// Generated by CoffeeScript 1.7.1
(function() {
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };

  this.CheckoutMode = (function() {
    function CheckoutMode(switcher, config) {
      this.onLogout = __bind(this.onLogout, this);
      this.switcher = switcher;
      this.cfg = config ? config : CheckoutConfig;
    }

    CheckoutMode.prototype.glyph = function() {
      return "";
    };

    CheckoutMode.prototype.title = function() {
      return "[unknown mode]";
    };

    CheckoutMode.prototype.subtitle = function() {
      return "" + this.cfg.settings.clerkName + " @ " + this.cfg.settings.counterName;
    };

    CheckoutMode.prototype.inputPlaceholder = function() {
      return "Barcode";
    };

    CheckoutMode.prototype.enter = function() {};

    CheckoutMode.prototype.exit = function() {};

    CheckoutMode.prototype.actions = function() {
      return [["", function() {}]];
    };

    CheckoutMode.prototype.onLogout = function() {
      return Api.clerk_logout().then((function(_this) {
        return function() {
          console.log("Logged out " + _this.cfg.settings.clerkName + ".");
          _this.cfg.settings.clerkName = null;
          return _this.switcher.switchTo(ClerkLoginMode);
        };
      })(this), (function(_this) {
        return function() {
          alert("Logout failed!");
          return true;
        };
      })(this));
    };

    return CheckoutMode;

  })();

}).call(this);
