Full Code of Shopify/dashing for AI

master bc1c106e42d5 cached
75 files
786.2 KB
227.2k tokens
769 symbols
1 requests
Download .txt
Showing preview only (818K chars total). Download the full file or copy to clipboard to get everything.
Repository: Shopify/dashing
Branch: master
Commit: bc1c106e42d5
Files: 75
Total size: 786.2 KB

Directory structure:
gitextract_5ra_d6aq/

├── .gitignore
├── .travis.yml
├── CONTRIBUTING.md
├── Gemfile
├── MIT-LICENSE
├── README.md
├── Rakefile
├── bin/
│   └── dashing
├── dashing.gemspec
├── javascripts/
│   ├── batman.jquery.js
│   ├── batman.js
│   ├── dashing.coffee
│   ├── es5-shim.js
│   └── jquery.js
├── lib/
│   ├── dashing/
│   │   ├── app.rb
│   │   ├── cli.rb
│   │   └── downloader.rb
│   └── dashing.rb
├── shipit.rubygems.yml
├── templates/
│   ├── dashboard/
│   │   └── %name%.erb.tt
│   ├── job/
│   │   └── %name%.rb
│   ├── project/
│   │   ├── .gitignore
│   │   ├── Gemfile
│   │   ├── README.md
│   │   ├── assets/
│   │   │   ├── fonts/
│   │   │   │   └── FontAwesome.otf
│   │   │   ├── javascripts/
│   │   │   │   ├── application.coffee
│   │   │   │   ├── d3-3.2.8.js
│   │   │   │   ├── dashing.gridster.coffee
│   │   │   │   └── jquery.knob.js
│   │   │   └── stylesheets/
│   │   │       ├── application.scss
│   │   │       └── font-awesome.css
│   │   ├── config.ru
│   │   ├── dashboards/
│   │   │   ├── layout.erb
│   │   │   ├── sample.erb
│   │   │   └── sampletv.erb
│   │   ├── jobs/
│   │   │   ├── buzzwords.rb
│   │   │   ├── convergence.rb
│   │   │   ├── sample.rb
│   │   │   └── twitter.rb
│   │   ├── lib/
│   │   │   └── .empty_directory
│   │   ├── public/
│   │   │   └── 404.html
│   │   └── widgets/
│   │       ├── clock/
│   │       │   ├── clock.coffee
│   │       │   ├── clock.html
│   │       │   └── clock.scss
│   │       ├── comments/
│   │       │   ├── comments.coffee
│   │       │   ├── comments.html
│   │       │   └── comments.scss
│   │       ├── graph/
│   │       │   ├── graph.coffee
│   │       │   ├── graph.html
│   │       │   └── graph.scss
│   │       ├── iframe/
│   │       │   ├── iframe.coffee
│   │       │   ├── iframe.html
│   │       │   └── iframe.scss
│   │       ├── image/
│   │       │   ├── image.coffee
│   │       │   ├── image.html
│   │       │   └── image.scss
│   │       ├── list/
│   │       │   ├── list.coffee
│   │       │   ├── list.html
│   │       │   └── list.scss
│   │       ├── meter/
│   │       │   ├── meter.coffee
│   │       │   ├── meter.html
│   │       │   └── meter.scss
│   │       ├── number/
│   │       │   ├── number.coffee
│   │       │   ├── number.html
│   │       │   └── number.scss
│   │       └── text/
│   │           ├── text.coffee
│   │           ├── text.html
│   │           └── text.scss
│   └── widget/
│       └── %name%/
│           ├── %name%.coffee.tt
│           ├── %name%.html
│           └── %name%.scss.tt
└── test/
    ├── app_test.rb
    ├── cli_test.rb
    ├── downloader_test.rb
    └── test_helper.rb

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
*DS_STORE
/Gemfile.lock
*.gem
coverage/
log/
tmp/
.ruby-version
history.yml


================================================
FILE: .travis.yml
================================================
language: ruby
rvm:
  - 2.3.0
  - 2.2.4
  - 2.1.8

script: "rake test"


================================================
FILE: CONTRIBUTING.md
================================================
<a name="issues"></a>
## Have an Issue?

Dashing is no longer being actively maintained.

1. Check the [Troubleshooting Guide](https://github.com/Shopify/dashing/wiki#how-tos) in the wiki.
2. Use the [GitHub Issue Search](https://help.github.com/articles/searching-issues/) to check if the issue has already been reported.
3. You can ask your issue on the tracker, but your best bet is to go to [Stack Overflow](http://stackoverflow.com/questions/tagged/dashing)


<a name="features"></a>

If you feel that you have a really amazing, super neato idea that should be a part of Dashing, it may be a good candidate for an external Gem which supercharges a project. An excellent example of this is
[dashing-contrib](https://github.com/QubitProducts/dashing-contrib). If you
do create a third-party extension for Dashing, please add it [here](https://github.com/Shopify/dashing/wiki/Additional-Widgets#other-third-party-tools).



================================================
FILE: Gemfile
================================================
source 'https://rubygems.org'

gemspec

================================================
FILE: MIT-LICENSE
================================================
Copyright (c) 2016 Shopify

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.


================================================
FILE: README.md
================================================
# [Dashing](http://shopify.github.com/dashing)
[![Build Status](https://secure.travis-ci.org/Shopify/dashing.png?branch=master)](http://travis-ci.org/Shopify/dashing)

Dashing is a Sinatra based framework that lets you build beautiful dashboards. It looks especially great on TVs.

[Check out the homepage](http://shopify.github.com/dashing).

Note: Dashing is no longer being actively maintained. Read about it [here](https://github.com/Shopify/dashing/issues/711). There is a fork of the project being maintained at at [https://github.com/dashing-io/dashing](https://github.com/dashing-io/dashing)

# License
Distributed under the [MIT license](MIT-LICENSE)


================================================
FILE: Rakefile
================================================
require 'rubygems'
require 'rake'
require 'bundler/gem_tasks'

require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
  test.libs << 'lib' << 'test'
  test.pattern = 'test/**/*_test.rb'
end

task :default => [:test]


================================================
FILE: bin/dashing
================================================
#!/usr/bin/env ruby
require "pathname"
bin_file = Pathname.new(__FILE__).realpath
$:.unshift File.expand_path("../../lib", bin_file)

require 'dashing/cli'
require 'dashing/downloader'
Dashing::CLI.source_root(File.expand_path('../../templates', bin_file))
Dashing::CLI.start(ARGV)


================================================
FILE: dashing.gemspec
================================================
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
  s.name        = 'dashing'
  s.version     = '1.3.7'
  s.date        = '2016-04-11'
  s.executables = %w(dashing)


  s.summary     = "The exceptionally handsome dashboard framework."
  s.description = "This framework lets you build & easily layout dashboards with your own custom widgets. Use it to make a status boards for your ops team, or use it to track signups, conversion rates, or whatever else metrics you'd like to see in one spot. Included with the framework are ready-made widgets for you to use or customize. All of this code was extracted out of a project at Shopify that displays dashboards on TVs around the office."
  s.author      = "Daniel Beauchamp"
  s.email       = 'daniel.beauchamp@shopify.com'
  s.homepage    = 'http://shopify.github.com/dashing'
  s.license     = "MIT"

  s.files = Dir['README.md', 'javascripts/**/*', 'templates/**/*','templates/**/.[a-z]*', 'lib/**/*']

  s.add_dependency('sass', '~> 3.2.12')
  s.add_dependency('coffee-script', '~> 2.2.0')
  s.add_dependency('execjs', '~> 2.0.2')
  s.add_dependency('sinatra', '~> 1.4.4')
  s.add_dependency('sinatra-contrib', '~> 1.4.2')
  s.add_dependency('thin', '~> 1.6.1')
  s.add_dependency('rufus-scheduler', '~> 2.0.24')
  s.add_dependency('thor', '> 0.18.1')
  s.add_dependency('sprockets', '~> 2.10.1')
  s.add_dependency('rack', '~> 1.5.4')

  s.add_development_dependency('rake', '~> 10.1.0')
  s.add_development_dependency('haml', '~> 4.0.4')
  s.add_development_dependency('minitest', '~> 5.2.0')
  s.add_development_dependency('mocha', '~> 0.14.0')
  s.add_development_dependency('fakeweb', '~> 1.3.0')
  s.add_development_dependency('simplecov', '~> 0.8.2')
end


================================================
FILE: javascripts/batman.jquery.js
================================================
(function() {

  Batman.extend(Batman.DOM, {
    querySelectorAll: function(node, selector) {
      return jQuery(selector, node);
    },
    querySelector: function(node, selector) {
      return jQuery(selector, node)[0];
    },
    setInnerHTML: function(node, html) {
      var child, childNodes, result, _i, _j, _len, _len1;
      childNodes = (function() {
        var _i, _len, _ref, _results;
        _ref = node.childNodes;
        _results = [];
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          child = _ref[_i];
          _results.push(child);
        }
        return _results;
      })();
      for (_i = 0, _len = childNodes.length; _i < _len; _i++) {
        child = childNodes[_i];
        Batman.DOM.willRemoveNode(child);
      }
      result = jQuery(node).html(html);
      for (_j = 0, _len1 = childNodes.length; _j < _len1; _j++) {
        child = childNodes[_j];
        Batman.DOM.didRemoveNode(child);
      }
      return result;
    },
    removeNode: function(node) {
      var _ref;
      Batman.DOM.willRemoveNode(node);
      if ((_ref = node.parentNode) != null) {
        _ref.removeChild(node);
      }
      return Batman.DOM.didRemoveNode(node);
    },
    destroyNode: function(node) {
      Batman.DOM.willDestroyNode(node);
      Batman.DOM.willRemoveNode(node);
      jQuery(node).remove();
      Batman.DOM.didRemoveNode(node);
      return Batman.DOM.didDestroyNode(node);
    },
    appendChild: function(parent, child) {
      Batman.DOM.willInsertNode(child);
      jQuery(parent).append(child);
      return Batman.DOM.didInsertNode(child);
    },
    innerText: function(node) {
      return jQuery(node).text();
    }
  });

  Batman.Request.prototype._parseResponseHeaders = function(xhr) {
    var headers;
    return headers = xhr.getAllResponseHeaders().split('\n').reduce(function(acc, header) {
      var key, matches, value;
      if (matches = header.match(/([^:]*):\s*(.*)/)) {
        key = matches[1];
        value = matches[2];
        acc[key] = value;
      }
      return acc;
    }, {});
  };

  Batman.Request.prototype._prepareOptions = function(data) {
    var options, _ref, _this = this;
    options = {
      url: this.get('url'),
      type: this.get('method'),
      dataType: this.get('type'),
      data: data || this.get('data'),
      username: this.get('username'),
      password: this.get('password'),
      headers: this.get('headers'),
      beforeSend: function() {
        return _this.fire('loading');
      },
      success: function(response, textStatus, xhr) {
        _this.mixin({
          xhr: xhr,
          status: xhr.status,
          response: response,
          responseHeaders: _this._parseResponseHeaders(xhr)
        });
        return _this.fire('success', response);
      },
      error: function(xhr, status, error) {
        _this.mixin({
          xhr: xhr,
          status: xhr.status,
          response: xhr.responseText,
          responseHeaders: _this._parseResponseHeaders(xhr)
        });
        xhr.request = _this;
        return _this.fire('error', xhr);
      },
      complete: function() {
        return _this.fire('loaded');
      }
    };
    if ((_ref = this.get('method')) === 'PUT' || _ref === 'POST') {
      if (!this.hasFileUploads()) {
        options.contentType = this.get('contentType');
        if (typeof options.data === 'object') {
          options.processData = false;
          options.data = Batman.URI.queryFromParams(options.data);
        }
      } else {
        options.contentType = false;
        options.processData = false;
        options.data = this.constructor.objectToFormData(options.data);
      }
    }
    return options;
  };

  Batman.Request.prototype.send = function(data) {
    return jQuery.ajax(this._prepareOptions(data));
  };

  Batman.mixins.animation = {
    show: function(addToParent) {
      var jq, show, _ref, _ref1;
      jq = $(this);
      show = function() {
        return jq.show(600);
      };
      if (addToParent) {
        if ((_ref = addToParent.append) != null) {
          _ref.appendChild(this);
        }
        if ((_ref1 = addToParent.before) != null) {
          _ref1.parentNode.insertBefore(this, addToParent.before);
        }
        jq.hide();
        setTimeout(show, 0);
      } else {
        show();
      }
      return this;
    },
    hide: function(removeFromParent) {
      var _this = this;
      $(this).hide(600, function() {
        var _ref;
        if (removeFromParent) {
          if ((_ref = _this.parentNode) != null) {
            _ref.removeChild(_this);
          }
        }
        return Batman.DOM.didRemoveNode(_this);
      });
      return this;
    }
  };

}).call(this);

================================================
FILE: javascripts/batman.js
================================================
(function() {
  var Batman, __slice = [].slice;

  Batman = function() {
    var mixins;
    mixins = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
    return (function(func, args, ctor) {
      ctor.prototype = func.prototype;
      var child = new ctor,
        result = func.apply(child, args),
        t = typeof result;
      return t == "object" || t == "function" ? result || child : child;
    })(Batman.Object, mixins, function() {});
  };

  Batman.version = '0.14.1';

  Batman.config = {
    pathPrefix: '/',
    viewPrefix: 'views',
    fetchRemoteViews: true,
    usePushState: false,
    minificationErrors: true
  };

  (Batman.container = (function() {
    return this;
  })()).Batman = Batman;

  if (typeof define === 'function') {
    define('batman', [], function() {
      return Batman;
    });
  }

  Batman.exportHelpers = function(onto) {
    var k, _i, _len, _ref;
    _ref = ['mixin', 'extend', 'unmixin', 'redirect', 'typeOf', 'redirect', 'setImmediate', 'clearImmediate'];
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
      k = _ref[_i];
      onto["$" + k] = Batman[k];
    }
    return onto;
  };

  Batman.exportGlobals = function() {
    return Batman.exportHelpers(Batman.container);
  };

}).call(this);

(function() {
  var _Batman;

  Batman._Batman = _Batman = (function() {

    function _Batman(object) {
      this.object = object;
    }

    _Batman.prototype.check = function(object) {
      if (object !== this.object) {
        object._batman = new Batman._Batman(object);
        return false;
      }
      return true;
    };

    _Batman.prototype.get = function(key) {
      var reduction, results;
      results = this.getAll(key);
      switch (results.length) {
      case 0:
        return void 0;
      case 1:
        return results[0];
      default:
        reduction = results[0].concat != null ?
        function(a, b) {
          return a.concat(b);
        } : results[0].merge != null ?
        function(a, b) {
          return a.merge(b);
        } : results.every(function(x) {
          return typeof x === 'object';
        }) ? (results.unshift({}), function(a, b) {
          return Batman.extend(a, b);
        }) : void 0;
        if (reduction) {
          return results.reduceRight(reduction);
        } else {
          return results;
        }
      }
    };

    _Batman.prototype.getFirst = function(key) {
      var results;
      results = this.getAll(key);
      return results[0];
    };

    _Batman.prototype.getAll = function(keyOrGetter) {
      var getter, results, val;
      if (typeof keyOrGetter === 'function') {
        getter = keyOrGetter;
      } else {
        getter = function(ancestor) {
          var _ref;
          return (_ref = ancestor._batman) != null ? _ref[keyOrGetter] : void 0;
        };
      }
      results = this.ancestors(getter);
      if (val = getter(this.object)) {
        results.unshift(val);
      }
      return results;
    };

    _Batman.prototype.ancestors = function(getter) {
      var ancestor, results, val, _i, _len, _ref;
      this._allAncestors || (this._allAncestors = this.allAncestors());
      if (getter) {
        results = [];
        _ref = this._allAncestors;
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          ancestor = _ref[_i];
          val = getter(ancestor);
          if (val != null) {
            results.push(val);
          }
        }
        return results;
      } else {
        return this._allAncestors;
      }
    };

    _Batman.prototype.allAncestors = function() {
      var isClass, parent, proto, results, _ref, _ref1;
      results = [];
      isClass = !! this.object.prototype;
      parent = isClass ? (_ref = this.object.__super__) != null ? _ref.constructor : void 0 : (proto = Object.getPrototypeOf(this.object)) === this.object ? this.object.constructor.__super__ : proto;
      if (parent != null) {
        if ((_ref1 = parent._batman) != null) {
          _ref1.check(parent);
        }
        results.push(parent);
        if (parent._batman != null) {
          results = results.concat(parent._batman.allAncestors());
        }
      }
      return results;
    };

    _Batman.prototype.set = function(key, value) {
      return this[key] = value;
    };

    return _Batman;

  })();

}).call(this);

(function() {
  var chr, _encodedChars, _encodedCharsPattern, _entityMap, _implementImmediates, _objectToString, _unsafeChars, _unsafeCharsPattern, __slice = [].slice,
    __hasProp = {}.hasOwnProperty,
    __indexOf = [].indexOf ||
  function(item) {
    for (var i = 0, l = this.length; i < l; i++) {
      if (i in this && this[i] === item) return i;
    }
    return -1;
  };

  Batman.typeOf = function(object) {
    if (typeof object === 'undefined') {
      return "Undefined";
    }
    return _objectToString.call(object).slice(8, -1);
  };

  _objectToString = Object.prototype.toString;

  Batman.extend = function() {
    var key, object, objects, to, value, _i, _len;
    to = arguments[0], objects = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
    for (_i = 0, _len = objects.length; _i < _len; _i++) {
      object = objects[_i];
      for (key in object) {
        value = object[key];
        to[key] = value;
      }
    }
    return to;
  };

  Batman.mixin = function() {
    var hasSet, key, mixin, mixins, to, value, _i, _len;
    to = arguments[0], mixins = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
    hasSet = typeof to.set === 'function';
    for (_i = 0, _len = mixins.length; _i < _len; _i++) {
      mixin = mixins[_i];
      if (Batman.typeOf(mixin) !== 'Object') {
        continue;
      }
      for (key in mixin) {
        if (!__hasProp.call(mixin, key)) continue;
        value = mixin[key];
        if (key === 'initialize' || key === 'uninitialize' || key === 'prototype') {
          continue;
        }
        if (hasSet) {
          to.set(key, value);
        } else if (to.nodeName != null) {
          Batman.data(to, key, value);
        } else {
          to[key] = value;
        }
      }
      if (typeof mixin.initialize === 'function') {
        mixin.initialize.call(to);
      }
    }
    return to;
  };

  Batman.unmixin = function() {
    var from, key, mixin, mixins, _i, _len;
    from = arguments[0], mixins = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
    for (_i = 0, _len = mixins.length; _i < _len; _i++) {
      mixin = mixins[_i];
      for (key in mixin) {
        if (key === 'initialize' || key === 'uninitialize') {
          continue;
        }
        delete from[key];
      }
      if (typeof mixin.uninitialize === 'function') {
        mixin.uninitialize.call(from);
      }
    }
    return from;
  };

  Batman._functionName = Batman.functionName = function(f) {
    var _ref;
    if (f.__name__) {
      return f.__name__;
    }
    if (f.name) {
      return f.name;
    }
    return (_ref = f.toString().match(/\W*function\s+([\w\$]+)\(/)) != null ? _ref[1] : void 0;
  };

  Batman._isChildOf = Batman.isChildOf = function(parentNode, childNode) {
    var node;
    node = childNode.parentNode;
    while (node) {
      if (node === parentNode) {
        return true;
      }
      node = node.parentNode;
    }
    return false;
  };

  _implementImmediates = function(container) {
    var canUsePostMessage, count, functions, getHandle, handler, prefix, tasks;
    canUsePostMessage = function() {
      var async, oldMessage;
      if (!container.postMessage) {
        return false;
      }
      async = true;
      oldMessage = container.onmessage;
      container.onmessage = function() {
        return async = false;
      };
      container.postMessage("", "*");
      container.onmessage = oldMessage;
      return async;
    };
    tasks = new Batman.SimpleHash;
    count = 0;
    getHandle = function() {
      return "go" + (++count);
    };
    if (container.setImmediate && container.clearImmediate) {
      Batman.setImmediate = container.setImmediate;
      return Batman.clearImmediate = container.clearImmediate;
    } else if (canUsePostMessage()) {
      prefix = 'com.batman.';
      functions = new Batman.SimpleHash;
      handler = function(e) {
        var handle, _base;
        if (!~e.data.search(prefix)) {
          return;
        }
        handle = e.data.substring(prefix.length);
        return typeof(_base = tasks.unset(handle)) === "function" ? _base() : void 0;
      };
      if (container.addEventListener) {
        container.addEventListener('message', handler, false);
      } else {
        container.attachEvent('onmessage', handler);
      }
      Batman.setImmediate = function(f) {
        var handle;
        tasks.set(handle = getHandle(), f);
        container.postMessage(prefix + handle, "*");
        return handle;
      };
      return Batman.clearImmediate = function(handle) {
        return tasks.unset(handle);
      };
    } else if (typeof document !== 'undefined' && __indexOf.call(document.createElement("script"), "onreadystatechange") >= 0) {
      Batman.setImmediate = function(f) {
        var handle, script;
        handle = getHandle();
        script = document.createElement("script");
        script.onreadystatechange = function() {
          var _base;
          if (typeof(_base = tasks.get(handle)) === "function") {
            _base();
          }
          script.onreadystatechange = null;
          script.parentNode.removeChild(script);
          return script = null;
        };
        document.documentElement.appendChild(script);
        return handle;
      };
      return Batman.clearImmediate = function(handle) {
        return tasks.unset(handle);
      };
    } else if (typeof process !== "undefined" && process !== null ? process.nextTick : void 0) {
      functions = {};
      Batman.setImmediate = function(f) {
        var handle;
        handle = getHandle();
        functions[handle] = f;
        process.nextTick(function() {
          if (typeof functions[handle] === "function") {
            functions[handle]();
          }
          return delete functions[handle];
        });
        return handle;
      };
      return Batman.clearImmediate = function(handle) {
        return delete functions[handle];
      };
    } else {
      Batman.setImmediate = function(f) {
        return setTimeout(f, 0);
      };
      return Batman.clearImmediate = function(handle) {
        return clearTimeout(handle);
      };
    }
  };

  Batman.setImmediate = function() {
    _implementImmediates(Batman.container);
    return Batman.setImmediate.apply(this, arguments);
  };

  Batman.clearImmediate = function() {
    _implementImmediates(Batman.container);
    return Batman.clearImmediate.apply(this, arguments);
  };

  Batman.forEach = function(container, iterator, ctx) {
    var e, i, k, v, _i, _len, _results, _results1;
    if (container.forEach) {
      return container.forEach(iterator, ctx);
    } else if (container.indexOf) {
      _results = [];
      for (i = _i = 0, _len = container.length; _i < _len; i = ++_i) {
        e = container[i];
        _results.push(iterator.call(ctx, e, i, container));
      }
      return _results;
    } else {
      _results1 = [];
      for (k in container) {
        v = container[k];
        _results1.push(iterator.call(ctx, k, v, container));
      }
      return _results1;
    }
  };

  Batman.objectHasKey = function(object, key) {
    if (typeof object.hasKey === 'function') {
      return object.hasKey(key);
    } else {
      return key in object;
    }
  };

  Batman.contains = function(container, item) {
    if (container.indexOf) {
      return __indexOf.call(container, item) >= 0;
    } else if (typeof container.has === 'function') {
      return container.has(item);
    } else {
      return Batman.objectHasKey(container, item);
    }
  };

  Batman.get = function(base, key) {
    if (typeof base.get === 'function') {
      return base.get(key);
    } else {
      return Batman.Property.forBaseAndKey(base, key).getValue();
    }
  };

  Batman.getPath = function(base, segments) {
    var segment, _i, _len;
    for (_i = 0, _len = segments.length; _i < _len; _i++) {
      segment = segments[_i];
      if (base != null) {
        base = Batman.get(base, segment);
        if (base == null) {
          return base;
        }
      } else {
        return void 0;
      }
    }
    return base;
  };

  _entityMap = {
    "&": "&amp;",
    "<": "&lt;",
    ">": "&gt;",
    "\"": "&#34;",
    "'": "&#39;"
  };

  _unsafeChars = [];

  _encodedChars = [];

  for (chr in _entityMap) {
    _unsafeChars.push(chr);
    _encodedChars.push(_entityMap[chr]);
  }

  _unsafeCharsPattern = new RegExp("[" + (_unsafeChars.join('')) + "]", "g");

  _encodedCharsPattern = new RegExp("(" + (_encodedChars.join('|')) + ")", "g");

  Batman.escapeHTML = (function() {
    return function(s) {
      return ("" + s).replace(_unsafeCharsPattern, function(c) {
        return _entityMap[c];
      });
    };
  })();

  Batman.unescapeHTML = (function() {
    return function(s) {
      var node;
      if (s == null) {
        return;
      }
      node = Batman._unescapeHTMLNode || (Batman._unescapeHTMLNode = document.createElement('DIV'));
      node.innerHTML = s;
      return Batman.DOM.innerText(node);
    };
  })();

  Batman.translate = function(x, values) {
    if (values == null) {
      values = {};
    }
    return Batman.helpers.interpolate(Batman.get(Batman.translate.messages, x), values);
  };

  Batman.translate.messages = {};

  Batman.t = function() {
    return Batman.translate.apply(Batman, arguments);
  };

  Batman.redirect = function(url) {
    var _ref;
    return (_ref = Batman.navigator) != null ? _ref.redirect(url) : void 0;
  };

  Batman.initializeObject = function(object) {
    if (object._batman != null) {
      return object._batman.check(object);
    } else {
      return object._batman = new Batman._Batman(object);
    }
  };

}).call(this);

(function() {
  var __slice = [].slice,
    __indexOf = [].indexOf ||
  function(item) {
    for (var i = 0, l = this.length; i < l; i++) {
      if (i in this && this[i] === item) return i;
    }
    return -1;
  };

  Batman.Inflector = (function() {

    Inflector.prototype.plural = function(regex, replacement) {
      return this._plural.unshift([regex, replacement]);
    };

    Inflector.prototype.singular = function(regex, replacement) {
      return this._singular.unshift([regex, replacement]);
    };

    Inflector.prototype.human = function(regex, replacement) {
      return this._human.unshift([regex, replacement]);
    };

    Inflector.prototype.uncountable = function() {
      var strings;
      strings = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
      return this._uncountable = this._uncountable.concat(strings.map(function(x) {
        return new RegExp("" + x + "$", 'i');
      }));
    };

    Inflector.prototype.irregular = function(singular, plural) {
      if (singular.charAt(0) === plural.charAt(0)) {
        this.plural(new RegExp("(" + (singular.charAt(0)) + ")" + (singular.slice(1)) + "$", "i"), "$1" + plural.slice(1));
        this.plural(new RegExp("(" + (singular.charAt(0)) + ")" + (plural.slice(1)) + "$", "i"), "$1" + plural.slice(1));
        return this.singular(new RegExp("(" + (plural.charAt(0)) + ")" + (plural.slice(1)) + "$", "i"), "$1" + singular.slice(1));
      } else {
        this.plural(new RegExp("" + singular + "$", 'i'), plural);
        this.plural(new RegExp("" + plural + "$", 'i'), plural);
        return this.singular(new RegExp("" + plural + "$", 'i'), singular);
      }
    };

    function Inflector() {
      this._plural = [];
      this._singular = [];
      this._uncountable = [];
      this._human = [];
    }

    Inflector.prototype.ordinalize = function(number) {
      var absNumber, _ref;
      absNumber = Math.abs(parseInt(number));
      if (_ref = absNumber % 100, __indexOf.call([11, 12, 13], _ref) >= 0) {
        return number + "th";
      } else {
        switch (absNumber % 10) {
        case 1:
          return number + "st";
        case 2:
          return number + "nd";
        case 3:
          return number + "rd";
        default:
          return number + "th";
        }
      }
    };

    Inflector.prototype.pluralize = function(word) {
      var regex, replace_string, uncountableRegex, _i, _j, _len, _len1, _ref, _ref1, _ref2;
      _ref = this._uncountable;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        uncountableRegex = _ref[_i];
        if (uncountableRegex.test(word)) {
          return word;
        }
      }
      _ref1 = this._plural;
      for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
        _ref2 = _ref1[_j], regex = _ref2[0], replace_string = _ref2[1];
        if (regex.test(word)) {
          return word.replace(regex, replace_string);
        }
      }
      return word;
    };

    Inflector.prototype.singularize = function(word) {
      var regex, replace_string, uncountableRegex, _i, _j, _len, _len1, _ref, _ref1, _ref2;
      _ref = this._uncountable;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        uncountableRegex = _ref[_i];
        if (uncountableRegex.test(word)) {
          return word;
        }
      }
      _ref1 = this._singular;
      for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
        _ref2 = _ref1[_j], regex = _ref2[0], replace_string = _ref2[1];
        if (regex.test(word)) {
          return word.replace(regex, replace_string);
        }
      }
      return word;
    };

    Inflector.prototype.humanize = function(word) {
      var regex, replace_string, _i, _len, _ref, _ref1;
      _ref = this._human;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        _ref1 = _ref[_i], regex = _ref1[0], replace_string = _ref1[1];
        if (regex.test(word)) {
          return word.replace(regex, replace_string);
        }
      }
      return word;
    };

    return Inflector;

  })();

}).call(this);

(function() {
  var Inflector, camelize_rx, capitalize_rx, humanize_rx1, humanize_rx2, humanize_rx3, underscore_rx1, underscore_rx2;

  camelize_rx = /(?:^|_|\-)(.)/g;

  capitalize_rx = /(^|\s)([a-z])/g;

  underscore_rx1 = /([A-Z]+)([A-Z][a-z])/g;

  underscore_rx2 = /([a-z\d])([A-Z])/g;

  humanize_rx1 = /_id$/;

  humanize_rx2 = /_|-/g;

  humanize_rx3 = /^\w/g;

  Batman.helpers = {
    ordinalize: function() {
      return Batman.helpers.inflector.ordinalize.apply(Batman.helpers.inflector, arguments);
    },
    singularize: function() {
      return Batman.helpers.inflector.singularize.apply(Batman.helpers.inflector, arguments);
    },
    pluralize: function(count, singular, plural, includeCount) {
      var result;
      if (includeCount == null) {
        includeCount = true;
      }
      if (arguments.length < 2) {
        return Batman.helpers.inflector.pluralize(count);
      } else {
        result = +count === 1 ? singular : plural || Batman.helpers.inflector.pluralize(singular);
        if (includeCount) {
          result = ("" + (count || 0) + " ") + result;
        }
        return result;
      }
    },
    camelize: function(string, firstLetterLower) {
      string = string.replace(camelize_rx, function(str, p1) {
        return p1.toUpperCase();
      });
      if (firstLetterLower) {
        return string.substr(0, 1).toLowerCase() + string.substr(1);
      } else {
        return string;
      }
    },
    underscore: function(string) {
      return string.replace(underscore_rx1, '$1_$2').replace(underscore_rx2, '$1_$2').replace('-', '_').toLowerCase();
    },
    capitalize: function(string) {
      return string.replace(capitalize_rx, function(m, p1, p2) {
        return p1 + p2.toUpperCase();
      });
    },
    trim: function(string) {
      if (string) {
        return string.trim();
      } else {
        return "";
      }
    },
    interpolate: function(stringOrObject, keys) {
      var key, string, value;
      if (typeof stringOrObject === 'object') {
        string = stringOrObject[keys.count];
        if (!string) {
          string = stringOrObject['other'];
        }
      } else {
        string = stringOrObject;
      }
      for (key in keys) {
        value = keys[key];
        string = string.replace(new RegExp("%\\{" + key + "\\}", "g"), value);
      }
      return string;
    },
    humanize: function(string) {
      string = Batman.helpers.underscore(string);
      string = Batman.helpers.inflector.humanize(string);
      return string.replace(humanize_rx1, '').replace(humanize_rx2, ' ').replace(humanize_rx3, function(match) {
        return match.toUpperCase();
      });
    }
  };

  Inflector = new Batman.Inflector;

  Batman.helpers.inflector = Inflector;

  Inflector.plural(/$/, 's');

  Inflector.plural(/s$/i, 's');

  Inflector.plural(/(ax|test)is$/i, '$1es');

  Inflector.plural(/(octop|vir)us$/i, '$1i');

  Inflector.plural(/(octop|vir)i$/i, '$1i');

  Inflector.plural(/(alias|status)$/i, '$1es');

  Inflector.plural(/(bu)s$/i, '$1ses');

  Inflector.plural(/(buffal|tomat)o$/i, '$1oes');

  Inflector.plural(/([ti])um$/i, '$1a');

  Inflector.plural(/([ti])a$/i, '$1a');

  Inflector.plural(/sis$/i, 'ses');

  Inflector.plural(/(?:([^f])fe|([lr])f)$/i, '$1$2ves');

  Inflector.plural(/(hive)$/i, '$1s');

  Inflector.plural(/([^aeiouy]|qu)y$/i, '$1ies');

  Inflector.plural(/(x|ch|ss|sh)$/i, '$1es');

  Inflector.plural(/(matr|vert|ind)(?:ix|ex)$/i, '$1ices');

  Inflector.plural(/([m|l])ouse$/i, '$1ice');

  Inflector.plural(/([m|l])ice$/i, '$1ice');

  Inflector.plural(/^(ox)$/i, '$1en');

  Inflector.plural(/^(oxen)$/i, '$1');

  Inflector.plural(/(quiz)$/i, '$1zes');

  Inflector.singular(/s$/i, '');

  Inflector.singular(/(n)ews$/i, '$1ews');

  Inflector.singular(/([ti])a$/i, '$1um');

  Inflector.singular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i, '$1$2sis');

  Inflector.singular(/(^analy)ses$/i, '$1sis');

  Inflector.singular(/([^f])ves$/i, '$1fe');

  Inflector.singular(/(hive)s$/i, '$1');

  Inflector.singular(/(tive)s$/i, '$1');

  Inflector.singular(/([lr])ves$/i, '$1f');

  Inflector.singular(/([^aeiouy]|qu)ies$/i, '$1y');

  Inflector.singular(/(s)eries$/i, '$1eries');

  Inflector.singular(/(m)ovies$/i, '$1ovie');

  Inflector.singular(/(x|ch|ss|sh)es$/i, '$1');

  Inflector.singular(/([m|l])ice$/i, '$1ouse');

  Inflector.singular(/(bus)es$/i, '$1');

  Inflector.singular(/(o)es$/i, '$1');

  Inflector.singular(/(shoe)s$/i, '$1');

  Inflector.singular(/(cris|ax|test)es$/i, '$1is');

  Inflector.singular(/(octop|vir)i$/i, '$1us');

  Inflector.singular(/(alias|status)es$/i, '$1');

  Inflector.singular(/^(ox)en/i, '$1');

  Inflector.singular(/(vert|ind)ices$/i, '$1ex');

  Inflector.singular(/(matr)ices$/i, '$1ix');

  Inflector.singular(/(quiz)zes$/i, '$1');

  Inflector.singular(/(database)s$/i, '$1');

  Inflector.irregular('person', 'people');

  Inflector.irregular('man', 'men');

  Inflector.irregular('child', 'children');

  Inflector.irregular('sex', 'sexes');

  Inflector.irregular('move', 'moves');

  Inflector.irregular('cow', 'kine');

  Inflector.irregular('zombie', 'zombies');

  Inflector.uncountable('equipment', 'information', 'rice', 'money', 'species', 'series', 'fish', 'sheep', 'jeans');

}).call(this);

(function() {
  var developer;

  Batman.developer = {
    suppressed: false,
    DevelopmentError: (function() {
      var DevelopmentError;
      DevelopmentError = function(message) {
        this.message = message;
        return this.name = "DevelopmentError";
      };
      DevelopmentError.prototype = Error.prototype;
      return DevelopmentError;
    })(),
    _ie_console: function(f, args) {
      var arg, _i, _len, _results;
      if (args.length !== 1) {
        if (typeof console !== "undefined" && console !== null) {
          console[f]("..." + f + " of " + args.length + " items...");
        }
      }
      _results = [];
      for (_i = 0, _len = args.length; _i < _len; _i++) {
        arg = args[_i];
        _results.push(typeof console !== "undefined" && console !== null ? console[f](arg) : void 0);
      }
      return _results;
    },
    suppress: function(f) {
      developer.suppressed = true;
      if (f) {
        f();
        return developer.suppressed = false;
      }
    },
    unsuppress: function() {
      return developer.suppressed = false;
    },
    log: function() {
      if (developer.suppressed || !((typeof console !== "undefined" && console !== null ? console.log : void 0) != null)) {
        return;
      }
      if (console.log.apply) {
        return console.log.apply(console, arguments);
      } else {
        return developer._ie_console("log", arguments);
      }
    },
    warn: function() {
      if (developer.suppressed || !((typeof console !== "undefined" && console !== null ? console.warn : void 0) != null)) {
        return;
      }
      if (console.warn.apply) {
        return console.warn.apply(console, arguments);
      } else {
        return developer._ie_console("warn", arguments);
      }
    },
    error: function(message) {
      throw new developer.DevelopmentError(message);
    },
    assert: function(result, message) {
      if (!result) {
        return developer.error(message);
      }
    },
    "do": function(f) {
      if (!developer.suppressed) {
        return f();
      }
    },
    addFilters: function() {
      return Batman.extend(Batman.Filters, {
        log: function(value, key) {
          if (typeof console !== "undefined" && console !== null) {
            if (typeof console.log === "function") {
              console.log(arguments);
            }
          }
          return value;
        },
        logStack: function(value) {
          if (typeof console !== "undefined" && console !== null) {
            if (typeof console.log === "function") {
              console.log(developer.currentFilterStack);
            }
          }
          return value;
        }
      });
    },
    deprecated: function(deprecatedName, upgradeString) {
      return Batman.developer.warn("" + deprecatedName + " has been deprecated.", upgradeString || '');
    }
  };

  developer = Batman.developer;

  Batman.developer.assert((function() {}).bind, "Error! Batman needs Function.bind to work! Please shim it using something like es5-shim or augmentjs!");

}).call(this);

(function() {

  Batman.Event = (function() {

    Event.forBaseAndKey = function(base, key) {
      if (base.isEventEmitter) {
        return base.event(key);
      } else {
        return new Batman.Event(base, key);
      }
    };

    function Event(base, key) {
      this.base = base;
      this.key = key;
      this._preventCount = 0;
    }

    Event.prototype.isEvent = true;

    Event.prototype.isEqual = function(other) {
      return this.constructor === other.constructor && this.base === other.base && this.key === other.key;
    };

    Event.prototype.hashKey = function() {
      var key;
      this.hashKey = function() {
        return key;
      };
      return key = "<Batman.Event base: " + (Batman.Hash.prototype.hashKeyFor(this.base)) + ", key: \"" + (Batman.Hash.prototype.hashKeyFor(this.key)) + "\">";
    };

    Event.prototype.addHandler = function(handler) {
      this.handlers || (this.handlers = []);
      if (this.handlers.indexOf(handler) === -1) {
        this.handlers.push(handler);
      }
      if (this.oneShot) {
        this.autofireHandler(handler);
      }
      return this;
    };

    Event.prototype.removeHandler = function(handler) {
      var index;
      if (this.handlers && (index = this.handlers.indexOf(handler)) !== -1) {
        this.handlers.splice(index, 1);
      }
      return this;
    };

    Event.prototype.eachHandler = function(iterator) {
      var ancestor, key, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _results;
      if ((_ref = this.handlers) != null) {
        _ref.slice().forEach(iterator);
      }
      if ((_ref1 = this.base) != null ? _ref1.isEventEmitter : void 0) {
        key = this.key;
        _ref3 = (_ref2 = this.base._batman) != null ? _ref2.ancestors() : void 0;
        _results = [];
        for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
          ancestor = _ref3[_i];
          if (ancestor.isEventEmitter && ((_ref4 = ancestor._batman) != null ? (_ref5 = _ref4.events) != null ? _ref5.hasOwnProperty(key) : void 0 : void 0)) {
            _results.push((_ref6 = ancestor.event(key, false)) != null ? (_ref7 = _ref6.handlers) != null ? _ref7.slice().forEach(iterator) : void 0 : void 0);
          } else {
            _results.push(void 0);
          }
        }
        return _results;
      }
    };

    Event.prototype.clearHandlers = function() {
      return this.handlers = void 0;
    };

    Event.prototype.handlerContext = function() {
      return this.base;
    };

    Event.prototype.prevent = function() {
      return ++this._preventCount;
    };

    Event.prototype.allow = function() {
      if (this._preventCount) {
        --this._preventCount;
      }
      return this._preventCount;
    };

    Event.prototype.isPrevented = function() {
      return this._preventCount > 0;
    };

    Event.prototype.autofireHandler = function(handler) {
      if (this._oneShotFired && (this._oneShotArgs != null)) {
        return handler.apply(this.handlerContext(), this._oneShotArgs);
      }
    };

    Event.prototype.resetOneShot = function() {
      this._oneShotFired = false;
      return this._oneShotArgs = null;
    };

    Event.prototype.fire = function() {
      return this.fireWithContext(this.handlerContext(), arguments);
    };

    Event.prototype.fireWithContext = function(context, args) {
      if (this.isPrevented() || this._oneShotFired) {
        return false;
      }
      if (this.oneShot) {
        this._oneShotFired = true;
        this._oneShotArgs = args;
      }
      return this.eachHandler(function(handler) {
        return handler.apply(context, args);
      });
    };

    Event.prototype.allowAndFire = function() {
      return this.allowAndFireWithContext(this.handlerContext, arguments);
    };

    Event.prototype.allowAndFireWithContext = function(context, args) {
      this.allow();
      return this.fireWithContext(context, args);
    };

    return Event;

  })();

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.PropertyEvent = (function(_super) {

    __extends(PropertyEvent, _super);

    function PropertyEvent() {
      return PropertyEvent.__super__.constructor.apply(this, arguments);
    }

    PropertyEvent.prototype.eachHandler = function(iterator) {
      return this.base.eachObserver(iterator);
    };

    PropertyEvent.prototype.handlerContext = function() {
      return this.base.base;
    };

    return PropertyEvent;

  })(Batman.Event);

}).call(this);

