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AA4BuT,GAG7C,QAAuC,KADvCtP,EAAUsP,GACSjP,gBAClB,MAAM,IAAItE,MAAMC,EAAOC,EAAMoB,iBAAiB,CAAC2C,EAAQK,gBAAgB,6BACxEkD,EAAOU,KAAKjE,QAIZA,EAAU,IAAIC,EAAQyN,IACdrN,gBAAkBiP,EACH,EAApBhT,UAAU2B,SACZ+B,EAAQN,IAAMA,GACQ,EAApBpD,UAAU2B,SACZ+B,EAAQG,SAAWA,GACpBoD,EAAOU,KAAKjE,IAWdpB,KAAK4J,WAAa,WACjBjF,EAAOiF,cAUR5J,KAAK6J,YAAc,WAClB,OAAOlF,EAAOkF,eASf7J,KAAK+J,WAAa,WACjBpF,EAAOoF,cASR/J,KAAKgK,UAAY,WAChBrF,EAAOqF,aAGRhK,KAAK4Q,YAAc,WAClB,OAAOjM,EAAOqC,YA4Hf3F,QAASA,GAlvEI,MAqvEM,IAAX,EAAAwP,EAAyB,EAAAA,EAAyB,oBAATC,KAAuBA,KAAyB,oBAAXC,OAAyBA,OAAS,IAC1H,OAAO5U,GApwEN6U,EAAOC,QAAU/U","sources":["webpack://leadsbridge/./node_modules/paho-mqtt/paho-mqtt.js"],"sourcesContent":["/*******************************************************************************\n * Copyright (c) 2013 IBM Corp.\n *\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * and Eclipse Distribution License v1.0 which accompany this distribution.\n *\n * The Eclipse Public License is available at\n * http://www.eclipse.org/legal/epl-v10.html\n * and the Eclipse Distribution License is available at\n * http://www.eclipse.org/org/documents/edl-v10.php.\n *\n * Contributors:\n * Andrew Banks - initial API and implementation and initial documentation\n *******************************************************************************/\n\n\n// Only expose a single object name in the global namespace.\n// Everything must go through this module. Global Paho module\n// only has a single public function, client, which returns\n// a Paho client object given connection details.\n\n/**\n * Send and receive messages using web browsers.\n *

\n * This programming interface lets a JavaScript client application use the MQTT V3.1 or\n * V3.1.1 protocol to connect to an MQTT-supporting messaging server.\n *\n * The function supported includes:\n *

    \n *
  1. Connecting to and disconnecting from a server. The server is identified by its host name and port number.\n *
  2. Specifying options that relate to the communications link with the server,\n * for example the frequency of keep-alive heartbeats, and whether SSL/TLS is required.\n *
  3. Subscribing to and receiving messages from MQTT Topics.\n *
  4. Publishing messages to MQTT Topics.\n *
\n *

\n * The API consists of two main objects:\n *

\n *
{@link Paho.Client}
\n *
This contains methods that provide the functionality of the API,\n * including provision of callbacks that notify the application when a message\n * arrives from or is delivered to the messaging server,\n * or when the status of its connection to the messaging server changes.
\n *
{@link Paho.Message}
\n *
This encapsulates the payload of the message along with various attributes\n * associated with its delivery, in particular the destination to which it has\n * been (or is about to be) sent.
\n *
\n *

\n * The programming interface validates parameters passed to it, and will throw\n * an Error containing an error message intended for developer use, if it detects\n * an error with any parameter.\n *

\n * Example:\n *\n *

