Files
apt-nl-map/static/Magic4/roslib.min.js

2 lines
50 KiB
JavaScript
Raw Normal View History

2024-12-03 16:40:54 +08:00
!function(){function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}return a}()({1:[function(a,b,c){!function(a,c){"use strict";function d(a){function b(a){for(var b=p.byteLength,c=r+a;b<c;)b*=2;if(b!==p.byteLength){var d=q;p=new ArrayBuffer(b),q=new DataView(p);for(var e=r+3>>2,f=0;f<e;++f)q.setUint32(4*f,d.getUint32(4*f))}return o=a,q}function d(){r+=o}function e(a){d(b(8).setFloat64(r,a))}function f(a){d(b(1).setUint8(r,a))}function i(a){for(var c=b(a.length),e=0;e<a.length;++e)c.setUint8(r+e,a[e]);d()}function j(a){d(b(2).setUint16(r,a))}function k(a){d(b(4).setUint32(r,a))}function l(a){var c=a%g,e=(a-c)/g,f=b(8);f.setUint32(r,e),f.setUint32(r+4,c),d()}function m(a,b){b<24?f(a<<5|b):b<256?(f(a<<5|24),f(b)):b<65536?(f(a<<5|25),j(b)):b<4294967296?(f(a<<5|26),k(b)):(f(a<<5|27),l(b))}function n(a){var b;if(a===!1)return f(244);if(a===!0)return f(245);if(null===a)return f(246);if(a===c)return f(247);switch(typeof a){case"number":if(Math.floor(a)===a){if(0<=a&&a<=h)return m(0,a);if(-h<=a&&a<0)return m(1,-(a+1))}return f(251),e(a);case"string":var d=[];for(b=0;b<a.length;++b){var g=a.charCodeAt(b);g<128?d.push(g):g<2048?(d.push(192|g>>6),d.push(128|63&g)):g<55296?(d.push(224|g>>12),d.push(128|g>>6&63),d.push(128|63&g)):(g=(1023&g)<<10,g|=1023&a.charCodeAt(++b),g+=65536,d.push(240|g>>18),d.push(128|g>>12&63),d.push(128|g>>6&63),d.push(128|63&g))}return m(3,d.length),i(d);default:var j;if(Array.isArray(a))for(j=a.length,m(4,j),b=0;b<j;++b)n(a[b]);else if(a instanceof Uint8Array)m(2,a.length),i(a);else{var k=Object.keys(a);for(j=k.length,m(5,j),b=0;b<j;++b){var l=k[b];n(l),n(a[l])}}}}var o,p=new ArrayBuffer(256),q=new DataView(p),r=0;if(n(a),"slice"in p)return p.slice(0,r);for(var s=new ArrayBuffer(r),t=new DataView(s),u=0;u<r;++u)t.setUint8(u,q.getUint8(u));return s}function e(a,b,d){function e(a,b){return v+=b,a}function h(b){return e(new Uint8Array(a,v,b),b)}function i(){var a=new ArrayBuffer(4),b=new DataView(a),c=m(),d=32768&c,e=31744&c,g=1023&c;if(31744===e)e=261120;else if(0!==e)e+=114688;else if(0!==g)return g*f;return b.setUint32(0,d<<16|e<<13|g<<13),b.getFloat32(0)}function j(){return e(u.getFloat32(v),4)}function k(){return e(u.getFloat64(v),8)}function l(){return e(u.getUint8(v),1)}function m(){return e(u.getUint16(v),2)}function n(){return e(u.getUint32(v),4)}function o(){return n()*g+n()}function p(){return 255===u.getUint8(v)&&(v+=1,!0)}function q(a){if(a<24)return a;if(24===a)return l();if(25===a)return m();if(26===a)return n();if(27===a)return o();if(31===a)return-1;throw"Invalid length encoding"}function r(a){var b=l();if(255===b)return-1;var c=q(31&b);if(c<0||b>>5!==a)throw"Invalid indefinite length element";return c}function s(a,b){for(var c=0;c<b;++c){var d=l();128&d&&(d<224?(d=(31&d)<<6|63&l(),b-=1):d<240?(d=(15&d)<<12|(63&l())<<6|63&l(),b-=2):(d=(15&d)<<18|(63&l())<<12|(63&l())<<6|63&l(),b-=3)),d<65536?a.push(d):(d-=65536,a.push(55296|d>>10),a.push(56320|1023&d))}}function t(){var a,e,f=l(),g=f>>5,m=31&f;if(7===g)switch(m){case 25:return i();case 26:return j();case 27:return k()}if(e=q(m),e<0&&(g<2||6<g))throw"Invalid length";switch(g){case 0:return e;case 1:return-1-e;case 2:if(e<0){for(var n=[],o=0;(e=r(g))>=0;)o+=e,n.push(h(e));var u=new Uint8Array(o),v=0;for(a=0;a<n.length;++a)u.set(n[a],v),v+=n[a].length;return u}return h(e);case 3:var w=[];if(e<0)for(;(e=r(g))>=0;)s(w,e);else s(w,e);return String.fromCharCode.apply(null,w);case 4:var x;if(e<0)for(x=[];!p();)x.push(t());else for(x=new Array(e),a=0;a<e;++a)x[a]=t();return x;case 5:var y={};for(a=0;a<e||e<0&&!p();++a){var z=t();y[z]=t()}return y;case 6:return b(t(),e);case 7:switch(e){case 20:return!1;case 21:return!0;case 22:return null;case 23:return c;default:return d(e)}}}v
},{"./ServiceRequest":16,"./ServiceResponse":17,eventemitter2:2}],16:[function(a,b,c){function d(a){e(this,a)}var e=a("object-assign");b.exports=d},{"object-assign":3}],17:[function(a,b,c){function d(a){e(this,a)}var e=a("object-assign");b.exports=d},{"object-assign":3}],18:[function(a,b,c){"use strict";function d(a){function b(b){"publish"===b.op?a.emit(b.topic,b.msg):"service_response"===b.op?a.emit(b.id,b):"call_service"===b.op?a.emit(b.service,b):"status"===b.op&&(b.id?a.emit("status:"+b.id,b):a.emit("status",b))}function c(a,b){"png"===a.op?e(a.data,b):b(a)}function d(a,b){if(!h)throw"Cannot process BSON encoded message without BSON header.";var c=new FileReader;c.onload=function(){var a=new Uint8Array(this.result),c=h.deserialize(a);b(c)},c.readAsArrayBuffer(a)}return{onopen:function(b){a.isConnected=!0,a.emit("connection",b)},onclose:function(b){a.isConnected=!1,a.emit("close",b)},onerror:function(b){a.emit("error",b)},onmessage:function(a){if("undefined"!=typeof Blob&&a.data instanceof Blob)d(a.data,function(a){c(a,b)});else if(a.data instanceof ArrayBuffer){var e=f.decode(a.data,g);b(e)}else{var h=JSON.parse("string"==typeof a?a:a.data);c(h,b)}}}}var e=a("../util/decompressPng"),f=a("cbor-js"),g=a("../util/cborTypedArrayTags"),h=(a("ws"),null);"undefined"!=typeof bson&&(h=bson().BSON),b.exports=d},{"../util/cborTypedArrayTags":41,"../util/decompressPng":44,"cbor-js":1,ws:42}],19:[function(a,b,c){function d(a){a=a||{},this.ros=a.ros,this.name=a.name,this.messageType=a.messageType,this.isAdvertised=!1,this.compression=a.compression||"none",this.throttle_rate=a.throttle_rate||0,this.latch=a.latch||!1,this.queue_size=a.queue_size||100,this.queue_length=a.queue_length||0,this.reconnect_on_close=a.reconnect_on_close||!0,this.compression&&"png"!==this.compression&&"cbor"!==this.compression&&"none"!==this.compression&&(this.emit("warning",this.compression+" compression is not supported. No compression will be used."),this.compression="none"),this.throttle_rate<0&&(this.emit("warning",this.throttle_rate+" is not allowed. Set to 0"),this.throttle_rate=0);var b=this;this.reconnect_on_close?this.callForSubscribeAndAdvertise=function(a){b.ros.callOnConnection(a),b.waitForReconnect=!1,b.reconnectFunc=function(){b.waitForReconnect||(b.waitForReconnect=!0,b.ros.callOnConnection(a),b.ros.once("connection",function(){b.waitForReconnect=!1}))},b.ros.on("close",b.reconnectFunc)}:this.callForSubscribeAndAdvertise=this.ros.callOnConnection,this._messageCallback=function(a){b.emit("message",new f(a))}}var e=a("eventemitter2").EventEmitter2,f=a("./Message");d.prototype.__proto__=e.prototype,d.prototype.subscribe=function(a){"function"==typeof a&&this.on("message",a),this.subscribeId||(this.ros.on(this.name,this._messageCallback),this.subscribeId="subscribe:"+this.name+":"+ ++this.ros.idCounter,this.callForSubscribeAndAdvertise({op:"subscribe",id:this.subscribeId,type:this.messageType,topic:this.name,compression:this.compression,throttle_rate:this.throttle_rate,queue_length:this.queue_length}))},d.prototype.unsubscribe=function(a){a&&(this.off("message",a),this.listeners("message").length)||this.subscribeId&&(this.ros.off(this.name,this._messageCallback),this.reconnect_on_close&&this.ros.off("close",this.reconnectFunc),this.emit("unsubscribe"),this.ros.callOnConnection({op:"unsubscribe",id:this.subscribeId,topic:this.name}),this.subscribeId=null)},d.prototype.advertise=function(){if(!this.isAdvertised&&(this.advertiseId="advertise:"+this.name+":"+ ++this.ros.idCounter,this.callForSubscribeAndAdvertise({op:"advertise",id:this.advertiseId,type:this.messageType,topic:this.name,latch:this.latch,queue_size:this.queue_size}),this.isAdvertised=!0,!this.reconnect_on_close)){var a=this;this.ros.on("close",function(){a.isAdvertised=!1})}},d.prototype.unadvertise=function(){this.isAdvertised&&(this.reconnect_on_close&&this.ros.off("close",this.reconnectFunc),this.emit("unadvertise"),this.ros.callOnConnection({op:"unadvertise",id:this.advertiseId,topic:this.name}),this.isAdvertised=!1)},d.prototype.publish=function(a){this.isAdvertised||this.adver