{"ast":null,"code":"'use strict';\n\nvar JSON3 = require('json3'),\n    iframeUtils = require('./utils/iframe');\n\nfunction FacadeJS(transport) {\n  this._transport = transport;\n  transport.on('message', this._transportMessage.bind(this));\n  transport.on('close', this._transportClose.bind(this));\n}\n\nFacadeJS.prototype._transportClose = function (code, reason) {\n  iframeUtils.postMessage('c', JSON3.stringify([code, reason]));\n};\n\nFacadeJS.prototype._transportMessage = function (frame) {\n  iframeUtils.postMessage('t', frame);\n};\n\nFacadeJS.prototype._send = function (data) {\n  this._transport.send(data);\n};\n\nFacadeJS.prototype._close = function () {\n  this._transport.close();\n\n  this._transport.removeAllListeners();\n};\n\nmodule.exports = FacadeJS;","map":null,"metadata":{},"sourceType":"script"}