{ "version": 3, "sources": ["../../../node_modules/@rails/actioncable/src/adapters.js", "../../../node_modules/@rails/actioncable/src/logger.js", "../../../node_modules/@rails/actioncable/src/connection_monitor.js", "../../../node_modules/@rails/actioncable/src/internal.js", "../../../node_modules/@rails/actioncable/src/connection.js", "../../../node_modules/@rails/actioncable/src/subscription.js", "../../../node_modules/@rails/actioncable/src/subscription_guarantor.js", "../../../node_modules/@rails/actioncable/src/subscriptions.js", "../../../node_modules/@rails/actioncable/src/consumer.js", "../../../node_modules/@rails/actioncable/src/index.js", "../../../node_modules/@uppy/utils/lib/Translator.js", "../../../node_modules/namespace-emitter/index.js", "../../../node_modules/lodash/isObject.js", "../../../node_modules/lodash/_freeGlobal.js", "../../../node_modules/lodash/_root.js", "../../../node_modules/lodash/now.js", "../../../node_modules/lodash/_trimmedEndIndex.js", "../../../node_modules/lodash/_baseTrim.js", "../../../node_modules/lodash/_Symbol.js", "../../../node_modules/lodash/_getRawTag.js", "../../../node_modules/lodash/_objectToString.js", "../../../node_modules/lodash/_baseGetTag.js", "../../../node_modules/lodash/isObjectLike.js", "../../../node_modules/lodash/isSymbol.js", "../../../node_modules/lodash/toNumber.js", "../../../node_modules/lodash/debounce.js", "../../../node_modules/lodash/throttle.js", "../../../node_modules/@transloadit/prettier-bytes/src/prettierBytes.ts", "../../../node_modules/wildcard/index.js", "../../../node_modules/mime-match/index.js", "../../../node_modules/@uppy/core/lib/BasePlugin.js", "../../../node_modules/classnames/index.js", "../../../node_modules/eventemitter3/index.js", "../../../node_modules/is-mobile/index.js", "../../../node_modules/@noble/hashes/src/_assert.ts", "../../../node_modules/@noble/hashes/src/_u64.ts", "../../../node_modules/@noble/hashes/src/crypto.ts", "../../../node_modules/@noble/hashes/src/utils.ts", "../../../node_modules/@noble/hashes/src/sha3.ts", "../../../node_modules/@paralleldrive/cuid2/src/index.js", "../../../node_modules/@paralleldrive/cuid2/index.js", "../../../node_modules/@uppy/utils/lib/RateLimitedQueue.js", "../../../node_modules/@excid3/uppy-activestorage-upload/node_modules/@rails/activestorage/app/assets/javascripts/activestorage.js", "../../../node_modules/@excid3/uppy-activestorage-upload/lib/index.js", "../../../node_modules/lunr/lunr.js", "../../../node_modules/@rails/activestorage/app/assets/javascripts/activestorage.js", "../../../node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/snakeize.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable_stream_source_element.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/fetch_requests.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/index.js", "../../../node_modules/@hotwired/stimulus/dist/stimulus.js", "../../../node_modules/stimulus-autocomplete/src/autocomplete.js", "../../../node_modules/flatpickr/dist/esm/types/options.js", "../../../node_modules/flatpickr/dist/esm/l10n/default.js", "../../../node_modules/flatpickr/dist/esm/utils/index.js", "../../../node_modules/flatpickr/dist/esm/utils/dom.js", "../../../node_modules/flatpickr/dist/esm/utils/formatting.js", "../../../node_modules/flatpickr/dist/esm/utils/dates.js", "../../../node_modules/flatpickr/dist/esm/utils/polyfills.js", "../../../node_modules/flatpickr/dist/esm/index.js", "../../../node_modules/stimulus-flatpickr/node_modules/@hotwired/stimulus/dist/stimulus.js", "../../../node_modules/stimulus-flatpickr/src/utils.js", "../../../node_modules/stimulus-flatpickr/src/config_options.js", "../../../node_modules/stimulus-flatpickr/src/events.js", "../../../node_modules/stimulus-flatpickr/src/elements.js", "../../../node_modules/stimulus-flatpickr/src/strftime_mapping.js", "../../../node_modules/stimulus-flatpickr/src/index.js", "../../javascript/shared_controllers/click_toggle_controller.js", "../../../node_modules/@uppy/core/lib/Uppy.js", "../../../node_modules/nanoid/non-secure/index.js", "../../../node_modules/@uppy/store-default/lib/index.js", "../../../node_modules/@uppy/utils/lib/getFileNameAndExtension.js", "../../../node_modules/@uppy/utils/lib/mimeTypes.js", "../../../node_modules/@uppy/utils/lib/getFileType.js", "../../../node_modules/@uppy/utils/lib/generateFileID.js", "../../../node_modules/@uppy/core/lib/supportsUploadProgress.js", "../../../node_modules/@uppy/core/lib/getFileName.js", "../../../node_modules/@uppy/utils/lib/getTimeStamp.js", "../../../node_modules/@uppy/core/lib/loggers.js", "../../../node_modules/@uppy/core/lib/Restricter.js", "../../../node_modules/@uppy/core/lib/locale.js", "../../../node_modules/preact/src/util.js", "../../../node_modules/preact/src/options.js", "../../../node_modules/preact/src/create-element.js", "../../../node_modules/preact/src/component.js", "../../../node_modules/preact/src/create-context.js", "../../../node_modules/preact/src/constants.js", "../../../node_modules/preact/src/diff/children.js", "../../../node_modules/preact/src/diff/props.js", "../../../node_modules/preact/src/diff/index.js", "../../../node_modules/preact/src/render.js", "../../../node_modules/preact/src/clone-element.js", "../../../node_modules/preact/src/diff/catch-error.js", "../../../node_modules/@uppy/utils/lib/isDOMElement.js", "../../../node_modules/@uppy/utils/lib/findDOMElement.js", "../../../node_modules/@uppy/utils/lib/getTextDirection.js", "../../../node_modules/@uppy/core/lib/UIPlugin.js", "../../../node_modules/@uppy/utils/lib/emaFilter.js", "../../../node_modules/@uppy/status-bar/lib/StatusBarStates.js", "../../../node_modules/@uppy/status-bar/lib/StatusBarUI.js", "../../../node_modules/@uppy/status-bar/lib/calculateProcessingProgress.js", "../../../node_modules/@uppy/status-bar/lib/Components.js", "../../../node_modules/@uppy/utils/lib/secondsToTime.js", "../../../node_modules/@uppy/utils/lib/prettyETA.js", "../../../node_modules/@uppy/status-bar/lib/locale.js", "../../../node_modules/@uppy/status-bar/lib/StatusBar.js", "../../../node_modules/@uppy/informer/lib/FadeIn.js", "../../../node_modules/@uppy/informer/lib/TransitionGroup.js", "../../../node_modules/@uppy/informer/lib/Informer.js", "../../../node_modules/@uppy/utils/lib/dataURItoBlob.js", "../../../node_modules/@uppy/utils/lib/isObjectURL.js", "../../../node_modules/@uppy/utils/lib/isPreviewSupported.js", "../../../node_modules/exifr/dist/mini.esm.mjs", "../../../node_modules/@uppy/thumbnail-generator/lib/locale.js", "../../../node_modules/@uppy/thumbnail-generator/lib/index.js", "../../../node_modules/@uppy/utils/lib/findAllDOMElements.js", "../../../node_modules/@uppy/utils/lib/toArray.js", "../../../node_modules/@uppy/utils/lib/getDroppedFiles/utils/webkitGetAsEntryApi/getFilesAndDirectoriesFromDirectory.js", "../../../node_modules/@uppy/utils/lib/getDroppedFiles/utils/webkitGetAsEntryApi/index.js", "../../../node_modules/@uppy/utils/lib/getDroppedFiles/utils/fallbackApi.js", "../../../node_modules/@uppy/utils/lib/getDroppedFiles/index.js", "../../../node_modules/@uppy/provider-views/lib/ProviderView/ProviderView.js", "../../../node_modules/@uppy/utils/lib/remoteFileObjToLocal.js", "../../../node_modules/preact/hooks/src/index.js", "../../../node_modules/@uppy/provider-views/lib/ProviderView/AuthView.js", "../../../node_modules/@uppy/provider-views/lib/ProviderView/Header.js", "../../../node_modules/@uppy/provider-views/lib/ProviderView/User.js", "../../../node_modules/@uppy/provider-views/lib/Breadcrumbs.js", "../../../node_modules/@uppy/utils/lib/VirtualList.js", "../../../node_modules/@uppy/provider-views/lib/Item/index.js", "../../../node_modules/@uppy/provider-views/lib/Item/components/ItemIcon.js", "../../../node_modules/@uppy/provider-views/lib/Item/components/GridItem.js", "../../../node_modules/@uppy/provider-views/lib/Item/components/ListItem.js", "../../../node_modules/@uppy/provider-views/lib/Browser.js", "../../../node_modules/@uppy/provider-views/lib/utils/PartialTreeUtils/afterOpenFolder.js", "../../../node_modules/@uppy/provider-views/lib/utils/PartialTreeUtils/afterScrollFolder.js", "../../../node_modules/@uppy/provider-views/lib/utils/PartialTreeUtils/shallowClone.js", "../../../node_modules/@uppy/provider-views/lib/utils/PartialTreeUtils/afterToggleCheckbox.js", "../../../node_modules/eventemitter3/index.mjs", "../../../node_modules/p-queue/node_modules/p-timeout/index.js", "../../../node_modules/p-queue/dist/lower-bound.js", "../../../node_modules/p-queue/dist/priority-queue.js", "../../../node_modules/p-queue/dist/index.js", "../../../node_modules/@uppy/provider-views/lib/utils/PartialTreeUtils/afterFill.js", "../../../node_modules/@uppy/provider-views/lib/utils/PartialTreeUtils/index.js", "../../../node_modules/@uppy/provider-views/lib/utils/shouldHandleScroll.js", "../../../node_modules/@uppy/provider-views/lib/utils/handleError.js", "../../../node_modules/@uppy/provider-views/lib/utils/getClickedRange.js", "../../../node_modules/@uppy/provider-views/lib/SearchInput.js", "../../../node_modules/@uppy/provider-views/lib/FooterActions.js", "../../../node_modules/@uppy/provider-views/lib/utils/PartialTreeUtils/getNumberOfSelectedFiles.js", "../../../node_modules/@uppy/provider-views/lib/utils/getTagFile.js", "../../../node_modules/@uppy/provider-views/lib/utils/addFiles.js", "../../../node_modules/@uppy/provider-views/lib/utils/PartialTreeUtils/getCheckedFilesWithPaths.js", "../../../node_modules/@uppy/provider-views/lib/utils/PartialTreeUtils/getBreadcrumbs.js", "../../../node_modules/@uppy/provider-views/lib/SearchProviderView/SearchProviderView.js", "../../../node_modules/memoize-one/dist/memoize-one.esm.js", "../../../node_modules/@uppy/utils/lib/FOCUSABLE_ELEMENTS.js", "../../../node_modules/@uppy/dashboard/lib/utils/getActiveOverlayEl.js", "../../../node_modules/@uppy/dashboard/lib/utils/trapFocus.js", "../../../node_modules/@uppy/dashboard/lib/utils/createSuperFocus.js", "../../../node_modules/@uppy/dashboard/lib/components/Dashboard.js", "../../../node_modules/@uppy/utils/lib/isDragDropSupported.js", "../../../node_modules/@uppy/dashboard/lib/components/FileItem/index.js", "../../../node_modules/shallow-equal/src/arrays.ts", "../../../node_modules/shallow-equal/src/objects.ts", "../../../node_modules/shallow-equal/src/index.ts", "../../../node_modules/@uppy/dashboard/lib/utils/getFileTypeIcon.js", "../../../node_modules/@uppy/dashboard/lib/components/FilePreview.js", "../../../node_modules/@uppy/dashboard/lib/components/FileItem/MetaErrorMessage.js", "../../../node_modules/@uppy/dashboard/lib/components/FileItem/FilePreviewAndLink/index.js", "../../../node_modules/@uppy/dashboard/lib/components/FileItem/FileProgress/index.js", "../../../node_modules/@uppy/dashboard/lib/components/FileItem/FileInfo/index.js", "../../../node_modules/@uppy/utils/lib/truncateString.js", "../../../node_modules/@uppy/dashboard/lib/utils/copyToClipboard.js", "../../../node_modules/@uppy/dashboard/lib/components/FileItem/Buttons/index.js", "../../../node_modules/@uppy/dashboard/lib/components/FileList.js", "../../../node_modules/@uppy/dashboard/lib/components/AddFiles.js", "../../../node_modules/@uppy/dashboard/lib/components/AddFilesPanel.js", "../../../node_modules/@uppy/dashboard/lib/components/PickerPanelContent.js", "../../../node_modules/@uppy/dashboard/lib/utils/ignoreEvent.js", "../../../node_modules/@uppy/dashboard/lib/components/EditorPanel.js", "../../../node_modules/@uppy/dashboard/lib/components/PickerPanelTopBar.js", "../../../node_modules/@uppy/dashboard/lib/components/FileCard/index.js", "../../../node_modules/@uppy/dashboard/lib/components/FileCard/RenderMetaFields.js", "../../../node_modules/@uppy/dashboard/lib/components/Slide.js", "../../../node_modules/@uppy/dashboard/lib/locale.js", "../../../node_modules/@uppy/dashboard/lib/Dashboard.js", "../../../node_modules/@uppy/utils/lib/getFileTypeExtension.js", "../../../node_modules/@uppy/webcam/lib/Webcam.js", "../../../node_modules/@uppy/utils/lib/canvasToBlob.js", "../../../node_modules/@uppy/webcam/lib/supportsMediaRecorder.js", "../../../node_modules/@uppy/webcam/lib/CameraIcon.js", "../../../node_modules/@uppy/webcam/lib/SnapshotButton.js", "../../../node_modules/@uppy/webcam/lib/RecordButton.js", "../../../node_modules/@uppy/webcam/lib/formatSeconds.js", "../../../node_modules/@uppy/webcam/lib/RecordingLength.js", "../../../node_modules/@uppy/webcam/lib/VideoSourceSelect.js", "../../../node_modules/@uppy/webcam/lib/SubmitButton.js", "../../../node_modules/@uppy/webcam/lib/DiscardButton.js", "../../../node_modules/@uppy/webcam/lib/CameraScreen.js", "../../../node_modules/@uppy/webcam/lib/PermissionsScreen.js", "../../../node_modules/@uppy/webcam/lib/locale.js", "../../javascript/shared_controllers/file_upload_controller.js", "../../javascript/controllers/combobox_controller.js", "../../javascript/controllers/cookieless_controller.js", "../../javascript/controllers/coupon_requests_controller.js", "../../javascript/helpers/commons.js", "../../javascript/controllers/data_collection_controller.js", "../../javascript/controllers/data_collection_field_controller.js", "../../javascript/controllers/errors_controller.js", "../../javascript/controllers/faqs_controller.js", "../../javascript/controllers/fetch_controller.js", "../../javascript/controllers/forms_controller.js", "../../javascript/controllers/hub_card_controller.js", "../../javascript/controllers/hub_controller.js", "../../javascript/controllers/hub_hosted_controller.js", "../../javascript/controllers/hub_popup_controller.js", "../../../node_modules/el-transition/index.js", "../../javascript/controllers/layout_controller.js", "../../javascript/controllers/layout_tw_controller.js", "../../javascript/controllers/location_controller.js", "../../javascript/controllers/pin_codes_controller.js", "../../javascript/controllers/polling_controller.js", "../../javascript/controllers/privacy_controller.js", "../../javascript/controllers/redirect_controller.js", "../../javascript/controllers/session_controller.js", "../../javascript/controllers/share_controller.js", "../../javascript/controllers/signin_controller.js", "../../javascript/controllers/tabs_controller.js", "../../javascript/controllers/tooltip_controller.js", "../../javascript/controllers/turnstile_controller.js", "../../javascript/controllers/users_controller.js", "../../javascript/controllers/utils_controller.js", "../../javascript/controllers/verify_controller.js", "../../javascript/controllers/window_switcher_controller.js", "rails:/tmp/build_a1bfdd1c/app/javascript/controllers/*_controller.js", "../../javascript/controllers/index.js", "../../javascript/application.js"], "sourcesContent": ["export default {\n logger: self.console,\n WebSocket: self.WebSocket\n}\n", "import adapters from \"./adapters\"\n\n// 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(...messages) {\n if (this.enabled) {\n messages.push(Date.now())\n adapters.logger.log(\"[ActionCable]\", ...messages)\n }\n },\n}\n", "import logger from \"./logger\"\n\n// 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\nconst now = () => new Date().getTime()\n\nconst secondsSince = time => (now() - time) / 1000\n\nclass ConnectionMonitor {\n constructor(connection) {\n this.visibilityDidChange = this.visibilityDidChange.bind(this)\n this.connection = connection\n this.reconnectAttempts = 0\n }\n\n 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. stale threshold = ${this.constructor.staleThreshold} s`)\n }\n }\n\n 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 isRunning() {\n return this.startedAt && !this.stoppedAt\n }\n\n recordPing() {\n this.pingedAt = now()\n }\n\n recordConnect() {\n this.reconnectAttempts = 0\n this.recordPing()\n delete this.disconnectedAt\n logger.log(\"ConnectionMonitor recorded connect\")\n }\n\n recordDisconnect() {\n this.disconnectedAt = now()\n logger.log(\"ConnectionMonitor recorded disconnect\")\n }\n\n // Private\n\n startPolling() {\n this.stopPolling()\n this.poll()\n }\n\n stopPolling() {\n clearTimeout(this.pollTimeout)\n }\n\n poll() {\n this.pollTimeout = setTimeout(() => {\n this.reconnectIfStale()\n this.poll()\n }\n , this.getPollInterval())\n }\n\n getPollInterval() {\n const { staleThreshold, reconnectionBackoffRate } = this.constructor\n const backoff = Math.pow(1 + reconnectionBackoffRate, Math.min(this.reconnectAttempts, 10))\n const jitterMax = this.reconnectAttempts === 0 ? 1.0 : reconnectionBackoffRate\n const jitter = jitterMax * Math.random()\n return staleThreshold * 1000 * backoff * (1 + jitter)\n }\n\n reconnectIfStale() {\n if (this.connectionIsStale()) {\n logger.log(`ConnectionMonitor detected stale connection. reconnectAttempts = ${this.reconnectAttempts}, time stale = ${secondsSince(this.refreshedAt)} s, stale threshold = ${this.constructor.staleThreshold} s`)\n this.reconnectAttempts++\n if (this.disconnectedRecently()) {\n logger.log(`ConnectionMonitor skipping reopening recent disconnect. time disconnected = ${secondsSince(this.disconnectedAt)} s`)\n } else {\n logger.log(\"ConnectionMonitor reopening\")\n this.connection.reopen()\n }\n }\n }\n\n get refreshedAt() {\n return this.pingedAt ? this.pingedAt : this.startedAt\n }\n\n connectionIsStale() {\n return secondsSince(this.refreshedAt) > this.constructor.staleThreshold\n }\n\n disconnectedRecently() {\n return this.disconnectedAt && (secondsSince(this.disconnectedAt) < this.constructor.staleThreshold)\n }\n\n visibilityDidChange() {\n if (document.visibilityState === \"visible\") {\n setTimeout(() => {\n if (this.connectionIsStale() || !this.connection.isOpen()) {\n logger.log(`ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = ${document.visibilityState}`)\n this.connection.reopen()\n }\n }\n , 200)\n }\n }\n\n}\n\nConnectionMonitor.staleThreshold = 6 // Server::Connections::BEAT_INTERVAL * 2 (missed two pings)\nConnectionMonitor.reconnectionBackoffRate = 0.15\n\nexport default ConnectionMonitor\n", "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\": [\n \"actioncable-v1-json\",\n \"actioncable-unsupported\"\n ]\n}\n", "import adapters from \"./adapters\"\nimport ConnectionMonitor from \"./connection_monitor\"\nimport INTERNAL from \"./internal\"\nimport logger from \"./logger\"\n\n// Encapsulate the cable connection held by the consumer. This is an internal class not intended for direct user manipulation.\n\nconst {message_types, protocols} = INTERNAL\nconst supportedProtocols = protocols.slice(0, protocols.length - 1)\n\nconst indexOf = [].indexOf\n\nclass Connection {\n constructor(consumer) {\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 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 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 if (this.webSocket) { this.uninstallEventHandlers() }\n this.webSocket = new adapters.WebSocket(this.consumer.url, protocols)\n this.installEventHandlers()\n this.monitor.start()\n return true\n }\n }\n\n close({allowReconnect} = {allowReconnect: true}) {\n if (!allowReconnect) { this.monitor.stop() }\n // Avoid closing websockets in a \"connecting\" state due to Safari 15.1+ bug. See: https://github.com/rails/rails/issues/43835#issuecomment-1002288478\n if (this.isOpen()) {\n return this.webSocket.close()\n }\n }\n\n reopen() {\n logger.log(`Reopening WebSocket, current state is ${this.getState()}`)\n if (this.isActive()) {\n try {\n return this.close()\n } catch (error) {\n logger.log(\"Failed to reopen WebSocket\", error)\n }\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 getProtocol() {\n if (this.webSocket) {\n return this.webSocket.protocol\n }\n }\n\n isOpen() {\n return this.isState(\"open\")\n }\n\n isActive() {\n return this.isState(\"open\", \"connecting\")\n }\n\n // Private\n\n isProtocolSupported() {\n return indexOf.call(supportedProtocols, this.getProtocol()) >= 0\n }\n\n isState(...states) {\n return indexOf.call(states, this.getState()) >= 0\n }\n\n getState() {\n if (this.webSocket) {\n for (let state in adapters.WebSocket) {\n if (adapters.WebSocket[state] === this.webSocket.readyState) {\n return state.toLowerCase()\n }\n }\n }\n return null\n }\n\n installEventHandlers() {\n for (let eventName in this.events) {\n const handler = this.events[eventName].bind(this)\n this.webSocket[`on${eventName}`] = handler\n }\n }\n\n uninstallEventHandlers() {\n for (let eventName in this.events) {\n this.webSocket[`on${eventName}`] = function() {}\n }\n }\n\n}\n\nConnection.reopenDelay = 500\n\nConnection.prototype.events = {\n message(event) {\n if (!this.isProtocolSupported()) { return }\n const {identifier, message, reason, reconnect, type} = JSON.parse(event.data)\n switch (type) {\n case message_types.welcome:\n this.monitor.recordConnect()\n return this.subscriptions.reload()\n case message_types.disconnect:\n logger.log(`Disconnecting. Reason: ${reason}`)\n return this.close({allowReconnect: reconnect})\n case message_types.ping:\n return this.monitor.recordPing()\n case message_types.confirmation:\n this.subscriptions.confirmSubscription(identifier)\n return this.subscriptions.notify(identifier, \"connected\")\n case message_types.rejection:\n return this.subscriptions.reject(identifier)\n default:\n return this.subscriptions.notify(identifier, \"received\", message)\n }\n },\n\n open() {\n logger.log(`WebSocket onopen event, using '${this.getProtocol()}' subprotocol`)\n this.disconnected = false\n if (!this.isProtocolSupported()) {\n logger.log(\"Protocol is unsupported. Stopping monitor and disconnecting.\")\n return this.close({allowReconnect: false})\n }\n },\n\n close(event) {\n logger.log(\"WebSocket onclose event\")\n if (this.disconnected) { return }\n this.disconnected = true\n this.monitor.recordDisconnect()\n return this.subscriptions.notifyAll(\"disconnected\", {willAttemptReconnect: this.monitor.isRunning()})\n },\n\n error() {\n logger.log(\"WebSocket onerror event\")\n }\n}\n\nexport default Connection\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.\n\nconst extend = function(object, properties) {\n if (properties != null) {\n for (let key in properties) {\n const value = properties[key]\n object[key] = value\n }\n }\n return object\n}\n\nexport default class Subscription {\n constructor(consumer, params = {}, mixin) {\n this.consumer = consumer\n this.identifier = JSON.stringify(params)\n extend(this, mixin)\n }\n\n // Perform a channel action with the optional data passed as an attribute\n perform(action, data = {}) {\n data.action = action\n return this.send(data)\n }\n\n send(data) {\n return this.consumer.send({command: \"message\", identifier: this.identifier, data: JSON.stringify(data)})\n }\n\n unsubscribe() {\n return this.consumer.subscriptions.remove(this)\n }\n}\n", "import logger from \"./logger\"\n\n// Responsible for ensuring channel subscribe command is confirmed, retrying until confirmation is received.\n// Internal class, not intended for direct user manipulation.\n\nclass SubscriptionGuarantor {\n constructor(subscriptions) {\n this.subscriptions = subscriptions\n this.pendingSubscriptions = []\n }\n\n guarantee(subscription) {\n if(this.pendingSubscriptions.indexOf(subscription) == -1){ \n logger.log(`SubscriptionGuarantor guaranteeing ${subscription.identifier}`)\n this.pendingSubscriptions.push(subscription) \n }\n else {\n logger.log(`SubscriptionGuarantor already guaranteeing ${subscription.identifier}`)\n }\n this.startGuaranteeing()\n }\n\n forget(subscription) {\n logger.log(`SubscriptionGuarantor forgetting ${subscription.identifier}`)\n this.pendingSubscriptions = (this.pendingSubscriptions.filter((s) => s !== subscription))\n }\n\n startGuaranteeing() {\n this.stopGuaranteeing()\n this.retrySubscribing()\n }\n \n stopGuaranteeing() {\n clearTimeout(this.retryTimeout)\n }\n\n retrySubscribing() {\n this.retryTimeout = setTimeout(() => {\n if (this.subscriptions && typeof(this.subscriptions.subscribe) === \"function\") {\n this.pendingSubscriptions.map((subscription) => {\n logger.log(`SubscriptionGuarantor resubscribing ${subscription.identifier}`)\n this.subscriptions.subscribe(subscription)\n })\n }\n }\n , 500)\n }\n}\n\nexport default SubscriptionGuarantor", "import Subscription from \"./subscription\"\nimport SubscriptionGuarantor from \"./subscription_guarantor\"\nimport logger from \"./logger\"\n\n// 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\nexport default class Subscriptions {\n constructor(consumer) {\n this.consumer = consumer\n this.guarantor = new SubscriptionGuarantor(this)\n this.subscriptions = []\n }\n\n create(channelName, mixin) {\n const channel = channelName\n const params = typeof channel === \"object\" ? channel : {channel}\n const subscription = new Subscription(this.consumer, params, mixin)\n return this.add(subscription)\n }\n\n // Private\n\n add(subscription) {\n this.subscriptions.push(subscription)\n this.consumer.ensureActiveConnection()\n this.notify(subscription, \"initialized\")\n this.subscribe(subscription)\n return subscription\n }\n\n remove(subscription) {\n this.forget(subscription)\n if (!this.findAll(subscription.identifier).length) {\n this.sendCommand(subscription, \"unsubscribe\")\n }\n return subscription\n }\n\n reject(identifier) {\n return this.findAll(identifier).map((subscription) => {\n this.forget(subscription)\n this.notify(subscription, \"rejected\")\n return subscription\n })\n }\n\n forget(subscription) {\n this.guarantor.forget(subscription)\n this.subscriptions = (this.subscriptions.filter((s) => s !== subscription))\n return subscription\n }\n\n findAll(identifier) {\n return this.subscriptions.filter((s) => s.identifier === identifier)\n }\n\n reload() {\n return this.subscriptions.map((subscription) =>\n this.subscribe(subscription))\n }\n\n notifyAll(callbackName, ...args) {\n return this.subscriptions.map((subscription) =>\n this.notify(subscription, callbackName, ...args))\n }\n\n notify(subscription, callbackName, ...args) {\n let subscriptions\n if (typeof subscription === \"string\") {\n subscriptions = this.findAll(subscription)\n } else {\n subscriptions = [subscription]\n }\n\n return subscriptions.map((subscription) =>\n (typeof subscription[callbackName] === \"function\" ? subscription[callbackName](...args) : undefined))\n }\n\n subscribe(subscription) {\n if (this.sendCommand(subscription, \"subscribe\")) {\n this.guarantor.guarantee(subscription)\n }\n }\n\n confirmSubscription(identifier) {\n logger.log(`Subscription confirmed ${identifier}`)\n this.findAll(identifier).map((subscription) =>\n this.guarantor.forget(subscription))\n }\n\n sendCommand(subscription, command) {\n const {identifier} = subscription\n return this.consumer.send({command, identifier})\n }\n}\n", "import Connection from \"./connection\"\nimport Subscriptions from \"./subscriptions\"\n\n// 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\nexport default class Consumer {\n constructor(url) {\n this._url = url\n this.subscriptions = new Subscriptions(this)\n this.connection = new Connection(this)\n }\n\n get url() {\n return createWebSocketURL(this._url)\n }\n\n send(data) {\n return this.connection.send(data)\n }\n\n connect() {\n return this.connection.open()\n }\n\n disconnect() {\n return this.connection.close({allowReconnect: false})\n }\n\n ensureActiveConnection() {\n if (!this.connection.isActive()) {\n return this.connection.open()\n }\n }\n}\n\nexport function createWebSocketURL(url) {\n if (typeof url === \"function\") {\n url = url()\n }\n\n if (url && !/^wss?:/i.test(url)) {\n const a = document.createElement(\"a\")\n a.href = url\n // Fix populating Location properties in IE. Otherwise, protocol will be blank.\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", "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 SubscriptionGuarantor from \"./subscription_guarantor\"\nimport adapters from \"./adapters\"\nimport logger from \"./logger\"\n\nexport {\n Connection,\n ConnectionMonitor,\n Consumer,\n INTERNAL,\n Subscription,\n Subscriptions,\n SubscriptionGuarantor,\n adapters,\n createWebSocketURL,\n logger,\n}\n\nexport function createConsumer(url = getConfig(\"url\") || INTERNAL.default_mount_path) {\n return new Consumer(url)\n}\n\nexport function getConfig(name) {\n const element = document.head.querySelector(`meta[name='action-cable-${name}']`)\n if (element) {\n return element.getAttribute(\"content\")\n }\n}\n", "function _classPrivateFieldLooseBase(e, t) { if (!{}.hasOwnProperty.call(e, t)) throw new TypeError(\"attempted to use private field on non-instance\"); return e; }\nvar id = 0;\nfunction _classPrivateFieldLooseKey(e) { return \"__private_\" + id++ + \"_\" + e; }\n// We're using a generic because languages have different plural rules.\n\n// eslint-disable-next-line no-use-before-define\n\nfunction insertReplacement(source, rx, replacement) {\n const newParts = [];\n source.forEach(chunk => {\n // When the source contains multiple placeholders for interpolation,\n // we should ignore chunks that are not strings, because those\n // can be JSX objects and will be otherwise incorrectly turned into strings.\n // Without this condition we\u2019d get this: [object Object] hello [object Object] my