\nvar client = new Paho.MQTT.Client(location.hostname, Number(location.port), \"clientId\");\nclient.onConnectionLost = onConnectionLost;\nclient.onMessageArrived = onMessageArrived;\nclient.connect({onSuccess:onConnect});\n\nfunction onConnect() {\n  // Once a connection has been made, make a subscription and send a message.\n  console.log(\"onConnect\");\n  client.subscribe(\"/World\");\n  var message = new Paho.MQTT.Message(\"Hello\");\n  message.destinationName = \"/World\";\n  client.send(message);\n};\nfunction onConnectionLost(responseObject) {\n  if (responseObject.errorCode !== 0)\n\tconsole.log(\"onConnectionLost:\"+responseObject.errorMessage);\n};\nfunction onMessageArrived(message) {\n  console.log(\"onMessageArrived:\"+message.payloadString);\n  client.disconnect();\n};\n * 
\n * @namespace Paho\n */\n\n/* jshint shadow:true */\n(function ExportLibrary(root, factory) {\n\tif(typeof exports === \"object\" && typeof module === \"object\"){\n\t\tmodule.exports = factory();\n\t} else if (typeof define === \"function\" && define.amd){\n\t\tdefine(factory);\n\t} else if (typeof exports === \"object\"){\n\t\texports = factory();\n\t} else {\n\t\t//if (typeof root.Paho === \"undefined\"){\n\t\t//\troot.Paho = {};\n\t\t//}\n\t\troot.Paho = factory();\n\t}\n})(this, function LibraryFactory(){\n\n\n\tvar PahoMQTT = (function (global) {\n\n\t// Private variables below, these are only visible inside the function closure\n\t// which is used to define the module.\n\tvar version = \"@VERSION@-@BUILDLEVEL@\";\n\n\t/**\n\t * @private\n\t */\n\tvar localStorage = global.localStorage || (function () {\n\t\tvar data = {};\n\n\t\treturn {\n\t\t\tsetItem: function (key, item) { data[key] = item; },\n\t\t\tgetItem: function (key) { return data[key]; },\n\t\t\tremoveItem: function (key) { delete data[key]; },\n\t\t};\n\t})();\n\n\t\t/**\n\t * Unique message type identifiers, with associated\n\t * associated integer values.\n\t * @private\n\t */\n\t\tvar MESSAGE_TYPE = {\n\t\t\tCONNECT: 1,\n\t\t\tCONNACK: 2,\n\t\t\tPUBLISH: 3,\n\t\t\tPUBACK: 4,\n\t\t\tPUBREC: 5,\n\t\t\tPUBREL: 6,\n\t\t\tPUBCOMP: 7,\n\t\t\tSUBSCRIBE: 8,\n\t\t\tSUBACK: 9,\n\t\t\tUNSUBSCRIBE: 10,\n\t\t\tUNSUBACK: 11,\n\t\t\tPINGREQ: 12,\n\t\t\tPINGRESP: 13,\n\t\t\tDISCONNECT: 14\n\t\t};\n\n\t\t// Collection of utility methods used to simplify module code\n\t\t// and promote the DRY pattern.\n\n\t\t/**\n\t * Validate an object's parameter names to ensure they\n\t * match a list of expected variables name for this option\n\t * type. Used to ensure option object passed into the API don't\n\t * contain erroneous parameters.\n\t * @param {Object} obj - User options object\n\t * @param {Object} keys - valid keys and types that may exist in obj.\n\t * @throws {Error} Invalid option parameter found.\n\t * @private\n\t */\n\t\tvar validate = function(obj, keys) {\n\t\t\tfor (var key in obj) {\n\t\t\t\tif (obj.hasOwnProperty(key)) {\n\t\t\t\t\tif (keys.hasOwnProperty(key)) {\n\t\t\t\t\t\tif (typeof obj[key] !== keys[key])\n\t\t\t\t\t\t\tthrow new Error(format(ERROR.INVALID_TYPE, [typeof obj[key], key]));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar errorStr = \"Unknown property, \" + key + \". Valid properties are:\";\n\t\t\t\t\t\tfor (var validKey in keys)\n\t\t\t\t\t\t\tif (keys.hasOwnProperty(validKey))\n\t\t\t\t\t\t\t\terrorStr = errorStr+\" \"+validKey;\n\t\t\t\t\t\tthrow new Error(errorStr);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t * Return a new function which runs the user function bound\n\t * to a fixed scope.\n\t * @param {function} User function\n\t * @param {object} Function scope\n\t * @return {function} User function bound to another scope\n\t * @private\n\t */\n\t\tvar scope = function (f, scope) {\n\t\t\treturn function () {\n\t\t\t\treturn f.apply(scope, arguments);\n\t\t\t};\n\t\t};\n\n\t\t/**\n\t * Unique message type identifiers, with associated\n\t * associated integer values.\n\t * @private\n\t */\n\t\tvar ERROR = {\n\t\t\tOK: {code:0, text:\"AMQJSC0000I OK.\"},\n\t\t\tCONNECT_TIMEOUT: {code:1, text:\"AMQJSC0001E Connect timed out.\"},\n\t\t\tSUBSCRIBE_TIMEOUT: {code:2, text:\"AMQJS0002E Subscribe timed out.\"},\n\t\t\tUNSUBSCRIBE_TIMEOUT: {code:3, text:\"AMQJS0003E Unsubscribe timed out.\"},\n\t\t\tPING_TIMEOUT: {code:4, text:\"AMQJS0004E Ping timed out.\"},\n\t\t\tINTERNAL_ERROR: {code:5, text:\"AMQJS0005E Internal error. Error Message: {0}, Stack trace: {1}\"},\n\t\t\tCONNACK_RETURNCODE: {code:6, text:\"AMQJS0006E Bad Connack return code:{0} {1}.\"},\n\t\t\tSOCKET_ERROR: {code:7, text:\"AMQJS0007E Socket error:{0}.\"},\n\t\t\tSOCKET_CLOSE: {code:8, text:\"AMQJS0008I Socket closed.\"},\n\t\t\tMALFORMED_UTF: {code:9, text:\"AMQJS0009E Malformed UTF data:{0} {1} {2}.\"},\n\t\t\tUNSUPPORTED: {code:10, text:\"AMQJS0010E {0} is not supported by this browser.\"},\n\t\t\tINVALID_STATE: {code:11, text:\"AMQJS0011E Invalid state {0}.\"},\n\t\t\tINVALID_TYPE: {code:12, text:\"AMQJS0012E Invalid type {0} for {1}.\"},\n\t\t\tINVALID_ARGUMENT: {code:13, text:\"AMQJS0013E Invalid argument {0} for {1}.\"},\n\t\t\tUNSUPPORTED_OPERATION: {code:14, text:\"AMQJS0014E Unsupported operation.\"},\n\t\t\tINVALID_STORED_DATA: {code:15, text:\"AMQJS0015E Invalid data in local storage key={0} value={1}.\"},\n\t\t\tINVALID_MQTT_MESSAGE_TYPE: {code:16, text:\"AMQJS0016E Invalid MQTT message type {0}.\"},\n\t\t\tMALFORMED_UNICODE: {code:17, text:\"AMQJS0017E Malformed Unicode string:{0} {1}.\"},\n\t\t\tBUFFER_FULL: {code:18, text:\"AMQJS0018E Message buffer is full, maximum buffer size: {0}.\"},\n\t\t};\n\n\t\t/** CONNACK RC Meaning. */\n\t\tvar CONNACK_RC = {\n\t\t\t0:\"Connection Accepted\",\n\t\t\t1:\"Connection Refused: unacceptable protocol version\",\n\t\t\t2:\"Connection Refused: identifier rejected\",\n\t\t\t3:\"Connection Refused: server unavailable\",\n\t\t\t4:\"Connection Refused: bad user name or password\",\n\t\t\t5:\"Connection Refused: not authorized\"\n\t\t};\n\n\t/**\n\t * Format an error message text.\n\t * @private\n\t * @param {error} ERROR value above.\n\t * @param {substitutions} [array] substituted into the text.\n\t * @return the text with the substitutions made.\n\t */\n\t\tvar format = function(error, substitutions) {\n\t\t\tvar text = error.text;\n\t\t\tif (substitutions) {\n\t\t\t\tvar field,start;\n\t\t\t\tfor (var i=0; i 0) {\n\t\t\t\t\t\tvar part1 = text.substring(0,start);\n\t\t\t\t\t\tvar part2 = text.substring(start+field.length);\n\t\t\t\t\t\ttext = part1+substitutions[i]+part2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn text;\n\t\t};\n\n\t\t//MQTT protocol and version 6 M Q I s d p 3\n\t\tvar MqttProtoIdentifierv3 = [0x00,0x06,0x4d,0x51,0x49,0x73,0x64,0x70,0x03];\n\t\t//MQTT proto/version for 311 4 M Q T T 4\n\t\tvar MqttProtoIdentifierv4 = [0x00,0x04,0x4d,0x51,0x54,0x54,0x04];\n\n\t\t/**\n\t * Construct an MQTT wire protocol message.\n\t * @param type MQTT packet type.\n\t * @param options optional wire message attributes.\n\t *\n\t * Optional properties\n\t *\n\t * messageIdentifier: message ID in the range [0..65535]\n\t * payloadMessage:\tApplication Message - PUBLISH only\n\t * connectStrings:\tarray of 0 or more Strings to be put into the CONNECT payload\n\t * topics:\t\t\tarray of strings (SUBSCRIBE, UNSUBSCRIBE)\n\t * requestQoS:\t\tarray of QoS values [0..2]\n\t *\n\t * \"Flag\" properties\n\t * cleanSession:\ttrue if present / false if absent (CONNECT)\n\t * willMessage: \ttrue if present / false if absent (CONNECT)\n\t * isRetained:\t\ttrue if present / false if absent (CONNECT)\n\t * userName:\t\ttrue if present / false if absent (CONNECT)\n\t * password:\t\ttrue if present / false if absent (CONNECT)\n\t * keepAliveInterval:\tinteger [0..65535] (CONNECT)\n\t *\n\t * @private\n\t * @ignore\n\t */\n\t\tvar WireMessage = function (type, options) {\n\t\t\tthis.type = type;\n\t\t\tfor (var name in options) {\n\t\t\t\tif (options.hasOwnProperty(name)) {\n\t\t\t\t\tthis[name] = options[name];\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tWireMessage.prototype.encode = function() {\n\t\t// Compute the first byte of the fixed header\n\t\t\tvar first = ((this.type & 0x0f) << 4);\n\n\t\t\t/*\n\t\t * Now calculate the length of the variable header + payload by adding up the lengths\n\t\t * of all the component parts\n\t\t */\n\n\t\t\tvar remLength = 0;\n\t\t\tvar topicStrLength = [];\n\t\t\tvar destinationNameLength = 0;\n\t\t\tvar willMessagePayloadBytes;\n\n\t\t\t// if the message contains a messageIdentifier then we need two bytes for that\n\t\t\tif (this.messageIdentifier !== undefined)\n\t\t\t\tremLength += 2;\n\n\t\t\tswitch(this.type) {\n\t\t\t// If this a Connect then we need to include 12 bytes for its header\n\t\t\tcase MESSAGE_TYPE.CONNECT:\n\t\t\t\tswitch(this.mqttVersion) {\n\t\t\t\tcase 3:\n\t\t\t\t\tremLength += MqttProtoIdentifierv3.length + 3;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tremLength += MqttProtoIdentifierv4.length + 3;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tremLength += UTF8Length(this.clientId) + 2;\n\t\t\t\tif (this.willMessage !== undefined) {\n\t\t\t\t\tremLength += UTF8Length(this.willMessage.destinationName) + 2;\n\t\t\t\t\t// Will message is always a string, sent as UTF-8 characters with a preceding length.\n\t\t\t\t\twillMessagePayloadBytes = this.willMessage.payloadBytes;\n\t\t\t\t\tif (!(willMessagePayloadBytes instanceof Uint8Array))\n\t\t\t\t\t\twillMessagePayloadBytes = new Uint8Array(payloadBytes);\n\t\t\t\t\tremLength += willMessagePayloadBytes.byteLength +2;\n\t\t\t\t}\n\t\t\t\tif (this.userName !== undefined)\n\t\t\t\t\tremLength += UTF8Length(this.userName) + 2;\n\t\t\t\tif (this.password !== undefined)\n\t\t\t\t\tremLength += UTF8Length(this.password) + 2;\n\t\t\t\tbreak;\n\n\t\t\t// Subscribe, Unsubscribe can both contain topic strings\n\t\t\tcase MESSAGE_TYPE.SUBSCRIBE:\n\t\t\t\tfirst |= 0x02; // Qos = 1;\n\t\t\t\tfor ( var i = 0; i < this.topics.length; i++) {\n\t\t\t\t\ttopicStrLength[i] = UTF8Length(this.topics[i]);\n\t\t\t\t\tremLength += topicStrLength[i] + 2;\n\t\t\t\t}\n\t\t\t\tremLength += this.requestedQos.length; // 1 byte for each topic's Qos\n\t\t\t\t// QoS on Subscribe only\n\t\t\t\tbreak;\n\n\t\t\tcase MESSAGE_TYPE.UNSUBSCRIBE:\n\t\t\t\tfirst |= 0x02; // Qos = 1;\n\t\t\t\tfor ( var i = 0; i < this.topics.length; i++) {\n\t\t\t\t\ttopicStrLength[i] = UTF8Length(this.topics[i]);\n\t\t\t\t\tremLength += topicStrLength[i] + 2;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase MESSAGE_TYPE.PUBREL:\n\t\t\t\tfirst |= 0x02; // Qos = 1;\n\t\t\t\tbreak;\n\n\t\t\tcase MESSAGE_TYPE.PUBLISH:\n\t\t\t\tif (this.payloadMessage.duplicate) first |= 0x08;\n\t\t\t\tfirst = first |= (this.payloadMessage.qos << 1);\n\t\t\t\tif (this.payloadMessage.retained) first |= 0x01;\n\t\t\t\tdestinationNameLength = UTF8Length(this.payloadMessage.destinationName);\n\t\t\t\tremLength += destinationNameLength + 2;\n\t\t\t\tvar payloadBytes = this.payloadMessage.payloadBytes;\n\t\t\t\tremLength += payloadBytes.byteLength;\n\t\t\t\tif (payloadBytes instanceof ArrayBuffer)\n\t\t\t\t\tpayloadBytes = new Uint8Array(payloadBytes);\n\t\t\t\telse if (!(payloadBytes instanceof Uint8Array))\n\t\t\t\t\tpayloadBytes = new Uint8Array(payloadBytes.buffer);\n\t\t\t\tbreak;\n\n\t\t\tcase MESSAGE_TYPE.DISCONNECT:\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Now we can allocate a buffer for the message\n\n\t\t\tvar mbi = encodeMBI(remLength); // Convert the length to MQTT MBI format\n\t\t\tvar pos = mbi.length + 1; // Offset of start of variable header\n\t\t\tvar buffer = new ArrayBuffer(remLength + pos);\n\t\t\tvar byteStream = new Uint8Array(buffer); // view it as a sequence of bytes\n\n\t\t\t//Write the fixed header into the buffer\n\t\t\tbyteStream[0] = first;\n\t\t\tbyteStream.set(mbi,1);\n\n\t\t\t// If this is a PUBLISH then the variable header starts with a topic\n\t\t\tif (this.type == MESSAGE_TYPE.PUBLISH)\n\t\t\t\tpos = writeString(this.payloadMessage.destinationName, destinationNameLength, byteStream, pos);\n\t\t\t// If this is a CONNECT then the variable header contains the protocol name/version, flags and keepalive time\n\n\t\t\telse if (this.type == MESSAGE_TYPE.CONNECT) {\n\t\t\t\tswitch (this.mqttVersion) {\n\t\t\t\tcase 3:\n\t\t\t\t\tbyteStream.set(MqttProtoIdentifierv3, pos);\n\t\t\t\t\tpos += MqttProtoIdentifierv3.length;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tbyteStream.set(MqttProtoIdentifierv4, pos);\n\t\t\t\t\tpos += MqttProtoIdentifierv4.length;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tvar connectFlags = 0;\n\t\t\t\tif (this.cleanSession)\n\t\t\t\t\tconnectFlags = 0x02;\n\t\t\t\tif (this.willMessage !== undefined ) {\n\t\t\t\t\tconnectFlags |= 0x04;\n\t\t\t\t\tconnectFlags |= (this.willMessage.qos<<3);\n\t\t\t\t\tif (this.willMessage.retained) {\n\t\t\t\t\t\tconnectFlags |= 0x20;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.userName !== undefined)\n\t\t\t\t\tconnectFlags |= 0x80;\n\t\t\t\tif (this.password !== undefined)\n\t\t\t\t\tconnectFlags |= 0x40;\n\t\t\t\tbyteStream[pos++] = connectFlags;\n\t\t\t\tpos = writeUint16 (this.keepAliveInterval, byteStream, pos);\n\t\t\t}\n\n\t\t\t// Output the messageIdentifier - if there is one\n\t\t\tif (this.messageIdentifier !== undefined)\n\t\t\t\tpos = writeUint16 (this.messageIdentifier, byteStream, pos);\n\n\t\t\tswitch(this.type) {\n\t\t\tcase MESSAGE_TYPE.CONNECT:\n\t\t\t\tpos = writeString(this.clientId, UTF8Length(this.clientId), byteStream, pos);\n\t\t\t\tif (this.willMessage !== undefined) {\n\t\t\t\t\tpos = writeString(this.willMessage.destinationName, UTF8Length(this.willMessage.destinationName), byteStream, pos);\n\t\t\t\t\tpos = writeUint16(willMessagePayloadBytes.byteLength, byteStream, pos);\n\t\t\t\t\tbyteStream.set(willMessagePayloadBytes, pos);\n\t\t\t\t\tpos += willMessagePayloadBytes.byteLength;\n\n\t\t\t\t}\n\t\t\t\tif (this.userName !== undefined)\n\t\t\t\t\tpos = writeString(this.userName, UTF8Length(this.userName), byteStream, pos);\n\t\t\t\tif (this.password !== undefined)\n\t\t\t\t\tpos = writeString(this.password, UTF8Length(this.password), byteStream, pos);\n\t\t\t\tbreak;\n\n\t\t\tcase MESSAGE_TYPE.PUBLISH:\n\t\t\t\t// PUBLISH has a text or binary payload, if text do not add a 2 byte length field, just the UTF characters.\n\t\t\t\tbyteStream.set(payloadBytes, pos);\n\n\t\t\t\tbreak;\n\n\t\t\t\t// \t case MESSAGE_TYPE.PUBREC:\n\t\t\t\t// \t case MESSAGE_TYPE.PUBREL:\n\t\t\t\t// \t case MESSAGE_TYPE.PUBCOMP:\n\t\t\t\t// \t \tbreak;\n\n\t\t\tcase MESSAGE_TYPE.SUBSCRIBE:\n\t\t\t\t// SUBSCRIBE has a list of topic strings and request QoS\n\t\t\t\tfor (var i=0; i> 4;\n\t\t\tvar messageInfo = first &= 0x0f;\n\t\t\tpos += 1;\n\n\n\t\t\t// Decode the remaining length (MBI format)\n\n\t\t\tvar digit;\n\t\t\tvar remLength = 0;\n\t\t\tvar multiplier = 1;\n\t\t\tdo {\n\t\t\t\tif (pos == input.length) {\n\t\t\t\t\treturn [null,startingPos];\n\t\t\t\t}\n\t\t\t\tdigit = input[pos++];\n\t\t\t\tremLength += ((digit & 0x7F) * multiplier);\n\t\t\t\tmultiplier *= 128;\n\t\t\t} while ((digit & 0x80) !== 0);\n\n\t\t\tvar endPos = pos+remLength;\n\t\t\tif (endPos > input.length) {\n\t\t\t\treturn [null,startingPos];\n\t\t\t}\n\n\t\t\tvar wireMessage = new WireMessage(type);\n\t\t\tswitch(type) {\n\t\t\tcase MESSAGE_TYPE.CONNACK:\n\t\t\t\tvar connectAcknowledgeFlags = input[pos++];\n\t\t\t\tif (connectAcknowledgeFlags & 0x01)\n\t\t\t\t\twireMessage.sessionPresent = true;\n\t\t\t\twireMessage.returnCode = input[pos++];\n\t\t\t\tbreak;\n\n\t\t\tcase MESSAGE_TYPE.PUBLISH:\n\t\t\t\tvar qos = (messageInfo >> 1) & 0x03;\n\n\t\t\t\tvar len = readUint16(input, pos);\n\t\t\t\tpos += 2;\n\t\t\t\tvar topicName = parseUTF8(input, pos, len);\n\t\t\t\tpos += len;\n\t\t\t\t// If QoS 1 or 2 there will be a messageIdentifier\n\t\t\t\tif (qos > 0) {\n\t\t\t\t\twireMessage.messageIdentifier = readUint16(input, pos);\n\t\t\t\t\tpos += 2;\n\t\t\t\t}\n\n\t\t\t\tvar message = new Message(input.subarray(pos, endPos));\n\t\t\t\tif ((messageInfo & 0x01) == 0x01)\n\t\t\t\t\tmessage.retained = true;\n\t\t\t\tif ((messageInfo & 0x08) == 0x08)\n\t\t\t\t\tmessage.duplicate = true;\n\t\t\t\tmessage.qos = qos;\n\t\t\t\tmessage.destinationName = topicName;\n\t\t\t\twireMessage.payloadMessage = message;\n\t\t\t\tbreak;\n\n\t\t\tcase MESSAGE_TYPE.PUBACK:\n\t\t\tcase MESSAGE_TYPE.PUBREC:\n\t\t\tcase MESSAGE_TYPE.PUBREL:\n\t\t\tcase MESSAGE_TYPE.PUBCOMP:\n\t\t\tcase MESSAGE_TYPE.UNSUBACK:\n\t\t\t\twireMessage.messageIdentifier = readUint16(input, pos);\n\t\t\t\tbreak;\n\n\t\t\tcase MESSAGE_TYPE.SUBACK:\n\t\t\t\twireMessage.messageIdentifier = readUint16(input, pos);\n\t\t\t\tpos += 2;\n\t\t\t\twireMessage.returnCode = input.subarray(pos, endPos);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn [wireMessage,endPos];\n\t\t}\n\n\t\tfunction writeUint16(input, buffer, offset) {\n\t\t\tbuffer[offset++] = input >> 8; //MSB\n\t\t\tbuffer[offset++] = input % 256; //LSB\n\t\t\treturn offset;\n\t\t}\n\n\t\tfunction writeString(input, utf8Length, buffer, offset) {\n\t\t\toffset = writeUint16(utf8Length, buffer, offset);\n\t\t\tstringToUTF8(input, buffer, offset);\n\t\t\treturn offset + utf8Length;\n\t\t}\n\n\t\tfunction readUint16(buffer, offset) {\n\t\t\treturn 256*buffer[offset] + buffer[offset+1];\n\t\t}\n\n\t\t/**\n\t * Encodes an MQTT Multi-Byte Integer\n\t * @private\n\t */\n\t\tfunction encodeMBI(number) {\n\t\t\tvar output = new Array(1);\n\t\t\tvar numBytes = 0;\n\n\t\t\tdo {\n\t\t\t\tvar digit = number % 128;\n\t\t\t\tnumber = number >> 7;\n\t\t\t\tif (number > 0) {\n\t\t\t\t\tdigit |= 0x80;\n\t\t\t\t}\n\t\t\t\toutput[numBytes++] = digit;\n\t\t\t} while ( (number > 0) && (numBytes<4) );\n\n\t\t\treturn output;\n\t\t}\n\n\t\t/**\n\t * Takes a String and calculates its length in bytes when encoded in UTF8.\n\t * @private\n\t */\n\t\tfunction UTF8Length(input) {\n\t\t\tvar output = 0;\n\t\t\tfor (var i = 0; i 0x7FF)\n\t\t\t\t{\n\t\t\t\t\t// Surrogate pair means its a 4 byte character\n\t\t\t\t\tif (0xD800 <= charCode && charCode <= 0xDBFF)\n\t\t\t\t\t{\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\toutput++;\n\t\t\t\t\t}\n\t\t\t\t\toutput +=3;\n\t\t\t\t}\n\t\t\t\telse if (charCode > 0x7F)\n\t\t\t\t\toutput +=2;\n\t\t\t\telse\n\t\t\t\t\toutput++;\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\n\t\t/**\n\t * Takes a String and writes it into an array as UTF8 encoded bytes.\n\t * @private\n\t */\n\t\tfunction stringToUTF8(input, output, start) {\n\t\t\tvar pos = start;\n\t\t\tfor (var i = 0; i>6 & 0x1F | 0xC0;\n\t\t\t\t\toutput[pos++] = charCode & 0x3F | 0x80;\n\t\t\t\t} else if (charCode <= 0xFFFF) {\n\t\t\t\t\toutput[pos++] = charCode>>12 & 0x0F | 0xE0;\n\t\t\t\t\toutput[pos++] = charCode>>6 & 0x3F | 0x80;\n\t\t\t\t\toutput[pos++] = charCode & 0x3F | 0x80;\n\t\t\t\t} else {\n\t\t\t\t\toutput[pos++] = charCode>>18 & 0x07 | 0xF0;\n\t\t\t\t\toutput[pos++] = charCode>>12 & 0x3F | 0x80;\n\t\t\t\t\toutput[pos++] = charCode>>6 & 0x3F | 0x80;\n\t\t\t\t\toutput[pos++] = charCode & 0x3F | 0x80;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\n\t\tfunction parseUTF8(input, offset, length) {\n\t\t\tvar output = \"\";\n\t\t\tvar utf16;\n\t\t\tvar pos = offset;\n\n\t\t\twhile (pos < offset+length)\n\t\t\t{\n\t\t\t\tvar byte1 = input[pos++];\n\t\t\t\tif (byte1 < 128)\n\t\t\t\t\tutf16 = byte1;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar byte2 = input[pos++]-128;\n\t\t\t\t\tif (byte2 < 0)\n\t\t\t\t\t\tthrow new Error(format(ERROR.MALFORMED_UTF, [byte1.toString(16), byte2.toString(16),\"\"]));\n\t\t\t\t\tif (byte1 < 0xE0) // 2 byte character\n\t\t\t\t\t\tutf16 = 64*(byte1-0xC0) + byte2;\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar byte3 = input[pos++]-128;\n\t\t\t\t\t\tif (byte3 < 0)\n\t\t\t\t\t\t\tthrow new Error(format(ERROR.MALFORMED_UTF, [byte1.toString(16), byte2.toString(16), byte3.toString(16)]));\n\t\t\t\t\t\tif (byte1 < 0xF0) // 3 byte character\n\t\t\t\t\t\t\tutf16 = 4096*(byte1-0xE0) + 64*byte2 + byte3;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar byte4 = input[pos++]-128;\n\t\t\t\t\t\t\tif (byte4 < 0)\n\t\t\t\t\t\t\t\tthrow new Error(format(ERROR.MALFORMED_UTF, [byte1.toString(16), byte2.toString(16), byte3.toString(16), byte4.toString(16)]));\n\t\t\t\t\t\t\tif (byte1 < 0xF8) // 4 byte character\n\t\t\t\t\t\t\t\tutf16 = 262144*(byte1-0xF0) + 4096*byte2 + 64*byte3 + byte4;\n\t\t\t\t\t\t\telse // longer encodings are not supported\n\t\t\t\t\t\t\t\tthrow new Error(format(ERROR.MALFORMED_UTF, [byte1.toString(16), byte2.toString(16), byte3.toString(16), byte4.toString(16)]));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (utf16 > 0xFFFF) // 4 byte character - express as a surrogate pair\n\t\t\t\t{\n\t\t\t\t\tutf16 -= 0x10000;\n\t\t\t\t\toutput += String.fromCharCode(0xD800 + (utf16 >> 10)); // lead character\n\t\t\t\t\tutf16 = 0xDC00 + (utf16 & 0x3FF); // trail character\n\t\t\t\t}\n\t\t\t\toutput += String.fromCharCode(utf16);\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\n\t\t/**\n\t * Repeat keepalive requests, monitor responses.\n\t * @ignore\n\t */\n\t\tvar Pinger = function(client, keepAliveInterval) {\n\t\t\tthis._client = client;\n\t\t\tthis._keepAliveInterval = keepAliveInterval*1000;\n\t\t\tthis.isReset = false;\n\n\t\t\tvar pingReq = new WireMessage(MESSAGE_TYPE.PINGREQ).encode();\n\n\t\t\tvar doTimeout = function (pinger) {\n\t\t\t\treturn function () {\n\t\t\t\t\treturn doPing.apply(pinger);\n\t\t\t\t};\n\t\t\t};\n\n\t\t\t/** @ignore */\n\t\t\tvar doPing = function() {\n\t\t\t\tif (!this.isReset) {\n\t\t\t\t\tthis._client._trace(\"Pinger.doPing\", \"Timed out\");\n\t\t\t\t\tthis._client._disconnected( ERROR.PING_TIMEOUT.code , format(ERROR.PING_TIMEOUT));\n\t\t\t\t} else {\n\t\t\t\t\tthis.isReset = false;\n\t\t\t\t\tthis._client._trace(\"Pinger.doPing\", \"send PINGREQ\");\n\t\t\t\t\tthis._client.socket.send(pingReq);\n\t\t\t\t\tthis.timeout = setTimeout(doTimeout(this), this._keepAliveInterval);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.reset = function() {\n\t\t\t\tthis.isReset = true;\n\t\t\t\tclearTimeout(this.timeout);\n\t\t\t\tif (this._keepAliveInterval > 0)\n\t\t\t\t\tthis.timeout = setTimeout(doTimeout(this), this._keepAliveInterval);\n\t\t\t};\n\n\t\t\tthis.cancel = function() {\n\t\t\t\tclearTimeout(this.timeout);\n\t\t\t};\n\t\t};\n\n\t\t/**\n\t * Monitor request completion.\n\t * @ignore\n\t */\n\t\tvar Timeout = function(client, timeoutSeconds, action, args) {\n\t\t\tif (!timeoutSeconds)\n\t\t\t\ttimeoutSeconds = 30;\n\n\t\t\tvar doTimeout = function (action, client, args) {\n\t\t\t\treturn function () {\n\t\t\t\t\treturn action.apply(client, args);\n\t\t\t\t};\n\t\t\t};\n\t\t\tthis.timeout = setTimeout(doTimeout(action, client, args), timeoutSeconds * 1000);\n\n\t\t\tthis.cancel = function() {\n\t\t\t\tclearTimeout(this.timeout);\n\t\t\t};\n\t\t};\n\n\t/**\n\t * Internal implementation of the Websockets MQTT V3.1 client.\n\t *\n\t * @name Paho.ClientImpl @constructor\n\t * @param {String} host the DNS nameof the webSocket host.\n\t * @param {Number} port the port number for that host.\n\t * @param {String} clientId the MQ client identifier.\n\t */\n\t\tvar ClientImpl = function (uri, host, port, path, clientId) {\n\t\t// Check dependencies are satisfied in this browser.\n\t\t\tif (!(\"WebSocket\" in global && global.WebSocket !== null)) {\n\t\t\t\tthrow new Error(format(ERROR.UNSUPPORTED, [\"WebSocket\"]));\n\t\t\t}\n\t\t\tif (!(\"ArrayBuffer\" in global && global.ArrayBuffer !== null)) {\n\t\t\t\tthrow new Error(format(ERROR.UNSUPPORTED, [\"ArrayBuffer\"]));\n\t\t\t}\n\t\t\tthis._trace(\"Paho.Client\", uri, host, port, path, clientId);\n\n\t\t\tthis.host = host;\n\t\t\tthis.port = port;\n\t\t\tthis.path = path;\n\t\t\tthis.uri = uri;\n\t\t\tthis.clientId = clientId;\n\t\t\tthis._wsuri = null;\n\n\t\t\t// Local storagekeys are qualified with the following string.\n\t\t\t// The conditional inclusion of path in the key is for backward\n\t\t\t// compatibility to when the path was not configurable and assumed to\n\t\t\t// be /mqtt\n\t\t\tthis._localKey=host+\":\"+port+(path!=\"/mqtt\"?\":\"+path:\"\")+\":\"+clientId+\":\";\n\n\t\t\t// Create private instance-only message queue\n\t\t\t// Internal queue of messages to be sent, in sending order.\n\t\t\tthis._msg_queue = [];\n\t\t\tthis._buffered_msg_queue = [];\n\n\t\t\t// Messages we have sent and are expecting a response for, indexed by their respective message ids.\n\t\t\tthis._sentMessages = {};\n\n\t\t\t// Messages we have received and acknowleged and are expecting a confirm message for\n\t\t\t// indexed by their respective message ids.\n\t\t\tthis._receivedMessages = {};\n\n\t\t\t// Internal list of callbacks to be executed when messages\n\t\t\t// have been successfully sent over web socket, e.g. disconnect\n\t\t\t// when it doesn't have to wait for ACK, just message is dispatched.\n\t\t\tthis._notify_msg_sent = {};\n\n\t\t\t// Unique identifier for SEND messages, incrementing\n\t\t\t// counter as messages are sent.\n\t\t\tthis._message_identifier = 1;\n\n\t\t\t// Used to determine the transmission sequence of stored sent messages.\n\t\t\tthis._sequence = 0;\n\n\n\t\t\t// Load the local state, if any, from the saved version, only restore state relevant to this client.\n\t\t\tfor (var key in localStorage)\n\t\t\t\tif ( key.indexOf(\"Sent:\"+this._localKey) === 0 || key.indexOf(\"Received:\"+this._localKey) === 0)\n\t\t\t\t\tthis.restore(key);\n\t\t};\n\n\t\t// Messaging Client public instance members.\n\t\tClientImpl.prototype.host = null;\n\t\tClientImpl.prototype.port = null;\n\t\tClientImpl.prototype.path = null;\n\t\tClientImpl.prototype.uri = null;\n\t\tClientImpl.prototype.clientId = null;\n\n\t\t// Messaging Client private instance members.\n\t\tClientImpl.prototype.socket = null;\n\t\t/* true once we have received an acknowledgement to a CONNECT packet. */\n\t\tClientImpl.prototype.connected = false;\n\t\t/* The largest message identifier allowed, may not be larger than 2**16 but\n\t\t * if set smaller reduces the maximum number of outbound messages allowed.\n\t\t */\n\t\tClientImpl.prototype.maxMessageIdentifier = 65536;\n\t\tClientImpl.prototype.connectOptions = null;\n\t\tClientImpl.prototype.hostIndex = null;\n\t\tClientImpl.prototype.onConnected = null;\n\t\tClientImpl.prototype.onConnectionLost = null;\n\t\tClientImpl.prototype.onMessageDelivered = null;\n\t\tClientImpl.prototype.onMessageArrived = null;\n\t\tClientImpl.prototype.traceFunction = null;\n\t\tClientImpl.prototype._msg_queue = null;\n\t\tClientImpl.prototype._buffered_msg_queue = null;\n\t\tClientImpl.prototype._connectTimeout = null;\n\t\t/* The sendPinger monitors how long we allow before we send data to prove to the server that we are alive. */\n\t\tClientImpl.prototype.sendPinger = null;\n\t\t/* The receivePinger monitors how long we allow before we require evidence that the server is alive. */\n\t\tClientImpl.prototype.receivePinger = null;\n\t\tClientImpl.prototype._reconnectInterval = 1; // Reconnect Delay, starts at 1 second\n\t\tClientImpl.prototype._reconnecting = false;\n\t\tClientImpl.prototype._reconnectTimeout = null;\n\t\tClientImpl.prototype.disconnectedPublishing = false;\n\t\tClientImpl.prototype.disconnectedBufferSize = 5000;\n\n\t\tClientImpl.prototype.receiveBuffer = null;\n\n\t\tClientImpl.prototype._traceBuffer = null;\n\t\tClientImpl.prototype._MAX_TRACE_ENTRIES = 100;\n\n\t\tClientImpl.prototype.connect = function (connectOptions) {\n\t\t\tvar connectOptionsMasked = this._traceMask(connectOptions, \"password\");\n\t\t\tthis._trace(\"Client.connect\", connectOptionsMasked, this.socket, this.connected);\n\n\t\t\tif (this.connected)\n\t\t\t\tthrow new Error(format(ERROR.INVALID_STATE, [\"already connected\"]));\n\t\t\tif (this.socket)\n\t\t\t\tthrow new Error(format(ERROR.INVALID_STATE, [\"already connected\"]));\n\n\t\t\tif (this._reconnecting) {\n\t\t\t// connect() function is called while reconnect is in progress.\n\t\t\t// Terminate the auto reconnect process to use new connect options.\n\t\t\t\tthis._reconnectTimeout.cancel();\n\t\t\t\tthis._reconnectTimeout = null;\n\t\t\t\tthis._reconnecting = false;\n\t\t\t}\n\n\t\t\tthis.connectOptions = connectOptions;\n\t\t\tthis._reconnectInterval = 1;\n\t\t\tthis._reconnecting = false;\n\t\t\tif (connectOptions.uris) {\n\t\t\t\tthis.hostIndex = 0;\n\t\t\t\tthis._doConnect(connectOptions.uris[0]);\n\t\t\t} else {\n\t\t\t\tthis._doConnect(this.uri);\n\t\t\t}\n\n\t\t};\n\n\t\tClientImpl.prototype.subscribe = function (filter, subscribeOptions) {\n\t\t\tthis._trace(\"Client.subscribe\", filter, subscribeOptions);\n\n\t\t\tif (!this.connected)\n\t\t\t\tthrow new Error(format(ERROR.INVALID_STATE, [\"not connected\"]));\n\n var wireMessage = new WireMessage(MESSAGE_TYPE.SUBSCRIBE);\n wireMessage.topics = filter.constructor === Array ? filter : [filter];\n if (subscribeOptions.qos === undefined)\n subscribeOptions.qos = 0;\n wireMessage.requestedQos = [];\n for (var i = 0; i < wireMessage.topics.length; i++)\n wireMessage.requestedQos[i] = subscribeOptions.qos;\n\n\t\t\tif (subscribeOptions.onSuccess) {\n\t\t\t\twireMessage.onSuccess = function(grantedQos) {subscribeOptions.onSuccess({invocationContext:subscribeOptions.invocationContext,grantedQos:grantedQos});};\n\t\t\t}\n\n\t\t\tif (subscribeOptions.onFailure) {\n\t\t\t\twireMessage.onFailure = function(errorCode) {subscribeOptions.onFailure({invocationContext:subscribeOptions.invocationContext,errorCode:errorCode, errorMessage:format(errorCode)});};\n\t\t\t}\n\n\t\t\tif (subscribeOptions.timeout) {\n\t\t\t\twireMessage.timeOut = new Timeout(this, subscribeOptions.timeout, subscribeOptions.onFailure,\n\t\t\t\t\t[{invocationContext:subscribeOptions.invocationContext,\n\t\t\t\t\t\terrorCode:ERROR.SUBSCRIBE_TIMEOUT.code,\n\t\t\t\t\t\terrorMessage:format(ERROR.SUBSCRIBE_TIMEOUT)}]);\n\t\t\t}\n\n\t\t\t// All subscriptions return a SUBACK.\n\t\t\tthis._requires_ack(wireMessage);\n\t\t\tthis._schedule_message(wireMessage);\n\t\t};\n\n\t\t/** @ignore */\n\t\tClientImpl.prototype.unsubscribe = function(filter, unsubscribeOptions) {\n\t\t\tthis._trace(\"Client.unsubscribe\", filter, unsubscribeOptions);\n\n\t\t\tif (!this.connected)\n\t\t\t\tthrow new Error(format(ERROR.INVALID_STATE, [\"not connected\"]));\n\n var wireMessage = new WireMessage(MESSAGE_TYPE.UNSUBSCRIBE);\n wireMessage.topics = filter.constructor === Array ? filter : [filter];\n\n\t\t\tif (unsubscribeOptions.onSuccess) {\n\t\t\t\twireMessage.callback = function() {unsubscribeOptions.onSuccess({invocationContext:unsubscribeOptions.invocationContext});};\n\t\t\t}\n\t\t\tif (unsubscribeOptions.timeout) {\n\t\t\t\twireMessage.timeOut = new Timeout(this, unsubscribeOptions.timeout, unsubscribeOptions.onFailure,\n\t\t\t\t\t[{invocationContext:unsubscribeOptions.invocationContext,\n\t\t\t\t\t\terrorCode:ERROR.UNSUBSCRIBE_TIMEOUT.code,\n\t\t\t\t\t\terrorMessage:format(ERROR.UNSUBSCRIBE_TIMEOUT)}]);\n\t\t\t}\n\n\t\t\t// All unsubscribes return a SUBACK.\n\t\t\tthis._requires_ack(wireMessage);\n\t\t\tthis._schedule_message(wireMessage);\n\t\t};\n\n\t\tClientImpl.prototype.send = function (message) {\n\t\t\tthis._trace(\"Client.send\", message);\n\n\t\t\tvar wireMessage = new WireMessage(MESSAGE_TYPE.PUBLISH);\n\t\t\twireMessage.payloadMessage = message;\n\n\t\t\tif (this.connected) {\n\t\t\t// Mark qos 1 & 2 message as \"ACK required\"\n\t\t\t// For qos 0 message, invoke onMessageDelivered callback if there is one.\n\t\t\t// Then schedule the message.\n\t\t\t\tif (message.qos > 0) {\n\t\t\t\t\tthis._requires_ack(wireMessage);\n\t\t\t\t} else if (this.onMessageDelivered) {\n\t\t\t\t\tthis._notify_msg_sent[wireMessage] = this.onMessageDelivered(wireMessage.payloadMessage);\n\t\t\t\t}\n\t\t\t\tthis._schedule_message(wireMessage);\n\t\t\t} else {\n\t\t\t// Currently disconnected, will not schedule this message\n\t\t\t// Check if reconnecting is in progress and disconnected publish is enabled.\n\t\t\t\tif (this._reconnecting && this.disconnectedPublishing) {\n\t\t\t\t// Check the limit which include the \"required ACK\" messages\n\t\t\t\t\tvar messageCount = Object.keys(this._sentMessages).length + this._buffered_msg_queue.length;\n\t\t\t\t\tif (messageCount > this.disconnectedBufferSize) {\n\t\t\t\t\t\tthrow new Error(format(ERROR.BUFFER_FULL, [this.disconnectedBufferSize]));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (message.qos > 0) {\n\t\t\t\t\t\t// Mark this message as \"ACK required\"\n\t\t\t\t\t\t\tthis._requires_ack(wireMessage);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twireMessage.sequence = ++this._sequence;\n\t\t\t\t\t\t\t// Add messages in fifo order to array, by adding to start\n\t\t\t\t\t\t\tthis._buffered_msg_queue.unshift(wireMessage);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(format(ERROR.INVALID_STATE, [\"not connected\"]));\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tClientImpl.prototype.disconnect = function () {\n\t\t\tthis._trace(\"Client.disconnect\");\n\n\t\t\tif (this._reconnecting) {\n\t\t\t// disconnect() function is called while reconnect is in progress.\n\t\t\t// Terminate the auto reconnect process.\n\t\t\t\tthis._reconnectTimeout.cancel();\n\t\t\t\tthis._reconnectTimeout = null;\n\t\t\t\tthis._reconnecting = false;\n\t\t\t}\n\n\t\t\tif (!this.socket)\n\t\t\t\tthrow new Error(format(ERROR.INVALID_STATE, [\"not connecting or connected\"]));\n\n\t\t\tvar wireMessage = new WireMessage(MESSAGE_TYPE.DISCONNECT);\n\n\t\t\t// Run the disconnected call back as soon as the message has been sent,\n\t\t\t// in case of a failure later on in the disconnect processing.\n\t\t\t// as a consequence, the _disconected call back may be run several times.\n\t\t\tthis._notify_msg_sent[wireMessage] = scope(this._disconnected, this);\n\n\t\t\tthis._schedule_message(wireMessage);\n\t\t};\n\n\t\tClientImpl.prototype.getTraceLog = function () {\n\t\t\tif ( this._traceBuffer !== null ) {\n\t\t\t\tthis._trace(\"Client.getTraceLog\", new Date());\n\t\t\t\tthis._trace(\"Client.getTraceLog in flight messages\", this._sentMessages.length);\n\t\t\t\tfor (var key in this._sentMessages)\n\t\t\t\t\tthis._trace(\"_sentMessages \",key, this._sentMessages[key]);\n\t\t\t\tfor (var key in this._receivedMessages)\n\t\t\t\t\tthis._trace(\"_receivedMessages \",key, this._receivedMessages[key]);\n\n\t\t\t\treturn this._traceBuffer;\n\t\t\t}\n\t\t};\n\n\t\tClientImpl.prototype.startTrace = function () {\n\t\t\tif ( this._traceBuffer === null ) {\n\t\t\t\tthis._traceBuffer = [];\n\t\t\t}\n\t\t\tthis._trace(\"Client.startTrace\", new Date(), version);\n\t\t};\n\n\t\tClientImpl.prototype.stopTrace = function () {\n\t\t\tdelete this._traceBuffer;\n\t\t};\n\n\t\tClientImpl.prototype._doConnect = function (wsurl) {\n\t\t// When the socket is open, this client will send the CONNECT WireMessage using the saved parameters.\n\t\t\tif (this.connectOptions.useSSL) {\n\t\t\t\tvar uriParts = wsurl.split(\":\");\n\t\t\t\turiParts[0] = \"wss\";\n\t\t\t\twsurl = uriParts.join(\":\");\n\t\t\t}\n\t\t\tthis._wsuri = wsurl;\n\t\t\tthis.connected = false;\n\n\n\n\t\t\tif (this.connectOptions.mqttVersion < 4) {\n\t\t\t\tthis.socket = new WebSocket(wsurl, [\"mqttv3.1\"]);\n\t\t\t} else {\n\t\t\t\tthis.socket = new WebSocket(wsurl, [\"mqtt\"]);\n\t\t\t}\n\t\t\tthis.socket.binaryType = \"arraybuffer\";\n\t\t\tthis.socket.onopen = scope(this._on_socket_open, this);\n\t\t\tthis.socket.onmessage = scope(this._on_socket_message, this);\n\t\t\tthis.socket.onerror = scope(this._on_socket_error, this);\n\t\t\tthis.socket.onclose = scope(this._on_socket_close, this);\n\n\t\t\tthis.sendPinger = new Pinger(this, this.connectOptions.keepAliveInterval);\n\t\t\tthis.receivePinger = new Pinger(this, this.connectOptions.keepAliveInterval);\n\t\t\tif (this._connectTimeout) {\n\t\t\t\tthis._connectTimeout.cancel();\n\t\t\t\tthis._connectTimeout = null;\n\t\t\t}\n\t\t\tthis._connectTimeout = new Timeout(this, this.connectOptions.timeout, this._disconnected, [ERROR.CONNECT_TIMEOUT.code, format(ERROR.CONNECT_TIMEOUT)]);\n\t\t};\n\n\n\t\t// Schedule a new message to be sent over the WebSockets\n\t\t// connection. CONNECT messages cause WebSocket connection\n\t\t// to be started. All other messages are queued internally\n\t\t// until this has happened. When WS connection starts, process\n\t\t// all outstanding messages.\n\t\tClientImpl.prototype._schedule_message = function (message) {\n\t\t\t// Add messages in fifo order to array, by adding to start\n\t\t\tthis._msg_queue.unshift(message);\n\t\t\t// Process outstanding messages in the queue if we have an open socket, and have received CONNACK.\n\t\t\tif (this.connected) {\n\t\t\t\tthis._process_queue();\n\t\t\t}\n\t\t};\n\n\t\tClientImpl.prototype.store = function(prefix, wireMessage) {\n\t\t\tvar storedMessage = {type:wireMessage.type, messageIdentifier:wireMessage.messageIdentifier, version:1};\n\n\t\t\tswitch(wireMessage.type) {\n\t\t\tcase MESSAGE_TYPE.PUBLISH:\n\t\t\t\tif(wireMessage.pubRecReceived)\n\t\t\t\t\tstoredMessage.pubRecReceived = true;\n\n\t\t\t\t// Convert the payload to a hex string.\n\t\t\t\tstoredMessage.payloadMessage = {};\n\t\t\t\tvar hex = \"\";\n\t\t\t\tvar messageBytes = wireMessage.payloadMessage.payloadBytes;\n\t\t\t\tfor (var i=0; i= 2) {\n\t\t\t\t\tvar x = parseInt(hex.substring(0, 2), 16);\n\t\t\t\t\thex = hex.substring(2, hex.length);\n\t\t\t\t\tbyteStream[i++] = x;\n\t\t\t\t}\n\t\t\t\tvar payloadMessage = new Message(byteStream);\n\n\t\t\t\tpayloadMessage.qos = storedMessage.payloadMessage.qos;\n\t\t\t\tpayloadMessage.destinationName = storedMessage.payloadMessage.destinationName;\n\t\t\t\tif (storedMessage.payloadMessage.duplicate)\n\t\t\t\t\tpayloadMessage.duplicate = true;\n\t\t\t\tif (storedMessage.payloadMessage.retained)\n\t\t\t\t\tpayloadMessage.retained = true;\n\t\t\t\twireMessage.payloadMessage = payloadMessage;\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow Error(format(ERROR.INVALID_STORED_DATA, [key, value]));\n\t\t\t}\n\n\t\t\tif (key.indexOf(\"Sent:\"+this._localKey) === 0) {\n\t\t\t\twireMessage.payloadMessage.duplicate = true;\n\t\t\t\tthis._sentMessages[wireMessage.messageIdentifier] = wireMessage;\n\t\t\t} else if (key.indexOf(\"Received:\"+this._localKey) === 0) {\n\t\t\t\tthis._receivedMessages[wireMessage.messageIdentifier] = wireMessage;\n\t\t\t}\n\t\t};\n\n\t\tClientImpl.prototype._process_queue = function () {\n\t\t\tvar message = null;\n\n\t\t\t// Send all queued messages down socket connection\n\t\t\twhile ((message = this._msg_queue.pop())) {\n\t\t\t\tthis._socket_send(message);\n\t\t\t\t// Notify listeners that message was successfully sent\n\t\t\t\tif (this._notify_msg_sent[message]) {\n\t\t\t\t\tthis._notify_msg_sent[message]();\n\t\t\t\t\tdelete this._notify_msg_sent[message];\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t * Expect an ACK response for this message. Add message to the set of in progress\n\t * messages and set an unused identifier in this message.\n\t * @ignore\n\t */\n\t\tClientImpl.prototype._requires_ack = function (wireMessage) {\n\t\t\tvar messageCount = Object.keys(this._sentMessages).length;\n\t\t\tif (messageCount > this.maxMessageIdentifier)\n\t\t\t\tthrow Error (\"Too many messages:\"+messageCount);\n\n\t\t\twhile(this._sentMessages[this._message_identifier] !== undefined) {\n\t\t\t\tthis._message_identifier++;\n\t\t\t}\n\t\t\twireMessage.messageIdentifier = this._message_identifier;\n\t\t\tthis._sentMessages[wireMessage.messageIdentifier] = wireMessage;\n\t\t\tif (wireMessage.type === MESSAGE_TYPE.PUBLISH) {\n\t\t\t\tthis.store(\"Sent:\", wireMessage);\n\t\t\t}\n\t\t\tif (this._message_identifier === this.maxMessageIdentifier) {\n\t\t\t\tthis._message_identifier = 1;\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t * Called when the underlying websocket has been opened.\n\t * @ignore\n\t */\n\t\tClientImpl.prototype._on_socket_open = function () {\n\t\t// Create the CONNECT message object.\n\t\t\tvar wireMessage = new WireMessage(MESSAGE_TYPE.CONNECT, this.connectOptions);\n\t\t\twireMessage.clientId = this.clientId;\n\t\t\tthis._socket_send(wireMessage);\n\t\t};\n\n\t\t/**\n\t * Called when the underlying websocket has received a complete packet.\n\t * @ignore\n\t */\n\t\tClientImpl.prototype._on_socket_message = function (event) {\n\t\t\tthis._trace(\"Client._on_socket_message\", event.data);\n\t\t\tvar messages = this._deframeMessages(event.data);\n\t\t\tfor (var i = 0; i < messages.length; i+=1) {\n\t\t\t\tthis._handleMessage(messages[i]);\n\t\t\t}\n\t\t};\n\n\t\tClientImpl.prototype._deframeMessages = function(data) {\n\t\t\tvar byteArray = new Uint8Array(data);\n\t\t\tvar messages = [];\n\t\t\tif (this.receiveBuffer) {\n\t\t\t\tvar newData = new Uint8Array(this.receiveBuffer.length+byteArray.length);\n\t\t\t\tnewData.set(this.receiveBuffer);\n\t\t\t\tnewData.set(byteArray,this.receiveBuffer.length);\n\t\t\t\tbyteArray = newData;\n\t\t\t\tdelete this.receiveBuffer;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tvar offset = 0;\n\t\t\t\twhile(offset < byteArray.length) {\n\t\t\t\t\tvar result = decodeMessage(byteArray,offset);\n\t\t\t\t\tvar wireMessage = result[0];\n\t\t\t\t\toffset = result[1];\n\t\t\t\t\tif (wireMessage !== null) {\n\t\t\t\t\t\tmessages.push(wireMessage);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (offset < byteArray.length) {\n\t\t\t\t\tthis.receiveBuffer = byteArray.subarray(offset);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tvar errorStack = ((error.hasOwnProperty(\"stack\") == \"undefined\") ? error.stack.toString() : \"No Error Stack Available\");\n\t\t\t\tthis._disconnected(ERROR.INTERNAL_ERROR.code , format(ERROR.INTERNAL_ERROR, [error.message,errorStack]));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn messages;\n\t\t};\n\n\t\tClientImpl.prototype._handleMessage = function(wireMessage) {\n\n\t\t\tthis._trace(\"Client._handleMessage\", wireMessage);\n\n\t\t\ttry {\n\t\t\t\tswitch(wireMessage.type) {\n\t\t\t\tcase MESSAGE_TYPE.CONNACK:\n\t\t\t\t\tthis._connectTimeout.cancel();\n\t\t\t\t\tif (this._reconnectTimeout)\n\t\t\t\t\t\tthis._reconnectTimeout.cancel();\n\n\t\t\t\t\t// If we have started using clean session then clear up the local state.\n\t\t\t\t\tif (this.connectOptions.cleanSession) {\n\t\t\t\t\t\tfor (var key in this._sentMessages) {\n\t\t\t\t\t\t\tvar sentMessage = this._sentMessages[key];\n\t\t\t\t\t\t\tlocalStorage.removeItem(\"Sent:\"+this._localKey+sentMessage.messageIdentifier);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._sentMessages = {};\n\n\t\t\t\t\t\tfor (var key in this._receivedMessages) {\n\t\t\t\t\t\t\tvar receivedMessage = this._receivedMessages[key];\n\t\t\t\t\t\t\tlocalStorage.removeItem(\"Received:\"+this._localKey+receivedMessage.messageIdentifier);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._receivedMessages = {};\n\t\t\t\t\t}\n\t\t\t\t\t// Client connected and ready for business.\n\t\t\t\t\tif (wireMessage.returnCode === 0) {\n\n\t\t\t\t\t\tthis.connected = true;\n\t\t\t\t\t\t// Jump to the end of the list of uris and stop looking for a good host.\n\n\t\t\t\t\t\tif (this.connectOptions.uris)\n\t\t\t\t\t\t\tthis.hostIndex = this.connectOptions.uris.length;\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._disconnected(ERROR.CONNACK_RETURNCODE.code , format(ERROR.CONNACK_RETURNCODE, [wireMessage.returnCode, CONNACK_RC[wireMessage.returnCode]]));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Resend messages.\n\t\t\t\t\tvar sequencedMessages = [];\n\t\t\t\t\tfor (var msgId in this._sentMessages) {\n\t\t\t\t\t\tif (this._sentMessages.hasOwnProperty(msgId))\n\t\t\t\t\t\t\tsequencedMessages.push(this._sentMessages[msgId]);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Also schedule qos 0 buffered messages if any\n\t\t\t\t\tif (this._buffered_msg_queue.length > 0) {\n\t\t\t\t\t\tvar msg = null;\n\t\t\t\t\t\twhile ((msg = this._buffered_msg_queue.pop())) {\n\t\t\t\t\t\t\tsequencedMessages.push(msg);\n\t\t\t\t\t\t\tif (this.onMessageDelivered)\n\t\t\t\t\t\t\t\tthis._notify_msg_sent[msg] = this.onMessageDelivered(msg.payloadMessage);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Sort sentMessages into the original sent order.\n\t\t\t\t\tvar sequencedMessages = sequencedMessages.sort(function(a,b) {return a.sequence - b.sequence;} );\n\t\t\t\t\tfor (var i=0, len=sequencedMessages.length; i\n\t * Most applications will create just one Client object and then call its connect() method,\n\t * however applications can create more than one Client object if they wish.\n\t * In this case the combination of host, port and clientId attributes must be different for each Client object.\n\t *

\n\t * The send, subscribe and unsubscribe methods are implemented as asynchronous JavaScript methods\n\t * (even though the underlying protocol exchange might be synchronous in nature).\n\t * This means they signal their completion by calling back to the application,\n\t * via Success or Failure callback functions provided by the application on the method in question.\n\t * Such callbacks are called at most once per method invocation and do not persist beyond the lifetime\n\t * of the script that made the invocation.\n\t *

\n\t * In contrast there are some callback functions, most notably onMessageArrived,\n\t * that are defined on the {@link Paho.Client} object.\n\t * These may get called multiple times, and aren't directly related to specific method invocations made by the client.\n\t *\n\t * @name Paho.Client\n\t *\n\t * @constructor\n\t *\n\t * @param {string} host - the address of the messaging server, as a fully qualified WebSocket URI, as a DNS name or dotted decimal IP address.\n\t * @param {number} port - the port number to connect to - only required if host is not a URI\n\t * @param {string} path - the path on the host to connect to - only used if host is not a URI. Default: '/mqtt'.\n\t * @param {string} clientId - the Messaging client identifier, between 1 and 23 characters in length.\n\t *\n\t * @property {string} host - read only the server's DNS hostname or dotted decimal IP address.\n\t * @property {number} port - read only the server's port.\n\t * @property {string} path - read only the server's path.\n\t * @property {string} clientId - read only used when connecting to the server.\n\t * @property {function} onConnectionLost - called when a connection has been lost.\n\t * after a connect() method has succeeded.\n\t * Establish the call back used when a connection has been lost. The connection may be\n\t * lost because the client initiates a disconnect or because the server or network\n\t * cause the client to be disconnected. The disconnect call back may be called without\n\t * the connectionComplete call back being invoked if, for example the client fails to\n\t * connect.\n\t * A single response object parameter is passed to the onConnectionLost callback containing the following fields:\n\t *

    \n\t *
  1. errorCode\n\t *
  2. errorMessage\n\t *
\n\t * @property {function} onMessageDelivered - called when a message has been delivered.\n\t * All processing that this Client will ever do has been completed. So, for example,\n\t * in the case of a Qos=2 message sent by this client, the PubComp flow has been received from the server\n\t * and the message has been removed from persistent storage before this callback is invoked.\n\t * Parameters passed to the onMessageDelivered callback are:\n\t *
    \n\t *
  1. {@link Paho.Message} that was delivered.\n\t *
\n\t * @property {function} onMessageArrived - called when a message has arrived in this Paho.client.\n\t * Parameters passed to the onMessageArrived callback are:\n\t *
    \n\t *
  1. {@link Paho.Message} that has arrived.\n\t *
\n\t * @property {function} onConnected - called when a connection is successfully made to the server.\n\t * after a connect() method.\n\t * Parameters passed to the onConnected callback are:\n\t *
    \n\t *
  1. reconnect (boolean) - If true, the connection was the result of a reconnect.
  2. \n\t *
  3. URI (string) - The URI used to connect to the server.
  4. \n\t *
\n\t * @property {boolean} disconnectedPublishing - if set, will enable disconnected publishing in\n\t * in the event that the connection to the server is lost.\n\t * @property {number} disconnectedBufferSize - Used to set the maximum number of messages that the disconnected\n\t * buffer will hold before rejecting new messages. Default size: 5000 messages\n\t * @property {function} trace - called whenever trace is called. TODO\n\t */\n\t\tvar Client = function (host, port, path, clientId) {\n\n\t\t\tvar uri;\n\n\t\t\tif (typeof host !== \"string\")\n\t\t\t\tthrow new Error(format(ERROR.INVALID_TYPE, [typeof host, \"host\"]));\n\n\t\t\tif (arguments.length == 2) {\n\t\t\t// host: must be full ws:// uri\n\t\t\t// port: clientId\n\t\t\t\tclientId = port;\n\t\t\t\turi = host;\n\t\t\t\tvar match = uri.match(/^(wss?):\\/\\/((\\[(.+)\\])|([^\\/]+?))(:(\\d+))?(\\/.*)$/);\n\t\t\t\tif (match) {\n\t\t\t\t\thost = match[4]||match[2];\n\t\t\t\t\tport = parseInt(match[7]);\n\t\t\t\t\tpath = match[8];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(format(ERROR.INVALID_ARGUMENT,[host,\"host\"]));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (arguments.length == 3) {\n\t\t\t\t\tclientId = path;\n\t\t\t\t\tpath = \"/mqtt\";\n\t\t\t\t}\n\t\t\t\tif (typeof port !== \"number\" || port < 0)\n\t\t\t\t\tthrow new Error(format(ERROR.INVALID_TYPE, [typeof port, \"port\"]));\n\t\t\t\tif (typeof path !== \"string\")\n\t\t\t\t\tthrow new Error(format(ERROR.INVALID_TYPE, [typeof path, \"path\"]));\n\n\t\t\t\tvar ipv6AddSBracket = (host.indexOf(\":\") !== -1 && host.slice(0,1) !== \"[\" && host.slice(-1) !== \"]\");\n\t\t\t\turi = \"ws://\"+(ipv6AddSBracket?\"[\"+host+\"]\":host)+\":\"+port+path;\n\t\t\t}\n\n\t\t\tvar clientIdLength = 0;\n\t\t\tfor (var i = 0; i 65535)\n\t\t\t\tthrow new Error(format(ERROR.INVALID_ARGUMENT, [clientId, \"clientId\"]));\n\n\t\t\tvar client = new ClientImpl(uri, host, port, path, clientId);\n\n\t\t\t//Public Properties\n\t\t\tObject.defineProperties(this,{\n\t\t\t\t\"host\":{\n\t\t\t\t\tget: function() { return host; },\n\t\t\t\t\tset: function() { throw new Error(format(ERROR.UNSUPPORTED_OPERATION)); }\n\t\t\t\t},\n\t\t\t\t\"port\":{\n\t\t\t\t\tget: function() { return port; },\n\t\t\t\t\tset: function() { throw new Error(format(ERROR.UNSUPPORTED_OPERATION)); }\n\t\t\t\t},\n\t\t\t\t\"path\":{\n\t\t\t\t\tget: function() { return path; },\n\t\t\t\t\tset: function() { throw new Error(format(ERROR.UNSUPPORTED_OPERATION)); }\n\t\t\t\t},\n\t\t\t\t\"uri\":{\n\t\t\t\t\tget: function() { return uri; },\n\t\t\t\t\tset: function() { throw new Error(format(ERROR.UNSUPPORTED_OPERATION)); }\n\t\t\t\t},\n\t\t\t\t\"clientId\":{\n\t\t\t\t\tget: function() { return client.clientId; },\n\t\t\t\t\tset: function() { throw new Error(format(ERROR.UNSUPPORTED_OPERATION)); }\n\t\t\t\t},\n\t\t\t\t\"onConnected\":{\n\t\t\t\t\tget: function() { return client.onConnected; },\n\t\t\t\t\tset: function(newOnConnected) {\n\t\t\t\t\t\tif (typeof newOnConnected === \"function\")\n\t\t\t\t\t\t\tclient.onConnected = newOnConnected;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthrow new Error(format(ERROR.INVALID_TYPE, [typeof newOnConnected, \"onConnected\"]));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"disconnectedPublishing\":{\n\t\t\t\t\tget: function() { return client.disconnectedPublishing; },\n\t\t\t\t\tset: function(newDisconnectedPublishing) {\n\t\t\t\t\t\tclient.disconnectedPublishing = newDisconnectedPublishing;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"disconnectedBufferSize\":{\n\t\t\t\t\tget: function() { return client.disconnectedBufferSize; },\n\t\t\t\t\tset: function(newDisconnectedBufferSize) {\n\t\t\t\t\t\tclient.disconnectedBufferSize = newDisconnectedBufferSize;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"onConnectionLost\":{\n\t\t\t\t\tget: function() { return client.onConnectionLost; },\n\t\t\t\t\tset: function(newOnConnectionLost) {\n\t\t\t\t\t\tif (typeof newOnConnectionLost === \"function\")\n\t\t\t\t\t\t\tclient.onConnectionLost = newOnConnectionLost;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthrow new Error(format(ERROR.INVALID_TYPE, [typeof newOnConnectionLost, \"onConnectionLost\"]));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"onMessageDelivered\":{\n\t\t\t\t\tget: function() { return client.onMessageDelivered; },\n\t\t\t\t\tset: function(newOnMessageDelivered) {\n\t\t\t\t\t\tif (typeof newOnMessageDelivered === \"function\")\n\t\t\t\t\t\t\tclient.onMessageDelivered = newOnMessageDelivered;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthrow new Error(format(ERROR.INVALID_TYPE, [typeof newOnMessageDelivered, \"onMessageDelivered\"]));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"onMessageArrived\":{\n\t\t\t\t\tget: function() { return client.onMessageArrived; },\n\t\t\t\t\tset: function(newOnMessageArrived) {\n\t\t\t\t\t\tif (typeof newOnMessageArrived === \"function\")\n\t\t\t\t\t\t\tclient.onMessageArrived = newOnMessageArrived;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthrow new Error(format(ERROR.INVALID_TYPE, [typeof newOnMessageArrived, \"onMessageArrived\"]));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"trace\":{\n\t\t\t\t\tget: function() { return client.traceFunction; },\n\t\t\t\t\tset: function(trace) {\n\t\t\t\t\t\tif(typeof trace === \"function\"){\n\t\t\t\t\t\t\tclient.traceFunction = trace;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tthrow new Error(format(ERROR.INVALID_TYPE, [typeof trace, \"onTrace\"]));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t});\n\n\t\t\t/**\n\t\t * Connect this Messaging client to its server.\n\t\t *\n\t\t * @name Paho.Client#connect\n\t\t * @function\n\t\t * @param {object} connectOptions - Attributes used with the connection.\n\t\t * @param {number} connectOptions.timeout - If the connect has not succeeded within this\n\t\t * number of seconds, it is deemed to have failed.\n\t\t * The default is 30 seconds.\n\t\t * @param {string} connectOptions.userName - Authentication username for this connection.\n\t\t * @param {string} connectOptions.password - Authentication password for this connection.\n\t\t * @param {Paho.Message} connectOptions.willMessage - sent by the server when the client\n\t\t * disconnects abnormally.\n\t\t * @param {number} connectOptions.keepAliveInterval - the server disconnects this client if\n\t\t * there is no activity for this number of seconds.\n\t\t * The default value of 60 seconds is assumed if not set.\n\t\t * @param {boolean} connectOptions.cleanSession - if true(default) the client and server\n\t\t * persistent state is deleted on successful connect.\n\t\t * @param {boolean} connectOptions.useSSL - if present and true, use an SSL Websocket connection.\n\t\t * @param {object} connectOptions.invocationContext - passed to the onSuccess callback or onFailure callback.\n\t\t * @param {function} connectOptions.onSuccess - called when the connect acknowledgement\n\t\t * has been received from the server.\n\t\t * A single response object parameter is passed to the onSuccess callback containing the following fields:\n\t\t *
    \n\t\t *
  1. invocationContext as passed in to the onSuccess method in the connectOptions.\n\t\t *
\n\t * @param {function} connectOptions.onFailure - called when the connect request has failed or timed out.\n\t\t * A single response object parameter is passed to the onFailure callback containing the following fields:\n\t\t *
    \n\t\t *
  1. invocationContext as passed in to the onFailure method in the connectOptions.\n\t\t *
  2. errorCode a number indicating the nature of the error.\n\t\t *
  3. errorMessage text describing the error.\n\t\t *
\n\t * @param {array} connectOptions.hosts - If present this contains either a set of hostnames or fully qualified\n\t\t * WebSocket URIs (ws://iot.eclipse.org:80/ws), that are tried in order in place\n\t\t * of the host and port paramater on the construtor. The hosts are tried one at at time in order until\n\t\t * one of then succeeds.\n\t * @param {array} connectOptions.ports - If present the set of ports matching the hosts. If hosts contains URIs, this property\n\t\t * is not used.\n\t * @param {boolean} connectOptions.reconnect - Sets whether the client will automatically attempt to reconnect\n\t * to the server if the connection is lost.\n\t *
    \n\t *
  • If set to false, the client will not attempt to automatically reconnect to the server in the event that the\n\t * connection is lost.
  • \n\t *
  • If set to true, in the event that the connection is lost, the client will attempt to reconnect to the server.\n\t * It will initially wait 1 second before it attempts to reconnect, for every failed reconnect attempt, the delay\n\t * will double until it is at 2 minutes at which point the delay will stay at 2 minutes.
  • \n\t *
\n\t * @param {number} connectOptions.mqttVersion - The version of MQTT to use to connect to the MQTT Broker.\n\t *
    \n\t *
  • 3 - MQTT V3.1
  • \n\t *
  • 4 - MQTT V3.1.1
  • \n\t *
\n\t * @param {boolean} connectOptions.mqttVersionExplicit - If set to true, will force the connection to use the\n\t * selected MQTT Version or will fail to connect.\n\t * @param {array} connectOptions.uris - If present, should contain a list of fully qualified WebSocket uris\n\t * (e.g. ws://iot.eclipse.org:80/ws), that are tried in order in place of the host and port parameter of the construtor.\n\t * The uris are tried one at a time in order until one of them succeeds. Do not use this in conjunction with hosts as\n\t * the hosts array will be converted to uris and will overwrite this property.\n\t\t * @throws {InvalidState} If the client is not in disconnected state. The client must have received connectionLost\n\t\t * or disconnected before calling connect for a second or subsequent time.\n\t\t */\n\t\t\tthis.connect = function (connectOptions) {\n\t\t\t\tconnectOptions = connectOptions || {} ;\n\t\t\t\tvalidate(connectOptions, {timeout:\"number\",\n\t\t\t\t\tuserName:\"string\",\n\t\t\t\t\tpassword:\"string\",\n\t\t\t\t\twillMessage:\"object\",\n\t\t\t\t\tkeepAliveInterval:\"number\",\n\t\t\t\t\tcleanSession:\"boolean\",\n\t\t\t\t\tuseSSL:\"boolean\",\n\t\t\t\t\tinvocationContext:\"object\",\n\t\t\t\t\tonSuccess:\"function\",\n\t\t\t\t\tonFailure:\"function\",\n\t\t\t\t\thosts:\"object\",\n\t\t\t\t\tports:\"object\",\n\t\t\t\t\treconnect:\"boolean\",\n\t\t\t\t\tmqttVersion:\"number\",\n\t\t\t\t\tmqttVersionExplicit:\"boolean\",\n\t\t\t\t\turis: \"object\"});\n\n\t\t\t\t// If no keep alive interval is set, assume 60 seconds.\n\t\t\t\tif (connectOptions.keepAliveInterval === undefined)\n\t\t\t\t\tconnectOptions.keepAliveInterval = 60;\n\n\t\t\t\tif (connectOptions.mqttVersion > 4 || connectOptions.mqttVersion < 3) {\n\t\t\t\t\tthrow new Error(format(ERROR.INVALID_ARGUMENT, [connectOptions.mqttVersion, \"connectOptions.mqttVersion\"]));\n\t\t\t\t}\n\n\t\t\t\tif (connectOptions.mqttVersion === undefined) {\n\t\t\t\t\tconnectOptions.mqttVersionExplicit = false;\n\t\t\t\t\tconnectOptions.mqttVersion = 4;\n\t\t\t\t} else {\n\t\t\t\t\tconnectOptions.mqttVersionExplicit = true;\n\t\t\t\t}\n\n\t\t\t\t//Check that if password is set, so is username\n\t\t\t\tif (connectOptions.password !== undefined && connectOptions.userName === undefined)\n\t\t\t\t\tthrow new Error(format(ERROR.INVALID_ARGUMENT, [connectOptions.password, \"connectOptions.password\"]));\n\n\t\t\t\tif (connectOptions.willMessage) {\n\t\t\t\t\tif (!(connectOptions.willMessage instanceof Message))\n\t\t\t\t\t\tthrow new Error(format(ERROR.INVALID_TYPE, [connectOptions.willMessage, \"connectOptions.willMessage\"]));\n\t\t\t\t\t// The will message must have a payload that can be represented as a string.\n\t\t\t\t\t// Cause the willMessage to throw an exception if this is not the case.\n\t\t\t\t\tconnectOptions.willMessage.stringPayload = null;\n\n\t\t\t\t\tif (typeof connectOptions.willMessage.destinationName === \"undefined\")\n\t\t\t\t\t\tthrow new Error(format(ERROR.INVALID_TYPE, [typeof connectOptions.willMessage.destinationName, \"connectOptions.willMessage.destinationName\"]));\n\t\t\t\t}\n\t\t\t\tif (typeof connectOptions.cleanSession === \"undefined\")\n\t\t\t\t\tconnectOptions.cleanSession = true;\n\t\t\t\tif (connectOptions.hosts) {\n\n\t\t\t\t\tif (!(connectOptions.hosts instanceof Array) )\n\t\t\t\t\t\tthrow new Error(format(ERROR.INVALID_ARGUMENT, [connectOptions.hosts, \"connectOptions.hosts\"]));\n\t\t\t\t\tif (connectOptions.hosts.length <1 )\n\t\t\t\t\t\tthrow new Error(format(ERROR.INVALID_ARGUMENT, [connectOptions.hosts, \"connectOptions.hosts\"]));\n\n\t\t\t\t\tvar usingURIs = false;\n\t\t\t\t\tfor (var i = 0; i\n\t\t * @param {object} subscribeOptions - used to control the subscription\n\t\t *\n\t\t * @param {number} subscribeOptions.qos - the maximum qos of any publications sent\n\t\t * as a result of making this subscription.\n\t\t * @param {object} subscribeOptions.invocationContext - passed to the onSuccess callback\n\t\t * or onFailure callback.\n\t\t * @param {function} subscribeOptions.onSuccess - called when the subscribe acknowledgement\n\t\t * has been received from the server.\n\t\t * A single response object parameter is passed to the onSuccess callback containing the following fields:\n\t\t *
    \n\t\t *
  1. invocationContext if set in the subscribeOptions.\n\t\t *
\n\t\t * @param {function} subscribeOptions.onFailure - called when the subscribe request has failed or timed out.\n\t\t * A single response object parameter is passed to the onFailure callback containing the following fields:\n\t\t *
    \n\t\t *
  1. invocationContext - if set in the subscribeOptions.\n\t\t *
  2. errorCode - a number indicating the nature of the error.\n\t\t *
  3. errorMessage - text describing the error.\n\t\t *
\n\t\t * @param {number} subscribeOptions.timeout - which, if present, determines the number of\n\t\t * seconds after which the onFailure calback is called.\n\t\t * The presence of a timeout does not prevent the onSuccess\n\t\t * callback from being called when the subscribe completes.\n\t\t * @throws {InvalidState} if the client is not in connected state.\n\t\t */\n\t\t\tthis.subscribe = function (filter, subscribeOptions) {\n\t\t\t\tif (typeof filter !== \"string\" && filter.constructor !== Array)\n\t\t\t\t\tthrow new Error(\"Invalid argument:\"+filter);\n\t\t\t\tsubscribeOptions = subscribeOptions || {} ;\n\t\t\t\tvalidate(subscribeOptions, {qos:\"number\",\n\t\t\t\t\tinvocationContext:\"object\",\n\t\t\t\t\tonSuccess:\"function\",\n\t\t\t\t\tonFailure:\"function\",\n\t\t\t\t\ttimeout:\"number\"\n\t\t\t\t});\n\t\t\t\tif (subscribeOptions.timeout && !subscribeOptions.onFailure)\n\t\t\t\t\tthrow new Error(\"subscribeOptions.timeout specified with no onFailure callback.\");\n\t\t\t\tif (typeof subscribeOptions.qos !== \"undefined\" && !(subscribeOptions.qos === 0 || subscribeOptions.qos === 1 || subscribeOptions.qos === 2 ))\n\t\t\t\t\tthrow new Error(format(ERROR.INVALID_ARGUMENT, [subscribeOptions.qos, \"subscribeOptions.qos\"]));\n\t\t\t\tclient.subscribe(filter, subscribeOptions);\n\t\t\t};\n\n\t\t/**\n\t\t * Unsubscribe for messages, stop receiving messages sent to destinations described by the filter.\n\t\t *\n\t\t * @name Paho.Client#unsubscribe\n\t\t * @function\n\t\t * @param {string} filter - describing the destinations to receive messages from.\n\t\t * @param {object} unsubscribeOptions - used to control the subscription\n\t\t * @param {object} unsubscribeOptions.invocationContext - passed to the onSuccess callback\n\t\t\t\t\t\t\t\t\t\t\t or onFailure callback.\n\t\t * @param {function} unsubscribeOptions.onSuccess - called when the unsubscribe acknowledgement has been received from the server.\n\t\t * A single response object parameter is passed to the\n\t\t * onSuccess callback containing the following fields:\n\t\t *
    \n\t\t *
  1. invocationContext - if set in the unsubscribeOptions.\n\t\t *
\n\t\t * @param {function} unsubscribeOptions.onFailure called when the unsubscribe request has failed or timed out.\n\t\t * A single response object parameter is passed to the onFailure callback containing the following fields:\n\t\t *
    \n\t\t *
  1. invocationContext - if set in the unsubscribeOptions.\n\t\t *
  2. errorCode - a number indicating the nature of the error.\n\t\t *
  3. errorMessage - text describing the error.\n\t\t *
\n\t\t * @param {number} unsubscribeOptions.timeout - which, if present, determines the number of seconds\n\t\t * after which the onFailure callback is called. The presence of\n\t\t * a timeout does not prevent the onSuccess callback from being\n\t\t * called when the unsubscribe completes\n\t\t * @throws {InvalidState} if the client is not in connected state.\n\t\t */\n\t\t\tthis.unsubscribe = function (filter, unsubscribeOptions) {\n\t\t\t\tif (typeof filter !== \"string\" && filter.constructor !== Array)\n\t\t\t\t\tthrow new Error(\"Invalid argument:\"+filter);\n\t\t\t\tunsubscribeOptions = unsubscribeOptions || {} ;\n\t\t\t\tvalidate(unsubscribeOptions, {invocationContext:\"object\",\n\t\t\t\t\tonSuccess:\"function\",\n\t\t\t\t\tonFailure:\"function\",\n\t\t\t\t\ttimeout:\"number\"\n\t\t\t\t});\n\t\t\t\tif (unsubscribeOptions.timeout && !unsubscribeOptions.onFailure)\n\t\t\t\t\tthrow new Error(\"unsubscribeOptions.timeout specified with no onFailure callback.\");\n\t\t\t\tclient.unsubscribe(filter, unsubscribeOptions);\n\t\t\t};\n\n\t\t\t/**\n\t\t * Send a message to the consumers of the destination in the Message.\n\t\t *\n\t\t * @name Paho.Client#send\n\t\t * @function\n\t\t * @param {string|Paho.Message} topic - mandatory The name of the destination to which the message is to be sent.\n\t\t * \t\t\t\t\t - If it is the only parameter, used as Paho.Message object.\n\t\t * @param {String|ArrayBuffer} payload - The message data to be sent.\n\t\t * @param {number} qos The Quality of Service used to deliver the message.\n\t\t * \t\t
\n\t\t * \t\t\t
0 Best effort (default).\n\t\t * \t\t\t
1 At least once.\n\t\t * \t\t\t
2 Exactly once.\n\t\t * \t\t
\n\t\t * @param {Boolean} retained If true, the message is to be retained by the server and delivered\n\t\t * to both current and future subscriptions.\n\t\t * If false the server only delivers the message to current subscribers, this is the default for new Messages.\n\t\t * A received message has the retained boolean set to true if the message was published\n\t\t * with the retained boolean set to true\n\t\t * and the subscrption was made after the message has been published.\n\t\t * @throws {InvalidState} if the client is not connected.\n\t\t */\n\t\t\tthis.send = function (topic,payload,qos,retained) {\n\t\t\t\tvar message ;\n\n\t\t\t\tif(arguments.length === 0){\n\t\t\t\t\tthrow new Error(\"Invalid argument.\"+\"length\");\n\n\t\t\t\t}else if(arguments.length == 1) {\n\n\t\t\t\t\tif (!(topic instanceof Message) && (typeof topic !== \"string\"))\n\t\t\t\t\t\tthrow new Error(\"Invalid argument:\"+ typeof topic);\n\n\t\t\t\t\tmessage = topic;\n\t\t\t\t\tif (typeof message.destinationName === \"undefined\")\n\t\t\t\t\t\tthrow new Error(format(ERROR.INVALID_ARGUMENT,[message.destinationName,\"Message.destinationName\"]));\n\t\t\t\t\tclient.send(message);\n\n\t\t\t\t}else {\n\t\t\t\t//parameter checking in Message object\n\t\t\t\t\tmessage = new Message(payload);\n\t\t\t\t\tmessage.destinationName = topic;\n\t\t\t\t\tif(arguments.length >= 3)\n\t\t\t\t\t\tmessage.qos = qos;\n\t\t\t\t\tif(arguments.length >= 4)\n\t\t\t\t\t\tmessage.retained = retained;\n\t\t\t\t\tclient.send(message);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t * Publish a message to the consumers of the destination in the Message.\n\t\t * Synonym for Paho.Mqtt.Client#send\n\t\t *\n\t\t * @name Paho.Client#publish\n\t\t * @function\n\t\t * @param {string|Paho.Message} topic - mandatory The name of the topic to which the message is to be published.\n\t\t * \t\t\t\t\t - If it is the only parameter, used as Paho.Message object.\n\t\t * @param {String|ArrayBuffer} payload - The message data to be published.\n\t\t * @param {number} qos The Quality of Service used to deliver the message.\n\t\t * \t\t
\n\t\t * \t\t\t
0 Best effort (default).\n\t\t * \t\t\t
1 At least once.\n\t\t * \t\t\t
2 Exactly once.\n\t\t * \t\t
\n\t\t * @param {Boolean} retained If true, the message is to be retained by the server and delivered\n\t\t * to both current and future subscriptions.\n\t\t * If false the server only delivers the message to current subscribers, this is the default for new Messages.\n\t\t * A received message has the retained boolean set to true if the message was published\n\t\t * with the retained boolean set to true\n\t\t * and the subscrption was made after the message has been published.\n\t\t * @throws {InvalidState} if the client is not connected.\n\t\t */\n\t\t\tthis.publish = function(topic,payload,qos,retained) {\n\t\t\t\tvar message ;\n\n\t\t\t\tif(arguments.length === 0){\n\t\t\t\t\tthrow new Error(\"Invalid argument.\"+\"length\");\n\n\t\t\t\t}else if(arguments.length == 1) {\n\n\t\t\t\t\tif (!(topic instanceof Message) && (typeof topic !== \"string\"))\n\t\t\t\t\t\tthrow new Error(\"Invalid argument:\"+ typeof topic);\n\n\t\t\t\t\tmessage = topic;\n\t\t\t\t\tif (typeof message.destinationName === \"undefined\")\n\t\t\t\t\t\tthrow new Error(format(ERROR.INVALID_ARGUMENT,[message.destinationName,\"Message.destinationName\"]));\n\t\t\t\t\tclient.send(message);\n\n\t\t\t\t}else {\n\t\t\t\t\t//parameter checking in Message object\n\t\t\t\t\tmessage = new Message(payload);\n\t\t\t\t\tmessage.destinationName = topic;\n\t\t\t\t\tif(arguments.length >= 3)\n\t\t\t\t\t\tmessage.qos = qos;\n\t\t\t\t\tif(arguments.length >= 4)\n\t\t\t\t\t\tmessage.retained = retained;\n\t\t\t\t\tclient.send(message);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t * Normal disconnect of this Messaging client from its server.\n\t\t *\n\t\t * @name Paho.Client#disconnect\n\t\t * @function\n\t\t * @throws {InvalidState} if the client is already disconnected.\n\t\t */\n\t\t\tthis.disconnect = function () {\n\t\t\t\tclient.disconnect();\n\t\t\t};\n\n\t\t\t/**\n\t\t * Get the contents of the trace log.\n\t\t *\n\t\t * @name Paho.Client#getTraceLog\n\t\t * @function\n\t\t * @return {Object[]} tracebuffer containing the time ordered trace records.\n\t\t */\n\t\t\tthis.getTraceLog = function () {\n\t\t\t\treturn client.getTraceLog();\n\t\t\t};\n\n\t\t\t/**\n\t\t * Start tracing.\n\t\t *\n\t\t * @name Paho.Client#startTrace\n\t\t * @function\n\t\t */\n\t\t\tthis.startTrace = function () {\n\t\t\t\tclient.startTrace();\n\t\t\t};\n\n\t\t\t/**\n\t\t * Stop tracing.\n\t\t *\n\t\t * @name Paho.Client#stopTrace\n\t\t * @function\n\t\t */\n\t\t\tthis.stopTrace = function () {\n\t\t\t\tclient.stopTrace();\n\t\t\t};\n\n\t\t\tthis.isConnected = function() {\n\t\t\t\treturn client.connected;\n\t\t\t};\n\t\t};\n\n\t\t/**\n\t * An application message, sent or received.\n\t *

\n\t * All attributes may be null, which implies the default values.\n\t *\n\t * @name Paho.Message\n\t * @constructor\n\t * @param {String|ArrayBuffer} payload The message data to be sent.\n\t *

\n\t * @property {string} payloadString read only The payload as a string if the payload consists of valid UTF-8 characters.\n\t * @property {ArrayBuffer} payloadBytes read only The payload as an ArrayBuffer.\n\t *

\n\t * @property {string} destinationName mandatory The name of the destination to which the message is to be sent\n\t * (for messages about to be sent) or the name of the destination from which the message has been received.\n\t * (for messages received by the onMessage function).\n\t *

\n\t * @property {number} qos The Quality of Service used to deliver the message.\n\t *

\n\t *
0 Best effort (default).\n\t *
1 At least once.\n\t *
2 Exactly once.\n\t *
\n\t *

\n\t * @property {Boolean} retained If true, the message is to be retained by the server and delivered\n\t * to both current and future subscriptions.\n\t * If false the server only delivers the message to current subscribers, this is the default for new Messages.\n\t * A received message has the retained boolean set to true if the message was published\n\t * with the retained boolean set to true\n\t * and the subscrption was made after the message has been published.\n\t *

\n\t * @property {Boolean} duplicate read only If true, this message might be a duplicate of one which has already been received.\n\t * This is only set on messages received from the server.\n\t *\n\t */\n\t\tvar Message = function (newPayload) {\n\t\t\tvar payload;\n\t\t\tif ( typeof newPayload === \"string\" ||\n\t\tnewPayload instanceof ArrayBuffer ||\n\t\t(ArrayBuffer.isView(newPayload) && !(newPayload instanceof DataView))\n\t\t\t) {\n\t\t\t\tpayload = newPayload;\n\t\t\t} else {\n\t\t\t\tthrow (format(ERROR.INVALID_ARGUMENT, [newPayload, \"newPayload\"]));\n\t\t\t}\n\n\t\t\tvar destinationName;\n\t\t\tvar qos = 0;\n\t\t\tvar retained = false;\n\t\t\tvar duplicate = false;\n\n\t\t\tObject.defineProperties(this,{\n\t\t\t\t\"payloadString\":{\n\t\t\t\t\tenumerable : true,\n\t\t\t\t\tget : function () {\n\t\t\t\t\t\tif (typeof payload === \"string\")\n\t\t\t\t\t\t\treturn payload;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn parseUTF8(payload, 0, payload.length);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"payloadBytes\":{\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tget: function() {\n\t\t\t\t\t\tif (typeof payload === \"string\") {\n\t\t\t\t\t\t\tvar buffer = new ArrayBuffer(UTF8Length(payload));\n\t\t\t\t\t\t\tvar byteStream = new Uint8Array(buffer);\n\t\t\t\t\t\t\tstringToUTF8(payload, byteStream, 0);\n\n\t\t\t\t\t\t\treturn byteStream;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn payload;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"destinationName\":{\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tget: function() { return destinationName; },\n\t\t\t\t\tset: function(newDestinationName) {\n\t\t\t\t\t\tif (typeof newDestinationName === \"string\")\n\t\t\t\t\t\t\tdestinationName = newDestinationName;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthrow new Error(format(ERROR.INVALID_ARGUMENT, [newDestinationName, \"newDestinationName\"]));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"qos\":{\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tget: function() { return qos; },\n\t\t\t\t\tset: function(newQos) {\n\t\t\t\t\t\tif (newQos === 0 || newQos === 1 || newQos === 2 )\n\t\t\t\t\t\t\tqos = newQos;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthrow new Error(\"Invalid argument:\"+newQos);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"retained\":{\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tget: function() { return retained; },\n\t\t\t\t\tset: function(newRetained) {\n\t\t\t\t\t\tif (typeof newRetained === \"boolean\")\n\t\t\t\t\t\t\tretained = newRetained;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthrow new Error(format(ERROR.INVALID_ARGUMENT, [newRetained, \"newRetained\"]));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"topic\":{\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tget: function() { return destinationName; },\n\t\t\t\t\tset: function(newTopic) {destinationName=newTopic;}\n\t\t\t\t},\n\t\t\t\t\"duplicate\":{\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tget: function() { return duplicate; },\n\t\t\t\t\tset: function(newDuplicate) {duplicate=newDuplicate;}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\t// Module contents.\n\t\treturn {\n\t\t\tClient: Client,\n\t\t\tMessage: Message\n\t\t};\n\t// eslint-disable-next-line no-nested-ternary\n\t})(typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {});\n\treturn PahoMQTT;\n});\n"],"names":["factory","PahoMQTT","global","data","localStorage","setItem","key","item","getItem","removeItem","MESSAGE_TYPE","validate","obj","keys","hasOwnProperty","errorStr","validKey","Error","format","ERROR","INVALID_TYPE","scope","f","apply","arguments","OK","code","text","CONNECT_TIMEOUT","SUBSCRIBE_TIMEOUT","UNSUBSCRIBE_TIMEOUT","PING_TIMEOUT","INTERNAL_ERROR","CONNACK_RETURNCODE","SOCKET_ERROR","SOCKET_CLOSE","MALFORMED_UTF","UNSUPPORTED","INVALID_STATE","INVALID_ARGUMENT","UNSUPPORTED_OPERATION","INVALID_STORED_DATA","INVALID_MQTT_MESSAGE_TYPE","MALFORMED_UNICODE","BUFFER_FULL","CONNACK_RC","error","substitutions","field","start","i","length","indexOf","part1","substring","part2","MqttProtoIdentifierv3","MqttProtoIdentifierv4","WireMessage","type","options","name","this","decodeMessage","input","pos","digit","startingPos","first","messageInfo","remLength","multiplier","endPos","wireMessage","sessionPresent","returnCode","qos","len","readUint16","topicName","parseUTF8","messageIdentifier","message","Message","subarray","retained","duplicate","destinationName","payloadMessage","writeUint16","buffer","offset","writeString","utf8Length","stringToUTF8","UTF8Length","output","charCode","charCodeAt","lowCharCode","isNaN","utf16","byte1","byte2","toString","byte3","byte4","String","fromCharCode","prototype","encode","willMessagePayloadBytes","topicStrLength","destinationNameLength","undefined","mqttVersion","clientId","willMessage","payloadBytes","Uint8Array","byteLength","userName","password","topics","requestedQos","ArrayBuffer","mbi","number","Array","numBytes","encodeMBI","byteStream","set","connectFlags","cleanSession","keepAliveInterval","Pinger","client","_client","_keepAliveInterval","isReset","pingReq","doTimeout","pinger","doPing","_trace","socket","send","timeout","setTimeout","_disconnected","reset","clearTimeout","cancel","Timeout","timeoutSeconds","action","args","ClientImpl","uri","host","port","path","WebSocket","_wsuri","_localKey","_msg_queue","_buffered_msg_queue","_sentMessages","_receivedMessages","_notify_msg_sent","_message_identifier","_sequence","restore","connected","maxMessageIdentifier","connectOptions","hostIndex","onConnected","onConnectionLost","onMessageDelivered","onMessageArrived","traceFunction","_connectTimeout","sendPinger","receivePinger","_reconnectInterval","_reconnecting","_reconnectTimeout","disconnectedPublishing","disconnectedBufferSize","receiveBuffer","_traceBuffer","_MAX_TRACE_ENTRIES","connect","connectOptionsMasked","_traceMask","uris","_doConnect","subscribe","filter","subscribeOptions","constructor","onSuccess","grantedQos","invocationContext","onFailure","errorCode","errorMessage","timeOut","_requires_ack","_schedule_message","unsubscribe","unsubscribeOptions","callback","Object","sequence","unshift","disconnect","getTraceLog","Date","startTrace","stopTrace","wsurl","useSSL","uriParts","split","join","binaryType","onopen","_on_socket_open","onmessage","_on_socket_message","onerror","_on_socket_error","onclose","_on_socket_close","_process_queue","store","prefix","storedMessage","version","pubRecReceived","hex","messageBytes","payloadHex","JSON","stringify","value","parse","x","parseInt","pop","_socket_send","messageCount","event","messages","_deframeMessages","_handleMessage","byteArray","newData","result","push","errorStack","stack","sentMessage","receivedMessage","sequencedMessages","msgId","msg","sort","a","b","pubRelMessage","reconnected","_connected","_receivePublish","_receiveMessage","pubCompMessage","wireMessageMasked","pubAckMessage","pubRecMessage","reconnect","_reconnect","errorText","readyState","close","mqttVersionExplicit","slice","call","splice","record","severity","max","shift","traceObject","masked","traceObjectMasked","attr","newPayload","payload","isView","DataView","defineProperties","enumerable","get","newDestinationName","newQos","newRetained","newTopic","newDuplicate","Client","match","ipv6AddSBracket","clientIdLength","newOnConnected","newDisconnectedPublishing","newDisconnectedBufferSize","newOnConnectionLost","newOnMessageDelivered","newOnMessageArrived","trace","hosts","ports","stringPayload","usingURIs","test","ipv6","topic","publish","isConnected","g","self","window","module","exports"],"sourceRoot":""}