(function() {
  var __slice = [].slice;

  Batman.EventEmitter = {
    isEventEmitter: true,
    hasEvent: function(key) {
      var _ref, _ref1;
      return (_ref = this._batman) != null ? typeof _ref.get === "function" ? (_ref1 = _ref.get('events')) != null ? _ref1.hasOwnProperty(key) : void 0 : void 0 : void 0;
    },
    event: function(key, createEvent) {
      var ancestor, eventClass, events, existingEvent, newEvent, _base, _i, _len, _ref, _ref1, _ref2, _ref3;
      if (createEvent == null) {
        createEvent = true;
      }
      Batman.initializeObject(this);
      eventClass = this.eventClass || Batman.Event;
      if ((_ref = this._batman.events) != null ? _ref.hasOwnProperty(key) : void 0) {
        return existingEvent = this._batman.events[key];
      } else {
        _ref1 = this._batman.ancestors();
        for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
          ancestor = _ref1[_i];
          existingEvent = (_ref2 = ancestor._batman) != null ? (_ref3 = _ref2.events) != null ? _ref3[key] : void 0 : void 0;
          if (existingEvent) {
            break;
          }
        }
        if (createEvent || (existingEvent != null ? existingEvent.oneShot : void 0)) {
          events = (_base = this._batman).events || (_base.events = {});
          newEvent = events[key] = new eventClass(this, key);
          newEvent.oneShot = existingEvent != null ? existingEvent.oneShot : void 0;
          return newEvent;
        } else {
          return existingEvent;
        }
      }
    },
    on: function() {
      var handler, key, keys, _i, _j, _len, _results;
      keys = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), handler = arguments[_i++];
      _results = [];
      for (_j = 0, _len = keys.length; _j < _len; _j++) {
        key = keys[_j];
        _results.push(this.event(key).addHandler(handler));
      }
      return _results;
    },
    once: function(key, handler) {
      var event, handlerWrapper;
      event = this.event(key);
      handlerWrapper = function() {
        handler.apply(this, arguments);
        return event.removeHandler(handlerWrapper);
      };
      return event.addHandler(handlerWrapper);
    },
    registerAsMutableSource: function() {
      return Batman.Property.registerSource(this);
    },
    mutation: function(wrappedFunction) {
      return function() {
        var result, _ref;
        result = wrappedFunction.apply(this, arguments);
        if ((_ref = this.event('change', false)) != null) {
          _ref.fire(this, this);
        }
        return result;
      };
    },
    prevent: function(key) {
      this.event(key).prevent();
      return this;
    },
    allow: function(key) {
      this.event(key).allow();
      return this;
    },
    isPrevented: function(key) {
      var _ref;
      return (_ref = this.event(key, false)) != null ? _ref.isPrevented() : void 0;
    },
    fire: function() {
      var args, key, _ref;
      key = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
      return (_ref = this.event(key, false)) != null ? _ref.fireWithContext(this, args) : void 0;
    },
    allowAndFire: function() {
      var args, key, _ref;
      key = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
      return (_ref = this.event(key, false)) != null ? _ref.allowAndFireWithContext(this, args) : void 0;
    }
  };

}).call(this);

(function() {
  var __slice = [].slice;

  Batman.Enumerable = {
    isEnumerable: true,
    map: function(f, ctx) {
      var result;
      if (ctx == null) {
        ctx = Batman.container;
      }
      result = [];
      this.forEach(function() {
        return result.push(f.apply(ctx, arguments));
      });
      return result;
    },
    mapToProperty: function(key) {
      var result;
      result = [];
      this.forEach(function(item) {
        return result.push(item.get(key));
      });
      return result;
    },
    every: function(f, ctx) {
      var result;
      if (ctx == null) {
        ctx = Batman.container;
      }
      result = true;
      this.forEach(function() {
        return result = result && f.apply(ctx, arguments);
      });
      return result;
    },
    some: function(f, ctx) {
      var result;
      if (ctx == null) {
        ctx = Batman.container;
      }
      result = false;
      this.forEach(function() {
        return result = result || f.apply(ctx, arguments);
      });
      return result;
    },
    reduce: function(f, accumulator) {
      var count, initialValuePassed, self;
      count = 0;
      self = this;
      if (accumulator != null) {
        initialValuePassed = true;
      } else {
        initialValuePassed = false;
      }
      this.forEach(function() {
        if (!initialValuePassed) {
          accumulator = arguments[0];
          initialValuePassed = true;
          return;
        }
        return accumulator = f.apply(null, [accumulator].concat(__slice.call(arguments), [count], [self]));
      });
      return accumulator;
    },
    filter: function(f) {
      var result, wrap;
      result = new this.constructor;
      if (result.add) {
        wrap = function(result, element) {
          if (f(element)) {
            result.add(element);
          }
          return result;
        };
      } else if (result.set) {
        wrap = function(result, key, value) {
          if (f(key, value)) {
            result.set(key, value);
          }
          return result;
        };
      } else {
        if (!result.push) {
          result = [];
        }
        wrap = function(result, element) {
          if (f(element)) {
            result.push(element);
          }
          return result;
        };
      }
      return this.reduce(wrap, result);
    },
    inGroupsOf: function(groupSize) {
      var current, i, result;
      result = [];
      current = false;
      i = 0;
      this.forEach(function(element) {
        if (i++ % groupSize === 0) {
          current = [];
          result.push(current);
        }
        return current.push(element);
      });
      return result;
    }
  };

}).call(this);

(function() {
  var _objectToString, __slice = [].slice;

  _objectToString = Object.prototype.toString;

  Batman.SimpleHash = (function() {

    function SimpleHash(obj) {
      this._storage = {};
      this.length = 0;
      if (obj != null) {
        this.update(obj);
      }
    }

    Batman.extend(SimpleHash.prototype, Batman.Enumerable);

    SimpleHash.prototype.hasKey = function(key) {
      var pair, pairs, _i, _len;
      if (this.objectKey(key)) {
        if (!this._objectStorage) {
          return false;
        }
        if (pairs = this._objectStorage[this.hashKeyFor(key)]) {
          for (_i = 0, _len = pairs.length; _i < _len; _i++) {
            pair = pairs[_i];
            if (this.equality(pair[0], key)) {
              return true;
            }
          }
        }
        return false;
      } else {
        key = this.prefixedKey(key);
        return this._storage.hasOwnProperty(key);
      }
    };

    SimpleHash.prototype.get = function(key) {
      var pair, pairs, _i, _len;
      if (this.objectKey(key)) {
        if (!this._objectStorage) {
          return void 0;
        }
        if (pairs = this._objectStorage[this.hashKeyFor(key)]) {
          for (_i = 0, _len = pairs.length; _i < _len; _i++) {
            pair = pairs[_i];
            if (this.equality(pair[0], key)) {
              return pair[1];
            }
          }
        }
      } else {
        return this._storage[this.prefixedKey(key)];
      }
    };

    SimpleHash.prototype.set = function(key, val) {
      var pair, pairs, _base, _i, _len, _name;
      if (this.objectKey(key)) {
        this._objectStorage || (this._objectStorage = {});
        pairs = (_base = this._objectStorage)[_name = this.hashKeyFor(key)] || (_base[_name] = []);
        for (_i = 0, _len = pairs.length; _i < _len; _i++) {
          pair = pairs[_i];
          if (this.equality(pair[0], key)) {
            return pair[1] = val;
          }
        }
        this.length++;
        pairs.push([key, val]);
        return val;
      } else {
        key = this.prefixedKey(key);
        if (this._storage[key] == null) {
          this.length++;
        }
        return this._storage[key] = val;
      }
    };

    SimpleHash.prototype.unset = function(key) {
      var hashKey, index, obj, pair, pairs, val, value, _i, _len, _ref;
      if (this.objectKey(key)) {
        if (!this._objectStorage) {
          return void 0;
        }
        hashKey = this.hashKeyFor(key);
        if (pairs = this._objectStorage[hashKey]) {
          for (index = _i = 0, _len = pairs.length; _i < _len; index = ++_i) {
            _ref = pairs[index], obj = _ref[0], value = _ref[1];
            if (this.equality(obj, key)) {
              pair = pairs.splice(index, 1);
              if (!pairs.length) {
                delete this._objectStorage[hashKey];
              }
              this.length--;
              return pair[0][1];
            }
          }
        }
      } else {
        key = this.prefixedKey(key);
        val = this._storage[key];
        if (this._storage[key] != null) {
          this.length--;
          delete this._storage[key];
        }
        return val;
      }
    };

    SimpleHash.prototype.getOrSet = function(key, valueFunction) {
      var currentValue;
      currentValue = this.get(key);
      if (!currentValue) {
        currentValue = valueFunction();
        this.set(key, currentValue);
      }
      return currentValue;
    };

    SimpleHash.prototype.prefixedKey = function(key) {
      return "_" + key;
    };

    SimpleHash.prototype.unprefixedKey = function(key) {
      return key.slice(1);
    };

    SimpleHash.prototype.hashKeyFor = function(obj) {
      var hashKey, typeString;
      if (hashKey = obj != null ? typeof obj.hashKey === "function" ? obj.hashKey() : void 0 : void 0) {
        return hashKey;
      } else {
        typeString = _objectToString.call(obj);
        if (typeString === "[object Array]") {
          return typeString;
        } else {
          return obj;
        }
      }
    };

    SimpleHash.prototype.equality = function(lhs, rhs) {
      if (lhs === rhs) {
        return true;
      }
      if (lhs !== lhs && rhs !== rhs) {
        return true;
      }
      if ((lhs != null ? typeof lhs.isEqual === "function" ? lhs.isEqual(rhs) : void 0 : void 0) && (rhs != null ? typeof rhs.isEqual === "function" ? rhs.isEqual(lhs) : void 0 : void 0)) {
        return true;
      }
      return false;
    };

    SimpleHash.prototype.objectKey = function(key) {
      return typeof key !== 'string';
    };

    SimpleHash.prototype.forEach = function(iterator, ctx) {
      var key, obj, results, value, values, _i, _len, _ref, _ref1, _ref2, _ref3;
      results = [];
      if (this._objectStorage) {
        _ref = this._objectStorage;
        for (key in _ref) {
          values = _ref[key];
          _ref1 = values.slice();
          for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
            _ref2 = _ref1[_i], obj = _ref2[0], value = _ref2[1];
            results.push(iterator.call(ctx, obj, value, this));
          }
        }
      }
      _ref3 = this._storage;
      for (key in _ref3) {
        value = _ref3[key];
        results.push(iterator.call(ctx, this.unprefixedKey(key), value, this));
      }
      return results;
    };

    SimpleHash.prototype.keys = function() {
      var result;
      result = [];
      Batman.SimpleHash.prototype.forEach.call(this, function(key) {
        return result.push(key);
      });
      return result;
    };

    SimpleHash.prototype.toArray = SimpleHash.prototype.keys;

    SimpleHash.prototype.clear = function() {
      this._storage = {};
      delete this._objectStorage;
      return this.length = 0;
    };

    SimpleHash.prototype.isEmpty = function() {
      return this.length === 0;
    };

    SimpleHash.prototype.merge = function() {
      var hash, merged, others, _i, _len;
      others = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
      merged = new this.constructor;
      others.unshift(this);
      for (_i = 0, _len = others.length; _i < _len; _i++) {
        hash = others[_i];
        hash.forEach(function(obj, value) {
          return merged.set(obj, value);
        });
      }
      return merged;
    };

    SimpleHash.prototype.update = function(object) {
      var k, v, _results;
      _results = [];
      for (k in object) {
        v = object[k];
        _results.push(this.set(k, v));
      }
      return _results;
    };

    SimpleHash.prototype.replace = function(object) {
      var _this = this;
      this.forEach(function(key, value) {
        if (!(key in object)) {
          return _this.unset(key);
        }
      });
      return this.update(object);
    };

    SimpleHash.prototype.toObject = function() {
      var key, obj, pair, value, _ref, _ref1;
      obj = {};
      _ref = this._storage;
      for (key in _ref) {
        value = _ref[key];
        obj[this.unprefixedKey(key)] = value;
      }
      if (this._objectStorage) {
        _ref1 = this._objectStorage;
        for (key in _ref1) {
          pair = _ref1[key];
          obj[key] = pair[0][1];
        }
      }
      return obj;
    };

    SimpleHash.prototype.toJSON = SimpleHash.prototype.toObject;

    return SimpleHash;

  })();

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    },
    __slice = [].slice;

  Batman.AssociationCurator = (function(_super) {

    __extends(AssociationCurator, _super);

    AssociationCurator.availableAssociations = ['belongsTo', 'hasOne', 'hasMany'];

    function AssociationCurator(model) {
      this.model = model;
      AssociationCurator.__super__.constructor.call(this);
      this._byTypeStorage = new Batman.SimpleHash;
    }

    AssociationCurator.prototype.add = function(association) {
      var associationTypeSet;
      this.set(association.label, association);
      if (!(associationTypeSet = this._byTypeStorage.get(association.associationType))) {
        associationTypeSet = new Batman.SimpleSet;
        this._byTypeStorage.set(association.associationType, associationTypeSet);
      }
      return associationTypeSet.add(association);
    };

    AssociationCurator.prototype.getByType = function(type) {
      return this._byTypeStorage.get(type);
    };

    AssociationCurator.prototype.getByLabel = function(label) {
      return this.get(label);
    };

    AssociationCurator.prototype.reset = function() {
      this.forEach(function(label, association) {
        return association.reset();
      });
      return true;
    };

    AssociationCurator.prototype.merge = function() {
      var others, result;
      others = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
      result = AssociationCurator.__super__.merge.apply(this, arguments);
      result._byTypeStorage = this._byTypeStorage.merge(others.map(function(other) {
        return other._byTypeStorage;
      }));
      return result;
    };

    AssociationCurator.prototype._markDirtyAttribute = function(key, oldValue) {
      var _ref;
      if ((_ref = this.lifecycle.get('state')) !== 'loading' && _ref !== 'creating' && _ref !== 'saving' && _ref !== 'saved') {
        if (this.lifecycle.startTransition('set')) {
          return this.dirtyKeys.set(key, oldValue);
        } else {
          throw new Batman.StateMachine.InvalidTransitionError("Can't set while in state " + (this.lifecycle.get('state')));
        }
      }
    };

    return AssociationCurator;

  })(Batman.SimpleHash);

}).call(this);

(function() {
  var __slice = [].slice;

  Batman.SimpleSet = (function() {

    function SimpleSet() {
      var item, itemsToAdd;
      this._storage = [];
      this.length = 0;
      itemsToAdd = (function() {
        var _i, _len, _results;
        _results = [];
        for (_i = 0, _len = arguments.length; _i < _len; _i++) {
          item = arguments[_i];
          if (item != null) {
            _results.push(item);
          }
        }
        return _results;
      }).apply(this, arguments);
      if (itemsToAdd.length > 0) {
        this.add.apply(this, itemsToAdd);
      }
    }

    Batman.extend(SimpleSet.prototype, Batman.Enumerable);

    SimpleSet.prototype.has = function(item) {
      return !!(~this._indexOfItem(item));
    };

    SimpleSet.prototype.add = function() {
      var addedItems, item, items, _i, _len;
      items = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
      addedItems = [];
      for (_i = 0, _len = items.length; _i < _len; _i++) {
        item = items[_i];
        if (!(!~this._indexOfItem(item))) {
          continue;
        }
        this._storage.push(item);
        addedItems.push(item);
      }
      this.length = this._storage.length;
      if (this.fire && addedItems.length !== 0) {
        this.fire('change', this, this);
        this.fire.apply(this, ['itemsWereAdded'].concat(__slice.call(addedItems)));
      }
      return addedItems;
    };

    SimpleSet.prototype.remove = function() {
      var index, item, items, removedItems, _i, _len;
      items = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
      removedItems = [];
      for (_i = 0, _len = items.length; _i < _len; _i++) {
        item = items[_i];
        if (!(~ (index = this._indexOfItem(item)))) {
          continue;
        }
        this._storage.splice(index, 1);
        removedItems.push(item);
      }
      this.length = this._storage.length;
      if (this.fire && removedItems.length !== 0) {
        this.fire('change', this, this);
        this.fire.apply(this, ['itemsWereRemoved'].concat(__slice.call(removedItems)));
      }
      return removedItems;
    };

    SimpleSet.prototype.find = function(f) {
      var item, _i, _len, _ref;
      _ref = this._storage;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        item = _ref[_i];
        if (f(item)) {
          return item;
        }
      }
    };

    SimpleSet.prototype.forEach = function(iterator, ctx) {
      var key, _i, _len, _ref, _results;
      _ref = this._storage;
      _results = [];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        key = _ref[_i];
        _results.push(iterator.call(ctx, key, null, this));
      }
      return _results;
    };

    SimpleSet.prototype.isEmpty = function() {
      return this.length === 0;
    };

    SimpleSet.prototype.clear = function() {
      var items;
      items = this._storage;
      this._storage = [];
      this.length = 0;
      if (this.fire && items.length !== 0) {
        this.fire('change', this, this);
        this.fire.apply(this, ['itemsWereRemoved'].concat(__slice.call(items)));
      }
      return items;
    };

    SimpleSet.prototype.replace = function(other) {
      try {
        if (typeof this.prevent === "function") {
          this.prevent('change');
        }
        this.clear();
        return this.add.apply(this, other.toArray());
      } finally {
        if (typeof this.allowAndFire === "function") {
          this.allowAndFire('change', this, this);
        }
      }
    };

    SimpleSet.prototype.toArray = function() {
      return this._storage.slice();
    };

    SimpleSet.prototype.merge = function() {
      var merged, others, set, _i, _len;
      others = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
      merged = new this.constructor;
      others.unshift(this);
      for (_i = 0, _len = others.length; _i < _len; _i++) {
        set = others[_i];
        set.forEach(function(v) {
          return merged.add(v);
        });
      }
      return merged;
    };

    SimpleSet.prototype.indexedBy = function(key) {
      this._indexes || (this._indexes = new Batman.SimpleHash);
      return this._indexes.get(key) || this._indexes.set(key, new Batman.SetIndex(this, key));
    };

    SimpleSet.prototype.indexedByUnique = function(key) {
      this._uniqueIndexes || (this._uniqueIndexes = new Batman.SimpleHash);
      return this._uniqueIndexes.get(key) || this._uniqueIndexes.set(key, new Batman.UniqueSetIndex(this, key));
    };

    SimpleSet.prototype.sortedBy = function(key, order) {
      var sortsForKey;
      if (order == null) {
        order = "asc";
      }
      order = order.toLowerCase() === "desc" ? "desc" : "asc";
      this._sorts || (this._sorts = new Batman.SimpleHash);
      sortsForKey = this._sorts.get(key) || this._sorts.set(key, new Batman.Object);
      return sortsForKey.get(order) || sortsForKey.set(order, new Batman.SetSort(this, key, order));
    };

    SimpleSet.prototype.equality = Batman.SimpleHash.prototype.equality;

    SimpleSet.prototype._indexOfItem = function(givenItem) {
      var index, item, _i, _len, _ref;
      _ref = this._storage;
      for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) {
        item = _ref[index];
        if (this.equality(givenItem, item)) {
          return index;
        }
      }
      return -1;
    };

    return SimpleSet;

  })();

}).call(this);

