{"version":3,"sources":["webpack:///./node_modules/@rails/actioncable/src/adapters.js","webpack:///./node_modules/@rails/actioncable/src/logger.js","webpack:///./node_modules/@rails/actioncable/src/connection_monitor.js","webpack:///./node_modules/@rails/actioncable/src/internal.js","webpack:///./node_modules/@rails/actioncable/src/connection.js","webpack:///./node_modules/@rails/actioncable/src/subscription.js","webpack:///./node_modules/@rails/actioncable/src/subscriptions.js","webpack:///./node_modules/@rails/actioncable/src/consumer.js","webpack:///./node_modules/@rails/actioncable/src/index.js"],"names":["logger","self","console","WebSocket","log","this","enabled","_adapters$logger","_len","arguments","length","messages","Array","_key","push","Date","now","adapters","apply","concat","_defineProperties","target","props","i","descriptor","enumerable","configurable","writable","Object","defineProperty","key","getTime","secondsSince","time","ConnectionMonitor","connection","instance","Constructor","TypeError","_classCallCheck","visibilityDidChange","bind","reconnectAttempts","protoProps","staticProps","value","isRunning","startedAt","stoppedAt","startPolling","addEventListener","getPollInterval","stopPolling","removeEventListener","pingedAt","recordPing","disconnectedAt","poll","clearTimeout","pollTimeout","_this","setTimeout","reconnectIfStale","_this$constructor$pol","constructor","pollInterval","min","max","interval","multiplier","Math","round","number","clamp","connectionIsStale","staleThreshold","disconnectedRecently","reopen","_this2","document","visibilityState","isOpen","prototype","message_types","protocols","supportedProtocols","slice","indexOf","Connection","consumer","open","subscriptions","monitor","disconnected","data","webSocket","send","JSON","stringify","isActive","getState","uninstallEventHandlers","url","installEventHandlers","start","_ref","undefined","allowReconnect","stop","close","error","reopenDelay","protocol","isState","call","getProtocol","states","state","readyState","toLowerCase","eventName","events","handler","message","event","isProtocolSupported","_JSON$parse","parse","identifier","reason","reconnect","type","welcome","recordConnect","reload","disconnect","ping","confirmation","notify","rejection","reject","recordDisconnect","notifyAll","willAttemptReconnect","extend","object","properties","Subscription","params","mixin","action","command","remove","_typeof","obj","Symbol","iterator","Subscriptions","channelName","channel","subscription","add","ensureActiveConnection","sendCommand","forget","findAll","map","filter","s","callbackName","_this3","args","_len2","_key2","Consumer","_url","get","createWebSocketURL","test","a","createElement","href","replace","createConsumer","getConfig","default_mount_path","name","element","head","querySelector","getAttribute"],"mappings":"ukBAAe,OACbA,OAAQC,KAAKC,QACbC,UAAWF,KAAKE,WCUH,GACbC,IAAK,WACH,GAAIC,KAAKC,QAAS,CAGhB,IAFA,IAAIC,EAEKC,EAAOC,UAAUC,OAAQC,EAAW,IAAIC,MAAMJ,GAAOK,EAAO,EAAGA,EAAOL,EAAMK,IACnFF,EAASE,GAAQJ,UAAUI,GAG7BF,EAASG,KAAKC,KAAKC,QAElBT,EAAmBU,EAASjB,QAAQI,IAAIc,MAAMX,EAAkB,CAAC,iBAAiBY,OAAOR,OCrBhG,SAASS,EAAkBC,EAAQC,GAAS,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAMZ,OAAQa,IAAK,CAAE,IAAIC,EAAaF,EAAMC,GAAIC,EAAWC,WAAaD,EAAWC,aAAc,EAAOD,EAAWE,cAAe,EAAU,UAAWF,IAAYA,EAAWG,UAAW,GAAMC,OAAOC,eAAeR,EAAQG,EAAWM,IAAKN,IAO7S,IAAIR,EAAM,WACR,OAAO,IAAID,MAAOgB,WAGhBC,EAAe,SAAsBC,GACvC,OAAQjB,IAAQiB,GAAQ,KAOtB,EAAiC,WACnC,SAASC,EAAkBC,IAtB7B,SAAyBC,EAAUC,GAAe,KAAMD,aAAoBC,GAAgB,MAAM,IAAIC,UAAU,qCAuB5GC,CAAgBlC,KAAM6B,GAEtB7B,KAAKmC,oBAAsBnC,KAAKmC,oBAAoBC,KAAKpC,MACzDA,KAAK8B,WAAaA,EAClB9B,KAAKqC,kBAAoB,EAvB7B,IAAsBL,EAAaM,EAAYC,EAkJ7C,OAlJoBP,EA0BPH,GA1BoBS,EA0BD,CAAC,CAC/Bb,IAAK,QACLe,MAAO,WACAxC,KAAKyC,cACRzC,KAAK0C,UAAY/B,WACVX,KAAK2C,UACZ3C,KAAK4C,eACLC,iBAAiB,mBAAoB7C,KAAKmC,qBAC1CxC,EAA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MACLkJ,IAAK,WACH,OAAOC,EAAmB5K,KAAK0K,QAEhC,CACDjJ,IAAK,OACLe,MAAO,SAAciD,GACnB,OAAOzF,KAAK8B,WAAW6D,KAAKF,KAE7B,CACDhE,IAAK,UACLe,MAAO,WACL,OAAOxC,KAAK8B,WAAWuD,SAExB,CACD5D,IAAK,aACLe,MAAO,WACL,OAAOxC,KAAK8B,WAAW0E,MAAM,CAC3BF,gBAAgB,MAGnB,CACD7E,IAAK,yBACLe,MAAO,WACL,IAAKxC,KAAK8B,WAAWgE,WACnB,OAAO9F,KAAK8B,WAAWuD,YAhE+C,EAAkBrD,EAAY6C,UAAWvC,GAAiBC,GAAa,EAAkBP,EAAaO,GAAchB,OAAOC,eAAeQ,EAAa,YAAa,CAAEV,UAAU,IAqErPmJ,EAxCmB,GA4CrB,SAASG,EAAmB3E,GAKjC,GAJmB,oBAARA,IACTA,EAAMA,KAGJA,IAAQ,UAAU4E,KAAK5E,GAAM,CAC/B,IAAI6E,EAAIpG,SAASqG,cAAc,KAK/B,OAJAD,EAAEE,KAAO/E,EAET6E,EAAEE,KAAOF,EAAEE,KACXF,EAAEnE,SAAWmE,EAAEnE,SAASsE,QAAQ,OAAQ,MACjCH,EAAEE,KAET,OAAO/E,ECjFJ,SAASiF,IACd,IAAIjF,EAAM7F,UAAUC,OAAS,QAAsBgG,IAAjBjG,UAAU,GAAmBA,UAAU,GAAK+K,EAAU,QAAU,EAASC,mBAC3G,OAAO,IAAI,EAASnF,GAEf,SAASkF,EAAUE,GACxB,IAAIC,EAAU5G,SAAS6G,KAAKC,cAAc,2BAA2B1K,OAAOuK,EAAM,OAElF,GAAIC,EACF,OAAOA,EAAQG,aAAa","file":"js/actioncable-657476a9383eb2246aad.chunk.js","sourcesContent":["export default {\n logger: self.console,\n WebSocket: self.WebSocket\n};","import adapters from \"./adapters\"; // The logger is disabled by default. You can enable it with:\n//\n// ActionCable.logger.enabled = true\n//\n// Example:\n//\n// import * as ActionCable from '@rails/actioncable'\n//\n// ActionCable.logger.enabled = true\n// ActionCable.logger.log('Connection Established.')\n//\n\nexport default {\n log: function log() {\n if (this.enabled) {\n var _adapters$logger;\n\n for (var _len = arguments.length, messages = new 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};","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nimport logger from \"./logger\"; // Responsible for ensuring the cable connection is in good health by validating the heartbeat pings sent from the server, and attempting\n// revival reconnections if things go astray. Internal class, not intended for direct user manipulation.\n\nvar now = function now() {\n return new Date().getTime();\n};\n\nvar secondsSince = function secondsSince(time) {\n return (now() - time) / 1000;\n};\n\nvar clamp = function clamp(number, min, max) {\n return Math.max(min, Math.min(max, number));\n};\n\nvar ConnectionMonitor = /*#__PURE__*/function () {\n function ConnectionMonitor(connection) {\n _classCallCheck(this, ConnectionMonitor);\n\n this.visibilityDidChange = this.visibilityDidChange.bind(this);\n this.connection = connection;\n this.reconnectAttempts = 0;\n }\n\n _createClass(ConnectionMonitor, [{\n key: \"start\",\n value: 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 = \".concat(this.getPollInterval(), \" ms\"));\n }\n }\n }, {\n key: \"stop\",\n value: 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 key: \"isRunning\",\n value: function isRunning() {\n return this.startedAt && !this.stoppedAt;\n }\n }, {\n key: \"recordPing\",\n value: function recordPing() {\n this.pingedAt = now();\n }\n }, {\n key: \"recordConnect\",\n value: function recordConnect() {\n this.reconnectAttempts = 0;\n this.recordPing();\n delete this.disconnectedAt;\n logger.log(\"ConnectionMonitor recorded connect\");\n }\n }, {\n key: \"recordDisconnect\",\n value: function recordDisconnect() {\n this.disconnectedAt = now();\n logger.log(\"ConnectionMonitor recorded disconnect\");\n } // Private\n\n }, {\n key: \"startPolling\",\n value: function startPolling() {\n this.stopPolling();\n this.poll();\n }\n }, {\n key: \"stopPolling\",\n value: function stopPolling() {\n clearTimeout(this.pollTimeout);\n }\n }, {\n key: \"poll\",\n value: 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 key: \"getPollInterval\",\n value: function getPollInterval() {\n var _this$constructor$pol = this.constructor.pollInterval,\n min = _this$constructor$pol.min,\n max = _this$constructor$pol.max,\n multiplier = _this$constructor$pol.multiplier;\n var interval = multiplier * Math.log(this.reconnectAttempts + 1);\n return Math.round(clamp(interval, min, max) * 1000);\n }\n }, {\n key: \"reconnectIfStale\",\n value: function reconnectIfStale() {\n if (this.connectionIsStale()) {\n logger.log(\"ConnectionMonitor detected stale connection. reconnectAttempts = \".concat(this.reconnectAttempts, \", pollInterval = \").concat(this.getPollInterval(), \" ms, time disconnected = \").concat(secondsSince(this.disconnectedAt), \" s, stale threshold = \").concat(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 key: \"connectionIsStale\",\n value: function connectionIsStale() {\n return secondsSince(this.pingedAt ? this.pingedAt : this.startedAt) > this.constructor.staleThreshold;\n }\n }, {\n key: \"disconnectedRecently\",\n value: function disconnectedRecently() {\n return this.disconnectedAt && secondsSince(this.disconnectedAt) < this.constructor.staleThreshold;\n }\n }, {\n key: \"visibilityDidChange\",\n value: 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. visibilityState = \".concat(document.visibilityState));\n\n _this2.connection.reopen();\n }\n }, 200);\n }\n }\n }]);\n\n return ConnectionMonitor;\n}();\n\nConnectionMonitor.pollInterval = {\n min: 3,\n max: 30,\n multiplier: 5\n};\nConnectionMonitor.staleThreshold = 6; // Server::Connections::BEAT_INTERVAL * 2 (missed two pings)\n\nexport default ConnectionMonitor;","export default {\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};","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nimport adapters from \"./adapters\";\nimport ConnectionMonitor from \"./connection_monitor\";\nimport INTERNAL from \"./internal\";\nimport logger from \"./logger\"; // Encapsulate the cable connection held by the consumer. This is an internal class not intended for direct user manipulation.\n\nvar message_types = INTERNAL.message_types,\n protocols = INTERNAL.protocols;\nvar supportedProtocols = protocols.slice(0, protocols.length - 1);\nvar indexOf = [].indexOf;\n\nvar Connection = /*#__PURE__*/function () {\n function Connection(consumer) {\n _classCallCheck(this, Connection);\n\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 _createClass(Connection, [{\n key: \"send\",\n value: 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 key: \"open\",\n value: function open() {\n if (this.isActive()) {\n logger.log(\"Attempted to open WebSocket, but existing socket is \".concat(this.getState()));\n return false;\n } else {\n logger.log(\"Opening WebSocket, current state is \".concat(this.getState(), \", subprotocols: \").concat(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 key: \"close\",\n value: 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 key: \"reopen\",\n value: function reopen() {\n logger.log(\"Reopening WebSocket, current state is \".concat(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 \".concat(this.constructor.reopenDelay, \"ms\"));\n setTimeout(this.open, this.constructor.reopenDelay);\n }\n } else {\n return this.open();\n }\n }\n }, {\n key: \"getProtocol\",\n value: function getProtocol() {\n if (this.webSocket) {\n return this.webSocket.protocol;\n }\n }\n }, {\n key: \"isOpen\",\n value: function isOpen() {\n return this.isState(\"open\");\n }\n }, {\n key: \"isActive\",\n value: function isActive() {\n return this.isState(\"open\", \"connecting\");\n } // Private\n\n }, {\n key: \"isProtocolSupported\",\n value: function isProtocolSupported() {\n return indexOf.call(supportedProtocols, this.getProtocol()) >= 0;\n }\n }, {\n key: \"isState\",\n value: function isState() {\n for (var _len = arguments.length, states = new 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 key: \"getState\",\n value: 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 key: \"installEventHandlers\",\n value: function installEventHandlers() {\n for (var eventName in this.events) {\n var handler = this.events[eventName].bind(this);\n this.webSocket[\"on\".concat(eventName)] = handler;\n }\n }\n }, {\n key: \"uninstallEventHandlers\",\n value: function uninstallEventHandlers() {\n for (var eventName in this.events) {\n this.webSocket[\"on\".concat(eventName)] = function () {};\n }\n }\n }]);\n\n return Connection;\n}();\n\nConnection.reopenDelay = 500;\nConnection.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: \".concat(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 '\".concat(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};\nexport default Connection;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\n// A new subscription is created through the ActionCable.Subscriptions instance available on the consumer.\n// It provides a number of callbacks and a method for calling remote procedure calls on the corresponding\n// Channel instance on the server side.\n//\n// An example demonstrates the basic functionality:\n//\n// App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\", {\n// connected() {\n// // Called once the subscription has been successfully completed\n// },\n//\n// disconnected({ willAttemptReconnect: boolean }) {\n// // Called when the client has disconnected with the server.\n// // The object will have an `willAttemptReconnect` property which\n// // says whether the client has the intention of attempting\n// // to reconnect.\n// },\n//\n// appear() {\n// this.perform('appear', {appearing_on: this.appearingOn()})\n// },\n//\n// away() {\n// this.perform('away')\n// },\n//\n// appearingOn() {\n// $('main').data('appearing-on')\n// }\n// })\n//\n// The methods #appear and #away forward their intent to the remote AppearanceChannel instance on the server\n// by calling the `perform` method with the first parameter being the action (which maps to AppearanceChannel#appear/away).\n// The second parameter is a hash that'll get JSON encoded and made available on the server in the data parameter.\n//\n// This is how the server component would look:\n//\n// class AppearanceChannel < ApplicationActionCable::Channel\n// def subscribed\n// current_user.appear\n// end\n//\n// def unsubscribed\n// current_user.disappear\n// end\n//\n// def appear(data)\n// current_user.appear on: data['appearing_on']\n// end\n//\n// def away\n// current_user.away\n// end\n// end\n//\n// The \"AppearanceChannel\" name is automatically mapped between the client-side subscription creation and the server-side Ruby class name.\n// The AppearanceChannel#appear/away public methods are exposed automatically to client-side invocation through the perform method.\nvar 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\nvar Subscription = /*#__PURE__*/function () {\n function Subscription(consumer) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var mixin = arguments.length > 2 ? arguments[2] : undefined;\n\n _classCallCheck(this, Subscription);\n\n this.consumer = consumer;\n this.identifier = JSON.stringify(params);\n extend(this, mixin);\n } // Perform a channel action with the optional data passed as an attribute\n\n\n _createClass(Subscription, [{\n key: \"perform\",\n value: 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 key: \"send\",\n value: function send(data) {\n return this.consumer.send({\n command: \"message\",\n identifier: this.identifier,\n data: JSON.stringify(data)\n });\n }\n }, {\n key: \"unsubscribe\",\n value: function unsubscribe() {\n return this.consumer.subscriptions.remove(this);\n }\n }]);\n\n return Subscription;\n}();\n\nexport { Subscription as default };","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nimport Subscription from \"./subscription\"; // Collection class for creating (and internally managing) channel subscriptions.\n// The only method intended to be triggered by the user is ActionCable.Subscriptions#create,\n// and it should be called through the consumer like so:\n//\n// App = {}\n// App.cable = ActionCable.createConsumer(\"ws://example.com/accounts/1\")\n// App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\")\n//\n// For more details on how you'd configure an actual channel subscription, see ActionCable.Subscription.\n\nvar Subscriptions = /*#__PURE__*/function () {\n function Subscriptions(consumer) {\n _classCallCheck(this, Subscriptions);\n\n this.consumer = consumer;\n this.subscriptions = [];\n }\n\n _createClass(Subscriptions, [{\n key: \"create\",\n value: function create(channelName, mixin) {\n var channel = channelName;\n var params = _typeof(channel) === \"object\" ? channel : {\n channel: channel\n };\n var subscription = new Subscription(this.consumer, params, mixin);\n return this.add(subscription);\n } // Private\n\n }, {\n key: \"add\",\n value: 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 key: \"remove\",\n value: 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 key: \"reject\",\n value: 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 key: \"forget\",\n value: function forget(subscription) {\n this.subscriptions = this.subscriptions.filter(function (s) {\n return s !== subscription;\n });\n return subscription;\n }\n }, {\n key: \"findAll\",\n value: function findAll(identifier) {\n return this.subscriptions.filter(function (s) {\n return s.identifier === identifier;\n });\n }\n }, {\n key: \"reload\",\n value: function reload() {\n var _this2 = this;\n\n return this.subscriptions.map(function (subscription) {\n return _this2.sendCommand(subscription, \"subscribe\");\n });\n }\n }, {\n key: \"notifyAll\",\n value: function notifyAll(callbackName) {\n var _this3 = this;\n\n for (var _len = arguments.length, args = new 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 key: \"notify\",\n value: function notify(subscription, callbackName) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n var subscriptions;\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 key: \"sendCommand\",\n value: function sendCommand(subscription, command) {\n var identifier = subscription.identifier;\n return this.consumer.send({\n command: command,\n identifier: identifier\n });\n }\n }]);\n\n return Subscriptions;\n}();\n\nexport { Subscriptions as default };","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nimport Connection from \"./connection\";\nimport Subscriptions from \"./subscriptions\"; // The ActionCable.Consumer establishes the connection to a server-side Ruby Connection object. Once established,\n// the ActionCable.ConnectionMonitor will ensure that its properly maintained through heartbeats and checking for stale updates.\n// The Consumer instance is also the gateway to establishing subscriptions to desired channels through the #createSubscription\n// method.\n//\n// The following example shows how this can be set up:\n//\n// App = {}\n// App.cable = ActionCable.createConsumer(\"ws://example.com/accounts/1\")\n// App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\")\n//\n// For more details on how you'd configure an actual channel subscription, see ActionCable.Subscription.\n//\n// When a consumer is created, it automatically connects with the server.\n//\n// To disconnect from the server, call\n//\n// App.cable.disconnect()\n//\n// and to restart the connection:\n//\n// App.cable.connect()\n//\n// Any channel subscriptions which existed prior to disconnecting will\n// automatically resubscribe.\n\nvar Consumer = /*#__PURE__*/function () {\n function Consumer(url) {\n _classCallCheck(this, Consumer);\n\n this._url = url;\n this.subscriptions = new Subscriptions(this);\n this.connection = new Connection(this);\n }\n\n _createClass(Consumer, [{\n key: \"url\",\n get: function get() {\n return createWebSocketURL(this._url);\n }\n }, {\n key: \"send\",\n value: function send(data) {\n return this.connection.send(data);\n }\n }, {\n key: \"connect\",\n value: function connect() {\n return this.connection.open();\n }\n }, {\n key: \"disconnect\",\n value: function disconnect() {\n return this.connection.close({\n allowReconnect: false\n });\n }\n }, {\n key: \"ensureActiveConnection\",\n value: function ensureActiveConnection() {\n if (!this.connection.isActive()) {\n return this.connection.open();\n }\n }\n }]);\n\n return Consumer;\n}();\n\nexport { Consumer as default };\nexport 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; // Fix populating Location properties in IE. Otherwise, protocol will be blank.\n\n a.href = a.href;\n a.protocol = a.protocol.replace(\"http\", \"ws\");\n return a.href;\n } else {\n return url;\n }\n}","import Connection from \"./connection\";\nimport ConnectionMonitor from \"./connection_monitor\";\nimport Consumer, { createWebSocketURL } from \"./consumer\";\nimport INTERNAL from \"./internal\";\nimport Subscription from \"./subscription\";\nimport Subscriptions from \"./subscriptions\";\nimport adapters from \"./adapters\";\nimport logger from \"./logger\";\nexport { Connection, ConnectionMonitor, Consumer, INTERNAL, Subscription, Subscriptions, adapters, createWebSocketURL, logger };\nexport 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}\nexport function getConfig(name) {\n var element = document.head.querySelector(\"meta[name='action-cable-\".concat(name, \"']\"));\n\n if (element) {\n return element.getAttribute(\"content\");\n }\n}"],"sourceRoot":""}