Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var _createProxyCallback, _environmentEvent, _findHandlers, _getElementId, _subscribe, _unsubscribe;

_subscribe = function(element, event, callback, selector, delegate_callback) {
  var delegate, element_handlers, element_id, handler;
  event = _environmentEvent(event);
  element_id = _getElementId(element);
  element_handlers = HANDLERS[element_id] || (HANDLERS[element_id] = []);
  delegate = delegate_callback && delegate_callback(callback, event);
  handler = {
    event: event,
    callback: callback,
    selector: selector,
    proxy: _createProxyCallback(delegate, callback, element),
    delegate: delegate,
    index: element_handlers.length
  };
  element_handlers.push(handler);
  return $$.fn.addEvent(element, handler.event, handler.proxy);
};

_unsubscribe = function(element, event, callback, selector) {
  var element_id;
  event = _environmentEvent(event);
  element_id = _getElementId(element);
  return _findHandlers(element_id, event, callback, selector).forEach(function(handler) {
    delete HANDLERS[element_id][handler.index];
    return $$.fn.removeEvent(element, handler.event, handler.proxy);
  });
};

_getElementId = function(element) {
  return element._id || (element._id = ELEMENT_ID++);
};

_environmentEvent = function(event) {
  var environment_event;
  environment_event = (($$.isMobile()) ? event : EVENTS_DESKTOP[event]);
  return environment_event || event;
};

_createProxyCallback = function(delegate, callback, element) {
  var proxy;
  callback = delegate || callback;
  proxy = function(event) {
    var result;
    result = callback.apply(element, [event].concat(event.data));
    if (result === false) {
      event.preventDefault();
    }
    return result;
  };
  return proxy;
};

_findHandlers = function(element_id, event, fn, selector) {
  return (HANDLERS[element_id] || []).filter(function(handler) {
    return handler && (!event || handler.event === event) && (!fn || handler.callback === fn) && (!selector || handler.selector === selector);
  });
};
```

Response:
_subscribe = (element, event, callback, selector, delegate_callback) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        element_handlers = HANDLERS[element_id] or (HANDLERS[element_id] = [])
        delegate = delegate_callback and delegate_callback(callback, event)
        handler =
            event: event
            callback: callback
            selector: selector
            proxy: _createProxyCallback(delegate, callback, element)
            delegate: delegate
            index: element_handlers.length

        element_handlers.push handler
        $$.fn.addEvent element, handler.event, handler.proxy

    _unsubscribe = (element, event, callback, selector) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        _findHandlers(element_id, event, callback, selector).forEach (handler) ->
            delete HANDLERS[element_id][handler.index]

            $$.fn.removeEvent element, handler.event, handler.proxy

    _getElementId = (element) -> element._id or (element._id = ELEMENT_ID++)

    _environmentEvent = (event) ->
        environment_event = (if ($$.isMobile()) then event else EVENTS_DESKTOP[event])
        (environment_event) or event

    _createProxyCallback = (delegate, callback, element) ->
        callback = delegate or callback
        proxy = (event) ->
            result = callback.apply(element, [ event ].concat(event.data))
            event.preventDefault() if result is false
            result
        proxy

    _findHandlers = (element_id, event, fn, selector) ->
        (HANDLERS[element_id] or []).filter (handler) ->
            handler and (not event or handler.event is event) and (not fn or handler.callback is fn) and (not selector or handler.selector is selector)


Prompt:
_subscribe = (element, event, callback, selector, delegate_callback) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        element_handlers = HANDLERS[element_id] or (HANDLERS[element_id] = [])
        delegate = delegate_callback and delegate_callback(callback, event)
        handler =
            event: event
            callback: callback
            selector: selector
            proxy: _createProxyCallback(delegate, callback, element)
            delegate: delegate
            index: element_handlers.length

        element_handlers.push handler
        $$.fn.addEvent element, handler.event, handler.proxy

    _unsubscribe = (element, event, callback, selector) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        _findHandlers(element_id, event, callback, selector).forEach (handler) ->

Response:
delete HANDLERS[element_id][handler.index]

            $$.fn.removeEvent element, handler.event, handler.proxy

    _getElementId = (element) -> element._id or (element._id = ELEMENT_ID++)

    _environmentEvent = (event) ->
        environment_event = (if ($$.isMobile()) then event else EVENTS_DESKTOP[event])
        (environment_event) or event

    _createProxyCallback = (delegate, callback, element) ->
        callback = delegate or callback
        proxy = (event) ->
            result = callback.apply(element, [ event ].concat(event.data))
            event.preventDefault() if result is false
            result
        proxy

    _findHandlers = (element_id, event, fn, selector) ->
        (HANDLERS[element_id] or []).filter (handler) ->
            handler and (not event or handler.event is event) and (not fn or handler.callback is fn) and (not selector or handler.selector is selector)


Response:
_createProxy = (event) ->
        proxy = $$.extend( originalEvent: event, event)
        $$.each EVENT_METHODS, (name, method) ->
            proxy[name] = ->
                @[method] = ->
                    true

                event[name].apply event, arguments

            proxy[method] = ->
                false
        proxy


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
_createProxy = (event) ->
        proxy = $$.extend( originalEvent: event, event)
        $$.each EVENT_METHODS, (name, method) ->
            proxy[name] = ->
                @[method] = ->
                    true

                event[name].apply event, arguments

            proxy[method] = ->
                false
        proxy
```

Response:
var _createProxy;