(function() {
  var SOURCE_TRACKER_STACK, SOURCE_TRACKER_STACK_VALID, __slice = [].slice;

  SOURCE_TRACKER_STACK = [];

  SOURCE_TRACKER_STACK_VALID = true;

  Batman.Property = (function() {

    Batman.mixin(Property.prototype, Batman.EventEmitter);

    Property._sourceTrackerStack = SOURCE_TRACKER_STACK;

    Property._sourceTrackerStackValid = SOURCE_TRACKER_STACK_VALID;

    Property.defaultAccessor = {
      get: function(key) {
        return this[key];
      },
      set: function(key, val) {
        return this[key] = val;
      },
      unset: function(key) {
        var x;
        x = this[key];
        delete this[key];
        return x;
      },
      cache: false
    };

    Property.defaultAccessorForBase = function(base) {
      var _ref;
      return ((_ref = base._batman) != null ? _ref.getFirst('defaultAccessor') : void 0) || Batman.Property.defaultAccessor;
    };

    Property.accessorForBaseAndKey = function(base, key) {
      var accessor, ancestor, _bm, _i, _len, _ref, _ref1, _ref2, _ref3;
      if ((_bm = base._batman) != null) {
        accessor = (_ref = _bm.keyAccessors) != null ? _ref.get(key) : void 0;
        if (!accessor) {
          _ref1 = _bm.ancestors();
          for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
            ancestor = _ref1[_i];
            accessor = (_ref2 = ancestor._batman) != null ? (_ref3 = _ref2.keyAccessors) != null ? _ref3.get(key) : void 0 : void 0;
            if (accessor) {
              break;
            }
          }
        }
      }
      return accessor || this.defaultAccessorForBase(base);
    };

    Property.forBaseAndKey = function(base, key) {
      if (base.isObservable) {
        return base.property(key);
      } else {
        return new Batman.Keypath(base, key);
      }
    };

    Property.withoutTracking = function(block) {
      return this.wrapTrackingPrevention(block)();
    };

    Property.wrapTrackingPrevention = function(block) {
      return function() {
        Batman.Property.pushDummySourceTracker();
        try {
          return block.apply(this, arguments);
        } finally {
          Batman.Property.popSourceTracker();
        }
      };
    };

    Property.registerSource = function(obj) {
      var set;
      if (!obj.isEventEmitter) {
        return;
      }
      if (SOURCE_TRACKER_STACK_VALID) {
        set = SOURCE_TRACKER_STACK[SOURCE_TRACKER_STACK.length - 1];
      } else {
        set = [];
        SOURCE_TRACKER_STACK.push(set);
        SOURCE_TRACKER_STACK_VALID = true;
      }
      if (set != null) {
        set.push(obj);
      }
      return void 0;
    };

    Property.pushSourceTracker = function() {
      if (SOURCE_TRACKER_STACK_VALID) {
        return SOURCE_TRACKER_STACK_VALID = false;
      } else {
        return SOURCE_TRACKER_STACK.push([]);
      }
    };

    Property.popSourceTracker = function() {
      if (SOURCE_TRACKER_STACK_VALID) {
        return SOURCE_TRACKER_STACK.pop();
      } else {
        SOURCE_TRACKER_STACK_VALID = true;
        return void 0;
      }
    };

    Property.pushDummySourceTracker = function() {
      if (!SOURCE_TRACKER_STACK_VALID) {
        SOURCE_TRACKER_STACK.push([]);
        SOURCE_TRACKER_STACK_VALID = true;
      }
      return SOURCE_TRACKER_STACK.push(null);
    };

    function Property(base, key) {
      this.base = base;
      this.key = key;
    }

    Property.prototype._isolationCount = 0;

    Property.prototype.cached = false;

    Property.prototype.value = null;

    Property.prototype.sources = null;

    Property.prototype.isProperty = true;

    Property.prototype.isDead = false;

    Property.prototype.eventClass = Batman.PropertyEvent;

    Property.prototype.isEqual = function(other) {
      return this.constructor === other.constructor && this.base === other.base && this.key === other.key;
    };

    Property.prototype.hashKey = function() {
      return this._hashKey || (this._hashKey = "<Batman.Property base: " + (Batman.Hash.prototype.hashKeyFor(this.base)) + ", key: \"" + (Batman.Hash.prototype.hashKeyFor(this.key)) + "\">");
    };

    Property.prototype.event = function(key) {
      var eventClass, _base;
      eventClass = this.eventClass || Batman.Event;
      this.events || (this.events = {});
      (_base = this.events)[key] || (_base[key] = new eventClass(this, key));
      return this.events[key];
    };

    Property.prototype.changeEvent = function() {
      return this._changeEvent || (this._changeEvent = this.event('change'));
    };

    Property.prototype.accessor = function() {
      return this._accessor || (this._accessor = this.constructor.accessorForBaseAndKey(this.base, this.key));
    };

    Property.prototype.eachObserver = function(iterator) {
      var ancestor, handlers, key, object, property, _i, _j, _len, _len1, _ref, _ref1, _ref2, _results;
      key = this.key;
      handlers = (_ref = this.changeEvent().handlers) != null ? _ref.slice() : void 0;
      if (handlers) {
        for (_i = 0, _len = handlers.length; _i < _len; _i++) {
          object = handlers[_i];
          iterator(object);
        }
      }
      if (this.base.isObservable) {
        _ref1 = this.base._batman.ancestors();
        _results = [];
        for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
          ancestor = _ref1[_j];
          if (ancestor.isObservable && ancestor.hasProperty(key)) {
            property = ancestor.property(key);
            handlers = (_ref2 = property.changeEvent().handlers) != null ? _ref2.slice() : void 0;
            if (handlers) {
              _results.push((function() {
                var _k, _len2, _results1;
                _results1 = [];
                for (_k = 0, _len2 = handlers.length; _k < _len2; _k++) {
                  object = handlers[_k];
                  _results1.push(iterator(object));
                }
                return _results1;
              })());
            } else {
              _results.push(void 0);
            }
          } else {
            _results.push(void 0);
          }
        }
        return _results;
      }
    };

    Property.prototype.observers = function() {
      var results;
      results = [];
      this.eachObserver(function(observer) {
        return results.push(observer);
      });
      return results;
    };

    Property.prototype.hasObservers = function() {
      return this.observers().length > 0;
    };

    Property.prototype.updateSourcesFromTracker = function() {
      var handler, newSources, source, _i, _j, _len, _len1, _ref, _ref1, _results;
      newSources = this.constructor.popSourceTracker();
      handler = this.sourceChangeHandler();
      if (this.sources) {
        _ref = this.sources;
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          source = _ref[_i];
          if (source != null) {
            source.event('change').removeHandler(handler);
          }
        }
      }
      this.sources = newSources;
      if (this.sources) {
        _ref1 = this.sources;
        _results = [];
        for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
          source = _ref1[_j];
          _results.push(source != null ? source.event('change').addHandler(handler) : void 0);
        }
        return _results;
      }
    };

    Property.prototype.getValue = function() {
      this.registerAsMutableSource();
      if (!this.isCached()) {
        this.constructor.pushSourceTracker();
        try {
          this.value = this.valueFromAccessor();
          this.cached = true;
        } finally {
          this.updateSourcesFromTracker();
        }
      }
      return this.value;
    };

    Property.prototype.isCachable = function() {
      var cacheable;
      if (this.isFinal()) {
        return true;
      }
      cacheable = this.accessor().cache;
      if (cacheable != null) {
        return !!cacheable;
      } else {
        return true;
      }
    };

    Property.prototype.isCached = function() {
      return this.isCachable() && this.cached;
    };

    Property.prototype.isFinal = function() {
      return !!this.accessor()['final'];
    };

    Property.prototype.refresh = function() {
      var previousValue, value;
      this.cached = false;
      previousValue = this.value;
      value = this.getValue();
      if (value !== previousValue && !this.isIsolated()) {
        this.fire(value, previousValue);
      }
      if (this.value !== void 0 && this.isFinal()) {
        return this.lockValue();
      }
    };

    Property.prototype.sourceChangeHandler = function() {
      var _this = this;
      this._sourceChangeHandler || (this._sourceChangeHandler = this._handleSourceChange.bind(this));
      Batman.developer["do"](function() {
        return _this._sourceChangeHandler.property = _this;
      });
      return this._sourceChangeHandler;
    };

    Property.prototype._handleSourceChange = function() {
      if (this.isIsolated()) {
        return this._needsRefresh = true;
      } else if (!this.isFinal() && !this.hasObservers()) {
        return this.cached = false;
      } else {
        return this.refresh();
      }
    };

    Property.prototype.valueFromAccessor = function() {
      var _ref;
      return (_ref = this.accessor().get) != null ? _ref.call(this.base, this.key) : void 0;
    };

    Property.prototype.setValue = function(val) {
      var set;
      if (!(set = this.accessor().set)) {
        return;
      }
      return this._changeValue(function() {
        return set.call(this.base, this.key, val);
      });
    };

    Property.prototype.unsetValue = function() {
      var unset;
      if (!(unset = this.accessor().unset)) {
        return;
      }
      return this._changeValue(function() {
        return unset.call(this.base, this.key);
      });
    };

    Property.prototype._changeValue = function(block) {
      var result;
      this.cached = false;
      this.constructor.pushDummySourceTracker();
      try {
        result = block.apply(this);
        this.refresh();
      } finally {
        this.constructor.popSourceTracker();
      }
      if (!(this.isCached() || this.hasObservers())) {
        this.die();
      }
      return result;
    };

    Property.prototype.forget = function(handler) {
      if (handler != null) {
        return this.changeEvent().removeHandler(handler);
      } else {
        return this.changeEvent().clearHandlers();
      }
    };

    Property.prototype.observeAndFire = function(handler) {
      this.observe(handler);
      return handler.call(this.base, this.value, this.value, this.key);
    };

    Property.prototype.observe = function(handler) {
      this.changeEvent().addHandler(handler);
      if (this.sources == null) {
        this.getValue();
      }
      return this;
    };

    Property.prototype.observeOnce = function(originalHandler) {
      var event, handler;
      event = this.changeEvent();
      handler = function() {
        originalHandler.apply(this, arguments);
        return event.removeHandler(handler);
      };
      event.addHandler(handler);
      if (this.sources == null) {
        this.getValue();
      }
      return this;
    };

    Property.prototype._removeHandlers = function() {
      var handler, source, _i, _len, _ref;
      handler = this.sourceChangeHandler();
      if (this.sources) {
        _ref = this.sources;
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          source = _ref[_i];
          source.event('change').removeHandler(handler);
        }
      }
      delete this.sources;
      return this.changeEvent().clearHandlers();
    };

    Property.prototype.lockValue = function() {
      this._removeHandlers();
      this.getValue = function() {
        return this.value;
      };
      return this.setValue = this.unsetValue = this.refresh = this.observe = function() {};
    };

    Property.prototype.die = function() {
      var _ref, _ref1;
      this._removeHandlers();
      if ((_ref = this.base._batman) != null) {
        if ((_ref1 = _ref.properties) != null) {
          _ref1.unset(this.key);
        }
      }
      return this.isDead = true;
    };

    Property.prototype.fire = function() {
      var _ref;
      return (_ref = this.changeEvent()).fire.apply(_ref, __slice.call(arguments).concat([this.key]));
    };

    Property.prototype.isolate = function() {
      if (this._isolationCount === 0) {
        this._preIsolationValue = this.getValue();
      }
      return this._isolationCount++;
    };

    Property.prototype.expose = function() {
      if (this._isolationCount === 1) {
        this._isolationCount--;
        if (this._needsRefresh) {
          this.value = this._preIsolationValue;
          this.refresh();
        } else if (this.value !== this._preIsolationValue) {
          this.fire(this.value, this._preIsolationValue);
        }
        return this._preIsolationValue = null;
      } else if (this._isolationCount > 0) {
        return this._isolationCount--;
      }
    };

    Property.prototype.isIsolated = function() {
      return this._isolationCount > 0;
    };

    return Property;

  })();

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.Keypath = (function(_super) {

    __extends(Keypath, _super);

    function Keypath(base, key) {
      if (typeof key === 'string') {
        this.segments = key.split('.');
        this.depth = this.segments.length;
      } else {
        this.segments = [key];
        this.depth = 1;
      }
      Keypath.__super__.constructor.apply(this, arguments);
    }

    Keypath.prototype.isCachable = function() {
      if (this.depth === 1) {
        return Keypath.__super__.isCachable.apply(this, arguments);
      } else {
        return true;
      }
    };

    Keypath.prototype.terminalProperty = function() {
      var base;
      base = Batman.getPath(this.base, this.segments.slice(0, -1));
      if (base == null) {
        return;
      }
      return Batman.Keypath.forBaseAndKey(base, this.segments[this.depth - 1]);
    };

    Keypath.prototype.valueFromAccessor = function() {
      if (this.depth === 1) {
        return Keypath.__super__.valueFromAccessor.apply(this, arguments);
      } else {
        return Batman.getPath(this.base, this.segments);
      }
    };

    Keypath.prototype.setValue = function(val) {
      var _ref;
      if (this.depth === 1) {
        return Keypath.__super__.setValue.apply(this, arguments);
      } else {
        return (_ref = this.terminalProperty()) != null ? _ref.setValue(val) : void 0;
      }
    };

    Keypath.prototype.unsetValue = function() {
      var _ref;
      if (this.depth === 1) {
        return Keypath.__super__.unsetValue.apply(this, arguments);
      } else {
        return (_ref = this.terminalProperty()) != null ? _ref.unsetValue() : void 0;
      }
    };

    return Keypath;

  })(Batman.Property);

}).call(this);

(function() {
  var __slice = [].slice;

  Batman.Observable = {
    isObservable: true,
    hasProperty: function(key) {
      var _ref, _ref1;
      return (_ref = this._batman) != null ? (_ref1 = _ref.properties) != null ? typeof _ref1.hasKey === "function" ? _ref1.hasKey(key) : void 0 : void 0 : void 0;
    },
    property: function(key) {
      var properties, propertyClass, _base;
      Batman.initializeObject(this);
      propertyClass = this.propertyClass || Batman.Keypath;
      properties = (_base = this._batman).properties || (_base.properties = new Batman.SimpleHash);
      return properties.get(key) || properties.set(key, new propertyClass(this, key));
    },
    get: function(key) {
      return this.property(key).getValue();
    },
    set: function(key, val) {
      return this.property(key).setValue(val);
    },
    unset: function(key) {
      return this.property(key).unsetValue();
    },
    getOrSet: Batman.SimpleHash.prototype.getOrSet,
    forget: function(key, observer) {
      var _ref;
      if (key) {
        this.property(key).forget(observer);
      } else {
        if ((_ref = this._batman.properties) != null) {
          _ref.forEach(function(key, property) {
            return property.forget();
          });
        }
      }
      return this;
    },
    observe: function() {
      var args, key, _ref;
      key = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
      (_ref = this.property(key)).observe.apply(_ref, args);
      return this;
    },
    observeAndFire: function() {
      var args, key, _ref;
      key = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
      (_ref = this.property(key)).observeAndFire.apply(_ref, args);
      return this;
    },
    observeOnce: function() {
      var args, key, _ref;
      key = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
      (_ref = this.property(key)).observeOnce.apply(_ref, args);
      return this;
    }
  };

}).call(this);

(function() {

  Batman.DOM = {
    textInputTypes: ['text', 'search', 'tel', 'url', 'email', 'password'],
    scrollIntoView: function(elementID) {
      var _ref;
      return (_ref = document.getElementById(elementID)) != null ? typeof _ref.scrollIntoView === "function" ? _ref.scrollIntoView() : void 0 : void 0;
    },
    partial: function(container, path, context, renderer) {
      var view;
      renderer.prevent('rendered');
      view = new Batman.View({
        source: path,
        context: context
      });
      return view.on('ready', function() {
        Batman.DOM.setInnerHTML(container, '');
        Batman.DOM.appendChild(container, view.get('node'));
        return renderer.allowAndFire('rendered');
      });
    },
    propagateBindingEvent: function(binding, node) {
      var current, parentBinding, parentBindings, _i, _len;
      while ((current = (current || node).parentNode)) {
        parentBindings = Batman._data(current, 'bindings');
        if (parentBindings != null) {
          for (_i = 0, _len = parentBindings.length; _i < _len; _i++) {
            parentBinding = parentBindings[_i];
            if (typeof parentBinding.childBindingAdded === "function") {
              parentBinding.childBindingAdded(binding);
            }
          }
        }
      }
    },
    propagateBindingEvents: function(newNode) {
      var binding, bindings, child, _i, _j, _len, _len1, _ref;
      _ref = newNode.childNodes;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        child = _ref[_i];
        Batman.DOM.propagateBindingEvents(child);
      }
      if (bindings = Batman._data(newNode, 'bindings')) {
        for (_j = 0, _len1 = bindings.length; _j < _len1; _j++) {
          binding = bindings[_j];
          Batman.DOM.propagateBindingEvent(binding, newNode);
        }
      }
    },
    trackBinding: function(binding, node) {
      var bindings;
      if (bindings = Batman._data(node, 'bindings')) {
        bindings.push(binding);
      } else {
        Batman._data(node, 'bindings', [binding]);
      }
      Batman.DOM.fire('bindingAdded', binding);
      Batman.DOM.propagateBindingEvent(binding, node);
      return true;
    },
    onParseExit: function(node, callback) {
      var set;
      set = Batman._data(node, 'onParseExit') || Batman._data(node, 'onParseExit', new Batman.SimpleSet);
      if (callback != null) {
        set.add(callback);
      }
      return set;
    },
    forgetParseExit: function(node, callback) {
      return Batman.removeData(node, 'onParseExit', true);
    },
    defineView: function(name, node) {
      var contents;
      contents = node.innerHTML;
      Batman.View.store.set(Batman.Navigator.normalizePath(name), contents);
      return contents;
    },
    setStyleProperty: function(node, property, value, importance) {
      if (node.style.setProperty) {
        return node.style.setProperty(property, value, importance);
      } else {
        return node.style.setAttribute(property, value, importance);
      }
    },
    removeOrDestroyNode: function(node) {
      var view;
      view = Batman._data(node, 'view');
      view || (view = Batman._data(node, 'yielder'));
      if ((view != null) && view.get('cached')) {
        return Batman.DOM.removeNode(node);
      } else {
        return Batman.DOM.destroyNode(node);
      }
    },
    insertBefore: function(parentNode, newNode, referenceNode) {
      if (referenceNode == null) {
        referenceNode = null;
      }
      if (!referenceNode || parentNode.childNodes.length <= 0) {
        return Batman.DOM.appendChild(parentNode, newNode);
      } else {
        Batman.DOM.willInsertNode(newNode);
        parentNode.insertBefore(newNode, referenceNode);
        return Batman.DOM.didInsertNode(newNode);
      }
    },
    valueForNode: function(node, value, escapeValue) {
      var isSetting;
      if (value == null) {
        value = '';
      }
      if (escapeValue == null) {
        escapeValue = true;
      }
      isSetting = arguments.length > 1;
      switch (node.nodeName.toUpperCase()) {
      case 'INPUT':
      case 'TEXTAREA':
        if (isSetting) {
          return node.value = value;
        } else {
          return node.value;
        }
        break;
      case 'SELECT':
        if (isSetting) {
          return node.value = value;
        }
        break;
      default:
        if (isSetting) {
          return Batman.DOM.setInnerHTML(node, escapeValue ? Batman.escapeHTML(value) : value);
        } else {
          return node.innerHTML;
        }
      }
    },
    nodeIsEditable: function(node) {
      var _ref;
      return (_ref = node.nodeName.toUpperCase()) === 'INPUT' || _ref === 'TEXTAREA' || _ref === 'SELECT';
    },
    addEventListener: function(node, eventName, callback) {
      var listeners;
      if (!(listeners = Batman._data(node, 'listeners'))) {
        listeners = Batman._data(node, 'listeners', {});
      }
      if (!listeners[eventName]) {
        listeners[eventName] = [];
      }
      listeners[eventName].push(callback);
      if (Batman.DOM.hasAddEventListener) {
        return node.addEventListener(eventName, callback, false);
      } else {
        return node.attachEvent("on" + eventName, callback);
      }
    },
    removeEventListener: function(node, eventName, callback) {
      var eventListeners, index, listeners;
      if (listeners = Batman._data(node, 'listeners')) {
        if (eventListeners = listeners[eventName]) {
          index = eventListeners.indexOf(callback);
          if (index !== -1) {
            eventListeners.splice(index, 1);
          }
        }
      }
      if (Batman.DOM.hasAddEventListener) {
        return node.removeEventListener(eventName, callback, false);
      } else {
        return node.detachEvent('on' + eventName, callback);
      }
    },
    hasAddEventListener: !! (typeof window !== "undefined" && window !== null ? window.addEventListener : void 0),
    preventDefault: function(e) {
      if (typeof e.preventDefault === "function") {
        return e.preventDefault();
      } else {
        return e.returnValue = false;
      }
    },
    stopPropagation: function(e) {
      if (e.stopPropagation) {
        return e.stopPropagation();
      } else {
        return e.cancelBubble = true;
      }
    },
    willInsertNode: function(node) {
      var child, view, _i, _len, _ref, _ref1;
      view = Batman._data(node, 'view');
      if (view != null) {
        view.fire('beforeAppear', node);
      }
      if ((_ref = Batman.data(node, 'show')) != null) {
        _ref.call(node);
      }
      _ref1 = node.childNodes;
      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
        child = _ref1[_i];
        Batman.DOM.willInsertNode(child);
      }
      return true;
    },
    didInsertNode: function(node) {
      var child, view, _i, _len, _ref;
      view = Batman._data(node, 'view');
      if (view) {
        view.fire('appear', node);
        view.applyYields();
      }
      _ref = node.childNodes;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        child = _ref[_i];
        Batman.DOM.didInsertNode(child);
      }
      return true;
    },
    willRemoveNode: function(node) {
      var child, view, _i, _len, _ref, _ref1;
      view = Batman._data(node, 'view');
      if (view) {
        view.fire('beforeDisappear', node);
      }
      if ((_ref = Batman.data(node, 'hide')) != null) {
        _ref.call(node);
      }
      _ref1 = node.childNodes;
      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
        child = _ref1[_i];
        Batman.DOM.willRemoveNode(child);
      }
      return true;
    },
    didRemoveNode: function(node) {
      var child, view, _i, _len, _ref;
      view = Batman._data(node, 'view');
      if (view) {
        view.retractYields();
        view.fire('disappear', node);
      }
      _ref = node.childNodes;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        child = _ref[_i];
        Batman.DOM.didRemoveNode(child);
      }
      return true;
    },
    willDestroyNode: function(node) {
      var child, view, _i, _len, _ref;
      view = Batman._data(node, 'view');
      if (view) {
        view.fire('beforeDestroy', node);
        view.get('yields').forEach(function(name, actions) {
          var _i, _len, _results;
          _results = [];
          for (_i = 0, _len = actions.length; _i < _len; _i++) {
            node = actions[_i].node;
            _results.push(Batman.DOM.willDestroyNode(node));
          }
          return _results;
        });
      }
      _ref = node.childNodes;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        child = _ref[_i];
        Batman.DOM.willDestroyNode(child);
      }
      return true;
    },
    didDestroyNode: function(node) {
      var bindings, child, eventListeners, eventName, listeners, view, _i, _len, _ref;
      view = Batman._data(node, 'view');
      if (view) {
        view.die();
      }
      if (bindings = Batman._data(node, 'bindings')) {
        bindings.forEach(function(binding) {
          return binding.die();
        });
      }
      if (listeners = Batman._data(node, 'listeners')) {
        for (eventName in listeners) {
          eventListeners = listeners[eventName];
          eventListeners.forEach(function(listener) {
            return Batman.DOM.removeEventListener(node, eventName, listener);
          });
        }
      }
      Batman.removeData(node);
      Batman.removeData(node, void 0, true);
      _ref = node.childNodes;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        child = _ref[_i];
        Batman.DOM.didDestroyNode(child);
      }
      return true;
    }
  };

  Batman.mixin(Batman.DOM, Batman.EventEmitter, Batman.Observable);

  Batman.DOM.event('bindingAdded');

}).call(this);

(function() {

  Batman.DOM.ReaderBindingDefinition = (function() {

    function ReaderBindingDefinition(node, keyPath, context, renderer) {
      this.node = node;
      this.keyPath = keyPath;
      this.context = context;
      this.renderer = renderer;
    }

    return ReaderBindingDefinition;

  })();

  Batman.BindingDefinitionOnlyObserve = {
    Data: 'data',
    Node: 'node',
    All: 'all',
    None: 'none'
  };

  Batman.DOM.readers = {
    target: function(definition) {
      definition.onlyObserve = Batman.BindingDefinitionOnlyObserve.Node;
      return Batman.DOM.readers.bind(definition);
    },
    source: function(definition) {
      definition.onlyObserve = Batman.BindingDefinitionOnlyObserve.Data;
      return Batman.DOM.readers.bind(definition);
    },
    bind: function(definition) {
      var bindingClass, node;
      node = definition.node;
      switch (node.nodeName.toLowerCase()) {
      case 'input':
        switch (node.getAttribute('type')) {
        case 'checkbox':
          definition.attr = 'checked';
          Batman.DOM.attrReaders.bind(definition);
          return true;
        case 'radio':
          bindingClass = Batman.DOM.RadioBinding;
          break;
        case 'file':
          bindingClass = Batman.DOM.FileBinding;
        }
        break;
      case 'select':
        bindingClass = Batman.DOM.SelectBinding;
      }
      bindingClass || (bindingClass = Batman.DOM.ValueBinding);
      return new bindingClass(definition);
    },
    context: function(definition) {
      return definition.context.descendWithDefinition(definition);
    },
    mixin: function(definition) {
      definition.context = definition.context.descend(Batman.mixins);
      return new Batman.DOM.MixinBinding(definition);
    },
    showif: function(definition) {
      return new Batman.DOM.ShowHideBinding(definition);
    },
    hideif: function(definition) {
      definition.invert = true;
      return new Batman.DOM.ShowHideBinding(definition);
    },
    insertif: function(definition) {
      return new Batman.DOM.InsertionBinding(definition);
    },
    removeif: function(definition) {
      definition.invert = true;
      return new Batman.DOM.InsertionBinding(definition);
    },
    route: function(definition) {
      return new Batman.DOM.RouteBinding(definition);
    },
    view: function(definition) {
      return new Batman.DOM.ViewBinding(definition);
    },
    partial: function(definition) {
      return Batman.DOM.partial(definition.node, definition.keyPath, definition.context, definition.renderer);
    },
    defineview: function(definition) {
      var node;
      node = definition.node;
      Batman.DOM.onParseExit(node, function() {
        var _ref;
        return (_ref = node.parentNode) != null ? _ref.removeChild(node) : void 0;
      });
      Batman.DOM.defineView(definition.keyPath, node);
      return {
        skipChildren: true
      };
    },
    renderif: function(definition) {
      return new Batman.DOM.DeferredRenderingBinding(definition);
    },
    "yield": function(definition) {
      var keyPath, node;
      node = definition.node, keyPath = definition.keyPath;
      return Batman.DOM.onParseExit(node, function() {
        return Batman.DOM.Yield.withName(keyPath).set('containerNode', node);
      });
    },
    contentfor: function(definition) {
      var keyPath, node, renderer, swapMethod, value;
      node = definition.node, value = definition.value, swapMethod = definition.swapMethod, renderer = definition.renderer, keyPath = definition.keyPath;
      swapMethod || (swapMethod = 'append');
      return Batman.DOM.onParseExit(node, function() {
        var _ref;
        if ((_ref = node.parentNode) != null) {
          _ref.removeChild(node);
        }
        return renderer.view.pushYieldAction(keyPath, swapMethod, node);
      });
    },
    replace: function(definition) {
      definition.swapMethod = 'replace';
      return Batman.DOM.readers.contentfor(definition);
    }
  };

}).call(this);

(function() {
  var __slice = [].slice,
    __indexOf = [].indexOf ||
  function(item) {
    for (var i = 0, l = this.length; i < l; i++) {
      if (i in this && this[i] === item) return i;
    }
    return -1;
  };

  Batman.DOM.events = {
    click: function(node, callback, context, eventName) {
      if (eventName == null) {
        eventName = 'click';
      }
      Batman.DOM.addEventListener(node, eventName, function() {
        var args, event;
        event = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
        if (event.metaKey || event.ctrlKey || event.button === 1) {
          return;
        }
        Batman.DOM.preventDefault(event);
        if (!Batman.DOM.eventIsAllowed(eventName, event)) {
          return;
        }
        return callback.apply(null, [node, event].concat(__slice.call(args), [context]));
      });
      if (node.nodeName.toUpperCase() === 'A' && !node.href) {
        node.href = '#';
      }
      return node;
    },
    doubleclick: function(node, callback, context) {
      return Batman.DOM.events.click(node, callback, context, 'dblclick');
    },
    change: function(node, callback, context) {
      var eventName, eventNames, oldCallback, _i, _len, _results;
      eventNames = (function() {
        var _ref;
        switch (node.nodeName.toUpperCase()) {
        case 'TEXTAREA':
          return ['input', 'keyup', 'change'];
        case 'INPUT':
          if (_ref = node.type.toLowerCase(), __indexOf.call(Batman.DOM.textInputTypes, _ref) >= 0) {
            oldCallback = callback;
            callback = function(node, event) {
              if (event.type === 'keyup' && Batman.DOM.events.isEnter(event)) {
                return;
              }
              return oldCallback(node, event);
            };
            return ['input', 'keyup', 'change'];
          } else {
            return ['input', 'change'];
          }
          break;
        default:
          return ['change'];
        }
      })();
      _results = [];
      for (_i = 0, _len = eventNames.length; _i < _len; _i++) {
        eventName = eventNames[_i];
        _results.push(Batman.DOM.addEventListener(node, eventName, function() {
          var args;
          args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
          return callback.apply(null, [node].concat(__slice.call(args), [context]));
        }));
      }
      return _results;
    },
    isEnter: function(ev) {
      var _ref, _ref1;
      return ((13 <= (_ref = ev.keyCode) && _ref <= 14)) || ((13 <= (_ref1 = ev.which) && _ref1 <= 14)) || ev.keyIdentifier === 'Enter' || ev.key === 'Enter';
    },
    submit: function(node, callback, context) {
      if (Batman.DOM.nodeIsEditable(node)) {
        Batman.DOM.addEventListener(node, 'keydown', function() {
          var args;
          args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
          if (Batman.DOM.events.isEnter(args[0])) {
            return Batman.DOM._keyCapturingNode = node;
          }
        });
        Batman.DOM.addEventListener(node, 'keyup', function() {
          var args;
          args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
          if (Batman.DOM.events.isEnter(args[0])) {
            if (Batman.DOM._keyCapturingNode === node) {
              Batman.DOM.preventDefault(args[0]);
              callback.apply(null, [node].concat(__slice.call(args), [context]));
            }
            return Batman.DOM._keyCapturingNode = null;
          }
        });
      } else {
        Batman.DOM.addEventListener(node, 'submit', function() {
          var args;
          args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
          Batman.DOM.preventDefault(args[0]);
          return callback.apply(null, [node].concat(__slice.call(args), [context]));
        });
      }
      return node;
    },
    other: function(node, eventName, callback, context) {
      return Batman.DOM.addEventListener(node, eventName, function() {
        var args;
        args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
        return callback.apply(null, [node].concat(__slice.call(args), [context]));
      });
    }
  };

  Batman.DOM.eventIsAllowed = function(eventName, event) {
    var delegate, _ref, _ref1;
    if (delegate = (_ref = Batman.currentApp) != null ? (_ref1 = _ref.shouldAllowEvent) != null ? _ref1[eventName] : void 0 : void 0) {
      if (delegate(event) === false) {
        return false;
      }
    }
    return true;
  };

}).call(this);

(function() {

  Batman.DOM.AttrReaderBindingDefinition = (function() {

    function AttrReaderBindingDefinition(node, attr, keyPath, context, renderer) {
      this.node = node;
      this.attr = attr;
      this.keyPath = keyPath;
      this.context = context;
      this.renderer = renderer;
    }

    return AttrReaderBindingDefinition;

  })();

  Batman.DOM.attrReaders = {
    _parseAttribute: function(value) {
      if (value === 'false') {
        value = false;
      }
      if (value === 'true') {
        value = true;
      }
      return value;
    },
    source: function(definition) {
      definition.onlyObserve = Batman.BindingDefinitionOnlyObserve.Data;
      return Batman.DOM.attrReaders.bind(definition);
    },
    bind: function(definition) {
      var bindingClass;
      bindingClass = (function() {
        switch (definition.attr) {
        case 'checked':
        case 'disabled':
        case 'selected':
          return Batman.DOM.CheckedBinding;
        case 'value':
        case 'href':
        case 'src':
        case 'size':
          return Batman.DOM.NodeAttributeBinding;
        case 'class':
          return Batman.DOM.ClassBinding;
        case 'style':
          return Batman.DOM.StyleBinding;
        default:
          return Batman.DOM.AttributeBinding;
        }
      })();
      return new bindingClass(definition);
    },
    context: function(definition) {
      return definition.context.descendWithDefinition(definition);
    },
    event: function(definition) {
      return new Batman.DOM.EventBinding(definition);
    },
    addclass: function(definition) {
      return new Batman.DOM.AddClassBinding(definition);
    },
    removeclass: function(definition) {
      definition.invert = true;
      return new Batman.DOM.AddClassBinding(definition);
    },
    foreach: function(definition) {
      return new Batman.DOM.IteratorBinding(definition);
    },
    formfor: function(definition) {
      new Batman.DOM.FormBinding(definition);
      return definition.context.descendWithDefinition(definition);
    }
  };

}).call(this);

