/* eslint-disable no-undef */

function importScriptsWrapper(uri) {
  self.importScripts(uri);
}

function postMessageWrapper(msg) {
  self.postMessage(msg);
}

var ChatService = require('mweb/chat/chatService').ChatService;
var chatService = new ChatService(importScriptsWrapper, postMessageWrapper);
self.addEventListener('message', chatService.messageHandler.bind(chatService));