_createProxy = function(event) {
  var proxy;
  proxy = $$.extend({
    originalEvent: event
  }, event);
  $$.each(EVENT_METHODS, function(name, method) {
    proxy[name] = function() {
      this[method] = function() {
        return true;
      };
      return event[name].apply(event, arguments);
    };
    return proxy[method] = function() {
      return false;
    };
  });
  return proxy;
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var _createProxy;

_createProxy = function(event) {
  var proxy;
  proxy = $$.extend({
    originalEvent: event
  }, event);
  $$.each(EVENT_METHODS, function(name, method) {
    proxy[name] = function() {
      this[method] = function() {
        return true;
      };
      return event[name].apply(event, arguments);
    };
    return proxy[method] = function() {
      return false;
    };
  });
  return proxy;
};
```

Response:
_createProxy = (event) ->
        proxy = $$.extend( originalEvent: event, event)
        $$.each EVENT_METHODS, (name, method) ->
            proxy[name] = ->
                @[method] = ->
                    true

                event[name].apply event, arguments

            proxy[method] = ->
                false
        proxy


Prompt:
_createProxy = (event) ->
        proxy = $$.extend( originalEvent: event, event)
        $$.each EVENT_METHODS, (name, method) ->
            proxy[name] = ->
                @[method] = ->
                    true

Response:
event[name].apply event, arguments

            proxy[method] = ->
                false
        proxy


Response:
$$.fn.unbind = (event, callback) ->
        @each ->
            _unsubscribe @, event, callback
            return

    $$.fn.delegate = (selector, event, callback) ->
        @each (i, element) ->
            _subscribe element, event, callback, selector, (fn) ->
                (e) ->
                    match = $$(e.target).closest(selector, element).get(0)
                    if match
                        evt = $$.extend(_createProxy(e),
                            currentTarget: match
                            liveFired: element
                        )
                        fn.apply match, [ evt ].concat([].slice.call(arguments, 1))
            return

    $$.fn.undelegate = (selector, event, callback) ->
        @each ->
            _unsubscribe @, event, callback, selector
            return

    $$.fn.trigger = (event, touch) ->
        event = $$.Event(event, touch) if $$.toType(event) is "string"
        @each ->
            @dispatchEvent event
            return

    $$.fn.addEvent = (element, event_name, callback) ->
        if element.addEventListener
            element.addEventListener event_name, callback, false
        else if element.attachEvent
            element.attachEvent "on" + event_name, callback
        else
            element["on" + event_name] = callback

    $$.fn.removeEvent = (element, event_name, callback) ->
        if element.removeEventListener
            element.removeEventListener event_name, callback, false
        else if element.detachEvent
            element.detachEvent "on" + event_name, callback
        else
            element["on" + event_name] = null


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
$$.fn.unbind = (event, callback) ->
        @each ->
            _unsubscribe @, event, callback
            return

    $$.fn.delegate = (selector, event, callback) ->
        @each (i, element) ->
            _subscribe element, event, callback, selector, (fn) ->
                (e) ->
                    match = $$(e.target).closest(selector, element).get(0)
                    if match
                        evt = $$.extend(_createProxy(e),
                            currentTarget: match
                            liveFired: element
                        )
                        fn.apply match, [ evt ].concat([].slice.call(arguments, 1))
            return

    $$.fn.undelegate = (selector, event, callback) ->
        @each ->
            _unsubscribe @, event, callback, selector
            return

    $$.fn.trigger = (event, touch) ->
        event = $$.Event(event, touch) if $$.toType(event) is "string"
        @each ->
            @dispatchEvent event
            return

    $$.fn.addEvent = (element, event_name, callback) ->
        if element.addEventListener
            element.addEventListener event_name, callback, false
        else if element.attachEvent
            element.attachEvent "on" + event_name, callback
        else
            element["on" + event_name] = callback

    $$.fn.removeEvent = (element, event_name, callback) ->
        if element.removeEventListener
            element.removeEventListener event_name, callback, false
        else if element.detachEvent
            element.detachEvent "on" + event_name, callback
        else
            element["on" + event_name] = null
```

Response:
$$.fn.unbind = function(event, callback) {
  return this.each(function() {
    _unsubscribe(this, event, callback);
  });
};

$$.fn.delegate = function(selector, event, callback) {
  return this.each(function(i, element) {
    _subscribe(element, event, callback, selector, function(fn) {
      return function(e) {
        var evt, match;
        match = $$(e.target).closest(selector, element).get(0);
        if (match) {
          evt = $$.extend(_createProxy(e), {
            currentTarget: match,
            liveFired: element
          });
          return fn.apply(match, [evt].concat([].slice.call(arguments, 1)));
        }
      };
    });
  });
};

$$.fn.undelegate = function(selector, event, callback) {
  return this.each(function() {
    _unsubscribe(this, event, callback, selector);
  });
};

$$.fn.trigger = function(event, touch) {
  if ($$.toType(event) === "string") {
    event = $$.Event(event, touch);
  }
  return this.each(function() {
    this.dispatchEvent(event);
  });
};

$$.fn.addEvent = function(element, event_name, callback) {
  if (element.addEventListener) {
    return element.addEventListener(event_name, callback, false);
  } else if (element.attachEvent) {
    return element.attachEvent("on" + event_name, callback);
  } else {
    return element["on" + event_name] = callback;
  }
};

$$.fn.removeEvent = function(element, event_name, callback) {
  if (element.removeEventListener) {
    return element.removeEventListener(event_name, callback, false);
  } else if (element.detachEvent) {
    return element.detachEvent("on" + event_name, callback);
  } else {
    return element["on" + event_name] = null;
  }
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
$$.fn.unbind = function(event, callback) {
  return this.each(function() {
    _unsubscribe(this, event, callback);
  });
};

$$.fn.delegate = function(selector, event, callback) {
  return this.each(function(i, element) {
    _subscribe(element, event, callback, selector, function(fn) {
      return function(e) {
        var evt, match;
        match = $$(e.target).closest(selector, element).get(0);
        if (match) {
          evt = $$.extend(_createProxy(e), {
            currentTarget: match,
            liveFired: element
          });
          return fn.apply(match, [evt].concat([].slice.call(arguments, 1)));
        }
      };
    });
  });
};

$$.fn.undelegate = function(selector, event, callback) {
  return this.each(function() {
    _unsubscribe(this, event, callback, selector);
  });
};

$$.fn.trigger = function(event, touch) {
  if ($$.toType(event) === "string") {
    event = $$.Event(event, touch);
  }
  return this.each(function() {
    this.dispatchEvent(event);
  });
};

$$.fn.addEvent = function(element, event_name, callback) {
  if (element.addEventListener) {
    return element.addEventListener(event_name, callback, false);
  } else if (element.attachEvent) {
    return element.attachEvent("on" + event_name, callback);
  } else {
    return element["on" + event_name] = callback;
  }
};

$$.fn.removeEvent = function(element, event_name, callback) {
  if (element.removeEventListener) {
    return element.removeEventListener(event_name, callback, false);
  } else if (element.detachEvent) {
    return element.detachEvent("on" + event_name, callback);
  } else {
    return element["on" + event_name] = null;
  }
};
```

Response:
$$.fn.unbind = (event, callback) ->
        @each ->
            _unsubscribe @, event, callback
            return

    $$.fn.delegate = (selector, event, callback) ->
        @each (i, element) ->
            _subscribe element, event, callback, selector, (fn) ->
                (e) ->
                    match = $$(e.target).closest(selector, element).get(0)
                    if match
                        evt = $$.extend(_createProxy(e),
                            currentTarget: match
                            liveFired: element
                        )
                        fn.apply match, [ evt ].concat([].slice.call(arguments, 1))
            return

    $$.fn.undelegate = (selector, event, callback) ->
        @each ->
            _unsubscribe @, event, callback, selector
            return

    $$.fn.trigger = (event, touch) ->
        event = $$.Event(event, touch) if $$.toType(event) is "string"
        @each ->
            @dispatchEvent event
            return

    $$.fn.addEvent = (element, event_name, callback) ->
        if element.addEventListener
            element.addEventListener event_name, callback, false
        else if element.attachEvent
            element.attachEvent "on" + event_name, callback
        else
            element["on" + event_name] = callback

    $$.fn.removeEvent = (element, event_name, callback) ->
        if element.removeEventListener
            element.removeEventListener event_name, callback, false
        else if element.detachEvent
            element.detachEvent "on" + event_name, callback
        else
            element["on" + event_name] = null


Prompt:
$$.fn.unbind = (event, callback) ->
        @each ->
            _unsubscribe @, event, callback
            return

    $$.fn.delegate = (selector, event, callback) ->
        @each (i, element) ->
            _subscribe element, event, callback, selector, (fn) ->
                (e) ->
                    match = $$(e.target).closest(selector, element).get(0)
                    if match
                        evt = $$.extend(_createProxy(e),
                            currentTarget: match
                            liveFired: element
                        )
                        fn.apply match, [ evt ].concat([].slice.call(arguments, 1))
            return

    $$.fn.undelegate = (selector, event, callback) ->
        @each ->
            _unsubscribe @, event, callback, selector
            return

Response:
$$.fn.trigger = (event, touch) ->
        event = $$.Event(event, touch) if $$.toType(event) is "string"
        @each ->
            @dispatchEvent event
            return

    $$.fn.addEvent = (element, event_name, callback) ->
        if element.addEventListener
            element.addEventListener event_name, callback, false
        else if element.attachEvent
            element.attachEvent "on" + event_name, callback
        else
            element["on" + event_name] = callback

    $$.fn.removeEvent = (element, event_name, callback) ->
        if element.removeEventListener
            element.removeEventListener event_name, callback, false
        else if element.detachEvent
            element.detachEvent "on" + event_name, callback
        else
            element["on" + event_name] = null


Response:
_subscribe = (element, event, callback, selector, delegate_callback) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        element_handlers = HANDLERS[element_id] or (HANDLERS[element_id] = [])
        delegate = delegate_callback and delegate_callback(callback, event)
        handler =
            event: event
            callback: callback
            selector: selector
            proxy: _createProxyCallback(delegate, callback, element)
            delegate: delegate
            index: element_handlers.length

        element_handlers.push handler
        $$.fn.addEvent element, handler.event, handler.proxy

    _unsubscribe = (element, event, callback, selector) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        _findHandlers(element_id, event, callback, selector).forEach (handler) ->
            delete HANDLERS[element_id][handler.index]

            $$.fn.removeEvent element, handler.event, handler.proxy

    _getElementId = (element) -> element._id or (element._id = ELEMENT_ID++)

    _environmentEvent = (event) ->
        environment_event = (if ($$.isMobile()) then event else EVENTS_DESKTOP[event])
        (environment_event) or event

    _createProxyCallback = (delegate, callback, element) ->
        callback = delegate or callback
        proxy = (event) ->
            result = callback.apply(element, [ event ].concat(event.data))
            event.preventDefault() if result is false
            result
        proxy

    _findHandlers = (element_id, event, fn, selector) ->
        (HANDLERS[element_id] or []).filter (handler) ->
            handler and (not event or handler.event is event) and (not fn or handler.fn is fn) and (not selector or handler.selector is selector)


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
_subscribe = (element, event, callback, selector, delegate_callback) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        element_handlers = HANDLERS[element_id] or (HANDLERS[element_id] = [])
        delegate = delegate_callback and delegate_callback(callback, event)
        handler =
            event: event
            callback: callback
            selector: selector
            proxy: _createProxyCallback(delegate, callback, element)
            delegate: delegate
            index: element_handlers.length

        element_handlers.push handler
        $$.fn.addEvent element, handler.event, handler.proxy

    _unsubscribe = (element, event, callback, selector) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        _findHandlers(element_id, event, callback, selector).forEach (handler) ->
            delete HANDLERS[element_id][handler.index]

            $$.fn.removeEvent element, handler.event, handler.proxy

    _getElementId = (element) -> element._id or (element._id = ELEMENT_ID++)

    _environmentEvent = (event) ->
        environment_event = (if ($$.isMobile()) then event else EVENTS_DESKTOP[event])
        (environment_event) or event

    _createProxyCallback = (delegate, callback, element) ->
        callback = delegate or callback
        proxy = (event) ->
            result = callback.apply(element, [ event ].concat(event.data))
            event.preventDefault() if result is false
            result
        proxy

    _findHandlers = (element_id, event, fn, selector) ->
        (HANDLERS[element_id] or []).filter (handler) ->
            handler and (not event or handler.event is event) and (not fn or handler.fn is fn) and (not selector or handler.selector is selector)
```

Response:
var _createProxyCallback, _environmentEvent, _findHandlers, _getElementId, _subscribe, _unsubscribe;

_subscribe = function(element, event, callback, selector, delegate_callback) {
  var delegate, element_handlers, element_id, handler;
  event = _environmentEvent(event);
  element_id = _getElementId(element);
  element_handlers = HANDLERS[element_id] || (HANDLERS[element_id] = []);
  delegate = delegate_callback && delegate_callback(callback, event);
  handler = {
    event: event,
    callback: callback,
    selector: selector,
    proxy: _createProxyCallback(delegate, callback, element),
    delegate: delegate,
    index: element_handlers.length
  };
  element_handlers.push(handler);
  return $$.fn.addEvent(element, handler.event, handler.proxy);
};

_unsubscribe = function(element, event, callback, selector) {
  var element_id;
  event = _environmentEvent(event);
  element_id = _getElementId(element);
  return _findHandlers(element_id, event, callback, selector).forEach(function(handler) {
    delete HANDLERS[element_id][handler.index];
    return $$.fn.removeEvent(element, handler.event, handler.proxy);
  });
};

_getElementId = function(element) {
  return element._id || (element._id = ELEMENT_ID++);
};

_environmentEvent = function(event) {
  var environment_event;
  environment_event = (($$.isMobile()) ? event : EVENTS_DESKTOP[event]);
  return environment_event || event;
};

_createProxyCallback = function(delegate, callback, element) {
  var proxy;
  callback = delegate || callback;
  proxy = function(event) {
    var result;
    result = callback.apply(element, [event].concat(event.data));
    if (result === false) {
      event.preventDefault();
    }
    return result;
  };
  return proxy;
};

_findHandlers = function(element_id, event, fn, selector) {
  return (HANDLERS[element_id] || []).filter(function(handler) {
    return handler && (!event || handler.event === event) && (!fn || handler.fn === fn) && (!selector || handler.selector === selector);
  });
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var _createProxyCallback, _environmentEvent, _findHandlers, _getElementId, _subscribe, _unsubscribe;

_subscribe = function(element, event, callback, selector, delegate_callback) {
  var delegate, element_handlers, element_id, handler;
  event = _environmentEvent(event);
  element_id = _getElementId(element);
  element_handlers = HANDLERS[element_id] || (HANDLERS[element_id] = []);
  delegate = delegate_callback && delegate_callback(callback, event);
  handler = {
    event: event,
    callback: callback,
    selector: selector,
    proxy: _createProxyCallback(delegate, callback, element),
    delegate: delegate,
    index: element_handlers.length
  };
  element_handlers.push(handler);
  return $$.fn.addEvent(element, handler.event, handler.proxy);
};

_unsubscribe = function(element, event, callback, selector) {
  var element_id;
  event = _environmentEvent(event);
  element_id = _getElementId(element);
  return _findHandlers(element_id, event, callback, selector).forEach(function(handler) {
    delete HANDLERS[element_id][handler.index];
    return $$.fn.removeEvent(element, handler.event, handler.proxy);
  });
};

_getElementId = function(element) {
  return element._id || (element._id = ELEMENT_ID++);
};

_environmentEvent = function(event) {
  var environment_event;
  environment_event = (($$.isMobile()) ? event : EVENTS_DESKTOP[event]);
  return environment_event || event;
};

_createProxyCallback = function(delegate, callback, element) {
  var proxy;
  callback = delegate || callback;
  proxy = function(event) {
    var result;
    result = callback.apply(element, [event].concat(event.data));
    if (result === false) {
      event.preventDefault();
    }
    return result;
  };
  return proxy;
};

_findHandlers = function(element_id, event, fn, selector) {
  return (HANDLERS[element_id] || []).filter(function(handler) {
    return handler && (!event || handler.event === event) && (!fn || handler.fn === fn) && (!selector || handler.selector === selector);
  });
};
```

Response:
_subscribe = (element, event, callback, selector, delegate_callback) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        element_handlers = HANDLERS[element_id] or (HANDLERS[element_id] = [])
        delegate = delegate_callback and delegate_callback(callback, event)
        handler =
            event: event
            callback: callback
            selector: selector
            proxy: _createProxyCallback(delegate, callback, element)
            delegate: delegate
            index: element_handlers.length

        element_handlers.push handler
        $$.fn.addEvent element, handler.event, handler.proxy

    _unsubscribe = (element, event, callback, selector) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        _findHandlers(element_id, event, callback, selector).forEach (handler) ->
            delete HANDLERS[element_id][handler.index]

            $$.fn.removeEvent element, handler.event, handler.proxy

    _getElementId = (element) -> element._id or (element._id = ELEMENT_ID++)

    _environmentEvent = (event) ->
        environment_event = (if ($$.isMobile()) then event else EVENTS_DESKTOP[event])
        (environment_event) or event

    _createProxyCallback = (delegate, callback, element) ->
        callback = delegate or callback
        proxy = (event) ->
            result = callback.apply(element, [ event ].concat(event.data))
            event.preventDefault() if result is false
            result
        proxy

    _findHandlers = (element_id, event, fn, selector) ->
        (HANDLERS[element_id] or []).filter (handler) ->
            handler and (not event or handler.event is event) and (not fn or handler.fn is fn) and (not selector or handler.selector is selector)


Prompt:
_subscribe = (element, event, callback, selector, delegate_callback) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        element_handlers = HANDLERS[element_id] or (HANDLERS[element_id] = [])
        delegate = delegate_callback and delegate_callback(callback, event)
        handler =
            event: event
            callback: callback
            selector: selector
            proxy: _createProxyCallback(delegate, callback, element)
            delegate: delegate
            index: element_handlers.length

        element_handlers.push handler
        $$.fn.addEvent element, handler.event, handler.proxy

    _unsubscribe = (element, event, callback, selector) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        _findHandlers(element_id, event, callback, selector).forEach (handler) ->

Response:
delete HANDLERS[element_id][handler.index]

            $$.fn.removeEvent element, handler.event, handler.proxy

    _getElementId = (element) -> element._id or (element._id = ELEMENT_ID++)

    _environmentEvent = (event) ->
        environment_event = (if ($$.isMobile()) then event else EVENTS_DESKTOP[event])
        (environment_event) or event

    _createProxyCallback = (delegate, callback, element) ->
        callback = delegate or callback
        proxy = (event) ->
            result = callback.apply(element, [ event ].concat(event.data))
            event.preventDefault() if result is false
            result
        proxy

    _findHandlers = (element_id, event, fn, selector) ->
        (HANDLERS[element_id] or []).filter (handler) ->
            handler and (not event or handler.event is event) and (not fn or handler.fn is fn) and (not selector or handler.selector is selector)


Response:
do ($$ = Quo) ->

    ELEMENT_ID = 1
    HANDLERS = {}
    EVENT_METHODS =
        preventDefault: "isDefaultPrevented"
        stopImmediatePropagation: "isImmediatePropagationStopped"
        stopPropagation: "isPropagationStopped"
    EVENTS_DESKTOP =
        touchstart: "mousedown"
        touchmove: "mousemove"
        touchend: "mouseup"
        touch: "click"
        doubletap: "dblclick"
        orientationchange: "resize"

    READY_EXPRESSION = /complete|loaded|interactive/

    SHORTCUTS = [ "tap" ]
    SHORTCUTS.forEach (event) ->
        $$.fn[event] = (callback) ->
            $$(document.body).delegate @selector, event, callback
        @

    $$.fn.on = (event, selector, callback) ->
        (if (selector is "undefined" or $$.toType(selector) is "function") then @bind(event, selector) else @delegate(selector, event, callback))

    $$.fn.off = (event, selector, callback) ->
        (if (selector is "undefined" or $$.toType(selector) is "function") then @unbind(event, selector) else @undelegate(selector, event, callback))

    $$.fn.ready = (callback) ->
        if READY_EXPRESSION.test(document.readyState)
            callback $$
        else
            $$.fn.addEvent document, "DOMContentLoaded", -> callback $$

    $$.Event = (type, touch) ->
        event = document.createEvent("Events")
        event.initEvent type, true, true, null, null, null, null, null, null, null, null, null, null, null, null
        if touch
            event[property] = touch[property] for property of touch
        event


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
do ($$ = Quo) ->

    ELEMENT_ID = 1
    HANDLERS = {}
    EVENT_METHODS =
        preventDefault: "isDefaultPrevented"
        stopImmediatePropagation: "isImmediatePropagationStopped"
        stopPropagation: "isPropagationStopped"
    EVENTS_DESKTOP =
        touchstart: "mousedown"
        touchmove: "mousemove"
        touchend: "mouseup"
        touch: "click"
        doubletap: "dblclick"
        orientationchange: "resize"

    READY_EXPRESSION = /complete|loaded|interactive/

    SHORTCUTS = [ "tap" ]
    SHORTCUTS.forEach (event) ->
        $$.fn[event] = (callback) ->
            $$(document.body).delegate @selector, event, callback
        @

    $$.fn.on = (event, selector, callback) ->
        (if (selector is "undefined" or $$.toType(selector) is "function") then @bind(event, selector) else @delegate(selector, event, callback))

    $$.fn.off = (event, selector, callback) ->
        (if (selector is "undefined" or $$.toType(selector) is "function") then @unbind(event, selector) else @undelegate(selector, event, callback))

    $$.fn.ready = (callback) ->
        if READY_EXPRESSION.test(document.readyState)
            callback $$
        else
            $$.fn.addEvent document, "DOMContentLoaded", -> callback $$

    $$.Event = (type, touch) ->
        event = document.createEvent("Events")
        event.initEvent type, true, true, null, null, null, null, null, null, null, null, null, null, null, null
        if touch
            event[property] = touch[property] for property of touch
        event
```

Response:
(function($$) {
  var ELEMENT_ID, EVENTS_DESKTOP, EVENT_METHODS, HANDLERS, READY_EXPRESSION, SHORTCUTS;
  ELEMENT_ID = 1;
  HANDLERS = {};
  EVENT_METHODS = {
    preventDefault: "isDefaultPrevented",
    stopImmediatePropagation: "isImmediatePropagationStopped",
    stopPropagation: "isPropagationStopped"
  };
  EVENTS_DESKTOP = {
    touchstart: "mousedown",
    touchmove: "mousemove",
    touchend: "mouseup",
    touch: "click",
    doubletap: "dblclick",
    orientationchange: "resize"
  };
  READY_EXPRESSION = /complete|loaded|interactive/;
  SHORTCUTS = ["tap"];
  SHORTCUTS.forEach(function(event) {
    $$.fn[event] = function(callback) {
      return $$(document.body).delegate(this.selector, event, callback);
    };
    return this;
  });
  $$.fn.on = function(event, selector, callback) {
    if (selector === "undefined" || $$.toType(selector) === "function") {
      return this.bind(event, selector);
    } else {
      return this.delegate(selector, event, callback);
    }
  };
  $$.fn.off = function(event, selector, callback) {
    if (selector === "undefined" || $$.toType(selector) === "function") {
      return this.unbind(event, selector);
    } else {
      return this.undelegate(selector, event, callback);
    }
  };
  $$.fn.ready = function(callback) {
    if (READY_EXPRESSION.test(document.readyState)) {
      return callback($$);
    } else {
      return $$.fn.addEvent(document, "DOMContentLoaded", function() {
        return callback($$);
      });
    }
  };
  return $$.Event = function(type, touch) {
    var event, property;
    event = document.createEvent("Events");
    event.initEvent(type, true, true, null, null, null, null, null, null, null, null, null, null, null, null);
    if (touch) {
      for (property in touch) {
        event[property] = touch[property];
      }
    }
    return event;
  };
})(Quo);


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
(function($$) {
  var ELEMENT_ID, EVENTS_DESKTOP, EVENT_METHODS, HANDLERS, READY_EXPRESSION, SHORTCUTS;
  ELEMENT_ID = 1;
  HANDLERS = {};
  EVENT_METHODS = {
    preventDefault: "isDefaultPrevented",
    stopImmediatePropagation: "isImmediatePropagationStopped",
    stopPropagation: "isPropagationStopped"
  };
  EVENTS_DESKTOP = {
    touchstart: "mousedown",
    touchmove: "mousemove",
    touchend: "mouseup",
    touch: "click",
    doubletap: "dblclick",
    orientationchange: "resize"
  };
  READY_EXPRESSION = /complete|loaded|interactive/;
  SHORTCUTS = ["tap"];
  SHORTCUTS.forEach(function(event) {
    $$.fn[event] = function(callback) {
      return $$(document.body).delegate(this.selector, event, callback);
    };
    return this;
  });
  $$.fn.on = function(event, selector, callback) {
    if (selector === "undefined" || $$.toType(selector) === "function") {
      return this.bind(event, selector);
    } else {
      return this.delegate(selector, event, callback);
    }
  };
  $$.fn.off = function(event, selector, callback) {
    if (selector === "undefined" || $$.toType(selector) === "function") {
      return this.unbind(event, selector);
    } else {
      return this.undelegate(selector, event, callback);
    }
  };
  $$.fn.ready = function(callback) {
    if (READY_EXPRESSION.test(document.readyState)) {
      return callback($$);
    } else {
      return $$.fn.addEvent(document, "DOMContentLoaded", function() {
        return callback($$);
      });
    }
  };
  return $$.Event = function(type, touch) {
    var event, property;
    event = document.createEvent("Events");
    event.initEvent(type, true, true, null, null, null, null, null, null, null, null, null, null, null, null);
    if (touch) {
      for (property in touch) {
        event[property] = touch[property];
      }
    }
    return event;
  };
})(Quo);
```

Response:
do ($$ = Quo) ->

    ELEMENT_ID = 1
    HANDLERS = {}
    EVENT_METHODS =
        preventDefault: "isDefaultPrevented"
        stopImmediatePropagation: "isImmediatePropagationStopped"
        stopPropagation: "isPropagationStopped"
    EVENTS_DESKTOP =
        touchstart: "mousedown"
        touchmove: "mousemove"
        touchend: "mouseup"
        touch: "click"
        doubletap: "dblclick"
        orientationchange: "resize"

    READY_EXPRESSION = /complete|loaded|interactive/

    SHORTCUTS = [ "tap" ]
    SHORTCUTS.forEach (event) ->
        $$.fn[event] = (callback) ->
            $$(document.body).delegate @selector, event, callback
        @

    $$.fn.on = (event, selector, callback) ->
        (if (selector is "undefined" or $$.toType(selector) is "function") then @bind(event, selector) else @delegate(selector, event, callback))

    $$.fn.off = (event, selector, callback) ->
        (if (selector is "undefined" or $$.toType(selector) is "function") then @unbind(event, selector) else @undelegate(selector, event, callback))

    $$.fn.ready = (callback) ->
        if READY_EXPRESSION.test(document.readyState)
            callback $$
        else
            $$.fn.addEvent document, "DOMContentLoaded", -> callback $$

    $$.Event = (type, touch) ->
        event = document.createEvent("Events")
        event.initEvent type, true, true, null, null, null, null, null, null, null, null, null, null, null, null
        if touch
            event[property] = touch[property] for property of touch
        event


Prompt:
do ($$ = Quo) ->

    ELEMENT_ID = 1
    HANDLERS = {}
    EVENT_METHODS =
        preventDefault: "isDefaultPrevented"
        stopImmediatePropagation: "isImmediatePropagationStopped"
        stopPropagation: "isPropagationStopped"
    EVENTS_DESKTOP =
        touchstart: "mousedown"
        touchmove: "mousemove"
        touchend: "mouseup"
        touch: "click"
        doubletap: "dblclick"
        orientationchange: "resize"

    READY_EXPRESSION = /complete|loaded|interactive/

    SHORTCUTS = [ "tap" ]
    SHORTCUTS.forEach (event) ->
        $$.fn[event] = (callback) ->

Response:
$$(document.body).delegate @selector, event, callback
        @

    $$.fn.on = (event, selector, callback) ->
        (if (selector is "undefined" or $$.toType(selector) is "function") then @bind(event, selector) else @delegate(selector, event, callback))

    $$.fn.off = (event, selector, callback) ->
        (if (selector is "undefined" or $$.toType(selector) is "function") then @unbind(event, selector) else @undelegate(selector, event, callback))

    $$.fn.ready = (callback) ->
        if READY_EXPRESSION.test(document.readyState)
            callback $$
        else
            $$.fn.addEvent document, "DOMContentLoaded", -> callback $$

    $$.Event = (type, touch) ->
        event = document.createEvent("Events")
        event.initEvent type, true, true, null, null, null, null, null, null, null, null, null, null, null, null
        if touch
            event[property] = touch[property] for property of touch
        event


Response:
$$.fn.bind = (event, callback) ->
        @each ->
            _subscribe @, event, callback
            return

    $$.fn.unbind = (event, callback) ->
        @each ->
            _unsubscribe @, event, callback
            return

    $$.fn.delegate = (selector, event, callback) ->
        @each (i, element) ->
            _subscribe element, event, callback, selector, (fn) ->
                (e) ->
                    match = $$(e.target).closest(selector, element).get(0)
                    if match
                        evt = $$.extend(_createProxy(e),
                            currentTarget: match
                            liveFired: element
                        )
                        fn.apply match, [ evt ].concat([].slice.call(arguments, 1))
            return

    $$.fn.undelegate = (selector, event, callback) ->
        @each ->
            _unsubscribe @, event, callback, selector
            return

    $$.fn.trigger = (event, touch) ->
        event = $$.Event(event, touch) if $$.toType(event) is "string"
        @each ->
            @dispatchEvent event
            return

    $$.fn.addEvent = (element, event_name, callback) ->
        if element.addEventListener
            element.addEventListener event_name, callback, false
        else if element.attachEvent
            element.attachEvent "on" + event_name, callback
        else
            element["on" + event_name] = callback


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
$$.fn.bind = (event, callback) ->
        @each ->
            _subscribe @, event, callback
            return

    $$.fn.unbind = (event, callback) ->
        @each ->
            _unsubscribe @, event, callback
            return

    $$.fn.delegate = (selector, event, callback) ->
        @each (i, element) ->
            _subscribe element, event, callback, selector, (fn) ->
                (e) ->
                    match = $$(e.target).closest(selector, element).get(0)
                    if match
                        evt = $$.extend(_createProxy(e),
                            currentTarget: match
                            liveFired: element
                        )
                        fn.apply match, [ evt ].concat([].slice.call(arguments, 1))
            return

    $$.fn.undelegate = (selector, event, callback) ->
        @each ->
            _unsubscribe @, event, callback, selector
            return

    $$.fn.trigger = (event, touch) ->
        event = $$.Event(event, touch) if $$.toType(event) is "string"
        @each ->
            @dispatchEvent event
            return

    $$.fn.addEvent = (element, event_name, callback) ->
        if element.addEventListener
            element.addEventListener event_name, callback, false
        else if element.attachEvent
            element.attachEvent "on" + event_name, callback
        else
            element["on" + event_name] = callback
```

Response:
$$.fn.bind = function(event, callback) {
  return this.each(function() {
    _subscribe(this, event, callback);
  });
};

$$.fn.unbind = function(event, callback) {
  return this.each(function() {
    _unsubscribe(this, event, callback);
  });
};

$$.fn.delegate = function(selector, event, callback) {
  return this.each(function(i, element) {
    _subscribe(element, event, callback, selector, function(fn) {
      return function(e) {
        var evt, match;
        match = $$(e.target).closest(selector, element).get(0);
        if (match) {
          evt = $$.extend(_createProxy(e), {
            currentTarget: match,
            liveFired: element
          });
          return fn.apply(match, [evt].concat([].slice.call(arguments, 1)));
        }
      };
    });
  });
};

$$.fn.undelegate = function(selector, event, callback) {
  return this.each(function() {
    _unsubscribe(this, event, callback, selector);
  });
};

$$.fn.trigger = function(event, touch) {
  if ($$.toType(event) === "string") {
    event = $$.Event(event, touch);
  }
  return this.each(function() {
    this.dispatchEvent(event);
  });
};

$$.fn.addEvent = function(element, event_name, callback) {
  if (element.addEventListener) {
    return element.addEventListener(event_name, callback, false);
  } else if (element.attachEvent) {
    return element.attachEvent("on" + event_name, callback);
  } else {
    return element["on" + event_name] = callback;
  }
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
$$.fn.bind = function(event, callback) {
  return this.each(function() {
    _subscribe(this, event, callback);
  });
};

$$.fn.unbind = function(event, callback) {
  return this.each(function() {
    _unsubscribe(this, event, callback);
  });
};

$$.fn.delegate = function(selector, event, callback) {
  return this.each(function(i, element) {
    _subscribe(element, event, callback, selector, function(fn) {
      return function(e) {
        var evt, match;
        match = $$(e.target).closest(selector, element).get(0);
        if (match) {
          evt = $$.extend(_createProxy(e), {
            currentTarget: match,
            liveFired: element
          });
          return fn.apply(match, [evt].concat([].slice.call(arguments, 1)));
        }
      };
    });
  });
};

$$.fn.undelegate = function(selector, event, callback) {
  return this.each(function() {
    _unsubscribe(this, event, callback, selector);
  });
};

$$.fn.trigger = function(event, touch) {
  if ($$.toType(event) === "string") {
    event = $$.Event(event, touch);
  }
  return this.each(function() {
    this.dispatchEvent(event);
  });
};

$$.fn.addEvent = function(element, event_name, callback) {
  if (element.addEventListener) {
    return element.addEventListener(event_name, callback, false);
  } else if (element.attachEvent) {
    return element.attachEvent("on" + event_name, callback);
  } else {
    return element["on" + event_name] = callback;
  }
};
```

Response:
$$.fn.bind = (event, callback) ->
        @each ->
            _subscribe @, event, callback
            return

    $$.fn.unbind = (event, callback) ->
        @each ->
            _unsubscribe @, event, callback
            return

    $$.fn.delegate = (selector, event, callback) ->
        @each (i, element) ->
            _subscribe element, event, callback, selector, (fn) ->
                (e) ->
                    match = $$(e.target).closest(selector, element).get(0)
                    if match
                        evt = $$.extend(_createProxy(e),
                            currentTarget: match
                            liveFired: element
                        )
                        fn.apply match, [ evt ].concat([].slice.call(arguments, 1))
            return

    $$.fn.undelegate = (selector, event, callback) ->
        @each ->
            _unsubscribe @, event, callback, selector
            return

    $$.fn.trigger = (event, touch) ->
        event = $$.Event(event, touch) if $$.toType(event) is "string"
        @each ->
            @dispatchEvent event
            return

    $$.fn.addEvent = (element, event_name, callback) ->
        if element.addEventListener
            element.addEventListener event_name, callback, false
        else if element.attachEvent
            element.attachEvent "on" + event_name, callback
        else
            element["on" + event_name] = callback


Prompt:
$$.fn.bind = (event, callback) ->
        @each ->
            _subscribe @, event, callback
            return

    $$.fn.unbind = (event, callback) ->
        @each ->
            _unsubscribe @, event, callback
            return

    $$.fn.delegate = (selector, event, callback) ->
        @each (i, element) ->
            _subscribe element, event, callback, selector, (fn) ->
                (e) ->
                    match = $$(e.target).closest(selector, element).get(0)
                    if match
                        evt = $$.extend(_createProxy(e),
                            currentTarget: match
                            liveFired: element
                        )

Response:
fn.apply match, [ evt ].concat([].slice.call(arguments, 1))
            return

    $$.fn.undelegate = (selector, event, callback) ->
        @each ->
            _unsubscribe @, event, callback, selector
            return

    $$.fn.trigger = (event, touch) ->
        event = $$.Event(event, touch) if $$.toType(event) is "string"
        @each ->
            @dispatchEvent event
            return

    $$.fn.addEvent = (element, event_name, callback) ->
        if element.addEventListener
            element.addEventListener event_name, callback, false
        else if element.attachEvent
            element.attachEvent "on" + event_name, callback
        else
            element["on" + event_name] = callback


Response:
$$.fn.removeEvent = (element, event_name, callback) ->
        if element.removeEventListener
            element.removeEventListener event_name, callback, false
        else if element.detachEvent
            element.detachEvent "on" + event_name, callback
        else
            element["on" + event_name] = null

    _subscribe = (element, event, callback, selector, delegate_callback) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        element_handlers = HANDLERS[element_id] or (HANDLERS[element_id] = [])
        delegate = delegate_callback and delegate_callback(callback, event)
        handler =
            event: event
            callback: callback
            selector: selector
            proxy: _createProxyCallback(delegate, callback, element)
            delegate: delegate
            index: element_handlers.length

        element_handlers.push handler
        $$.fn.addEvent element, handler.event, handler.proxy

    _unsubscribe = (element, event, callback, selector) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        _findHandlers(element_id, event, callback, selector).forEach (handler) ->
            delete HANDLERS[element_id][handler.index]

            $$.fn.removeEvent element, handler.event, handler.proxy

    _getElementId = (element) -> element._id or (element._id = ELEMENT_ID++)

    _environmentEvent = (event) ->
        environment_event = (if ($$.isMobile()) then event else EVENTS_DESKTOP[event])
        (environment_event) or event

    _createProxyCallback = (delegate, callback, element) ->
        callback = delegate or callback
        proxy = (event) ->
            result = callback.apply(element, [ event ].concat(event.data))
            event.preventDefault() if result is false
            result
        proxy


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
$$.fn.removeEvent = (element, event_name, callback) ->
        if element.removeEventListener
            element.removeEventListener event_name, callback, false
        else if element.detachEvent
            element.detachEvent "on" + event_name, callback
        else
            element["on" + event_name] = null

    _subscribe = (element, event, callback, selector, delegate_callback) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        element_handlers = HANDLERS[element_id] or (HANDLERS[element_id] = [])
        delegate = delegate_callback and delegate_callback(callback, event)
        handler =
            event: event
            callback: callback
            selector: selector
            proxy: _createProxyCallback(delegate, callback, element)
            delegate: delegate
            index: element_handlers.length

        element_handlers.push handler
        $$.fn.addEvent element, handler.event, handler.proxy

    _unsubscribe = (element, event, callback, selector) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        _findHandlers(element_id, event, callback, selector).forEach (handler) ->
            delete HANDLERS[element_id][handler.index]

            $$.fn.removeEvent element, handler.event, handler.proxy

    _getElementId = (element) -> element._id or (element._id = ELEMENT_ID++)

    _environmentEvent = (event) ->
        environment_event = (if ($$.isMobile()) then event else EVENTS_DESKTOP[event])
        (environment_event) or event

    _createProxyCallback = (delegate, callback, element) ->
        callback = delegate or callback
        proxy = (event) ->
            result = callback.apply(element, [ event ].concat(event.data))
            event.preventDefault() if result is false
            result
        proxy
```

Response:
var _createProxyCallback, _environmentEvent, _getElementId, _subscribe, _unsubscribe;

$$.fn.removeEvent = function(element, event_name, callback) {
  if (element.removeEventListener) {
    return element.removeEventListener(event_name, callback, false);
  } else if (element.detachEvent) {
    return element.detachEvent("on" + event_name, callback);
  } else {
    return element["on" + event_name] = null;
  }
};

_subscribe = function(element, event, callback, selector, delegate_callback) {
  var delegate, element_handlers, element_id, handler;
  event = _environmentEvent(event);
  element_id = _getElementId(element);
  element_handlers = HANDLERS[element_id] || (HANDLERS[element_id] = []);
  delegate = delegate_callback && delegate_callback(callback, event);
  handler = {
    event: event,
    callback: callback,
    selector: selector,
    proxy: _createProxyCallback(delegate, callback, element),
    delegate: delegate,
    index: element_handlers.length
  };
  element_handlers.push(handler);
  return $$.fn.addEvent(element, handler.event, handler.proxy);
};

_unsubscribe = function(element, event, callback, selector) {
  var element_id;
  event = _environmentEvent(event);
  element_id = _getElementId(element);
  return _findHandlers(element_id, event, callback, selector).forEach(function(handler) {
    delete HANDLERS[element_id][handler.index];
    return $$.fn.removeEvent(element, handler.event, handler.proxy);
  });
};

_getElementId = function(element) {
  return element._id || (element._id = ELEMENT_ID++);
};

_environmentEvent = function(event) {
  var environment_event;
  environment_event = (($$.isMobile()) ? event : EVENTS_DESKTOP[event]);
  return environment_event || event;
};

_createProxyCallback = function(delegate, callback, element) {
  var proxy;
  callback = delegate || callback;
  proxy = function(event) {
    var result;
    result = callback.apply(element, [event].concat(event.data));
    if (result === false) {
      event.preventDefault();
    }
    return result;
  };
  return proxy;
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var _createProxyCallback, _environmentEvent, _getElementId, _subscribe, _unsubscribe;

$$.fn.removeEvent = function(element, event_name, callback) {
  if (element.removeEventListener) {
    return element.removeEventListener(event_name, callback, false);
  } else if (element.detachEvent) {
    return element.detachEvent("on" + event_name, callback);
  } else {
    return element["on" + event_name] = null;
  }
};

_subscribe = function(element, event, callback, selector, delegate_callback) {
  var delegate, element_handlers, element_id, handler;
  event = _environmentEvent(event);
  element_id = _getElementId(element);
  element_handlers = HANDLERS[element_id] || (HANDLERS[element_id] = []);
  delegate = delegate_callback && delegate_callback(callback, event);
  handler = {
    event: event,
    callback: callback,
    selector: selector,
    proxy: _createProxyCallback(delegate, callback, element),
    delegate: delegate,
    index: element_handlers.length
  };
  element_handlers.push(handler);
  return $$.fn.addEvent(element, handler.event, handler.proxy);
};

_unsubscribe = function(element, event, callback, selector) {
  var element_id;
  event = _environmentEvent(event);
  element_id = _getElementId(element);
  return _findHandlers(element_id, event, callback, selector).forEach(function(handler) {
    delete HANDLERS[element_id][handler.index];
    return $$.fn.removeEvent(element, handler.event, handler.proxy);
  });
};

_getElementId = function(element) {
  return element._id || (element._id = ELEMENT_ID++);
};

_environmentEvent = function(event) {
  var environment_event;
  environment_event = (($$.isMobile()) ? event : EVENTS_DESKTOP[event]);
  return environment_event || event;
};

_createProxyCallback = function(delegate, callback, element) {
  var proxy;
  callback = delegate || callback;
  proxy = function(event) {
    var result;
    result = callback.apply(element, [event].concat(event.data));
    if (result === false) {
      event.preventDefault();
    }
    return result;
  };
  return proxy;
};
```

Response:
$$.fn.removeEvent = (element, event_name, callback) ->
        if element.removeEventListener
            element.removeEventListener event_name, callback, false
        else if element.detachEvent
            element.detachEvent "on" + event_name, callback
        else
            element["on" + event_name] = null

    _subscribe = (element, event, callback, selector, delegate_callback) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        element_handlers = HANDLERS[element_id] or (HANDLERS[element_id] = [])
        delegate = delegate_callback and delegate_callback(callback, event)
        handler =
            event: event
            callback: callback
            selector: selector
            proxy: _createProxyCallback(delegate, callback, element)
            delegate: delegate
            index: element_handlers.length

        element_handlers.push handler
        $$.fn.addEvent element, handler.event, handler.proxy

    _unsubscribe = (element, event, callback, selector) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        _findHandlers(element_id, event, callback, selector).forEach (handler) ->
            delete HANDLERS[element_id][handler.index]

            $$.fn.removeEvent element, handler.event, handler.proxy

    _getElementId = (element) -> element._id or (element._id = ELEMENT_ID++)

    _environmentEvent = (event) ->
        environment_event = (if ($$.isMobile()) then event else EVENTS_DESKTOP[event])
        (environment_event) or event

    _createProxyCallback = (delegate, callback, element) ->
        callback = delegate or callback
        proxy = (event) ->
            result = callback.apply(element, [ event ].concat(event.data))
            event.preventDefault() if result is false
            result
        proxy


Prompt:
$$.fn.removeEvent = (element, event_name, callback) ->
        if element.removeEventListener
            element.removeEventListener event_name, callback, false
        else if element.detachEvent
            element.detachEvent "on" + event_name, callback
        else
            element["on" + event_name] = null

    _subscribe = (element, event, callback, selector, delegate_callback) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        element_handlers = HANDLERS[element_id] or (HANDLERS[element_id] = [])
        delegate = delegate_callback and delegate_callback(callback, event)
        handler =
            event: event
            callback: callback
            selector: selector
            proxy: _createProxyCallback(delegate, callback, element)
            delegate: delegate
            index: element_handlers.length

        element_handlers.push handler

Response:
$$.fn.addEvent element, handler.event, handler.proxy

    _unsubscribe = (element, event, callback, selector) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        _findHandlers(element_id, event, callback, selector).forEach (handler) ->
            delete HANDLERS[element_id][handler.index]

            $$.fn.removeEvent element, handler.event, handler.proxy

    _getElementId = (element) -> element._id or (element._id = ELEMENT_ID++)

    _environmentEvent = (event) ->
        environment_event = (if ($$.isMobile()) then event else EVENTS_DESKTOP[event])
        (environment_event) or event

    _createProxyCallback = (delegate, callback, element) ->
        callback = delegate or callback
        proxy = (event) ->
            result = callback.apply(element, [ event ].concat(event.data))
            event.preventDefault() if result is false
            result
        proxy


Response:
_findHandlers = (element_id, event, fn, selector) ->
        (HANDLERS[element_id] or []).filter (handler) ->
            handler and (not event or handler.event is event) and (not fn or handler.fn is fn) and (not selector or handler.selector is selector)

    _createProxy = (event) ->
        proxy = $$.extend( originalEvent: event, event)
        $$.each EVENT_METHODS, (name, method) ->
            proxy[name] = ->
                @[method] = ->
                    true

                event[name].apply event, arguments

            proxy[method] = ->
                false
        proxy


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
_findHandlers = (element_id, event, fn, selector) ->
        (HANDLERS[element_id] or []).filter (handler) ->
            handler and (not event or handler.event is event) and (not fn or handler.fn is fn) and (not selector or handler.selector is selector)

    _createProxy = (event) ->
        proxy = $$.extend( originalEvent: event, event)
        $$.each EVENT_METHODS, (name, method) ->
            proxy[name] = ->
                @[method] = ->
                    true

                event[name].apply event, arguments

            proxy[method] = ->
                false
        proxy
```

Response:
var _createProxy, _findHandlers;

_findHandlers = function(element_id, event, fn, selector) {
  return (HANDLERS[element_id] || []).filter(function(handler) {
    return handler && (!event || handler.event === event) && (!fn || handler.fn === fn) && (!selector || handler.selector === selector);
  });
};

_createProxy = function(event) {
  var proxy;
  proxy = $$.extend({
    originalEvent: event
  }, event);
  $$.each(EVENT_METHODS, function(name, method) {
    proxy[name] = function() {
      this[method] = function() {
        return true;
      };
      return event[name].apply(event, arguments);
    };
    return proxy[method] = function() {
      return false;
    };
  });
  return proxy;
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var _createProxy, _findHandlers;

_findHandlers = function(element_id, event, fn, selector) {
  return (HANDLERS[element_id] || []).filter(function(handler) {
    return handler && (!event || handler.event === event) && (!fn || handler.fn === fn) && (!selector || handler.selector === selector);
  });
};

_createProxy = function(event) {
  var proxy;
  proxy = $$.extend({
    originalEvent: event
  }, event);
  $$.each(EVENT_METHODS, function(name, method) {
    proxy[name] = function() {
      this[method] = function() {
        return true;
      };
      return event[name].apply(event, arguments);
    };
    return proxy[method] = function() {
      return false;
    };
  });
  return proxy;
};
```

Response:
_findHandlers = (element_id, event, fn, selector) ->
        (HANDLERS[element_id] or []).filter (handler) ->
            handler and (not event or handler.event is event) and (not fn or handler.fn is fn) and (not selector or handler.selector is selector)

    _createProxy = (event) ->
        proxy = $$.extend( originalEvent: event, event)
        $$.each EVENT_METHODS, (name, method) ->
            proxy[name] = ->
                @[method] = ->
                    true

                event[name].apply event, arguments

            proxy[method] = ->
                false
        proxy


Prompt:
_findHandlers = (element_id, event, fn, selector) ->
        (HANDLERS[element_id] or []).filter (handler) ->
            handler and (not event or handler.event is event) and (not fn or handler.fn is fn) and (not selector or handler.selector is selector)

    _createProxy = (event) ->
        proxy = $$.extend( originalEvent: event, event)
        $$.each EVENT_METHODS, (name, method) ->
            proxy[name] = ->

Response:
@[method] = ->
                    true

                event[name].apply event, arguments

            proxy[method] = ->
                false
        proxy


Response:
do ($$ = Quo) ->

    ELEMENT_ID = 1
    HANDLERS = {}
    EVENT_METHODS =
        preventDefault: "isDefaultPrevented"
        stopImmediatePropagation: "isImmediatePropagationStopped"
        stopPropagation: "isPropagationStopped"
    EVENTS_DESKTOP =
        touchstart: "mousedown"
        touchmove: "mousemove"
        touchend: "mouseup"
        touch: "click"
        doubletap: "dblclick"
        orientationchange: "resize"

    READY_EXPRESSION = /complete|loaded|interactive/

    SHORTCUTS = [ "touch" ]
    SHORTCUTS.forEach (event) ->
        $$.fn[event] = (callback) ->
            $$(document.body).delegate @selector, event, callback
        @

    $$.fn.on = (event, selector, callback) ->
        (if (selector is "undefined" or $$.toType(selector) is "function") then @bind(event, selector) else @delegate(selector, event, callback))

    $$.fn.off = (event, selector, callback) ->
        (if (selector is "undefined" or $$.toType(selector) is "function") then @unbind(event, selector) else @undelegate(selector, event, callback))

    $$.fn.ready = (callback) ->
        if READY_EXPRESSION.test(document.readyState)
            callback $$
        else
            $$.fn.addEvent document, "DOMContentLoaded", -> callback $$

    $$.Event = (type, touch) ->
        event = document.createEvent("Events")
        event.initEvent type, true, true, null, null, null, null, null, null, null, null, null, null, null, null
        if touch
            event[property] = touch[property] for property of touch
        event


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
do ($$ = Quo) ->

    ELEMENT_ID = 1
    HANDLERS = {}
    EVENT_METHODS =
        preventDefault: "isDefaultPrevented"
        stopImmediatePropagation: "isImmediatePropagationStopped"
        stopPropagation: "isPropagationStopped"
    EVENTS_DESKTOP =
        touchstart: "mousedown"
        touchmove: "mousemove"
        touchend: "mouseup"
        touch: "click"
        doubletap: "dblclick"
        orientationchange: "resize"

    READY_EXPRESSION = /complete|loaded|interactive/

    SHORTCUTS = [ "touch" ]
    SHORTCUTS.forEach (event) ->
        $$.fn[event] = (callback) ->
            $$(document.body).delegate @selector, event, callback
        @

    $$.fn.on = (event, selector, callback) ->
        (if (selector is "undefined" or $$.toType(selector) is "function") then @bind(event, selector) else @delegate(selector, event, callback))

    $$.fn.off = (event, selector, callback) ->
        (if (selector is "undefined" or $$.toType(selector) is "function") then @unbind(event, selector) else @undelegate(selector, event, callback))

    $$.fn.ready = (callback) ->
        if READY_EXPRESSION.test(document.readyState)
            callback $$
        else
            $$.fn.addEvent document, "DOMContentLoaded", -> callback $$

    $$.Event = (type, touch) ->
        event = document.createEvent("Events")
        event.initEvent type, true, true, null, null, null, null, null, null, null, null, null, null, null, null
        if touch
            event[property] = touch[property] for property of touch
        event
```

Response:
(function($$) {
  var ELEMENT_ID, EVENTS_DESKTOP, EVENT_METHODS, HANDLERS, READY_EXPRESSION, SHORTCUTS;
  ELEMENT_ID = 1;
  HANDLERS = {};
  EVENT_METHODS = {
    preventDefault: "isDefaultPrevented",
    stopImmediatePropagation: "isImmediatePropagationStopped",
    stopPropagation: "isPropagationStopped"
  };
  EVENTS_DESKTOP = {
    touchstart: "mousedown",
    touchmove: "mousemove",
    touchend: "mouseup",
    touch: "click",
    doubletap: "dblclick",
    orientationchange: "resize"
  };
  READY_EXPRESSION = /complete|loaded|interactive/;
  SHORTCUTS = ["touch"];
  SHORTCUTS.forEach(function(event) {
    $$.fn[event] = function(callback) {
      return $$(document.body).delegate(this.selector, event, callback);
    };
    return this;
  });
  $$.fn.on = function(event, selector, callback) {
    if (selector === "undefined" || $$.toType(selector) === "function") {
      return this.bind(event, selector);
    } else {
      return this.delegate(selector, event, callback);
    }
  };
  $$.fn.off = function(event, selector, callback) {
    if (selector === "undefined" || $$.toType(selector) === "function") {
      return this.unbind(event, selector);
    } else {
      return this.undelegate(selector, event, callback);
    }
  };
  $$.fn.ready = function(callback) {
    if (READY_EXPRESSION.test(document.readyState)) {
      return callback($$);
    } else {
      return $$.fn.addEvent(document, "DOMContentLoaded", function() {
        return callback($$);
      });
    }
  };
  return $$.Event = function(type, touch) {
    var event, property;
    event = document.createEvent("Events");
    event.initEvent(type, true, true, null, null, null, null, null, null, null, null, null, null, null, null);
    if (touch) {
      for (property in touch) {
        event[property] = touch[property];
      }
    }
    return event;
  };
})(Quo);


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
(function($$) {
  var ELEMENT_ID, EVENTS_DESKTOP, EVENT_METHODS, HANDLERS, READY_EXPRESSION, SHORTCUTS;
  ELEMENT_ID = 1;
  HANDLERS = {};
  EVENT_METHODS = {
    preventDefault: "isDefaultPrevented",
    stopImmediatePropagation: "isImmediatePropagationStopped",
    stopPropagation: "isPropagationStopped"
  };
  EVENTS_DESKTOP = {
    touchstart: "mousedown",
    touchmove: "mousemove",
    touchend: "mouseup",
    touch: "click",
    doubletap: "dblclick",
    orientationchange: "resize"
  };
  READY_EXPRESSION = /complete|loaded|interactive/;
  SHORTCUTS = ["touch"];
  SHORTCUTS.forEach(function(event) {
    $$.fn[event] = function(callback) {
      return $$(document.body).delegate(this.selector, event, callback);
    };
    return this;
  });
  $$.fn.on = function(event, selector, callback) {
    if (selector === "undefined" || $$.toType(selector) === "function") {
      return this.bind(event, selector);
    } else {
      return this.delegate(selector, event, callback);
    }
  };
  $$.fn.off = function(event, selector, callback) {
    if (selector === "undefined" || $$.toType(selector) === "function") {
      return this.unbind(event, selector);
    } else {
      return this.undelegate(selector, event, callback);
    }
  };
  $$.fn.ready = function(callback) {
    if (READY_EXPRESSION.test(document.readyState)) {
      return callback($$);
    } else {
      return $$.fn.addEvent(document, "DOMContentLoaded", function() {
        return callback($$);
      });
    }
  };
  return $$.Event = function(type, touch) {
    var event, property;
    event = document.createEvent("Events");
    event.initEvent(type, true, true, null, null, null, null, null, null, null, null, null, null, null, null);
    if (touch) {
      for (property in touch) {
        event[property] = touch[property];
      }
    }
    return event;
  };
})(Quo);
```

Response:
do ($$ = Quo) ->

    ELEMENT_ID = 1
    HANDLERS = {}
    EVENT_METHODS =
        preventDefault: "isDefaultPrevented"
        stopImmediatePropagation: "isImmediatePropagationStopped"
        stopPropagation: "isPropagationStopped"
    EVENTS_DESKTOP =
        touchstart: "mousedown"
        touchmove: "mousemove"
        touchend: "mouseup"
        touch: "click"
        doubletap: "dblclick"
        orientationchange: "resize"

    READY_EXPRESSION = /complete|loaded|interactive/

    SHORTCUTS = [ "touch" ]
    SHORTCUTS.forEach (event) ->
        $$.fn[event] = (callback) ->
            $$(document.body).delegate @selector, event, callback
        @

    $$.fn.on = (event, selector, callback) ->
        (if (selector is "undefined" or $$.toType(selector) is "function") then @bind(event, selector) else @delegate(selector, event, callback))

    $$.fn.off = (event, selector, callback) ->
        (if (selector is "undefined" or $$.toType(selector) is "function") then @unbind(event, selector) else @undelegate(selector, event, callback))

    $$.fn.ready = (callback) ->
        if READY_EXPRESSION.test(document.readyState)
            callback $$
        else
            $$.fn.addEvent document, "DOMContentLoaded", -> callback $$

    $$.Event = (type, touch) ->
        event = document.createEvent("Events")
        event.initEvent type, true, true, null, null, null, null, null, null, null, null, null, null, null, null
        if touch
            event[property] = touch[property] for property of touch
        event


Prompt:
do ($$ = Quo) ->

    ELEMENT_ID = 1
    HANDLERS = {}
    EVENT_METHODS =
        preventDefault: "isDefaultPrevented"
        stopImmediatePropagation: "isImmediatePropagationStopped"
        stopPropagation: "isPropagationStopped"
    EVENTS_DESKTOP =
        touchstart: "mousedown"
        touchmove: "mousemove"
        touchend: "mouseup"
        touch: "click"
        doubletap: "dblclick"
        orientationchange: "resize"

    READY_EXPRESSION = /complete|loaded|interactive/

    SHORTCUTS = [ "touch" ]
    SHORTCUTS.forEach (event) ->
        $$.fn[event] = (callback) ->

Response:
$$(document.body).delegate @selector, event, callback
        @

    $$.fn.on = (event, selector, callback) ->
        (if (selector is "undefined" or $$.toType(selector) is "function") then @bind(event, selector) else @delegate(selector, event, callback))

    $$.fn.off = (event, selector, callback) ->
        (if (selector is "undefined" or $$.toType(selector) is "function") then @unbind(event, selector) else @undelegate(selector, event, callback))

    $$.fn.ready = (callback) ->
        if READY_EXPRESSION.test(document.readyState)
            callback $$
        else
            $$.fn.addEvent document, "DOMContentLoaded", -> callback $$

    $$.Event = (type, touch) ->
        event = document.createEvent("Events")
        event.initEvent type, true, true, null, null, null, null, null, null, null, null, null, null, null, null
        if touch
            event[property] = touch[property] for property of touch
        event


Response:
###
  QuoJS
  (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
  http://quojs.tapquo.com
###

(($$) ->

    READY_EXPRESSION = /complete|loaded|interactive/
    SHORTCUTS = [ "touch", "tap" ]
    SHORTCUTS_EVENTS =
        touch: "touchstart"
        tap: "tap"

    SHORTCUTS.forEach (event) ->
        $$.fn[event] = (callback) ->
            $$(document.body).delegate @selector, SHORTCUTS_EVENTS[event], callback
        @

    $$.fn.on = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @bind(event, selector) else @delegate(selector, event, callback))

    $$.fn.off = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @unbind(event, selector) else @undelegate(selector, event, callback))

    $$.fn.ready = (callback) ->
        if READY_EXPRESSION.test(document.readyState)
            callback $$
        else
            $$.fn.addEvent document, "DOMContentLoaded", -> callback $$
        @

    return

) Quo


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
###
  QuoJS
  (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
  http://quojs.tapquo.com
###

(($$) ->

    READY_EXPRESSION = /complete|loaded|interactive/
    SHORTCUTS = [ "touch", "tap" ]
    SHORTCUTS_EVENTS =
        touch: "touchstart"
        tap: "tap"

    SHORTCUTS.forEach (event) ->
        $$.fn[event] = (callback) ->
            $$(document.body).delegate @selector, SHORTCUTS_EVENTS[event], callback
        @

    $$.fn.on = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @bind(event, selector) else @delegate(selector, event, callback))

    $$.fn.off = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @unbind(event, selector) else @undelegate(selector, event, callback))

    $$.fn.ready = (callback) ->
        if READY_EXPRESSION.test(document.readyState)
            callback $$
        else
            $$.fn.addEvent document, "DOMContentLoaded", -> callback $$
        @

    return

) Quo
```

Response:
/*
  QuoJS
  (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
  http://quojs.tapquo.com
*/
(function($$) {
  var READY_EXPRESSION, SHORTCUTS, SHORTCUTS_EVENTS;
  READY_EXPRESSION = /complete|loaded|interactive/;
  SHORTCUTS = ["touch", "tap"];
  SHORTCUTS_EVENTS = {
    touch: "touchstart",
    tap: "tap"
  };
  SHORTCUTS.forEach(function(event) {
    $$.fn[event] = function(callback) {
      return $$(document.body).delegate(this.selector, SHORTCUTS_EVENTS[event], callback);
    };
    return this;
  });
  $$.fn.on = function(event, selector, callback) {
    if (selector === undefined || $$.toType(selector) === "function") {
      return this.bind(event, selector);
    } else {
      return this.delegate(selector, event, callback);
    }
  };
  $$.fn.off = function(event, selector, callback) {
    if (selector === undefined || $$.toType(selector) === "function") {
      return this.unbind(event, selector);
    } else {
      return this.undelegate(selector, event, callback);
    }
  };
  $$.fn.ready = function(callback) {
    if (READY_EXPRESSION.test(document.readyState)) {
      callback($$);
    } else {
      $$.fn.addEvent(document, "DOMContentLoaded", function() {
        return callback($$);
      });
    }
    return this;
  };
})(Quo);


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
/*
  QuoJS
  (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
  http://quojs.tapquo.com
*/
(function($$) {
  var READY_EXPRESSION, SHORTCUTS, SHORTCUTS_EVENTS;
  READY_EXPRESSION = /complete|loaded|interactive/;
  SHORTCUTS = ["touch", "tap"];
  SHORTCUTS_EVENTS = {
    touch: "touchstart",
    tap: "tap"
  };
  SHORTCUTS.forEach(function(event) {
    $$.fn[event] = function(callback) {
      return $$(document.body).delegate(this.selector, SHORTCUTS_EVENTS[event], callback);
    };
    return this;
  });
  $$.fn.on = function(event, selector, callback) {
    if (selector === undefined || $$.toType(selector) === "function") {
      return this.bind(event, selector);
    } else {
      return this.delegate(selector, event, callback);
    }
  };
  $$.fn.off = function(event, selector, callback) {
    if (selector === undefined || $$.toType(selector) === "function") {
      return this.unbind(event, selector);
    } else {
      return this.undelegate(selector, event, callback);
    }
  };
  $$.fn.ready = function(callback) {
    if (READY_EXPRESSION.test(document.readyState)) {
      callback($$);
    } else {
      $$.fn.addEvent(document, "DOMContentLoaded", function() {
        return callback($$);
      });
    }
    return this;
  };
})(Quo);
```

Response:
###
  QuoJS
  (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
  http://quojs.tapquo.com
###

(($$) ->

    READY_EXPRESSION = /complete|loaded|interactive/
    SHORTCUTS = [ "touch", "tap" ]
    SHORTCUTS_EVENTS =
        touch: "touchstart"
        tap: "tap"

    SHORTCUTS.forEach (event) ->
        $$.fn[event] = (callback) ->
            $$(document.body).delegate @selector, SHORTCUTS_EVENTS[event], callback
        @

    $$.fn.on = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @bind(event, selector) else @delegate(selector, event, callback))

    $$.fn.off = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @unbind(event, selector) else @undelegate(selector, event, callback))

    $$.fn.ready = (callback) ->
        if READY_EXPRESSION.test(document.readyState)
            callback $$
        else
            $$.fn.addEvent document, "DOMContentLoaded", -> callback $$
        @

    return

) Quo


Prompt:
###
  QuoJS
  (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
  http://quojs.tapquo.com
###

(($$) ->

    READY_EXPRESSION = /complete|loaded|interactive/
    SHORTCUTS = [ "touch", "tap" ]
    SHORTCUTS_EVENTS =
        touch: "touchstart"
        tap: "tap"

    SHORTCUTS.forEach (event) ->
        $$.fn[event] = (callback) ->
            $$(document.body).delegate @selector, SHORTCUTS_EVENTS[event], callback

Response:
@

    $$.fn.on = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @bind(event, selector) else @delegate(selector, event, callback))

    $$.fn.off = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @unbind(event, selector) else @undelegate(selector, event, callback))

    $$.fn.ready = (callback) ->
        if READY_EXPRESSION.test(document.readyState)
            callback $$
        else
            $$.fn.addEvent document, "DOMContentLoaded", -> callback $$
        @

    return

) Quo


Response:
###
  QuoJS 2.2.0
  (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
  http://quojs.tapquo.com
###

(($$) ->

    READY_EXPRESSION = /complete|loaded|interactive/
    SHORTCUTS = [ "touch", "tap" ]
    SHORTCUTS_EVENTS =
        touch: "touchstart"
        tap: "tap"

    SHORTCUTS.forEach (event) ->
        $$.fn[event] = (callback) ->
            $$(document.body).delegate @selector, SHORTCUTS_EVENTS[event], callback
        @

    $$.fn.on = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @bind(event, selector) else @delegate(selector, event, callback))

    $$.fn.off = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @unbind(event, selector) else @undelegate(selector, event, callback))

    $$.fn.ready = (callback) ->
        if READY_EXPRESSION.test(document.readyState)
            callback $$
        else
            $$.fn.addEvent document, "DOMContentLoaded", -> callback $$
        @

    return

) Quo


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
###
  QuoJS 2.2.0
  (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
  http://quojs.tapquo.com
###

(($$) ->

    READY_EXPRESSION = /complete|loaded|interactive/
    SHORTCUTS = [ "touch", "tap" ]
    SHORTCUTS_EVENTS =
        touch: "touchstart"
        tap: "tap"

    SHORTCUTS.forEach (event) ->
        $$.fn[event] = (callback) ->
            $$(document.body).delegate @selector, SHORTCUTS_EVENTS[event], callback
        @

    $$.fn.on = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @bind(event, selector) else @delegate(selector, event, callback))

    $$.fn.off = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @unbind(event, selector) else @undelegate(selector, event, callback))

    $$.fn.ready = (callback) ->
        if READY_EXPRESSION.test(document.readyState)
            callback $$
        else
            $$.fn.addEvent document, "DOMContentLoaded", -> callback $$
        @

    return

) Quo
```

Response:
/*
  QuoJS 2.2.0
  (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
  http://quojs.tapquo.com
*/
(function($$) {
  var READY_EXPRESSION, SHORTCUTS, SHORTCUTS_EVENTS;
  READY_EXPRESSION = /complete|loaded|interactive/;
  SHORTCUTS = ["touch", "tap"];
  SHORTCUTS_EVENTS = {
    touch: "touchstart",
    tap: "tap"
  };
  SHORTCUTS.forEach(function(event) {
    $$.fn[event] = function(callback) {
      return $$(document.body).delegate(this.selector, SHORTCUTS_EVENTS[event], callback);
    };
    return this;
  });
  $$.fn.on = function(event, selector, callback) {
    if (selector === undefined || $$.toType(selector) === "function") {
      return this.bind(event, selector);
    } else {
      return this.delegate(selector, event, callback);
    }
  };
  $$.fn.off = function(event, selector, callback) {
    if (selector === undefined || $$.toType(selector) === "function") {
      return this.unbind(event, selector);
    } else {
      return this.undelegate(selector, event, callback);
    }
  };
  $$.fn.ready = function(callback) {
    if (READY_EXPRESSION.test(document.readyState)) {
      callback($$);
    } else {
      $$.fn.addEvent(document, "DOMContentLoaded", function() {
        return callback($$);
      });
    }
    return this;
  };
})(Quo);


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
/*
  QuoJS 2.2.0
  (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
  http://quojs.tapquo.com
*/
(function($$) {
  var READY_EXPRESSION, SHORTCUTS, SHORTCUTS_EVENTS;
  READY_EXPRESSION = /complete|loaded|interactive/;
  SHORTCUTS = ["touch", "tap"];
  SHORTCUTS_EVENTS = {
    touch: "touchstart",
    tap: "tap"
  };
  SHORTCUTS.forEach(function(event) {
    $$.fn[event] = function(callback) {
      return $$(document.body).delegate(this.selector, SHORTCUTS_EVENTS[event], callback);
    };
    return this;
  });
  $$.fn.on = function(event, selector, callback) {
    if (selector === undefined || $$.toType(selector) === "function") {
      return this.bind(event, selector);
    } else {
      return this.delegate(selector, event, callback);
    }
  };
  $$.fn.off = function(event, selector, callback) {
    if (selector === undefined || $$.toType(selector) === "function") {
      return this.unbind(event, selector);
    } else {
      return this.undelegate(selector, event, callback);
    }
  };
  $$.fn.ready = function(callback) {
    if (READY_EXPRESSION.test(document.readyState)) {
      callback($$);
    } else {
      $$.fn.addEvent(document, "DOMContentLoaded", function() {
        return callback($$);
      });
    }
    return this;
  };
})(Quo);
```

Response:
###
  QuoJS 2.2.0
  (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
  http://quojs.tapquo.com
###

(($$) ->

    READY_EXPRESSION = /complete|loaded|interactive/
    SHORTCUTS = [ "touch", "tap" ]
    SHORTCUTS_EVENTS =
        touch: "touchstart"
        tap: "tap"

    SHORTCUTS.forEach (event) ->
        $$.fn[event] = (callback) ->
            $$(document.body).delegate @selector, SHORTCUTS_EVENTS[event], callback
        @

    $$.fn.on = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @bind(event, selector) else @delegate(selector, event, callback))

    $$.fn.off = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @unbind(event, selector) else @undelegate(selector, event, callback))

    $$.fn.ready = (callback) ->
        if READY_EXPRESSION.test(document.readyState)
            callback $$
        else
            $$.fn.addEvent document, "DOMContentLoaded", -> callback $$
        @

    return

) Quo


Prompt:
###
  QuoJS 2.2.0
  (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
  http://quojs.tapquo.com
###

(($$) ->

    READY_EXPRESSION = /complete|loaded|interactive/
    SHORTCUTS = [ "touch", "tap" ]
    SHORTCUTS_EVENTS =
        touch: "touchstart"
        tap: "tap"

    SHORTCUTS.forEach (event) ->
        $$.fn[event] = (callback) ->
            $$(document.body).delegate @selector, SHORTCUTS_EVENTS[event], callback

Response:
@

    $$.fn.on = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @bind(event, selector) else @delegate(selector, event, callback))

    $$.fn.off = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @unbind(event, selector) else @undelegate(selector, event, callback))

    $$.fn.ready = (callback) ->
        if READY_EXPRESSION.test(document.readyState)
            callback $$
        else
            $$.fn.addEvent document, "DOMContentLoaded", -> callback $$
        @

    return

) Quo


Response:
###
  QuoJS 2.1
  (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
  http://quojs.tapquo.com
###

(($$) ->

    READY_EXPRESSION = /complete|loaded|interactive/
    SHORTCUTS = [ "touch", "tap" ]
    SHORTCUTS_EVENTS =
        touch: "touchstart"
        tap: "tap"

    SHORTCUTS.forEach (event) ->
        $$.fn[event] = (callback) ->
            $$(document.body).delegate @selector, SHORTCUTS_EVENTS[event], callback
        @

    $$.fn.on = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @bind(event, selector) else @delegate(selector, event, callback))

    $$.fn.off = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @unbind(event, selector) else @undelegate(selector, event, callback))

    $$.fn.ready = (callback) ->
        if READY_EXPRESSION.test(document.readyState)
            callback $$
        else
            $$.fn.addEvent document, "DOMContentLoaded", -> callback $$
        @

    return

) Quo


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
###
  QuoJS 2.1
  (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
  http://quojs.tapquo.com
###

(($$) ->

    READY_EXPRESSION = /complete|loaded|interactive/
    SHORTCUTS = [ "touch", "tap" ]
    SHORTCUTS_EVENTS =
        touch: "touchstart"
        tap: "tap"

    SHORTCUTS.forEach (event) ->
        $$.fn[event] = (callback) ->
            $$(document.body).delegate @selector, SHORTCUTS_EVENTS[event], callback
        @

    $$.fn.on = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @bind(event, selector) else @delegate(selector, event, callback))

    $$.fn.off = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @unbind(event, selector) else @undelegate(selector, event, callback))

    $$.fn.ready = (callback) ->
        if READY_EXPRESSION.test(document.readyState)
            callback $$
        else
            $$.fn.addEvent document, "DOMContentLoaded", -> callback $$
        @

    return

) Quo
```

Response:
/*
  QuoJS 2.1
  (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
  http://quojs.tapquo.com
*/
(function($$) {
  var READY_EXPRESSION, SHORTCUTS, SHORTCUTS_EVENTS;
  READY_EXPRESSION = /complete|loaded|interactive/;
  SHORTCUTS = ["touch", "tap"];
  SHORTCUTS_EVENTS = {
    touch: "touchstart",
    tap: "tap"
  };
  SHORTCUTS.forEach(function(event) {
    $$.fn[event] = function(callback) {
      return $$(document.body).delegate(this.selector, SHORTCUTS_EVENTS[event], callback);
    };
    return this;
  });
  $$.fn.on = function(event, selector, callback) {
    if (selector === undefined || $$.toType(selector) === "function") {
      return this.bind(event, selector);
    } else {
      return this.delegate(selector, event, callback);
    }
  };
  $$.fn.off = function(event, selector, callback) {
    if (selector === undefined || $$.toType(selector) === "function") {
      return this.unbind(event, selector);
    } else {
      return this.undelegate(selector, event, callback);
    }
  };
  $$.fn.ready = function(callback) {
    if (READY_EXPRESSION.test(document.readyState)) {
      callback($$);
    } else {
      $$.fn.addEvent(document, "DOMContentLoaded", function() {
        return callback($$);
      });
    }
    return this;
  };
})(Quo);


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
/*
  QuoJS 2.1
  (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
  http://quojs.tapquo.com
*/
(function($$) {
  var READY_EXPRESSION, SHORTCUTS, SHORTCUTS_EVENTS;
  READY_EXPRESSION = /complete|loaded|interactive/;
  SHORTCUTS = ["touch", "tap"];
  SHORTCUTS_EVENTS = {
    touch: "touchstart",
    tap: "tap"
  };
  SHORTCUTS.forEach(function(event) {
    $$.fn[event] = function(callback) {
      return $$(document.body).delegate(this.selector, SHORTCUTS_EVENTS[event], callback);
    };
    return this;
  });
  $$.fn.on = function(event, selector, callback) {
    if (selector === undefined || $$.toType(selector) === "function") {
      return this.bind(event, selector);
    } else {
      return this.delegate(selector, event, callback);
    }
  };
  $$.fn.off = function(event, selector, callback) {
    if (selector === undefined || $$.toType(selector) === "function") {
      return this.unbind(event, selector);
    } else {
      return this.undelegate(selector, event, callback);
    }
  };
  $$.fn.ready = function(callback) {
    if (READY_EXPRESSION.test(document.readyState)) {
      callback($$);
    } else {
      $$.fn.addEvent(document, "DOMContentLoaded", function() {
        return callback($$);
      });
    }
    return this;
  };
})(Quo);
```

Response:
###
  QuoJS 2.1
  (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
  http://quojs.tapquo.com
###

(($$) ->

    READY_EXPRESSION = /complete|loaded|interactive/
    SHORTCUTS = [ "touch", "tap" ]
    SHORTCUTS_EVENTS =
        touch: "touchstart"
        tap: "tap"

    SHORTCUTS.forEach (event) ->
        $$.fn[event] = (callback) ->
            $$(document.body).delegate @selector, SHORTCUTS_EVENTS[event], callback
        @

    $$.fn.on = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @bind(event, selector) else @delegate(selector, event, callback))

    $$.fn.off = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @unbind(event, selector) else @undelegate(selector, event, callback))

    $$.fn.ready = (callback) ->
        if READY_EXPRESSION.test(document.readyState)
            callback $$
        else
            $$.fn.addEvent document, "DOMContentLoaded", -> callback $$
        @

    return

) Quo


Prompt:
###
  QuoJS 2.1
  (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
  http://quojs.tapquo.com
###

(($$) ->

    READY_EXPRESSION = /complete|loaded|interactive/
    SHORTCUTS = [ "touch", "tap" ]
    SHORTCUTS_EVENTS =
        touch: "touchstart"
        tap: "tap"

    SHORTCUTS.forEach (event) ->
        $$.fn[event] = (callback) ->
            $$(document.body).delegate @selector, SHORTCUTS_EVENTS[event], callback

Response:
@

    $$.fn.on = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @bind(event, selector) else @delegate(selector, event, callback))

    $$.fn.off = (event, selector, callback) ->
        (if (selector is `undefined` or $$.toType(selector) is "function") then @unbind(event, selector) else @undelegate(selector, event, callback))

    $$.fn.ready = (callback) ->
        if READY_EXPRESSION.test(document.readyState)
            callback $$
        else
            $$.fn.addEvent document, "DOMContentLoaded", -> callback $$
        @

    return

) Quo


Response:
Command = require('./Command')

class Variable extends Command
  type: 'Variable'

  signature: [
    property: ['String']
  ]

  log: ->
  unlog: ->

  constructor: ->

  before: (args, engine, operation, continuation, scope, ascender, ascending) ->
    if (value = ascending?.values?[args[0]])?
      return value

  # Declare variable within domain, initial value is zero
  declare: (engine, name) ->
    variables = engine.variables
    unless variable = variables[name]
      variable = variables[name] = engine.variable(name)
    #if engine.nullified?[name]
    #  delete engine.nullified[name]
    #if engine.replaced?[name]
    #  delete engine.replaced[name]
    (engine.declared ||= {})[name] = variable
    return variable

  # Undeclare variable in given domain, outputs "null" once
  undeclare: (engine, variable, quick) ->
    if quick
      (engine.replaced ||= {})[variable.name] = variable
    else
      (engine.nullified ||= {})[variable.name] = variable
      if engine.declared?[variable.name]
        delete engine.declared[variable.name]

    delete engine.values[variable.name]
    engine.nullify(variable)
    engine.unedit(variable)

# Algebraic expression
class Variable.Expression extends Variable

  signature: [
    left:  ['Variable', 'Number']
    right: ['Variable', 'Number']
  ]


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Command = require('./Command')

class Variable extends Command
  type: 'Variable'

  signature: [
    property: ['String']
  ]

  log: ->
  unlog: ->

  constructor: ->

  before: (args, engine, operation, continuation, scope, ascender, ascending) ->
    if (value = ascending?.values?[args[0]])?
      return value

  # Declare variable within domain, initial value is zero
  declare: (engine, name) ->
    variables = engine.variables
    unless variable = variables[name]
      variable = variables[name] = engine.variable(name)
    #if engine.nullified?[name]
    #  delete engine.nullified[name]
    #if engine.replaced?[name]
    #  delete engine.replaced[name]
    (engine.declared ||= {})[name] = variable
    return variable

  # Undeclare variable in given domain, outputs "null" once
  undeclare: (engine, variable, quick) ->
    if quick
      (engine.replaced ||= {})[variable.name] = variable
    else
      (engine.nullified ||= {})[variable.name] = variable
      if engine.declared?[variable.name]
        delete engine.declared[variable.name]

    delete engine.values[variable.name]
    engine.nullify(variable)
    engine.unedit(variable)

# Algebraic expression
class Variable.Expression extends Variable

  signature: [
    left:  ['Variable', 'Number']
    right: ['Variable', 'Number']
  ]
```

Response:
var Command, Variable;

Command = require('./Command');

Variable = (function() {
  class Variable extends Command {
    log() {}

    unlog() {}

    constructor() {}

    before(args, engine, operation, continuation, scope, ascender, ascending) {
      var ref, value;
      if ((value = ascending != null ? (ref = ascending.values) != null ? ref[args[0]] : void 0 : void 0) != null) {
        return value;
      }
    }

    // Declare variable within domain, initial value is zero
    declare(engine, name) {
      var variable, variables;
      variables = engine.variables;
      if (!(variable = variables[name])) {
        variable = variables[name] = engine.variable(name);
      }
      //if engine.nullified?[name]
      //  delete engine.nullified[name]
      //if engine.replaced?[name]
      //  delete engine.replaced[name]
      (engine.declared || (engine.declared = {}))[name] = variable;
      return variable;
    }

    // Undeclare variable in given domain, outputs "null" once
    undeclare(engine, variable, quick) {
      var ref;
      if (quick) {
        (engine.replaced || (engine.replaced = {}))[variable.name] = variable;
      } else {
        (engine.nullified || (engine.nullified = {}))[variable.name] = variable;
        if ((ref = engine.declared) != null ? ref[variable.name] : void 0) {
          delete engine.declared[variable.name];
        }
      }
      delete engine.values[variable.name];
      engine.nullify(variable);
      return engine.unedit(variable);
    }

  };

  Variable.prototype.type = 'Variable';

  Variable.prototype.signature = [
    {
      property: ['String']
    }
  ];

  return Variable;

}).call(this);

Variable.Expression = (function() {
  // Algebraic expression
  class Expression extends Variable {};

  Expression.prototype.signature = [
    {
      left: ['Variable',
    'Number'],
      right: ['Variable',
    'Number']
    }
  ];

  return Expression;

}).call(this);