(function() {
  var BatmanObject, ObjectFunctions, getAccessorObject, promiseWrapper, wrapSingleAccessor, __slice = [].slice,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  getAccessorObject = function(base, accessor) {
    var deprecated, _i, _len, _ref;
    if (typeof accessor === 'function') {
      accessor = {
        get: accessor
      };
    }
    _ref = ['cachable', 'cacheable'];
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
      deprecated = _ref[_i];
      if (deprecated in accessor) {
        Batman.developer.warn("Property accessor option \"" + deprecated + "\" is deprecated. Use \"cache\" instead.");
        if (!('cache' in accessor)) {
          accessor.cache = accessor[deprecated];
        }
      }
    }
    return accessor;
  };

  promiseWrapper = function(fetcher) {
    return function(defaultAccessor) {
      return {
        get: function(key) {
          var asyncDeliver, existingValue, newValue, _base, _base1, _ref, _ref1, _this = this;
          if ((existingValue = defaultAccessor.get.apply(this, arguments)) != null) {
            return existingValue;
          }
          asyncDeliver = false;
          newValue = void 0;
          if ((_ref = (_base = this._batman).promises) == null) {
            _base.promises = {};
          }
          if ((_ref1 = (_base1 = this._batman.promises)[key]) == null) {
            _base1[key] = (function() {
              var deliver, returnValue;
              deliver = function(err, result) {
                if (asyncDeliver) {
                  _this.set(key, result);
                }
                return newValue = result;
              };
              returnValue = fetcher.call(_this, deliver, key);
              if (newValue == null) {
                newValue = returnValue;
              }
              return true;
            })();
          }
          asyncDeliver = true;
          return newValue;
        },
        cache: true
      };
    };
  };

  wrapSingleAccessor = function(core, wrapper) {
    var k, v;
    wrapper = (typeof wrapper === "function" ? wrapper(core) : void 0) || wrapper;
    for (k in core) {
      v = core[k];
      if (!(k in wrapper)) {
        wrapper[k] = v;
      }
    }
    return wrapper;
  };

  ObjectFunctions = {
    _defineAccessor: function() {
      var accessor, key, keys, _base, _i, _j, _len, _ref, _results;
      keys = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), accessor = arguments[_i++];
      if (!(accessor != null)) {
        return Batman.Property.defaultAccessorForBase(this);
      } else if (keys.length === 0 && ((_ref = Batman.typeOf(accessor)) !== 'Object' && _ref !== 'Function')) {
        return Batman.Property.accessorForBaseAndKey(this, accessor);
      } else if (typeof accessor.promise === 'function') {
        return this._defineWrapAccessor.apply(this, __slice.call(keys).concat([promiseWrapper(accessor.promise)]));
      }
      Batman.initializeObject(this);
      if (keys.length === 0) {
        return this._batman.defaultAccessor = getAccessorObject(this, accessor);
      } else {
        (_base = this._batman).keyAccessors || (_base.keyAccessors = new Batman.SimpleHash);
        _results = [];
        for (_j = 0, _len = keys.length; _j < _len; _j++) {
          key = keys[_j];
          _results.push(this._batman.keyAccessors.set(key, getAccessorObject(this, accessor)));
        }
        return _results;
      }
    },
    _defineWrapAccessor: function() {
      var key, keys, wrapper, _i, _j, _len, _results;
      keys = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), wrapper = arguments[_i++];
      Batman.initializeObject(this);
      if (keys.length === 0) {
        return this._defineAccessor(wrapSingleAccessor(this._defineAccessor(), wrapper));
      } else {
        _results = [];
        for (_j = 0, _len = keys.length; _j < _len; _j++) {
          key = keys[_j];
          _results.push(this._defineAccessor(key, wrapSingleAccessor(this._defineAccessor(key), wrapper)));
        }
        return _results;
      }
    },
    _resetPromises: function() {
      var key;
      if (this._batman.promises == null) {
        return;
      }
      for (key in this._batman.promises) {
        this._resetPromise(key);
      }
    },
    _resetPromise: function(key) {
      this.unset(key);
      this.property(key).cached = false;
      delete this._batman.promises[key];
    }
  };

  BatmanObject = (function(_super) {
    var counter;

    __extends(BatmanObject, _super);

    Batman.initializeObject(BatmanObject);

    Batman.initializeObject(BatmanObject.prototype);

    Batman.mixin(BatmanObject.prototype, ObjectFunctions, Batman.EventEmitter, Batman.Observable);

    Batman.mixin(BatmanObject, ObjectFunctions, Batman.EventEmitter, Batman.Observable);

    BatmanObject.classMixin = function() {
      return Batman.mixin.apply(Batman, [this].concat(__slice.call(arguments)));
    };

    BatmanObject.mixin = function() {
      return this.classMixin.apply(this.prototype, arguments);
    };

    BatmanObject.prototype.mixin = BatmanObject.classMixin;

    BatmanObject.classAccessor = BatmanObject._defineAccessor;

    BatmanObject.accessor = function() {
      var _ref;
      return (_ref = this.prototype)._defineAccessor.apply(_ref, arguments);
    };

    BatmanObject.prototype.accessor = BatmanObject._defineAccessor;

    BatmanObject.wrapClassAccessor = BatmanObject._defineWrapAccessor;

    BatmanObject.wrapAccessor = function() {
      var _ref;
      return (_ref = this.prototype)._defineWrapAccessor.apply(_ref, arguments);
    };

    BatmanObject.prototype.wrapAccessor = BatmanObject._defineWrapAccessor;

    BatmanObject.observeAll = function() {
      return this.prototype.observe.apply(this.prototype, arguments);
    };

    BatmanObject.singleton = function(singletonMethodName) {
      if (singletonMethodName == null) {
        singletonMethodName = "sharedInstance";
      }
      return this.classAccessor(singletonMethodName, {
        get: function() {
          var _name;
          return this[_name = "_" + singletonMethodName] || (this[_name] = new this);
        }
      });
    };

    BatmanObject.accessor('_batmanID', function() {
      return this._batmanID();
    });

    function BatmanObject() {
      var mixins;
      mixins = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
      this._batman = new Batman._Batman(this);
      this.mixin.apply(this, mixins);
    }

    counter = 0;

    BatmanObject.prototype._batmanID = function() {
      var _base, _ref;
      this._batman.check(this);
      if ((_ref = (_base = this._batman).id) == null) {
        _base.id = counter++;
      }
      return this._batman.id;
    };

    BatmanObject.prototype.hashKey = function() {
      var _base;
      if (typeof this.isEqual === 'function') {
        return;
      }
      return (_base = this._batman).hashKey || (_base.hashKey = "<Batman.Object " + (this._batmanID()) + ">");
    };

    BatmanObject.prototype.toJSON = function() {
      var key, obj, value;
      obj = {};
      for (key in this) {
        if (!__hasProp.call(this, key)) continue;
        value = this[key];
        if (key !== "_batman" && key !== "hashKey" && key !== "_batmanID") {
          obj[key] = (value != null ? value.toJSON : void 0) ? value.toJSON() : value;
        }
      }
      return obj;
    };

    return BatmanObject;

  })(Object);

  Batman.Object = BatmanObject;

}).call(this);

(function() {
  var __bind = function(fn, me) {
      return function() {
        return fn.apply(me, arguments);
      };
    },
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.Renderer = (function(_super) {
    var bindingRegexp, bindingSortOrder, bindingSortPositions, k, name, pos, _i, _j, _len, _len1, _ref;

    __extends(Renderer, _super);

    Renderer.prototype.deferEvery = 50;

    function Renderer(node, context, view) {
      this.node = node;
      this.context = context;
      this.view = view;
      this.resume = __bind(this.resume, this);

      this.start = __bind(this.start, this);

      Renderer.__super__.constructor.call(this);
      if (!(this.context instanceof Batman.RenderContext)) {
        Batman.developer.error("Must pass a RenderContext to a renderer for rendering");
      }
      this.immediate = Batman.setImmediate(this.start);
    }

    Renderer.prototype.start = function() {
      this.startTime = new Date;
      this.prevent('parsed');
      this.prevent('rendered');
      return this.parseNode(this.node);
    };

    Renderer.prototype.resume = function() {
      this.startTime = new Date;
      return this.parseNode(this.resumeNode);
    };

    Renderer.prototype.finish = function() {
      this.startTime = null;
      this.prevent('stopped');
      this.allowAndFire('parsed');
      return this.allowAndFire('rendered');
    };

    Renderer.prototype.stop = function() {
      Batman.clearImmediate(this.immediate);
      return this.fire('stopped');
    };

    _ref = ['parsed', 'rendered', 'stopped'];
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
      k = _ref[_i];
      Renderer.prototype.event(k).oneShot = true;
    }

    bindingRegexp = /^data\-(.*)/;

    bindingSortOrder = ["view", "renderif", "foreach", "formfor", "context", "bind", "source", "target"];

    bindingSortPositions = {};

    for (pos = _j = 0, _len1 = bindingSortOrder.length; _j < _len1; pos = ++_j) {
      name = bindingSortOrder[pos];
      bindingSortPositions[name] = pos;
    }

    Renderer.prototype._sortBindings = function(a, b) {
      var aindex, bindex;
      aindex = bindingSortPositions[a[0]];
      bindex = bindingSortPositions[b[0]];
      if (aindex == null) {
        aindex = bindingSortOrder.length;
      }
      if (bindex == null) {
        bindex = bindingSortOrder.length;
      }
      if (aindex > bindex) {
        return 1;
      } else if (bindex > aindex) {
        return -1;
      } else if (a[0] > b[0]) {
        return 1;
      } else if (b[0] > a[0]) {
        return -1;
      } else {
        return 0;
      }
    };

    Renderer.prototype.parseNode = function(node) {
      var attr, attribute, binding, bindingDefinition, bindings, names, nextNode, oldContext, reader, skipChildren, value, _k, _l, _len2, _len3, _ref1, _ref2, _ref3, _ref4, _this = this;
      if (this.deferEvery && (new Date - this.startTime) > this.deferEvery) {
        this.resumeNode = node;
        this.timeout = Batman.setImmediate(this.resume);
        return;
      }
      if (node.getAttribute && node.attributes) {
        bindings = [];
        _ref1 = node.attributes;
        for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) {
          attribute = _ref1[_k];
          name = (_ref2 = attribute.nodeName.match(bindingRegexp)) != null ? _ref2[1] : void 0;
          if (!name) {
            continue;
          }
          bindings.push((names = name.split('-')).length > 1 ? [names[0], names.slice(1, names.length + 1 || 9e9).join('-'), attribute.value] : [name, void 0, attribute.value]);
        }
        _ref3 = bindings.sort(this._sortBindings);
        for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) {
          _ref4 = _ref3[_l], name = _ref4[0], attr = _ref4[1], value = _ref4[2];
          binding = attr ? (reader = Batman.DOM.attrReaders[name]) ? (bindingDefinition = new Batman.DOM.AttrReaderBindingDefinition(node, attr, value, this.context, this), reader(bindingDefinition)) : void 0 : (reader = Batman.DOM.readers[name]) ? (bindingDefinition = new Batman.DOM.ReaderBindingDefinition(node, value, this.context, this), reader(bindingDefinition)) : void 0;
          if (binding instanceof Batman.RenderContext) {
            oldContext = this.context;
            this.context = binding;
            Batman.DOM.onParseExit(node, function() {
              return _this.context = oldContext;
            });
          } else if (binding != null ? binding.skipChildren : void 0) {
            skipChildren = true;
            break;
          }
        }
      }
      if ((nextNode = this.nextNode(node, skipChildren))) {
        return this.parseNode(nextNode);
      } else {
        return this.finish();
      }
    };

    Renderer.prototype.nextNode = function(node, skipChildren) {
      var children, nextParent, parentSibling, sibling, _ref1, _ref2;
      if (!skipChildren) {
        children = node.childNodes;
        if (children != null ? children.length : void 0) {
          return children[0];
        }
      }
      sibling = node.nextSibling;
      if ((_ref1 = Batman.DOM.onParseExit(node)) != null) {
        _ref1.forEach(function(callback) {
          return callback();
        });
      }
      Batman.DOM.forgetParseExit(node);
      if (this.node === node) {
        return;
      }
      if (sibling) {
        return sibling;
      }
      nextParent = node;
      while (nextParent = nextParent.parentNode) {
        parentSibling = nextParent.nextSibling;
        if ((_ref2 = Batman.DOM.onParseExit(nextParent)) != null) {
          _ref2.forEach(function(callback) {
            return callback();
          });
        }
        Batman.DOM.forgetParseExit(nextParent);
        if (this.node === nextParent) {
          return;
        }
        if (parentSibling) {
          return parentSibling;
        }
      }
    };

    return Renderer;

  })(Batman.Object);

}).call(this);

(function() {
  var __bind = function(fn, me) {
      return function() {
        return fn.apply(me, arguments);
      };
    },
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.AbstractBinding = (function(_super) {
    var get_dot_rx, get_rx, keypath_rx, onlyAll, onlyData, onlyNode;

    __extends(AbstractBinding, _super);

    keypath_rx = /(^|,)\s*(?:(true|false)|("[^"]*")|(\{[^\}]*\})|(([0-9]+[a-zA-Z\_]|[a-zA-Z])[\w\-\.]*[\?\!]?))\s*(?=$|,)/g;

    get_dot_rx = /(?:\]\.)(.+?)(?=[\[\.]|\s*\||$)/;

    get_rx = /(?!^\s*)\[(.*?)\]/g;

    AbstractBinding.accessor('filteredValue', {
      get: function() {
        var renderContext, result, self, unfilteredValue;
        unfilteredValue = this.get('unfilteredValue');
        self = this;
        renderContext = this.get('renderContext');
        if (this.filterFunctions.length > 0) {
          Batman.developer.currentFilterStack = renderContext;
          result = this.filterFunctions.reduce(function(value, fn, i) {
            var args;
            args = self.filterArguments[i].map(function(argument) {
              if (argument._keypath) {
                return self.renderContext.get(argument._keypath);
              } else {
                return argument;
              }
            });
            args.unshift(value);
            while (args.length < (fn.length - 1)) {
              args.push(void 0);
            }
            args.push(self);
            return fn.apply(renderContext, args);
          }, unfilteredValue);
          Batman.developer.currentFilterStack = null;
          return result;
        } else {
          return unfilteredValue;
        }
      },
      set: function(_, newValue) {
        return this.set('unfilteredValue', newValue);
      }
    });

    AbstractBinding.accessor('unfilteredValue', {
      get: function() {
        var k;
        if (k = this.get('key')) {
          return Batman.RenderContext.deProxy(Batman.getPath(this, ['keyContext', k]));
        } else {
          return this.get('value');
        }
      },
      set: function(_, value) {
        var k, keyContext, prop;
        if (k = this.get('key')) {
          keyContext = this.get('keyContext');
          if (keyContext && keyContext !== Batman.container) {
            prop = Batman.Property.forBaseAndKey(keyContext, k);
            return prop.setValue(value);
          }
        } else {
          return this.set('value', value);
        }
      }
    });

    AbstractBinding.accessor('keyContext', function() {
      return this.renderContext.contextForKey(this.key);
    });

    onlyAll = Batman.BindingDefinitionOnlyObserve.All;

    onlyData = Batman.BindingDefinitionOnlyObserve.Data;

    onlyNode = Batman.BindingDefinitionOnlyObserve.Node;

    AbstractBinding.prototype.bindImmediately = true;

    AbstractBinding.prototype.shouldSet = true;

    AbstractBinding.prototype.isInputBinding = false;

    AbstractBinding.prototype.escapeValue = true;

    AbstractBinding.prototype.onlyObserve = onlyAll;

    AbstractBinding.prototype.skipParseFilter = false;

    function AbstractBinding(definition) {
      this._fireDataChange = __bind(this._fireDataChange, this);
      this.node = definition.node, this.keyPath = definition.keyPath, this.renderContext = definition.context, this.renderer = definition.renderer;
      if (definition.onlyObserve) {
        this.onlyObserve = definition.onlyObserve;
      }
      if (definition.skipParseFilter != null) {
        this.skipParseFilter = definition.skipParseFilter;
      }
      if (!this.skipParseFilter) {
        this.parseFilter();
      }
      if (this.bindImmediately) {
        this.bind();
      }
    }

    AbstractBinding.prototype.isTwoWay = function() {
      return (this.key != null) && this.filterFunctions.length === 0;
    };

    AbstractBinding.prototype.bind = function() {
      var _ref, _ref1;
      if (this.node && ((_ref = this.onlyObserve) === onlyAll || _ref === onlyNode) && Batman.DOM.nodeIsEditable(this.node)) {
        Batman.DOM.events.change(this.node, this._fireNodeChange.bind(this));
        if (this.onlyObserve === onlyNode) {
          this._fireNodeChange();
        }
      }
      if ((_ref1 = this.onlyObserve) === onlyAll || _ref1 === onlyData) {
        this.observeAndFire('filteredValue', this._fireDataChange);
      }
      if (this.node) {
        return Batman.DOM.trackBinding(this, this.node);
      }
    };

    AbstractBinding.prototype._fireNodeChange = function(event) {
      var val;
      this.shouldSet = false;
      val = this.value || this.get('keyContext');
      if (typeof this.nodeChange === "function") {
        this.nodeChange(this.node, val, event);
      }
      this.fire('nodeChange', this.node, val);
      return this.shouldSet = true;
    };

    AbstractBinding.prototype._fireDataChange = function(value) {
      if (this.shouldSet) {
        if (typeof this.dataChange === "function") {
          this.dataChange(value, this.node);
        }
        return this.fire('dataChange', value, this.node);
      }
    };

    AbstractBinding.prototype.die = function() {
      var _ref;
      this.forget();
      if ((_ref = this._batman.properties) != null) {
        _ref.forEach(function(key, property) {
          return property.die();
        });
      }
      this.fire('die');
      this.node = null;
      this.keyPath = null;
      this.renderContext = null;
      this.renderer = null;
      this.dead = true;
      return true;
    };

    AbstractBinding.prototype.parseFilter = function() {
      var args, filter, filterName, filterString, filters, key, keyPath, orig, split;
      this.filterFunctions = [];
      this.filterArguments = [];
      keyPath = this.keyPath;
      while (get_dot_rx.test(keyPath)) {
        keyPath = keyPath.replace(get_dot_rx, "]['$1']");
      }
      filters = keyPath.replace(get_rx, " | get $1 ").replace(/'/g, '"').split(/(?!")\s+\|\s+(?!")/);
      try {
        key = this.parseSegment(orig = filters.shift())[0];
      } catch (e) {
        Batman.developer.warn(e);
        Batman.developer.error("Error! Couldn't parse keypath in \"" + orig + "\". Parsing error above.");
      }
      if (key && key._keypath) {
        this.key = key._keypath;
      } else {
        this.value = key;
      }
      if (filters.length) {
        while (filterString = filters.shift()) {
          split = filterString.indexOf(' ');
          if (split === -1) {
            split = filterString.length;
          }
          filterName = filterString.substr(0, split);
          args = filterString.substr(split);
          if (!(filter = Batman.Filters[filterName])) {
            return Batman.developer.error("Unrecognized filter '" + filterName + "' in key \"" + this.keyPath + "\"!");
          }
          this.filterFunctions.push(filter);
          try {
            this.filterArguments.push(this.parseSegment(args));
          } catch (e) {
            Batman.developer.error("Bad filter arguments \"" + args + "\"!");
          }
        }
        return true;
      }
    };

    AbstractBinding.prototype.parseSegment = function(segment) {
      segment = segment.replace(keypath_rx, function(match, start, bool, string, object, keypath, offset) {
        var replacement;
        if (start == null) {
          start = '';
        }
        replacement = keypath ? '{"_keypath": "' + keypath + '"}' : bool || string || object;
        return start + replacement;
      });
      return JSON.parse("[" + segment + "]");
    };

    return AbstractBinding;

  })(Batman.Object);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.ViewBinding = (function(_super) {

    __extends(ViewBinding, _super);

    ViewBinding.prototype.skipChildren = true;

    ViewBinding.prototype.onlyObserve = Batman.BindingDefinitionOnlyObserve.Data;

    function ViewBinding() {
      ViewBinding.__super__.constructor.apply(this, arguments);
      this.renderer.prevent('rendered');
      this.node.removeAttribute('data-view');
    }

    ViewBinding.prototype.dataChange = function(viewClassOrInstance) {
      var _ref, _this = this;
      if (viewClassOrInstance == null) {
        return;
      }
      if (viewClassOrInstance.isView) {
        this.view = viewClassOrInstance;
        this.view.set('context', this.renderContext);
        this.view.set('node', this.node);
      } else {
        this.view = new viewClassOrInstance({
          node: this.node,
          context: this.renderContext,
          parentView: this.renderer.view
        });
      }
      this.view.on('ready', function() {
        return _this.renderer.allowAndFire('rendered');
      });
      this.forget();
      return (_ref = this._batman.properties) != null ? _ref.forEach(function(key, property) {
        return property.die();
      }) : void 0;
    };

    ViewBinding.prototype.die = function() {
      this.view = null;
      return ViewBinding.__super__.die.apply(this, arguments);
    };

    return ViewBinding;

  })(Batman.DOM.AbstractBinding);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.ViewArgumentBinding = (function(_super) {

    __extends(ViewArgumentBinding, _super);

    function ViewArgumentBinding() {
      return ViewArgumentBinding.__super__.constructor.apply(this, arguments);
    }

    ViewArgumentBinding.prototype.onlyObserve = Batman.BindingDefinitionOnlyObserve.None;

    return ViewArgumentBinding;

  })(Batman.DOM.AbstractBinding);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.ValueBinding = (function(_super) {

    __extends(ValueBinding, _super);

    function ValueBinding(definition) {
      var _ref;
      this.isInputBinding = (_ref = definition.node.nodeName.toLowerCase()) === 'input' || _ref === 'textarea';
      ValueBinding.__super__.constructor.apply(this, arguments);
    }

    ValueBinding.prototype.nodeChange = function(node, context) {
      if (this.isTwoWay()) {
        return this.set('filteredValue', this.node.value);
      }
    };

    ValueBinding.prototype.dataChange = function(value, node) {
      return Batman.DOM.valueForNode(this.node, value, this.escapeValue);
    };

    return ValueBinding;

  })(Batman.DOM.AbstractBinding);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.ShowHideBinding = (function(_super) {

    __extends(ShowHideBinding, _super);

    ShowHideBinding.prototype.onlyObserve = Batman.BindingDefinitionOnlyObserve.Data;

    function ShowHideBinding(definition) {
      var display;
      display = definition.node.style.display;
      if (!display || display === 'none') {
        display = '';
      }
      this.originalDisplay = display;
      this.invert = definition.invert;
      ShowHideBinding.__super__.constructor.apply(this, arguments);
    }

    ShowHideBinding.prototype.dataChange = function(value) {
      var hide, view, _ref;
      view = Batman._data(this.node, 'view');
      if ( !! value === !this.invert) {
        if (view != null) {
          view.fire('beforeAppear', this.node);
        }
        if ((_ref = Batman.data(this.node, 'show')) != null) {
          _ref.call(this.node);
        }
        this.node.style.display = this.originalDisplay;
        return view != null ? view.fire('appear', this.node) : void 0;
      } else {
        if (view != null) {
          view.fire('beforeDisappear', this.node);
        }
        if (typeof(hide = Batman.data(this.node, 'hide')) === 'function') {
          hide.call(this.node);
        } else {
          Batman.DOM.setStyleProperty(this.node, 'display', 'none', 'important');
        }
        return view != null ? view.fire('disappear', this.node) : void 0;
      }
    };

    return ShowHideBinding;

  })(Batman.DOM.AbstractBinding);

}).call(this);

(function() {
  var __bind = function(fn, me) {
      return function() {
        return fn.apply(me, arguments);
      };
    },
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.SelectBinding = (function(_super) {

    __extends(SelectBinding, _super);

    SelectBinding.prototype.isInputBinding = true;

    SelectBinding.prototype.canSetImplicitly = true;

    function SelectBinding() {
      this.updateOptionBindings = __bind(this.updateOptionBindings, this);

      this.nodeChange = __bind(this.nodeChange, this);

      this.dataChange = __bind(this.dataChange, this);

      this.childBindingAdded = __bind(this.childBindingAdded, this);
      this.selectedBindings = new Batman.SimpleSet;
      SelectBinding.__super__.constructor.apply(this, arguments);
    }

    SelectBinding.prototype.childBindingAdded = function(binding) {
      var dataChangeHandler, _this = this;
      if (binding instanceof Batman.DOM.CheckedBinding) {
        binding.on('dataChange', dataChangeHandler = function() {
          return _this.nodeChange();
        });
        binding.on('die', function() {
          binding.forget('dataChange', dataChangeHandler);
          return _this.selectedBindings.remove(binding);
        });
        this.selectedBindings.add(binding);
      } else if (binding instanceof Batman.DOM.IteratorBinding) {
        binding.on('nodeAdded', dataChangeHandler = function() {
          return _this._fireDataChange(_this.get('filteredValue'));
        });
        binding.on('nodeRemoved', dataChangeHandler);
        binding.on('die', function() {
          binding.forget('nodeAdded', dataChangeHandler);
          return binding.forget('nodeRemoved', dataChangeHandler);
        });
      } else {
        return;
      }
      return this._fireDataChange(this.get('filteredValue'));
    };

    SelectBinding.prototype.lastKeyContext = null;

    SelectBinding.prototype.dataChange = function(newValue) {
      var child, matches, valueToChild, _i, _len, _name, _ref, _this = this;
      this.lastKeyContext || (this.lastKeyContext = this.get('keyContext'));
      if (this.lastKeyContext !== this.get('keyContext')) {
        this.canSetImplicitly = true;
        this.lastKeyContext = this.get('keyContext');
      }
      if (newValue != null ? newValue.forEach : void 0) {
        valueToChild = {};
        _ref = this.node.children;
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          child = _ref[_i];
          child.selected = false;
          matches = valueToChild[_name = child.value] || (valueToChild[_name] = []);
          matches.push(child);
        }
        newValue.forEach(function(value) {
          var children, node, _j, _len1, _results;
          if (children = valueToChild[value]) {
            _results = [];
            for (_j = 0, _len1 = children.length; _j < _len1; _j++) {
              node = children[_j];
              _results.push(node.selected = true);
            }
            return _results;
          }
        });
      } else {
        if (!(newValue != null) && this.canSetImplicitly) {
          if (this.node.value) {
            this.canSetImplicitly = false;
            this.set('unfilteredValue', this.node.value);
          }
        } else {
          this.canSetImplicitly = false;
          Batman.DOM.valueForNode(this.node, newValue, this.escapeValue);
        }
      }
      this.updateOptionBindings();
    };

    SelectBinding.prototype.nodeChange = function() {
      var c, selections;
      if (this.isTwoWay()) {
        selections = this.node.multiple ? (function() {
          var _i, _len, _ref, _results;
          _ref = this.node.children;
          _results = [];
          for (_i = 0, _len = _ref.length; _i < _len; _i++) {
            c = _ref[_i];
            if (c.selected) {
              _results.push(c.value);
            }
          }
          return _results;
        }).call(this) : this.node.value;
        if (typeof selections === Array && selections.length === 1) {
          selections = selections[0];
        }
        this.set('unfilteredValue', selections);
        this.updateOptionBindings();
      }
    };

    SelectBinding.prototype.updateOptionBindings = function() {
      return this.selectedBindings.forEach(function(binding) {
        return binding._fireNodeChange();
      });
    };

    return SelectBinding;

  })(Batman.DOM.AbstractBinding);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.RouteBinding = (function(_super) {

    __extends(RouteBinding, _super);

    function RouteBinding() {
      return RouteBinding.__super__.constructor.apply(this, arguments);
    }

    RouteBinding.prototype.onAnchorTag = false;

    RouteBinding.prototype.onlyObserve = Batman.BindingDefinitionOnlyObserve.Data;

    RouteBinding.accessor('dispatcher', function() {
      return this.renderContext.get('dispatcher') || Batman.App.get('current.dispatcher');
    });

    RouteBinding.prototype.bind = function() {
      var _this = this;
      if (this.node.nodeName.toUpperCase() === 'A') {
        this.onAnchorTag = true;
      }
      RouteBinding.__super__.bind.apply(this, arguments);
      return Batman.DOM.events.click(this.node, function(node, event) {
        var params;
        if (event.__batmanActionTaken) {
          return;
        }
        event.__batmanActionTaken = true;
        params = _this.pathFromValue(_this.get('filteredValue'));
        if (params != null) {
          return Batman.redirect(params);
        }
      });
    };

    RouteBinding.prototype.dataChange = function(value) {
      var path;
      if (value) {
        path = this.pathFromValue(value);
      }
      if (this.onAnchorTag) {
        if (path && Batman.navigator) {
          path = Batman.navigator.linkTo(path);
        } else {
          path = "#";
        }
        return this.node.href = path;
      }
    };

    RouteBinding.prototype.pathFromValue = function(value) {
      var _ref;
      if (value) {
        if (value.isNamedRouteQuery) {
          return value.get('path');
        } else {
          return (_ref = this.get('dispatcher')) != null ? _ref.pathFromParams(value) : void 0;
        }
      }
    };

    return RouteBinding;

  })(Batman.DOM.AbstractBinding);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.RadioBinding = (function(_super) {

    __extends(RadioBinding, _super);

    function RadioBinding() {
      return RadioBinding.__super__.constructor.apply(this, arguments);
    }

    RadioBinding.accessor('parsedNodeValue', function() {
      return Batman.DOM.attrReaders._parseAttribute(this.node.value);
    });

    RadioBinding.prototype.firstBind = true;

    RadioBinding.prototype.dataChange = function(value) {
      var boundValue;
      boundValue = this.get('filteredValue');
      if (boundValue != null) {
        this.node.checked = boundValue === Batman.DOM.attrReaders._parseAttribute(this.node.value);
      } else {
        if (this.firstBind && this.node.checked) {
          this.set('filteredValue', this.get('parsedNodeValue'));
        }
      }
      return this.firstBind = false;
    };

    RadioBinding.prototype.nodeChange = function(node) {
      if (this.isTwoWay()) {
        return this.set('filteredValue', this.get('parsedNodeValue'));
      }
    };

    return RadioBinding;

  })(Batman.DOM.AbstractBinding);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.MixinBinding = (function(_super) {

    __extends(MixinBinding, _super);

    function MixinBinding() {
      return MixinBinding.__super__.constructor.apply(this, arguments);
    }

    MixinBinding.prototype.onlyObserve = Batman.BindingDefinitionOnlyObserve.Data;

    MixinBinding.prototype.dataChange = function(value) {
      if (value != null) {
        return Batman.mixin(this.node, value);
      }
    };

    return MixinBinding;

  })(Batman.DOM.AbstractBinding);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.FileBinding = (function(_super) {

    __extends(FileBinding, _super);

    function FileBinding() {
      return FileBinding.__super__.constructor.apply(this, arguments);
    }

    FileBinding.prototype.isInputBinding = true;

    FileBinding.prototype.nodeChange = function(node, subContext) {
      if (!this.isTwoWay()) {
        return;
      }
      if (node.hasAttribute('multiple')) {
        return this.set('filteredValue', Array.prototype.slice.call(node.files));
      } else {
        return this.set('filteredValue', node.files[0]);
      }
    };

    return FileBinding;

  })(Batman.DOM.AbstractBinding);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.DeferredRenderingBinding = (function(_super) {

    __extends(DeferredRenderingBinding, _super);

    DeferredRenderingBinding.prototype.rendered = false;

    DeferredRenderingBinding.prototype.skipChildren = true;

    function DeferredRenderingBinding() {
      DeferredRenderingBinding.__super__.constructor.apply(this, arguments);
      this.node.removeAttribute("data-renderif");
    }

    DeferredRenderingBinding.prototype.nodeChange = function() {};

    DeferredRenderingBinding.prototype.dataChange = function(value) {
      if (value && !this.rendered) {
        return this.render();
      }
    };

    DeferredRenderingBinding.prototype.render = function() {
      new Batman.Renderer(this.node, this.renderContext, this.renderer.view);
      return this.rendered = true;
    };

    return DeferredRenderingBinding;

  })(Batman.DOM.AbstractBinding);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.AbstractAttributeBinding = (function(_super) {

    __extends(AbstractAttributeBinding, _super);

    function AbstractAttributeBinding(definition) {
      this.attributeName = definition.attr;
      AbstractAttributeBinding.__super__.constructor.apply(this, arguments);
    }

    return AbstractAttributeBinding;

  })(Batman.DOM.AbstractBinding);

}).call(this);

(function() {
  var __bind = function(fn, me) {
      return function() {
        return fn.apply(me, arguments);
      };
    },
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.FormBinding = (function(_super) {

    __extends(FormBinding, _super);

    FormBinding.current = null;

    FormBinding.prototype.errorClass = 'error';

    FormBinding.prototype.defaultErrorsListSelector = 'div.errors';

    FormBinding.prototype.onlyObserve = Batman.BindingDefinitionOnlyObserve.None;

    FormBinding.accessor('errorsListSelector', function() {
      return this.get('node').getAttribute('data-errors-list') || this.defaultErrorsListSelector;
    });

    function FormBinding() {
      this.childBindingAdded = __bind(this.childBindingAdded, this);
      FormBinding.__super__.constructor.apply(this, arguments);
      this.contextName = this.attributeName;
      delete this.attributeName;
      Batman.DOM.events.submit(this.get('node'), function(node, e) {
        return Batman.DOM.preventDefault(e);
      });
      this.setupErrorsList();
    }

    FormBinding.prototype.childBindingAdded = function(binding) {
      var definition, field, index, node;
      if (binding.isInputBinding && Batman.isChildOf(this.get('node'), binding.get('node'))) {
        if (~ (index = binding.get('key').indexOf(this.contextName))) {
          node = binding.get('node');
          field = binding.get('key').slice(index + this.contextName.length + 1);
          definition = new Batman.DOM.AttrReaderBindingDefinition(node, this.errorClass, this.get('keyPath') + (" | get 'errors." + field + ".length'"), this.renderContext, this.renderer);
          return new Batman.DOM.AddClassBinding(definition);
        }
      }
    };

    FormBinding.prototype.setupErrorsList = function() {
      if (this.errorsListNode = Batman.DOM.querySelector(this.get('node'), this.get('errorsListSelector'))) {
        Batman.DOM.setInnerHTML(this.errorsListNode, this.errorsListHTML());
        if (!this.errorsListNode.getAttribute('data-showif')) {
          return this.errorsListNode.setAttribute('data-showif', "" + this.contextName + ".errors.length");
        }
      }
    };

    FormBinding.prototype.errorsListHTML = function() {
      return "<ul>\n  <li data-foreach-error=\"" + this.contextName + ".errors\" data-bind=\"error.fullMessage\"></li>\n</ul>";
    };

    return FormBinding;

  })(Batman.DOM.AbstractAttributeBinding);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.EventBinding = (function(_super) {

    __extends(EventBinding, _super);

    EventBinding.prototype.onlyObserve = Batman.BindingDefinitionOnlyObserve.None;

    function EventBinding() {
      var attacher, callback, confirmText, _this = this;
      EventBinding.__super__.constructor.apply(this, arguments);
      if (confirmText = this.node.getAttribute('data-confirm')) {
        Batman.developer.deprecated("data-confirm");
      }
      callback = function() {
        var _ref;
        if (confirmText && !confirm(confirmText)) {
          return;
        }
        return (_ref = _this.get('filteredValue')) != null ? _ref.apply(_this.get('callbackContext'), arguments) : void 0;
      };
      if (attacher = Batman.DOM.events[this.attributeName]) {
        attacher(this.node, callback, this.renderContext);
      } else {
        Batman.DOM.events.other(this.node, this.attributeName, callback, this.renderContext);
      }
    }

    EventBinding.accessor('callbackContext', function() {
      var contextKeySegments;
      contextKeySegments = this.key.split('.');
      contextKeySegments.pop();
      if (contextKeySegments.length > 0) {
        return this.get('keyContext').get(contextKeySegments.join('.'));
      } else {
        return this.get('keyContext');
      }
    });

    EventBinding.wrapAccessor('unfilteredValue', function(core) {
      return {
        get: function() {
          var functionKey, k, keyContext, keys;
          if (k = this.get('key')) {
            keys = k.split('.');
            if (keys.length > 1) {
              functionKey = keys.pop();
              keyContext = Batman.getPath(this, ['keyContext'].concat(keys));
              keyContext = Batman.RenderContext.deProxy(keyContext);
              if (keyContext != null) {
                return keyContext[functionKey];
              }
            }
          }
          return core.get.apply(this, arguments);
        }
      };
    });

    return EventBinding;

  })(Batman.DOM.AbstractAttributeBinding);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.NodeAttributeBinding = (function(_super) {

    __extends(NodeAttributeBinding, _super);

    function NodeAttributeBinding() {
      return NodeAttributeBinding.__super__.constructor.apply(this, arguments);
    }

    NodeAttributeBinding.prototype.dataChange = function(value) {
      if (value == null) {
        value = "";
      }
      return this.node[this.attributeName] = value;
    };

    NodeAttributeBinding.prototype.nodeChange = function(node) {
      if (this.isTwoWay()) {
        return this.set('filteredValue', Batman.DOM.attrReaders._parseAttribute(node[this.attributeName]));
      }
    };

    return NodeAttributeBinding;

  })(Batman.DOM.AbstractAttributeBinding);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.CheckedBinding = (function(_super) {

    __extends(CheckedBinding, _super);

    function CheckedBinding() {
      return CheckedBinding.__super__.constructor.apply(this, arguments);
    }

    CheckedBinding.prototype.isInputBinding = true;

    CheckedBinding.prototype.dataChange = function(value) {
      return this.node[this.attributeName] = !! value;
    };

    return CheckedBinding;

  })(Batman.DOM.NodeAttributeBinding);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.AttributeBinding = (function(_super) {

    __extends(AttributeBinding, _super);

    function AttributeBinding() {
      return AttributeBinding.__super__.constructor.apply(this, arguments);
    }

    AttributeBinding.prototype.onlyObserve = Batman.BindingDefinitionOnlyObserve.Data;

    AttributeBinding.prototype.dataChange = function(value) {
      return this.node.setAttribute(this.attributeName, value);
    };

    AttributeBinding.prototype.nodeChange = function(node) {
      if (this.isTwoWay()) {
        return this.set('filteredValue', Batman.DOM.attrReaders._parseAttribute(node.getAttribute(this.attributeName)));
      }
    };

    return AttributeBinding;

  })(Batman.DOM.AbstractAttributeBinding);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.AddClassBinding = (function(_super) {

    __extends(AddClassBinding, _super);

    AddClassBinding.prototype.onlyObserve = Batman.BindingDefinitionOnlyObserve.Data;

    function AddClassBinding(definition) {
      var name;
      this.invert = definition.invert;
      this.classes = (function() {
        var _i, _len, _ref, _results;
        _ref = definition.attr.split('|');
        _results = [];
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          name = _ref[_i];
          _results.push({
            name: name,
            pattern: new RegExp("(?:^|\\s)" + name + "(?:$|\\s)", 'i')
          });
        }
        return _results;
      })();
      AddClassBinding.__super__.constructor.apply(this, arguments);
    }

    AddClassBinding.prototype.dataChange = function(value) {
      var currentName, includesClassName, name, pattern, _i, _len, _ref, _ref1;
      currentName = this.node.className;
      _ref = this.classes;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        _ref1 = _ref[_i], name = _ref1.name, pattern = _ref1.pattern;
        includesClassName = pattern.test(currentName);
        if ( !! value === !this.invert) {
          if (!includesClassName) {
            this.node.className = "" + currentName + " " + name;
          }
        } else {
          if (includesClassName) {
            this.node.className = currentName.replace(pattern, ' ');
          }
        }
      }
      return true;
    };

    return AddClassBinding;

  })(Batman.DOM.AbstractAttributeBinding);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.AbstractCollectionBinding = (function(_super) {

    __extends(AbstractCollectionBinding, _super);

    function AbstractCollectionBinding() {
      return AbstractCollectionBinding.__super__.constructor.apply(this, arguments);
    }

    AbstractCollectionBinding.prototype.bindCollection = function(newCollection) {
      var _ref;
      if (newCollection instanceof Batman.Hash) {
        newCollection = newCollection.meta;
      }
      if (newCollection === this.collection) {
        return true;
      } else {
        this.unbindCollection();
        this.collection = newCollection;
        if ((_ref = this.collection) != null ? _ref.isObservable : void 0) {
          this.collection.observeAndFire('toArray', this.handleArrayChanged);
          return true;
        }
      }
      return false;
    };

    AbstractCollectionBinding.prototype.unbindCollection = function() {
      var _ref;
      if ((_ref = this.collection) != null ? _ref.isObservable : void 0) {
        return this.collection.forget('toArray', this.handleArrayChanged);
      }
    };

    AbstractCollectionBinding.prototype.handleArrayChanged = function() {};

    AbstractCollectionBinding.prototype.die = function() {
      this.unbindCollection();
      return AbstractCollectionBinding.__super__.die.apply(this, arguments);
    };

    return AbstractCollectionBinding;

  })(Batman.DOM.AbstractAttributeBinding);

}).call(this);

