{"version":3,"sources":["node_modules/sockjs-client/lib/utils/browser-crypto.js","node_modules/sockjs-client/lib/utils/random.js","node_modules/sockjs-client/lib/utils/event.js","node_modules/requires-port/index.js","node_modules/querystringify/index.js","node_modules/url-parse/index.js","node_modules/sockjs-client/lib/utils/url.js","node_modules/inherits/inherits_browser.js","node_modules/sockjs-client/lib/event/eventtarget.js","node_modules/sockjs-client/lib/event/emitter.js","node_modules/sockjs-client/lib/transport/browser/websocket.js","node_modules/sockjs-client/lib/transport/websocket.js","node_modules/sockjs-client/lib/transport/lib/buffered-sender.js","node_modules/sockjs-client/lib/transport/lib/polling.js","node_modules/sockjs-client/lib/transport/lib/sender-receiver.js","node_modules/sockjs-client/lib/transport/lib/ajax-based.js","node_modules/sockjs-client/lib/transport/receiver/xhr.js","node_modules/sockjs-client/lib/transport/browser/abstract-xhr.js","node_modules/sockjs-client/lib/transport/sender/xhr-cors.js","node_modules/sockjs-client/lib/transport/sender/xhr-local.js","node_modules/sockjs-client/lib/utils/browser.js","node_modules/sockjs-client/lib/transport/xhr-streaming.js","node_modules/sockjs-client/lib/transport/sender/xdr.js","node_modules/sockjs-client/lib/transport/xdr-streaming.js","node_modules/sockjs-client/lib/transport/browser/eventsource.js","node_modules/sockjs-client/lib/transport/receiver/eventsource.js","node_modules/sockjs-client/lib/transport/eventsource.js","node_modules/sockjs-client/lib/version.js","node_modules/sockjs-client/lib/utils/iframe.js","node_modules/sockjs-client/lib/transport/iframe.js","node_modules/sockjs-client/lib/utils/object.js","node_modules/sockjs-client/lib/transport/lib/iframe-wrap.js","node_modules/sockjs-client/lib/transport/receiver/htmlfile.js","node_modules/sockjs-client/lib/transport/htmlfile.js","node_modules/sockjs-client/lib/transport/xhr-polling.js","node_modules/sockjs-client/lib/transport/xdr-polling.js","node_modules/sockjs-client/lib/transport/receiver/jsonp.js","node_modules/sockjs-client/lib/transport/sender/jsonp.js","node_modules/sockjs-client/lib/transport/jsonp-polling.js","node_modules/sockjs-client/lib/transport-list.js","node_modules/sockjs-client/lib/shims.js","node_modules/sockjs-client/lib/utils/escape.js","node_modules/sockjs-client/lib/utils/transport.js","node_modules/sockjs-client/lib/utils/log.js","node_modules/sockjs-client/lib/event/event.js","node_modules/sockjs-client/lib/location.js","node_modules/sockjs-client/lib/event/close.js","node_modules/sockjs-client/lib/event/trans-message.js","node_modules/sockjs-client/lib/transport/sender/xhr-fake.js","node_modules/sockjs-client/lib/info-ajax.js","node_modules/sockjs-client/lib/info-iframe-receiver.js","node_modules/sockjs-client/lib/info-iframe.js","node_modules/sockjs-client/lib/info-receiver.js","node_modules/sockjs-client/lib/facade.js","node_modules/sockjs-client/lib/iframe-bootstrap.js","node_modules/sockjs-client/lib/main.js","node_modules/sockjs-client/lib/entry.js","node_modules/@angular/core/fesm2022/primitives/signals.mjs","node_modules/rxjs/dist/esm/internal/util/isFunction.js","node_modules/rxjs/dist/esm/internal/util/createErrorClass.js","node_modules/rxjs/dist/esm/internal/util/UnsubscriptionError.js","node_modules/rxjs/dist/esm/internal/util/arrRemove.js","node_modules/rxjs/dist/esm/internal/Subscription.js","node_modules/rxjs/dist/esm/internal/config.js","node_modules/rxjs/dist/esm/internal/scheduler/timeoutProvider.js","node_modules/rxjs/dist/esm/internal/util/reportUnhandledError.js","node_modules/rxjs/dist/esm/internal/util/noop.js","node_modules/rxjs/dist/esm/internal/NotificationFactories.js","node_modules/rxjs/dist/esm/internal/util/errorContext.js","node_modules/rxjs/dist/esm/internal/Subscriber.js","node_modules/rxjs/dist/esm/internal/symbol/observable.js","node_modules/rxjs/dist/esm/internal/util/identity.js","node_modules/rxjs/dist/esm/internal/util/pipe.js","node_modules/rxjs/dist/esm/internal/Observable.js","node_modules/rxjs/dist/esm/internal/util/lift.js","node_modules/rxjs/dist/esm/internal/operators/OperatorSubscriber.js","node_modules/rxjs/dist/esm/internal/operators/refCount.js","node_modules/rxjs/dist/esm/internal/observable/ConnectableObservable.js","node_modules/rxjs/dist/esm/internal/util/ObjectUnsubscribedError.js","node_modules/rxjs/dist/esm/internal/Subject.js","node_modules/rxjs/dist/esm/internal/BehaviorSubject.js","node_modules/rxjs/dist/esm/internal/scheduler/dateTimestampProvider.js","node_modules/rxjs/dist/esm/internal/scheduler/Action.js","node_modules/rxjs/dist/esm/internal/scheduler/intervalProvider.js","node_modules/rxjs/dist/esm/internal/scheduler/AsyncAction.js","node_modules/rxjs/dist/esm/internal/Scheduler.js","node_modules/rxjs/dist/esm/internal/scheduler/AsyncScheduler.js","node_modules/rxjs/dist/esm/internal/scheduler/async.js","node_modules/rxjs/dist/esm/internal/observable/empty.js","node_modules/rxjs/dist/esm/internal/util/isScheduler.js","node_modules/rxjs/dist/esm/internal/util/args.js","node_modules/tslib/tslib.es6.mjs","node_modules/rxjs/dist/esm/internal/util/isArrayLike.js","node_modules/rxjs/dist/esm/internal/util/isPromise.js","node_modules/rxjs/dist/esm/internal/util/isInteropObservable.js","node_modules/rxjs/dist/esm/internal/util/isAsyncIterable.js","node_modules/rxjs/dist/esm/internal/util/throwUnobservableError.js","node_modules/rxjs/dist/esm/internal/symbol/iterator.js","node_modules/rxjs/dist/esm/internal/util/isIterable.js","node_modules/rxjs/dist/esm/internal/util/isReadableStreamLike.js","node_modules/rxjs/dist/esm/internal/observable/innerFrom.js","node_modules/rxjs/dist/esm/internal/util/executeSchedule.js","node_modules/rxjs/dist/esm/internal/operators/observeOn.js","node_modules/rxjs/dist/esm/internal/operators/subscribeOn.js","node_modules/rxjs/dist/esm/internal/scheduled/scheduleObservable.js","node_modules/rxjs/dist/esm/internal/scheduled/schedulePromise.js","node_modules/rxjs/dist/esm/internal/scheduled/scheduleArray.js","node_modules/rxjs/dist/esm/internal/scheduled/scheduleIterable.js","node_modules/rxjs/dist/esm/internal/scheduled/scheduleAsyncIterable.js","node_modules/rxjs/dist/esm/internal/scheduled/scheduleReadableStreamLike.js","node_modules/rxjs/dist/esm/internal/scheduled/scheduled.js","node_modules/rxjs/dist/esm/internal/observable/from.js","node_modules/rxjs/dist/esm/internal/observable/of.js","node_modules/rxjs/dist/esm/internal/observable/throwError.js","node_modules/rxjs/dist/esm/internal/util/isObservable.js","node_modules/rxjs/dist/esm/internal/util/EmptyError.js","node_modules/rxjs/dist/esm/internal/firstValueFrom.js","node_modules/rxjs/dist/esm/internal/util/isDate.js","node_modules/rxjs/dist/esm/internal/operators/map.js","node_modules/rxjs/dist/esm/internal/util/mapOneOrManyArgs.js","node_modules/rxjs/dist/esm/internal/util/argsArgArrayOrObject.js","node_modules/rxjs/dist/esm/internal/util/createObject.js","node_modules/rxjs/dist/esm/internal/observable/combineLatest.js","node_modules/rxjs/dist/esm/internal/operators/mergeInternals.js","node_modules/rxjs/dist/esm/internal/operators/mergeMap.js","node_modules/rxjs/dist/esm/internal/operators/mergeAll.js","node_modules/rxjs/dist/esm/internal/operators/concatAll.js","node_modules/rxjs/dist/esm/internal/observable/concat.js","node_modules/rxjs/dist/esm/internal/observable/defer.js","node_modules/rxjs/dist/esm/internal/observable/forkJoin.js","node_modules/rxjs/dist/esm/internal/observable/fromEvent.js","node_modules/rxjs/dist/esm/internal/observable/timer.js","node_modules/rxjs/dist/esm/internal/observable/merge.js","node_modules/rxjs/dist/esm/internal/util/argsOrArgArray.js","node_modules/rxjs/dist/esm/internal/operators/filter.js","node_modules/rxjs/dist/esm/internal/observable/race.js","node_modules/rxjs/dist/esm/internal/observable/zip.js","node_modules/rxjs/dist/esm/internal/operators/catchError.js","node_modules/rxjs/dist/esm/internal/operators/scanInternals.js","node_modules/rxjs/dist/esm/internal/operators/concatMap.js","node_modules/rxjs/dist/esm/internal/operators/debounceTime.js","node_modules/rxjs/dist/esm/internal/operators/defaultIfEmpty.js","node_modules/rxjs/dist/esm/internal/operators/take.js","node_modules/rxjs/dist/esm/internal/operators/ignoreElements.js","node_modules/rxjs/dist/esm/internal/operators/mapTo.js","node_modules/rxjs/dist/esm/internal/operators/delayWhen.js","node_modules/rxjs/dist/esm/internal/operators/delay.js","node_modules/rxjs/dist/esm/internal/operators/distinctUntilChanged.js","node_modules/rxjs/dist/esm/internal/operators/throwIfEmpty.js","node_modules/rxjs/dist/esm/internal/operators/endWith.js","node_modules/rxjs/dist/esm/internal/operators/expand.js","node_modules/rxjs/dist/esm/internal/operators/finalize.js","node_modules/rxjs/dist/esm/internal/operators/first.js","node_modules/rxjs/dist/esm/internal/operators/takeLast.js","node_modules/rxjs/dist/esm/internal/operators/last.js","node_modules/rxjs/dist/esm/internal/operators/scan.js","node_modules/rxjs/dist/esm/internal/operators/share.js","node_modules/rxjs/dist/esm/internal/operators/startWith.js","node_modules/rxjs/dist/esm/internal/operators/switchMap.js","node_modules/rxjs/dist/esm/internal/operators/takeUntil.js","node_modules/rxjs/dist/esm/internal/operators/tap.js","node_modules/rxjs/dist/esm/internal/operators/withLatestFrom.js","node_modules/@angular/core/fesm2022/core.mjs","node_modules/@angular/common/fesm2022/common.mjs","node_modules/@angular/common/fesm2022/http.mjs","node_modules/@angular/platform-browser/fesm2022/platform-browser.mjs","node_modules/@angular/router/fesm2022/router.mjs","node_modules/@angular/core/fesm2022/rxjs-interop.mjs","node_modules/@angular/animations/fesm2022/animations.mjs","node_modules/@angular/forms/fesm2022/forms.mjs","node_modules/@popperjs/core/lib/enums.js","node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","node_modules/@popperjs/core/lib/dom-utils/getWindow.js","node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","node_modules/@popperjs/core/lib/modifiers/applyStyles.js","node_modules/@popperjs/core/lib/utils/getBasePlacement.js","node_modules/@popperjs/core/lib/utils/math.js","node_modules/@popperjs/core/lib/utils/userAgent.js","node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js","node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","node_modules/@popperjs/core/lib/dom-utils/contains.js","node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","node_modules/@popperjs/core/lib/utils/within.js","node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","node_modules/@popperjs/core/lib/utils/expandToHashMap.js","node_modules/@popperjs/core/lib/modifiers/arrow.js","node_modules/@popperjs/core/lib/utils/getVariation.js","node_modules/@popperjs/core/lib/modifiers/computeStyles.js","node_modules/@popperjs/core/lib/modifiers/eventListeners.js","node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","node_modules/@popperjs/core/lib/utils/rectToClientRect.js","node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","node_modules/@popperjs/core/lib/utils/computeOffsets.js","node_modules/@popperjs/core/lib/utils/detectOverflow.js","node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","node_modules/@popperjs/core/lib/modifiers/flip.js","node_modules/@popperjs/core/lib/modifiers/offset.js","node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","node_modules/@popperjs/core/lib/utils/getAltAxis.js","node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","node_modules/@popperjs/core/lib/utils/orderModifiers.js","node_modules/@popperjs/core/lib/utils/debounce.js","node_modules/@popperjs/core/lib/utils/mergeByName.js","node_modules/@popperjs/core/lib/createPopper.js","node_modules/@popperjs/core/lib/popper-lite.js","node_modules/@ng-bootstrap/ng-bootstrap/fesm2022/ng-bootstrap.mjs","node_modules/@stomp/rx-stomp/esm6/rx-stomp-config.js","node_modules/@stomp/stompjs/esm6/byte.js","node_modules/@stomp/stompjs/esm6/frame-impl.js","node_modules/@stomp/stompjs/esm6/parser.js","node_modules/@stomp/stompjs/esm6/types.js","node_modules/@stomp/stompjs/esm6/versions.js","node_modules/@stomp/stompjs/esm6/augment-websocket.js","node_modules/@stomp/stompjs/esm6/stomp-handler.js","node_modules/@stomp/stompjs/esm6/client.js","node_modules/@stomp/rx-stomp/esm6/rx-stomp-state.js","node_modules/@stomp/rx-stomp/esm6/rx-stomp.js","node_modules/@forgerock/backstage-ui-core/fesm2022/forgerock-backstage-ui-core.mjs","node_modules/@forgerock/backstage-ui-components/fesm2022/forgerock-backstage-ui-components.mjs","src/app/model/issue-constants.ts","src/app/model/everything-search-params.ts","src/app/everything-search.service.ts","src/app/issue-watch.service.ts","src/app/issue.service.ts","src/app/model/issue-watch-state.ts","src/app/model/search-constants.ts","src/app/model/search-filter-name.ts","src/app/page/issue-details-page/issue-details-page.component.ts","src/app/page/issue-details-page/issue-details-page.component.html","src/app/model/tabs.ts","src/app/model/app-search-params.ts","src/app/model/product-path-keys.ts","src/app/search-product-tree.service.ts","src/app/search-params/search-params-mapper.service.ts","src/app/search-params/search-params-adapter.service.ts","src/app/utils/multi-comparator.ts","src/app/utils/key-value-count.ts","src/app/pipe/aggregation-key-value.pipe.ts","src/app/tab/tab.service.ts","src/app/search-params/search-params-container/search-params-container.component.ts","src/app/search-params/search-params-container/search-params-container.component.html","src/app/search-params/search-filter-pagination/search-filter-pagination.component.ts","src/app/search-params/search-filter-pagination/search-filter-pagination.component.html","src/app/pipe/source.pipe.ts","src/app/search-result/search-result-snippet/search-result-snippet.component.ts","src/app/search-result/search-result-snippet/search-result-snippet.component.html","src/app/pipe/truthy.pipe.ts","src/app/utils/crumb/crumb.component.ts","src/app/utils/crumb/crumb.component.html","src/app/search-result-link.directive.ts","src/app/search-result/search-result/search-result.component.ts","src/app/search-result/search-result/search-result.component.html","src/app/search-result/search-result-generic/search-result-generic.component.ts","src/app/search-result/search-result-generic/search-result-generic.component.html","src/app/doc.service.ts","src/app/pipe/product-name.pipe.ts","src/app/search-result/search-result-doc/search-result-doc.component.ts","src/app/search-result/search-result-doc/search-result-doc.component.html","src/app/library.service.ts","src/app/pipe/library-name.pipe.ts","src/app/search-result/search-result-book/search-result-book.component.ts","src/app/search-result/search-result-book/search-result-book.component.html","src/app/search-result/search-result-article/search-result-article.component.ts","src/app/search-result/search-result-article/search-result-article.component.html","src/app/search-result/search-result-knowledge/search-result-knowledge.component.ts","src/app/search-result/search-result-knowledge/search-result-knowledge.component.html","src/app/search-result/search-result-issue/search-result-issue.component.ts","src/app/search-result/search-result-issue/search-result-issue.component.html","src/app/pipe/discourse-resource-url.pipe.ts","src/app/pipe/discourse-category-url.pipe.ts","src/app/pipe/discourse-profile-url.pipe.ts","src/app/pipe/discourse-avatar-url.pipe.ts","src/app/utils/avatar/avatar.component.ts","src/app/utils/avatar/avatar.component.html","src/app/search-result/search-result-date-user/search-result-date-user.component.ts","src/app/search-result/search-result-date-user/search-result-date-user.component.html","src/app/search-result/search-result-community-discussion/search-result-community-discussion.component.ts","src/app/search-result/search-result-community-discussion/search-result-community-discussion.component.html","src/app/search-result/search-result-marketplace-entry/search-result-marketplace-entry.component.ts","src/app/search-result/search-result-marketplace-entry/search-result-marketplace-entry.component.html","src/app/search-result/search-result-download-meta/search-result-download-meta.component.ts","src/app/search-result/search-result-download-meta/search-result-download-meta.component.html","src/app/pipe/university-learning-path-url.pipe.ts","src/app/pipe/entity-type.pipe.ts","src/app/search-result/search-result-card/search-result-card.component.ts","src/app/search-result/search-result-card/search-result-card.component.html","src/app/search-result/search-result-cloud-learning-content/search-result-workbook/search-result-workbook.component.ts","src/app/search-result/search-result-cloud-learning-content/search-result-workbook/search-result-workbook.component.html","src/app/search-result/search-result-cloud-learning-content/search-result-exercise/search-result-exercise.component.ts","src/app/search-result/search-result-cloud-learning-content/search-result-exercise/search-result-exercise.component.html","src/app/search-result/search-result-cloud-learning-content/search-result-chapter/search-result-chapter.component.ts","src/app/search-result/search-result-cloud-learning-content/search-result-chapter/search-result-chapter.component.html","src/app/search-result/search-result-cloud-learning-content/search-result-path/search-result-path.component.ts","src/app/search-result/search-result-cloud-learning-content/search-result-path/search-result-path.component.html","src/app/search-result/search-result-video/search-result-video.component.ts","src/app/search-result/search-result-video/search-result-video.component.html","src/app/search-result/search-result-wrapper/search-result-wrapper.component.ts","src/app/search-result/search-result-wrapper/search-result-wrapper.component.html","src/app/tab/tab-section/tab-section.component.ts","src/app/tab/tab-section/tab-section.component.html","src/app/tab/tab/tab.component.ts","src/app/tab/tab/tab.component.html","src/app/search-result/search-hit-count/search-hit-count.component.ts","src/app/search-result/search-hit-count/search-hit-count.component.html","src/app/search-params/search-params-sort/search-params-sort.component.ts","src/app/search-params/search-params-sort/search-params-sort.component.html","src/app/layout/layout-tab-container/layout-tab-container.component.ts","src/app/layout/layout-tab-container/layout-tab-container.component.html","src/app/layout/layout-tab/layout-tab.component.ts","src/app/layout/layout-tab/layout-tab.component.html","src/app/pipe/html-decode.pipe.ts","src/app/search-params/search-filter-value-list/search-filter-value-list.component.ts","src/app/search-params/search-filter-value-list/search-filter-value-list.component.html","src/app/search-params/search-filter-library/search-filter-library.component.ts","src/app/search-params/search-filter-library/search-filter-library.component.html","src/app/search-params/search-filter-entity-type/search-filter-entity-type.component.ts","src/app/search-params/search-filter-entity-type/search-filter-entity-type.component.html","src/app/input/tree-item-badge/tree-item-badge.component.ts","src/app/input/tree-item-badge/tree-item-badge.component.html","src/app/input/tree-item/tree-item.component.ts","src/app/input/tree-item/tree-item.component.html","src/app/input/tree/tree.component.ts","src/app/input/tree/tree.component.html","src/app/search-params/search-filter-product/search-filter-product.component.ts","src/app/search-params/search-filter-product/search-filter-product.component.html","src/app/search-params/search-filter-source/search-filter-source.component.ts","src/app/search-params/search-filter-source/search-filter-source.component.html","src/app/layout/layout-hidden-on-mobile/layout-hidden-on-mobile.component.ts","src/app/layout/layout-hidden-on-mobile/layout-hidden-on-mobile.component.html","src/app/pipe/product-version-path.pipe.ts","src/app/search-params/search-filter-chips/search-filter-chips.component.ts","src/app/search-params/search-filter-chips/search-filter-chips.component.html","src/app/search-params/did-you-mean/did-you-mean.component.ts","src/app/search-params/did-you-mean/did-you-mean.component.html","src/app/model/everything-search-result.ts","src/app/everything-autocomplete-search.service.ts","src/app/search-params/search-filter-query/search-filter-query.component.ts","src/app/search-params/search-filter-query/search-filter-query.component.html","src/app/page/search-page/search-page.component.ts","src/app/page/search-page/search-page.component.html","src/environments/environment.prod.ts","src/app/app.component.ts","src/app/app.component.html","node_modules/@angular/animations/fesm2022/browser.mjs","node_modules/@angular/platform-browser/fesm2022/animations.mjs","src/main.ts"],"sourcesContent":["'use strict';\n\nif (global.crypto && global.crypto.getRandomValues) {\n module.exports.randomBytes = function (length) {\n var bytes = new Uint8Array(length);\n global.crypto.getRandomValues(bytes);\n return bytes;\n };\n} else {\n module.exports.randomBytes = function (length) {\n var bytes = new Array(length);\n for (var i = 0; i < length; i++) {\n bytes[i] = Math.floor(Math.random() * 256);\n }\n return bytes;\n };\n}","'use strict';\n\nvar crypto = require('crypto');\n\n// This string has length 32, a power of 2, so the modulus doesn't introduce a\n// bias.\nvar _randomStringChars = 'abcdefghijklmnopqrstuvwxyz012345';\nmodule.exports = {\n string: function (length) {\n var max = _randomStringChars.length;\n var bytes = crypto.randomBytes(length);\n var ret = [];\n for (var i = 0; i < length; i++) {\n ret.push(_randomStringChars.substr(bytes[i] % max, 1));\n }\n return ret.join('');\n },\n number: function (max) {\n return Math.floor(Math.random() * max);\n },\n numberString: function (max) {\n var t = ('' + (max - 1)).length;\n var p = new Array(t + 1).join('0');\n return (p + this.number(max)).slice(-t);\n }\n};","'use strict';\n\nvar random = require('./random');\nvar onUnload = {},\n afterUnload = false\n // detect google chrome packaged apps because they don't allow the 'unload' event\n ,\n isChromePackagedApp = global.chrome && global.chrome.app && global.chrome.app.runtime;\nmodule.exports = {\n attachEvent: function (event, listener) {\n if (typeof global.addEventListener !== 'undefined') {\n global.addEventListener(event, listener, false);\n } else if (global.document && global.attachEvent) {\n // IE quirks.\n // According to: http://stevesouders.com/misc/test-postmessage.php\n // the message gets delivered only to 'document', not 'window'.\n global.document.attachEvent('on' + event, listener);\n // I get 'window' for ie8.\n global.attachEvent('on' + event, listener);\n }\n },\n detachEvent: function (event, listener) {\n if (typeof global.addEventListener !== 'undefined') {\n global.removeEventListener(event, listener, false);\n } else if (global.document && global.detachEvent) {\n global.document.detachEvent('on' + event, listener);\n global.detachEvent('on' + event, listener);\n }\n },\n unloadAdd: function (listener) {\n if (isChromePackagedApp) {\n return null;\n }\n var ref = random.string(8);\n onUnload[ref] = listener;\n if (afterUnload) {\n setTimeout(this.triggerUnloadCallbacks, 0);\n }\n return ref;\n },\n unloadDel: function (ref) {\n if (ref in onUnload) {\n delete onUnload[ref];\n }\n },\n triggerUnloadCallbacks: function () {\n for (var ref in onUnload) {\n onUnload[ref]();\n delete onUnload[ref];\n }\n }\n};\nvar unloadTriggered = function () {\n if (afterUnload) {\n return;\n }\n afterUnload = true;\n module.exports.triggerUnloadCallbacks();\n};\n\n// 'unload' alone is not reliable in opera within an iframe, but we\n// can't use `beforeunload` as IE fires it on javascript: links.\nif (!isChromePackagedApp) {\n module.exports.attachEvent('unload', unloadTriggered);\n}","'use strict';\n\n/**\n * Check if we're required to add a port number.\n *\n * @see https://url.spec.whatwg.org/#default-port\n * @param {Number|String} port Port number we need to check\n * @param {String} protocol Protocol we need to check against.\n * @returns {Boolean} Is it a default port for the given protocol\n * @api private\n */\nmodule.exports = function required(port, protocol) {\n protocol = protocol.split(':')[0];\n port = +port;\n if (!port) return false;\n switch (protocol) {\n case 'http':\n case 'ws':\n return port !== 80;\n case 'https':\n case 'wss':\n return port !== 443;\n case 'ftp':\n return port !== 21;\n case 'gopher':\n return port !== 70;\n case 'file':\n return false;\n }\n return port !== 0;\n};","'use strict';\n\nvar has = Object.prototype.hasOwnProperty,\n undef;\n\n/**\n * Decode a URI encoded string.\n *\n * @param {String} input The URI encoded string.\n * @returns {String|Null} The decoded string.\n * @api private\n */\nfunction decode(input) {\n try {\n return decodeURIComponent(input.replace(/\\+/g, ' '));\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Attempts to encode a given input.\n *\n * @param {String} input The string that needs to be encoded.\n * @returns {String|Null} The encoded string.\n * @api private\n */\nfunction encode(input) {\n try {\n return encodeURIComponent(input);\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Simple query string parser.\n *\n * @param {String} query The query string that needs to be parsed.\n * @returns {Object}\n * @api public\n */\nfunction querystring(query) {\n var parser = /([^=?#&]+)=?([^&]*)/g,\n result = {},\n part;\n while (part = parser.exec(query)) {\n var key = decode(part[1]),\n value = decode(part[2]);\n\n //\n // Prevent overriding of existing properties. This ensures that build-in\n // methods like `toString` or __proto__ are not overriden by malicious\n // querystrings.\n //\n // In the case if failed decoding, we want to omit the key/value pairs\n // from the result.\n //\n if (key === null || value === null || key in result) continue;\n result[key] = value;\n }\n return result;\n}\n\n/**\n * Transform a query string to an object.\n *\n * @param {Object} obj Object that should be transformed.\n * @param {String} prefix Optional prefix.\n * @returns {String}\n * @api public\n */\nfunction querystringify(obj, prefix) {\n prefix = prefix || '';\n var pairs = [],\n value,\n key;\n\n //\n // Optionally prefix with a '?' if needed\n //\n if ('string' !== typeof prefix) prefix = '?';\n for (key in obj) {\n if (has.call(obj, key)) {\n value = obj[key];\n\n //\n // Edge cases where we actually want to encode the value to an empty\n // string instead of the stringified value.\n //\n if (!value && (value === null || value === undef || isNaN(value))) {\n value = '';\n }\n key = encode(key);\n value = encode(value);\n\n //\n // If we failed to encode the strings, we should bail out as we don't\n // want to add invalid strings to the query.\n //\n if (key === null || value === null) continue;\n pairs.push(key + '=' + value);\n }\n }\n return pairs.length ? prefix + pairs.join('&') : '';\n}\n\n//\n// Expose the module.\n//\nexports.stringify = querystringify;\nexports.parse = querystring;","'use strict';\n\nvar required = require('requires-port'),\n qs = require('querystringify'),\n controlOrWhitespace = /^[\\x00-\\x20\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]+/,\n CRHTLF = /[\\n\\r\\t]/g,\n slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\\/\\//,\n port = /:\\d+$/,\n protocolre = /^([a-z][a-z0-9.+-]*:)?(\\/\\/)?([\\\\/]+)?([\\S\\s]*)/i,\n windowsDriveLetter = /^[a-zA-Z]:/;\n\n/**\n * Remove control characters and whitespace from the beginning of a string.\n *\n * @param {Object|String} str String to trim.\n * @returns {String} A new string representing `str` stripped of control\n * characters and whitespace from its beginning.\n * @public\n */\nfunction trimLeft(str) {\n return (str ? str : '').toString().replace(controlOrWhitespace, '');\n}\n\n/**\n * These are the parse rules for the URL parser, it informs the parser\n * about:\n *\n * 0. The char it Needs to parse, if it's a string it should be done using\n * indexOf, RegExp using exec and NaN means set as current value.\n * 1. The property we should set when parsing this value.\n * 2. Indication if it's backwards or forward parsing, when set as number it's\n * the value of extra chars that should be split off.\n * 3. Inherit from location if non existing in the parser.\n * 4. `toLowerCase` the resulting value.\n */\nvar rules = [['#', 'hash'],\n// Extract from the back.\n['?', 'query'],\n// Extract from the back.\nfunction sanitize(address, url) {\n // Sanitize what is left of the address\n return isSpecial(url.protocol) ? address.replace(/\\\\/g, '/') : address;\n}, ['/', 'pathname'],\n// Extract from the back.\n['@', 'auth', 1],\n// Extract from the front.\n[NaN, 'host', undefined, 1, 1],\n// Set left over value.\n[/:(\\d*)$/, 'port', undefined, 1],\n// RegExp the back.\n[NaN, 'hostname', undefined, 1, 1] // Set left over.\n];\n\n/**\n * These properties should not be copied or inherited from. This is only needed\n * for all non blob URL's as a blob URL does not include a hash, only the\n * origin.\n *\n * @type {Object}\n * @private\n */\nvar ignore = {\n hash: 1,\n query: 1\n};\n\n/**\n * The location object differs when your code is loaded through a normal page,\n * Worker or through a worker using a blob. And with the blobble begins the\n * trouble as the location object will contain the URL of the blob, not the\n * location of the page where our code is loaded in. The actual origin is\n * encoded in the `pathname` so we can thankfully generate a good \"default\"\n * location from it so we can generate proper relative URL's again.\n *\n * @param {Object|String} loc Optional default location object.\n * @returns {Object} lolcation object.\n * @public\n */\nfunction lolcation(loc) {\n var globalVar;\n if (typeof window !== 'undefined') globalVar = window;else if (typeof global !== 'undefined') globalVar = global;else if (typeof self !== 'undefined') globalVar = self;else globalVar = {};\n var location = globalVar.location || {};\n loc = loc || location;\n var finaldestination = {},\n type = typeof loc,\n key;\n if ('blob:' === loc.protocol) {\n finaldestination = new Url(unescape(loc.pathname), {});\n } else if ('string' === type) {\n finaldestination = new Url(loc, {});\n for (key in ignore) delete finaldestination[key];\n } else if ('object' === type) {\n for (key in loc) {\n if (key in ignore) continue;\n finaldestination[key] = loc[key];\n }\n if (finaldestination.slashes === undefined) {\n finaldestination.slashes = slashes.test(loc.href);\n }\n }\n return finaldestination;\n}\n\n/**\n * Check whether a protocol scheme is special.\n *\n * @param {String} The protocol scheme of the URL\n * @return {Boolean} `true` if the protocol scheme is special, else `false`\n * @private\n */\nfunction isSpecial(scheme) {\n return scheme === 'file:' || scheme === 'ftp:' || scheme === 'http:' || scheme === 'https:' || scheme === 'ws:' || scheme === 'wss:';\n}\n\n/**\n * @typedef ProtocolExtract\n * @type Object\n * @property {String} protocol Protocol matched in the URL, in lowercase.\n * @property {Boolean} slashes `true` if protocol is followed by \"//\", else `false`.\n * @property {String} rest Rest of the URL that is not part of the protocol.\n */\n\n/**\n * Extract protocol information from a URL with/without double slash (\"//\").\n *\n * @param {String} address URL we want to extract from.\n * @param {Object} location\n * @return {ProtocolExtract} Extracted information.\n * @private\n */\nfunction extractProtocol(address, location) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n location = location || {};\n var match = protocolre.exec(address);\n var protocol = match[1] ? match[1].toLowerCase() : '';\n var forwardSlashes = !!match[2];\n var otherSlashes = !!match[3];\n var slashesCount = 0;\n var rest;\n if (forwardSlashes) {\n if (otherSlashes) {\n rest = match[2] + match[3] + match[4];\n slashesCount = match[2].length + match[3].length;\n } else {\n rest = match[2] + match[4];\n slashesCount = match[2].length;\n }\n } else {\n if (otherSlashes) {\n rest = match[3] + match[4];\n slashesCount = match[3].length;\n } else {\n rest = match[4];\n }\n }\n if (protocol === 'file:') {\n if (slashesCount >= 2) {\n rest = rest.slice(2);\n }\n } else if (isSpecial(protocol)) {\n rest = match[4];\n } else if (protocol) {\n if (forwardSlashes) {\n rest = rest.slice(2);\n }\n } else if (slashesCount >= 2 && isSpecial(location.protocol)) {\n rest = match[4];\n }\n return {\n protocol: protocol,\n slashes: forwardSlashes || isSpecial(protocol),\n slashesCount: slashesCount,\n rest: rest\n };\n}\n\n/**\n * Resolve a relative URL pathname against a base URL pathname.\n *\n * @param {String} relative Pathname of the relative URL.\n * @param {String} base Pathname of the base URL.\n * @return {String} Resolved pathname.\n * @private\n */\nfunction resolve(relative, base) {\n if (relative === '') return base;\n var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/')),\n i = path.length,\n last = path[i - 1],\n unshift = false,\n up = 0;\n while (i--) {\n if (path[i] === '.') {\n path.splice(i, 1);\n } else if (path[i] === '..') {\n path.splice(i, 1);\n up++;\n } else if (up) {\n if (i === 0) unshift = true;\n path.splice(i, 1);\n up--;\n }\n }\n if (unshift) path.unshift('');\n if (last === '.' || last === '..') path.push('');\n return path.join('/');\n}\n\n/**\n * The actual URL instance. Instead of returning an object we've opted-in to\n * create an actual constructor as it's much more memory efficient and\n * faster and it pleases my OCD.\n *\n * It is worth noting that we should not use `URL` as class name to prevent\n * clashes with the global URL instance that got introduced in browsers.\n *\n * @constructor\n * @param {String} address URL we want to parse.\n * @param {Object|String} [location] Location defaults for relative paths.\n * @param {Boolean|Function} [parser] Parser for the query string.\n * @private\n */\nfunction Url(address, location, parser) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n if (!(this instanceof Url)) {\n return new Url(address, location, parser);\n }\n var relative,\n extracted,\n parse,\n instruction,\n index,\n key,\n instructions = rules.slice(),\n type = typeof location,\n url = this,\n i = 0;\n\n //\n // The following if statements allows this module two have compatibility with\n // 2 different API:\n //\n // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments\n // where the boolean indicates that the query string should also be parsed.\n //\n // 2. The `URL` interface of the browser which accepts a URL, object as\n // arguments. The supplied object will be used as default values / fall-back\n // for relative paths.\n //\n if ('object' !== type && 'string' !== type) {\n parser = location;\n location = null;\n }\n if (parser && 'function' !== typeof parser) parser = qs.parse;\n location = lolcation(location);\n\n //\n // Extract protocol information before running the instructions.\n //\n extracted = extractProtocol(address || '', location);\n relative = !extracted.protocol && !extracted.slashes;\n url.slashes = extracted.slashes || relative && location.slashes;\n url.protocol = extracted.protocol || location.protocol || '';\n address = extracted.rest;\n\n //\n // When the authority component is absent the URL starts with a path\n // component.\n //\n if (extracted.protocol === 'file:' && (extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) || !extracted.slashes && (extracted.protocol || extracted.slashesCount < 2 || !isSpecial(url.protocol))) {\n instructions[3] = [/(.*)/, 'pathname'];\n }\n for (; i < instructions.length; i++) {\n instruction = instructions[i];\n if (typeof instruction === 'function') {\n address = instruction(address, url);\n continue;\n }\n parse = instruction[0];\n key = instruction[1];\n if (parse !== parse) {\n url[key] = address;\n } else if ('string' === typeof parse) {\n index = parse === '@' ? address.lastIndexOf(parse) : address.indexOf(parse);\n if (~index) {\n if ('number' === typeof instruction[2]) {\n url[key] = address.slice(0, index);\n address = address.slice(index + instruction[2]);\n } else {\n url[key] = address.slice(index);\n address = address.slice(0, index);\n }\n }\n } else if (index = parse.exec(address)) {\n url[key] = index[1];\n address = address.slice(0, index.index);\n }\n url[key] = url[key] || (relative && instruction[3] ? location[key] || '' : '');\n\n //\n // Hostname, host and protocol should be lowercased so they can be used to\n // create a proper `origin`.\n //\n if (instruction[4]) url[key] = url[key].toLowerCase();\n }\n\n //\n // Also parse the supplied query string in to an object. If we're supplied\n // with a custom parser as function use that instead of the default build-in\n // parser.\n //\n if (parser) url.query = parser(url.query);\n\n //\n // If the URL is relative, resolve the pathname against the base URL.\n //\n if (relative && location.slashes && url.pathname.charAt(0) !== '/' && (url.pathname !== '' || location.pathname !== '')) {\n url.pathname = resolve(url.pathname, location.pathname);\n }\n\n //\n // Default to a / for pathname if none exists. This normalizes the URL\n // to always have a /\n //\n if (url.pathname.charAt(0) !== '/' && isSpecial(url.protocol)) {\n url.pathname = '/' + url.pathname;\n }\n\n //\n // We should not add port numbers if they are already the default port number\n // for a given protocol. As the host also contains the port number we're going\n // override it with the hostname which contains no port number.\n //\n if (!required(url.port, url.protocol)) {\n url.host = url.hostname;\n url.port = '';\n }\n\n //\n // Parse down the `auth` for the username and password.\n //\n url.username = url.password = '';\n if (url.auth) {\n index = url.auth.indexOf(':');\n if (~index) {\n url.username = url.auth.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n url.password = url.auth.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password));\n } else {\n url.username = encodeURIComponent(decodeURIComponent(url.auth));\n }\n url.auth = url.password ? url.username + ':' + url.password : url.username;\n }\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host ? url.protocol + '//' + url.host : 'null';\n\n //\n // The href is just the compiled result.\n //\n url.href = url.toString();\n}\n\n/**\n * This is convenience method for changing properties in the URL instance to\n * insure that they all propagate correctly.\n *\n * @param {String} part Property we need to adjust.\n * @param {Mixed} value The newly assigned value.\n * @param {Boolean|Function} fn When setting the query, it will be the function\n * used to parse the query.\n * When setting the protocol, double slash will be\n * removed from the final url if it is true.\n * @returns {URL} URL instance for chaining.\n * @public\n */\nfunction set(part, value, fn) {\n var url = this;\n switch (part) {\n case 'query':\n if ('string' === typeof value && value.length) {\n value = (fn || qs.parse)(value);\n }\n url[part] = value;\n break;\n case 'port':\n url[part] = value;\n if (!required(value, url.protocol)) {\n url.host = url.hostname;\n url[part] = '';\n } else if (value) {\n url.host = url.hostname + ':' + value;\n }\n break;\n case 'hostname':\n url[part] = value;\n if (url.port) value += ':' + url.port;\n url.host = value;\n break;\n case 'host':\n url[part] = value;\n if (port.test(value)) {\n value = value.split(':');\n url.port = value.pop();\n url.hostname = value.join(':');\n } else {\n url.hostname = value;\n url.port = '';\n }\n break;\n case 'protocol':\n url.protocol = value.toLowerCase();\n url.slashes = !fn;\n break;\n case 'pathname':\n case 'hash':\n if (value) {\n var char = part === 'pathname' ? '/' : '#';\n url[part] = value.charAt(0) !== char ? char + value : value;\n } else {\n url[part] = value;\n }\n break;\n case 'username':\n case 'password':\n url[part] = encodeURIComponent(value);\n break;\n case 'auth':\n var index = value.indexOf(':');\n if (~index) {\n url.username = value.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n url.password = value.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password));\n } else {\n url.username = encodeURIComponent(decodeURIComponent(value));\n }\n }\n for (var i = 0; i < rules.length; i++) {\n var ins = rules[i];\n if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();\n }\n url.auth = url.password ? url.username + ':' + url.password : url.username;\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host ? url.protocol + '//' + url.host : 'null';\n url.href = url.toString();\n return url;\n}\n\n/**\n * Transform the properties back in to a valid and full URL string.\n *\n * @param {Function} stringify Optional query stringify function.\n * @returns {String} Compiled version of the URL.\n * @public\n */\nfunction toString(stringify) {\n if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify;\n var query,\n url = this,\n host = url.host,\n protocol = url.protocol;\n if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';\n var result = protocol + (url.protocol && url.slashes || isSpecial(url.protocol) ? '//' : '');\n if (url.username) {\n result += url.username;\n if (url.password) result += ':' + url.password;\n result += '@';\n } else if (url.password) {\n result += ':' + url.password;\n result += '@';\n } else if (url.protocol !== 'file:' && isSpecial(url.protocol) && !host && url.pathname !== '/') {\n //\n // Add back the empty userinfo, otherwise the original invalid URL\n // might be transformed into a valid one with `url.pathname` as host.\n //\n result += '@';\n }\n\n //\n // Trailing colon is removed from `url.host` when it is parsed. If it still\n // ends with a colon, then add back the trailing colon that was removed. This\n // prevents an invalid URL from being transformed into a valid one.\n //\n if (host[host.length - 1] === ':' || port.test(url.hostname) && !url.port) {\n host += ':';\n }\n result += host + url.pathname;\n query = 'object' === typeof url.query ? stringify(url.query) : url.query;\n if (query) result += '?' !== query.charAt(0) ? '?' + query : query;\n if (url.hash) result += url.hash;\n return result;\n}\nUrl.prototype = {\n set: set,\n toString: toString\n};\n\n//\n// Expose the URL parser and some additional properties that might be useful for\n// others or testing.\n//\nUrl.extractProtocol = extractProtocol;\nUrl.location = lolcation;\nUrl.trimLeft = trimLeft;\nUrl.qs = qs;\nmodule.exports = Url;","'use strict';\n\nvar URL = require('url-parse');\nvar debug = function () {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:utils:url');\n}\nmodule.exports = {\n getOrigin: function (url) {\n if (!url) {\n return null;\n }\n var p = new URL(url);\n if (p.protocol === 'file:') {\n return null;\n }\n var port = p.port;\n if (!port) {\n port = p.protocol === 'https:' ? '443' : '80';\n }\n return p.protocol + '//' + p.hostname + ':' + port;\n },\n isOriginEqual: function (a, b) {\n var res = this.getOrigin(a) === this.getOrigin(b);\n debug('same', a, b, res);\n return res;\n },\n isSchemeEqual: function (a, b) {\n return a.split(':')[0] === b.split(':')[0];\n },\n addPath: function (url, path) {\n var qs = url.split('?');\n return qs[0] + path + (qs[1] ? '?' + qs[1] : '');\n },\n addQuery: function (url, q) {\n return url + (url.indexOf('?') === -1 ? '?' + q : '&' + q);\n },\n isLoopbackAddr: function (addr) {\n return /^127\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})$/i.test(addr) || /^\\[::1\\]$/.test(addr);\n }\n};","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor;\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n };\n}","'use strict';\n\n/* Simplified implementation of DOM2 EventTarget.\n * http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget\n */\nfunction EventTarget() {\n this._listeners = {};\n}\nEventTarget.prototype.addEventListener = function (eventType, listener) {\n if (!(eventType in this._listeners)) {\n this._listeners[eventType] = [];\n }\n var arr = this._listeners[eventType];\n // #4\n if (arr.indexOf(listener) === -1) {\n // Make a copy so as not to interfere with a current dispatchEvent.\n arr = arr.concat([listener]);\n }\n this._listeners[eventType] = arr;\n};\nEventTarget.prototype.removeEventListener = function (eventType, listener) {\n var arr = this._listeners[eventType];\n if (!arr) {\n return;\n }\n var idx = arr.indexOf(listener);\n if (idx !== -1) {\n if (arr.length > 1) {\n // Make a copy so as not to interfere with a current dispatchEvent.\n this._listeners[eventType] = arr.slice(0, idx).concat(arr.slice(idx + 1));\n } else {\n delete this._listeners[eventType];\n }\n return;\n }\n};\nEventTarget.prototype.dispatchEvent = function () {\n var event = arguments[0];\n var t = event.type;\n // equivalent of Array.prototype.slice.call(arguments, 0);\n var args = arguments.length === 1 ? [event] : Array.apply(null, arguments);\n // TODO: This doesn't match the real behavior; per spec, onfoo get\n // their place in line from the /first/ time they're set from\n // non-null. Although WebKit bumps it to the end every time it's\n // set.\n if (this['on' + t]) {\n this['on' + t].apply(this, args);\n }\n if (t in this._listeners) {\n // Grab a reference to the listeners list. removeEventListener may alter the list.\n var listeners = this._listeners[t];\n for (var i = 0; i < listeners.length; i++) {\n listeners[i].apply(this, args);\n }\n }\n};\nmodule.exports = EventTarget;","'use strict';\n\nvar inherits = require('inherits'),\n EventTarget = require('./eventtarget');\nfunction EventEmitter() {\n EventTarget.call(this);\n}\ninherits(EventEmitter, EventTarget);\nEventEmitter.prototype.removeAllListeners = function (type) {\n if (type) {\n delete this._listeners[type];\n } else {\n this._listeners = {};\n }\n};\nEventEmitter.prototype.once = function (type, listener) {\n var self = this,\n fired = false;\n function g() {\n self.removeListener(type, g);\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n this.on(type, g);\n};\nEventEmitter.prototype.emit = function () {\n var type = arguments[0];\n var listeners = this._listeners[type];\n if (!listeners) {\n return;\n }\n // equivalent of Array.prototype.slice.call(arguments, 1);\n var l = arguments.length;\n var args = new Array(l - 1);\n for (var ai = 1; ai < l; ai++) {\n args[ai - 1] = arguments[ai];\n }\n for (var i = 0; i < listeners.length; i++) {\n listeners[i].apply(this, args);\n }\n};\nEventEmitter.prototype.on = EventEmitter.prototype.addListener = EventTarget.prototype.addEventListener;\nEventEmitter.prototype.removeListener = EventTarget.prototype.removeEventListener;\nmodule.exports.EventEmitter = EventEmitter;","'use strict';\n\nvar Driver = global.WebSocket || global.MozWebSocket;\nif (Driver) {\n module.exports = function WebSocketBrowserDriver(url) {\n return new Driver(url);\n };\n} else {\n module.exports = undefined;\n}","'use strict';\n\nvar utils = require('../utils/event'),\n urlUtils = require('../utils/url'),\n inherits = require('inherits'),\n EventEmitter = require('events').EventEmitter,\n WebsocketDriver = require('./driver/websocket');\nvar debug = function () {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:websocket');\n}\nfunction WebSocketTransport(transUrl, ignore, options) {\n if (!WebSocketTransport.enabled()) {\n throw new Error('Transport created when disabled');\n }\n EventEmitter.call(this);\n debug('constructor', transUrl);\n var self = this;\n var url = urlUtils.addPath(transUrl, '/websocket');\n if (url.slice(0, 5) === 'https') {\n url = 'wss' + url.slice(5);\n } else {\n url = 'ws' + url.slice(4);\n }\n this.url = url;\n this.ws = new WebsocketDriver(this.url, [], options);\n this.ws.onmessage = function (e) {\n debug('message event', e.data);\n self.emit('message', e.data);\n };\n // Firefox has an interesting bug. If a websocket connection is\n // created after onunload, it stays alive even when user\n // navigates away from the page. In such situation let's lie -\n // let's not open the ws connection at all. See:\n // https://github.com/sockjs/sockjs-client/issues/28\n // https://bugzilla.mozilla.org/show_bug.cgi?id=696085\n this.unloadRef = utils.unloadAdd(function () {\n debug('unload');\n self.ws.close();\n });\n this.ws.onclose = function (e) {\n debug('close event', e.code, e.reason);\n self.emit('close', e.code, e.reason);\n self._cleanup();\n };\n this.ws.onerror = function (e) {\n debug('error event', e);\n self.emit('close', 1006, 'WebSocket connection broken');\n self._cleanup();\n };\n}\ninherits(WebSocketTransport, EventEmitter);\nWebSocketTransport.prototype.send = function (data) {\n var msg = '[' + data + ']';\n debug('send', msg);\n this.ws.send(msg);\n};\nWebSocketTransport.prototype.close = function () {\n debug('close');\n var ws = this.ws;\n this._cleanup();\n if (ws) {\n ws.close();\n }\n};\nWebSocketTransport.prototype._cleanup = function () {\n debug('_cleanup');\n var ws = this.ws;\n if (ws) {\n ws.onmessage = ws.onclose = ws.onerror = null;\n }\n utils.unloadDel(this.unloadRef);\n this.unloadRef = this.ws = null;\n this.removeAllListeners();\n};\nWebSocketTransport.enabled = function () {\n debug('enabled');\n return !!WebsocketDriver;\n};\nWebSocketTransport.transportName = 'websocket';\n\n// In theory, ws should require 1 round trip. But in chrome, this is\n// not very stable over SSL. Most likely a ws connection requires a\n// separate SSL connection, in which case 2 round trips are an\n// absolute minumum.\nWebSocketTransport.roundTrips = 2;\nmodule.exports = WebSocketTransport;","'use strict';\n\nvar inherits = require('inherits'),\n EventEmitter = require('events').EventEmitter;\nvar debug = function () {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:buffered-sender');\n}\nfunction BufferedSender(url, sender) {\n debug(url);\n EventEmitter.call(this);\n this.sendBuffer = [];\n this.sender = sender;\n this.url = url;\n}\ninherits(BufferedSender, EventEmitter);\nBufferedSender.prototype.send = function (message) {\n debug('send', message);\n this.sendBuffer.push(message);\n if (!this.sendStop) {\n this.sendSchedule();\n }\n};\n\n// For polling transports in a situation when in the message callback,\n// new message is being send. If the sending connection was started\n// before receiving one, it is possible to saturate the network and\n// timeout due to the lack of receiving socket. To avoid that we delay\n// sending messages by some small time, in order to let receiving\n// connection be started beforehand. This is only a halfmeasure and\n// does not fix the big problem, but it does make the tests go more\n// stable on slow networks.\nBufferedSender.prototype.sendScheduleWait = function () {\n debug('sendScheduleWait');\n var self = this;\n var tref;\n this.sendStop = function () {\n debug('sendStop');\n self.sendStop = null;\n clearTimeout(tref);\n };\n tref = setTimeout(function () {\n debug('timeout');\n self.sendStop = null;\n self.sendSchedule();\n }, 25);\n};\nBufferedSender.prototype.sendSchedule = function () {\n debug('sendSchedule', this.sendBuffer.length);\n var self = this;\n if (this.sendBuffer.length > 0) {\n var payload = '[' + this.sendBuffer.join(',') + ']';\n this.sendStop = this.sender(this.url, payload, function (err) {\n self.sendStop = null;\n if (err) {\n debug('error', err);\n self.emit('close', err.code || 1006, 'Sending error: ' + err);\n self.close();\n } else {\n self.sendScheduleWait();\n }\n });\n this.sendBuffer = [];\n }\n};\nBufferedSender.prototype._cleanup = function () {\n debug('_cleanup');\n this.removeAllListeners();\n};\nBufferedSender.prototype.close = function () {\n debug('close');\n this._cleanup();\n if (this.sendStop) {\n this.sendStop();\n this.sendStop = null;\n }\n};\nmodule.exports = BufferedSender;","'use strict';\n\nvar inherits = require('inherits'),\n EventEmitter = require('events').EventEmitter;\nvar debug = function () {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:polling');\n}\nfunction Polling(Receiver, receiveUrl, AjaxObject) {\n debug(receiveUrl);\n EventEmitter.call(this);\n this.Receiver = Receiver;\n this.receiveUrl = receiveUrl;\n this.AjaxObject = AjaxObject;\n this._scheduleReceiver();\n}\ninherits(Polling, EventEmitter);\nPolling.prototype._scheduleReceiver = function () {\n debug('_scheduleReceiver');\n var self = this;\n var poll = this.poll = new this.Receiver(this.receiveUrl, this.AjaxObject);\n poll.on('message', function (msg) {\n debug('message', msg);\n self.emit('message', msg);\n });\n poll.once('close', function (code, reason) {\n debug('close', code, reason, self.pollIsClosing);\n self.poll = poll = null;\n if (!self.pollIsClosing) {\n if (reason === 'network') {\n self._scheduleReceiver();\n } else {\n self.emit('close', code || 1006, reason);\n self.removeAllListeners();\n }\n }\n });\n};\nPolling.prototype.abort = function () {\n debug('abort');\n this.removeAllListeners();\n this.pollIsClosing = true;\n if (this.poll) {\n this.poll.abort();\n }\n};\nmodule.exports = Polling;","'use strict';\n\nvar inherits = require('inherits'),\n urlUtils = require('../../utils/url'),\n BufferedSender = require('./buffered-sender'),\n Polling = require('./polling');\nvar debug = function () {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:sender-receiver');\n}\nfunction SenderReceiver(transUrl, urlSuffix, senderFunc, Receiver, AjaxObject) {\n var pollUrl = urlUtils.addPath(transUrl, urlSuffix);\n debug(pollUrl);\n var self = this;\n BufferedSender.call(this, transUrl, senderFunc);\n this.poll = new Polling(Receiver, pollUrl, AjaxObject);\n this.poll.on('message', function (msg) {\n debug('poll message', msg);\n self.emit('message', msg);\n });\n this.poll.once('close', function (code, reason) {\n debug('poll close', code, reason);\n self.poll = null;\n self.emit('close', code, reason);\n self.close();\n });\n}\ninherits(SenderReceiver, BufferedSender);\nSenderReceiver.prototype.close = function () {\n BufferedSender.prototype.close.call(this);\n debug('close');\n this.removeAllListeners();\n if (this.poll) {\n this.poll.abort();\n this.poll = null;\n }\n};\nmodule.exports = SenderReceiver;","'use strict';\n\nvar inherits = require('inherits'),\n urlUtils = require('../../utils/url'),\n SenderReceiver = require('./sender-receiver');\nvar debug = function () {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:ajax-based');\n}\nfunction createAjaxSender(AjaxObject) {\n return function (url, payload, callback) {\n debug('create ajax sender', url, payload);\n var opt = {};\n if (typeof payload === 'string') {\n opt.headers = {\n 'Content-type': 'text/plain'\n };\n }\n var ajaxUrl = urlUtils.addPath(url, '/xhr_send');\n var xo = new AjaxObject('POST', ajaxUrl, payload, opt);\n xo.once('finish', function (status) {\n debug('finish', status);\n xo = null;\n if (status !== 200 && status !== 204) {\n return callback(new Error('http status ' + status));\n }\n callback();\n });\n return function () {\n debug('abort');\n xo.close();\n xo = null;\n var err = new Error('Aborted');\n err.code = 1000;\n callback(err);\n };\n };\n}\nfunction AjaxBasedTransport(transUrl, urlSuffix, Receiver, AjaxObject) {\n SenderReceiver.call(this, transUrl, urlSuffix, createAjaxSender(AjaxObject), Receiver, AjaxObject);\n}\ninherits(AjaxBasedTransport, SenderReceiver);\nmodule.exports = AjaxBasedTransport;","'use strict';\n\nvar inherits = require('inherits'),\n EventEmitter = require('events').EventEmitter;\nvar debug = function () {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:receiver:xhr');\n}\nfunction XhrReceiver(url, AjaxObject) {\n debug(url);\n EventEmitter.call(this);\n var self = this;\n this.bufferPosition = 0;\n this.xo = new AjaxObject('POST', url, null);\n this.xo.on('chunk', this._chunkHandler.bind(this));\n this.xo.once('finish', function (status, text) {\n debug('finish', status, text);\n self._chunkHandler(status, text);\n self.xo = null;\n var reason = status === 200 ? 'network' : 'permanent';\n debug('close', reason);\n self.emit('close', null, reason);\n self._cleanup();\n });\n}\ninherits(XhrReceiver, EventEmitter);\nXhrReceiver.prototype._chunkHandler = function (status, text) {\n debug('_chunkHandler', status);\n if (status !== 200 || !text) {\n return;\n }\n for (var idx = -1;; this.bufferPosition += idx + 1) {\n var buf = text.slice(this.bufferPosition);\n idx = buf.indexOf('\\n');\n if (idx === -1) {\n break;\n }\n var msg = buf.slice(0, idx);\n if (msg) {\n debug('message', msg);\n this.emit('message', msg);\n }\n }\n};\nXhrReceiver.prototype._cleanup = function () {\n debug('_cleanup');\n this.removeAllListeners();\n};\nXhrReceiver.prototype.abort = function () {\n debug('abort');\n if (this.xo) {\n this.xo.close();\n debug('close');\n this.emit('close', null, 'user');\n this.xo = null;\n }\n this._cleanup();\n};\nmodule.exports = XhrReceiver;","'use strict';\n\nvar EventEmitter = require('events').EventEmitter,\n inherits = require('inherits'),\n utils = require('../../utils/event'),\n urlUtils = require('../../utils/url'),\n XHR = global.XMLHttpRequest;\nvar debug = function () {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:browser:xhr');\n}\nfunction AbstractXHRObject(method, url, payload, opts) {\n debug(method, url);\n var self = this;\n EventEmitter.call(this);\n setTimeout(function () {\n self._start(method, url, payload, opts);\n }, 0);\n}\ninherits(AbstractXHRObject, EventEmitter);\nAbstractXHRObject.prototype._start = function (method, url, payload, opts) {\n var self = this;\n try {\n this.xhr = new XHR();\n } catch (x) {\n // intentionally empty\n }\n if (!this.xhr) {\n debug('no xhr');\n this.emit('finish', 0, 'no xhr support');\n this._cleanup();\n return;\n }\n\n // several browsers cache POSTs\n url = urlUtils.addQuery(url, 't=' + +new Date());\n\n // Explorer tends to keep connection open, even after the\n // tab gets closed: http://bugs.jquery.com/ticket/5280\n this.unloadRef = utils.unloadAdd(function () {\n debug('unload cleanup');\n self._cleanup(true);\n });\n try {\n this.xhr.open(method, url, true);\n if (this.timeout && 'timeout' in this.xhr) {\n this.xhr.timeout = this.timeout;\n this.xhr.ontimeout = function () {\n debug('xhr timeout');\n self.emit('finish', 0, '');\n self._cleanup(false);\n };\n }\n } catch (e) {\n debug('exception', e);\n // IE raises an exception on wrong port.\n this.emit('finish', 0, '');\n this._cleanup(false);\n return;\n }\n if ((!opts || !opts.noCredentials) && AbstractXHRObject.supportsCORS) {\n debug('withCredentials');\n // Mozilla docs says https://developer.mozilla.org/en/XMLHttpRequest :\n // \"This never affects same-site requests.\"\n\n this.xhr.withCredentials = true;\n }\n if (opts && opts.headers) {\n for (var key in opts.headers) {\n this.xhr.setRequestHeader(key, opts.headers[key]);\n }\n }\n this.xhr.onreadystatechange = function () {\n if (self.xhr) {\n var x = self.xhr;\n var text, status;\n debug('readyState', x.readyState);\n switch (x.readyState) {\n case 3:\n // IE doesn't like peeking into responseText or status\n // on Microsoft.XMLHTTP and readystate=3\n try {\n status = x.status;\n text = x.responseText;\n } catch (e) {\n // intentionally empty\n }\n debug('status', status);\n // IE returns 1223 for 204: http://bugs.jquery.com/ticket/1450\n if (status === 1223) {\n status = 204;\n }\n\n // IE does return readystate == 3 for 404 answers.\n if (status === 200 && text && text.length > 0) {\n debug('chunk');\n self.emit('chunk', status, text);\n }\n break;\n case 4:\n status = x.status;\n debug('status', status);\n // IE returns 1223 for 204: http://bugs.jquery.com/ticket/1450\n if (status === 1223) {\n status = 204;\n }\n // IE returns this for a bad port\n // http://msdn.microsoft.com/en-us/library/windows/desktop/aa383770(v=vs.85).aspx\n if (status === 12005 || status === 12029) {\n status = 0;\n }\n debug('finish', status, x.responseText);\n self.emit('finish', status, x.responseText);\n self._cleanup(false);\n break;\n }\n }\n };\n try {\n self.xhr.send(payload);\n } catch (e) {\n self.emit('finish', 0, '');\n self._cleanup(false);\n }\n};\nAbstractXHRObject.prototype._cleanup = function (abort) {\n debug('cleanup');\n if (!this.xhr) {\n return;\n }\n this.removeAllListeners();\n utils.unloadDel(this.unloadRef);\n\n // IE needs this field to be a function\n this.xhr.onreadystatechange = function () {};\n if (this.xhr.ontimeout) {\n this.xhr.ontimeout = null;\n }\n if (abort) {\n try {\n this.xhr.abort();\n } catch (x) {\n // intentionally empty\n }\n }\n this.unloadRef = this.xhr = null;\n};\nAbstractXHRObject.prototype.close = function () {\n debug('close');\n this._cleanup(true);\n};\nAbstractXHRObject.enabled = !!XHR;\n// override XMLHttpRequest for IE6/7\n// obfuscate to avoid firewalls\nvar axo = ['Active'].concat('Object').join('X');\nif (!AbstractXHRObject.enabled && axo in global) {\n debug('overriding xmlhttprequest');\n XHR = function () {\n try {\n return new global[axo]('Microsoft.XMLHTTP');\n } catch (e) {\n return null;\n }\n };\n AbstractXHRObject.enabled = !!new XHR();\n}\nvar cors = false;\ntry {\n cors = 'withCredentials' in new XHR();\n} catch (ignored) {\n // intentionally empty\n}\nAbstractXHRObject.supportsCORS = cors;\nmodule.exports = AbstractXHRObject;","'use strict';\n\nvar inherits = require('inherits'),\n XhrDriver = require('../driver/xhr');\nfunction XHRCorsObject(method, url, payload, opts) {\n XhrDriver.call(this, method, url, payload, opts);\n}\ninherits(XHRCorsObject, XhrDriver);\nXHRCorsObject.enabled = XhrDriver.enabled && XhrDriver.supportsCORS;\nmodule.exports = XHRCorsObject;","'use strict';\n\nvar inherits = require('inherits'),\n XhrDriver = require('../driver/xhr');\nfunction XHRLocalObject(method, url, payload /*, opts */) {\n XhrDriver.call(this, method, url, payload, {\n noCredentials: true\n });\n}\ninherits(XHRLocalObject, XhrDriver);\nXHRLocalObject.enabled = XhrDriver.enabled;\nmodule.exports = XHRLocalObject;","'use strict';\n\nmodule.exports = {\n isOpera: function () {\n return global.navigator && /opera/i.test(global.navigator.userAgent);\n },\n isKonqueror: function () {\n return global.navigator && /konqueror/i.test(global.navigator.userAgent);\n }\n\n // #187 wrap document.domain in try/catch because of WP8 from file:///\n ,\n hasDomain: function () {\n // non-browser client always has a domain\n if (!global.document) {\n return true;\n }\n try {\n return !!global.document.domain;\n } catch (e) {\n return false;\n }\n }\n};","'use strict';\n\nvar inherits = require('inherits'),\n AjaxBasedTransport = require('./lib/ajax-based'),\n XhrReceiver = require('./receiver/xhr'),\n XHRCorsObject = require('./sender/xhr-cors'),\n XHRLocalObject = require('./sender/xhr-local'),\n browser = require('../utils/browser');\nfunction XhrStreamingTransport(transUrl) {\n if (!XHRLocalObject.enabled && !XHRCorsObject.enabled) {\n throw new Error('Transport created when disabled');\n }\n AjaxBasedTransport.call(this, transUrl, '/xhr_streaming', XhrReceiver, XHRCorsObject);\n}\ninherits(XhrStreamingTransport, AjaxBasedTransport);\nXhrStreamingTransport.enabled = function (info) {\n if (info.nullOrigin) {\n return false;\n }\n // Opera doesn't support xhr-streaming #60\n // But it might be able to #92\n if (browser.isOpera()) {\n return false;\n }\n return XHRCorsObject.enabled;\n};\nXhrStreamingTransport.transportName = 'xhr-streaming';\nXhrStreamingTransport.roundTrips = 2; // preflight, ajax\n\n// Safari gets confused when a streaming ajax request is started\n// before onload. This causes the load indicator to spin indefinetely.\n// Only require body when used in a browser\nXhrStreamingTransport.needBody = !!global.document;\nmodule.exports = XhrStreamingTransport;","'use strict';\n\nvar EventEmitter = require('events').EventEmitter,\n inherits = require('inherits'),\n eventUtils = require('../../utils/event'),\n browser = require('../../utils/browser'),\n urlUtils = require('../../utils/url');\nvar debug = function () {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:sender:xdr');\n}\n\n// References:\n// http://ajaxian.com/archives/100-line-ajax-wrapper\n// http://msdn.microsoft.com/en-us/library/cc288060(v=VS.85).aspx\n\nfunction XDRObject(method, url, payload) {\n debug(method, url);\n var self = this;\n EventEmitter.call(this);\n setTimeout(function () {\n self._start(method, url, payload);\n }, 0);\n}\ninherits(XDRObject, EventEmitter);\nXDRObject.prototype._start = function (method, url, payload) {\n debug('_start');\n var self = this;\n var xdr = new global.XDomainRequest();\n // IE caches even POSTs\n url = urlUtils.addQuery(url, 't=' + +new Date());\n xdr.onerror = function () {\n debug('onerror');\n self._error();\n };\n xdr.ontimeout = function () {\n debug('ontimeout');\n self._error();\n };\n xdr.onprogress = function () {\n debug('progress', xdr.responseText);\n self.emit('chunk', 200, xdr.responseText);\n };\n xdr.onload = function () {\n debug('load');\n self.emit('finish', 200, xdr.responseText);\n self._cleanup(false);\n };\n this.xdr = xdr;\n this.unloadRef = eventUtils.unloadAdd(function () {\n self._cleanup(true);\n });\n try {\n // Fails with AccessDenied if port number is bogus\n this.xdr.open(method, url);\n if (this.timeout) {\n this.xdr.timeout = this.timeout;\n }\n this.xdr.send(payload);\n } catch (x) {\n this._error();\n }\n};\nXDRObject.prototype._error = function () {\n this.emit('finish', 0, '');\n this._cleanup(false);\n};\nXDRObject.prototype._cleanup = function (abort) {\n debug('cleanup', abort);\n if (!this.xdr) {\n return;\n }\n this.removeAllListeners();\n eventUtils.unloadDel(this.unloadRef);\n this.xdr.ontimeout = this.xdr.onerror = this.xdr.onprogress = this.xdr.onload = null;\n if (abort) {\n try {\n this.xdr.abort();\n } catch (x) {\n // intentionally empty\n }\n }\n this.unloadRef = this.xdr = null;\n};\nXDRObject.prototype.close = function () {\n debug('close');\n this._cleanup(true);\n};\n\n// IE 8/9 if the request target uses the same scheme - #79\nXDRObject.enabled = !!(global.XDomainRequest && browser.hasDomain());\nmodule.exports = XDRObject;","'use strict';\n\nvar inherits = require('inherits'),\n AjaxBasedTransport = require('./lib/ajax-based'),\n XhrReceiver = require('./receiver/xhr'),\n XDRObject = require('./sender/xdr');\n\n// According to:\n// http://stackoverflow.com/questions/1641507/detect-browser-support-for-cross-domain-xmlhttprequests\n// http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/\n\nfunction XdrStreamingTransport(transUrl) {\n if (!XDRObject.enabled) {\n throw new Error('Transport created when disabled');\n }\n AjaxBasedTransport.call(this, transUrl, '/xhr_streaming', XhrReceiver, XDRObject);\n}\ninherits(XdrStreamingTransport, AjaxBasedTransport);\nXdrStreamingTransport.enabled = function (info) {\n if (info.cookie_needed || info.nullOrigin) {\n return false;\n }\n return XDRObject.enabled && info.sameScheme;\n};\nXdrStreamingTransport.transportName = 'xdr-streaming';\nXdrStreamingTransport.roundTrips = 2; // preflight, ajax\n\nmodule.exports = XdrStreamingTransport;","module.exports = global.EventSource;","'use strict';\n\nvar inherits = require('inherits'),\n EventEmitter = require('events').EventEmitter,\n EventSourceDriver = require('eventsource');\nvar debug = function () {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:receiver:eventsource');\n}\nfunction EventSourceReceiver(url) {\n debug(url);\n EventEmitter.call(this);\n var self = this;\n var es = this.es = new EventSourceDriver(url);\n es.onmessage = function (e) {\n debug('message', e.data);\n self.emit('message', decodeURI(e.data));\n };\n es.onerror = function (e) {\n debug('error', es.readyState, e);\n // ES on reconnection has readyState = 0 or 1.\n // on network error it's CLOSED = 2\n var reason = es.readyState !== 2 ? 'network' : 'permanent';\n self._cleanup();\n self._close(reason);\n };\n}\ninherits(EventSourceReceiver, EventEmitter);\nEventSourceReceiver.prototype.abort = function () {\n debug('abort');\n this._cleanup();\n this._close('user');\n};\nEventSourceReceiver.prototype._cleanup = function () {\n debug('cleanup');\n var es = this.es;\n if (es) {\n es.onmessage = es.onerror = null;\n es.close();\n this.es = null;\n }\n};\nEventSourceReceiver.prototype._close = function (reason) {\n debug('close', reason);\n var self = this;\n // Safari and chrome < 15 crash if we close window before\n // waiting for ES cleanup. See:\n // https://code.google.com/p/chromium/issues/detail?id=89155\n setTimeout(function () {\n self.emit('close', null, reason);\n self.removeAllListeners();\n }, 200);\n};\nmodule.exports = EventSourceReceiver;","'use strict';\n\nvar inherits = require('inherits'),\n AjaxBasedTransport = require('./lib/ajax-based'),\n EventSourceReceiver = require('./receiver/eventsource'),\n XHRCorsObject = require('./sender/xhr-cors'),\n EventSourceDriver = require('eventsource');\nfunction EventSourceTransport(transUrl) {\n if (!EventSourceTransport.enabled()) {\n throw new Error('Transport created when disabled');\n }\n AjaxBasedTransport.call(this, transUrl, '/eventsource', EventSourceReceiver, XHRCorsObject);\n}\ninherits(EventSourceTransport, AjaxBasedTransport);\nEventSourceTransport.enabled = function () {\n return !!EventSourceDriver;\n};\nEventSourceTransport.transportName = 'eventsource';\nEventSourceTransport.roundTrips = 2;\nmodule.exports = EventSourceTransport;","module.exports = '1.6.1';","'use strict';\n\nvar eventUtils = require('./event'),\n browser = require('./browser');\nvar debug = function () {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:utils:iframe');\n}\nmodule.exports = {\n WPrefix: '_jp',\n currentWindowId: null,\n polluteGlobalNamespace: function () {\n if (!(module.exports.WPrefix in global)) {\n global[module.exports.WPrefix] = {};\n }\n },\n postMessage: function (type, data) {\n if (global.parent !== global) {\n global.parent.postMessage(JSON.stringify({\n windowId: module.exports.currentWindowId,\n type: type,\n data: data || ''\n }), '*');\n } else {\n debug('Cannot postMessage, no parent window.', type, data);\n }\n },\n createIframe: function (iframeUrl, errorCallback) {\n var iframe = global.document.createElement('iframe');\n var tref, unloadRef;\n var unattach = function () {\n debug('unattach');\n clearTimeout(tref);\n // Explorer had problems with that.\n try {\n iframe.onload = null;\n } catch (x) {\n // intentionally empty\n }\n iframe.onerror = null;\n };\n var cleanup = function () {\n debug('cleanup');\n if (iframe) {\n unattach();\n // This timeout makes chrome fire onbeforeunload event\n // within iframe. Without the timeout it goes straight to\n // onunload.\n setTimeout(function () {\n if (iframe) {\n iframe.parentNode.removeChild(iframe);\n }\n iframe = null;\n }, 0);\n eventUtils.unloadDel(unloadRef);\n }\n };\n var onerror = function (err) {\n debug('onerror', err);\n if (iframe) {\n cleanup();\n errorCallback(err);\n }\n };\n var post = function (msg, origin) {\n debug('post', msg, origin);\n setTimeout(function () {\n try {\n // When the iframe is not loaded, IE raises an exception\n // on 'contentWindow'.\n if (iframe && iframe.contentWindow) {\n iframe.contentWindow.postMessage(msg, origin);\n }\n } catch (x) {\n // intentionally empty\n }\n }, 0);\n };\n iframe.src = iframeUrl;\n iframe.style.display = 'none';\n iframe.style.position = 'absolute';\n iframe.onerror = function () {\n onerror('onerror');\n };\n iframe.onload = function () {\n debug('onload');\n // `onload` is triggered before scripts on the iframe are\n // executed. Give it few seconds to actually load stuff.\n clearTimeout(tref);\n tref = setTimeout(function () {\n onerror('onload timeout');\n }, 2000);\n };\n global.document.body.appendChild(iframe);\n tref = setTimeout(function () {\n onerror('timeout');\n }, 15000);\n unloadRef = eventUtils.unloadAdd(cleanup);\n return {\n post: post,\n cleanup: cleanup,\n loaded: unattach\n };\n }\n\n /* eslint no-undef: \"off\", new-cap: \"off\" */,\n createHtmlfile: function (iframeUrl, errorCallback) {\n var axo = ['Active'].concat('Object').join('X');\n var doc = new global[axo]('htmlfile');\n var tref, unloadRef;\n var iframe;\n var unattach = function () {\n clearTimeout(tref);\n iframe.onerror = null;\n };\n var cleanup = function () {\n if (doc) {\n unattach();\n eventUtils.unloadDel(unloadRef);\n iframe.parentNode.removeChild(iframe);\n iframe = doc = null;\n CollectGarbage();\n }\n };\n var onerror = function (r) {\n debug('onerror', r);\n if (doc) {\n cleanup();\n errorCallback(r);\n }\n };\n var post = function (msg, origin) {\n try {\n // When the iframe is not loaded, IE raises an exception\n // on 'contentWindow'.\n setTimeout(function () {\n if (iframe && iframe.contentWindow) {\n iframe.contentWindow.postMessage(msg, origin);\n }\n }, 0);\n } catch (x) {\n // intentionally empty\n }\n };\n doc.open();\n doc.write('' + 'document.domain=\"' + global.document.domain + '\";' + '');\n doc.close();\n doc.parentWindow[module.exports.WPrefix] = global[module.exports.WPrefix];\n var c = doc.createElement('div');\n doc.body.appendChild(c);\n iframe = doc.createElement('iframe');\n c.appendChild(iframe);\n iframe.src = iframeUrl;\n iframe.onerror = function () {\n onerror('onerror');\n };\n tref = setTimeout(function () {\n onerror('timeout');\n }, 15000);\n unloadRef = eventUtils.unloadAdd(cleanup);\n return {\n post: post,\n cleanup: cleanup,\n loaded: unattach\n };\n }\n};\nmodule.exports.iframeEnabled = false;\nif (global.document) {\n // postMessage misbehaves in konqueror 4.6.5 - the messages are delivered with\n // huge delay, or not at all.\n module.exports.iframeEnabled = (typeof global.postMessage === 'function' || typeof global.postMessage === 'object') && !browser.isKonqueror();\n}","'use strict';\n\n// Few cool transports do work only for same-origin. In order to make\n// them work cross-domain we shall use iframe, served from the\n// remote domain. New browsers have capabilities to communicate with\n// cross domain iframe using postMessage(). In IE it was implemented\n// from IE 8+, but of course, IE got some details wrong:\n// http://msdn.microsoft.com/en-us/library/cc197015(v=VS.85).aspx\n// http://stevesouders.com/misc/test-postmessage.php\nvar inherits = require('inherits'),\n EventEmitter = require('events').EventEmitter,\n version = require('../version'),\n urlUtils = require('../utils/url'),\n iframeUtils = require('../utils/iframe'),\n eventUtils = require('../utils/event'),\n random = require('../utils/random');\nvar debug = function () {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:transport:iframe');\n}\nfunction IframeTransport(transport, transUrl, baseUrl) {\n if (!IframeTransport.enabled()) {\n throw new Error('Transport created when disabled');\n }\n EventEmitter.call(this);\n var self = this;\n this.origin = urlUtils.getOrigin(baseUrl);\n this.baseUrl = baseUrl;\n this.transUrl = transUrl;\n this.transport = transport;\n this.windowId = random.string(8);\n var iframeUrl = urlUtils.addPath(baseUrl, '/iframe.html') + '#' + this.windowId;\n debug(transport, transUrl, iframeUrl);\n this.iframeObj = iframeUtils.createIframe(iframeUrl, function (r) {\n debug('err callback');\n self.emit('close', 1006, 'Unable to load an iframe (' + r + ')');\n self.close();\n });\n this.onmessageCallback = this._message.bind(this);\n eventUtils.attachEvent('message', this.onmessageCallback);\n}\ninherits(IframeTransport, EventEmitter);\nIframeTransport.prototype.close = function () {\n debug('close');\n this.removeAllListeners();\n if (this.iframeObj) {\n eventUtils.detachEvent('message', this.onmessageCallback);\n try {\n // When the iframe is not loaded, IE raises an exception\n // on 'contentWindow'.\n this.postMessage('c');\n } catch (x) {\n // intentionally empty\n }\n this.iframeObj.cleanup();\n this.iframeObj = null;\n this.onmessageCallback = this.iframeObj = null;\n }\n};\nIframeTransport.prototype._message = function (e) {\n debug('message', e.data);\n if (!urlUtils.isOriginEqual(e.origin, this.origin)) {\n debug('not same origin', e.origin, this.origin);\n return;\n }\n var iframeMessage;\n try {\n iframeMessage = JSON.parse(e.data);\n } catch (ignored) {\n debug('bad json', e.data);\n return;\n }\n if (iframeMessage.windowId !== this.windowId) {\n debug('mismatched window id', iframeMessage.windowId, this.windowId);\n return;\n }\n switch (iframeMessage.type) {\n case 's':\n this.iframeObj.loaded();\n // window global dependency\n this.postMessage('s', JSON.stringify([version, this.transport, this.transUrl, this.baseUrl]));\n break;\n case 't':\n this.emit('message', iframeMessage.data);\n break;\n case 'c':\n var cdata;\n try {\n cdata = JSON.parse(iframeMessage.data);\n } catch (ignored) {\n debug('bad json', iframeMessage.data);\n return;\n }\n this.emit('close', cdata[0], cdata[1]);\n this.close();\n break;\n }\n};\nIframeTransport.prototype.postMessage = function (type, data) {\n debug('postMessage', type, data);\n this.iframeObj.post(JSON.stringify({\n windowId: this.windowId,\n type: type,\n data: data || ''\n }), this.origin);\n};\nIframeTransport.prototype.send = function (message) {\n debug('send', message);\n this.postMessage('m', message);\n};\nIframeTransport.enabled = function () {\n return iframeUtils.iframeEnabled;\n};\nIframeTransport.transportName = 'iframe';\nIframeTransport.roundTrips = 2;\nmodule.exports = IframeTransport;","'use strict';\n\nmodule.exports = {\n isObject: function (obj) {\n var type = typeof obj;\n return type === 'function' || type === 'object' && !!obj;\n },\n extend: function (obj) {\n if (!this.isObject(obj)) {\n return obj;\n }\n var source, prop;\n for (var i = 1, length = arguments.length; i < length; i++) {\n source = arguments[i];\n for (prop in source) {\n if (Object.prototype.hasOwnProperty.call(source, prop)) {\n obj[prop] = source[prop];\n }\n }\n }\n return obj;\n }\n};","'use strict';\n\nvar inherits = require('inherits'),\n IframeTransport = require('../iframe'),\n objectUtils = require('../../utils/object');\nmodule.exports = function (transport) {\n function IframeWrapTransport(transUrl, baseUrl) {\n IframeTransport.call(this, transport.transportName, transUrl, baseUrl);\n }\n inherits(IframeWrapTransport, IframeTransport);\n IframeWrapTransport.enabled = function (url, info) {\n if (!global.document) {\n return false;\n }\n var iframeInfo = objectUtils.extend({}, info);\n iframeInfo.sameOrigin = true;\n return transport.enabled(iframeInfo) && IframeTransport.enabled();\n };\n IframeWrapTransport.transportName = 'iframe-' + transport.transportName;\n IframeWrapTransport.needBody = true;\n IframeWrapTransport.roundTrips = IframeTransport.roundTrips + transport.roundTrips - 1; // html, javascript (2) + transport - no CORS (1)\n\n IframeWrapTransport.facadeTransport = transport;\n return IframeWrapTransport;\n};","'use strict';\n\nvar inherits = require('inherits'),\n iframeUtils = require('../../utils/iframe'),\n urlUtils = require('../../utils/url'),\n EventEmitter = require('events').EventEmitter,\n random = require('../../utils/random');\nvar debug = function () {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:receiver:htmlfile');\n}\nfunction HtmlfileReceiver(url) {\n debug(url);\n EventEmitter.call(this);\n var self = this;\n iframeUtils.polluteGlobalNamespace();\n this.id = 'a' + random.string(6);\n url = urlUtils.addQuery(url, 'c=' + decodeURIComponent(iframeUtils.WPrefix + '.' + this.id));\n debug('using htmlfile', HtmlfileReceiver.htmlfileEnabled);\n var constructFunc = HtmlfileReceiver.htmlfileEnabled ? iframeUtils.createHtmlfile : iframeUtils.createIframe;\n global[iframeUtils.WPrefix][this.id] = {\n start: function () {\n debug('start');\n self.iframeObj.loaded();\n },\n message: function (data) {\n debug('message', data);\n self.emit('message', data);\n },\n stop: function () {\n debug('stop');\n self._cleanup();\n self._close('network');\n }\n };\n this.iframeObj = constructFunc(url, function () {\n debug('callback');\n self._cleanup();\n self._close('permanent');\n });\n}\ninherits(HtmlfileReceiver, EventEmitter);\nHtmlfileReceiver.prototype.abort = function () {\n debug('abort');\n this._cleanup();\n this._close('user');\n};\nHtmlfileReceiver.prototype._cleanup = function () {\n debug('_cleanup');\n if (this.iframeObj) {\n this.iframeObj.cleanup();\n this.iframeObj = null;\n }\n delete global[iframeUtils.WPrefix][this.id];\n};\nHtmlfileReceiver.prototype._close = function (reason) {\n debug('_close', reason);\n this.emit('close', null, reason);\n this.removeAllListeners();\n};\nHtmlfileReceiver.htmlfileEnabled = false;\n\n// obfuscate to avoid firewalls\nvar axo = ['Active'].concat('Object').join('X');\nif (axo in global) {\n try {\n HtmlfileReceiver.htmlfileEnabled = !!new global[axo]('htmlfile');\n } catch (x) {\n // intentionally empty\n }\n}\nHtmlfileReceiver.enabled = HtmlfileReceiver.htmlfileEnabled || iframeUtils.iframeEnabled;\nmodule.exports = HtmlfileReceiver;","'use strict';\n\nvar inherits = require('inherits'),\n HtmlfileReceiver = require('./receiver/htmlfile'),\n XHRLocalObject = require('./sender/xhr-local'),\n AjaxBasedTransport = require('./lib/ajax-based');\nfunction HtmlFileTransport(transUrl) {\n if (!HtmlfileReceiver.enabled) {\n throw new Error('Transport created when disabled');\n }\n AjaxBasedTransport.call(this, transUrl, '/htmlfile', HtmlfileReceiver, XHRLocalObject);\n}\ninherits(HtmlFileTransport, AjaxBasedTransport);\nHtmlFileTransport.enabled = function (info) {\n return HtmlfileReceiver.enabled && info.sameOrigin;\n};\nHtmlFileTransport.transportName = 'htmlfile';\nHtmlFileTransport.roundTrips = 2;\nmodule.exports = HtmlFileTransport;","'use strict';\n\nvar inherits = require('inherits'),\n AjaxBasedTransport = require('./lib/ajax-based'),\n XhrReceiver = require('./receiver/xhr'),\n XHRCorsObject = require('./sender/xhr-cors'),\n XHRLocalObject = require('./sender/xhr-local');\nfunction XhrPollingTransport(transUrl) {\n if (!XHRLocalObject.enabled && !XHRCorsObject.enabled) {\n throw new Error('Transport created when disabled');\n }\n AjaxBasedTransport.call(this, transUrl, '/xhr', XhrReceiver, XHRCorsObject);\n}\ninherits(XhrPollingTransport, AjaxBasedTransport);\nXhrPollingTransport.enabled = function (info) {\n if (info.nullOrigin) {\n return false;\n }\n if (XHRLocalObject.enabled && info.sameOrigin) {\n return true;\n }\n return XHRCorsObject.enabled;\n};\nXhrPollingTransport.transportName = 'xhr-polling';\nXhrPollingTransport.roundTrips = 2; // preflight, ajax\n\nmodule.exports = XhrPollingTransport;","'use strict';\n\nvar inherits = require('inherits'),\n AjaxBasedTransport = require('./lib/ajax-based'),\n XdrStreamingTransport = require('./xdr-streaming'),\n XhrReceiver = require('./receiver/xhr'),\n XDRObject = require('./sender/xdr');\nfunction XdrPollingTransport(transUrl) {\n if (!XDRObject.enabled) {\n throw new Error('Transport created when disabled');\n }\n AjaxBasedTransport.call(this, transUrl, '/xhr', XhrReceiver, XDRObject);\n}\ninherits(XdrPollingTransport, AjaxBasedTransport);\nXdrPollingTransport.enabled = XdrStreamingTransport.enabled;\nXdrPollingTransport.transportName = 'xdr-polling';\nXdrPollingTransport.roundTrips = 2; // preflight, ajax\n\nmodule.exports = XdrPollingTransport;","'use strict';\n\nvar utils = require('../../utils/iframe'),\n random = require('../../utils/random'),\n browser = require('../../utils/browser'),\n urlUtils = require('../../utils/url'),\n inherits = require('inherits'),\n EventEmitter = require('events').EventEmitter;\nvar debug = function () {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:receiver:jsonp');\n}\nfunction JsonpReceiver(url) {\n debug(url);\n var self = this;\n EventEmitter.call(this);\n utils.polluteGlobalNamespace();\n this.id = 'a' + random.string(6);\n var urlWithId = urlUtils.addQuery(url, 'c=' + encodeURIComponent(utils.WPrefix + '.' + this.id));\n global[utils.WPrefix][this.id] = this._callback.bind(this);\n this._createScript(urlWithId);\n\n // Fallback mostly for Konqueror - stupid timer, 35 seconds shall be plenty.\n this.timeoutId = setTimeout(function () {\n debug('timeout');\n self._abort(new Error('JSONP script loaded abnormally (timeout)'));\n }, JsonpReceiver.timeout);\n}\ninherits(JsonpReceiver, EventEmitter);\nJsonpReceiver.prototype.abort = function () {\n debug('abort');\n if (global[utils.WPrefix][this.id]) {\n var err = new Error('JSONP user aborted read');\n err.code = 1000;\n this._abort(err);\n }\n};\nJsonpReceiver.timeout = 35000;\nJsonpReceiver.scriptErrorTimeout = 1000;\nJsonpReceiver.prototype._callback = function (data) {\n debug('_callback', data);\n this._cleanup();\n if (this.aborting) {\n return;\n }\n if (data) {\n debug('message', data);\n this.emit('message', data);\n }\n this.emit('close', null, 'network');\n this.removeAllListeners();\n};\nJsonpReceiver.prototype._abort = function (err) {\n debug('_abort', err);\n this._cleanup();\n this.aborting = true;\n this.emit('close', err.code, err.message);\n this.removeAllListeners();\n};\nJsonpReceiver.prototype._cleanup = function () {\n debug('_cleanup');\n clearTimeout(this.timeoutId);\n if (this.script2) {\n this.script2.parentNode.removeChild(this.script2);\n this.script2 = null;\n }\n if (this.script) {\n var script = this.script;\n // Unfortunately, you can't really abort script loading of\n // the script.\n script.parentNode.removeChild(script);\n script.onreadystatechange = script.onerror = script.onload = script.onclick = null;\n this.script = null;\n }\n delete global[utils.WPrefix][this.id];\n};\nJsonpReceiver.prototype._scriptError = function () {\n debug('_scriptError');\n var self = this;\n if (this.errorTimer) {\n return;\n }\n this.errorTimer = setTimeout(function () {\n if (!self.loadedOkay) {\n self._abort(new Error('JSONP script loaded abnormally (onerror)'));\n }\n }, JsonpReceiver.scriptErrorTimeout);\n};\nJsonpReceiver.prototype._createScript = function (url) {\n debug('_createScript', url);\n var self = this;\n var script = this.script = global.document.createElement('script');\n var script2; // Opera synchronous load trick.\n\n script.id = 'a' + random.string(8);\n script.src = url;\n script.type = 'text/javascript';\n script.charset = 'UTF-8';\n script.onerror = this._scriptError.bind(this);\n script.onload = function () {\n debug('onload');\n self._abort(new Error('JSONP script loaded abnormally (onload)'));\n };\n\n // IE9 fires 'error' event after onreadystatechange or before, in random order.\n // Use loadedOkay to determine if actually errored\n script.onreadystatechange = function () {\n debug('onreadystatechange', script.readyState);\n if (/loaded|closed/.test(script.readyState)) {\n if (script && script.htmlFor && script.onclick) {\n self.loadedOkay = true;\n try {\n // In IE, actually execute the script.\n script.onclick();\n } catch (x) {\n // intentionally empty\n }\n }\n if (script) {\n self._abort(new Error('JSONP script loaded abnormally (onreadystatechange)'));\n }\n }\n };\n // IE: event/htmlFor/onclick trick.\n // One can't rely on proper order for onreadystatechange. In order to\n // make sure, set a 'htmlFor' and 'event' properties, so that\n // script code will be installed as 'onclick' handler for the\n // script object. Later, onreadystatechange, manually execute this\n // code. FF and Chrome doesn't work with 'event' and 'htmlFor'\n // set. For reference see:\n // http://jaubourg.net/2010/07/loading-script-as-onclick-handler-of.html\n // Also, read on that about script ordering:\n // http://wiki.whatwg.org/wiki/Dynamic_Script_Execution_Order\n if (typeof script.async === 'undefined' && global.document.attachEvent) {\n // According to mozilla docs, in recent browsers script.async defaults\n // to 'true', so we may use it to detect a good browser:\n // https://developer.mozilla.org/en/HTML/Element/script\n if (!browser.isOpera()) {\n // Naively assume we're in IE\n try {\n script.htmlFor = script.id;\n script.event = 'onclick';\n } catch (x) {\n // intentionally empty\n }\n script.async = true;\n } else {\n // Opera, second sync script hack\n script2 = this.script2 = global.document.createElement('script');\n script2.text = \"try{var a = document.getElementById('\" + script.id + \"'); if(a)a.onerror();}catch(x){};\";\n script.async = script2.async = false;\n }\n }\n if (typeof script.async !== 'undefined') {\n script.async = true;\n }\n var head = global.document.getElementsByTagName('head')[0];\n head.insertBefore(script, head.firstChild);\n if (script2) {\n head.insertBefore(script2, head.firstChild);\n }\n};\nmodule.exports = JsonpReceiver;","'use strict';\n\nvar random = require('../../utils/random'),\n urlUtils = require('../../utils/url');\nvar debug = function () {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:sender:jsonp');\n}\nvar form, area;\nfunction createIframe(id) {\n debug('createIframe', id);\n try {\n // ie6 dynamic iframes with target=\"\" support (thanks Chris Lambacher)\n return global.document.createElement('