{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/@rails/actioncable/app/assets/javascripts/action_cable.js","webpack:///./app/javascript/packs/application.js","webpack:///./app/javascript/channels/index.js","webpack:///./app/javascript/channels sync _channel\\.js$","webpack:///./app/javascript/channels/consumer.js","webpack:///./app/javascript/channels/background_job_channel.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","factory","_typeof2","iterator","obj","constructor","adapters","logger","self","console","WebSocket","log","this","enabled","_adapters$logger","_len","arguments","length","messages","Array","_key","push","Date","now","apply","concat","_typeof","classCallCheck","instance","Constructor","TypeError","createClass","defineProperties","target","props","descriptor","configurable","writable","protoProps","staticProps","getTime","secondsSince","time","ConnectionMonitor","connection","visibilityDidChange","reconnectAttempts","start","isRunning","startedAt","stoppedAt","startPolling","addEventListener","getPollInterval","stop","stopPolling","removeEventListener","recordPing","pingedAt","recordConnect","disconnectedAt","recordDisconnect","poll","clearTimeout","pollTimeout","_this","setTimeout","reconnectIfStale","_constructor$pollInte","pollInterval","min","max","interval","multiplier","Math","round","number","clamp","connectionIsStale","staleThreshold","disconnectedRecently","reopen","_this2","document","visibilityState","isOpen","INTERNAL","message_types","welcome","disconnect","ping","confirmation","rejection","disconnect_reasons","unauthorized","invalid_request","server_restart","default_mount_path","protocols","supportedProtocols","slice","indexOf","Connection","consumer","open","subscriptions","monitor","disconnected","send","data","webSocket","JSON","stringify","isActive","getState","uninstallEventHandlers","url","installEventHandlers","close","_ref","undefined","allowReconnect","error","reopenDelay","getProtocol","protocol","isState","isProtocolSupported","states","state","readyState","toLowerCase","eventName","events","handler","message","event","_JSON$parse","parse","identifier","reason","reconnect","type","reload","notify","reject","notifyAll","willAttemptReconnect","extend","properties","Subscription","params","mixin","perform","action","command","unsubscribe","remove","Subscriptions","channelName","channel","subscription","add","ensureActiveConnection","sendCommand","forget","findAll","map","filter","callbackName","_this3","args","_len2","_key2","Consumer","_url","connect","createWebSocketURL","test","a","createElement","href","replace","getConfig","element","head","querySelector","getAttribute","createConsumer","require","channels","keys","forEach","webpackContext","req","id","webpackContextResolve","e","Error","code","resolve","idea_id","window","location","pathname","split","connected","received","getElementById","classList","includes","html","insertAdjacentHTML","appendLine","template","logsDiv","scrollTop","scrollHeight","codeGenerateButton","logsLoading","innerHTML","disabled","closest","parentNode","insertBefore","trim","content","firstChild","nextElementSibling"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,qBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,kBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAA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H,eAAe,kBAC7CW,EAAcxI,SAAS6H,eAAe,gBAC1CU,EAAmBE,UAAY,gBAC/BF,EAAmBG,UAAW,EAC9BF,EAAYV,UAAU/C,IAAI,UAC1ByD,EAAYV,UAAUpD,OAAO,WAEsB,OAAhD1E,SAAS6H,eAAe,qBACzBU,EAAmBI,QAAQ,QAAQC,WAAWC,cAgBnCb,EAfKtG,EAAI,sBAgB1ByG,EAAWnI,SAASiG,cAAc,YACtC+B,EAAOA,EAAKc,OACZX,EAASM,UAAYT,EACdG,EAASY,QAAQC,YAlBZT,EAAmBI,QAAQ,QAAQM","file":"js/application-1c1bd911525c38c6e8af.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"//ideas-prod.herokuapp.com/packs/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","function _typeof2(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\n(function (global, factory) {\n (typeof exports === \"undefined\" ? \"undefined\" : _typeof2(exports)) === \"object\" && typeof module !== \"undefined\" ? factory(exports) : typeof define === \"function\" && define.amd ? define([\"exports\"], factory) : factory(global.ActionCable = {});\n})(this, function (exports) {\n \"use strict\";\n\n var adapters = {\n logger: self.console,\n WebSocket: self.WebSocket\n };\n var logger = {\n log: function log() {\n if (this.enabled) {\n var _adapters$logger;\n\n for (var _len = arguments.length, messages = Array(_len), _key = 0; _key < _len; _key++) {\n messages[_key] = arguments[_key];\n }\n\n messages.push(Date.now());\n\n (_adapters$logger = adapters.logger).log.apply(_adapters$logger, [\"[ActionCable]\"].concat(messages));\n }\n }\n };\n\n var _typeof = typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\" ? function (obj) {\n return _typeof2(obj);\n } : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n\n var classCallCheck = function classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n };\n\n var createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n\n var now = function now() {\n return new Date().getTime();\n };\n\n var secondsSince = function secondsSince(time) {\n return (now() - time) / 1e3;\n };\n\n var clamp = function clamp(number, min, max) {\n return Math.max(min, Math.min(max, number));\n };\n\n var ConnectionMonitor = function () {\n function ConnectionMonitor(connection) {\n classCallCheck(this, ConnectionMonitor);\n this.visibilityDidChange = this.visibilityDidChange.bind(this);\n this.connection = connection;\n this.reconnectAttempts = 0;\n }\n\n ConnectionMonitor.prototype.start = function start() {\n if (!this.isRunning()) {\n this.startedAt = now();\n delete this.stoppedAt;\n this.startPolling();\n addEventListener(\"visibilitychange\", this.visibilityDidChange);\n logger.log(\"ConnectionMonitor started. pollInterval = \" + this.getPollInterval() + \" ms\");\n }\n };\n\n ConnectionMonitor.prototype.stop = function stop() {\n if (this.isRunning()) {\n this.stoppedAt = now();\n this.stopPolling();\n removeEventListener(\"visibilitychange\", this.visibilityDidChange);\n logger.log(\"ConnectionMonitor stopped\");\n }\n };\n\n ConnectionMonitor.prototype.isRunning = function isRunning() {\n return this.startedAt && !this.stoppedAt;\n };\n\n ConnectionMonitor.prototype.recordPing = function recordPing() {\n this.pingedAt = now();\n };\n\n ConnectionMonitor.prototype.recordConnect = function recordConnect() {\n this.reconnectAttempts = 0;\n this.recordPing();\n delete this.disconnectedAt;\n logger.log(\"ConnectionMonitor recorded connect\");\n };\n\n ConnectionMonitor.prototype.recordDisconnect = function recordDisconnect() {\n this.disconnectedAt = now();\n logger.log(\"ConnectionMonitor recorded disconnect\");\n };\n\n ConnectionMonitor.prototype.startPolling = function startPolling() {\n this.stopPolling();\n this.poll();\n };\n\n ConnectionMonitor.prototype.stopPolling = function stopPolling() {\n clearTimeout(this.pollTimeout);\n };\n\n ConnectionMonitor.prototype.poll = function poll() {\n var _this = this;\n\n this.pollTimeout = setTimeout(function () {\n _this.reconnectIfStale();\n\n _this.poll();\n }, this.getPollInterval());\n };\n\n ConnectionMonitor.prototype.getPollInterval = function getPollInterval() {\n var _constructor$pollInte = this.constructor.pollInterval,\n min = _constructor$pollInte.min,\n max = _constructor$pollInte.max,\n multiplier = _constructor$pollInte.multiplier;\n var interval = multiplier * Math.log(this.reconnectAttempts + 1);\n return Math.round(clamp(interval, min, max) * 1e3);\n };\n\n ConnectionMonitor.prototype.reconnectIfStale = function reconnectIfStale() {\n if (this.connectionIsStale()) {\n logger.log(\"ConnectionMonitor detected stale connection. reconnectAttempts = \" + this.reconnectAttempts + \", pollInterval = \" + this.getPollInterval() + \" ms, time disconnected = \" + secondsSince(this.disconnectedAt) + \" s, stale threshold = \" + this.constructor.staleThreshold + \" s\");\n this.reconnectAttempts++;\n\n if (this.disconnectedRecently()) {\n logger.log(\"ConnectionMonitor skipping reopening recent disconnect\");\n } else {\n logger.log(\"ConnectionMonitor reopening\");\n this.connection.reopen();\n }\n }\n };\n\n ConnectionMonitor.prototype.connectionIsStale = function connectionIsStale() {\n return secondsSince(this.pingedAt ? this.pingedAt : this.startedAt) > this.constructor.staleThreshold;\n };\n\n ConnectionMonitor.prototype.disconnectedRecently = function disconnectedRecently() {\n return this.disconnectedAt && secondsSince(this.disconnectedAt) < this.constructor.staleThreshold;\n };\n\n ConnectionMonitor.prototype.visibilityDidChange = function visibilityDidChange() {\n var _this2 = this;\n\n if (document.visibilityState === \"visible\") {\n setTimeout(function () {\n if (_this2.connectionIsStale() || !_this2.connection.isOpen()) {\n logger.log(\"ConnectionMonitor reopening stale connection on visibilitychange. visbilityState = \" + document.visibilityState);\n\n _this2.connection.reopen();\n }\n }, 200);\n }\n };\n\n return ConnectionMonitor;\n }();\n\n ConnectionMonitor.pollInterval = {\n min: 3,\n max: 30,\n multiplier: 5\n };\n ConnectionMonitor.staleThreshold = 6;\n var INTERNAL = {\n message_types: {\n welcome: \"welcome\",\n disconnect: \"disconnect\",\n ping: \"ping\",\n confirmation: \"confirm_subscription\",\n rejection: \"reject_subscription\"\n },\n disconnect_reasons: {\n unauthorized: \"unauthorized\",\n invalid_request: \"invalid_request\",\n server_restart: \"server_restart\"\n },\n default_mount_path: \"/cable\",\n protocols: [\"actioncable-v1-json\", \"actioncable-unsupported\"]\n };\n var message_types = INTERNAL.message_types,\n protocols = INTERNAL.protocols;\n var supportedProtocols = protocols.slice(0, protocols.length - 1);\n var indexOf = [].indexOf;\n\n var Connection = function () {\n function Connection(consumer) {\n classCallCheck(this, Connection);\n this.open = this.open.bind(this);\n this.consumer = consumer;\n this.subscriptions = this.consumer.subscriptions;\n this.monitor = new ConnectionMonitor(this);\n this.disconnected = true;\n }\n\n Connection.prototype.send = function send(data) {\n if (this.isOpen()) {\n this.webSocket.send(JSON.stringify(data));\n return true;\n } else {\n return false;\n }\n };\n\n Connection.prototype.open = function open() {\n if (this.isActive()) {\n logger.log(\"Attempted to open WebSocket, but existing socket is \" + this.getState());\n return false;\n } else {\n logger.log(\"Opening WebSocket, current state is \" + this.getState() + \", subprotocols: \" + protocols);\n\n if (this.webSocket) {\n this.uninstallEventHandlers();\n }\n\n this.webSocket = new adapters.WebSocket(this.consumer.url, protocols);\n this.installEventHandlers();\n this.monitor.start();\n return true;\n }\n };\n\n Connection.prototype.close = function close() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n allowReconnect: true\n },\n allowReconnect = _ref.allowReconnect;\n\n if (!allowReconnect) {\n this.monitor.stop();\n }\n\n if (this.isActive()) {\n return this.webSocket.close();\n }\n };\n\n Connection.prototype.reopen = function reopen() {\n logger.log(\"Reopening WebSocket, current state is \" + this.getState());\n\n if (this.isActive()) {\n try {\n return this.close();\n } catch (error) {\n logger.log(\"Failed to reopen WebSocket\", error);\n } finally {\n logger.log(\"Reopening WebSocket in \" + this.constructor.reopenDelay + \"ms\");\n setTimeout(this.open, this.constructor.reopenDelay);\n }\n } else {\n return this.open();\n }\n };\n\n Connection.prototype.getProtocol = function getProtocol() {\n if (this.webSocket) {\n return this.webSocket.protocol;\n }\n };\n\n Connection.prototype.isOpen = function isOpen() {\n return this.isState(\"open\");\n };\n\n Connection.prototype.isActive = function isActive() {\n return this.isState(\"open\", \"connecting\");\n };\n\n Connection.prototype.isProtocolSupported = function isProtocolSupported() {\n return indexOf.call(supportedProtocols, this.getProtocol()) >= 0;\n };\n\n Connection.prototype.isState = function isState() {\n for (var _len = arguments.length, states = Array(_len), _key = 0; _key < _len; _key++) {\n states[_key] = arguments[_key];\n }\n\n return indexOf.call(states, this.getState()) >= 0;\n };\n\n Connection.prototype.getState = function getState() {\n if (this.webSocket) {\n for (var state in adapters.WebSocket) {\n if (adapters.WebSocket[state] === this.webSocket.readyState) {\n return state.toLowerCase();\n }\n }\n }\n\n return null;\n };\n\n Connection.prototype.installEventHandlers = function installEventHandlers() {\n for (var eventName in this.events) {\n var handler = this.events[eventName].bind(this);\n this.webSocket[\"on\" + eventName] = handler;\n }\n };\n\n Connection.prototype.uninstallEventHandlers = function uninstallEventHandlers() {\n for (var eventName in this.events) {\n this.webSocket[\"on\" + eventName] = function () {};\n }\n };\n\n return Connection;\n }();\n\n Connection.reopenDelay = 500;\n Connection.prototype.events = {\n message: function message(event) {\n if (!this.isProtocolSupported()) {\n return;\n }\n\n var _JSON$parse = JSON.parse(event.data),\n identifier = _JSON$parse.identifier,\n message = _JSON$parse.message,\n reason = _JSON$parse.reason,\n reconnect = _JSON$parse.reconnect,\n type = _JSON$parse.type;\n\n switch (type) {\n case message_types.welcome:\n this.monitor.recordConnect();\n return this.subscriptions.reload();\n\n case message_types.disconnect:\n logger.log(\"Disconnecting. Reason: \" + reason);\n return this.close({\n allowReconnect: reconnect\n });\n\n case message_types.ping:\n return this.monitor.recordPing();\n\n case message_types.confirmation:\n return this.subscriptions.notify(identifier, \"connected\");\n\n case message_types.rejection:\n return this.subscriptions.reject(identifier);\n\n default:\n return this.subscriptions.notify(identifier, \"received\", message);\n }\n },\n open: function open() {\n logger.log(\"WebSocket onopen event, using '\" + this.getProtocol() + \"' subprotocol\");\n this.disconnected = false;\n\n if (!this.isProtocolSupported()) {\n logger.log(\"Protocol is unsupported. Stopping monitor and disconnecting.\");\n return this.close({\n allowReconnect: false\n });\n }\n },\n close: function close(event) {\n logger.log(\"WebSocket onclose event\");\n\n if (this.disconnected) {\n return;\n }\n\n this.disconnected = true;\n this.monitor.recordDisconnect();\n return this.subscriptions.notifyAll(\"disconnected\", {\n willAttemptReconnect: this.monitor.isRunning()\n });\n },\n error: function error() {\n logger.log(\"WebSocket onerror event\");\n }\n };\n\n var extend = function extend(object, properties) {\n if (properties != null) {\n for (var key in properties) {\n var value = properties[key];\n object[key] = value;\n }\n }\n\n return object;\n };\n\n var Subscription = function () {\n function Subscription(consumer) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var mixin = arguments[2];\n classCallCheck(this, Subscription);\n this.consumer = consumer;\n this.identifier = JSON.stringify(params);\n extend(this, mixin);\n }\n\n Subscription.prototype.perform = function perform(action) {\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n data.action = action;\n return this.send(data);\n };\n\n Subscription.prototype.send = function send(data) {\n return this.consumer.send({\n command: \"message\",\n identifier: this.identifier,\n data: JSON.stringify(data)\n });\n };\n\n Subscription.prototype.unsubscribe = function unsubscribe() {\n return this.consumer.subscriptions.remove(this);\n };\n\n return Subscription;\n }();\n\n var Subscriptions = function () {\n function Subscriptions(consumer) {\n classCallCheck(this, Subscriptions);\n this.consumer = consumer;\n this.subscriptions = [];\n }\n\n Subscriptions.prototype.create = function create(channelName, mixin) {\n var channel = channelName;\n var params = (typeof channel === \"undefined\" ? \"undefined\" : _typeof(channel)) === \"object\" ? channel : {\n channel: channel\n };\n var subscription = new Subscription(this.consumer, params, mixin);\n return this.add(subscription);\n };\n\n Subscriptions.prototype.add = function add(subscription) {\n this.subscriptions.push(subscription);\n this.consumer.ensureActiveConnection();\n this.notify(subscription, \"initialized\");\n this.sendCommand(subscription, \"subscribe\");\n return subscription;\n };\n\n Subscriptions.prototype.remove = function remove(subscription) {\n this.forget(subscription);\n\n if (!this.findAll(subscription.identifier).length) {\n this.sendCommand(subscription, \"unsubscribe\");\n }\n\n return subscription;\n };\n\n Subscriptions.prototype.reject = function reject(identifier) {\n var _this = this;\n\n return this.findAll(identifier).map(function (subscription) {\n _this.forget(subscription);\n\n _this.notify(subscription, \"rejected\");\n\n return subscription;\n });\n };\n\n Subscriptions.prototype.forget = function forget(subscription) {\n this.subscriptions = this.subscriptions.filter(function (s) {\n return s !== subscription;\n });\n return subscription;\n };\n\n Subscriptions.prototype.findAll = function findAll(identifier) {\n return this.subscriptions.filter(function (s) {\n return s.identifier === identifier;\n });\n };\n\n Subscriptions.prototype.reload = function reload() {\n var _this2 = this;\n\n return this.subscriptions.map(function (subscription) {\n return _this2.sendCommand(subscription, \"subscribe\");\n });\n };\n\n Subscriptions.prototype.notifyAll = function notifyAll(callbackName) {\n var _this3 = this;\n\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return this.subscriptions.map(function (subscription) {\n return _this3.notify.apply(_this3, [subscription, callbackName].concat(args));\n });\n };\n\n Subscriptions.prototype.notify = function notify(subscription, callbackName) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n var subscriptions = void 0;\n\n if (typeof subscription === \"string\") {\n subscriptions = this.findAll(subscription);\n } else {\n subscriptions = [subscription];\n }\n\n return subscriptions.map(function (subscription) {\n return typeof subscription[callbackName] === \"function\" ? subscription[callbackName].apply(subscription, args) : undefined;\n });\n };\n\n Subscriptions.prototype.sendCommand = function sendCommand(subscription, command) {\n var identifier = subscription.identifier;\n return this.consumer.send({\n command: command,\n identifier: identifier\n });\n };\n\n return Subscriptions;\n }();\n\n var Consumer = function () {\n function Consumer(url) {\n classCallCheck(this, Consumer);\n this._url = url;\n this.subscriptions = new Subscriptions(this);\n this.connection = new Connection(this);\n }\n\n Consumer.prototype.send = function send(data) {\n return this.connection.send(data);\n };\n\n Consumer.prototype.connect = function connect() {\n return this.connection.open();\n };\n\n Consumer.prototype.disconnect = function disconnect() {\n return this.connection.close({\n allowReconnect: false\n });\n };\n\n Consumer.prototype.ensureActiveConnection = function ensureActiveConnection() {\n if (!this.connection.isActive()) {\n return this.connection.open();\n }\n };\n\n createClass(Consumer, [{\n key: \"url\",\n get: function get$$1() {\n return createWebSocketURL(this._url);\n }\n }]);\n return Consumer;\n }();\n\n function createWebSocketURL(url) {\n if (typeof url === \"function\") {\n url = url();\n }\n\n if (url && !/^wss?:/i.test(url)) {\n var a = document.createElement(\"a\");\n a.href = url;\n a.href = a.href;\n a.protocol = a.protocol.replace(\"http\", \"ws\");\n return a.href;\n } else {\n return url;\n }\n }\n\n function createConsumer() {\n var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getConfig(\"url\") || INTERNAL.default_mount_path;\n return new Consumer(url);\n }\n\n function getConfig(name) {\n var element = document.head.querySelector(\"meta[name='action-cable-\" + name + \"']\");\n\n if (element) {\n return element.getAttribute(\"content\");\n }\n }\n\n exports.Connection = Connection;\n exports.ConnectionMonitor = ConnectionMonitor;\n exports.Consumer = Consumer;\n exports.INTERNAL = INTERNAL;\n exports.Subscription = Subscription;\n exports.Subscriptions = Subscriptions;\n exports.adapters = adapters;\n exports.createWebSocketURL = createWebSocketURL;\n exports.logger = logger;\n exports.createConsumer = createConsumer;\n exports.getConfig = getConfig;\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n});","/* eslint no-console:0 */\n// This file is automatically compiled by Webpack, along with any other files\n// present in this directory. You're encouraged to place your actual application logic in\n// a relevant structure within app/javascript and only use these pack files to reference\n// that code so it'll be compiled.\n//\n// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate\n// layout file, like app/views/layouts/application.html.erb\n\n\n// Uncomment to copy all static images under ../images to the output folder and reference\n// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)\n// or the `imagePath` JavaScript helper below.\n//\n// const images = require.context('../images', true)\n// const imagePath = (name) => images(name, true)\n\n// It would be better to use jquery with webpack\n// only after removing jquery-rails from Gemfile\n// otherwise it creates issues related to CSRF token\n//require(\"jquery\");\n\nrequire(\"channels\");\n","// Load all the channels within this directory and all subdirectories.\n// Channel files must be named *_channel.js.\n\nconst channels = require.context('.', true, /_channel\\.js$/);\nchannels.keys().forEach(channels);\n","var map = {\n\t\"./background_job_channel.js\": 4\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 3;","// Action Cable provides the framework to deal with WebSockets in Rails.\n// You can generate new channels where WebSocket features live using the `rails generate channel` command.\n\nimport { createConsumer } from \"@rails/actioncable\";\n\nexport default createConsumer();\n","import consumer from \"./consumer\";\n\ndocument.addEventListener(\"DOMContentLoaded\", function(event) {\n const path_array = window.location.pathname.split('/');\n const idea_id = path_array[2];\n\n consumer.subscriptions.create(\n {\n channel: \"BackgroundJobChannel\",\n idea_id: idea_id\n },\n {\n connected() {\n },\n\n disconnected() {\n },\n\n received(data) {\n if (document.getElementById(\"background-job-broadcast\").classList.value.includes(\"d-none\")) {\n document.getElementById(\"background-job-broadcast\").classList.remove(\"d-none\");\n document.getElementById(\"background-job-broadcast\").classList.add(\"d-block\");\n document.getElementById(\"logs-loading\").classList.remove(\"d-none\");\n document.getElementById(\"logs-loading\").classList.add(\"d-block\");\n }\n\n appendLine(data[\"message\"]);\n\n // auto scrolling\n let logsDiv = document.getElementById(\"background-job-broadcast\");\n logsDiv.scrollTop = logsDiv.scrollHeight;\n\n if(data[\"status\"] === \"completed\") {\n var codeGenerateButton = document.getElementById('push-to-github');\n var logsLoading = document.getElementById(\"logs-loading\");\n codeGenerateButton.innerHTML = 'Generate Code';\n codeGenerateButton.disabled = false;\n logsLoading.classList.add(\"d-none\");\n logsLoading.classList.remove(\"d-block\");\n\n if(document.getElementById('github-view-code') === null) {\n codeGenerateButton.closest(\".row\").parentNode.insertBefore(\n htmlToElement(data[\"view_code_button_html\"]),\n codeGenerateButton.closest(\".row\").nextElementSibling\n );\n }\n }\n }\n });\n});\n\nfunction appendLine(data) {\n const html = `
${data}`;\n const element = document.querySelector(\"#background-job-broadcast\");\n element.insertAdjacentHTML(\"beforeend\", html);\n}\n\nfunction htmlToElement(html) {\n var template = document.createElement('template');\n html = html.trim();\n template.innerHTML = html;\n return template.content.firstChild;\n}\n"],"sourceRoot":""}