(function() {
  var __bind = function(fn, me) {
      return function() {
        return fn.apply(me, arguments);
      };
    },
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    },
    __slice = [].slice;

  Batman.DOM.StyleBinding = (function(_super) {

    __extends(StyleBinding, _super);

    StyleBinding.prototype.onlyObserve = Batman.BindingDefinitionOnlyObserve.Data;

    function StyleBinding() {
      this.setStyle = __bind(this.setStyle, this);

      this.handleArrayChanged = __bind(this.handleArrayChanged, this);
      this.oldStyles = {};
      this.styleBindings = {};
      StyleBinding.__super__.constructor.apply(this, arguments);
    }

    StyleBinding.prototype.dataChange = function(value) {
      var colonSplitCSSValues, cssName, key, style, _i, _len, _ref, _ref1, _results;
      if (!value) {
        this.resetStyles();
        return;
      }
      this.unbindCollection();
      if (typeof value === 'string') {
        this.resetStyles();
        _ref = value.split(';');
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          style = _ref[_i];
          _ref1 = style.split(":"), cssName = _ref1[0], colonSplitCSSValues = 2 <= _ref1.length ? __slice.call(_ref1, 1) : [];
          this.setStyle(cssName, colonSplitCSSValues.join(":"));
        }
        return;
      }
      if (value instanceof Batman.Hash) {
        return this.bindCollection(value);
      } else {
        if (value instanceof Batman.Object) {
          value = value.toJSON();
        }
        this.resetStyles();
        _results = [];
        for (key in value) {
          if (!__hasProp.call(value, key)) continue;
          _results.push(this.bindSingleAttribute(key, "" + this.keyPath + "." + key));
        }
        return _results;
      }
    };

    StyleBinding.prototype.handleArrayChanged = function(array) {
      var _this = this;
      return this.collection.forEach(function(key, value) {
        return _this.bindSingleAttribute(key, "" + _this.keyPath + "." + key);
      });
    };

    StyleBinding.prototype.bindSingleAttribute = function(attr, keyPath) {
      var definition;
      definition = new Batman.DOM.AttrReaderBindingDefinition(this.node, attr, keyPath, this.renderContext, this.renderer);
      return this.styleBindings[attr] = new Batman.DOM.StyleBinding.SingleStyleBinding(definition, this);
    };

    StyleBinding.prototype.setStyle = function(key, value) {
      key = Batman.helpers.camelize(key.trim(), true);
      if (this.oldStyles[key] == null) {
        this.oldStyles[key] = this.node.style[key] || "";
      }
      if (value != null ? value.trim : void 0) {
        value = value.trim();
      }
      if (value == null) {
        value = "";
      }
      return this.node.style[key] = value;
    };

    StyleBinding.prototype.resetStyles = function() {
      var cssName, cssValue, _ref, _results;
      _ref = this.oldStyles;
      _results = [];
      for (cssName in _ref) {
        if (!__hasProp.call(_ref, cssName)) continue;
        cssValue = _ref[cssName];
        _results.push(this.setStyle(cssName, cssValue));
      }
      return _results;
    };

    StyleBinding.prototype.resetBindings = function() {
      var attribute, binding, _ref;
      _ref = this.styleBindings;
      for (attribute in _ref) {
        binding = _ref[attribute];
        binding._fireDataChange('');
        binding.die();
      }
      return this.styleBindings = {};
    };

    StyleBinding.prototype.unbindCollection = function() {
      this.resetBindings();
      return StyleBinding.__super__.unbindCollection.apply(this, arguments);
    };

    StyleBinding.SingleStyleBinding = (function(_super1) {

      __extends(SingleStyleBinding, _super1);

      SingleStyleBinding.prototype.onlyObserve = Batman.BindingDefinitionOnlyObserve.Data;

      SingleStyleBinding.prototype.isTwoWay = function() {
        return false;
      };

      function SingleStyleBinding(definition, parent) {
        this.parent = parent;
        SingleStyleBinding.__super__.constructor.call(this, definition);
      }

      SingleStyleBinding.prototype.dataChange = function(value) {
        return this.parent.setStyle(this.attributeName, value);
      };

      return SingleStyleBinding;

    })(Batman.DOM.AbstractAttributeBinding);

    return StyleBinding;

  })(Batman.DOM.AbstractCollectionBinding);

}).call(this);

(function() {
  var __bind = function(fn, me) {
      return function() {
        return fn.apply(me, arguments);
      };
    },
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.IteratorBinding = (function(_super) {

    __extends(IteratorBinding, _super);

    IteratorBinding.prototype.currentActionNumber = 0;

    IteratorBinding.prototype.queuedActionNumber = 0;

    IteratorBinding.prototype.bindImmediately = false;

    IteratorBinding.prototype.skipChildren = true;

    IteratorBinding.prototype.onlyObserve = Batman.BindingDefinitionOnlyObserve.Data;

    function IteratorBinding(definition) {
      this.handleArrayChanged = __bind(this.handleArrayChanged, this);

      var previousSiblingNode, sourceNode, _this = this;
      sourceNode = definition.node, this.iteratorName = definition.attr, this.key = definition.keyPath, this.parentRenderer = definition.renderer;
      this.nodeMap = new Batman.SimpleHash;
      this.rendererMap = new Batman.SimpleHash;
      this.prototypeNode = sourceNode.cloneNode(true);
      this.prototypeNode.removeAttribute("data-foreach-" + this.iteratorName);
      previousSiblingNode = sourceNode.nextSibling;
      this.startNode = document.createComment("start " + this.iteratorName + "-" + (this.get('_batmanID')));
      this.endNode = document.createComment("end " + this.iteratorName + "-" + (this.get('_batmanID')));
      this.endNode[Batman.expando] = sourceNode[Batman.expando];
      if (Batman.canDeleteExpando) {
        delete sourceNode[Batman.expando];
      }
      Batman.DOM.insertBefore(sourceNode.parentNode, this.startNode, previousSiblingNode);
      Batman.DOM.insertBefore(sourceNode.parentNode, this.endNode, previousSiblingNode);
      this.parentRenderer.prevent('rendered');
      Batman.DOM.onParseExit(sourceNode.parentNode, function() {
        Batman.DOM.destroyNode(sourceNode);
        _this.bind();
        return _this.parentRenderer.allowAndFire('rendered');
      });
      definition.node = this.endNode;
      IteratorBinding.__super__.constructor.apply(this, arguments);
    }

    IteratorBinding.prototype.parentNode = function() {
      return this.endNode.parentNode;
    };

    IteratorBinding.prototype.dataChange = function(collection) {
      var items, _items;
      if (collection != null) {
        if (!this.bindCollection(collection)) {
          items = (collection != null ? collection.forEach : void 0) ? (_items = [], collection.forEach(function(item) {
            return _items.push(item);
          }), _items) : Object.keys(collection);
          return this.handleArrayChanged(items);
        }
      } else {
        return this.handleArrayChanged([]);
      }
    };

    IteratorBinding.prototype.handleArrayChanged = function(newItems) {
      var existingNode, index, newItem, node, nodeAtIndex, parentNode, startIndex, unseenNodeMap, _i, _len, _this = this;
      parentNode = this.parentNode();
      startIndex = this._getStartNodeIndex() + 1;
      unseenNodeMap = this.nodeMap.merge();
      if (newItems) {
        for (index = _i = 0, _len = newItems.length; _i < _len; index = ++_i) {
          newItem = newItems[index];
          nodeAtIndex = parentNode.childNodes[startIndex + index];
          if ((nodeAtIndex != null) && this._itemForNode(nodeAtIndex) === newItem) {
            unseenNodeMap.unset(newItem);
            continue;
          } else {
            node = (existingNode = this.nodeMap.get(newItem)) ? (unseenNodeMap.unset(newItem), existingNode) : this._newNodeForItem(newItem);
            Batman.DOM.insertBefore(this.parentNode(), node, nodeAtIndex);
          }
        }
      }
      unseenNodeMap.forEach(function(item, node) {
        if (_this._nodesToBeRendered.has(node)) {
          _this._nodesToBeRemoved || (_this._nodesToBeRemoved = new Batman.SimpleSet);
          return _this._nodesToBeRemoved.add(node);
        } else {
          return _this._removeItem(item);
        }
      });
    };

    IteratorBinding.prototype._itemForNode = function(node) {
      return Batman._data(node, "" + this.iteratorName + "Item");
    };

    IteratorBinding.prototype._newNodeForItem = function(newItem) {
      var newNode, renderer, _this = this;
      newNode = this.prototypeNode.cloneNode(true);
      this._nodesToBeRendered || (this._nodesToBeRendered = new Batman.SimpleSet);
      this._nodesToBeRendered.add(newNode);
      Batman._data(newNode, "" + this.iteratorName + "Item", newItem);
      this.nodeMap.set(newItem, newNode);
      this.parentRenderer.prevent('rendered');
      renderer = new Batman.Renderer(newNode, this.renderContext.descend(newItem, this.iteratorName), this.parentRenderer.view);
      renderer.once('rendered', function() {
        var _ref;
        _this._nodesToBeRendered.remove(newNode);
        if ((_ref = _this._nodesToBeRemoved) != null ? _ref.has(newNode) : void 0) {
          _this._nodesToBeRemoved.remove(newNode);
          _this._removeItem(newItem);
        } else {
          Batman.DOM.propagateBindingEvents(newNode);
          _this.fire('nodeAdded', newNode, newItem);
        }
        return _this.parentRenderer.allowAndFire('rendered');
      });
      return newNode;
    };

    IteratorBinding.prototype._getStartNodeIndex = function() {
      var index, node, _i, _len, _ref;
      _ref = this.parentNode().childNodes;
      for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) {
        node = _ref[index];
        if (node === this.startNode) {
          return index;
        }
      }
      return 0;
    };

    IteratorBinding.prototype._removeItem = function(item) {
      var node;
      node = this.nodeMap.unset(item);
      Batman.DOM.destroyNode(node);
      return this.fire('nodeRemoved', node, item);
    };

    IteratorBinding.prototype.die = function() {
      var _ref;
      if (this._nodesToBeRendered && !this._nodesToBeRendered.isEmpty()) {
        this._nodesToBeRemoved || (this._nodesToBeRemoved = new Batman.SimpleSet);
        (_ref = this._nodesToBeRemoved).add.apply(_ref, this._nodesToBeRendered.toArray());
      }
      return IteratorBinding.__super__.die.apply(this, arguments);
    };

    return IteratorBinding;

  })(Batman.DOM.AbstractCollectionBinding);

}).call(this);

(function() {
  var __bind = function(fn, me) {
      return function() {
        return fn.apply(me, arguments);
      };
    },
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.DOM.ClassBinding = (function(_super) {

    __extends(ClassBinding, _super);

    function ClassBinding() {
      this.handleArrayChanged = __bind(this.handleArrayChanged, this);
      return ClassBinding.__super__.constructor.apply(this, arguments);
    }

    ClassBinding.prototype.onlyObserve = Batman.BindingDefinitionOnlyObserve.Data;

    ClassBinding.prototype.dataChange = function(value) {
      if (value != null) {
        this.unbindCollection();
        if (typeof value === 'string') {
          return this.node.className = value;
        } else {
          this.bindCollection(value);
          return this.updateFromCollection();
        }
      }
    };

    ClassBinding.prototype.updateFromCollection = function() {
      var array, k, v;
      if (this.collection) {
        array = this.collection.map ? this.collection.map(function(x) {
          return x;
        }) : (function() {
          var _ref, _results;
          _ref = this.collection;
          _results = [];
          for (k in _ref) {
            if (!__hasProp.call(_ref, k)) continue;
            v = _ref[k];
            _results.push(k);
          }
          return _results;
        }).call(this);
        if (array.toArray != null) {
          array = array.toArray();
        }
        return this.node.className = array.join(' ');
      }
    };

    ClassBinding.prototype.handleArrayChanged = function() {
      return this.updateFromCollection();
    };

    return ClassBinding;

  })(Batman.DOM.AbstractCollectionBinding);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.ValidationError = (function(_super) {

    __extends(ValidationError, _super);

    ValidationError.accessor('fullMessage', function() {
      return Batman.t('errors.format', {
        attribute: Batman.helpers.humanize(this.attribute),
        message: this.message
      });
    });

    function ValidationError(attribute, message) {
      ValidationError.__super__.constructor.call(this, {
        attribute: attribute,
        message: message
      });
    }

    return ValidationError;

  })(Batman.Object);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    },
    __slice = [].slice;

  Batman.StorageAdapter = (function(_super) {

    __extends(StorageAdapter, _super);

    StorageAdapter.StorageError = (function(_super1) {

      __extends(StorageError, _super1);

      StorageError.prototype.name = "StorageError";

      function StorageError(message) {
        StorageError.__super__.constructor.apply(this, arguments);
        this.message = message;
      }

      return StorageError;

    })(Error);

    StorageAdapter.RecordExistsError = (function(_super1) {

      __extends(RecordExistsError, _super1);

      RecordExistsError.prototype.name = 'RecordExistsError';

      function RecordExistsError(message) {
        RecordExistsError.__super__.constructor.call(this, message || "Can't create this record because it already exists in the store!");
      }

      return RecordExistsError;

    })(StorageAdapter.StorageError);

    StorageAdapter.NotFoundError = (function(_super1) {

      __extends(NotFoundError, _super1);

      NotFoundError.prototype.name = 'NotFoundError';

      function NotFoundError(message) {
        NotFoundError.__super__.constructor.call(this, message || "Record couldn't be found in storage!");
      }

      return NotFoundError;

    })(StorageAdapter.StorageError);

    StorageAdapter.NotAllowedError = (function(_super1) {

      __extends(NotAllowedError, _super1);

      NotAllowedError.prototype.name = "NotAllowedError";

      function NotAllowedError(message) {
        NotAllowedError.__super__.constructor.call(this, message || "Storage operation denied access to the operation!");
      }

      return NotAllowedError;

    })(StorageAdapter.StorageError);

    StorageAdapter.NotAcceptableError = (function(_super1) {

      __extends(NotAcceptableError, _super1);

      NotAcceptableError.prototype.name = "NotAcceptableError";

      function NotAcceptableError(message) {
        NotAcceptableError.__super__.constructor.call(this, message || "Storage operation permitted but the request was malformed!");
      }

      return NotAcceptableError;

    })(StorageAdapter.StorageError);

    StorageAdapter.UnprocessableRecordError = (function(_super1) {

      __extends(UnprocessableRecordError, _super1);

      UnprocessableRecordError.prototype.name = "UnprocessableRecordError";

      function UnprocessableRecordError(message) {
        UnprocessableRecordError.__super__.constructor.call(this, message || "Storage adapter could not process the record!");
      }

      return UnprocessableRecordError;

    })(StorageAdapter.StorageError);

    StorageAdapter.InternalStorageError = (function(_super1) {

      __extends(InternalStorageError, _super1);

      InternalStorageError.prototype.name = "InternalStorageError";

      function InternalStorageError(message) {
        InternalStorageError.__super__.constructor.call(this, message || "An error occured during the storage operation!");
      }

      return InternalStorageError;

    })(StorageAdapter.StorageError);

    StorageAdapter.NotImplementedError = (function(_super1) {

      __extends(NotImplementedError, _super1);

      NotImplementedError.prototype.name = "NotImplementedError";

      function NotImplementedError(message) {
        NotImplementedError.__super__.constructor.call(this, message || "This operation is not implemented by the storage adpater!");
      }

      return NotImplementedError;

    })(StorageAdapter.StorageError);

    function StorageAdapter(model) {
      var constructor;
      StorageAdapter.__super__.constructor.call(this, {
        model: model
      });
      constructor = this.constructor;
      if (constructor.ModelMixin) {
        Batman.extend(model, constructor.ModelMixin);
      }
      if (constructor.RecordMixin) {
        Batman.extend(model.prototype, constructor.RecordMixin);
      }
    }

    StorageAdapter.prototype.isStorageAdapter = true;

    StorageAdapter.prototype.storageKey = function(record) {
      var model;
      model = (record != null ? record.constructor : void 0) || this.model;
      return model.get('storageKey') || Batman.helpers.pluralize(Batman.helpers.underscore(model.get('resourceName')));
    };

    StorageAdapter.prototype.getRecordFromData = function(attributes, constructor) {
      var record;
      if (constructor == null) {
        constructor = this.model;
      }
      record = new constructor();
      record._withoutDirtyTracking(function() {
        return this.fromJSON(attributes);
      });
      return record;
    };

    StorageAdapter.skipIfError = function(f) {
      return function(env, next) {
        if (env.error != null) {
          return next();
        } else {
          return f.call(this, env, next);
        }
      };
    };

    StorageAdapter.prototype.before = function() {
      return this._addFilter.apply(this, ['before'].concat(__slice.call(arguments)));
    };

    StorageAdapter.prototype.after = function() {
      return this._addFilter.apply(this, ['after'].concat(__slice.call(arguments)));
    };

    StorageAdapter.prototype._inheritFilters = function() {
      var filtersByKey, filtersList, key, oldFilters, position, _results;
      if (!this._batman.check(this) || !this._batman.filters) {
        oldFilters = this._batman.getFirst('filters');
        this._batman.filters = {
          before: {},
          after: {}
        };
        if (oldFilters != null) {
          _results = [];
          for (position in oldFilters) {
            filtersByKey = oldFilters[position];
            _results.push((function() {
              var _results1;
              _results1 = [];
              for (key in filtersByKey) {
                filtersList = filtersByKey[key];
                _results1.push(this._batman.filters[position][key] = filtersList.slice(0));
              }
              return _results1;
            }).call(this));
          }
          return _results;
        }
      }
    };

    StorageAdapter.prototype._addFilter = function() {
      var filter, key, keys, position, _base, _i, _j, _len;
      position = arguments[0], keys = 3 <= arguments.length ? __slice.call(arguments, 1, _i = arguments.length - 1) : (_i = 1, []), filter = arguments[_i++];
      this._inheritFilters();
      for (_j = 0, _len = keys.length; _j < _len; _j++) {
        key = keys[_j];
        (_base = this._batman.filters[position])[key] || (_base[key] = []);
        this._batman.filters[position][key].push(filter);
      }
      return true;
    };

    StorageAdapter.prototype.runFilter = function(position, action, env, callback) {
      var actionFilters, allFilters, filters, next, _this = this;
      this._inheritFilters();
      allFilters = this._batman.filters[position].all || [];
      actionFilters = this._batman.filters[position][action] || [];
      env.action = action;
      filters = position === 'before' ? actionFilters.concat(allFilters) : allFilters.concat(actionFilters);
      next = function(newEnv) {
        var nextFilter;
        if (newEnv != null) {
          env = newEnv;
        }
        if ((nextFilter = filters.shift()) != null) {
          return nextFilter.call(_this, env, next);
        } else {
          return callback.call(_this, env);
        }
      };
      return next();
    };

    StorageAdapter.prototype.runBeforeFilter = function() {
      return this.runFilter.apply(this, ['before'].concat(__slice.call(arguments)));
    };

    StorageAdapter.prototype.runAfterFilter = function(action, env, callback) {
      return this.runFilter('after', action, env, this.exportResult(callback));
    };

    StorageAdapter.prototype.exportResult = function(callback) {
      return function(env) {
        return callback(env.error, env.result, env);
      };
    };

    StorageAdapter.prototype._jsonToAttributes = function(json) {
      return JSON.parse(json);
    };

    StorageAdapter.prototype.perform = function(key, subject, options, callback) {
      var env, next, _this = this;
      options || (options = {});
      env = {
        options: options,
        subject: subject
      };
      next = function(newEnv) {
        if (newEnv != null) {
          env = newEnv;
        }
        return _this.runAfterFilter(key, env, callback);
      };
      this.runBeforeFilter(key, env, function(env) {
        return this[key](env, next);
      });
      return void 0;
    };

    return StorageAdapter;

  })(Batman.Object);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    },
    __slice = [].slice,
    __indexOf = [].indexOf ||
  function(item) {
    for (var i = 0, l = this.length; i < l; i++) {
      if (i in this && this[i] === item) return i;
    }
    return -1;
  };

  Batman.RestStorage = (function(_super) {
    var key, _fn, _i, _len, _ref, _this = this;

    __extends(RestStorage, _super);

    RestStorage.CommunicationError = (function(_super1) {

      __extends(CommunicationError, _super1);

      CommunicationError.prototype.name = 'CommunicationError';

      function CommunicationError(message) {
        CommunicationError.__super__.constructor.call(this, message || "A communication error has occurred!");
      }

      return CommunicationError;

    })(RestStorage.StorageError);

    RestStorage.JSONContentType = 'application/json';

    RestStorage.PostBodyContentType = 'application/x-www-form-urlencoded';

    RestStorage.BaseMixin = {
      request: function(action, options, callback) {
        if (!callback) {
          callback = options;
          options = {};
        }
        options.method || (options.method = 'GET');
        options.action = action;
        return this._doStorageOperation(options.method.toLowerCase(), options, callback);
      }
    };

    RestStorage.ModelMixin = Batman.extend({}, RestStorage.BaseMixin, {
      urlNestsUnder: function() {
        var key, keys, parents, _i, _len;
        keys = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
        parents = {};
        for (_i = 0, _len = keys.length; _i < _len; _i++) {
          key = keys[_i];
          parents[key + '_id'] = Batman.helpers.pluralize(key);
        }
        this.url = function(options) {
          var childSegment, parentID, plural;
          childSegment = Batman.helpers.pluralize(this.get('resourceName').toLowerCase());
          for (key in parents) {
            plural = parents[key];
            parentID = options.data[key];
            if (parentID) {
              delete options.data[key];
              return "" + plural + "/" + parentID + "/" + childSegment;
            }
          }
          return childSegment;
        };
        return this.prototype.url = function() {
          var childSegment, id, parentID, plural, url;
          childSegment = Batman.helpers.pluralize(this.constructor.get('resourceName').toLowerCase());
          for (key in parents) {
            plural = parents[key];
            parentID = this.get('dirtyKeys').get(key);
            if (parentID === void 0) {
              parentID = this.get(key);
            }
            if (parentID) {
              url = "" + plural + "/" + parentID + "/" + childSegment;
              break;
            }
          }
          url || (url = childSegment);
          if (id = this.get('id')) {
            url += '/' + id;
          }
          return url;
        };
      }
    });

    RestStorage.RecordMixin = Batman.extend({}, RestStorage.BaseMixin);

    RestStorage.prototype.defaultRequestOptions = {
      type: 'json'
    };

    RestStorage.prototype._implicitActionNames = ['create', 'read', 'update', 'destroy', 'readAll'];

    RestStorage.prototype.serializeAsForm = true;

    function RestStorage() {
      RestStorage.__super__.constructor.apply(this, arguments);
      this.defaultRequestOptions = Batman.extend({}, this.defaultRequestOptions);
    }

    RestStorage.prototype.recordJsonNamespace = function(record) {
      return Batman.helpers.singularize(this.storageKey(record));
    };

    RestStorage.prototype.collectionJsonNamespace = function(constructor) {
      return Batman.helpers.pluralize(this.storageKey(constructor.prototype));
    };

    RestStorage.prototype._execWithOptions = function(object, key, options, context) {
      if (context == null) {
        context = object;
      }
      if (typeof object[key] === 'function') {
        return object[key].call(context, options);
      } else {
        return object[key];
      }
    };

    RestStorage.prototype._defaultCollectionUrl = function(model) {
      return "" + (this.storageKey(model.prototype));
    };

    RestStorage.prototype._addParams = function(url, options) {
      var _ref;
      if (options && options.action && !(_ref = options.action, __indexOf.call(this._implicitActionNames, _ref) >= 0)) {
        url += '/' + options.action.toLowerCase();
      }
      return url;
    };

    RestStorage.prototype._addUrlAffixes = function(url, subject, env) {
      var prefix, segments;
      segments = [url, this.urlSuffix(subject, env)];
      if (url.charAt(0) !== '/') {
        prefix = this.urlPrefix(subject, env);
        if (prefix.charAt(prefix.length - 1) !== '/') {
          segments.unshift('/');
        }
        segments.unshift(prefix);
      }
      return segments.join('');
    };

    RestStorage.prototype.urlPrefix = function(object, env) {
      return this._execWithOptions(object, 'urlPrefix', env.options) || '';
    };

    RestStorage.prototype.urlSuffix = function(object, env) {
      return this._execWithOptions(object, 'urlSuffix', env.options) || '';
    };

    RestStorage.prototype.urlForRecord = function(record, env) {
      var id, url, _ref;
      if ((_ref = env.options) != null ? _ref.recordUrl : void 0) {
        url = this._execWithOptions(env.options, 'recordUrl', env.options, record);
      } else if (record.url) {
        url = this._execWithOptions(record, 'url', env.options);
      } else {
        url = record.constructor.url ? this._execWithOptions(record.constructor, 'url', env.options) : this._defaultCollectionUrl(record.constructor);
        if (env.action !== 'create') {
          if ((id = record.get('id')) != null) {
            url = url + "/" + id;
          } else {
            throw new this.constructor.StorageError("Couldn't get/set record primary key on " + env.action + "!");
          }
        }
      }
      return this._addUrlAffixes(this._addParams(url, env.options), record, env);
    };

    RestStorage.prototype.urlForCollection = function(model, env) {
      var url, _ref;
      url = ((_ref = env.options) != null ? _ref.collectionUrl : void 0) ? this._execWithOptions(env.options, 'collectionUrl', env.options, env.options.urlContext) : model.url ? this._execWithOptions(model, 'url', env.options) : this._defaultCollectionUrl(model, env.options);
      return this._addUrlAffixes(this._addParams(url, env.options), model, env);
    };

    RestStorage.prototype.request = function(env, next) {
      var options;
      options = Batman.extend(env.options, {
        autosend: false,
        success: function(data) {
          return env.data = data;
        },
        error: function(error) {
          return env.error = error;
        },
        loaded: function() {
          env.response = env.request.get('response');
          return next();
        }
      });
      env.request = new Batman.Request(options);
      return env.request.send();
    };

    RestStorage.prototype.perform = function(key, record, options, callback) {
      options || (options = {});
      Batman.extend(options, this.defaultRequestOptions);
      return RestStorage.__super__.perform.call(this, key, record, options, callback);
    };

    RestStorage.prototype.before('all', RestStorage.skipIfError(function(env, next) {
      if (!env.options.url) {
        try {
          env.options.url = env.subject.prototype ? this.urlForCollection(env.subject, env) : this.urlForRecord(env.subject, env);
        } catch (error) {
          env.error = error;
        }
      }
      return next();
    }));

    RestStorage.prototype.before('get', 'put', 'post', 'delete', RestStorage.skipIfError(function(env, next) {
      env.options.method = env.action.toUpperCase();
      return next();
    }));

    RestStorage.prototype.before('create', 'update', RestStorage.skipIfError(function(env, next) {
      var data, json, namespace;
      json = env.subject.toJSON();
      if (namespace = this.recordJsonNamespace(env.subject)) {
        data = {};
        data[namespace] = json;
      } else {
        data = json;
      }
      env.options.data = data;
      return next();
    }));

    RestStorage.prototype.before('create', 'update', 'put', 'post', RestStorage.skipIfError(function(env, next) {
      if (this.serializeAsForm) {
        env.options.contentType = this.constructor.PostBodyContentType;
      } else {
        if (env.options.data != null) {
          env.options.data = JSON.stringify(env.options.data);
          env.options.contentType = this.constructor.JSONContentType;
        }
      }
      return next();
    }));

    RestStorage.prototype.after('all', RestStorage.skipIfError(function(env, next) {
      var json;
      if (!(env.data != null)) {
        return next();
      }
      if (typeof env.data === 'string') {
        if (env.data.length > 0) {
          try {
            json = this._jsonToAttributes(env.data);
          } catch (error) {
            env.error = error;
            return next();
          }
        }
      } else if (typeof env.data === 'object') {
        json = env.data;
      }
      if (json != null) {
        env.json = json;
      }
      return next();
    }));

    RestStorage.prototype.extractFromNamespace = function(data, namespace) {
      if (namespace && (data[namespace] != null)) {
        return data[namespace];
      } else {
        return data;
      }
    };

    RestStorage.prototype.after('create', 'read', 'update', RestStorage.skipIfError(function(env, next) {
      var json;
      if (env.json != null) {
        json = this.extractFromNamespace(env.json, this.recordJsonNamespace(env.subject));
        env.subject._withoutDirtyTracking(function() {
          return this.fromJSON(json);
        });
      }
      env.result = env.subject;
      return next();
    }));

    RestStorage.prototype.after('readAll', RestStorage.skipIfError(function(env, next) {
      var jsonRecordAttributes, namespace;
      namespace = this.collectionJsonNamespace(env.subject);
      env.recordsAttributes = this.extractFromNamespace(env.json, namespace);
      if (Batman.typeOf(env.recordsAttributes) !== 'Array') {
        namespace = this.recordJsonNamespace(env.subject.prototype);
        env.recordsAttributes = [this.extractFromNamespace(env.json, namespace)];
      }
      env.result = env.records = (function() {
        var _i, _len, _ref, _results;
        _ref = env.recordsAttributes;
        _results = [];
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          jsonRecordAttributes = _ref[_i];
          _results.push(this.getRecordFromData(jsonRecordAttributes, env.subject));
        }
        return _results;
      }).call(this);
      return next();
    }));

    RestStorage.prototype.after('get', 'put', 'post', 'delete', RestStorage.skipIfError(function(env, next) {
      var json, namespace;
      if (env.json != null) {
        json = env.json;
        namespace = env.subject.prototype ? this.collectionJsonNamespace(env.subject) : this.recordJsonNamespace(env.subject);
        env.result = namespace && (env.json[namespace] != null) ? env.json[namespace] : env.json;
      }
      return next();
    }));

    RestStorage.HTTPMethods = {
      create: 'POST',
      update: 'PUT',
      read: 'GET',
      readAll: 'GET',
      destroy: 'DELETE'
    };

    _ref = ['create', 'read', 'update', 'destroy', 'readAll', 'get', 'post', 'put', 'delete'];
    _fn = function(key) {
      return RestStorage.prototype[key] = RestStorage.skipIfError(function(env, next) {
        var _base;
        (_base = env.options).method || (_base.method = this.constructor.HTTPMethods[key]);
        return this.request(env, next);
      });
    };
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
      key = _ref[_i];
      _fn(key);
    }

    RestStorage.prototype.after('all', function(env, next) {
      if (env.error) {
        env.error = this._errorFor(env.error, env);
      }
      return next();
    });

    RestStorage._statusCodeErrors = {
      '0': RestStorage.CommunicationError,
      '403': RestStorage.NotAllowedError,
      '404': RestStorage.NotFoundError,
      '406': RestStorage.NotAcceptableError,
      '409': RestStorage.RecordExistsError,
      '422': RestStorage.UnprocessableRecordError,
      '500': RestStorage.InternalStorageError,
      '501': RestStorage.NotImplementedError
    };

    RestStorage.prototype._errorFor = function(error, env) {
      var errorClass, request;
      if (error instanceof Error || !(error.request != null)) {
        return error;
      }
      if (errorClass = this.constructor._statusCodeErrors[error.request.status]) {
        request = error.request;
        error = new errorClass;
        error.request = request;
        error.env = env;
      }
      return error;
    };

    return RestStorage;

  }).call(this, Batman.StorageAdapter);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.LocalStorage = (function(_super) {

    __extends(LocalStorage, _super);

    function LocalStorage() {
      if (typeof window.localStorage === 'undefined') {
        return null;
      }
      LocalStorage.__super__.constructor.apply(this, arguments);
      this.storage = localStorage;
    }

    LocalStorage.prototype.storageRegExpForRecord = function(record) {
      return new RegExp("^" + (this.storageKey(record)) + "(\\d+)$");
    };

    LocalStorage.prototype.nextIdForRecord = function(record) {
      var nextId, re;
      re = this.storageRegExpForRecord(record);
      nextId = 1;
      this._forAllStorageEntries(function(k, v) {
        var matches;
        if (matches = re.exec(k)) {
          return nextId = Math.max(nextId, parseInt(matches[1], 10) + 1);
        }
      });
      return nextId;
    };

    LocalStorage.prototype._forAllStorageEntries = function(iterator) {
      var i, key, _i, _ref;
      for (i = _i = 0, _ref = this.storage.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
        key = this.storage.key(i);
        iterator.call(this, key, this.storage.getItem(key));
      }
      return true;
    };

    LocalStorage.prototype._storageEntriesMatching = function(constructor, options) {
      var re, records;
      re = this.storageRegExpForRecord(constructor.prototype);
      records = [];
      this._forAllStorageEntries(function(storageKey, storageString) {
        var data, keyMatches;
        if (keyMatches = re.exec(storageKey)) {
          data = this._jsonToAttributes(storageString);
          data[constructor.primaryKey] = keyMatches[1];
          if (this._dataMatches(options, data)) {
            return records.push(data);
          }
        }
      });
      return records;
    };

    LocalStorage.prototype._dataMatches = function(conditions, data) {
      var k, match, v;
      match = true;
      for (k in conditions) {
        v = conditions[k];
        if (data[k] !== v) {
          match = false;
          break;
        }
      }
      return match;
    };

    LocalStorage.prototype.before('read', 'create', 'update', 'destroy', LocalStorage.skipIfError(function(env, next) {
      var _this = this;
      if (env.action === 'create') {
        env.id = env.subject.get('id') || env.subject._withoutDirtyTracking(function() {
          return env.subject.set('id', _this.nextIdForRecord(env.subject));
        });
      } else {
        env.id = env.subject.get('id');
      }
      if (env.id == null) {
        env.error = new this.constructor.StorageError("Couldn't get/set record primary key on " + env.action + "!");
      } else {
        env.key = this.storageKey(env.subject) + env.id;
      }
      return next();
    }));

    LocalStorage.prototype.before('create', 'update', LocalStorage.skipIfError(function(env, next) {
      env.recordAttributes = JSON.stringify(env.subject);
      return next();
    }));

    LocalStorage.prototype.after('read', LocalStorage.skipIfError(function(env, next) {
      if (typeof env.recordAttributes === 'string') {
        try {
          env.recordAttributes = this._jsonToAttributes(env.recordAttributes);
        } catch (error) {
          env.error = error;
          return next();
        }
      }
      env.subject._withoutDirtyTracking(function() {
        return this.fromJSON(env.recordAttributes);
      });
      return next();
    }));

    LocalStorage.prototype.after('read', 'create', 'update', 'destroy', LocalStorage.skipIfError(function(env, next) {
      env.result = env.subject;
      return next();
    }));

    LocalStorage.prototype.after('readAll', LocalStorage.skipIfError(function(env, next) {
      var recordAttributes;
      env.result = env.records = (function() {
        var _i, _len, _ref, _results;
        _ref = env.recordsAttributes;
        _results = [];
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          recordAttributes = _ref[_i];
          _results.push(this.getRecordFromData(recordAttributes, env.subject));
        }
        return _results;
      }).call(this);
      return next();
    }));

    LocalStorage.prototype.read = LocalStorage.skipIfError(function(env, next) {
      env.recordAttributes = this.storage.getItem(env.key);
      if (!env.recordAttributes) {
        env.error = new this.constructor.NotFoundError();
      }
      return next();
    });

    LocalStorage.prototype.create = LocalStorage.skipIfError(function(_arg, next) {
      var key, recordAttributes;
      key = _arg.key, recordAttributes = _arg.recordAttributes;
      if (this.storage.getItem(key)) {
        arguments[0].error = new this.constructor.RecordExistsError;
      } else {
        this.storage.setItem(key, recordAttributes);
      }
      return next();
    });

    LocalStorage.prototype.update = LocalStorage.skipIfError(function(_arg, next) {
      var key, recordAttributes;
      key = _arg.key, recordAttributes = _arg.recordAttributes;
      this.storage.setItem(key, recordAttributes);
      return next();
    });

    LocalStorage.prototype.destroy = LocalStorage.skipIfError(function(_arg, next) {
      var key;
      key = _arg.key;
      this.storage.removeItem(key);
      return next();
    });

    LocalStorage.prototype.readAll = LocalStorage.skipIfError(function(env, next) {
      try {
        arguments[0].recordsAttributes = this._storageEntriesMatching(env.subject, env.options.data);
      } catch (error) {
        arguments[0].error = error;
      }
      return next();
    });

    return LocalStorage;

  })(Batman.StorageAdapter);

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.SessionStorage = (function(_super) {

    __extends(SessionStorage, _super);

    function SessionStorage() {
      if (typeof window.sessionStorage === 'undefined') {
        return null;
      }
      SessionStorage.__super__.constructor.apply(this, arguments);
      this.storage = sessionStorage;
    }

    return SessionStorage;

  })(Batman.LocalStorage);

}).call(this);

