const DEPLOYMENT_ID   = '572U0000000k9cB';
const ORGANIZATION_ID = '00DU0000000Kwch';
const ELEMENT_ID      = '573U0000000k9cB';

import { computed } from 'mobx';
import User from './user';

export default {

  @computed get isEnabled() {
    return window.liveagent && User.isProbablyTeacher;
  },

  initialize() {
    if (this.isEnabled) {
      window.liveagent.init('https://d.la2-c2-dfw.salesforceliveagent.com/chat', DEPLOYMENT_ID, ORGANIZATION_ID);
    }
    // will emit debugging info to the console
    // liveagent.enableLogging();
  },

  setElementVisiblity(online, offline) {
    if (this.isEnabled) {
      window.liveagent.showWhenOnline(ELEMENT_ID, online);
      if (offline) {
        window.liveagent.showWhenOffline(ELEMENT_ID, offline);
      }
    }
  },

  start() {
    window.liveagent.startChat(ELEMENT_ID);
  },

};

@@ -243,16 +243,24 @@
  return 
+Boolean(
 window.l
@@ -293,16 +293,17 @@
 yTeacher
+)
 ;%0A  %7D,%0A%0A

return boolean