mirror of
https://github.com/JasonHHouse/gaps.git
synced 2026-05-21 00:39:43 -05:00
Updating versions and adding minified files
This commit is contained in:
@@ -159,7 +159,7 @@
|
||||
|
||||
<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
|
||||
<script type="text/javascript" src="js/materialize.min.js"></script>
|
||||
<script type="text/javascript" src="js/sockjs-1.3.0.min.js"></script>
|
||||
<script type="text/javascript" src="js/sockjs-1.4.0.min.js"></script>
|
||||
<script type="text/javascript" src="js/stomp-2.3.3.min.js"></script>
|
||||
<script type="text/javascript" src="js/folder.js"></script>
|
||||
</body>
|
||||
|
||||
@@ -21,7 +21,6 @@ function onStart() {
|
||||
|
||||
M.AutoInit();
|
||||
M.updateTextFields();
|
||||
|
||||
}
|
||||
|
||||
function populateCookieValues() {
|
||||
|
||||
+2
-1
@@ -1 +1,2 @@
|
||||
"use strict";function onStart(){$("#plex").click(function(){if(validateInput()){let obj;try{obj=JSON.parse(document.cookie);}catch(e){obj={};}obj.movie_db_api_key=$("#movie_db_api_key").val();document.cookie=JSON.stringify(obj);location.assign("plex_configuration.html");}});populateCookieValues();M.AutoInit();M.updateTextFields();}function populateCookieValues(){if(document.cookie){try{let obj=JSON.parse(document.cookie);if(obj.movie_db_api_key){$("#movie_db_api_key").val(obj.movie_db_api_key);}}catch(e){}}}function validateInput(){if(!$("#movie_db_api_key").val()){M.toast({html:"The MovieDB api key must not be empty"});return false;}return true;}
|
||||
function onStart(){$("#plex").click(function(){if(validateInput()){try{var a=JSON.parse(document.cookie)}catch(b){a={}}a.movie_db_api_key=$("#movie_db_api_key").val();document.cookie=JSON.stringify(a);location.assign("plex_configuration.html")}});populateCookieValues();M.AutoInit();M.updateTextFields()}function populateCookieValues(){if(document.cookie)try{var a=JSON.parse(document.cookie);a.movie_db_api_key&&$("#movie_db_api_key").val(a.movie_db_api_key)}catch(b){}}
|
||||
function validateInput(){return $("#movie_db_api_key").val()?!0:(M.toast({html:"The MovieDB api key must not be empty"}),!1)};
|
||||
|
||||
+10598
File diff suppressed because it is too large
Load Diff
+241
-2
File diff suppressed because one or more lines are too long
@@ -104,7 +104,6 @@ function getLibraries() {
|
||||
|
||||
function encodeQueryData(data) {
|
||||
const ret = [];
|
||||
|
||||
for (const d in data) {
|
||||
ret.push(encodeURIComponent(d) + "=" + encodeURIComponent(data[d]));
|
||||
}
|
||||
|
||||
@@ -171,7 +171,6 @@ function shouldDisconnect(obj) {
|
||||
contentType: "application/json",
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function showSearchStatus(obj) {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):$jscomp.arrayIterator(a)};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
|
||||
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);
|
||||
$jscomp.polyfill=function(a,b,c,d){if(b){c=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})}};$jscomp.polyfill("Math.trunc",function(a){return a?a:function(a){a=Number(a);if(isNaN(a)||Infinity===a||-Infinity===a||0===a)return a;var b=Math.floor(Math.abs(a));return 0>a?-b:b}},"es6","es3");
|
||||
var stompClient,backButton,copyToClipboard,searchResults,searchPosition,progressContainer,searchTitle,searchDescription;
|
||||
document.addEventListener("DOMContentLoaded",function(){var a=document.querySelectorAll(".modal");M.Modal.init(a);searchResults=$("#searchResults");backButton=$("#cancel");copyToClipboard=$("#copyToClipboard");searchResults=$("#searchResults");searchPosition=$("#searchPosition");progressContainer=$("#progressContainer");searchTitle=$("#searchTitle");searchDescription=$("#searchDescription");backButton.click(function(){$("#warningModal").modal("open")});setCopyToClipboardEnabled(!1);copyToClipboard.click(function(){CopyToClipboard("searchResults");
|
||||
M.toast({html:"Copied to Clipboard"})});$("#agree").click(function(){$.ajax({type:"PUT",url:"http://"+location.hostname+":"+location.port+"/cancelSearch",contentType:"application/json"});location.assign("index.html")});connect();search()});window.onbeforeunload=function(){disconnect()};function setCopyToClipboardEnabled(a){a?copyToClipboard.removeClass("disabled"):copyToClipboard.addClass("disabled")}
|
||||
function search(){progressContainer.hide();searchTitle.text("Searching for Movies...");searchDescription.text("Gaps is looking through your Plex libraries. This could take a while so just sit tight and we'll find all the missing movies for you.");for(var a=JSON.parse(document.cookie),b=[],c=$jscomp.makeIterator(a.libraries),d=c.next();!d.done;d=c.next())d="http://"+a.address+":"+a.port+"/library/sections/"+d.value.key+"/all/?"+encodeQueryData({"X-Plex-Token":a.plex_token}),b.push(d);$.ajax({type:"POST",
|
||||
url:"http://"+location.hostname+":"+location.port+"/submit",data:JSON.stringify({movieDbApiKey:a.movie_db_api_key,writeToFile:!0,searchFromPlex:!0,movieUrls:b}),contentType:"application/json",timeout:0,success:function(a){var b="";a.forEach(function(a){b+=buildMovieDiv(a)});searchTitle.text(a.length+" movies to add to complete your collections");searchDescription.text("Below is everything Gaps found that is missing from your movie collections.");progressContainer.hide();backButton.text("restart");
|
||||
setCopyToClipboardEnabled(!0)},error:function(a){disconnect();a&&(a=JSON.parse(a.responseText).message,Console.error(a));searchTitle.text("An error occurred...");searchDescription.text("");progressContainer.hide();backButton.text("restart");setCopyToClipboardEnabled(!1)}});showSearchStatus()}function buildMoviesDiv(a){var b="";a=$jscomp.makeIterator(a);for(var c=a.next();!c.done;c=a.next())b+=buildMovieDiv(c.value);return b}function buildMovieDiv(a){return"<div>"+buildMovie(a)+"</div>"}
|
||||
function buildMovie(a){return a.name+" ("+a.year+") from '"+a.collection+"'"}function connect(){var a=new SockJS("/gs-guide-websocket");stompClient=Stomp.over(a);stompClient.connect({},function(a){stompClient.subscribe("/topic/currentSearchResults",function(a){a=JSON.parse(a.body);showSearchStatus(a);shouldDisconnect(a)})})}function disconnect(){null!==stompClient&&stompClient.disconnect();console.log("Disconnected")}
|
||||
function shouldDisconnect(a){a&&a.searchedMovieCount&&a.totalMovieCount&&a.totalMovieCount===a.searchedMovieCount&&(disconnect(),$.ajax({type:"PUT",url:"http://"+location.hostname+":"+location.port+"/cancelSearch",contentType:"application/json"}))}
|
||||
function showSearchStatus(a){if(a&&(a.searchedMovieCount||a.totalMovieCount||0!==a.totalMovieCount)){progressContainer.show();var b=Math.trunc(a.searchedMovieCount/a.totalMovieCount*100);searchPosition.html("<h5>"+a.searchedMovieCount+" of "+a.totalMovieCount+" movies searched. "+b+"% complete.</h5>");searchResults.html(buildMoviesDiv(a.moviesFound));$("#progressBar").css("width",b+"%")}else searchResults.html("")}
|
||||
function encodeQueryData(a){var b=[],c;for(c in a)b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b.join("&")}function CopyToClipboard(a){if(document.selection){var b=document.body.createTextRange();b.moveToElementText(document.getElementById(a));b.select().createTextRange();document.execCommand("copy")}else window.getSelection&&(b=document.createRange(),b.selectNode(document.getElementById(a)),window.getSelection().addRange(b),document.execCommand("copy"))};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
+185
@@ -0,0 +1,185 @@
|
||||
sockjs-1.4.0.js:807: WARNING - [JSC_UNREACHABLE_CODE] unreachable code
|
||||
for (var Transport = this._transports.shift(); Transport; Transport = this._transports.shift()) {
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
sockjs-1.4.0.js:4062: WARNING - [JSC_UNREACHABLE_CODE] unreachable code
|
||||
} catch (error) {// Swallow
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
sockjs-1.4.0.js:4658: WARNING - [JSC_SUSPICIOUS_SEMICOLON] If this if/for/while really shouldn't have a body, use {}
|
||||
for (length = members.length; property = members[--length]; hasProperty.call(object, property) && callback(property));
|
||||
^
|
||||
|
||||
sockjs-1.4.0.js:4767: WARNING - [JSC_SUSPICIOUS_SEMICOLON] If this if/for/while really shouldn't have a body, use {}
|
||||
for (year = floor(date / 365.2425) + 1970 - 1; getDay(year + 1, 0) <= date; year++);
|
||||
^
|
||||
|
||||
sockjs-1.4.0.js:4768: WARNING - [JSC_SUSPICIOUS_SEMICOLON] If this if/for/while really shouldn't have a body, use {}
|
||||
for (month = floor((date - getDay(year, 0)) / 30.42); getDay(year, month + 1) <= date; month++);
|
||||
^
|
||||
|
||||
sockjs-1.4.0.js:4885: WARNING - [JSC_SUSPICIOUS_SEMICOLON] If this if/for/while really shouldn't have a body, use {}
|
||||
for (var index = 0, length = filter.length, value; index < length; value = filter[index++], ((className = getClass.call(value)), className == stringClass || className == numberClass) && (properties[value] = 1));
|
||||
^
|
||||
|
||||
sockjs-1.4.0.js:4893: WARNING - [JSC_SUSPICIOUS_SEMICOLON] If this if/for/while really shouldn't have a body, use {}
|
||||
for (whitespace = "", width > 10 && (width = 10); whitespace.length < width; whitespace += " ");
|
||||
^
|
||||
|
||||
sockjs-1.4.0.js:5034: WARNING - [JSC_SUSPICIOUS_SEMICOLON] If this if/for/while really shouldn't have a body, use {}
|
||||
for (; Index < length && ((charCode = source.charCodeAt(Index)), charCode >= 48 && charCode <= 57); Index++);
|
||||
^
|
||||
|
||||
sockjs-1.4.0.js:5040: WARNING - [JSC_SUSPICIOUS_SEMICOLON] If this if/for/while really shouldn't have a body, use {}
|
||||
for (; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);
|
||||
^
|
||||
|
||||
sockjs-1.4.0.js:5058: WARNING - [JSC_SUSPICIOUS_SEMICOLON] If this if/for/while really shouldn't have a body, use {}
|
||||
for (position = Index; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);
|
||||
^
|
||||
|
||||
0 error(s), 11 warning(s)
|
||||
/*
|
||||
JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 2012-2014, Kit Cambridge | http://kit.mit-license.org */
|
||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var f=0;return function(){return f<a.length?{done:!1,value:a[f++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
|
||||
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,f,h){a!=Array.prototype&&a!=Object.prototype&&(a[f]=h.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};
|
||||
$jscomp.SymbolClass=function(a,f){this.$jscomp$symbol$id_=a;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:f})};$jscomp.SymbolClass.prototype.toString=function(){return this.$jscomp$symbol$id_};$jscomp.Symbol=function(){function a(h){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return new $jscomp.SymbolClass($jscomp.SYMBOL_PREFIX+(h||"")+"_"+f++,h)}var f=0;return a}();
|
||||
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("Symbol.iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}});$jscomp.initSymbolIterator=function(){}};
|
||||
$jscomp.initSymbolAsyncIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.asyncIterator;a||(a=$jscomp.global.Symbol.asyncIterator=$jscomp.global.Symbol("Symbol.asyncIterator"));$jscomp.initSymbolAsyncIterator=function(){}};$jscomp.iteratorPrototype=function(a){$jscomp.initSymbolIterator();a={next:a};a[$jscomp.global.Symbol.iterator]=function(){return this};return a};
|
||||
$jscomp.iteratorFromArray=function(a,f){$jscomp.initSymbolIterator();a instanceof String&&(a+="");var h=0,c={next:function(){if(h<a.length){var b=h++;return{value:f(b,a[b]),done:!1}}c.next=function(){return{done:!0,value:void 0}};return c.next()}};c[Symbol.iterator]=function(){return c};return c};
|
||||
$jscomp.polyfill=function(a,f,h,c){if(f){h=$jscomp.global;a=a.split(".");for(c=0;c<a.length-1;c++){var b=a[c];b in h||(h[b]={});h=h[b]}a=a[a.length-1];c=h[a];f=f(c);f!=c&&null!=f&&$jscomp.defineProperty(h,a,{configurable:!0,writable:!0,value:f})}};$jscomp.polyfill("Array.prototype.keys",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(a){return a})}},"es6","es3");
|
||||
(function(a){"object"===typeof exports&&"undefined"!==typeof module?module.exports=a():"function"===typeof define&&define.amd?define([],a):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).SockJS=a()})(function(){return function(){function a(f,h,c){function b(e,g){if(!h[e]){if(!f[e]){var k="function"==typeof require&&require;if(!g&&k)return k(e,!0);if(d)return d(e,!0);g=Error("Cannot find module '"+e+"'");throw g.code="MODULE_NOT_FOUND",g;
|
||||
}g=h[e]={exports:{}};f[e][0].call(g.exports,function(a){return b(f[e][1][a]||a)},g,g.exports,a,f,h,c)}return h[e].exports}for(var d="function"==typeof require&&require,k=0;k<c.length;k++)b(c[k]);return b}return a}()({1:[function(a,f,h){h="undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{};var c=a("./transport-list");f.exports=a("./main")(c);"_sockjs_onload"in h&&setTimeout(h._sockjs_onload,1)},{"./main":14,"./transport-list":16}],2:[function(a,f,
|
||||
h){function c(){b.call(this);this.initEvent("close",!1,!1);this.wasClean=!1;this.code=0;this.reason=""}h=a("inherits");var b=a("./event");h(c,b);f.exports=c},{"./event":4,inherits:57}],3:[function(a,f,h){function c(){b.call(this)}h=a("inherits");var b=a("./eventtarget");h(c,b);c.prototype.removeAllListeners=function(a){a?delete this._listeners[a]:this._listeners={}};c.prototype.once=function(a,b){function d(){g.removeListener(a,d);c||(c=!0,b.apply(this,arguments))}var g=this,c=!1;this.on(a,d)};c.prototype.emit=
|
||||
function(){var a=this._listeners[arguments[0]];if(a){for(var b=arguments.length,c=Array(b-1),g=1;g<b;g++)c[g-1]=arguments[g];for(b=0;b<a.length;b++)a[b].apply(this,c)}};c.prototype.on=c.prototype.addListener=b.prototype.addEventListener;c.prototype.removeListener=b.prototype.removeEventListener;f.exports.EventEmitter=c},{"./eventtarget":5,inherits:57}],4:[function(a,f,h){function c(a){this.type=a}c.prototype.initEvent=function(a,d,c){this.type=a;this.bubbles=d;this.cancelable=c;this.timeStamp=+new Date;
|
||||
return this};c.prototype.stopPropagation=function(){};c.prototype.preventDefault=function(){};c.CAPTURING_PHASE=1;c.AT_TARGET=2;c.BUBBLING_PHASE=3;f.exports=c},{}],5:[function(a,f,h){function c(){this._listeners={}}c.prototype.addEventListener=function(a,d){a in this._listeners||(this._listeners[a]=[]);var b=this._listeners[a];-1===b.indexOf(d)&&(b=b.concat([d]));this._listeners[a]=b};c.prototype.removeEventListener=function(a,d){var b=this._listeners[a];b&&(d=b.indexOf(d),-1!==d&&(1<b.length?this._listeners[a]=
|
||||
b.slice(0,d).concat(b.slice(d+1)):delete this._listeners[a]))};c.prototype.dispatchEvent=function(){var a=arguments[0],d=a.type;a=1===arguments.length?[a]:Array.apply(null,arguments);this["on"+d]&&this["on"+d].apply(this,a);if(d in this._listeners){d=this._listeners[d];for(var c=0;c<d.length;c++)d[c].apply(this,a)}};f.exports=c},{}],6:[function(a,f,h){function c(a){b.call(this);this.initEvent("message",!1,!1);this.data=a}h=a("inherits");var b=a("./event");h(c,b);f.exports=c},{"./event":4,inherits:57}],
|
||||
7:[function(a,f,h){function c(a){this._transport=a;a.on("message",this._transportMessage.bind(this));a.on("close",this._transportClose.bind(this))}var b=a("json3"),d=a("./utils/iframe");c.prototype._transportClose=function(a,c){d.postMessage("c",b.stringify([a,c]))};c.prototype._transportMessage=function(a){d.postMessage("t",a)};c.prototype._send=function(a){this._transport.send(a)};c.prototype._close=function(){this._transport.close();this._transport.removeAllListeners()};f.exports=c},{"./utils/iframe":47,
|
||||
json3:58}],8:[function(a,f,h){(function(c){var b=a("./utils/url"),d=a("./utils/event"),k=a("json3"),e=a("./facade"),g=a("./info-iframe-receiver"),m=a("./utils/iframe"),p=a("./location"),n=function(){};"production"!==c.env.NODE_ENV&&(n=a("debug")("sockjs-client:iframe-bootstrap"));f.exports=function(a,c){var q={};c.forEach(function(a){a.facadeTransport&&(q[a.facadeTransport.transportName]=a.facadeTransport)});q[g.transportName]=g;var E;a.bootstrap_iframe=function(){var c;m.currentWindowId=p.hash.slice(1);
|
||||
d.attachEvent("message",function(d){if(d.source===parent&&("undefined"===typeof E&&(E=d.origin),d.origin===E)){try{var g=k.parse(d.data)}catch(G){n("bad json",d.data);return}if(g.windowId===m.currentWindowId)switch(g.type){case "s":try{var l=k.parse(g.data)}catch(G){n("bad json",g.data);break}d=l[0];g=l[1];var f=l[2];l=l[3];n(d,g,f,l);if(d!==a.version)throw Error('Incompatible SockJS! Main site uses: "'+d+'", the iframe: "'+a.version+'".');if(!b.isOriginEqual(f,p.href)||!b.isOriginEqual(l,p.href))throw Error("Can't connect to different domain from within an iframe. ("+
|
||||
p.href+", "+f+", "+l+")");c=new e(new q[g](f,l));break;case "m":c._send(g.data);break;case "c":c&&c._close(),c=null}}});m.postMessage("s")}}}).call(this,{env:{}})},{"./facade":7,"./info-iframe-receiver":10,"./location":13,"./utils/event":46,"./utils/iframe":47,"./utils/url":52,debug:55,json3:58}],9:[function(a,f,h){(function(c){function b(a,b){d.call(this);var c=this,l=+new Date;this.xo=new b("GET",a);this.xo.once("finish",function(a,b){if(200===a){var d=+new Date-l;if(b)try{var q=e.parse(b)}catch(F){m("bad json",
|
||||
b)}g.isObject(q)||(q={})}c.emit("finish",q,d);c.removeAllListeners()})}var d=a("events").EventEmitter,k=a("inherits"),e=a("json3"),g=a("./utils/object"),m=function(){};"production"!==c.env.NODE_ENV&&(m=a("debug")("sockjs-client:info-ajax"));k(b,d);b.prototype.close=function(){this.removeAllListeners();this.xo.close()};f.exports=b}).call(this,{env:{}})},{"./utils/object":49,debug:55,events:3,inherits:57,json3:58}],10:[function(a,f,h){function c(a){var c=this;b.call(this);this.ir=new e(a,k);this.ir.once("finish",
|
||||
function(a,b){c.ir=null;c.emit("message",d.stringify([a,b]))})}h=a("inherits");var b=a("events").EventEmitter,d=a("json3"),k=a("./transport/sender/xhr-local"),e=a("./info-ajax");h(c,b);c.transportName="iframe-info-receiver";c.prototype.close=function(){this.ir&&(this.ir.close(),this.ir=null);this.removeAllListeners()};f.exports=c},{"./info-ajax":9,"./transport/sender/xhr-local":37,events:3,inherits:57,json3:58}],11:[function(a,f,h){(function(c,b){function d(a,d){var c=this;k.call(this);var e=function(){var b=
|
||||
c.ifr=new p(n.transportName,d,a);b.once("message",function(a){if(a){try{var b=g.parse(a)}catch(P){h("bad json",a);c.emit("finish");c.close();return}c.emit("finish",b[0],b[1])}c.close()});b.once("close",function(){c.emit("finish");c.close()})};b.document.body?e():m.attachEvent("load",e)}var k=a("events").EventEmitter,e=a("inherits"),g=a("json3"),m=a("./utils/event"),p=a("./transport/iframe"),n=a("./info-iframe-receiver"),h=function(){};"production"!==c.env.NODE_ENV&&(h=a("debug")("sockjs-client:info-iframe"));
|
||||
e(d,k);d.enabled=function(){return p.enabled()};d.prototype.close=function(){this.ifr&&this.ifr.close();this.removeAllListeners();this.ifr=null};f.exports=d}).call(this,{env:{}},"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"./info-iframe-receiver":10,"./transport/iframe":22,"./utils/event":46,debug:55,events:3,inherits:57,json3:58}],12:[function(a,f,h){(function(c){function b(a,b){q(a);var c=this;d.call(this);setTimeout(function(){c.doXhr(a,
|
||||
b)},0)}var d=a("events").EventEmitter,k=a("inherits"),e=a("./utils/url"),g=a("./transport/sender/xdr"),m=a("./transport/sender/xhr-cors"),p=a("./transport/sender/xhr-local"),n=a("./transport/sender/xhr-fake"),h=a("./info-iframe"),l=a("./info-ajax"),q=function(){};"production"!==c.env.NODE_ENV&&(q=a("debug")("sockjs-client:info-receiver"));k(b,d);b._getReceiver=function(a,b,d){return d.sameOrigin?new l(b,p):m.enabled?new l(b,m):g.enabled&&d.sameScheme?new l(b,g):h.enabled()?new h(a,b):new l(b,n)};
|
||||
b.prototype.doXhr=function(a,d){var c=this,g=e.addPath(a,"/info");q("doXhr",g);this.xo=b._getReceiver(a,g,d);this.timeoutRef=setTimeout(function(){q("timeout");c._cleanup(!1);c.emit("finish")},b.timeout);this.xo.once("finish",function(a,b){q("finish",a,b);c._cleanup(!0);c.emit("finish",a,b)})};b.prototype._cleanup=function(a){q("_cleanup");clearTimeout(this.timeoutRef);this.timeoutRef=null;!a&&this.xo&&this.xo.close();this.xo=null};b.prototype.close=function(){q("close");this.removeAllListeners();
|
||||
this._cleanup(!1)};b.timeout=8E3;f.exports=b}).call(this,{env:{}})},{"./info-ajax":9,"./info-iframe":11,"./transport/sender/xdr":34,"./transport/sender/xhr-cors":35,"./transport/sender/xhr-fake":36,"./transport/sender/xhr-local":37,"./utils/url":52,debug:55,events:3,inherits:57}],13:[function(a,f,h){f.exports=("undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{}).location||{origin:"http://localhost:80",protocol:"http:",host:"localhost",port:80,href:"http://localhost/",
|
||||
hash:""}},{}],14:[function(a,f,h){(function(c,b){function d(a,b,c){if(!(this instanceof d))return new d(a,b,c);if(1>arguments.length)throw new TypeError("Failed to construct 'SockJS: 1 argument required, but only 0 present");F.call(this);this.readyState=d.CONNECTING;this.protocol=this.extensions="";c=c||{};c.protocols_whitelist&&X.warn("'protocols_whitelist' is DEPRECATED. Use 'transports' instead.");this._transportsWhitelist=c.transports;this._transportOptions=c.transportOptions||{};this._timeout=
|
||||
c.timeout||0;var g=c.sessionId||8;if("function"===typeof g)this._generateSessionId=g;else if("number"===typeof g)this._generateSessionId=function(){return m.string(g)};else throw new TypeError("If sessionId is used in the options, it needs to be a number or a function.");this._server=c.server||m.numberString(1E3);var e=new k(a);if(e.host&&e.protocol){if(e.hash)throw new SyntaxError("The URL must not contain a fragment");if("http:"!==e.protocol&&"https:"!==e.protocol)throw new SyntaxError("The URL's scheme must be either 'http:' or 'https:'. '"+
|
||||
e.protocol+"' is not allowed.");}else throw new SyntaxError("The URL '"+a+"' is invalid");var q="https:"===e.protocol;if("https:"===z.protocol&&!q)throw Error("SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS");b?Array.isArray(b)||(b=[b]):b=[];var l=b.sort();l.forEach(function(a,b){if(!a)throw new SyntaxError("The protocols entry '"+a+"' is invalid.");if(b<l.length-1&&a===l[b+1])throw new SyntaxError("The protocols entry '"+a+"' is duplicated.");});this._origin=
|
||||
(q=n.getOrigin(z.href))?q.toLowerCase():null;e.set("pathname",e.pathname.replace(/\/+$/,""));this.url=e.href;u("using url",this.url);this._urlInfo={nullOrigin:!E.hasDomain(),sameOrigin:n.isOriginEqual(this.url,z.href),sameScheme:n.isSchemeEqual(this.url,z.href)};this._ir=new R(this.url,this._urlInfo);this._ir.once("finish",this._receiveInfo.bind(this))}a("./shims");var k=a("url-parse"),e=a("inherits"),g=a("json3"),m=a("./utils/random"),p=a("./utils/escape"),n=a("./utils/url"),h=a("./utils/event"),
|
||||
l=a("./utils/transport"),q=a("./utils/object"),E=a("./utils/browser"),X=a("./utils/log"),w=a("./event/event"),F=a("./event/eventtarget"),z=a("./location"),P=a("./event/close"),G=a("./event/trans-message"),R=a("./info-receiver"),u=function(){};"production"!==c.env.NODE_ENV&&(u=a("debug")("sockjs-client:main"));var S;e(d,F);d.prototype.close=function(a,b){if(a&&!(1E3===a||3E3<=a&&4999>=a))throw Error("InvalidAccessError: Invalid code");if(b&&123<b.length)throw new SyntaxError("reason argument has an invalid length");
|
||||
this.readyState!==d.CLOSING&&this.readyState!==d.CLOSED&&this._close(a||1E3,b||"Normal closure",!0)};d.prototype.send=function(a){"string"!==typeof a&&(a=""+a);if(this.readyState===d.CONNECTING)throw Error("InvalidStateError: The connection has not been established yet");this.readyState===d.OPEN&&this._transport.send(p.quote(a))};d.version=a("./version");d.CONNECTING=0;d.OPEN=1;d.CLOSING=2;d.CLOSED=3;d.prototype._receiveInfo=function(a,b){u("_receiveInfo",b);this._ir=null;a?(this._rto=this.countRTO(b),
|
||||
this._transUrl=a.base_url?a.base_url:this.url,a=q.extend(a,this._urlInfo),u("info",a),this._transports=S.filterToEnabled(this._transportsWhitelist,a).main,u(this._transports.length+" enabled transports"),this._connect()):this._close(1002,"Cannot connect to server")};d.prototype._connect=function(){for(var a=this._transports.shift();a;){u("attempt",a.transportName);if(a.needBody&&(!b.document.body||"undefined"!==typeof b.document.readyState&&"complete"!==b.document.readyState&&"interactive"!==b.document.readyState)){u("waiting for body");
|
||||
this._transports.unshift(a);h.attachEvent("load",this._connect.bind(this));return}var d=Math.max(this._timeout,this._rto*a.roundTrips||5E3);this._transportTimeoutId=setTimeout(this._transportTimeout.bind(this),d);u("using timeout",d);d=n.addPath(this._transUrl,"/"+this._server+"/"+this._generateSessionId());var c=this._transportOptions[a.transportName];u("transport url",d);d=new a(d,this._transUrl,c);d.on("message",this._transportMessage.bind(this));d.once("close",this._transportClose.bind(this));
|
||||
d.transportName=a.transportName;this._transport=d;return}this._close(2E3,"All transports failed",!1)};d.prototype._transportTimeout=function(){u("_transportTimeout");this.readyState===d.CONNECTING&&(this._transport&&this._transport.close(),this._transportClose(2007,"Transport timed out"))};d.prototype._transportMessage=function(a){u("_transportMessage",a);var b=this,d=a.slice(0,1);a=a.slice(1);switch(d){case "o":this._open();return;case "h":this.dispatchEvent(new w("heartbeat"));u("heartbeat",this.transport);
|
||||
return}if(a)try{var c=g.parse(a)}catch(Q){u("bad json",a)}if("undefined"===typeof c)u("empty payload",a);else switch(d){case "a":Array.isArray(c)&&c.forEach(function(a){u("message",b.transport,a);b.dispatchEvent(new G(a))});break;case "m":u("message",this.transport,c);this.dispatchEvent(new G(c));break;case "c":Array.isArray(c)&&2===c.length&&this._close(c[0],c[1],!0)}};d.prototype._transportClose=function(a,b){u("_transportClose",this.transport,a,b);this._transport&&(this._transport.removeAllListeners(),
|
||||
this.transport=this._transport=null);1E3===a||3E3<=a&&4999>=a||2E3===a||this.readyState!==d.CONNECTING?this._close(a,b):this._connect()};d.prototype._open=function(){u("_open",this._transport&&this._transport.transportName,this.readyState);this.readyState===d.CONNECTING?(this._transportTimeoutId&&(clearTimeout(this._transportTimeoutId),this._transportTimeoutId=null),this.readyState=d.OPEN,this.transport=this._transport.transportName,this.dispatchEvent(new w("open")),u("connected",this.transport)):
|
||||
this._close(1006,"Server lost session")};d.prototype._close=function(a,b,c){u("_close",this.transport,a,b,c,this.readyState);var g=!1;this._ir&&(g=!0,this._ir.close(),this._ir=null);this._transport&&(this._transport.close(),this.transport=this._transport=null);if(this.readyState===d.CLOSED)throw Error("InvalidStateError: SockJS has already been closed");this.readyState=d.CLOSING;setTimeout(function(){this.readyState=d.CLOSED;g&&this.dispatchEvent(new w("error"));var e=new P("close");e.wasClean=c||
|
||||
!1;e.code=a||1E3;e.reason=b;this.dispatchEvent(e);this.onmessage=this.onclose=this.onerror=null;u("disconnected")}.bind(this),0)};d.prototype.countRTO=function(a){return 100<a?4*a:300+a};f.exports=function(b){S=l(b);a("./iframe-bootstrap")(d,b);return d}}).call(this,{env:{}},"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"./event/close":2,"./event/event":4,"./event/eventtarget":5,"./event/trans-message":6,"./iframe-bootstrap":8,"./info-receiver":12,
|
||||
"./location":13,"./shims":15,"./utils/browser":44,"./utils/escape":45,"./utils/event":46,"./utils/log":48,"./utils/object":49,"./utils/random":50,"./utils/transport":51,"./utils/url":52,"./version":53,debug:55,inherits:57,json3:58,"url-parse":61}],15:[function(a,f,h){function c(){}var b=Array.prototype,d=Object.prototype;f=Function.prototype;var k=String.prototype,e=b.slice,g=d.toString;if(a=Object.defineProperty)try{Object.defineProperty({},"x",{}),a=!0}catch(q){a=!1}var m=a?function(a,b,d,c){!c&&
|
||||
b in a||Object.defineProperty(a,b,{configurable:!0,enumerable:!1,writable:!0,value:d})}:function(a,b,d,c){!c&&b in a||(a[b]=d)};a=function(a,b,c){for(var g in b)d.hasOwnProperty.call(b,g)&&m(a,g,b[g],c)};var p=function(a){if(null==a)throw new TypeError("can't convert "+a+" to object");return Object(a)};a(f,{bind:function(a){var b=this;if("[object Function]"!==d.toString.call(b))throw new TypeError("Function.prototype.bind called on incompatible "+b);for(var g=e.call(arguments,1),l=Math.max(0,b.length-
|
||||
g.length),q=[],k=0;k<l;k++)q.push("$"+k);var m=Function("binder","return function ("+q.join(",")+"){ return binder.apply(this, arguments); }")(function(){if(this instanceof m){var d=b.apply(this,g.concat(e.call(arguments)));return Object(d)===d?d:this}return b.apply(a,g.concat(e.call(arguments)))});b.prototype&&(c.prototype=b.prototype,m.prototype=new c,c.prototype=null);return m}});a(Array,{isArray:function(a){return"[object Array]"===g.call(a)}});f=Object("a");var n="a"!==f[0]||!(0 in f);a(b,{forEach:function(a,
|
||||
b){var c=p(this),e=n&&"[object String]"===g.call(this)?this.split(""):c,l=-1,q=e.length>>>0;if("[object Function]"!==d.toString.call(a))throw new TypeError;for(;++l<q;)l in e&&a.call(b,e[l],l,c)}},!function(a){var b=!0,d=!0;a&&(a.call("foo",function(a,d,c){"object"!==typeof c&&(b=!1)}),a.call([1],function(){d="string"===typeof this},"x"));return!!a&&b&&d}(b.forEach));f=Array.prototype.indexOf&&-1!==[0,1].indexOf(1,2);a(b,{indexOf:function(a){var b=n&&"[object String]"===g.call(this)?this.split(""):
|
||||
p(this),d=b.length>>>0;if(!d)return-1;var c=0;1<arguments.length&&(c=+arguments[1],c!==c?c=0:0!==c&&c!==1/0&&c!==-(1/0)&&(c=(0<c||-1)*Math.floor(Math.abs(c))));for(c=0<=c?c:Math.max(0,d+c);c<d;c++)if(c in b&&b[c]===a)return c;return-1}},f);var t=k.split;2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||4!=="test".split(/(?:)/,-1).length||"".split(/.?/).length||1<".".split(/()()/).length?function(){var a=void 0===/()??/.exec("")[1];k.split=function(c,
|
||||
d){var e=this;if(void 0===c&&0===d)return[];if("[object RegExp]"!==g.call(c))return t.call(this,c,d);var l=[],q=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.extended?"x":"")+(c.sticky?"y":""),k=0,m,f;c=new RegExp(c.source,q+"g");e+="";a||(m=new RegExp("^"+c.source+"$(?!\\s)",q));for(d=void 0===d?4294967295:d>>>0;f=c.exec(e);){q=f.index+f[0].length;if(q>k){l.push(e.slice(k,f.index));!a&&1<f.length&&f[0].replace(m,function(){for(var a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(f[a]=void 0)});
|
||||
1<f.length&&f.index<e.length&&b.push.apply(l,f.slice(1));var n=f[0].length;k=q;if(l.length>=d)break}c.lastIndex===f.index&&c.lastIndex++}k===e.length?(n||!c.test(""))&&l.push(""):l.push(e.slice(k));return l.length>d?l.slice(0,d):l}}():"0".split(void 0,0).length&&(k.split=function(a,b){return void 0===a&&0===b?[]:t.call(this,a,b)});var l=k.substr;f="".substr&&"b"!=="0b".substr(-1);a(k,{substr:function(a,b){return l.call(this,0>a?0>(a=this.length+a)?0:a:a,b)}},f)},{}],16:[function(a,f,h){f.exports=
|
||||
[a("./transport/websocket"),a("./transport/xhr-streaming"),a("./transport/xdr-streaming"),a("./transport/eventsource"),a("./transport/lib/iframe-wrap")(a("./transport/eventsource")),a("./transport/htmlfile"),a("./transport/lib/iframe-wrap")(a("./transport/htmlfile")),a("./transport/xhr-polling"),a("./transport/xdr-polling"),a("./transport/lib/iframe-wrap")(a("./transport/xhr-polling")),a("./transport/jsonp-polling")]},{"./transport/eventsource":20,"./transport/htmlfile":21,"./transport/jsonp-polling":23,
|
||||
"./transport/lib/iframe-wrap":26,"./transport/websocket":38,"./transport/xdr-polling":39,"./transport/xdr-streaming":40,"./transport/xhr-polling":41,"./transport/xhr-streaming":42}],17:[function(a,f,h){(function(c,b){function d(a,b,c,d){n(a,b);var g=this;k.call(this);setTimeout(function(){g._start(a,b,c,d)},0)}var k=a("events").EventEmitter,e=a("inherits"),g=a("../../utils/event"),m=a("../../utils/url"),h=b.XMLHttpRequest,n=function(){};"production"!==c.env.NODE_ENV&&(n=a("debug")("sockjs-client:browser:xhr"));
|
||||
e(d,k);d.prototype._start=function(a,b,c,e){var l=this;try{this.xhr=new h}catch(z){}if(this.xhr){b=m.addQuery(b,"t="+ +new Date);this.unloadRef=g.unloadAdd(function(){n("unload cleanup");l._cleanup(!0)});try{this.xhr.open(a,b,!0),this.timeout&&"timeout"in this.xhr&&(this.xhr.timeout=this.timeout,this.xhr.ontimeout=function(){n("xhr timeout");l.emit("finish",0,"");l._cleanup(!1)})}catch(z){n("exception",z);this.emit("finish",0,"");this._cleanup(!1);return}e&&e.noCredentials||!d.supportsCORS||(n("withCredentials"),
|
||||
this.xhr.withCredentials=!0);if(e&&e.headers)for(var k in e.headers)this.xhr.setRequestHeader(k,e.headers[k]);this.xhr.onreadystatechange=function(){if(l.xhr){var a=l.xhr;n("readyState",a.readyState);switch(a.readyState){case 3:try{var b=a.status;var c=a.responseText}catch(R){}n("status",b);1223===b&&(b=204);200===b&&c&&0<c.length&&(n("chunk"),l.emit("chunk",b,c));break;case 4:b=a.status;n("status",b);1223===b&&(b=204);if(12005===b||12029===b)b=0;n("finish",b,a.responseText);l.emit("finish",b,a.responseText);
|
||||
l._cleanup(!1)}}};try{l.xhr.send(c)}catch(z){l.emit("finish",0,""),l._cleanup(!1)}}else n("no xhr"),this.emit("finish",0,"no xhr support"),this._cleanup()};d.prototype._cleanup=function(a){n("cleanup");if(this.xhr){this.removeAllListeners();g.unloadDel(this.unloadRef);this.xhr.onreadystatechange=function(){};this.xhr.ontimeout&&(this.xhr.ontimeout=null);if(a)try{this.xhr.abort()}catch(q){}this.unloadRef=this.xhr=null}};d.prototype.close=function(){n("close");this._cleanup(!0)};d.enabled=!!h;var t=
|
||||
["Active"].concat("Object").join("X");!d.enabled&&t in b&&(n("overriding xmlhttprequest"),h=function(){try{return new b[t]("Microsoft.XMLHTTP")}catch(l){return null}},d.enabled=!!new h);c=!1;try{c="withCredentials"in new h}catch(l){}d.supportsCORS=c;f.exports=d}).call(this,{env:{}},"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"../../utils/event":46,"../../utils/url":52,debug:55,events:3,inherits:57}],18:[function(a,f,h){f.exports=("undefined"!==
|
||||
typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{}).EventSource},{}],19:[function(a,f,h){(function(a){var b=a.WebSocket||a.MozWebSocket;f.exports=b?function(a){return new b(a)}:void 0}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],20:[function(a,f,h){function c(a){if(!c.enabled())throw Error("Transport created when disabled");b.call(this,a,"/eventsource",d,k)}h=a("inherits");var b=a("./lib/ajax-based"),
|
||||
d=a("./receiver/eventsource"),k=a("./sender/xhr-cors"),e=a("eventsource");h(c,b);c.enabled=function(){return!!e};c.transportName="eventsource";c.roundTrips=2;f.exports=c},{"./lib/ajax-based":24,"./receiver/eventsource":29,"./sender/xhr-cors":35,eventsource:18,inherits:57}],21:[function(a,f,h){function c(a){if(!b.enabled)throw Error("Transport created when disabled");k.call(this,a,"/htmlfile",b,d)}h=a("inherits");var b=a("./receiver/htmlfile"),d=a("./sender/xhr-local"),k=a("./lib/ajax-based");h(c,
|
||||
k);c.enabled=function(a){return b.enabled&&a.sameOrigin};c.transportName="htmlfile";c.roundTrips=2;f.exports=c},{"./lib/ajax-based":24,"./receiver/htmlfile":30,"./sender/xhr-local":37,inherits:57}],22:[function(a,f,h){(function(c){function b(a,c,d){if(!b.enabled())throw Error("Transport created when disabled");e.call(this);var g=this;this.origin=m.getOrigin(d);this.baseUrl=d;this.transUrl=c;this.transport=a;this.windowId=t.string(8);d=m.addPath(d,"/iframe.html")+"#"+this.windowId;l(a,c,d);this.iframeObj=
|
||||
h.createIframe(d,function(a){l("err callback");g.emit("close",1006,"Unable to load an iframe ("+a+")");g.close()});this.onmessageCallback=this._message.bind(this);n.attachEvent("message",this.onmessageCallback)}var d=a("inherits"),k=a("json3"),e=a("events").EventEmitter,g=a("../version"),m=a("../utils/url"),h=a("../utils/iframe"),n=a("../utils/event"),t=a("../utils/random"),l=function(){};"production"!==c.env.NODE_ENV&&(l=a("debug")("sockjs-client:transport:iframe"));d(b,e);b.prototype.close=function(){l("close");
|
||||
this.removeAllListeners();if(this.iframeObj){n.detachEvent("message",this.onmessageCallback);try{this.postMessage("c")}catch(q){}this.iframeObj.cleanup();this.onmessageCallback=this.iframeObj=null}};b.prototype._message=function(a){l("message",a.data);if(m.isOriginEqual(a.origin,this.origin)){try{var b=k.parse(a.data)}catch(w){l("bad json",a.data);return}if(b.windowId!==this.windowId)l("mismatched window id",b.windowId,this.windowId);else switch(b.type){case "s":this.iframeObj.loaded();this.postMessage("s",
|
||||
k.stringify([g,this.transport,this.transUrl,this.baseUrl]));break;case "t":this.emit("message",b.data);break;case "c":try{var c=k.parse(b.data)}catch(w){l("bad json",b.data);break}this.emit("close",c[0],c[1]);this.close()}}else l("not same origin",a.origin,this.origin)};b.prototype.postMessage=function(a,b){l("postMessage",a,b);this.iframeObj.post(k.stringify({windowId:this.windowId,type:a,data:b||""}),this.origin)};b.prototype.send=function(a){l("send",a);this.postMessage("m",a)};b.enabled=function(){return h.iframeEnabled};
|
||||
b.transportName="iframe";b.roundTrips=2;f.exports=b}).call(this,{env:{}})},{"../utils/event":46,"../utils/iframe":47,"../utils/random":50,"../utils/url":52,"../version":53,debug:55,events:3,inherits:57,json3:58}],23:[function(a,f,h){(function(c){function b(a){if(!b.enabled())throw Error("Transport created when disabled");k.call(this,a,"/jsonp",g,e)}var d=a("inherits"),k=a("./lib/sender-receiver"),e=a("./receiver/jsonp"),g=a("./sender/jsonp");d(b,k);b.enabled=function(){return!!c.document};b.transportName=
|
||||
"jsonp-polling";b.roundTrips=1;b.needBody=!0;f.exports=b}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"./lib/sender-receiver":28,"./receiver/jsonp":31,"./sender/jsonp":33,inherits:57}],24:[function(a,f,h){(function(c){function b(a){return function(b,c,d){m("create ajax sender",b,c);var g={};"string"===typeof c&&(g.headers={"Content-type":"text/plain"});b=e.addPath(b,"/xhr_send");var l=new a("POST",b,c,g);l.once("finish",function(a){m("finish",
|
||||
a);l=null;if(200!==a&&204!==a)return d(Error("http status "+a));d()});return function(){m("abort");l.close();l=null;var a=Error("Aborted");a.code=1E3;d(a)}}}function d(a,c,d,e){g.call(this,a,c,b(e),d,e)}var k=a("inherits"),e=a("../../utils/url"),g=a("./sender-receiver"),m=function(){};"production"!==c.env.NODE_ENV&&(m=a("debug")("sockjs-client:ajax-based"));k(d,g);f.exports=d}).call(this,{env:{}})},{"../../utils/url":52,"./sender-receiver":28,debug:55,inherits:57}],25:[function(a,f,h){(function(c){function b(a,
|
||||
b){e(a);k.call(this);this.sendBuffer=[];this.sender=b;this.url=a}var d=a("inherits"),k=a("events").EventEmitter,e=function(){};"production"!==c.env.NODE_ENV&&(e=a("debug")("sockjs-client:buffered-sender"));d(b,k);b.prototype.send=function(a){e("send",a);this.sendBuffer.push(a);this.sendStop||this.sendSchedule()};b.prototype.sendScheduleWait=function(){e("sendScheduleWait");var a=this;this.sendStop=function(){e("sendStop");a.sendStop=null;clearTimeout(b)};var b=setTimeout(function(){e("timeout");a.sendStop=
|
||||
null;a.sendSchedule()},25)};b.prototype.sendSchedule=function(){e("sendSchedule",this.sendBuffer.length);var a=this;if(0<this.sendBuffer.length){var b="["+this.sendBuffer.join(",")+"]";this.sendStop=this.sender(this.url,b,function(b){a.sendStop=null;b?(e("error",b),a.emit("close",b.code||1006,"Sending error: "+b),a.close()):a.sendScheduleWait()});this.sendBuffer=[]}};b.prototype._cleanup=function(){e("_cleanup");this.removeAllListeners()};b.prototype.close=function(){e("close");this._cleanup();this.sendStop&&
|
||||
(this.sendStop(),this.sendStop=null)};f.exports=b}).call(this,{env:{}})},{debug:55,events:3,inherits:57}],26:[function(a,f,h){(function(c){var b=a("inherits"),d=a("../iframe"),k=a("../../utils/object");f.exports=function(a){function g(b,c){d.call(this,a.transportName,b,c)}b(g,d);g.enabled=function(b,g){if(!c.document)return!1;b=k.extend({},g);b.sameOrigin=!0;return a.enabled(b)&&d.enabled()};g.transportName="iframe-"+a.transportName;g.needBody=!0;g.roundTrips=d.roundTrips+a.roundTrips-1;g.facadeTransport=
|
||||
a;return g}}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"../../utils/object":49,"../iframe":22,inherits:57}],27:[function(a,f,h){(function(c){function b(a,b,c){e(b);k.call(this);this.Receiver=a;this.receiveUrl=b;this.AjaxObject=c;this._scheduleReceiver()}var d=a("inherits"),k=a("events").EventEmitter,e=function(){};"production"!==c.env.NODE_ENV&&(e=a("debug")("sockjs-client:polling"));d(b,k);b.prototype._scheduleReceiver=function(){e("_scheduleReceiver");
|
||||
var a=this,b=this.poll=new this.Receiver(this.receiveUrl,this.AjaxObject);b.on("message",function(b){e("message",b);a.emit("message",b)});b.once("close",function(c,d){e("close",c,d,a.pollIsClosing);a.poll=b=null;a.pollIsClosing||("network"===d?a._scheduleReceiver():(a.emit("close",c||1006,d),a.removeAllListeners()))})};b.prototype.abort=function(){e("abort");this.removeAllListeners();this.pollIsClosing=!0;this.poll&&this.poll.abort()};f.exports=b}).call(this,{env:{}})},{debug:55,events:3,inherits:57}],
|
||||
28:[function(a,f,h){(function(c){function b(a,b,c,d,f){b=k.addPath(a,b);m(b);var l=this;e.call(this,a,c);this.poll=new g(d,b,f);this.poll.on("message",function(a){m("poll message",a);l.emit("message",a)});this.poll.once("close",function(a,b){m("poll close",a,b);l.poll=null;l.emit("close",a,b);l.close()})}var d=a("inherits"),k=a("../../utils/url"),e=a("./buffered-sender"),g=a("./polling"),m=function(){};"production"!==c.env.NODE_ENV&&(m=a("debug")("sockjs-client:sender-receiver"));d(b,e);b.prototype.close=
|
||||
function(){e.prototype.close.call(this);m("close");this.removeAllListeners();this.poll&&(this.poll.abort(),this.poll=null)};f.exports=b}).call(this,{env:{}})},{"../../utils/url":52,"./buffered-sender":25,"./polling":27,debug:55,inherits:57}],29:[function(a,f,h){(function(c){function b(a){g(a);k.call(this);var b=this,c=this.es=new e(a);c.onmessage=function(a){g("message",a.data);b.emit("message",decodeURI(a.data))};c.onerror=function(a){g("error",c.readyState,a);a=2!==c.readyState?"network":"permanent";
|
||||
b._cleanup();b._close(a)}}var d=a("inherits"),k=a("events").EventEmitter,e=a("eventsource"),g=function(){};"production"!==c.env.NODE_ENV&&(g=a("debug")("sockjs-client:receiver:eventsource"));d(b,k);b.prototype.abort=function(){g("abort");this._cleanup();this._close("user")};b.prototype._cleanup=function(){g("cleanup");var a=this.es;a&&(a.onmessage=a.onerror=null,a.close(),this.es=null)};b.prototype._close=function(a){g("close",a);var b=this;setTimeout(function(){b.emit("close",null,a);b.removeAllListeners()},
|
||||
200)};f.exports=b}).call(this,{env:{}})},{debug:55,events:3,eventsource:18,inherits:57}],30:[function(a,f,h){(function(c,b){function d(a){n(a);m.call(this);var c=this;e.polluteGlobalNamespace();this.id="a"+h.string(6);a=g.addQuery(a,"c="+decodeURIComponent(e.WPrefix+"."+this.id));n("using htmlfile",d.htmlfileEnabled);var k=d.htmlfileEnabled?e.createHtmlfile:e.createIframe;b[e.WPrefix][this.id]={start:function(){n("start");c.iframeObj.loaded()},message:function(a){n("message",a);c.emit("message",a)},
|
||||
stop:function(){n("stop");c._cleanup();c._close("network")}};this.iframeObj=k(a,function(){n("callback");c._cleanup();c._close("permanent")})}var k=a("inherits"),e=a("../../utils/iframe"),g=a("../../utils/url"),m=a("events").EventEmitter,h=a("../../utils/random"),n=function(){};"production"!==c.env.NODE_ENV&&(n=a("debug")("sockjs-client:receiver:htmlfile"));k(d,m);d.prototype.abort=function(){n("abort");this._cleanup();this._close("user")};d.prototype._cleanup=function(){n("_cleanup");this.iframeObj&&
|
||||
(this.iframeObj.cleanup(),this.iframeObj=null);delete b[e.WPrefix][this.id]};d.prototype._close=function(a){n("_close",a);this.emit("close",null,a);this.removeAllListeners()};d.htmlfileEnabled=!1;c=["Active"].concat("Object").join("X");if(c in b)try{d.htmlfileEnabled=!!new b[c]("htmlfile")}catch(t){}d.enabled=d.htmlfileEnabled||e.iframeEnabled;f.exports=d}).call(this,{env:{}},"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"../../utils/iframe":47,
|
||||
"../../utils/random":50,"../../utils/url":52,debug:55,events:3,inherits:57}],31:[function(a,f,h){(function(c,b){function d(a){t(a);var c=this;n.call(this);k.polluteGlobalNamespace();this.id="a"+e.string(6);a=m.addQuery(a,"c="+encodeURIComponent(k.WPrefix+"."+this.id));b[k.WPrefix][this.id]=this._callback.bind(this);this._createScript(a);this.timeoutId=setTimeout(function(){t("timeout");c._abort(Error("JSONP script loaded abnormally (timeout)"))},d.timeout)}var k=a("../../utils/iframe"),e=a("../../utils/random"),
|
||||
g=a("../../utils/browser"),m=a("../../utils/url"),h=a("inherits"),n=a("events").EventEmitter,t=function(){};"production"!==c.env.NODE_ENV&&(t=a("debug")("sockjs-client:receiver:jsonp"));h(d,n);d.prototype.abort=function(){t("abort");if(b[k.WPrefix][this.id]){var a=Error("JSONP user aborted read");a.code=1E3;this._abort(a)}};d.timeout=35E3;d.scriptErrorTimeout=1E3;d.prototype._callback=function(a){t("_callback",a);this._cleanup();this.aborting||(a&&(t("message",a),this.emit("message",a)),this.emit("close",
|
||||
null,"network"),this.removeAllListeners())};d.prototype._abort=function(a){t("_abort",a);this._cleanup();this.aborting=!0;this.emit("close",a.code,a.message);this.removeAllListeners()};d.prototype._cleanup=function(){t("_cleanup");clearTimeout(this.timeoutId);this.script2&&(this.script2.parentNode.removeChild(this.script2),this.script2=null);if(this.script){var a=this.script;a.parentNode.removeChild(a);this.script=a.onreadystatechange=a.onerror=a.onload=a.onclick=null}delete b[k.WPrefix][this.id]};
|
||||
d.prototype._scriptError=function(){t("_scriptError");var a=this;this.errorTimer||(this.errorTimer=setTimeout(function(){a.loadedOkay||a._abort(Error("JSONP script loaded abnormally (onerror)"))},d.scriptErrorTimeout))};d.prototype._createScript=function(a){t("_createScript",a);var c=this,d=this.script=b.document.createElement("script");d.id="a"+e.string(8);d.src=a;d.type="text/javascript";d.charset="UTF-8";d.onerror=this._scriptError.bind(this);d.onload=function(){t("onload");c._abort(Error("JSONP script loaded abnormally (onload)"))};
|
||||
d.onreadystatechange=function(){t("onreadystatechange",d.readyState);if(/loaded|closed/.test(d.readyState)){if(d&&d.htmlFor&&d.onclick){c.loadedOkay=!0;try{d.onclick()}catch(w){}}d&&c._abort(Error("JSONP script loaded abnormally (onreadystatechange)"))}};if("undefined"===typeof d.async&&b.document.attachEvent)if(g.isOpera()){var k=this.script2=b.document.createElement("script");k.text="try{var a = document.getElementById('"+d.id+"'); if(a)a.onerror();}catch(x){};";d.async=k.async=!1}else{try{d.htmlFor=
|
||||
d.id,d.event="onclick"}catch(w){}d.async=!0}"undefined"!==typeof d.async&&(d.async=!0);a=b.document.getElementsByTagName("head")[0];a.insertBefore(d,a.firstChild);k&&a.insertBefore(k,a.firstChild)};f.exports=d}).call(this,{env:{}},"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"../../utils/browser":44,"../../utils/iframe":47,"../../utils/random":50,"../../utils/url":52,debug:55,events:3,inherits:57}],32:[function(a,f,h){(function(c){function b(a,
|
||||
b){e(a);k.call(this);var c=this;this.bufferPosition=0;this.xo=new b("POST",a,null);this.xo.on("chunk",this._chunkHandler.bind(this));this.xo.once("finish",function(a,b){e("finish",a,b);c._chunkHandler(a,b);c.xo=null;a=200===a?"network":"permanent";e("close",a);c.emit("close",null,a);c._cleanup()})}var d=a("inherits"),k=a("events").EventEmitter,e=function(){};"production"!==c.env.NODE_ENV&&(e=a("debug")("sockjs-client:receiver:xhr"));d(b,k);b.prototype._chunkHandler=function(a,b){e("_chunkHandler",
|
||||
a);if(200===a&&b)for(;;this.bufferPosition+=a+1){var c=b.slice(this.bufferPosition);a=c.indexOf("\n");if(-1===a)break;if(c=c.slice(0,a))e("message",c),this.emit("message",c)}};b.prototype._cleanup=function(){e("_cleanup");this.removeAllListeners()};b.prototype.abort=function(){e("abort");this.xo&&(this.xo.close(),e("close"),this.emit("close",null,"user"),this.xo=null);this._cleanup()};f.exports=b}).call(this,{env:{}})},{debug:55,events:3,inherits:57}],33:[function(a,f,h){(function(c,b){function d(a){g("createIframe",
|
||||
a);try{return b.document.createElement('<iframe name="'+a+'">')}catch(l){var c=b.document.createElement("iframe");c.name=a;return c}}var k=a("../../utils/random"),e=a("../../utils/url"),g=function(){};"production"!==c.env.NODE_ENV&&(g=a("debug")("sockjs-client:sender:jsonp"));var m,h;f.exports=function(a,c,l){g(a,c);m||(g("createForm"),m=b.document.createElement("form"),m.style.display="none",m.style.position="absolute",m.method="POST",m.enctype="application/x-www-form-urlencoded",m.acceptCharset=
|
||||
"UTF-8",h=b.document.createElement("textarea"),h.name="d",m.appendChild(h),b.document.body.appendChild(m));var f="a"+k.string(8);m.target=f;m.action=e.addQuery(e.addPath(a,"/jsonp_send"),"i="+f);var n=d(f);n.id=f;n.style.display="none";m.appendChild(n);try{h.value=c}catch(w){}m.submit();var p=function(a){g("completed",f,a);n.onerror&&(n.onreadystatechange=n.onerror=n.onload=null,setTimeout(function(){g("cleaning up",f);n.parentNode.removeChild(n);n=null},500),h.value="",l(a))};n.onerror=function(){g("onerror",
|
||||
f);p()};n.onload=function(){g("onload",f);p()};n.onreadystatechange=function(a){g("onreadystatechange",f,n.readyState,a);"complete"===n.readyState&&p()};return function(){g("aborted",f);p(Error("Aborted"))}}}).call(this,{env:{}},"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"../../utils/random":50,"../../utils/url":52,debug:55}],34:[function(a,f,h){(function(c,b){function d(a,b,c){n(a,b);var d=this;k.call(this);setTimeout(function(){d._start(a,
|
||||
b,c)},0)}var k=a("events").EventEmitter,e=a("inherits"),g=a("../../utils/event"),m=a("../../utils/browser"),h=a("../../utils/url"),n=function(){};"production"!==c.env.NODE_ENV&&(n=a("debug")("sockjs-client:sender:xdr"));e(d,k);d.prototype._start=function(a,c,d){n("_start");var e=this,k=new b.XDomainRequest;c=h.addQuery(c,"t="+ +new Date);k.onerror=function(){n("onerror");e._error()};k.ontimeout=function(){n("ontimeout");e._error()};k.onprogress=function(){n("progress",k.responseText);e.emit("chunk",
|
||||
200,k.responseText)};k.onload=function(){n("load");e.emit("finish",200,k.responseText);e._cleanup(!1)};this.xdr=k;this.unloadRef=g.unloadAdd(function(){e._cleanup(!0)});try{this.xdr.open(a,c),this.timeout&&(this.xdr.timeout=this.timeout),this.xdr.send(d)}catch(w){this._error()}};d.prototype._error=function(){this.emit("finish",0,"");this._cleanup(!1)};d.prototype._cleanup=function(a){n("cleanup",a);if(this.xdr){this.removeAllListeners();g.unloadDel(this.unloadRef);this.xdr.ontimeout=this.xdr.onerror=
|
||||
this.xdr.onprogress=this.xdr.onload=null;if(a)try{this.xdr.abort()}catch(l){}this.unloadRef=this.xdr=null}};d.prototype.close=function(){n("close");this._cleanup(!0)};d.enabled=!(!b.XDomainRequest||!m.hasDomain());f.exports=d}).call(this,{env:{}},"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"../../utils/browser":44,"../../utils/event":46,"../../utils/url":52,debug:55,events:3,inherits:57}],35:[function(a,f,h){function c(a,c,e,g){b.call(this,
|
||||
a,c,e,g)}h=a("inherits");var b=a("../driver/xhr");h(c,b);c.enabled=b.enabled&&b.supportsCORS;f.exports=c},{"../driver/xhr":17,inherits:57}],36:[function(a,f,h){function c(){var a=this;b.call(this);this.to=setTimeout(function(){a.emit("finish",200,"{}")},c.timeout)}var b=a("events").EventEmitter;a("inherits")(c,b);c.prototype.close=function(){clearTimeout(this.to)};c.timeout=2E3;f.exports=c},{events:3,inherits:57}],37:[function(a,f,h){function c(a,c,e){b.call(this,a,c,e,{noCredentials:!0})}h=a("inherits");
|
||||
var b=a("../driver/xhr");h(c,b);c.enabled=b.enabled;f.exports=c},{"../driver/xhr":17,inherits:57}],38:[function(a,f,h){(function(c){function b(a,c,e){if(!b.enabled())throw Error("Transport created when disabled");g.call(this);h("constructor",a);var f=this;a=k.addPath(a,"/websocket");this.url=a="https"===a.slice(0,5)?"wss"+a.slice(5):"ws"+a.slice(4);this.ws=new m(this.url,[],e);this.ws.onmessage=function(a){h("message event",a.data);f.emit("message",a.data)};this.unloadRef=d.unloadAdd(function(){h("unload");
|
||||
f.ws.close()});this.ws.onclose=function(a){h("close event",a.code,a.reason);f.emit("close",a.code,a.reason);f._cleanup()};this.ws.onerror=function(a){h("error event",a);f.emit("close",1006,"WebSocket connection broken");f._cleanup()}}var d=a("../utils/event"),k=a("../utils/url"),e=a("inherits"),g=a("events").EventEmitter,m=a("./driver/websocket"),h=function(){};"production"!==c.env.NODE_ENV&&(h=a("debug")("sockjs-client:websocket"));e(b,g);b.prototype.send=function(a){a="["+a+"]";h("send",a);this.ws.send(a)};
|
||||
b.prototype.close=function(){h("close");var a=this.ws;this._cleanup();a&&a.close()};b.prototype._cleanup=function(){h("_cleanup");var a=this.ws;a&&(a.onmessage=a.onclose=a.onerror=null);d.unloadDel(this.unloadRef);this.unloadRef=this.ws=null;this.removeAllListeners()};b.enabled=function(){h("enabled");return!!m};b.transportName="websocket";b.roundTrips=2;f.exports=b}).call(this,{env:{}})},{"../utils/event":46,"../utils/url":52,"./driver/websocket":19,debug:55,events:3,inherits:57}],39:[function(a,
|
||||
f,h){function c(a){if(!e.enabled)throw Error("Transport created when disabled");b.call(this,a,"/xhr",k,e)}h=a("inherits");var b=a("./lib/ajax-based"),d=a("./xdr-streaming"),k=a("./receiver/xhr"),e=a("./sender/xdr");h(c,b);c.enabled=d.enabled;c.transportName="xdr-polling";c.roundTrips=2;f.exports=c},{"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xdr":34,"./xdr-streaming":40,inherits:57}],40:[function(a,f,h){function c(a){if(!k.enabled)throw Error("Transport created when disabled");b.call(this,
|
||||
a,"/xhr_streaming",d,k)}h=a("inherits");var b=a("./lib/ajax-based"),d=a("./receiver/xhr"),k=a("./sender/xdr");h(c,b);c.enabled=function(a){return a.cookie_needed||a.nullOrigin?!1:k.enabled&&a.sameScheme};c.transportName="xdr-streaming";c.roundTrips=2;f.exports=c},{"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xdr":34,inherits:57}],41:[function(a,f,h){function c(a){if(!e.enabled&&!k.enabled)throw Error("Transport created when disabled");b.call(this,a,"/xhr",d,k)}h=a("inherits");var b=a("./lib/ajax-based"),
|
||||
d=a("./receiver/xhr"),k=a("./sender/xhr-cors"),e=a("./sender/xhr-local");h(c,b);c.enabled=function(a){return a.nullOrigin?!1:e.enabled&&a.sameOrigin?!0:k.enabled};c.transportName="xhr-polling";c.roundTrips=2;f.exports=c},{"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xhr-cors":35,"./sender/xhr-local":37,inherits:57}],42:[function(a,f,h){(function(c){function b(a){if(!h.enabled&&!g.enabled)throw Error("Transport created when disabled");k.call(this,a,"/xhr_streaming",e,g)}var d=a("inherits"),
|
||||
k=a("./lib/ajax-based"),e=a("./receiver/xhr"),g=a("./sender/xhr-cors"),h=a("./sender/xhr-local"),p=a("../utils/browser");d(b,k);b.enabled=function(a){return a.nullOrigin||p.isOpera()?!1:g.enabled};b.transportName="xhr-streaming";b.roundTrips=2;b.needBody=!!c.document;f.exports=b}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"../utils/browser":44,"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xhr-cors":35,"./sender/xhr-local":37,
|
||||
inherits:57}],43:[function(a,f,h){(function(a){f.exports.randomBytes=a.crypto&&a.crypto.getRandomValues?function(b){b=new Uint8Array(b);a.crypto.getRandomValues(b);return b}:function(a){for(var b=Array(a),c=0;c<a;c++)b[c]=Math.floor(256*Math.random());return b}}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],44:[function(a,f,h){(function(a){f.exports={isOpera:function(){return a.navigator&&/opera/i.test(a.navigator.userAgent)},
|
||||
isKonqueror:function(){return a.navigator&&/konqueror/i.test(a.navigator.userAgent)},hasDomain:function(){if(!a.document)return!0;try{return!!a.document.domain}catch(b){return!1}}}}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],45:[function(a,f,h){var c=a("json3"),b=/[\x00-\x1f\ud800-\udfff\ufffe\uffff\u0300-\u0333\u033d-\u0346\u034a-\u034c\u0350-\u0352\u0357-\u0358\u035c-\u0362\u0374\u037e\u0387\u0591-\u05af\u05c4\u0610-\u0617\u0653-\u0654\u0657-\u065b\u065d-\u065e\u06df-\u06e2\u06eb-\u06ec\u0730\u0732-\u0733\u0735-\u0736\u073a\u073d\u073f-\u0741\u0743\u0745\u0747\u07eb-\u07f1\u0951\u0958-\u095f\u09dc-\u09dd\u09df\u0a33\u0a36\u0a59-\u0a5b\u0a5e\u0b5c-\u0b5d\u0e38-\u0e39\u0f43\u0f4d\u0f52\u0f57\u0f5c\u0f69\u0f72-\u0f76\u0f78\u0f80-\u0f83\u0f93\u0f9d\u0fa2\u0fa7\u0fac\u0fb9\u1939-\u193a\u1a17\u1b6b\u1cda-\u1cdb\u1dc0-\u1dcf\u1dfc\u1dfe\u1f71\u1f73\u1f75\u1f77\u1f79\u1f7b\u1f7d\u1fbb\u1fbe\u1fc9\u1fcb\u1fd3\u1fdb\u1fe3\u1feb\u1fee-\u1fef\u1ff9\u1ffb\u1ffd\u2000-\u2001\u20d0-\u20d1\u20d4-\u20d7\u20e7-\u20e9\u2126\u212a-\u212b\u2329-\u232a\u2adc\u302b-\u302c\uaab2-\uaab3\uf900-\ufa0d\ufa10\ufa12\ufa15-\ufa1e\ufa20\ufa22\ufa25-\ufa26\ufa2a-\ufa2d\ufa30-\ufa6d\ufa70-\ufad9\ufb1d\ufb1f\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4e\ufff0-\uffff]/g,
|
||||
d,k=function(a){var b,c={},d=[];for(b=0;65536>b;b++)d.push(String.fromCharCode(b));a.lastIndex=0;d.join("").replace(a,function(a){c[a]="\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4);return""});a.lastIndex=0;return c};f.exports={quote:function(a){a=c.stringify(a);b.lastIndex=0;if(!b.test(a))return a;d||(d=k(b));return a.replace(b,function(a){return d[a]})}}},{json3:58}],46:[function(a,f,h){(function(c){var b=a("./random"),d={},k=!1,e=c.chrome&&c.chrome.app&&c.chrome.app.runtime;f.exports={attachEvent:function(a,
|
||||
b){"undefined"!==typeof c.addEventListener?c.addEventListener(a,b,!1):c.document&&c.attachEvent&&(c.document.attachEvent("on"+a,b),c.attachEvent("on"+a,b))},detachEvent:function(a,b){"undefined"!==typeof c.addEventListener?c.removeEventListener(a,b,!1):c.document&&c.detachEvent&&(c.document.detachEvent("on"+a,b),c.detachEvent("on"+a,b))},unloadAdd:function(a){if(e)return null;var c=b.string(8);d[c]=a;k&&setTimeout(this.triggerUnloadCallbacks,0);return c},unloadDel:function(a){a in d&&delete d[a]},
|
||||
triggerUnloadCallbacks:function(){for(var a in d)d[a](),delete d[a]}};e||f.exports.attachEvent("unload",function(){k||(k=!0,f.exports.triggerUnloadCallbacks())})}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"./random":50}],47:[function(a,f,h){(function(c,b){var d=a("./event"),k=a("json3"),e=a("./browser"),g=function(){};"production"!==c.env.NODE_ENV&&(g=a("debug")("sockjs-client:utils:iframe"));f.exports={WPrefix:"_jp",currentWindowId:null,
|
||||
polluteGlobalNamespace:function(){f.exports.WPrefix in b||(b[f.exports.WPrefix]={})},postMessage:function(a,c){b.parent!==b?b.parent.postMessage(k.stringify({windowId:f.exports.currentWindowId,type:a,data:c||""}),"*"):g("Cannot postMessage, no parent window.",a,c)},createIframe:function(a,c){var e=b.document.createElement("iframe"),k=function(){g("unattach");clearTimeout(m);try{e.onload=null}catch(w){}e.onerror=null},f=function(){g("cleanup");e&&(k(),setTimeout(function(){e&&e.parentNode.removeChild(e);
|
||||
e=null},0),d.unloadDel(p))},h=function(a){g("onerror",a);e&&(f(),c(a))};e.src=a;e.style.display="none";e.style.position="absolute";e.onerror=function(){h("onerror")};e.onload=function(){g("onload");clearTimeout(m);m=setTimeout(function(){h("onload timeout")},2E3)};b.document.body.appendChild(e);var m=setTimeout(function(){h("timeout")},15E3);var p=d.unloadAdd(f);return{post:function(a,b){g("post",a,b);setTimeout(function(){try{e&&e.contentWindow&&e.contentWindow.postMessage(a,b)}catch(z){}},0)},cleanup:f,
|
||||
loaded:k}},createHtmlfile:function(a,c){var e=["Active"].concat("Object").join("X"),k=new b[e]("htmlfile"),l=function(){clearTimeout(w);p.onerror=null},h=function(){k&&(l(),d.unloadDel(F),p.parentNode.removeChild(p),p=k=null,CollectGarbage())},m=function(a){g("onerror",a);k&&(h(),c(a))};k.open();k.write('<html><script>document.domain="'+b.document.domain+'";\x3c/script></html>');k.close();k.parentWindow[f.exports.WPrefix]=b[f.exports.WPrefix];e=k.createElement("div");k.body.appendChild(e);var p=k.createElement("iframe");
|
||||
e.appendChild(p);p.src=a;p.onerror=function(){m("onerror")};var w=setTimeout(function(){m("timeout")},15E3);var F=d.unloadAdd(h);return{post:function(a,b){try{setTimeout(function(){p&&p.contentWindow&&p.contentWindow.postMessage(a,b)},0)}catch(G){}},cleanup:h,loaded:l}}};f.exports.iframeEnabled=!1;b.document&&(f.exports.iframeEnabled=("function"===typeof b.postMessage||"object"===typeof b.postMessage)&&!e.isKonqueror())}).call(this,{env:{}},"undefined"!==typeof global?global:"undefined"!==typeof self?
|
||||
self:"undefined"!==typeof window?window:{})},{"./browser":44,"./event":46,debug:55,json3:58}],48:[function(a,f,h){(function(a){var b={};["log","debug","warn"].forEach(function(c){try{var d=a.console&&a.console[c]&&a.console[c].apply}catch(e){}b[c]=d?function(){return a.console[c].apply(a.console,arguments)}:"log"===c?function(){}:b.log});f.exports=b}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],49:[function(a,f,h){f.exports=
|
||||
{isObject:function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},extend:function(a){if(!this.isObject(a))return a;for(var b,c,k=1,e=arguments.length;k<e;k++)for(c in b=arguments[k],b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c]);return a}}},{}],50:[function(a,f,h){var c=a("crypto");f.exports={string:function(a){for(var b=c.randomBytes(a),k=[],e=0;e<a;e++)k.push("abcdefghijklmnopqrstuvwxyz012345".substr(b[e]%32,1));return k.join("")},number:function(a){return Math.floor(Math.random()*
|
||||
a)},numberString:function(a){var b=(""+(a-1)).length;return(Array(b+1).join("0")+this.number(a)).slice(-b)}}},{crypto:43}],51:[function(a,f,h){(function(c){var b=function(){};"production"!==c.env.NODE_ENV&&(b=a("debug")("sockjs-client:utils:transport"));f.exports=function(a){return{filterToEnabled:function(c,d){var e={main:[],facade:[]};c?"string"===typeof c&&(c=[c]):c=[];a.forEach(function(a){a&&("websocket"===a.transportName&&!1===d.websocket?b("disabled from server","websocket"):c.length&&-1===
|
||||
c.indexOf(a.transportName)?b("not in whitelist",a.transportName):a.enabled(d)?(b("enabled",a.transportName),e.main.push(a),a.facadeTransport&&e.facade.push(a.facadeTransport)):b("disabled",a.transportName))});return e}}}}).call(this,{env:{}})},{debug:55}],52:[function(a,f,h){(function(c){var b=a("url-parse"),d=function(){};"production"!==c.env.NODE_ENV&&(d=a("debug")("sockjs-client:utils:url"));f.exports={getOrigin:function(a){if(!a)return null;a=new b(a);if("file:"===a.protocol)return null;var c=
|
||||
a.port;c||(c="https:"===a.protocol?"443":"80");return a.protocol+"//"+a.hostname+":"+c},isOriginEqual:function(a,b){var c=this.getOrigin(a)===this.getOrigin(b);d("same",a,b,c);return c},isSchemeEqual:function(a,b){return a.split(":")[0]===b.split(":")[0]},addPath:function(a,b){a=a.split("?");return a[0]+b+(a[1]?"?"+a[1]:"")},addQuery:function(a,b){return a+(-1===a.indexOf("?")?"?"+b:"&"+b)}}}).call(this,{env:{}})},{debug:55,"url-parse":61}],53:[function(a,f,h){f.exports="1.4.0"},{}],54:[function(a,
|
||||
f,h){function c(a){a=String(a);if(!(100<a.length)&&(a=/^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(a))){var b=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case "years":case "year":case "yrs":case "yr":case "y":return b*k;case "weeks":case "week":case "w":return b*d;case "days":case "day":case "d":return 864E5*b;case "hours":case "hour":case "hrs":case "hr":case "h":return 36E5*b;case "minutes":case "minute":case "mins":case "min":case "m":return 6E4*
|
||||
b;case "seconds":case "second":case "secs":case "sec":case "s":return 1E3*b;case "milliseconds":case "millisecond":case "msecs":case "msec":case "ms":return b}}}function b(a,b,c,d){return Math.round(a/c)+" "+d+(b>=1.5*c?"s":"")}var d=6048E5,k=315576E5;f.exports=function(a,d){d=d||{};var e=typeof a;if("string"===e&&0<a.length)return c(a);if("number"===e&&!1===isNaN(a))return d.long?(d=Math.abs(a),a=864E5<=d?b(a,d,864E5,"day"):36E5<=d?b(a,d,36E5,"hour"):6E4<=d?b(a,d,6E4,"minute"):1E3<=d?b(a,d,1E3,"second"):
|
||||
a+" ms"):(d=Math.abs(a),a=864E5<=d?Math.round(a/864E5)+"d":36E5<=d?Math.round(a/36E5)+"h":6E4<=d?Math.round(a/6E4)+"m":1E3<=d?Math.round(a/1E3)+"s":a+"ms"),a;throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a));}},{}],55:[function(a,f,h){(function(c){function b(a){b="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"===typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};
|
||||
return b(a)}h.log=function(){var a;return"object"===("undefined"===typeof console?"undefined":b(console))&&console.log&&(a=console).log.apply(a,arguments)};h.formatArgs=function(a){a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+f.exports.humanize(this.diff);if(this.useColors){var b="color: "+this.color;a.splice(1,0,b,"color: inherit");var c=0,d=0;a[0].replace(/%[a-zA-Z%]/g,function(a){"%%"!==a&&(c++,"%c"===a&&(d=c))});a.splice(d,0,b)}};
|
||||
h.save=function(a){try{a?h.storage.setItem("debug",a):h.storage.removeItem("debug")}catch(e){}};h.load=function(){try{var a=h.storage.getItem("debug")}catch(e){}!a&&"undefined"!==typeof c&&"env"in c&&(a=c.env.DEBUG);return a};h.useColors=function(){return"undefined"!==typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs)?!0:"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:"undefined"!==typeof document&&
|
||||
document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&31<=parseInt(RegExp.$1,10)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)};a:{try{var d=localStorage;
|
||||
break a}catch(k){}d=void 0}h.storage=d;h.colors="#0000CC #0000FF #0033CC #0033FF #0066CC #0066FF #0099CC #0099FF #00CC00 #00CC33 #00CC66 #00CC99 #00CCCC #00CCFF #3300CC #3300FF #3333CC #3333FF #3366CC #3366FF #3399CC #3399FF #33CC00 #33CC33 #33CC66 #33CC99 #33CCCC #33CCFF #6600CC #6600FF #6633CC #6633FF #66CC00 #66CC33 #9900CC #9900FF #9933CC #9933FF #99CC00 #99CC33 #CC0000 #CC0033 #CC0066 #CC0099 #CC00CC #CC00FF #CC3300 #CC3333 #CC3366 #CC3399 #CC33CC #CC33FF #CC6600 #CC6633 #CC9900 #CC9933 #CCCC00 #CCCC33 #FF0000 #FF0033 #FF0066 #FF0099 #FF00CC #FF00FF #FF3300 #FF3333 #FF3366 #FF3399 #FF33CC #FF33FF #FF6600 #FF6633 #FF9900 #FF9933 #FFCC00 #FFCC33".split(" ");
|
||||
f.exports=a("./common")(h);f.exports.formatters.j=function(a){try{return JSON.stringify(a)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,{env:{}})},{"./common":56}],56:[function(a,f,h){f.exports=function(c){function b(a){for(var b=0,c=0;c<a.length;c++)b=(b<<5)-b+a.charCodeAt(c),b|=0;return d.colors[Math.abs(b)%d.colors.length]}function d(a){function c(){for(var a=arguments.length,b=Array(a),e=0;e<a;e++)b[e]=arguments[e];if(c.enabled){a=Number(new Date);c.diff=a-(g||a);c.prev=
|
||||
g;g=c.curr=a;b[0]=d.coerce(b[0]);"string"!==typeof b[0]&&b.unshift("%O");var f=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,function(a,e){if("%%"===a)return a;f++;e=d.formatters[e];"function"===typeof e&&(a=e.call(c,b[f]),b.splice(f,1),f--);return a});d.formatArgs.call(c,b);(c.log||d.log).apply(c,b)}}var g;c.namespace=a;c.enabled=d.enabled(a);c.useColors=d.useColors();c.color=b(a);c.destroy=f;c.extend=e;"function"===typeof d.init&&d.init(c);d.instances.push(c);return c}function f(){var a=d.instances.indexOf(this);
|
||||
return-1!==a?(d.instances.splice(a,1),!0):!1}function e(a,b){return d(this.namespace+("undefined"===typeof b?":":b)+a)}d.debug=d;d.default=d;d.coerce=function(a){return a instanceof Error?a.stack||a.message:a};d.disable=function(){d.enable("")};d.enable=function(a){d.save(a);d.names=[];d.skips=[];var b,c=("string"===typeof a?a:"").split(/[\s,]+/),e=c.length;for(b=0;b<e;b++)c[b]&&(a=c[b].replace(/\*/g,".*?"),"-"===a[0]?d.skips.push(new RegExp("^"+a.substr(1)+"$")):d.names.push(new RegExp("^"+a+"$")));
|
||||
for(b=0;b<d.instances.length;b++)a=d.instances[b],a.enabled=d.enabled(a.namespace)};d.enabled=function(a){if("*"===a[a.length-1])return!0;var b;var c=0;for(b=d.skips.length;c<b;c++)if(d.skips[c].test(a))return!1;c=0;for(b=d.names.length;c<b;c++)if(d.names[c].test(a))return!0;return!1};d.humanize=a("ms");Object.keys(c).forEach(function(a){d[a]=c[a]});d.instances=[];d.names=[];d.skips=[];d.formatters={};d.selectColor=b;d.enable(d.load());return d}},{ms:54}],57:[function(a,f,h){f.exports="function"===
|
||||
typeof Object.create?function(a,b){a.super_=b;a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:function(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a}},{}],58:[function(a,f,h){(function(a){(function(){function b(a,d){function f(a){if(f[a]!==x)return f[a];if("bug-string-char-index"==a)var b=!1;else if("json"==a)b=f("json-stringify")&&f("json-parse");else{var c;if("json-stringify"==a){b=
|
||||
d.stringify;var e="function"==typeof b&&y;if(e){(c=function(){return 1}).toJSON=c;try{e="0"===b(0)&&"0"===b(new h)&&'""'==b(new k)&&b(p)===x&&b(x)===x&&b()===x&&"1"===b(c)&&"[1]"==b([c])&&"[null]"==b([x])&&"null"==b(null)&&"[null,null,null]"==b([x,p,null])&&'{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}'==b({a:[c,!0,!1,null,"\x00\b\n\f\r\t"]})&&"1"===b(null,c)&&"[\n 1,\n 2\n]"==b([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==b(new l(-864E13))&&'"+275760-09-13T00:00:00.000Z"'==b(new l(864E13))&&
|
||||
'"-000001-01-01T00:00:00.000Z"'==b(new l(-621987552E5))&&'"1969-12-31T23:59:59.999Z"'==b(new l(-1))}catch(K){e=!1}}b=e}if("json-parse"==a){b=d.parse;if("function"==typeof b)try{if(0===b("0")&&!b(!1)){c=b('{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}');var g=5==c.a.length&&1===c.a[0];if(g){try{g=!b('"\t"')}catch(K){}if(g)try{g=1!==b("01")}catch(K){}if(g)try{g=1!==b("1.")}catch(K){}}}}catch(K){g=!1}b=g}}return f[a]=!!b}a||(a=e.Object());d||(d=e.Object());var h=a.Number||e.Number,k=a.String||e.String,
|
||||
g=a.Object||e.Object,l=a.Date||e.Date,q=a.SyntaxError||e.SyntaxError,n=a.TypeError||e.TypeError,m=a.Math||e.Math;a=a.JSON||e.JSON;"object"==typeof a&&a&&(d.stringify=a.stringify,d.parse=a.parse);g=g.prototype;var p=g.toString,t,x,y=new l(-0xc782b5b800cec);try{y=-109252==y.getUTCFullYear()&&0===y.getUTCMonth()&&1===y.getUTCDate()&&10==y.getUTCHours()&&37==y.getUTCMinutes()&&6==y.getUTCSeconds()&&708==y.getUTCMilliseconds()}catch(M){}if(!f("json")){var H=f("bug-string-char-index");if(!y)var A=m.floor,
|
||||
Q=[0,31,59,90,120,151,181,212,243,273,304,334],I=function(a,b){return Q[b]+365*(a-1970)+A((a-1969+(b=+(1<b)))/4)-A((a-1901+b)/100)+A((a-1601+b)/400)};(t=g.hasOwnProperty)||(t=function(a){var b={};if((b.__proto__=null,b.__proto__={toString:1},b).toString!=p)t=function(a){var b=this.__proto__;a=a in(this.__proto__=null,this);this.__proto__=b;return a};else{var c=b.constructor;t=function(a){var b=(this.constructor||c).prototype;return a in this&&!(a in b&&this[a]===b[a])}}b=null;return t.call(this,a)});
|
||||
var J=function(a,b){var d=0,e,f;(e=function(){this.valueOf=0}).prototype.valueOf=0;var h=new e;for(f in h)t.call(h,f)&&d++;e=h=null;d?J=2==d?function(a,b){var c={},d="[object Function]"==p.call(a),e;for(e in a)d&&"prototype"==e||t.call(c,e)||!(c[e]=1)||!t.call(a,e)||b(e)}:function(a,b){var c="[object Function]"==p.call(a),d,e;for(d in a)c&&"prototype"==d||!t.call(a,d)||(e="constructor"===d)||b(d);(e||t.call(a,d="constructor"))&&b(d)}:(h="valueOf toString toLocaleString propertyIsEnumerable isPrototypeOf hasOwnProperty constructor".split(" "),
|
||||
J=function(a,b){var d="[object Function]"==p.call(a),e,f=!d&&"function"!=typeof a.constructor&&c[typeof a.hasOwnProperty]&&a.hasOwnProperty||t;for(e in a)d&&"prototype"==e||!f.call(a,e)||b(e);for(d=h.length;e=h[--d];f.call(a,e)&&b(e));});return J(a,b)};if(!f("json-stringify")){var Y={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},B=function(a,b){return("000000"+(b||0)).slice(-a)},U=function(a){for(var b='"',c=0,d=a.length,e=!H||10<d,f=e&&(H?a.split(""):a);c<d;c++){var h=a.charCodeAt(c);
|
||||
switch(h){case 8:case 9:case 10:case 12:case 13:case 34:case 92:b+=Y[h];break;default:b=32>h?b+("\\u00"+B(2,h.toString(16))):b+(e?f[c]:a.charAt(c))}}return b+'"'},N=function(a,b,c,d,e,f,h){var k;try{var g=b[a]}catch(ba){}if("object"==typeof g&&g){var l=p.call(g);if("[object Date]"!=l||t.call(g,"toJSON"))"function"==typeof g.toJSON&&("[object Number]"!=l&&"[object String]"!=l&&"[object Array]"!=l||t.call(g,"toJSON"))&&(g=g.toJSON(a));else if(g>-1/0&&g<1/0){if(I){var q=A(g/864E5);for(l=A(q/365.2425)+
|
||||
1970-1;I(l+1,0)<=q;l++);for(k=A((q-I(l,0))/30.42);I(l,k+1)<=q;k++);q=1+q-I(l,k);var m=(g%864E5+864E5)%864E5;var M=A(m/36E5)%24;var r=A(m/6E4)%60;var T=A(m/1E3)%60;m%=1E3}else l=g.getUTCFullYear(),k=g.getUTCMonth(),q=g.getUTCDate(),M=g.getUTCHours(),r=g.getUTCMinutes(),T=g.getUTCSeconds(),m=g.getUTCMilliseconds();g=(0>=l||1E4<=l?(0>l?"-":"+")+B(6,0>l?-l:l):B(4,l))+"-"+B(2,k+1)+"-"+B(2,q)+"T"+B(2,M)+":"+B(2,r)+":"+B(2,T)+"."+B(3,m)+"Z"}else g=null}c&&(g=c.call(b,a,g));if(null===g)return"null";l=p.call(g);
|
||||
if("[object Boolean]"==l)return""+g;if("[object Number]"==l)return g>-1/0&&g<1/0?""+g:"null";if("[object String]"==l)return U(""+g);if("object"==typeof g){for(a=h.length;a--;)if(h[a]===g)throw n();h.push(g);var C=[];b=f;f+=e;if("[object Array]"==l){k=0;for(a=g.length;k<a;k++)l=N(k,g,c,d,e,f,h),C.push(l===x?"null":l);a=C.length?e?"[\n"+f+C.join(",\n"+f)+"\n"+b+"]":"["+C.join(",")+"]":"[]"}else J(d||g,function(a){var b=N(a,g,c,d,e,f,h);b!==x&&C.push(U(a)+":"+(e?" ":"")+b)}),a=C.length?e?"{\n"+f+C.join(",\n"+
|
||||
f)+"\n"+b+"}":"{"+C.join(",")+"}":"{}";h.pop();return a}};d.stringify=function(a,b,d){var e;if(c[typeof b]&&b)if("[object Function]"==(e=p.call(b)))var f=b;else if("[object Array]"==e){var g={};for(var h=0,l=b.length,k;h<l;k=b[h++],(e=p.call(k),"[object String]"==e||"[object Number]"==e)&&(g[k]=1));}if(d)if("[object Number]"==(e=p.call(d))){if(0<(d-=d%1)){var q="";for(10<d&&(d=10);q.length<d;q+=" ");}}else"[object String]"==e&&(q=10>=d.length?d:d.slice(0,10));return N("",(k={},k[""]=a,k),f,g,q,"",
|
||||
[])}}if(!f("json-parse")){var Z=k.fromCharCode,aa={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},r,L,v=function(){r=L=null;throw q();},D=function(){for(var a=L,b=a.length,c,d,e,f,g;r<b;)switch(g=a.charCodeAt(r),g){case 9:case 10:case 13:case 32:r++;break;case 123:case 125:case 91:case 93:case 58:case 44:return c=H?a.charAt(r):a[r],r++,c;case 34:c="@";for(r++;r<b;)if(g=a.charCodeAt(r),32>g)v();else if(92==g)switch(g=a.charCodeAt(++r),g){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:c+=
|
||||
aa[g];r++;break;case 117:d=++r;for(e=r+4;r<e;r++)g=a.charCodeAt(r),48<=g&&57>=g||97<=g&&102>=g||65<=g&&70>=g||v();c+=Z("0x"+a.slice(d,r));break;default:v()}else{if(34==g)break;g=a.charCodeAt(r);for(d=r;32<=g&&92!=g&&34!=g;)g=a.charCodeAt(++r);c+=a.slice(d,r)}if(34==a.charCodeAt(r))return r++,c;v();default:d=r;45==g&&(f=!0,g=a.charCodeAt(++r));if(48<=g&&57>=g){for(48==g&&(g=a.charCodeAt(r+1),48<=g&&57>=g)&&v();r<b&&(g=a.charCodeAt(r),48<=g&&57>=g);r++);if(46==a.charCodeAt(r)){for(e=++r;e<b&&(g=a.charCodeAt(e),
|
||||
48<=g&&57>=g);e++);e==r&&v();r=e}g=a.charCodeAt(r);if(101==g||69==g){g=a.charCodeAt(++r);43!=g&&45!=g||r++;for(e=r;e<b&&(g=a.charCodeAt(e),48<=g&&57>=g);e++);e==r&&v();r=e}return+a.slice(d,r)}f&&v();if("true"==a.slice(r,r+4))return r+=4,!0;if("false"==a.slice(r,r+5))return r+=5,!1;if("null"==a.slice(r,r+4))return r+=4,null;v()}return"$"},O=function(a){var b,c;"$"==a&&v();if("string"==typeof a){if("@"==(H?a.charAt(0):a[0]))return a.slice(1);if("["==a){for(b=[];;c||(c=!0)){a=D();if("]"==a)break;c&&
|
||||
(","==a?(a=D(),"]"==a&&v()):v());","==a&&v();b.push(O(a))}return b}if("{"==a){for(b={};;c||(c=!0)){a=D();if("}"==a)break;c&&(","==a?(a=D(),"}"==a&&v()):v());","!=a&&"string"==typeof a&&"@"==(H?a.charAt(0):a[0])&&":"==D()||v();b[a.slice(1)]=O(D())}return b}v()}return a},W=function(a,b,c){c=V(a,b,c);c===x?delete a[b]:a[b]=c},V=function(a,b,c){var d=a[b],e;if("object"==typeof d&&d)if("[object Array]"==p.call(d))for(e=d.length;e--;)W(d,e,c);else J(d,function(a){W(d,a,c)});return c.call(a,b,d)};d.parse=
|
||||
function(a,b){var c;r=0;L=""+a;a=O(D());"$"!=D()&&v();r=L=null;return b&&"[object Function]"==p.call(b)?V((c={},c[""]=a,c),"",b):a}}}d.runInContext=b;return d}var c={"function":!0,object:!0},k=c[typeof h]&&h&&!h.nodeType&&h,e=c[typeof window]&&window||this,g=k&&c[typeof f]&&f&&!f.nodeType&&"object"==typeof a&&a;!g||g.global!==g&&g.window!==g&&g.self!==g||(e=g);if(k)b(e,k);else{var m=e.JSON,p=e.JSON3,n=!1,t=b(e,e.JSON3={noConflict:function(){n||(n=!0,e.JSON=m,e.JSON3=p,m=p=null);return t}});e.JSON=
|
||||
{parse:t.parse,stringify:t.stringify}}}).call(this)}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],59:[function(a,f,h){var c=Object.prototype.hasOwnProperty;h.stringify=function(a,d){d=d||"";var b=[];"string"!==typeof d&&(d="?");for(var e in a)c.call(a,e)&&b.push(encodeURIComponent(e)+"="+encodeURIComponent(a[e]));return b.length?d+b.join("&"):""};h.parse=function(a){for(var b=/([^=?&]+)=?([^&]*)/g,c={},e;e=b.exec(a);){var g=
|
||||
decodeURIComponent(e[1].replace(/\+/g," "));e=decodeURIComponent(e[2].replace(/\+/g," "));g in c||(c[g]=e)}return c}},{}],60:[function(a,f,h){f.exports=function(a,b){b=b.split(":")[0];a=+a;if(!a)return!1;switch(b){case "http":case "ws":return 80!==a;case "https":case "wss":return 443!==a;case "ftp":return 21!==a;case "gopher":return 70!==a;case "file":return!1}return 0!==a}},{}],61:[function(a,f,h){(function(c){function b(a){var b=c&&c.location||{};a=a||b;b={};var d=typeof a,e;if("blob:"===a.protocol)b=
|
||||
new h(unescape(a.pathname),{});else if("string"===d)for(e in b=new h(a,{}),t)delete b[e];else if("object"===d){for(e in a)e in t||(b[e]=a[e]);void 0===b.slashes&&(b.slashes=p.test(a.href))}return b}function d(a){a=m.exec(a);return{protocol:a[1]?a[1].toLowerCase():"",slashes:!!a[2],rest:a[3]}}function h(a,c,f){if(!(this instanceof h))return new h(a,c,f);var k=n.slice();var l=typeof c;var q=0;"object"!==l&&"string"!==l&&(f=c,c=null);f&&"function"!==typeof f&&(f=g.parse);c=b(c);var m=d(a||"");l=!m.protocol&&
|
||||
!m.slashes;this.slashes=m.slashes||l&&c.slashes;this.protocol=m.protocol||c.protocol||"";a=m.rest;for(m.slashes||(k[3]=[/(.*)/,"pathname"]);q<k.length;q++)if(m=k[q],"function"===typeof m)a=m(a);else{var p=m[0];var t=m[1];if(p!==p)this[t]=a;else if("string"===typeof p)~(p=a.indexOf(p))&&("number"===typeof m[2]?(this[t]=a.slice(0,p),a=a.slice(p+m[2])):(this[t]=a.slice(p),a=a.slice(0,p)));else if(p=p.exec(a))this[t]=p[1],a=a.slice(0,p.index);this[t]=this[t]||(l&&m[3]?c[t]||"":"");m[4]&&(this[t]=this[t].toLowerCase())}f&&
|
||||
(this.query=f(this.query));if(l&&c.slashes&&"/"!==this.pathname.charAt(0)&&(""!==this.pathname||""!==c.pathname)){a=this.pathname;c=(c.pathname||"/").split("/").slice(0,-1).concat(a.split("/"));a=c.length;f=c[a-1];k=!1;for(q=0;a--;)"."===c[a]?c.splice(a,1):".."===c[a]?(c.splice(a,1),q++):q&&(0===a&&(k=!0),c.splice(a,1),q--);k&&c.unshift("");"."!==f&&".."!==f||c.push("");this.pathname=c.join("/")}e(this.port,this.protocol)||(this.host=this.hostname,this.port="");this.username=this.password="";this.auth&&
|
||||
(m=this.auth.split(":"),this.username=m[0]||"",this.password=m[1]||"");this.origin=this.protocol&&this.host&&"file:"!==this.protocol?this.protocol+"//"+this.host:"null";this.href=this.toString()}var e=a("requires-port"),g=a("querystringify"),m=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,p=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,n=[["#","hash"],["?","query"],function(a){return a.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],
|
||||
t={hash:1,query:1};h.prototype={set:function(a,b,c){switch(a){case "query":"string"===typeof b&&b.length&&(b=(c||g.parse)(b));this[a]=b;break;case "port":this[a]=b;e(b,this.protocol)?b&&(this.host=this.hostname+":"+b):(this.host=this.hostname,this[a]="");break;case "hostname":this[a]=b;this.port&&(b+=":"+this.port);this.host=b;break;case "host":this[a]=b;/:\d+$/.test(b)?(b=b.split(":"),this.port=b.pop(),this.hostname=b.join(":")):(this.hostname=b,this.port="");break;case "protocol":this.protocol=
|
||||
b.toLowerCase();this.slashes=!c;break;case "pathname":case "hash":b?(c="pathname"===a?"/":"#",this[a]=b.charAt(0)!==c?c+b:b):this[a]=b;break;default:this[a]=b}for(a=0;a<n.length;a++)b=n[a],b[4]&&(this[b[1]]=this[b[1]].toLowerCase());this.origin=this.protocol&&this.host&&"file:"!==this.protocol?this.protocol+"//"+this.host:"null";this.href=this.toString();return this},toString:function(a){a&&"function"===typeof a||(a=g.stringify);var b=this.protocol;b&&":"!==b.charAt(b.length-1)&&(b+=":");b+=this.slashes?
|
||||
"//":"";this.username&&(b+=this.username,this.password&&(b+=":"+this.password),b+="@");b+=this.host+this.pathname;(a="object"===typeof this.query?a(this.query):this.query)&&(b+="?"!==a.charAt(0)?"?"+a:a);this.hash&&(b+=this.hash);return b}};h.extractProtocol=d;h.location=b;h.qs=g;f.exports=h}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{querystringify:59,"requires-port":60}]},{},[1])(1)});
|
||||
@@ -0,0 +1,488 @@
|
||||
// Generated by CoffeeScript 1.7.1
|
||||
|
||||
/*
|
||||
Stomp Over WebSocket http://www.jmesnil.net/stomp-websocket/doc/ | Apache License V2.0
|
||||
|
||||
Copyright (C) 2010-2013 [Jeff Mesnil](http://jmesnil.net/)
|
||||
Copyright (C) 2012 [FuseSource, Inc.](http://fusesource.com)
|
||||
*/
|
||||
|
||||
(function() {
|
||||
var Byte, Client, Frame, Stomp,
|
||||
__hasProp = {}.hasOwnProperty,
|
||||
__slice = [].slice;
|
||||
|
||||
Byte = {
|
||||
LF: '\x0A',
|
||||
NULL: '\x00'
|
||||
};
|
||||
|
||||
Frame = (function() {
|
||||
var unmarshallSingle;
|
||||
|
||||
function Frame(command, headers, body) {
|
||||
this.command = command;
|
||||
this.headers = headers != null ? headers : {};
|
||||
this.body = body != null ? body : '';
|
||||
}
|
||||
|
||||
Frame.prototype.toString = function() {
|
||||
var lines, name, skipContentLength, value, _ref;
|
||||
lines = [this.command];
|
||||
skipContentLength = this.headers['content-length'] === false ? true : false;
|
||||
if (skipContentLength) {
|
||||
delete this.headers['content-length'];
|
||||
}
|
||||
_ref = this.headers;
|
||||
for (name in _ref) {
|
||||
if (!__hasProp.call(_ref, name)) continue;
|
||||
value = _ref[name];
|
||||
lines.push("" + name + ":" + value);
|
||||
}
|
||||
if (this.body && !skipContentLength) {
|
||||
lines.push("content-length:" + (Frame.sizeOfUTF8(this.body)));
|
||||
}
|
||||
lines.push(Byte.LF + this.body);
|
||||
return lines.join(Byte.LF);
|
||||
};
|
||||
|
||||
Frame.sizeOfUTF8 = function(s) {
|
||||
if (s) {
|
||||
return encodeURI(s).match(/%..|./g).length;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
unmarshallSingle = function(data) {
|
||||
var body, chr, command, divider, headerLines, headers, i, idx, len, line, start, trim, _i, _j, _len, _ref, _ref1;
|
||||
divider = data.search(RegExp("" + Byte.LF + Byte.LF));
|
||||
headerLines = data.substring(0, divider).split(Byte.LF);
|
||||
command = headerLines.shift();
|
||||
headers = {};
|
||||
trim = function(str) {
|
||||
return str.replace(/^\s+|\s+$/g, '');
|
||||
};
|
||||
_ref = headerLines.reverse();
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
line = _ref[_i];
|
||||
idx = line.indexOf(':');
|
||||
headers[trim(line.substring(0, idx))] = trim(line.substring(idx + 1));
|
||||
}
|
||||
body = '';
|
||||
start = divider + 2;
|
||||
if (headers['content-length']) {
|
||||
len = parseInt(headers['content-length']);
|
||||
body = ('' + data).substring(start, start + len);
|
||||
} else {
|
||||
chr = null;
|
||||
for (i = _j = start, _ref1 = data.length; start <= _ref1 ? _j < _ref1 : _j > _ref1; i = start <= _ref1 ? ++_j : --_j) {
|
||||
chr = data.charAt(i);
|
||||
if (chr === Byte.NULL) {
|
||||
break;
|
||||
}
|
||||
body += chr;
|
||||
}
|
||||
}
|
||||
return new Frame(command, headers, body);
|
||||
};
|
||||
|
||||
Frame.unmarshall = function(datas) {
|
||||
var data;
|
||||
return (function() {
|
||||
var _i, _len, _ref, _results;
|
||||
_ref = datas.split(RegExp("" + Byte.NULL + Byte.LF + "*"));
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
data = _ref[_i];
|
||||
if ((data != null ? data.length : void 0) > 0) {
|
||||
_results.push(unmarshallSingle(data));
|
||||
}
|
||||
}
|
||||
return _results;
|
||||
})();
|
||||
};
|
||||
|
||||
Frame.marshall = function(command, headers, body) {
|
||||
var frame;
|
||||
frame = new Frame(command, headers, body);
|
||||
return frame.toString() + Byte.NULL;
|
||||
};
|
||||
|
||||
return Frame;
|
||||
|
||||
})();
|
||||
|
||||
Client = (function() {
|
||||
var now;
|
||||
|
||||
function Client(ws) {
|
||||
this.ws = ws;
|
||||
this.ws.binaryType = "arraybuffer";
|
||||
this.counter = 0;
|
||||
this.connected = false;
|
||||
this.heartbeat = {
|
||||
outgoing: 10000,
|
||||
incoming: 10000
|
||||
};
|
||||
this.maxWebSocketFrameSize = 16 * 1024;
|
||||
this.subscriptions = {};
|
||||
}
|
||||
|
||||
Client.prototype.debug = function(message) {
|
||||
var _ref;
|
||||
return typeof window !== "undefined" && window !== null ? (_ref = window.console) != null ? _ref.log(message) : void 0 : void 0;
|
||||
};
|
||||
|
||||
now = function() {
|
||||
if (Date.now) {
|
||||
return Date.now();
|
||||
} else {
|
||||
return new Date().valueOf;
|
||||
}
|
||||
};
|
||||
|
||||
Client.prototype._transmit = function(command, headers, body) {
|
||||
var out;
|
||||
out = Frame.marshall(command, headers, body);
|
||||
if (typeof this.debug === "function") {
|
||||
this.debug(">>> " + out);
|
||||
}
|
||||
while (true) {
|
||||
if (out.length > this.maxWebSocketFrameSize) {
|
||||
this.ws.send(out.substring(0, this.maxWebSocketFrameSize));
|
||||
out = out.substring(this.maxWebSocketFrameSize);
|
||||
if (typeof this.debug === "function") {
|
||||
this.debug("remaining = " + out.length);
|
||||
}
|
||||
} else {
|
||||
return this.ws.send(out);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Client.prototype._setupHeartbeat = function(headers) {
|
||||
var serverIncoming, serverOutgoing, ttl, v, _ref, _ref1;
|
||||
if ((_ref = headers.version) !== Stomp.VERSIONS.V1_1 && _ref !== Stomp.VERSIONS.V1_2) {
|
||||
return;
|
||||
}
|
||||
_ref1 = (function() {
|
||||
var _i, _len, _ref1, _results;
|
||||
_ref1 = headers['heart-beat'].split(",");
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
||||
v = _ref1[_i];
|
||||
_results.push(parseInt(v));
|
||||
}
|
||||
return _results;
|
||||
})(), serverOutgoing = _ref1[0], serverIncoming = _ref1[1];
|
||||
if (!(this.heartbeat.outgoing === 0 || serverIncoming === 0)) {
|
||||
ttl = Math.max(this.heartbeat.outgoing, serverIncoming);
|
||||
if (typeof this.debug === "function") {
|
||||
this.debug("send PING every " + ttl + "ms");
|
||||
}
|
||||
this.pinger = Stomp.setInterval(ttl, (function(_this) {
|
||||
return function() {
|
||||
_this.ws.send(Byte.LF);
|
||||
return typeof _this.debug === "function" ? _this.debug(">>> PING") : void 0;
|
||||
};
|
||||
})(this));
|
||||
}
|
||||
if (!(this.heartbeat.incoming === 0 || serverOutgoing === 0)) {
|
||||
ttl = Math.max(this.heartbeat.incoming, serverOutgoing);
|
||||
if (typeof this.debug === "function") {
|
||||
this.debug("check PONG every " + ttl + "ms");
|
||||
}
|
||||
return this.ponger = Stomp.setInterval(ttl, (function(_this) {
|
||||
return function() {
|
||||
var delta;
|
||||
delta = now() - _this.serverActivity;
|
||||
if (delta > ttl * 2) {
|
||||
if (typeof _this.debug === "function") {
|
||||
_this.debug("did not receive server activity for the last " + delta + "ms");
|
||||
}
|
||||
return _this.ws.close();
|
||||
}
|
||||
};
|
||||
})(this));
|
||||
}
|
||||
};
|
||||
|
||||
Client.prototype._parseConnect = function() {
|
||||
var args, connectCallback, errorCallback, headers;
|
||||
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
|
||||
headers = {};
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
headers = args[0], connectCallback = args[1];
|
||||
break;
|
||||
case 3:
|
||||
if (args[1] instanceof Function) {
|
||||
headers = args[0], connectCallback = args[1], errorCallback = args[2];
|
||||
} else {
|
||||
headers.login = args[0], headers.passcode = args[1], connectCallback = args[2];
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
headers.login = args[0], headers.passcode = args[1], connectCallback = args[2], errorCallback = args[3];
|
||||
break;
|
||||
default:
|
||||
headers.login = args[0], headers.passcode = args[1], connectCallback = args[2], errorCallback = args[3], headers.host = args[4];
|
||||
}
|
||||
return [headers, connectCallback, errorCallback];
|
||||
};
|
||||
|
||||
Client.prototype.connect = function() {
|
||||
var args, errorCallback, headers, out;
|
||||
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
|
||||
out = this._parseConnect.apply(this, args);
|
||||
headers = out[0], this.connectCallback = out[1], errorCallback = out[2];
|
||||
if (typeof this.debug === "function") {
|
||||
this.debug("Opening Web Socket...");
|
||||
}
|
||||
this.ws.onmessage = (function(_this) {
|
||||
return function(evt) {
|
||||
var arr, c, client, data, frame, messageID, onreceive, subscription, _i, _len, _ref, _results;
|
||||
data = typeof ArrayBuffer !== 'undefined' && evt.data instanceof ArrayBuffer ? (arr = new Uint8Array(evt.data), typeof _this.debug === "function" ? _this.debug("--- got data length: " + arr.length) : void 0, ((function() {
|
||||
var _i, _len, _results;
|
||||
_results = [];
|
||||
for (_i = 0, _len = arr.length; _i < _len; _i++) {
|
||||
c = arr[_i];
|
||||
_results.push(String.fromCharCode(c));
|
||||
}
|
||||
return _results;
|
||||
})()).join('')) : evt.data;
|
||||
_this.serverActivity = now();
|
||||
if (data === Byte.LF) {
|
||||
if (typeof _this.debug === "function") {
|
||||
_this.debug("<<< PONG");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (typeof _this.debug === "function") {
|
||||
_this.debug("<<< " + data);
|
||||
}
|
||||
_ref = Frame.unmarshall(data);
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
frame = _ref[_i];
|
||||
switch (frame.command) {
|
||||
case "CONNECTED":
|
||||
if (typeof _this.debug === "function") {
|
||||
_this.debug("connected to server " + frame.headers.server);
|
||||
}
|
||||
_this.connected = true;
|
||||
_this._setupHeartbeat(frame.headers);
|
||||
_results.push(typeof _this.connectCallback === "function" ? _this.connectCallback(frame) : void 0);
|
||||
break;
|
||||
case "MESSAGE":
|
||||
subscription = frame.headers.subscription;
|
||||
onreceive = _this.subscriptions[subscription] || _this.onreceive;
|
||||
if (onreceive) {
|
||||
client = _this;
|
||||
messageID = frame.headers["message-id"];
|
||||
frame.ack = function(headers) {
|
||||
if (headers == null) {
|
||||
headers = {};
|
||||
}
|
||||
return client.ack(messageID, subscription, headers);
|
||||
};
|
||||
frame.nack = function(headers) {
|
||||
if (headers == null) {
|
||||
headers = {};
|
||||
}
|
||||
return client.nack(messageID, subscription, headers);
|
||||
};
|
||||
_results.push(onreceive(frame));
|
||||
} else {
|
||||
_results.push(typeof _this.debug === "function" ? _this.debug("Unhandled received MESSAGE: " + frame) : void 0);
|
||||
}
|
||||
break;
|
||||
case "RECEIPT":
|
||||
_results.push(typeof _this.onreceipt === "function" ? _this.onreceipt(frame) : void 0);
|
||||
break;
|
||||
case "ERROR":
|
||||
_results.push(typeof errorCallback === "function" ? errorCallback(frame) : void 0);
|
||||
break;
|
||||
default:
|
||||
_results.push(typeof _this.debug === "function" ? _this.debug("Unhandled frame: " + frame) : void 0);
|
||||
}
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
})(this);
|
||||
this.ws.onclose = (function(_this) {
|
||||
return function() {
|
||||
var msg;
|
||||
msg = "Whoops! Lost connection to " + _this.ws.url;
|
||||
if (typeof _this.debug === "function") {
|
||||
_this.debug(msg);
|
||||
}
|
||||
_this._cleanUp();
|
||||
return typeof errorCallback === "function" ? errorCallback(msg) : void 0;
|
||||
};
|
||||
})(this);
|
||||
return this.ws.onopen = (function(_this) {
|
||||
return function() {
|
||||
if (typeof _this.debug === "function") {
|
||||
_this.debug('Web Socket Opened...');
|
||||
}
|
||||
headers["accept-version"] = Stomp.VERSIONS.supportedVersions();
|
||||
headers["heart-beat"] = [_this.heartbeat.outgoing, _this.heartbeat.incoming].join(',');
|
||||
return _this._transmit("CONNECT", headers);
|
||||
};
|
||||
})(this);
|
||||
};
|
||||
|
||||
Client.prototype.disconnect = function(disconnectCallback, headers) {
|
||||
if (headers == null) {
|
||||
headers = {};
|
||||
}
|
||||
this._transmit("DISCONNECT", headers);
|
||||
this.ws.onclose = null;
|
||||
this.ws.close();
|
||||
this._cleanUp();
|
||||
return typeof disconnectCallback === "function" ? disconnectCallback() : void 0;
|
||||
};
|
||||
|
||||
Client.prototype._cleanUp = function() {
|
||||
this.connected = false;
|
||||
if (this.pinger) {
|
||||
Stomp.clearInterval(this.pinger);
|
||||
}
|
||||
if (this.ponger) {
|
||||
return Stomp.clearInterval(this.ponger);
|
||||
}
|
||||
};
|
||||
|
||||
Client.prototype.send = function(destination, headers, body) {
|
||||
if (headers == null) {
|
||||
headers = {};
|
||||
}
|
||||
if (body == null) {
|
||||
body = '';
|
||||
}
|
||||
headers.destination = destination;
|
||||
return this._transmit("SEND", headers, body);
|
||||
};
|
||||
|
||||
Client.prototype.subscribe = function(destination, callback, headers) {
|
||||
var client;
|
||||
if (headers == null) {
|
||||
headers = {};
|
||||
}
|
||||
if (!headers.id) {
|
||||
headers.id = "sub-" + this.counter++;
|
||||
}
|
||||
headers.destination = destination;
|
||||
this.subscriptions[headers.id] = callback;
|
||||
this._transmit("SUBSCRIBE", headers);
|
||||
client = this;
|
||||
return {
|
||||
id: headers.id,
|
||||
unsubscribe: function() {
|
||||
return client.unsubscribe(headers.id);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Client.prototype.unsubscribe = function(id) {
|
||||
delete this.subscriptions[id];
|
||||
return this._transmit("UNSUBSCRIBE", {
|
||||
id: id
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.begin = function(transaction) {
|
||||
var client, txid;
|
||||
txid = transaction || "tx-" + this.counter++;
|
||||
this._transmit("BEGIN", {
|
||||
transaction: txid
|
||||
});
|
||||
client = this;
|
||||
return {
|
||||
id: txid,
|
||||
commit: function() {
|
||||
return client.commit(txid);
|
||||
},
|
||||
abort: function() {
|
||||
return client.abort(txid);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Client.prototype.commit = function(transaction) {
|
||||
return this._transmit("COMMIT", {
|
||||
transaction: transaction
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.abort = function(transaction) {
|
||||
return this._transmit("ABORT", {
|
||||
transaction: transaction
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.ack = function(messageID, subscription, headers) {
|
||||
if (headers == null) {
|
||||
headers = {};
|
||||
}
|
||||
headers["message-id"] = messageID;
|
||||
headers.subscription = subscription;
|
||||
return this._transmit("ACK", headers);
|
||||
};
|
||||
|
||||
Client.prototype.nack = function(messageID, subscription, headers) {
|
||||
if (headers == null) {
|
||||
headers = {};
|
||||
}
|
||||
headers["message-id"] = messageID;
|
||||
headers.subscription = subscription;
|
||||
return this._transmit("NACK", headers);
|
||||
};
|
||||
|
||||
return Client;
|
||||
|
||||
})();
|
||||
|
||||
Stomp = {
|
||||
VERSIONS: {
|
||||
V1_0: '1.0',
|
||||
V1_1: '1.1',
|
||||
V1_2: '1.2',
|
||||
supportedVersions: function() {
|
||||
return '1.1,1.0';
|
||||
}
|
||||
},
|
||||
client: function(url, protocols) {
|
||||
var klass, ws;
|
||||
if (protocols == null) {
|
||||
protocols = ['v10.stomp', 'v11.stomp'];
|
||||
}
|
||||
klass = Stomp.WebSocketClass || WebSocket;
|
||||
ws = new klass(url, protocols);
|
||||
return new Client(ws);
|
||||
},
|
||||
over: function(ws) {
|
||||
return new Client(ws);
|
||||
},
|
||||
Frame: Frame
|
||||
};
|
||||
|
||||
if (typeof exports !== "undefined" && exports !== null) {
|
||||
exports.Stomp = Stomp;
|
||||
}
|
||||
|
||||
if (typeof window !== "undefined" && window !== null) {
|
||||
Stomp.setInterval = function(interval, f) {
|
||||
return window.setInterval(f, interval);
|
||||
};
|
||||
Stomp.clearInterval = function(id) {
|
||||
return window.clearInterval(id);
|
||||
};
|
||||
window.Stomp = Stomp;
|
||||
} else if (!exports) {
|
||||
self.Stomp = Stomp;
|
||||
}
|
||||
|
||||
}).call(this);
|
||||
+19
-7
File diff suppressed because one or more lines are too long
@@ -163,7 +163,7 @@
|
||||
|
||||
<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
|
||||
<script type="text/javascript" src="js/materialize.min.js"></script>
|
||||
<script type="text/javascript" src="js/sockjs-1.3.0.min.js"></script>
|
||||
<script type="text/javascript" src="js/sockjs-1.4.0.min.js"></script>
|
||||
<script type="text/javascript" src="js/stomp-2.3.3.min.js"></script>
|
||||
<script type="text/javascript" src="js/plex.js"></script>
|
||||
</body>
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
|
||||
<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
|
||||
<script type="text/javascript" src="js/materialize.min.js"></script>
|
||||
<script type="text/javascript" src="js/sockjs-1.3.0.min.js"></script>
|
||||
<script type="text/javascript" src="js/sockjs-1.4.0.min.js"></script>
|
||||
<script type="text/javascript" src="js/stomp-2.3.3.min.js"></script>
|
||||
<script type="text/javascript" src="js/plex_movie_list.js"></script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user