(function() {

  Batman.Encoders = new Batman.Object;

}).call(this);

(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) {
      for (var key in parent) {
        if (__hasProp.call(parent, key)) child[key] = parent[key];
      }
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
      child.__super__ = parent.prototype;
      return child;
    };

  Batman.ParamsReplacer = (function(_super) {

    __extends(ParamsReplacer, _super);

    function ParamsReplacer(navigator, params) {
      this.navigator = navigator;
      this.params = params;
    }

    ParamsReplacer.prototype.redirect = function() {
      return this.navigator.replace(this.toObject());
    };

    ParamsReplacer.prototype.replace = function(params) {
      this.params.replace(params);
      return this.redirect();
    };

    ParamsReplacer.prototype.update = function(params) {
      this.params.update(params);
      return this.redirect();
    };

    ParamsReplacer.prototype.clear = function() {
      this.params.clear();
      return this.redirect();
    };

    ParamsReplacer.prototype.toObject = function() {
      return this.params.toObject();
    };

    ParamsReplacer.accessor({
      get: function(k) {
        return this.params.get(k);
      },
      set: function(k, v) {
        var oldValue, result;
        oldValue = this.params.get(k);
        result = this.params.set(k, v);
        if (oldValue !== v) {
          this.redirect();
        }
        return result;
      },
      unset: function(k) {
        var hadKey, result;
        hadKey = this.params.hasKey(k);
        result = this.params.unset(k);
        if (hadKey) {
          this.redirect();
        }
        return result;
      }
    });

    return ParamsReplacer;

  })(Batman.Object);

}).call(this);

(function() {
  var __hasProp = {
Download .txt
gitextract_5ra_d6aq/

├── .gitignore
├── .travis.yml
├── CONTRIBUTING.md
├── Gemfile
├── MIT-LICENSE
├── README.md
├── Rakefile
├── bin/
│   └── dashing
├── dashing.gemspec
├── javascripts/
│   ├── batman.jquery.js
│   ├── batman.js
│   ├── dashing.coffee
│   ├── es5-shim.js
│   └── jquery.js
├── lib/
│   ├── dashing/
│   │   ├── app.rb
│   │   ├── cli.rb
│   │   └── downloader.rb
│   └── dashing.rb
├── shipit.rubygems.yml
├── templates/
│   ├── dashboard/
│   │   └── %name%.erb.tt
│   ├── job/
│   │   └── %name%.rb
│   ├── project/
│   │   ├── .gitignore
│   │   ├── Gemfile
│   │   ├── README.md
│   │   ├── assets/
│   │   │   ├── fonts/
│   │   │   │   └── FontAwesome.otf
│   │   │   ├── javascripts/
│   │   │   │   ├── application.coffee
│   │   │   │   ├── d3-3.2.8.js
│   │   │   │   ├── dashing.gridster.coffee
│   │   │   │   └── jquery.knob.js
│   │   │   └── stylesheets/
│   │   │       ├── application.scss
│   │   │       └── font-awesome.css
│   │   ├── config.ru
│   │   ├── dashboards/
│   │   │   ├── layout.erb
│   │   │   ├── sample.erb
│   │   │   └── sampletv.erb
│   │   ├── jobs/
│   │   │   ├── buzzwords.rb
│   │   │   ├── convergence.rb
│   │   │   ├── sample.rb
│   │   │   └── twitter.rb
│   │   ├── lib/
│   │   │   └── .empty_directory
│   │   ├── public/
│   │   │   └── 404.html
│   │   └── widgets/
│   │       ├── clock/
│   │       │   ├── clock.coffee
│   │       │   ├── clock.html
│   │       │   └── clock.scss
│   │       ├── comments/
│   │       │   ├── comments.coffee
│   │       │   ├── comments.html
│   │       │   └── comments.scss
│   │       ├── graph/
│   │       │   ├── graph.coffee
│   │       │   ├── graph.html
│   │       │   └── graph.scss
│   │       ├── iframe/
│   │       │   ├── iframe.coffee
│   │       │   ├── iframe.html
│   │       │   └── iframe.scss
│   │       ├── image/
│   │       │   ├── image.coffee
│   │       │   ├── image.html
│   │       │   └── image.scss
│   │       ├── list/
│   │       │   ├── list.coffee
│   │       │   ├── list.html
│   │       │   └── list.scss
│   │       ├── meter/
│   │       │   ├── meter.coffee
│   │       │   ├── meter.html
│   │       │   └── meter.scss
│   │       ├── number/
│   │       │   ├── number.coffee
│   │       │   ├── number.html
│   │       │   └── number.scss
│   │       └── text/
│   │           ├── text.coffee
│   │           ├── text.html
│   │           └── text.scss
│   └── widget/
│       └── %name%/
│           ├── %name%.coffee.tt
│           ├── %name%.html
│           └── %name%.scss.tt
└── test/
    ├── app_test.rb
    ├── cli_test.rb
    ├── downloader_test.rb
    └── test_helper.rb
Download .txt
SYMBOL INDEX (769 symbols across 12 files)

FILE: javascripts/batman.js
  function _Batman (line 57) | function _Batman(object) {
  function Inflector (line 552) | function Inflector() {
  function Event (line 951) | function Event(base, key) {
  function ctor (line 1083) | function ctor() {
  function PropertyEvent (line 1096) | function PropertyEvent() {
  function SimpleHash (line 1329) | function SimpleHash(obj) {
  function ctor (line 1591) | function ctor() {
  function AssociationCurator (line 1607) | function AssociationCurator(model) {
  function SimpleSet (line 1670) | function SimpleSet() {
  function Property (line 1967) | function Property(base, key) {
  function ctor (line 2306) | function ctor() {
  function Keypath (line 2319) | function Keypath(base, key) {
  function ReaderBindingDefinition (line 2749) | function ReaderBindingDefinition(node, keyPath, context, renderer) {
  function AttrReaderBindingDefinition (line 3001) | function AttrReaderBindingDefinition(node, attr, keyPath, context, rende...
  function ctor (line 3081) | function ctor() {
  function BatmanObject (line 3275) | function BatmanObject() {
  function ctor (line 3333) | function ctor() {
  function Renderer (line 3349) | function Renderer(node, context, view) {
  function ctor (line 3525) | function ctor() {
  function AbstractBinding (line 3625) | function AbstractBinding(definition) {
  function ctor (line 3765) | function ctor() {
  function ViewBinding (line 3782) | function ViewBinding() {
  function ctor (line 3830) | function ctor() {
  function ViewArgumentBinding (line 3843) | function ViewArgumentBinding() {
  function ctor (line 3861) | function ctor() {
  function ValueBinding (line 3874) | function ValueBinding(definition) {
  function ctor (line 3902) | function ctor() {
  function ShowHideBinding (line 3917) | function ShowHideBinding(definition) {
  function ctor (line 3970) | function ctor() {
  function SelectBinding (line 3987) | function SelectBinding() {
  function ctor (line 4109) | function ctor() {
  function RouteBinding (line 4122) | function RouteBinding() {
  function ctor (line 4191) | function ctor() {
  function RadioBinding (line 4204) | function RadioBinding() {
  function ctor (line 4245) | function ctor() {
  function MixinBinding (line 4258) | function MixinBinding() {
  function ctor (line 4282) | function ctor() {
  function FileBinding (line 4295) | function FileBinding() {
  function ctor (line 4324) | function ctor() {
  function DeferredRenderingBinding (line 4341) | function DeferredRenderingBinding() {
  function ctor (line 4371) | function ctor() {
  function AbstractAttributeBinding (line 4384) | function AbstractAttributeBinding(definition) {
  function ctor (line 4406) | function ctor() {
  function FormBinding (line 4431) | function FormBinding() {
  function ctor (line 4479) | function ctor() {
  function EventBinding (line 4494) | function EventBinding() {
  function ctor (line 4557) | function ctor() {
  function NodeAttributeBinding (line 4570) | function NodeAttributeBinding() {
  function ctor (line 4599) | function ctor() {
  function CheckedBinding (line 4612) | function CheckedBinding() {
  function ctor (line 4634) | function ctor() {
  function AttributeBinding (line 4647) | function AttributeBinding() {
  function ctor (line 4675) | function ctor() {
  function AddClassBinding (line 4690) | function AddClassBinding(definition) {
  function ctor (line 4741) | function ctor() {
  function AbstractCollectionBinding (line 4754) | function AbstractCollectionBinding() {
  function ctor (line 4807) | function ctor() {
  function StyleBinding (line 4823) | function StyleBinding() {
  function SingleStyleBinding (line 4930) | function SingleStyleBinding(definition, parent) {
  function ctor (line 4960) | function ctor() {
  function IteratorBinding (line 4983) | function IteratorBinding(definition) {
  function ctor (line 5130) | function ctor() {
  function ClassBinding (line 5143) | function ClassBinding() {
  function ctor (line 5201) | function ctor() {
  function ValidationError (line 5221) | function ValidationError(attribute, message) {
  function ctor (line 5240) | function ctor() {
  function StorageError (line 5260) | function StorageError(message) {
  function RecordExistsError (line 5275) | function RecordExistsError(message) {
  function NotFoundError (line 5289) | function NotFoundError(message) {
  function NotAllowedError (line 5303) | function NotAllowedError(message) {
  function NotAcceptableError (line 5317) | function NotAcceptableError(message) {
  function UnprocessableRecordError (line 5331) | function UnprocessableRecordError(message) {
  function InternalStorageError (line 5345) | function InternalStorageError(message) {
  function NotImplementedError (line 5359) | function NotImplementedError(message) {
  function StorageAdapter (line 5367) | function StorageAdapter(model) {
  function ctor (line 5528) | function ctor() {
  function CommunicationError (line 5556) | function CommunicationError(message) {
  function RestStorage (line 5635) | function RestStorage() {
  function ctor (line 5922) | function ctor() {
  function LocalStorage (line 5935) | function LocalStorage() {
  function ctor (line 6110) | function ctor() {
  function SessionStorage (line 6123) | function SessionStorage() {
  function ctor (line 6149) | function ctor() {
  function ParamsReplacer (line 6162) | function ParamsReplacer(navigator, params) {
  function ctor (line 6226) | function ctor() {
  function ParamsPusher (line 6239) | function ParamsPusher() {
  function ctor (line 6259) | function ctor() {
  function NamedRouteQuery (line 6274) | function NamedRouteQuery(routeMap, args) {
  function ctor (line 6412) | function ctor() {
  function ControllerDirectory (line 6465) | function ControllerDirectory() {
  function Dispatcher (line 6485) | function Dispatcher(app, routeMap) {
  function ctor (line 6554) | function ctor() {
  function Route (line 6584) | function Route(templatePath, baseParams) {
  function ctor (line 6729) | function ctor() {
  function ControllerActionRoute (line 6744) | function ControllerActionRoute(templatePath, options) {
  function ctor (line 6776) | function ctor() {
  function CallbackActionRoute (line 6789) | function CallbackActionRoute() {
  function ctor (line 6811) | function ctor() {
  function Metadata (line 6832) | function Metadata(hash) {
  function Hash (line 6855) | function Hash() {
  function ctor (line 6987) | function ctor() {
  function RenderCache (line 7002) | function RenderCache() {
  function ctor (line 7124) | function ctor() {
  function Controller (line 7268) | function Controller() {
  function ctor (line 7461) | function ctor() {
  function Set (line 7475) | function Set() {
  function ctor (line 7567) | function ctor() {
  function ErrorsSet (line 7580) | function ErrorsSet() {
  function ctor (line 7604) | function ctor() {
  function SetProxy (line 7619) | function SetProxy(base) {
  function ctor (line 7699) | function ctor() {
  function BinarySetOperation (line 7713) | function BinarySetOperation(left, right) {
  function ctor (line 7766) | function ctor() {
  function SetUnion (line 7780) | function SetUnion() {
  function ctor (line 7819) | function ctor() {
  function SetIntersection (line 7833) | function SetIntersection() {
  function ctor (line 7874) | function ctor() {
  function SetComplement (line 7888) | function SetComplement() {
  function ctor (line 7981) | function ctor() {
  function StateMachine (line 8057) | function StateMachine(startState) {
  function DelegatingStateMachine (line 8129) | function DelegatingStateMachine(startState, base) {
  function ctor (line 8153) | function ctor() {
  function InstanceLifecycleStateMachine (line 8442) | function InstanceLifecycleStateMachine() {
  function Model (line 8493) | function Model(idOrAttributes) {
  function ctor (line 8907) | function ctor() {
  function Proxy (line 8922) | function Proxy(target) {
  function ctor (line 8958) | function ctor() {
  function AssociationProxy (line 8973) | function AssociationProxy(association, model) {
  function ctor (line 9055) | function ctor() {
  function HasOneProxy (line 9068) | function HasOneProxy() {
  function ctor (line 9114) | function ctor() {
  function BelongsToProxy (line 9127) | function BelongsToProxy() {
  function ctor (line 9165) | function ctor() {
  function PolymorphicBelongsToProxy (line 9178) | function PolymorphicBelongsToProxy() {
  function ctor (line 9216) | function ctor() {
  function Accessible (line 9229) | function Accessible() {
  function TerminalAccessible (line 9241) | function TerminalAccessible() {
  function URI (line 9272) | function URI(str) {
  function ctor (line 9476) | function ctor() {
  function Request (line 9577) | function Request(options) {
  function ctor (line 9622) | function ctor() {
  function SetObserver (line 9636) | function SetObserver(base) {
  function ctor (line 9742) | function ctor() {
  function SetSort (line 9755) | function SetSort(base, key, order) {
  function ctor (line 9913) | function ctor() {
  function AssociationSet (line 9926) | function AssociationSet(foreignKeyValue, association) {
  function ctor (line 9981) | function ctor() {
  function PolymorphicAssociationSet (line 9994) | function PolymorphicAssociationSet(foreignKeyValue, foreignTypeKeyValue,...
  function ctor (line 10027) | function ctor() {
  function SetIndex (line 10049) | function SetIndex(base, key) {
  function ctor (line 10164) | function ctor() {
  function PolymorphicAssociationSetIndex (line 10177) | function PolymorphicAssociationSetIndex(association, type, key) {
  function ctor (line 10213) | function ctor() {
  function AssociationSetIndex (line 10226) | function AssociationSetIndex(association, key) {
  function ctor (line 10267) | function ctor() {
  function UniqueSetIndex (line 10280) | function UniqueSetIndex() {
  function ctor (line 10319) | function ctor() {
  function UniqueAssociationSetIndex (line 10332) | function UniqueAssociationSetIndex(association, key) {
  function ctor (line 10349) | function ctor() {
  function PolymorphicUniqueAssociationSetIndex (line 10362) | function PolymorphicUniqueAssociationSetIndex(association, type, key) {
  function Navigator (line 10396) | function Navigator(app) {
  function ctor (line 10504) | function ctor() {
  function PushStateNavigator (line 10517) | function PushStateNavigator() {
  function ctor (line 10579) | function ctor() {
  function HashbangNavigator (line 10592) | function HashbangNavigator() {
  function RouteMap (line 10665) | function RouteMap() {
  function RouteMapBuilder (line 10781) | function RouteMapBuilder(app, routeMap, parent, baseOptions) {
  function ctor (line 11001) | function ctor() {
  function App (line 11016) | function App() {
  function Association (line 11238) | function Association(model, label, options) {
  function ctor (line 11329) | function ctor() {
  function PluralAssociation (line 11346) | function PluralAssociation() {
  function ctor (line 11461) | function ctor() {
  function HasManyAssociation (line 11478) | function HasManyAssociation(model, label, options) {
  function ctor (line 11585) | function ctor() {
  function PolymorphicHasManyAssociation (line 11602) | function PolymorphicHasManyAssociation(model, label, options) {
  function ctor (line 11732) | function ctor() {
  function SingularAssociation (line 11745) | function SingularAssociation() {
  function ctor (line 11799) | function ctor() {
  function HasOneAssociation (line 11818) | function HasOneAssociation() {
  function ctor (line 11875) | function ctor() {
  function BelongsToAssociation (line 11900) | function BelongsToAssociation(model, label, options) {
  function ctor (line 11968) | function ctor() {
  function PolymorphicBelongsToAssociation (line 11989) | function PolymorphicBelongsToAssociation() {
  function ctor (line 12113) | function ctor() {
  function Validator (line 12166) | function Validator() {
  function ctor (line 12225) | function ctor() {
  function RegExpValidator (line 12242) | function RegExpValidator(options) {
  function ctor (line 12274) | function ctor() {
  function PresenceValidator (line 12287) | function PresenceValidator() {
  function ctor (line 12320) | function ctor() {
  function NumericValidator (line 12333) | function NumericValidator() {
  function ctor (line 12402) | function ctor() {
  function LengthValidator (line 12419) | function LengthValidator(options) {
  function ctor (line 12472) | function ctor() {
  function AssociatedValidator (line 12485) | function AssociatedValidator() {
  function ctor (line 12536) | function ctor() {
  function ControllerActionFrame (line 12555) | function ControllerActionFrame(options, onComplete) {
  function ctor (line 12605) | function ctor() {
  function InsertionBinding (line 12624) | function InsertionBinding(definition) {
  function ctor (line 13015) | function ctor() {
  function RenderContext (line 13047) | function RenderContext(object, parent) {
  function ContextProxy (line 13124) | function ContextProxy(definition) {
  function ctor (line 13146) | function ctor() {
  function ViewStore (line 13159) | function ViewStore() {
  function ctor (line 13241) | function ctor() {
  function YieldStorage (line 13259) | function YieldStorage() {
  function View (line 13390) | function View(options) {
  function ctor (line 13537) | function ctor() {
  function Yield (line 13609) | function Yield() {

FILE: javascripts/es5-shim.js
  function doesDefinePropertyWork (line 570) | function doesDefinePropertyWork(object) {

FILE: javascripts/jquery.js
  function cy (line 2) | function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.pa...
  function cu (line 2) | function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.cs...
  function ct (line 2) | function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),funct...
  function cs (line 2) | function cs(){cq=b}
  function cr (line 2) | function cr(){setTimeout(cs,0);return cq=f.now()}
  function ci (line 2) | function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(...
  function ch (line 2) | function ch(){try{return new a.XMLHttpRequest}catch(b){}}
  function cb (line 2) | function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.da...
  function ca (line 2) | function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i...
  function b_ (line 2) | function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a...
  function b$ (line 2) | function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d...
  function bZ (line 2) | function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],...
  function bY (line 2) | function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f...
  function bB (line 2) | function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b===...
  function bo (line 2) | function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTM...
  function bn (line 2) | function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!...
  function bm (line 2) | function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked...
  function bl (line 2) | function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getEl...
  function bk (line 2) | function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttrib...
  function bj (line 2) | function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(...
  function bi (line 2) | function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tb...
  function U (line 2) | function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.creat...
  function T (line 2) | function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d...
  function S (line 2) | function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}
  function K (line 2) | function K(){return!0}
  function J (line 2) | function J(){return!1}
  function n (line 2) | function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);...
  function m (line 2) | function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))conti...
  function l (line 2) | function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-...
  function h (line 2) | function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;...
  function J (line 2) | function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch...
  function a (line 2) | function a(b,c){return new a.fn.init(b,c)}
  function m (line 2) | function m(a){return function(b){e[a]=arguments.length>1?i.call(argument...
  function l (line 2) | function l(a){return function(c){b[a]=arguments.length>1?i.call(argument...
  function m (line 2) | function m(){--h||d.resolveWith(e,[e])}
  function x (line 3) | function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j)...
  function w (line 3) | function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j)...
  function w (line 4) | function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.ready...
  function g (line 4) | function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nod...
  function h (line 4) | function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}
  function h (line 4) | function h(a){return e.step(a)}

FILE: lib/dashing.rb
  type Dashing (line 5) | module Dashing

FILE: lib/dashing/app.rb
  function development? (line 13) | def development?
  function production? (line 17) | def production?
  function protected! (line 23) | def protected!
  function authenticated? (line 27) | def authenticated?(token)
  function stop_with_connection_closing (line 127) | def stop_with_connection_closing
  function send_event (line 136) | def send_event(id, body, target=nil)
  function format_event (line 144) | def format_event(body, name=nil)
  function latest_events (line 150) | def latest_events
  function first_dashboard (line 156) | def first_dashboard
  function tilt_html_engines (line 162) | def tilt_html_engines
  function require_glob (line 169) | def require_glob(relative_glob)

FILE: lib/dashing/cli.rb
  type Dashing (line 4) | module Dashing
    class CLI (line 5) | class CLI < Thor
      method hyphenate (line 13) | def hyphenate(str)
      method new (line 29) | def new(name)
      method generate (line 35) | def generate(type, name)
      method install (line 42) | def install(gist_id, *args)
      method start (line 59) | def start(*args)
      method stop (line 68) | def stop
      method job (line 74) | def job(name, auth_token = "")
      method run_command (line 88) | def run_command(command)
      method install_widget_from_gist (line 92) | def install_widget_from_gist(gist, skip_overwrite)
      method require_file (line 105) | def require_file(file)

FILE: lib/dashing/downloader.rb
  type Dashing (line 5) | module Dashing
    type Downloader (line 6) | module Downloader
      function get_gist (line 9) | def get_gist(gist_id)
      function get_json (line 13) | def get_json(url)

FILE: templates/project/assets/javascripts/d3-3.2.8.js
  function n (line 1) | function n(n){return null!=n&&!isNaN(n)}
  function t (line 1) | function t(n){return n.length}
  function e (line 1) | function e(n){for(var t=1;n*t%1;)t*=10;return t}
  function r (line 1) | function r(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{...
  function i (line 1) | function i(){}
  function u (line 1) | function u(){}
  function a (line 1) | function a(n,t,e){return function(){var r=e.apply(t,arguments);return r=...
  function o (line 1) | function o(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.substri...
  function c (line 1) | function c(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}
  function l (line 1) | function l(n){return Array.prototype.slice.call(n)}
  function s (line 1) | function s(){}
  function f (line 1) | function f(){}
  function h (line 1) | function h(n){function t(){for(var t,r=e,i=-1,u=r.length;++i<u;)(t=r[i]....
  function g (line 1) | function g(){ya.event.preventDefault()}
  function p (line 1) | function p(){for(var n,t=ya.event;n=t.sourceEvent;)t=n;return t}
  function m (line 1) | function m(n){for(var t=new f,e=0,r=arguments.length;++e<r;)t[arguments[...
  function d (line 1) | function d(n){return La(n,Ya),n}
  function v (line 1) | function v(n){return"function"==typeof n?n:function(){return Ha(n,this)}}
  function y (line 1) | function y(n){return"function"==typeof n?n:function(){return Fa(n,this)}}
  function M (line 1) | function M(n,t){function e(){this.removeAttribute(n)}function r(){this.r...
  function x (line 1) | function x(n){return n.trim().replace(/\s+/g," ")}
  function b (line 1) | function b(n){return new RegExp("(?:^|\\s+)"+ya.requote(n)+"(?:\\s+|$)",...
  function _ (line 1) | function _(n,t){function e(){for(var e=-1;++e<i;)n[e](this,t)}function r...
  function w (line 1) | function w(n){var t=b(n);return function(e,r){if(i=e.classList)return r?...
  function S (line 1) | function S(n,t,e){function r(){this.style.removeProperty(n)}function i()...
  function E (line 1) | function E(n,t){function e(){delete this[n]}function r(){this[n]=t}funct...
  function k (line 1) | function k(n){return"function"==typeof n?n:(n=ya.ns.qualify(n)).local?fu...
  function A (line 1) | function A(n){return{__data__:n}}
  function N (line 1) | function N(n){return function(){return Oa(this,n)}}
  function q (line 1) | function q(n){return arguments.length||(n=ya.ascending),function(t,e){re...
  function T (line 1) | function T(n,t){for(var e=0,r=n.length;r>e;e++)for(var i,u=n[e],a=0,o=u....
  function C (line 1) | function C(n){return La(n,Ua),n}
  function z (line 1) | function z(n){var t,e;return function(r,i,u){var a,o=n[u].update,c=o.len...
  function D (line 1) | function D(n,t,e){function r(){var t=this[a];t&&(this.removeEventListene...
  function j (line 1) | function j(n,t){return function(e){var r=ya.event;ya.event=e,t[0]=this._...
  function L (line 1) | function L(n,t){var e=j(n,t);return function(n){var t=this,r=n.relatedTa...
  function H (line 1) | function H(){var n=".dragsuppress-"+ ++Za,t="touchmove"+n,e="selectstart...
  function F (line 1) | function F(n,t){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e....
  function P (line 1) | function P(){}
  function O (line 1) | function O(n,t,e){return new Y(n,t,e)}
  function Y (line 1) | function Y(n,t,e){this.h=n,this.s=t,this.l=e}
  function R (line 1) | function R(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?u...
  function U (line 1) | function U(n){return n>0?1:0>n?-1:0}
  function I (line 1) | function I(n){return n>1?0:-1>n?Ka:Math.acos(n)}
  function V (line 1) | function V(n){return n>1?Ka/2:-1>n?-Ka/2:Math.asin(n)}
  function X (line 1) | function X(n){return(Math.exp(n)-Math.exp(-n))/2}
  function Z (line 1) | function Z(n){return(Math.exp(n)+Math.exp(-n))/2}
  function B (line 1) | function B(n){return(n=Math.sin(n/2))*n}
  function $ (line 1) | function $(n,t,e){return new W(n,t,e)}
  function W (line 1) | function W(n,t,e){this.h=n,this.c=t,this.l=e}
  function J (line 1) | function J(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),G(e,Math.cos(n*...
  function G (line 1) | function G(n,t,e){return new K(n,t,e)}
  function K (line 1) | function K(n,t,e){this.l=n,this.a=t,this.b=e}
  function Q (line 1) | function Q(n,t,e){var r=(n+16)/116,i=r+t/500,u=r-e/200;return i=tt(i)*uo...
  function nt (line 1) | function nt(n,t,e){return n>0?$(Math.atan2(e,t)*eo,Math.sqrt(t*t+e*e),n)...
  function tt (line 1) | function tt(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}
  function et (line 1) | function et(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}
  function rt (line 1) | function rt(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n...
  function it (line 1) | function it(n){return at(n>>16,255&n>>8,255&n)}
  function ut (line 1) | function ut(n){return it(n)+""}
  function at (line 1) | function at(n,t,e){return new ot(n,t,e)}
  function ot (line 1) | function ot(n,t,e){this.r=n,this.g=t,this.b=e}
  function ct (line 1) | function ct(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n...
  function lt (line 1) | function lt(n,t,e){var r,i,u,a=0,o=0,c=0;if(r=/([a-z]+)\((.*)\)/i.exec(n...
  function st (line 1) | function st(n,t,e){var r,i,u=Math.min(n/=255,t/=255,e/=255),a=Math.max(n...
  function ft (line 1) | function ft(n,t,e){n=ht(n),t=ht(t),e=ht(e);var r=et((.4124564*n+.3575761...
  function ht (line 1) | function ht(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}
  function gt (line 1) | function gt(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math...
  function pt (line 1) | function pt(n){return"function"==typeof n?n:function(){return n}}
  function mt (line 1) | function mt(n){return n}
  function dt (line 1) | function dt(n){return function(t,e,r){return 2===arguments.length&&"func...
  function vt (line 1) | function vt(n,t,e,r){function i(){var n,t=c.status;if(!t&&c.responseText...
  function yt (line 1) | function yt(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}
  function Mt (line 1) | function Mt(){var n=bt(),t=_t()-n;t>24?(isFinite(t)&&(clearTimeout(po),p...
  function xt (line 1) | function xt(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now())...
  function bt (line 1) | function bt(){var n=Date.now();for(mo=fo;mo;)n>=mo.time&&(mo.flush=mo.ca...
  function _t (line 1) | function _t(){for(var n,t=fo,e=1/0;t;)t.flush?t=n?n.next=t.next:fo=t.nex...
  function wt (line 1) | function wt(n,t){var e=Math.pow(10,3*Math.abs(8-t));return{scale:t>8?fun...
  function St (line 1) | function St(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}
  function Et (line 1) | function Et(n){return n+""}
  function kt (line 1) | function kt(){}
  function At (line 1) | function At(n,t,e){var r=e.s=n+t,i=r-n,u=r-i;e.t=n-u+(t-i)}
  function Nt (line 1) | function Nt(n,t){n&&qo.hasOwnProperty(n.type)&&qo[n.type](n,t)}
  function qt (line 1) | function qt(n,t,e){var r,i=-1,u=n.length-e;for(t.lineStart();++i<u;)r=n[...
  function Tt (line 1) | function Tt(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)qt(n[e]...
  function Ct (line 1) | function Ct(){function n(n,t){n*=to,t=t*to/2+Ka/4;var e=n-r,a=Math.cos(t...
  function zt (line 1) | function zt(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Ma...
  function Dt (line 1) | function Dt(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}
  function jt (line 1) | function jt(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1...
  function Lt (line 1) | function Lt(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}
  function Ht (line 1) | function Ht(n,t){return[n[0]*t,n[1]*t,n[2]*t]}
  function Ft (line 1) | function Ft(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[...
  function Pt (line 1) | function Pt(n){return[Math.atan2(n[1],n[0]),V(n[2])]}
  function Ot (line 1) | function Ot(n,t){return Math.abs(n[0]-t[0])<Qa&&Math.abs(n[1]-t[1])<Qa}
  function Yt (line 1) | function Yt(n,t){n*=to;var e=Math.cos(t*=to);Rt(e*Math.cos(n),e*Math.sin...
  function Rt (line 1) | function Rt(n,t,e){++Do,Lo+=(n-Lo)/Do,Ho+=(t-Ho)/Do,Fo+=(e-Fo)/Do}
  function Ut (line 1) | function Ut(){function n(n,i){n*=to;var u=Math.cos(i*=to),a=u*Math.cos(n...
  function It (line 1) | function It(){Vo.point=Yt}
  function Vt (line 1) | function Vt(){function n(n,t){n*=to;var e=Math.cos(t*=to),a=e*Math.cos(n...
  function Xt (line 1) | function Xt(){return!0}
  function Zt (line 1) | function Zt(n,t,e,r,i){var u=[],a=[];if(n.forEach(function(n){if(!((t=n....
  function Bt (line 1) | function Bt(n){if(t=n.length){for(var t,e,r=0,i=n[0];++r<t;)i.next=e=n[r...
  function $t (line 1) | function $t(n,t,e,r){return function(i){function u(t,e){n(t,e)&&i.point(...
  function Wt (line 1) | function Wt(n){return n.length>1}
  function Jt (line 1) | function Jt(){var n,t=[];return{lineStart:function(){t.push(n=[])},point...
  function Gt (line 1) | function Gt(n,t){return((n=n.point)[0]<0?n[1]-Ka/2-Qa:Ka/2-n[1])-((t=t.p...
  function Kt (line 1) | function Kt(n,t){var e=n[0],r=n[1],i=[Math.sin(e),-Math.cos(e),0],u=0,a=...
  function Qt (line 1) | function Qt(n){var t,e=0/0,r=0/0,i=0/0;return{lineStart:function(){n.lin...
  function ne (line 1) | function ne(n,t,e,r){var i,u,a=Math.sin(n-e);return Math.abs(a)>Qa?Math....
  function te (line 1) | function te(n,t,e,r){var i;if(null==n)i=e*Ka/2,r.point(-Ka,i),r.point(0,...
  function ee (line 1) | function ee(n){return Kt(Zo,n)}
  function re (line 1) | function re(n){function t(n,t){return Math.cos(n)*Math.cos(t)>a}function...
  function ie (line 1) | function ie(n,t,e,r){function i(r,i){return Math.abs(r[0]-n)<Qa?i>0?0:3:...
  function ue (line 1) | function ue(n,t,e){if(Math.abs(t)<Qa)return 0>=n;var r=n/t;if(t>0){if(r>...
  function ae (line 1) | function ae(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.i...
  function oe (line 1) | function oe(n){var t=0,e=Ka/3,r=be(n),i=r(t,e);return i.parallels=functi...
  function ce (line 1) | function ce(n,t){function e(n,t){var e=Math.sqrt(u-2*i*Math.sin(t))/i;re...
  function le (line 1) | function le(){function n(n,t){Wo+=i*n-r*t,r=n,i=t}var t,e,r,i;nc.point=f...
  function se (line 1) | function se(n,t){Jo>n&&(Jo=n),n>Ko&&(Ko=n),Go>t&&(Go=t),t>Qo&&(Qo=t)}
  function fe (line 1) | function fe(){function n(n,t){a.push("M",n,",",t,u)}function t(n,t){a.pu...
  function he (line 1) | function he(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" ...
  function ge (line 1) | function ge(n,t){Lo+=n,Ho+=t,++Fo}
  function pe (line 1) | function pe(){function n(n,r){var i=n-t,u=r-e,a=Math.sqrt(i*i+u*u);Po+=a...
  function me (line 1) | function me(){ec.point=ge}
  function de (line 1) | function de(){function n(n,t){var e=n-r,u=t-i,a=Math.sqrt(e*e+u*u);Po+=a...
  function ve (line 1) | function ve(n){function t(t,e){n.moveTo(t,e),n.arc(t,e,a,0,2*Ka)}functio...
  function ye (line 1) | function ye(n){function t(t){function r(e,r){e=n(e,r),t.point(e[0],e[1])...
  function Me (line 1) | function Me(n){var t=ye(function(t,e){return n([t*eo,e*eo])});return fun...
  function xe (line 1) | function xe(n){return be(function(){return n})()}
  function be (line 1) | function be(n){function t(n){return n=o(n[0]*to,n[1]*to),[n[0]*h+c,l-n[1...
  function _e (line 1) | function _e(n,t){return{point:function(e,r){r=n(e*to,r*to),e=r[0],t.poin...
  function we (line 1) | function we(n,t){return[n,t]}
  function Se (line 1) | function Se(n,t,e){return n?t||e?ae(ke(n),Ae(t,e)):ke(n):t||e?Ae(t,e):we}
  function Ee (line 1) | function Ee(n){return function(t,e){return t+=n,[t>Ka?t-2*Ka:-Ka>t?t+2*K...
  function ke (line 1) | function ke(n){var t=Ee(n);return t.invert=Ee(-n),t}
  function Ae (line 1) | function Ae(n,t){function e(n,t){var e=Math.cos(t),o=Math.cos(n)*e,c=Mat...
  function Ne (line 1) | function Ne(n,t){var e=Math.cos(n),r=Math.sin(n);return function(i,u,a,o...
  function qe (line 1) | function qe(n,t){var e=zt(t);e[0]-=n,Ft(e);var r=I(-e[1]);return((-e[2]<...
  function Te (line 1) | function Te(n,t,e){var r=ya.range(n,t-Qa,e).concat(t);return function(n)...
  function Ce (line 1) | function Ce(n,t,e){var r=ya.range(n,t-Qa,e).concat(t);return function(n)...
  function ze (line 1) | function ze(n){return n.source}
  function De (line 1) | function De(n){return n.target}
  function je (line 1) | function je(n,t,e,r){var i=Math.cos(t),u=Math.sin(t),a=Math.cos(r),o=Mat...
  function Le (line 1) | function Le(){function n(n,i){var u=Math.sin(i*=to),a=Math.cos(i),o=Math...
  function He (line 1) | function He(n,t){function e(t,e){var r=Math.cos(t),i=Math.cos(e),u=n(r*i...
  function Fe (line 1) | function Fe(n,t){function e(n,t){var e=Math.abs(Math.abs(t)-Ka/2)<Qa?0:a...
  function Pe (line 1) | function Pe(n,t){function e(n,t){var e=u-t;return[e*Math.sin(i*n),u-e*Ma...
  function Oe (line 1) | function Oe(n,t){return[n,Math.log(Math.tan(Ka/4+t/2))]}
  function Ye (line 1) | function Ye(n){var t,e=xe(n),r=e.scale,i=e.translate,u=e.clipExtent;retu...
  function Re (line 1) | function Re(n,t){var e=Math.cos(t)*Math.sin(n);return[Math.log((1+e)/(1-...
  function Ue (line 1) | function Ue(n){function t(t){function a(){l.push("M",u(n(s),o))}for(var ...
  function Ie (line 1) | function Ie(n){return n[0]}
  function Ve (line 1) | function Ve(n){return n[1]}
  function Xe (line 1) | function Xe(n){return n.join("L")}
  function Ze (line 1) | function Ze(n){return Xe(n)+"Z"}
  function Be (line 1) | function Be(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t<e;)i....
  function $e (line 1) | function $e(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t<e;)i....
  function We (line 1) | function We(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t<e;)i....
  function Je (line 1) | function Je(n,t){return n.length<4?Xe(n):n[1]+Qe(n.slice(1,n.length-1),n...
  function Ge (line 1) | function Ge(n,t){return n.length<3?Xe(n):n[0]+Qe((n.push(n[0]),n),nr([n[...
  function Ke (line 1) | function Ke(n,t){return n.length<3?Xe(n):n[0]+Qe(n,nr(n,t))}
  function Qe (line 1) | function Qe(n,t){if(t.length<1||n.length!=t.length&&n.length!=t.length+2...
  function nr (line 1) | function nr(n,t){for(var e,r=[],i=(1-t)/2,u=n[0],a=n[1],o=1,c=n.length;+...
  function tr (line 1) | function tr(n){if(n.length<3)return Xe(n);var t=1,e=n.length,r=n[0],i=r[...
  function er (line 1) | function er(n){if(n.length<4)return Xe(n);for(var t,e=[],r=-1,i=n.length...
  function rr (line 1) | function rr(n){for(var t,e,r=-1,i=n.length,u=i+4,a=[],o=[];++r<4;)e=n[r%...
  function ir (line 1) | function ir(n,t){var e=n.length-1;if(e)for(var r,i,u=n[0][0],a=n[0][1],o...
  function ur (line 1) | function ur(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]
  function ar (line 2) | function ar(n,t,e){n.push("C",ur(fc,t),",",ur(fc,e),",",ur(hc,t),",",ur(...
  function or (line 2) | function or(n,t){return(t[1]-n[1])/(t[0]-n[0])}
  function cr (line 2) | function cr(n){for(var t=0,e=n.length-1,r=[],i=n[0],u=n[1],a=r[0]=or(i,u...
  function lr (line 2) | function lr(n){for(var t,e,r,i,u=[],a=cr(n),o=-1,c=n.length-1;++o<c;)t=o...
  function sr (line 2) | function sr(n){return n.length<3?Xe(n):n[0]+Qe(n,lr(n))}
  function fr (line 2) | function fr(n,t,e,r){var i,u,a,o,c,l,s;return i=r[n],u=i[0],a=i[1],i=r[t...
  function hr (line 2) | function hr(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}
  function gr (line 2) | function gr(n,t,e,r){var i=n[0],u=e[0],a=t[0]-i,o=r[0]-u,c=n[1],l=e[1],s...
  function pr (line 2) | function pr(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}
  function mr (line 2) | function mr(n,t){var e={list:n.map(function(n,t){return{index:t,x:n[0],y...
  function dr (line 2) | function dr(n){return n.x}
  function vr (line 2) | function vr(n){return n.y}
  function yr (line 2) | function yr(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}
  function Mr (line 2) | function Mr(n,t,e,r,i,u){if(!n(t,e,r,i,u)){var a=.5*(e+i),o=.5*(r+u),c=t...
  function xr (line 2) | function xr(n,t){n=ya.rgb(n),t=ya.rgb(t);var e=n.r,r=n.g,i=n.b,u=t.r-e,a...
  function br (line 2) | function br(n,t){var e,r={},i={};for(e in n)e in t?r[e]=Sr(n[e],t[e]):i[...
  function _r (line 2) | function _r(n,t){return t-=n=+n,function(e){return n+t*e}}
  function wr (line 2) | function wr(n,t){var e,r,i,u,a,o=0,c=0,l=[],s=[];for(n+="",t+="",dc.last...
  function Sr (line 2) | function Sr(n,t){for(var e,r=ya.interpolators.length;--r>=0&&!(e=ya.inte...
  function Er (line 2) | function Er(n,t){var e,r=[],i=[],u=n.length,a=t.length,o=Math.min(n.leng...
  function kr (line 2) | function kr(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}
  function Ar (line 2) | function Ar(n){return function(t){return 1-n(1-t)}}
  function Nr (line 2) | function Nr(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}
  function qr (line 2) | function qr(n){return n*n}
  function Tr (line 2) | function Tr(n){return n*n*n}
  function Cr (line 2) | function Cr(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return ...
  function zr (line 2) | function zr(n){return function(t){return Math.pow(t,n)}}
  function Dr (line 2) | function Dr(n){return 1-Math.cos(n*Ka/2)}
  function jr (line 2) | function jr(n){return Math.pow(2,10*(n-1))}
  function Lr (line 2) | function Lr(n){return 1-Math.sqrt(1-n*n)}
  function Hr (line 2) | function Hr(n,t){var e;return arguments.length<2&&(t=.45),arguments.leng...
  function Fr (line 2) | function Fr(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}
  function Pr (line 2) | function Pr(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*...
  function Or (line 2) | function Or(n,t){n=ya.hcl(n),t=ya.hcl(t);var e=n.h,r=n.c,i=n.l,u=t.h-e,a...
  function Yr (line 2) | function Yr(n,t){n=ya.hsl(n),t=ya.hsl(t);var e=n.h,r=n.s,i=n.l,u=t.h-e,a...
  function Rr (line 2) | function Rr(n,t){n=ya.lab(n),t=ya.lab(t);var e=n.l,r=n.a,i=n.b,u=t.l-e,a...
  function Ur (line 2) | function Ur(n,t){return t-=n,function(e){return Math.round(n+t*e)}}
  function Ir (line 2) | function Ir(n){var t=[n.a,n.b],e=[n.c,n.d],r=Xr(t),i=Vr(t,e),u=Xr(Zr(e,t...
  function Vr (line 2) | function Vr(n,t){return n[0]*t[0]+n[1]*t[1]}
  function Xr (line 2) | function Xr(n){var t=Math.sqrt(Vr(n,n));return t&&(n[0]/=t,n[1]/=t),t}
  function Zr (line 2) | function Zr(n,t,e){return n[0]+=e*t[0],n[1]+=e*t[1],n}
  function Br (line 2) | function Br(n,t){var e,r=[],i=[],u=ya.transform(n),a=ya.transform(t),o=u...
  function $r (line 2) | function $r(n,t){return t=t-(n=+n)?1/(t-n):0,function(e){return(e-n)*t}}
  function Wr (line 2) | function Wr(n,t){return t=t-(n=+n)?1/(t-n):0,function(e){return Math.max...
  function Jr (line 2) | function Jr(n){for(var t=n.source,e=n.target,r=Kr(t,e),i=[t];t!==r;)t=t....
  function Gr (line 2) | function Gr(n){for(var t=[],e=n.parent;null!=e;)t.push(n),n=e,e=e.parent...
  function Kr (line 2) | function Kr(n,t){if(n===t)return n;for(var e=Gr(n),r=Gr(t),i=e.pop(),u=r...
  function Qr (line 2) | function Qr(n){n.fixed|=2}
  function ni (line 2) | function ni(n){n.fixed&=-7}
  function ti (line 2) | function ti(n){n.fixed|=4,n.px=n.x,n.py=n.y}
  function ei (line 2) | function ei(n){n.fixed&=-5}
  function ri (line 2) | function ri(n,t,e){var r=0,i=0;if(n.charge=0,!n.leaf)for(var u,a=n.nodes...
  function ii (line 2) | function ii(n,t){return ya.rebind(n,t,"sort","children","value"),n.nodes...
  function ui (line 2) | function ui(n){return n.children}
  function ai (line 2) | function ai(n){return n.value}
  function oi (line 2) | function oi(n,t){return t.value-n.value}
  function ci (line 2) | function ci(n){return ya.merge(n.map(function(n){return(n.children||[])....
  function li (line 2) | function li(n){return n.x}
  function si (line 2) | function si(n){return n.y}
  function fi (line 2) | function fi(n,t,e){n.y0=t,n.y=e}
  function hi (line 2) | function hi(n){return ya.range(n.length)}
  function gi (line 2) | function gi(n){for(var t=-1,e=n[0].length,r=[];++t<e;)r[t]=0;return r}
  function pi (line 2) | function pi(n){for(var t,e=1,r=0,i=n[0][1],u=n.length;u>e;++e)(t=n[e][1]...
  function mi (line 2) | function mi(n){return n.reduce(di,0)}
  function di (line 2) | function di(n,t){return n+t[1]}
  function vi (line 2) | function vi(n,t){return yi(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}
  function yi (line 2) | function yi(n,t){for(var e=-1,r=+n[0],i=(n[1]-r)/t,u=[];++e<=t;)u[e]=i*e...
  function Mi (line 2) | function Mi(n){return[ya.min(n),ya.max(n)]}
  function xi (line 2) | function xi(n,t){return n.parent==t.parent?1:2}
  function bi (line 2) | function bi(n){var t=n.children;return t&&t.length?t[0]:n._tree.thread}
  function _i (line 2) | function _i(n){var t,e=n.children;return e&&(t=e.length)?e[t-1]:n._tree....
  function wi (line 2) | function wi(n,t){var e=n.children;if(e&&(i=e.length))for(var r,i,u=-1;++...
  function Si (line 2) | function Si(n,t){return n.x-t.x}
  function Ei (line 2) | function Ei(n,t){return t.x-n.x}
  function ki (line 2) | function ki(n,t){return n.depth-t.depth}
  function Ai (line 2) | function Ai(n,t){function e(n,r){var i=n.children;if(i&&(a=i.length))for...
  function Ni (line 2) | function Ni(n){for(var t,e=0,r=0,i=n.children,u=i.length;--u>=0;)t=i[u]....
  function qi (line 2) | function qi(n,t,e){n=n._tree,t=t._tree;var r=e/(t.number-n.number);n.cha...
  function Ti (line 2) | function Ti(n,t,e){return n._tree.ancestor.parent==t.parent?n._tree.ance...
  function Ci (line 2) | function Ci(n,t){return n.value-t.value}
  function zi (line 2) | function zi(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pac...
  function Di (line 2) | function Di(n,t){n._pack_next=t,t._pack_prev=n}
  function ji (line 2) | function ji(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 Li (line 2) | function Li(n){function t(n){s=Math.min(n.x-n.r,s),f=Math.max(n.x+n.r,f)...
  function Hi (line 2) | function Hi(n){n._pack_next=n._pack_prev=n}
  function Fi (line 2) | function Fi(n){delete n._pack_next,delete n._pack_prev}
  function Pi (line 2) | function Pi(n,t,e,r){var i=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=...
  function Oi (line 2) | function Oi(n,t,e){var r=n.r+e.r,i=t.x-n.x,u=t.y-n.y;if(r&&(i||u)){var a...
  function Yi (line 2) | function Yi(n){return 1+ya.max(n,function(n){return n.y})}
  function Ri (line 2) | function Ri(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}
  function Ui (line 2) | function Ui(n){var t=n.children;return t&&t.length?Ui(t[0]):n}
  function Ii (line 2) | function Ii(n){var t,e=n.children;return e&&(t=e.length)?Ii(e[t-1]):n}
  function Vi (line 2) | function Vi(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}
  function Xi (line 2) | function Xi(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]-...
  function Zi (line 2) | function Zi(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}
  function Bi (line 2) | function Bi(n){return n.rangeExtent?n.rangeExtent():Zi(n.range())}
  function $i (line 2) | function $i(n,t,e,r){var i=e(n[0],n[1]),u=r(t[0],t[1]);return function(n...
  function Wi (line 2) | function Wi(n,t){var e,r=0,i=n.length-1,u=n[r],a=n[i];return u>a&&(e=r,r...
  function Ji (line 2) | function Ji(n){return n?{floor:function(t){return Math.floor(t/n)*n},cei...
  function Gi (line 2) | function Gi(n,t,e,r){var i=[],u=[],a=0,o=Math.min(n.length,t.length)-1;f...
  function Ki (line 2) | function Ki(n,t,e,r){function i(){var i=Math.min(n.length,t.length)>2?Gi...
  function Qi (line 2) | function Qi(n,t){return ya.rebind(n,t,"range","rangeRound","interpolate"...
  function nu (line 2) | function nu(n,t){return Wi(n,Ji(t?eu(n,t)[2]:tu(n)))}
  function tu (line 2) | function tu(n){var t=Zi(n),e=t[1]-t[0];return Math.pow(10,Math.round(Mat...
  function eu (line 2) | function eu(n,t){var e=Zi(n),r=e[1]-e[0],i=Math.pow(10,Math.floor(Math.l...
  function ru (line 2) | function ru(n,t){return ya.range.apply(ya,eu(n,t))}
  function iu (line 2) | function iu(n,t,e){var r=-Math.floor(Math.log(eu(n,t)[2])/Math.LN10+.01)...
  function uu (line 2) | function uu(n,t,e,r){function i(n){return(e?Math.log(0>n?0:n):-Math.log(...
  function au (line 2) | function au(n,t,e){function r(t){return n(i(t))}var i=ou(t),u=ou(1/t);re...
  function ou (line 2) | function ou(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,...
  function cu (line 2) | function cu(n,t){function e(t){return a[((u.get(t)||u.set(t,n.push(t)))-...
  function lu (line 2) | function lu(n,t){function e(){var e=0,u=t.length;for(i=[];++e<u;)i[e-1]=...
  function su (line 2) | function su(n,t,e){function r(t){return e[Math.max(0,Math.min(a,Math.flo...
  function fu (line 2) | function fu(n,t){function e(e){return e>=e?t[ya.bisect(n,e)]:void 0}retu...
  function hu (line 2) | function hu(n){function t(n){return+n}return t.invert=t,t.domain=t.range...
  function gu (line 2) | function gu(n){return n.innerRadius}
  function pu (line 2) | function pu(n){return n.outerRadius}
  function mu (line 2) | function mu(n){return n.startAngle}
  function du (line 2) | function du(n){return n.endAngle}
  function vu (line 2) | function vu(n){for(var t,e,r,i=-1,u=n.length;++i<u;)t=n[i],e=t[0],r=t[1]...
  function yu (line 2) | function yu(n){function t(t){function c(){m.push("M",o(n(v),f),s,l(n(d.r...
  function Mu (line 2) | function Mu(n){return n.radius}
  function xu (line 2) | function xu(n){return[n.x,n.y]}
  function bu (line 2) | function bu(n){return function(){var t=n.apply(this,arguments),e=t[0],r=...
  function _u (line 2) | function _u(){return 64}
  function wu (line 2) | function wu(){return"circle"}
  function Su (line 2) | function Su(n){var t=Math.sqrt(n/Ka);return"M0,"+t+"A"+t+","+t+" 0 1,1 0...
  function Eu (line 2) | function Eu(n,t){return La(n,Yc),n.id=t,n}
  function ku (line 2) | function ku(n,t,e,r){var i=n.id;return T(n,"function"==typeof e?function...
  function Au (line 2) | function Au(n){return null==n&&(n=""),function(){this.textContent=n}}
  function Nu (line 2) | function Nu(n,t,e,r){var u=n.__transition__||(n.__transition__={active:0...
  function qu (line 2) | function qu(n,t){n.attr("transform",function(n){return"translate("+t(n)+...
  function Tu (line 2) | function Tu(n,t){n.attr("transform",function(n){return"translate(0,"+t(n...
  function Cu (line 2) | function Cu(n,t,e){if(r=[],e&&t.length>1){for(var r,i,u,a=Zi(n.domain())...
  function zu (line 2) | function zu(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arg...
  function Du (line 2) | function Du(n,t,e){function r(t){var e=n(t),r=u(e,1);return r-t>t-e?e:r}...
  function ju (line 2) | function ju(n){return function(t,e){try{Zc=zu;var r=new zu;return r._=t,...
  function Lu (line 2) | function Lu(n,t,e,r){for(var i,u,a=0,o=t.length,c=e.length;o>a;){if(r>=c...
  function Hu (line 2) | function Hu(n){return new RegExp("^(?:"+n.map(ya.requote).join("|")+")",...
  function Fu (line 2) | function Fu(n){for(var t=new i,e=-1,r=n.length;++e<r;)t.set(n[e].toLower...
  function Pu (line 2) | function Pu(n,t,e){var r=0>n?"-":"",i=(r?-n:n)+"",u=i.length;return r+(e...
  function Ou (line 2) | function Ou(n,t,e){il.lastIndex=0;var r=il.exec(t.substring(e));return r...
  function Yu (line 2) | function Yu(n,t,e){el.lastIndex=0;var r=el.exec(t.substring(e));return r...
  function Ru (line 2) | function Ru(n,t,e){pl.lastIndex=0;var r=pl.exec(t.substring(e,e+1));retu...
  function Uu (line 2) | function Uu(n,t,e){pl.lastIndex=0;var r=pl.exec(t.substring(e));return r...
  function Iu (line 2) | function Iu(n,t,e){pl.lastIndex=0;var r=pl.exec(t.substring(e));return r...
  function Vu (line 2) | function Vu(n,t,e){cl.lastIndex=0;var r=cl.exec(t.substring(e));return r...
  function Xu (line 2) | function Xu(n,t,e){al.lastIndex=0;var r=al.exec(t.substring(e));return r...
  function Zu (line 2) | function Zu(n,t,e){return Lu(n,hl.c.toString(),t,e)}
  function Bu (line 2) | function Bu(n,t,e){return Lu(n,hl.x.toString(),t,e)}
  function $u (line 2) | function $u(n,t,e){return Lu(n,hl.X.toString(),t,e)}
  function Wu (line 2) | function Wu(n,t,e){pl.lastIndex=0;var r=pl.exec(t.substring(e,e+4));retu...
  function Ju (line 2) | function Ju(n,t,e){pl.lastIndex=0;var r=pl.exec(t.substring(e,e+2));retu...
  function Gu (line 2) | function Gu(n){return n+(n>68?1900:2e3)}
  function Ku (line 2) | function Ku(n,t,e){pl.lastIndex=0;var r=pl.exec(t.substring(e,e+2));retu...
  function Qu (line 2) | function Qu(n,t,e){pl.lastIndex=0;var r=pl.exec(t.substring(e,e+2));retu...
  function na (line 2) | function na(n,t,e){pl.lastIndex=0;var r=pl.exec(t.substring(e,e+3));retu...
  function ta (line 2) | function ta(n,t,e){pl.lastIndex=0;var r=pl.exec(t.substring(e,e+2));retu...
  function ea (line 2) | function ea(n,t,e){pl.lastIndex=0;var r=pl.exec(t.substring(e,e+2));retu...
  function ra (line 2) | function ra(n,t,e){pl.lastIndex=0;var r=pl.exec(t.substring(e,e+2));retu...
  function ia (line 2) | function ia(n,t,e){pl.lastIndex=0;var r=pl.exec(t.substring(e,e+3));retu...
  function ua (line 2) | function ua(n,t,e){var r=ml.get(t.substring(e,e+=2).toLowerCase());retur...
  function aa (line 2) | function aa(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=~~(Math.abs(t...
  function oa (line 2) | function oa(n,t,e){sl.lastIndex=0;var r=sl.exec(t.substring(e,e+1));retu...
  function ca (line 2) | function ca(n){return n.toISOString()}
  function la (line 2) | function la(n,t,e){function r(t){return n(t)}return r.invert=function(t)...
  function sa (line 2) | function sa(n){return new Date(n)}
  function fa (line 2) | function fa(n){return function(t){for(var e=n.length-1,r=n[e];!r[1](t);)...
  function ha (line 2) | function ha(n){var t=new Date(n,0,1);return t.setFullYear(n),t}
  function ga (line 2) | function ga(n){var t=n.getFullYear(),e=ha(t),r=ha(t+1);return t+(n-e)/(r...
  function pa (line 2) | function pa(n){var t=new Date(Date.UTC(n,0,1));return t.setUTCFullYear(n...
  function ma (line 2) | function ma(n){var t=n.getUTCFullYear(),e=pa(t),r=pa(t+1);return t+(n-e)...
  function da (line 2) | function da(n){return JSON.parse(n.responseText)}
  function va (line 2) | function va(n){var t=Ma.createRange();return t.selectNode(Ma.body),t.cre...
  function n (line 3) | function n(t,o,c){if(c>=a.length)return r?r.call(u,o):e?o.sort(e):o;for(...
  function t (line 3) | function t(n,e){if(e>=a.length)return n;var r=[],i=o[e++];return n.forEa...
  function e (line 3) | function e(n,e){var r,u,a,o=n.length,f=e.length,h=Math.min(o,f),g=new Ar...
  function n (line 3) | function n(){this.on("mousedown.drag",a).on("touchstart.drag",o)}
  function t (line 3) | function t(){return ya.event.changedTouches[0].identifier}
  function e (line 3) | function e(n,t){return ya.touches(n).filter(function(n){return n.identif...
  function r (line 3) | function r(n,t,e,r){return function(){function a(){if(!s)return o();var ...
  function n (line 3) | function n(){this.on(w,o).on(Ja+".zoom",l).on(S,s).on("dblclick.zoom",f)...
  function t (line 3) | function t(n){return[(n[0]-x[0])/b,(n[1]-x[1])/b]}
  function e (line 3) | function e(n){return[n[0]*b+x[0],n[1]*b+x[1]]}
  function r (line 3) | function r(n){b=Math.max(_[0],Math.min(_[1],n))}
  function i (line 3) | function i(n,t){t=e(t),x[0]+=n[0]-t[0],x[1]+=n[1]-t[1]}
  function u (line 3) | function u(){v&&v.domain(d.range().map(function(n){return(n-x[0])/b}).ma...
  function a (line 3) | function a(n){u(),n({type:"zoom",scale:b,translate:x})}
  function o (line 3) | function o(){function n(){c=1,i(ya.mouse(r),f),a(u)}function e(){l.on(S,...
  function c (line 3) | function c(){function n(){var n=ya.touches(h);return f=b,s={},n.forEach(...
  function l (line 3) | function l(){g(),h||(h=t(ya.mouse(this))),r(Math.pow(2,.002*$a())*b),i(y...
  function s (line 3) | function s(){h=null}
  function f (line 3) | function f(){var n=ya.mouse(this),e=t(n),u=Math.log(b)/Math.LN2;r(Math.p...
  function e (line 3) | function e(n,e,u){arguments.length<3&&(u=e,e=null);var a=ya.xhr(n,t,u);r...
  function r (line 3) | function r(n){return e.parse(n.responseText)}
  function i (line 3) | function i(n){return function(t){return e.parse(t.responseText,n)}}
  function a (line 3) | function a(t){return t.map(o).join(n)}
  function o (line 3) | function o(n){return c.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}
  function e (line 3) | function e(){if(s>=c)return a;if(i)return i=!1,u;var t=s;if(34===n.charC...
  function n (line 3) | function n(n,t){M.push(x=[s=n,h=n]),f>t&&(f=t),t>g&&(g=t)}
  function t (line 3) | function t(t,e){var r=zt([t*to,e*to]);if(v){var i=jt(v,r),u=[i[1],-i[0],...
  function e (line 3) | function e(){b.point=t}
  function r (line 3) | function r(){x[0]=s,x[1]=h,b.point=n,v=null}
  function i (line 3) | function i(n,e){if(v){var r=n-p;y+=Math.abs(r)>180?r+(r>0?360:-360):r}el...
  function u (line 3) | function u(){zo.lineStart()}
  function a (line 3) | function a(){i(m,d),zo.lineEnd(),Math.abs(y)>Qa&&(s=-(h=180)),x[0]=s,x[1...
  function o (line 3) | function o(n,t){return(t-=n)<0?t+360:t}
  function c (line 3) | function c(n,t){return n[0]-t[0]}
  function l (line 3) | function l(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}
  function n (line 3) | function n(n){var u=n[0],a=n[1];return t=null,e(u,a),t||(r(u,a),t)||i(u,...
  function n (line 3) | function n(n){return n&&("function"==typeof o&&u.pointRadius(+o.apply(th...
  function t (line 3) | function t(){return a=null,n}
  function t (line 3) | function t(t){return t=n(t[0]*to,t[1]*to),t[0]*=eo,t[1]*=eo,t}
  function n (line 3) | function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=Se(-...
  function n (line 3) | function n(){return{type:"MultiLineString",coordinates:t()}}
  function t (line 3) | function t(){return ya.range(Math.ceil(u/d)*d,i,d).map(h).concat(ya.rang...
  function n (line 3) | function n(){return{type:"LineString",coordinates:[t||r.apply(this,argum...
  function t (line 4) | function t(n){if(n.length<3)return[];var t,i,u,a,o,c,l,s,f,h,g,p,m=pt(e)...
  function t (line 4) | function t(n){var t,u,a,o=n.map(function(){return[]}),c=pt(e),l=pt(r),s=...
  function u (line 4) | function u(n){function u(n,t,e,r,i,u,a,o){if(!isNaN(e)&&!isNaN(r))if(n.l...
  function n (line 4) | function n(){var n,l,f,h,g,p={},m=[],d=ya.range(u),v=[];for(e=[],r=[],n=...
  function t (line 4) | function t(){e.sort(function(n,t){return c((n.source.value+n.target.valu...
  function n (line 4) | function n(n){return function(t,e,r,i){if(t.point!==n){var u=t.cx-n.x,a=...
  function t (line 4) | function t(n){n.px=ya.event.x,n.py=ya.event.y,o.resume()}
  function n (line 4) | function n(n,r){for(var i,u=t(e),a=-1,o=u.length;++a<o;)if(!isNaN(i=u[a]...
  function t (line 4) | function t(){if(!c){for(c=[],r=0;p>r;++r)c[r]=[];for(r=0;m>r;++r){var n=...
  function n (line 4) | function n(t,a,o){var c=i.call(e,t,a);if(t.depth=a,o.push(t),c&&(l=c.len...
  function t (line 4) | function t(n,r){var i=n.children,a=0;if(i&&(o=i.length))for(var o,c=-1,l...
  function e (line 4) | function e(t){var e=[];return n(t,0,e),e}
  function n (line 4) | function n(t,e,r,i){var u=t.children;if(t.x=e,t.y=t.depth*i,t.dx=r,t.dy=...
  function t (line 4) | function t(n){var e=n.children,r=0;if(e&&(i=e.length))for(var i,u=-1;++u...
  function e (line 4) | function e(e,u){var a=r.call(this,e,u);return n(a[0],0,i[0],i[1]/t(a[0])...
  function n (line 4) | function n(u){var a=u.map(function(e,r){return+t.call(n,e,r)}),o=+("func...
  function n (line 4) | function n(o,c){var l=o.map(function(e,r){return t.call(n,e,r)}),s=l.map...
  function n (line 4) | function n(n,u){for(var a,o,c=[],l=n.map(e,this),s=r.call(this,l,u),f=i....
  function n (line 4) | function n(n,u){function a(n,t){var r=n.children,i=n._tree;if(r&&(u=r.le...
  function n (line 4) | function n(n,u){var a=e.call(this,n,u),o=a[0],c=i[0],l=i[1],s=null==t?Ma...
  function n (line 4) | function n(n,u){var a,o=t.call(this,n,u),c=o[0],l=0;Ai(c,function(n){var...
  function n (line 4) | function n(n,t){for(var e,r,i=-1,u=n.length;++i<u;)r=(e=n[i]).value*(0>t...
  function t (line 4) | function t(e){var u=e.children;if(u&&u.length){var a,o,c,l=f(e),s=[],h=u...
  function e (line 4) | function e(t){var r=t.children;if(r&&r.length){var u,a=f(t),o=r.slice(),...
  function r (line 4) | function r(n,t){for(var e,r=n.area,i=0,u=1/0,a=-1,o=n.length;++a<o;)(e=n...
  function i (line 4) | function i(n,t,e,r){var i,u=-1,a=n.length,o=e.x,l=e.y,s=t?c(n.area/t):0;...
  function u (line 4) | function u(r){var i=a||o(r),u=i[0];return u.x=0,u.y=0,u.dx=l[0],u.dy=l[1...
  function t (line 4) | function t(t){var e=n.call(u,t,t.depth);return null==e?Vi(t):Xi(t,"numbe...
  function e (line 4) | function e(t){return Xi(t,n)}
  function n (line 4) | function n(){var n=t.apply(this,arguments),u=e.apply(this,arguments),a=r...
  function n (line 4) | function n(n,o){var c=t(this,u,n,o),l=t(this,a,n,o);return"M"+c.p0+r(c.r...
  function t (line 4) | function t(n,t,e,r){var i=t.call(n,e,r),u=o.call(n,i,r),a=c.call(n,i,r)+...
  function e (line 4) | function e(n,t){return n.a0==t.a0&&n.a1==t.a1}
  function r (line 4) | function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>Ka)+",1 "+t}
  function i (line 4) | function i(n,t,e,r){return"Q 0,0 "+r}
  function n (line 4) | function n(n,i){var u=t.call(this,n,i),a=e.call(this,n,i),o=(u.y+a.y)/2,...
  function n (line 4) | function n(n,r){return(Lc.get(t.call(this,n,r))||Su)(e.call(this,n,r))}
  function e (line 4) | function e(){this.removeAttribute(o)}
  function r (line 4) | function r(){this.removeAttributeNS(o.space,o.local)}
  function i (line 4) | function i(n){return null==n?e:(n+="",function(){var t,e=this.getAttribu...
  function u (line 4) | function u(n){return null==n?r:(n+="",function(){var t,e=this.getAttribu...
  function e (line 4) | function e(n,e){var r=t.call(this,n,e,this.getAttribute(i));return r&&fu...
  function r (line 4) | function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(i.space,i.loca...
  function r (line 4) | function r(){this.style.removeProperty(n)}
  function i (line 4) | function i(t){return null==t?r:(t+="",function(){var r,i=ba.getComputedS...
  function r (line 4) | function r(r,i){var u=t.call(this,r,i,ba.getComputedStyle(this,null).get...
  function n (line 4) | function n(n){n.each(function(){var n,f=ya.select(this),h=null==l?e.tick...
  function n (line 5) | function n(u){u.each(function(){var u,a=ya.select(this),s=a.selectAll("....
  function t (line 5) | function t(n){n.selectAll(".resize").attr("transform",function(n){return...
  function e (line 5) | function e(n){n.select(".extent").attr("x",s[0][0]),n.selectAll(".extent...
  function r (line 5) | function r(n){n.select(".extent").attr("y",s[0][1]),n.selectAll(".extent...
  function i (line 5) | function i(){function i(){var n=ya.event.changedTouches;return n?ya.touc...
  function t (line 5) | function t(t){for(var r,i,u,a=[],o=-1,c=0;++o<e;)37===n.charCodeAt(o)&&(...
  function t (line 5) | function t(n){try{Zc=zu;var t=new Zc;return t._=n,e(t)}finally{Zc=Date}}

FILE: test/app_test.rb
  class AppTest (line 4) | class AppTest < Dashing::Test
    method setup (line 5) | def setup
    method test_redirect_to_first_dashboard (line 13) | def test_redirect_to_first_dashboard
    method test_redirect_to_first_dashboard_without_erb (line 21) | def test_redirect_to_first_dashboard_without_erb
    method test_redirect_to_default_dashboard (line 30) | def test_redirect_to_default_dashboard
    method test_errors_out_when_no_dashboards_available (line 39) | def test_errors_out_when_no_dashboards_available
    method test_post_widgets_without_auth_token (line 48) | def test_post_widgets_without_auth_token
    method test_post_widgets_with_invalid_auth_token (line 59) | def test_post_widgets_with_invalid_auth_token
    method test_post_widgets_with_valid_auth_token (line 65) | def test_post_widgets_with_valid_auth_token
    method test_get_events (line 71) | def test_get_events
    method test_dashboard_events (line 80) | def test_dashboard_events
    method test_get_dashboard (line 90) | def test_get_dashboard
    method test_page_title_set_correctly (line 99) | def test_page_title_set_correctly
    method test_get_haml_dashboard (line 106) | def test_get_haml_dashboard
    method test_get_haml_widget (line 115) | def test_get_haml_widget
    method test_get_nonexistent_dashboard (line 125) | def test_get_nonexistent_dashboard
    method test_get_widget (line 132) | def test_get_widget
    method with_generated_project (line 140) | def with_generated_project
    method app (line 155) | def app
    method parse_data (line 159) | def parse_data(string)
    method parse_event (line 163) | def parse_event(string)

FILE: test/cli_test.rb
  class CLITest (line 3) | class CLITest < Dashing::Test
    method setup (line 4) | def setup
    method test_new_task_creates_project_directory (line 8) | def test_new_task_creates_project_directory
    method test_generate_task_delegates_to_type (line 14) | def test_generate_task_delegates_to_type
    method test_generate_task_warns_when_generator_is_not_defined (line 23) | def test_generate_task_warns_when_generator_is_not_defined
    method test_generate_widget_creates_a_new_widget (line 31) | def test_generate_widget_creates_a_new_widget
    method test_generate_dashboard_creates_a_new_dashboard (line 37) | def test_generate_dashboard_creates_a_new_dashboard
    method test_generate_job_creates_a_new_job (line 43) | def test_generate_job_creates_a_new_job
    method test_install_task_requests_gist_from_downloader (line 49) | def test_install_task_requests_gist_from_downloader
    method test_install_task_calls_create_file_for_each_valid_file_in_gist (line 56) | def test_install_task_calls_create_file_for_each_valid_file_in_gist
    method test_install_task_ignores_invalid_files (line 79) | def test_install_task_ignores_invalid_files
    method test_install_task_warns_when_gist_not_found (line 95) | def test_install_task_warns_when_gist_not_found
    method test_start_task_starts_thin_with_default_port (line 104) | def test_start_task_starts_thin_with_default_port
    method test_start_task_starts_thin_with_specified_port (line 110) | def test_start_task_starts_thin_with_specified_port
    method test_start_task_supports_job_path_option (line 116) | def test_start_task_supports_job_path_option
    method test_stop_task_stops_thin_server (line 127) | def test_stop_task_stops_thin_server
    method test_job_task_requires_job_file (line 132) | def test_job_task_requires_job_file
    method test_job_task_requires_every_ruby_file_in_lib (line 139) | def test_job_task_requires_every_ruby_file_in_lib
    method test_job_sets_auth_token (line 147) | def test_job_sets_auth_token
    method test_hyphenate_lowers_and_hyphenates_inputs (line 154) | def test_hyphenate_lowers_and_hyphenates_inputs

FILE: test/downloader_test.rb
  class DownloaderTest (line 3) | class DownloaderTest < Minitest::Test
    method test_get_json_requests_and_parses_content (line 5) | def test_get_json_requests_and_parses_content
    method test_get_json_raises_on_bad_request (line 14) | def test_get_json_raises_on_bad_request
    method test_load_gist_attempts_to_get_the_gist (line 22) | def test_load_gist_attempts_to_get_the_gist

FILE: test/test_helper.rb
  function load_quietly (line 23) | def load_quietly(file)
  function temp (line 29) | def temp
  type Dashing (line 39) | module Dashing
    class Test (line 40) | class Test < Minitest::Test
      method teardown (line 45) | def teardown
Condensed preview — 75 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (838K chars).
[
  {
    "path": ".gitignore",
    "chars": 76,
    "preview": "*DS_STORE\n/Gemfile.lock\n*.gem\ncoverage/\nlog/\ntmp/\n.ruby-version\nhistory.yml\n"
  },
  {
    "path": ".travis.yml",
    "chars": 71,
    "preview": "language: ruby\nrvm:\n  - 2.3.0\n  - 2.2.4\n  - 2.1.8\n\nscript: \"rake test\"\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 924,
    "preview": "<a name=\"issues\"></a>\n## Have an Issue?\n\nDashing is no longer being actively maintained.\n\n1. Check the [Troubleshooting "
  },
  {
    "path": "Gemfile",
    "chars": 38,
    "preview": "source 'https://rubygems.org'\n\ngemspec"
  },
  {
    "path": "MIT-LICENSE",
    "chars": 1051,
    "preview": "Copyright (c) 2016 Shopify\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this softwar"
  },
  {
    "path": "README.md",
    "chars": 660,
    "preview": "# [Dashing](http://shopify.github.com/dashing)\n[![Build Status](https://secure.travis-ci.org/Shopify/dashing.png?branch="
  },
  {
    "path": "Rakefile",
    "chars": 221,
    "preview": "require 'rubygems'\nrequire 'rake'\nrequire 'bundler/gem_tasks'\n\nrequire 'rake/testtask'\nRake::TestTask.new(:test) do |tes"
  },
  {
    "path": "bin/dashing",
    "chars": 282,
    "preview": "#!/usr/bin/env ruby\nrequire \"pathname\"\nbin_file = Pathname.new(__FILE__).realpath\n$:.unshift File.expand_path(\"../../lib"
  },
  {
    "path": "dashing.gemspec",
    "chars": 1719,
    "preview": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |s|\n  s.name        = 'dashing'\n  s.version     = '1.3.7'\n  s.date "
  },
  {
    "path": "javascripts/batman.jquery.js",
    "chars": 4726,
    "preview": "(function() {\n\n  Batman.extend(Batman.DOM, {\n    querySelectorAll: function(node, selector) {\n      return jQuery(select"
  },
  {
    "path": "javascripts/batman.js",
    "chars": 415016,
    "preview": "(function() {\n  var Batman, __slice = [].slice;\n\n  Batman = function() {\n    var mixins;\n    mixins = 1 <= arguments.len"
  },
  {
    "path": "javascripts/dashing.coffee",
    "chars": 3706,
    "preview": "#= require jquery\n#= require es5-shim\n#= require batman\n#= require batman.jquery\n\n\nBatman.Filters.prettyNumber = (num) -"
  },
  {
    "path": "javascripts/es5-shim.js",
    "chars": 36755,
    "preview": "// vim: ts=4 sts=4 sw=4 expandtab\n// -- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License\n// -- tlrobinson Tom Ro"
  },
  {
    "path": "javascripts/jquery.js",
    "chars": 94839,
    "preview": "/*! jQuery v1.7.2 jquery.com | jquery.org/license */\n(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9"
  },
  {
    "path": "lib/dashing/app.rb",
    "chars": 4641,
    "preview": "require 'sinatra'\nrequire 'sprockets'\nrequire 'sinatra/content_for'\nrequire 'rufus/scheduler'\nrequire 'coffee-script'\nre"
  },
  {
    "path": "lib/dashing/cli.rb",
    "chars": 3466,
    "preview": "require 'thor'\nrequire 'open-uri'\n\nmodule Dashing\n  class CLI < Thor\n    include Thor::Actions\n\n    attr_reader :name\n\n "
  },
  {
    "path": "lib/dashing/downloader.rb",
    "chars": 298,
    "preview": "require 'net/http'\nrequire 'open-uri'\nrequire 'json'\n\nmodule Dashing\n  module Downloader\n    extend self\n\n    def get_gi"
  },
  {
    "path": "lib/dashing.rb",
    "chars": 92,
    "preview": "require 'dashing/cli'\nrequire 'dashing/downloader'\nrequire 'dashing/app'\n\nmodule Dashing\nend"
  },
  {
    "path": "shipit.rubygems.yml",
    "chars": 34,
    "preview": "# using the default shipit config\n"
  },
  {
    "path": "templates/dashboard/%name%.erb.tt",
    "chars": 174,
    "preview": "<div class=\"gridster\">\n  <ul>\n    <li data-row=\"1\" data-col=\"1\" data-sizex=\"1\" data-sizey=\"1\">\n      <div data-id=\"my_wi"
  },
  {
    "path": "templates/job/%name%.rb",
    "chars": 180,
    "preview": "# :first_in sets how long it takes before the job is first run. In this case, it is run immediately\nSCHEDULER.every '1m'"
  },
  {
    "path": "templates/project/.gitignore",
    "chars": 22,
    "preview": "*DS_STORE\nhistory.yml\n"
  },
  {
    "path": "templates/project/Gemfile",
    "chars": 122,
    "preview": "source 'https://rubygems.org'\n\ngem 'dashing'\n\n## Remove this if you don't need a twitter widget.\ngem 'twitter', '>= 5.9."
  },
  {
    "path": "templates/project/README.md",
    "chars": 65,
    "preview": "Check out http://shopify.github.com/dashing for more information."
  },
  {
    "path": "templates/project/assets/javascripts/application.coffee",
    "chars": 869,
    "preview": "# dashing.js is located in the dashing framework\n# It includes jquery & batman for you.\n#= require dashing.js\n\n#= requir"
  },
  {
    "path": "templates/project/assets/javascripts/d3-3.2.8.js",
    "chars": 143168,
    "preview": "d3=function(){function n(n){return null!=n&&!isNaN(n)}function t(n){return n.length}function e(n){for(var t=1;n*t%1;)t*="
  },
  {
    "path": "templates/project/assets/javascripts/dashing.gridster.coffee",
    "chars": 1242,
    "preview": "#= require_directory ./gridster\n\n# This file enables gridster integration (http://gridster.net/)\n# Delete it if you'd ra"
  },
  {
    "path": "templates/project/assets/javascripts/jquery.knob.js",
    "chars": 20009,
    "preview": "/*!jQuery Knob*/\n/**\n * Downward compatible, touchable dial\n *\n * Version: 1.2.0 (15/07/2012)\n * Requires: jQuery v1.7+\n"
  },
  {
    "path": "templates/project/assets/stylesheets/application.scss",
    "chars": 4978,
    "preview": "/*\n  //=require_directory .\n  //=require_tree ../../widgets\n*/\n// ------------------------------------------------------"
  },
  {
    "path": "templates/project/assets/stylesheets/font-awesome.css",
    "chars": 33239,
    "preview": "/*!\n *  Font Awesome 4.5.0 by @davegandy - http://fontawesome.io - @fontawesome\n *  License - http://fontawesome.io/lice"
  },
  {
    "path": "templates/project/config.ru",
    "chars": 342,
    "preview": "require 'dashing'\n\nconfigure do\n  set :auth_token, 'YOUR_AUTH_TOKEN'\n\n  helpers do\n    def protected!\n      # Put any au"
  },
  {
    "path": "templates/project/dashboards/layout.erb",
    "chars": 1057,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\"/>\n  <meta name=\"description\" content=\"\">\n  <meta name=\"v"
  },
  {
    "path": "templates/project/dashboards/sample.erb",
    "chars": 1418,
    "preview": "<% content_for :title do %>My super sweet dashboard<% end %>\n<div class=\"gridster\">\n  <ul>\n    <li data-row=\"1\" data-col"
  },
  {
    "path": "templates/project/dashboards/sampletv.erb",
    "chars": 2627,
    "preview": "<script type='text/javascript'>\n$(function() {\n  // These settings override the defaults set in application.coffee. You "
  },
  {
    "path": "templates/project/jobs/buzzwords.rb",
    "chars": 433,
    "preview": "buzzwords = ['Paradigm shift', 'Leverage', 'Pivoting', 'Turn-key', 'Streamlininess', 'Exit strategy', 'Synergy', 'Enterp"
  },
  {
    "path": "templates/project/jobs/convergence.rb",
    "chars": 281,
    "preview": "# Populate the graph with some random points\npoints = []\n(1..10).each do |i|\n  points << { x: i, y: rand(50) }\nend\nlast_"
  },
  {
    "path": "templates/project/jobs/sample.rb",
    "chars": 402,
    "preview": "current_valuation = 0\ncurrent_karma = 0\n\nSCHEDULER.every '2s' do\n  last_valuation = current_valuation\n  last_karma     ="
  },
  {
    "path": "templates/project/jobs/twitter.rb",
    "chars": 883,
    "preview": "require 'twitter'\n\n\n#### Get your twitter keys & secrets:\n#### https://dev.twitter.com/docs/auth/tokens-devtwittercom\ntw"
  },
  {
    "path": "templates/project/lib/.empty_directory",
    "chars": 16,
    "preview": ".empty_directory"
  },
  {
    "path": "templates/project/public/404.html",
    "chars": 683,
    "preview": "<!DOCTYPE html>\n<html>\n<head>\n  <title>This Dashboard doesn't exist.</title>\n  <style>\n    body { background-color: #fff"
  },
  {
    "path": "templates/project/widgets/clock/clock.coffee",
    "chars": 389,
    "preview": "class Dashing.Clock extends Dashing.Widget\n\n  ready: ->\n    setInterval(@startTime, 500)\n\n  startTime: =>\n    today = ne"
  },
  {
    "path": "templates/project/widgets/clock/clock.html",
    "chars": 53,
    "preview": "<h1 data-bind=\"date\"></h1>\n<h2 data-bind=\"time\"></h2>"
  },
  {
    "path": "templates/project/widgets/clock/clock.scss",
    "chars": 453,
    "preview": "// ----------------------------------------------------------------------------\n// Sass declarations\n// ----------------"
  },
  {
    "path": "templates/project/widgets/comments/comments.coffee",
    "chars": 587,
    "preview": "class Dashing.Comments extends Dashing.Widget\n\n  @accessor 'quote', ->\n    \"“#{@get('current_comment')?.body}”\"\n\n  ready"
  },
  {
    "path": "templates/project/widgets/comments/comments.html",
    "chars": 289,
    "preview": "<h1 class=\"title\" data-bind=\"title\"></h1>\n<div class=\"comment-container\">\n  <h3><img data-bind-src='current_comment.avat"
  },
  {
    "path": "templates/project/widgets/comments/comments.scss",
    "chars": 750,
    "preview": "// ----------------------------------------------------------------------------\n// Sass declarations\n// ----------------"
  },
  {
    "path": "templates/project/widgets/graph/graph.coffee",
    "chars": 1137,
    "preview": "class Dashing.Graph extends Dashing.Widget\n\n  @accessor 'current', ->\n    return @get('displayedValue') if @get('display"
  },
  {
    "path": "templates/project/widgets/graph/graph.html",
    "chars": 183,
    "preview": "<h1 class=\"title\" data-bind=\"title\"></h1>\n\n<h2 class=\"value\" data-bind=\"current | prettyNumber | prepend prefix | append"
  },
  {
    "path": "templates/project/widgets/graph/graph.scss",
    "chars": 1223,
    "preview": "// ----------------------------------------------------------------------------\n// Sass declarations\n// ----------------"
  },
  {
    "path": "templates/project/widgets/iframe/iframe.coffee",
    "chars": 320,
    "preview": "class Dashing.Iframe extends Dashing.Widget\n\n  ready: ->\n    # This is fired when the widget is done being rendered\n\n  o"
  },
  {
    "path": "templates/project/widgets/iframe/iframe.html",
    "chars": 52,
    "preview": "<iframe data-bind-src=\"url\" frameborder=0></iframe>\n"
  },
  {
    "path": "templates/project/widgets/iframe/iframe.scss",
    "chars": 109,
    "preview": ".widget-iframe {\n  padding: 3px 0px 0px 0px !important;\n\n  iframe {\n    width: 100%;\n    height: 100%;\n  }\n}\n"
  },
  {
    "path": "templates/project/widgets/image/image.coffee",
    "chars": 319,
    "preview": "class Dashing.Image extends Dashing.Widget\n\n  ready: ->\n    # This is fired when the widget is done being rendered\n\n  on"
  },
  {
    "path": "templates/project/widgets/image/image.html",
    "chars": 73,
    "preview": "<img data-bind-src=\"image | prepend '/assets'\" data-bind-width=\"width\"/>\n"
  },
  {
    "path": "templates/project/widgets/image/image.scss",
    "chars": 453,
    "preview": "// ----------------------------------------------------------------------------\n// Sass declarations\n// ----------------"
  },
  {
    "path": "templates/project/widgets/list/list.coffee",
    "chars": 158,
    "preview": "class Dashing.List extends Dashing.Widget\n  ready: ->\n    if @get('unordered')\n      $(@node).find('ol').remove()\n    el"
  },
  {
    "path": "templates/project/widgets/list/list.html",
    "chars": 493,
    "preview": "<h1 class=\"title\" data-bind=\"title\"></h1>\n\n<ol>\n  <li data-foreach-item=\"items\">\n    <span class=\"label\" data-bind=\"item"
  },
  {
    "path": "templates/project/widgets/list/list.scss",
    "chars": 1134,
    "preview": "// ----------------------------------------------------------------------------\n// Sass declarations\n// ----------------"
  },
  {
    "path": "templates/project/widgets/meter/meter.coffee",
    "chars": 387,
    "preview": "class Dashing.Meter extends Dashing.Widget\n\n  @accessor 'value', Dashing.AnimatedValue\n\n  constructor: ->\n    super\n    "
  },
  {
    "path": "templates/project/widgets/meter/meter.html",
    "chars": 442,
    "preview": "<h1 class=\"title\" data-bind=\"title\"></h1>\n\n<input class=\"meter\" data-angleOffset=-125 data-angleArc=250 data-bind-data-h"
  },
  {
    "path": "templates/project/widgets/meter/meter.scss",
    "chars": 819,
    "preview": "// ----------------------------------------------------------------------------\n// Sass declarations\n// ----------------"
  },
  {
    "path": "templates/project/widgets/number/number.coffee",
    "chars": 733,
    "preview": "class Dashing.Number extends Dashing.Widget\n  @accessor 'current', Dashing.AnimatedValue\n\n  @accessor 'difference', ->\n "
  },
  {
    "path": "templates/project/widgets/number/number.html",
    "chars": 343,
    "preview": "<h1 class=\"title\" data-bind=\"title\"></h1>\n\n<h2 class=\"value\" data-bind=\"current | shortenedNumber | prepend prefix | app"
  },
  {
    "path": "templates/project/widgets/number/number.scss",
    "chars": 846,
    "preview": "// ----------------------------------------------------------------------------\n// Sass declarations\n// ----------------"
  },
  {
    "path": "templates/project/widgets/text/text.coffee",
    "chars": 42,
    "preview": "class Dashing.Text extends Dashing.Widget\n"
  },
  {
    "path": "templates/project/widgets/text/text.html",
    "chars": 175,
    "preview": "<h1 class=\"title\" data-bind=\"title\"></h1>\n\n<h3 data-bind=\"text\"></h3>\n\n<p class=\"more-info\" data-bind=\"moreinfo\"></p>\n\n<"
  },
  {
    "path": "templates/project/widgets/text/text.scss",
    "chars": 732,
    "preview": "// ----------------------------------------------------------------------------\n// Sass declarations\n// ----------------"
  },
  {
    "path": "templates/widget/%name%/%name%.coffee.tt",
    "chars": 347,
    "preview": "class Dashing.<%= Thor::Util.camel_case(name) %> extends Dashing.Widget\n\n  ready: ->\n    # This is fired when the widget"
  },
  {
    "path": "templates/widget/%name%/%name%.html",
    "chars": 29,
    "preview": "<div data-bind=\"value\"></div>"
  },
  {
    "path": "templates/widget/%name%/%name%.scss.tt",
    "chars": 48,
    "preview": ".widget-<%= Dashing::CLI.hyphenate(name) %> {\n\n}"
  },
  {
    "path": "test/app_test.rb",
    "chars": 4695,
    "preview": "require 'test_helper'\nrequire 'haml'\n\nclass AppTest < Dashing::Test\n  def setup\n    @connection = []\n    app.settings.co"
  },
  {
    "path": "test/cli_test.rb",
    "chars": 4859,
    "preview": "require 'test_helper'\n\nclass CLITest < Dashing::Test\n  def setup\n    @cli = Dashing::CLI.new\n  end\n\n  def test_new_task_"
  },
  {
    "path": "test/downloader_test.rb",
    "chars": 715,
    "preview": "require 'test_helper'\n\nclass DownloaderTest < Minitest::Test\n\n  def test_get_json_requests_and_parses_content\n    endpoi"
  },
  {
    "path": "test/test_helper.rb",
    "chars": 882,
    "preview": "require 'simplecov'\nSimpleCov.start do\n  add_filter \"/vendor/\"\n  add_filter \"/test/\"\nend\n\nrequire 'rack/test'\nrequire 's"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the Shopify/dashing GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 75 files (786.2 KB), approximately 227.2k tokens, and a symbol index with 769 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!