browser-meshblu-http
Version:
Meshblu Client for the Browser
2 lines • 139 kB
JavaScript
module.exports=function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=215)}([function(t,e){var r=Array.isArray;t.exports=r},function(t,e,r){function n(t){return null==t?void 0===t?a:u:c&&c in Object(t)?i(t):s(t)}var o=r(6),i=r(128),s=r(155),u="[object Null]",a="[object Undefined]",c=o?o.toStringTag:void 0;t.exports=n},function(t,e){function r(t){return null!=t&&"object"==typeof t}t.exports=r},function(t,e,r){var n=r(51),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();t.exports=i},function(t,e){function r(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}t.exports=r},function(t,e,r){function n(t,e){var r=i(t,e);return o(r)?r:void 0}var o=r(99),i=r(130);t.exports=n},function(t,e,r){var n=r(3),o=n.Symbol;t.exports=o},function(t,e,r){function n(t){if("string"==typeof t||o(t))return t;var e=t+"";return"0"==e&&1/t==-i?"-0":e}var o=r(10),i=1/0;t.exports=n},function(t,e){function r(t,e){return t===e||t!==t&&e!==e}t.exports=r},function(t,e,r){function n(t){return null!=t&&i(t.length)&&!o(t)}var o=r(28),i=r(29);t.exports=n},function(t,e,r){function n(t){return"symbol"==typeof t||i(t)&&o(t)==s}var o=r(1),i=r(2),s="[object Symbol]";t.exports=n},function(t,e,r){function n(t){return null==t?"":o(t)}var o=r(45);t.exports=n},function(t,e,r){function n(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}var o=r(141),i=r(142),s=r(143),u=r(144),a=r(145);n.prototype.clear=o,n.prototype.delete=i,n.prototype.get=s,n.prototype.has=u,n.prototype.set=a,t.exports=n},function(t,e,r){function n(t,e){for(var r=t.length;r--;)if(o(t[r][0],e))return r;return-1}var o=r(8);t.exports=n},function(t,e,r){function n(t,e){return o(t)?t:i(t,e)?[t]:s(u(t))}var o=r(0),i=r(26),s=r(166),u=r(11);t.exports=n},function(t,e,r){function n(t,e){var r=t.__data__;return o(e)?r["string"==typeof e?"string":"hash"]:r.map}var o=r(139);t.exports=n},function(t,e){function r(t,e){return e=null==e?n:e,!!e&&("number"==typeof t||o.test(t))&&t>-1&&t%1==0&&t<e}var n=9007199254740991,o=/^(?:0|[1-9]\d*)$/;t.exports=r},function(t,e,r){var n=r(5),o=n(Object,"create");t.exports=o},function(t,e){function r(t){return t}t.exports=r},function(t,e,r){var n=r(96),o=r(2),i=Object.prototype,s=i.hasOwnProperty,u=i.propertyIsEnumerable,a=n(function(){return arguments}())?n:function(t){return o(t)&&s.call(t,"callee")&&!u.call(t,"callee")};t.exports=a},function(t,e,r){(function(t){var n=r(3),o=r(192),i="object"==typeof e&&e&&!e.nodeType&&e,s=i&&"object"==typeof t&&t&&!t.nodeType&&t,u=s&&s.exports===i,a=u?n.Buffer:void 0,c=a?a.isBuffer:void 0,f=c||o;t.exports=f}).call(e,r(32)(t))},function(t,e,r){var n=r(101),o=r(46),i=r(58),s=i&&i.isTypedArray,u=s?o(s):n;t.exports=u},function(t,e,r){var n=r(5),o=r(3),i=n(o,"Map");t.exports=i},function(t,e,r){function n(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}var o=r(146),i=r(147),s=r(148),u=r(149),a=r(150);n.prototype.clear=o,n.prototype.delete=i,n.prototype.get=s,n.prototype.has=u,n.prototype.set=a,t.exports=n},function(t,e,r){function n(t,e){e=o(e,t);for(var r=0,n=e.length;null!=t&&r<n;)t=t[i(e[r++])];return r&&r==n?t:void 0}var o=r(14),i=r(7);t.exports=n},function(t,e){function r(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),r=r>o?o:r,r<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(o);++n<o;)i[n]=t[n+e];return i}t.exports=r},function(t,e,r){function n(t,e){if(o(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!i(t))||(u.test(t)||!s.test(t)||null!=e&&t in Object(e))}var o=r(0),i=r(10),s=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/;t.exports=n},function(t,e){function r(t){var e=t&&t.constructor,r="function"==typeof e&&e.prototype||n;return t===r}var n=Object.prototype;t.exports=r},function(t,e,r){function n(t){if(!i(t))return!1;var e=o(t);return e==u||e==a||e==s||e==c}var o=r(1),i=r(4),s="[object AsyncFunction]",u="[object Function]",a="[object GeneratorFunction]",c="[object Proxy]";t.exports=n},function(t,e){function r(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}var n=9007199254740991;t.exports=r},function(t,e,r){function n(t){return s(t)?o(t):i(t)}var o=r(36),i=r(43),s=r(9);t.exports=n},function(t,e){function r(t){return null!==t&&"object"==typeof t}t.exports=r},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){function n(t){var e=this.__data__=new o(t);this.size=e.size}var o=r(12),i=r(160),s=r(161),u=r(162),a=r(163),c=r(164);n.prototype.clear=i,n.prototype.delete=s,n.prototype.get=u,n.prototype.has=a,n.prototype.set=c,t.exports=n},function(t,e){function r(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}t.exports=r},function(t,e){function r(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}t.exports=r},function(t,e,r){function n(t,e){var r=s(t),n=!r&&i(t),f=!r&&!n&&u(t),h=!r&&!n&&!f&&c(t),l=r||n||f||h,d=l?o(t.length,String):[],v=d.length;for(var y in t)!e&&!p.call(t,y)||l&&("length"==y||f&&("offset"==y||"parent"==y)||h&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||a(y,v))||d.push(y);return d}var o=r(113),i=r(19),s=r(0),u=r(20),a=r(16),c=r(21),f=Object.prototype,p=f.hasOwnProperty;t.exports=n},function(t,e){function r(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}t.exports=r},function(t,e,r){function n(t,e,r){var n=t[e];u.call(t,e)&&i(n,r)&&(void 0!==r||e in t)||o(t,e,r)}var o=r(39),i=r(8),s=Object.prototype,u=s.hasOwnProperty;t.exports=n},function(t,e,r){function n(t,e,r){"__proto__"==e&&o?o(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var o=r(49);t.exports=n},function(t,e,r){function n(t,e){return t&&o(t,e,i)}var o=r(93),i=r(30);t.exports=n},function(t,e,r){function n(t,e,r,s,u){return t===e||(null==t||null==e||!i(t)&&!i(e)?t!==t&&e!==e:o(t,e,r,s,n,u))}var o=r(97),i=r(2);t.exports=n},function(t,e,r){function n(t){return"function"==typeof t?t:null==t?s:"object"==typeof t?u(t)?i(t[0],t[1]):o(t):a(t)}var o=r(104),i=r(105),s=r(18),u=r(0),a=r(189);t.exports=n},function(t,e,r){function n(t){if(!o(t))return i(t);var e=[];for(var r in Object(t))u.call(t,r)&&"constructor"!=r&&e.push(r);return e}var o=r(27),i=r(153),s=Object.prototype,u=s.hasOwnProperty;t.exports=n},function(t,e,r){function n(t,e){return s(i(t,e,o),t+"")}var o=r(18),i=r(60),s=r(61);t.exports=n},function(t,e,r){function n(t){if("string"==typeof t)return t;if(s(t))return i(t,n)+"";if(u(t))return f?f.call(t):"";var e=t+"";return"0"==e&&1/t==-a?"-0":e}var o=r(6),i=r(84),s=r(0),u=r(10),a=1/0,c=o?o.prototype:void 0,f=c?c.toString:void 0;t.exports=n},function(t,e){function r(t){return function(e){return t(e)}}t.exports=r},function(t,e,r){function n(t,e,r,n){var s=!r;r||(r={});for(var u=-1,a=e.length;++u<a;){var c=e[u],f=n?n(r[c],t[c],c,r,t):void 0;void 0===f&&(f=t[c]),s?i(r,c,f):o(r,c,f)}return r}var o=r(38),i=r(39);t.exports=n},function(t,e,r){function n(t){return o(function(e,r){var n=-1,o=r.length,s=o>1?r[o-1]:void 0,u=o>2?r[2]:void 0;for(s=t.length>3&&"function"==typeof s?(o--,s):void 0,u&&i(r[0],r[1],u)&&(s=o<3?void 0:s,o=1),e=Object(e);++n<o;){var a=r[n];a&&t(e,a,n,s)}return e})}var o=r(44),i=r(55);t.exports=n},function(t,e,r){var n=r(5),o=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,e,r){function n(t,e,r,n,c,f){var p=r&u,h=t.length,l=e.length;if(h!=l&&!(p&&l>h))return!1;var d=f.get(t);if(d&&f.get(e))return d==e;var v=-1,y=!0,m=r&a?new o:void 0;for(f.set(t,e),f.set(e,t);++v<h;){var b=t[v],x=e[v];if(n)var _=p?n(x,b,v,e,t,f):n(b,x,v,t,e,f);if(void 0!==_){if(_)continue;y=!1;break}if(m){if(!i(e,function(t,e){if(!s(m,e)&&(b===t||c(b,t,r,n,f)))return m.push(e)})){y=!1;break}}else if(b!==x&&!c(b,x,r,n,f)){y=!1;break}}return f.delete(t),f.delete(e),y}var o=r(80),i=r(86),s=r(114),u=1,a=2;t.exports=n},function(t,e,r){(function(e){var r="object"==typeof e&&e&&e.Object===Object&&e;t.exports=r}).call(e,r(70))},function(t,e,r){var n=r(59),o=n(Object.getPrototypeOf,Object);t.exports=o},function(t,e,r){var n=r(76),o=r(22),i=r(78),s=r(79),u=r(82),a=r(1),c=r(62),f="[object Map]",p="[object Object]",h="[object Promise]",l="[object Set]",d="[object WeakMap]",v="[object DataView]",y=c(n),m=c(o),b=c(i),x=c(s),_=c(u),g=a;(n&&g(new n(new ArrayBuffer(1)))!=v||o&&g(new o)!=f||i&&g(i.resolve())!=h||s&&g(new s)!=l||u&&g(new u)!=d)&&(g=function(t){var e=a(t),r=e==p?t.constructor:void 0,n=r?c(r):"";if(n)switch(n){case y:return v;case m:return f;case b:return h;case x:return l;case _:return d}return e}),t.exports=g},function(t,e){function r(t){return f.test(t)}var n="\\ud800-\\udfff",o="\\u0300-\\u036f",i="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",u=o+i+s,a="\\ufe0e\\ufe0f",c="\\u200d",f=RegExp("["+c+n+u+a+"]");t.exports=r},function(t,e,r){function n(t,e,r){if(!u(r))return!1;var n=typeof e;return!!("number"==n?i(r)&&s(e,r.length):"string"==n&&e in r)&&o(r[e],t)}var o=r(8),i=r(9),s=r(16),u=r(4);t.exports=n},function(t,e,r){function n(t){return t===t&&!o(t)}var o=r(4);t.exports=n},function(t,e){function r(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}t.exports=r},function(t,e,r){(function(t){var n=r(51),o="object"==typeof e&&e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,s=i&&i.exports===o,u=s&&n.process,a=function(){try{return u&&u.binding&&u.binding("util")}catch(t){}}();t.exports=a}).call(e,r(32)(t))},function(t,e){function r(t,e){return function(r){return t(e(r))}}t.exports=r},function(t,e,r){function n(t,e,r){return e=i(void 0===e?t.length-1:e,0),function(){for(var n=arguments,s=-1,u=i(n.length-e,0),a=Array(u);++s<u;)a[s]=n[e+s];s=-1;for(var c=Array(e+1);++s<e;)c[s]=n[s];return c[e]=r(a),o(t,this,c)}}var o=r(34),i=Math.max;t.exports=n},function(t,e,r){var n=r(112),o=r(159),i=o(n);t.exports=i},function(t,e){function r(t){if(null!=t){try{return o.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var n=Function.prototype,o=n.toString;t.exports=r},function(t,e,r){var n=r(34),o=r(170),i=r(44),s=r(121),u=i(function(t){return t.push(void 0,s),n(o,void 0,t)});t.exports=u},function(t,e,r){function n(t,e){return null!=t&&i(t,e,o)}var o=r(95),i=r(131);t.exports=n},function(t,e,r){function n(t){if(null==t)return!0;if(a(t)&&(u(t)||"string"==typeof t||"function"==typeof t.splice||c(t)||p(t)||s(t)))return!t.length;var e=i(t);if(e==h||e==l)return!t.size;if(f(t))return!o(t).length;for(var r in t)if(v.call(t,r))return!1;return!0}var o=r(43),i=r(53),s=r(19),u=r(0),a=r(9),c=r(20),f=r(27),p=r(21),h="[object Map]",l="[object Set]",d=Object.prototype,v=d.hasOwnProperty;t.exports=n},function(t,e,r){function n(t){return s(t)?o(t,!0):i(t)}var o=r(36),i=r(102),s=r(9);t.exports=n},function(t,e,r){function n(t){var e=o(t),r=e%1;return e===e?r?e-r:e:0}var o=r(194);t.exports=n},function(t,e,r){"use strict";var n=String.prototype.replace,o=/%20/g;t.exports={default:"RFC3986",formatters:{RFC1738:function(t){return n.call(t,o,"+")},RFC3986:function(t){return t}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(t,e,r){"use strict";var n=Object.prototype.hasOwnProperty,o=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}();e.arrayToObject=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n<t.length;++n)"undefined"!=typeof t[n]&&(r[n]=t[n]);return r},e.merge=function(t,r,o){if(!r)return t;if("object"!=typeof r){if(Array.isArray(t))t.push(r);else{if("object"!=typeof t)return[t,r];t[r]=!0}return t}if("object"!=typeof t)return[t].concat(r);var i=t;return Array.isArray(t)&&!Array.isArray(r)&&(i=e.arrayToObject(t,o)),Array.isArray(t)&&Array.isArray(r)?(r.forEach(function(r,i){n.call(t,i)?t[i]&&"object"==typeof t[i]?t[i]=e.merge(t[i],r,o):t.push(r):t[i]=r}),t):Object.keys(r).reduce(function(t,n){var i=r[n];return Object.prototype.hasOwnProperty.call(t,n)?t[n]=e.merge(t[n],i,o):t[n]=i,t},i)},e.decode=function(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t}},e.encode=function(t){if(0===t.length)return t;for(var e="string"==typeof t?t:String(t),r="",n=0;n<e.length;++n){var i=e.charCodeAt(n);45===i||46===i||95===i||126===i||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?r+=e.charAt(n):i<128?r+=o[i]:i<2048?r+=o[192|i>>6]+o[128|63&i]:i<55296||i>=57344?r+=o[224|i>>12]+o[128|i>>6&63]+o[128|63&i]:(n+=1,i=65536+((1023&i)<<10|1023&e.charCodeAt(n)),r+=o[240|i>>18]+o[128|i>>12&63]+o[128|i>>6&63]+o[128|63&i])}return r},e.compact=function(t,r){if("object"!=typeof t||null===t)return t;var n=r||[],o=n.indexOf(t);if(o!==-1)return n[o];if(n.push(t),Array.isArray(t)){for(var i=[],s=0;s<t.length;++s)t[s]&&"object"==typeof t[s]?i.push(e.compact(t[s],n)):"undefined"!=typeof t[s]&&i.push(t[s]);return i}var u=Object.keys(t);return u.forEach(function(r){t[r]=e.compact(t[r],n)}),t},e.isRegExp=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},e.isBuffer=function(t){return null!==t&&"undefined"!=typeof t&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){t.exports=r(73)},function(t,e){t.exports=function(t){return function(){t.apply(null,arguments)}}},function(t,e,r){var n,o,i,s,u,a,c,f,p,h,l,d,v=function(t,e){return function(){return t.apply(e,arguments)}},y=[].slice;o=r(74),s=r(63),u=r(175),c=r(65),h=r(183),a=r(179),f=r(180),p=r(181),d=r(197),l=r(185),i={defaults:s,extend:u,isEmpty:c,isString:h,isBoolean:a,isNumber:f,isPlainObject:p,transform:d,kebabCase:l},n=function(){function t(t){this._possiblySerializeHeaderValue=v(this._possiblySerializeHeaderValue,this),this._getMetadataHeaders=v(this._getMetadataHeaders,this),this._getDefaultRequestOptions=v(this._getDefaultRequestOptions,this),this.whoami=v(this.whoami,this),this.updateDangerously=v(this.updateDangerously,this),this.update=v(this.update,this),this.unregister=v(this.unregister,this),this.revokeToken=v(this.revokeToken,this),this.removeTokenByQuery=v(this.removeTokenByQuery,this),this.register=v(this.register,this),this.message=v(this.message,this),this.listSubscriptions=v(this.listSubscriptions,this),this.generateAndStoreToken=v(this.generateAndStoreToken,this),this.searchTokens=v(this.searchTokens,this),this.search=v(this.search,this),this.devices=v(this.devices,this),this._device=v(this._device,this),this.device=v(this.device,this),this.deleteSubscription=v(this.deleteSubscription,this),this.createSubscription=v(this.createSubscription,this),this.claimdevice=v(this.claimdevice,this),this.authenticate=v(this.authenticate,this);var e,r,n,s,u,a,c,f,p;if(null!=t?t.server:void 0)throw new Error("MeshbluHttp only allows hostname: 'server' is not allowed");if(null!=t?t.host:void 0)throw new Error("MeshbluHttp only allows hostname: 'host' is not allowed");n=i.extend({port:443,hostname:"meshblu-http.octoblu.com"},t),this.uuid=n.uuid,this.token=n.token,this.bearerToken=n.bearerToken,u=n.protocol,r=n.hostname,s=n.port,a=n.resolveSrv,e=n.domain,f=n.service,c=n.secure,p=n.serviceName,"websocket"===u&&(u=null);try{s=parseInt(s)}catch(t){}443===s&&null==u&&(u="https:"),null==u&&(u="http:"),null==c&&(c=!0),null==e&&(e="octoblu.com"),null==f&&(f="meshblu"),this.request=new o({protocol:u,hostname:r,port:s,resolveSrv:a,domain:e,service:f,secure:c,serviceName:p})}return t.prototype.authenticate=function(t){var e;return e=this._getDefaultRequestOptions(),this.request.post("/authenticate",e,t)},t.prototype.claimdevice=function(t,e){var r;return r=this._getDefaultRequestOptions(),this.request.post("/claimdevice/"+t,r,e)},t.prototype.createSubscription=function(t,e){var r,n,o,s;return o=t.subscriberUuid,r=t.emitterUuid,s=t.type,n=this._getDefaultRequestOptions(),this.request.post("/v2/devices/"+o+"/subscriptions/"+r+"/"+s,n,function(t){return function(t,r){return null!=t?e(t):i.isEmpty(r)?e(null):e(null,r)}}(this))},t.prototype.deleteSubscription=function(t,e){var r,n,o,s;return o=t.subscriberUuid,r=t.emitterUuid,s=t.type,n=this._getDefaultRequestOptions(),this.request.delete("/v2/devices/"+o+"/subscriptions/"+r+"/"+s,n,function(t){return function(t,r){return null!=t?e(t):i.isEmpty(r)?e(null):e(null,r)}}(this))},t.prototype.device=function(){var t,e,r,n;return n=arguments[0],r=2<=arguments.length?y.call(arguments,1):[],t=r[0],i.isPlainObject(t)&&(e=r[0],t=r[1]),null==e&&(e={}),this._device(n,e,t)},t.prototype._device=function(t,e,r){var n;return null==r&&(r=function(){}),n=this._getDefaultRequestOptions(),n.headers=i.extend({},this._getMetadataHeaders(e),n.headers),this.request.get("/v2/devices/"+t,n,r)},t.prototype.devices=function(t,e){var r;return r=this._getDefaultRequestOptions(),r.query=t,this.request.get("/v2/devices",r,e)},t.prototype.search=function(t,e){var r,n,o,i;return i=t.query,o=t.projection,r=t.as,n=this._getDefaultRequestOptions(),n.body=i,null==n.headers&&(n.headers={}),null!=o&&(n.headers["X-MESHBLU-PROJECTION"]=JSON.stringify(o)),null!=r&&(n.headers["X-MESHBLU-AS"]=r),this.request.post("/search/devices",n,function(t){return function(t,r){return null==r&&(r=[]),null!=t?e(t):e(null,r)}}(this))},t.prototype.searchTokens=function(t,e){var r,n,o;return o=t.query,n=t.projection,r=this._getDefaultRequestOptions(),r.body=o,null==r.headers&&(r.headers={}),null!=n&&(r.headers["X-MESHBLU-PROJECTION"]=JSON.stringify(n)),this.request.post("/search/tokens",r,function(t){return function(t,r){return null==r&&(r=[]),null!=t?e(t):e(null,r)}}(this))},t.prototype.generateAndStoreToken=function(t,e,r){var n;return null==e&&(e={}),n=this._getDefaultRequestOptions(),n.body=e,this.request.post("/devices/"+t+"/tokens",n,function(t){return function(t,e){return null!=t?r(t):i.isEmpty(e)?r(new Error("Invalid Response")):r(null,e)}}(this))},t.prototype.listSubscriptions=function(t,e){var r,n;return n=t.subscriberUuid,r=this._getDefaultRequestOptions(),this.request.get("/v2/devices/"+n+"/subscriptions",r,e)},t.prototype.message=function(t,e){var r;return r=this._getDefaultRequestOptions(),r.body=t,this.request.post("/messages",r,e)},t.prototype.register=function(t,e){var r;return r=this._getDefaultRequestOptions(),r.body=t,this.request.post("/devices",r,function(t){return function(t,r){return null!=t?e(t):i.isEmpty(r)?e(new Error("Invalid Response")):e(null,r)}}(this))},t.prototype.removeTokenByQuery=function(t,e,r){var n;return null==e&&(e={}),console.log("removeTokenByQuery",t,e),n=this._getDefaultRequestOptions(),n.query=e,this.request.delete("/devices/"+t+"/tokens",n,r)},t.prototype.revokeToken=function(t,e,r){var n;return null==r&&(r=function(){}),n=this._getDefaultRequestOptions(),this.request.delete("/devices/"+t+"/tokens/"+e,n,r)},t.prototype.unregister=function(t,e){var r;return r=this._getDefaultRequestOptions(),this.request.delete("/devices/"+t,r,e)},t.prototype.update=function(t,e,r){var n;return n=this._getDefaultRequestOptions(),n.body=e,this.request.patch("/v2/devices/"+t,n,r)},t.prototype.updateDangerously=function(t,e,r){var n;return n=this._getDefaultRequestOptions(),n.body=e,this.request.put("/v2/devices/"+t,n,r)},t.prototype.whoami=function(t){var e;return e=this._getDefaultRequestOptions(),this.request.get("/v2/whoami",e,function(e){return function(e,r){return null!=e?t(e):i.isEmpty(r)?t(new Error("Invalid Response")):t(null,r)}}(this))},t.prototype._getDefaultRequestOptions=function(){return{uuid:this.uuid,token:this.token,bearerToken:this.bearerToken}},t.prototype._getMetadataHeaders=function(t){return i.transform(t,function(t){return function(e,r,n){var o;return o=i.kebabCase(n),e["x-meshblu-"+o]=t._possiblySerializeHeaderValue(r),!0}}(this),{})},t.prototype._possiblySerializeHeaderValue=function(t){return i.isString(t)?t:i.isBoolean(t)?t:i.isNumber(t)?t:JSON.stringify(t)},t}(),t.exports=n},function(t,e,r){var n,o,i,s,u,a,c,f=function(t,e){return function(){return t.apply(e,arguments)}};a=r(200),o=r(206),c=r(207),i=r(213),s={defaults:r(63),dropRight:r(173),each:r(174),isEmpty:r(65),join:r(184),minBy:r(187),pick:r(188),split:r(190),takeRight:r(193),toLower:r(195)},u=r(72),n=function(){function t(t){var e,r,n,i,s;null==t&&(t={}),this._url=f(this._url,this),this._retrySrvRequest=f(this._retrySrvRequest,this),this._resolveBaseUrl=f(this._resolveBaseUrl,this),this._request=f(this._request,this),this._inBrowser=f(this._inBrowser,this),this._handleResponse=f(this._handleResponse,this),this._doRequest=f(this._doRequest,this),this.put=f(this.put,this),this.post=f(this.post,this),this.patch=f(this.patch,this),this.get=f(this.get,this),this.delete=f(this.delete,this),this.protocol=t.protocol,this.hostname=t.hostname,this.port=t.port,s=t.service,e=t.domain,i=t.secure,n=t.resolveSrv,this.dnsHttpServer=t.dnsHttpServer,this.serviceName=t.serviceName,n&&(r="http",i&&(r="https"),this.srvFailover=new o({domain:e,service:s,protocol:r}))}return t.prototype.delete=function(t,e,r){var n,o;return o=s.pick(e,"uuid","token","bearerToken","headers"),o.pathname=t,n=a.stringify(e.query),this._resolveBaseUrl(t,function(t){return function(e,i){return null!=e?r(e):t._doRequest({method:"delete",baseUri:i,requestOptions:o,query:n},r)}}(this))},t.prototype.get=function(t,e,r){var n,o;return o=s.pick(e,"uuid","token","bearerToken","headers"),o.pathname=t,n=a.stringify(e.query),this._resolveBaseUrl(t,function(t){return function(e,i){return null!=e?r(e):t._doRequest({method:"get",baseUri:i,requestOptions:o,query:n},r)}}(this))},t.prototype.patch=function(t,e,r){var n,o;return o=s.pick(e,"uuid","token","bearerToken","headers"),o.pathname=t,n=e.body,this._resolveBaseUrl(t,function(t){return function(e,i){return null!=e?r(e):t._doRequest({method:"patch",baseUri:i,requestOptions:o,body:n},r)}}(this))},t.prototype.post=function(t,e,r){var n,o;return o=s.pick(e,"uuid","token","bearerToken","headers"),o.pathname=t,n=e.body,this._resolveBaseUrl(t,function(t){return function(e,i){return null!=e?r(e):t._doRequest({method:"post",baseUri:i,requestOptions:o,body:n},r)}}(this))},t.prototype.put=function(t,e,r){var n,o;return o=s.pick(e,"uuid","token","bearerToken","headers"),o.pathname=t,n=e.body,this._resolveBaseUrl(t,function(t){return function(e,i){return null!=e?r(e):t._doRequest({method:"put",baseUri:i,requestOptions:o,body:n},r)}}(this))},t.prototype._doRequest=function(t,e){var r,n,o,i,s;return o=t.method,r=t.baseUri,s=t.requestOptions,i=t.query,n=t.body,this._request(o,r,s).query(i).send(n).end(function(t){return function(u,a){return(null!=u?u.crossDomain:void 0)?t._retrySrvRequest(u,{method:o,baseUri:r,requestOptions:s,query:i,body:n},e):t._handleResponse(e)(u,a)}}(this))},t.prototype._handleResponse=function(t){return function(e){return function(e,r){return null!=e?t(e):r.notFound?t(null):r.ok?t(null,r.body):t(new Error("Invalid Response Code"))}}(this)},t.prototype._inBrowser=function(){return"undefined"!=typeof window&&null!==window},t.prototype._request=function(t,e,r){var n,o,i,u,a,f;return i=r.pathname,f=r.uuid,a=r.token,n=r.bearerToken,o=r.headers,t=s.toLower(t),u=c[t](this._url(e,i)),null!=f&&null!=a&&u.auth(f,a),null!=n&&u.set("Authorization","Bearer "+n),null!=this.serviceName&&u.set("x-meshblu-service-name",this.serviceName),u.accept("application/json"),u.set("Content-Type","application/json"),s.each(o,function(t){return function(t,e){return u.set(e,t)}}(this)),u},t.prototype._resolveBaseUrl=function(t,e){var r;return r=u(e),null==this.srvFailover?r(null,i.format({protocol:this.protocol,hostname:this.hostname,port:this.port})):this.srvFailover.resolveUrl(function(e){return function(n,o){return null!=n?r(n):e._inBrowser()?r(null,o):c.options(e._url(o,t)).end(function(n){return null!=n?(e.srvFailover.markBadUrl(o,{ttl:6e4}),e._resolveBaseUrl(t,r)):r(null,o)})}}(this))},t.prototype._retrySrvRequest=function(t,e,r){var n,o,i,s,u;return null==this.srvFailover?r(t):(i=e.method,n=e.baseUri,u=e.requestOptions,s=e.query,o=e.body,this.srvFailover.markBadUrl(n,{ttl:6e4}),this.srvFailover.resolveUrl(function(t){return function(e,n){return null!=e?r(e):t._doRequest({method:i,baseUri:n,requestOptions:u,query:s,body:o},r)}}(this)))},t.prototype._url=function(t,e){var r,n,o,s;return s=i.parse(t),o=s.protocol,r=s.hostname,n=s.port,i.format({hostname:r,protocol:o,port:n,pathname:e})},t}(),t.exports=n},function(t,e,r){function n(t){if(t)return o(t)}function o(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},n.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var n,o=0;o<r.length;o++)if(n=r[o],n===e||n.fn===e){r.splice(o,1);break}return this},n.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),r=this._callbacks["$"+t];if(r){r=r.slice(0);for(var n=0,o=r.length;n<o;++n)r[n].apply(this,e)}return this},n.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},n.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e,r){var n=r(5),o=r(3),i=n(o,"DataView");t.exports=i},function(t,e,r){function n(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}var o=r(133),i=r(134),s=r(135),u=r(136),a=r(137);n.prototype.clear=o,n.prototype.delete=i,n.prototype.get=s,n.prototype.has=u,n.prototype.set=a,t.exports=n},function(t,e,r){var n=r(5),o=r(3),i=n(o,"Promise");t.exports=i},function(t,e,r){var n=r(5),o=r(3),i=n(o,"Set");t.exports=i},function(t,e,r){function n(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new o;++e<r;)this.add(t[e])}var o=r(23),i=r(156),s=r(157);n.prototype.add=n.prototype.push=i,n.prototype.has=s,t.exports=n},function(t,e,r){var n=r(3),o=n.Uint8Array;t.exports=o},function(t,e,r){var n=r(5),o=r(3),i=n(o,"WeakMap");t.exports=i},function(t,e){function r(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var s=t[r];e(s,r,t)&&(i[o++]=s)}return i}t.exports=r},function(t,e){function r(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}t.exports=r},function(t,e){function r(t,e,r,n){var o=-1,i=null==t?0:t.length;for(n&&i&&(r=t[++o]);++o<i;)r=e(r,t[o],o,t);return r}t.exports=r},function(t,e){function r(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}t.exports=r},function(t,e){function r(t){return t.split("")}t.exports=r},function(t,e){function r(t){return t.match(n)||[]}var n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;t.exports=r},function(t,e,r){var n=r(4),o=Object.create,i=function(){function t(){}return function(e){if(!n(e))return{};if(o)return o(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();t.exports=i},function(t,e,r){var n=r(40),o=r(118),i=o(n);t.exports=i},function(t,e,r){function n(t,e,r){for(var n=-1,i=t.length;++n<i;){var s=t[n],u=e(s);if(null!=u&&(void 0===a?u===u&&!o(u):r(u,a)))var a=u,c=s}return c}var o=r(10);t.exports=n},function(t,e,r){function n(t,e,r,s,u){var a=-1,c=t.length;for(r||(r=i),u||(u=[]);++a<c;){var f=t[a];e>0&&r(f)?e>1?n(f,e-1,r,s,u):o(u,f):s||(u[u.length]=f)}return u}var o=r(37),i=r(138);t.exports=n},function(t,e,r){var n=r(119),o=n();t.exports=o},function(t,e,r){function n(t,e,r){var n=e(t);return i(t)?n:o(n,r(t))}var o=r(37),i=r(0);t.exports=n},function(t,e){function r(t,e){return null!=t&&e in Object(t)}t.exports=r},function(t,e,r){function n(t){return i(t)&&o(t)==s}var o=r(1),i=r(2),s="[object Arguments]";t.exports=n},function(t,e,r){function n(t,e,r,n,y,b){var x=c(t),_=c(e),g=x?d:a(t),j=_?d:a(e);g=g==l?v:g,j=j==l?v:j;var w=g==v,O=j==v,A=g==j;if(A&&f(t)){if(!f(e))return!1;x=!0,w=!1}if(A&&!w)return b||(b=new o),x||p(t)?i(t,e,r,n,y,b):s(t,e,g,r,n,y,b);if(!(r&h)){var T=w&&m.call(t,"__wrapped__"),k=O&&m.call(e,"__wrapped__");if(T||k){var E=T?t.value():t,R=k?e.value():e;return b||(b=new o),y(E,R,r,n,b)}}return!!A&&(b||(b=new o),u(t,e,r,n,y,b))}var o=r(33),i=r(50),s=r(123),u=r(124),a=r(53),c=r(0),f=r(20),p=r(21),h=1,l="[object Arguments]",d="[object Array]",v="[object Object]",y=Object.prototype,m=y.hasOwnProperty;t.exports=n},function(t,e,r){function n(t,e,r,n){var a=r.length,c=a,f=!n;if(null==t)return!c;for(t=Object(t);a--;){var p=r[a];if(f&&p[2]?p[1]!==t[p[0]]:!(p[0]in t))return!1}for(;++a<c;){p=r[a];var h=p[0],l=t[h],d=p[1];if(f&&p[2]){if(void 0===l&&!(h in t))return!1}else{var v=new o;if(n)var y=n(l,d,h,t,e,v);if(!(void 0===y?i(d,l,s|u,n,v):y))return!1}}return!0}var o=r(33),i=r(41),s=1,u=2;t.exports=n},function(t,e,r){function n(t){if(!s(t)||i(t))return!1;var e=o(t)?d:c;return e.test(u(t))}var o=r(28),i=r(140),s=r(4),u=r(62),a=/[\\^$.*+?()[\]{}|]/g,c=/^\[object .+?Constructor\]$/,f=Function.prototype,p=Object.prototype,h=f.toString,l=p.hasOwnProperty,d=RegExp("^"+h.call(l).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=n},function(t,e,r){function n(t){return i(t)&&o(t)==s}var o=r(1),i=r(2),s="[object RegExp]";t.exports=n},function(t,e,r){function n(t){return s(t)&&i(t.length)&&!!S[o(t)]}var o=r(1),i=r(29),s=r(2),u="[object Arguments]",a="[object Array]",c="[object Boolean]",f="[object Date]",p="[object Error]",h="[object Function]",l="[object Map]",d="[object Number]",v="[object Object]",y="[object RegExp]",m="[object Set]",b="[object String]",x="[object WeakMap]",_="[object ArrayBuffer]",g="[object DataView]",j="[object Float32Array]",w="[object Float64Array]",O="[object Int8Array]",A="[object Int16Array]",T="[object Int32Array]",k="[object Uint8Array]",E="[object Uint8ClampedArray]",R="[object Uint16Array]",q="[object Uint32Array]",S={};S[j]=S[w]=S[O]=S[A]=S[T]=S[k]=S[E]=S[R]=S[q]=!0,S[u]=S[a]=S[_]=S[c]=S[g]=S[f]=S[p]=S[h]=S[l]=S[d]=S[v]=S[y]=S[m]=S[b]=S[x]=!1,t.exports=n},function(t,e,r){function n(t){if(!o(t))return s(t);var e=i(t),r=[];for(var n in t)("constructor"!=n||!e&&a.call(t,n))&&r.push(n);return r}var o=r(4),i=r(27),s=r(154),u=Object.prototype,a=u.hasOwnProperty;t.exports=n},function(t,e){function r(t,e){return t<e}t.exports=r},function(t,e,r){function n(t){var e=i(t);return 1==e.length&&e[0][2]?s(e[0][0],e[0][1]):function(r){return r===t||o(r,t,e)}}var o=r(98),i=r(127),s=r(57);t.exports=n},function(t,e,r){function n(t,e){return u(t)&&a(e)?c(f(t),e):function(r){var n=i(r,t);return void 0===n&&n===e?s(r,t):o(e,n,p|h)}}var o=r(41),i=r(178),s=r(64),u=r(26),a=r(56),c=r(57),f=r(7),p=1,h=2;t.exports=n},function(t,e,r){function n(t,e){return o(t,e,function(e,r){return i(t,r)})}var o=r(107),i=r(64);t.exports=n},function(t,e,r){function n(t,e,r){for(var n=-1,u=e.length,a={};++n<u;){var c=e[n],f=o(t,c);r(f,c)&&i(a,s(c,t),f)}return a}var o=r(24),i=r(111),s=r(14);t.exports=n},function(t,e){function r(t){return function(e){return null==e?void 0:e[t]}}t.exports=r},function(t,e,r){function n(t){return function(e){return o(e,t)}}var o=r(24);t.exports=n},function(t,e){function r(t){return function(e){
return null==t?void 0:t[e]}}t.exports=r},function(t,e,r){function n(t,e,r,n){if(!u(t))return t;e=i(e,t);for(var c=-1,f=e.length,p=f-1,h=t;null!=h&&++c<f;){var l=a(e[c]),d=r;if(c!=p){var v=h[l];d=n?n(v,l,h):void 0,void 0===d&&(d=u(v)?v:s(e[c+1])?[]:{})}o(h,l,d),h=h[l]}return t}var o=r(38),i=r(14),s=r(16),u=r(4),a=r(7);t.exports=n},function(t,e,r){var n=r(171),o=r(49),i=r(18),s=o?function(t,e){return o(t,"toString",{configurable:!0,enumerable:!1,value:n(e),writable:!0})}:i;t.exports=s},function(t,e){function r(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}t.exports=r},function(t,e){function r(t,e){return t.has(e)}t.exports=r},function(t,e,r){function n(t){return"function"==typeof t?t:o}var o=r(18);t.exports=n},function(t,e,r){function n(t,e,r){var n=t.length;return r=void 0===r?n:r,!e&&r>=n?t:o(t,e,r)}var o=r(25);t.exports=n},function(t,e,r){var n=r(3),o=n["__core-js_shared__"];t.exports=o},function(t,e,r){function n(t,e){return function(r,n){if(null==r)return r;if(!o(r))return t(r,n);for(var i=r.length,s=e?i:-1,u=Object(r);(e?s--:++s<i)&&n(u[s],s,u)!==!1;);return r}}var o=r(9);t.exports=n},function(t,e){function r(t){return function(e,r,n){for(var o=-1,i=Object(e),s=n(e),u=s.length;u--;){var a=s[t?u:++o];if(r(i[a],a,i)===!1)break}return e}}t.exports=r},function(t,e,r){function n(t){return function(e){return o(s(i(e).replace(a,"")),t,"")}}var o=r(85),i=r(172),s=r(198),u="['’]",a=RegExp(u,"g");t.exports=n},function(t,e,r){function n(t,e,r,n){return void 0===t||o(t,i[r])&&!s.call(n,r)?e:t}var o=r(8),i=Object.prototype,s=i.hasOwnProperty;t.exports=n},function(t,e,r){var n=r(110),o={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},i=n(o);t.exports=i},function(t,e,r){function n(t,e,r,n,o,w,A){switch(r){case j:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case g:return!(t.byteLength!=e.byteLength||!w(new i(t),new i(e)));case h:case l:case y:return s(+t,+e);case d:return t.name==e.name&&t.message==e.message;case m:case x:return t==e+"";case v:var T=a;case b:var k=n&f;if(T||(T=c),t.size!=e.size&&!k)return!1;var E=A.get(t);if(E)return E==e;n|=p,A.set(t,e);var R=u(T(t),T(e),n,o,w,A);return A.delete(t),R;case _:if(O)return O.call(t)==O.call(e)}return!1}var o=r(6),i=r(81),s=r(8),u=r(50),a=r(151),c=r(158),f=1,p=2,h="[object Boolean]",l="[object Date]",d="[object Error]",v="[object Map]",y="[object Number]",m="[object RegExp]",b="[object Set]",x="[object String]",_="[object Symbol]",g="[object ArrayBuffer]",j="[object DataView]",w=o?o.prototype:void 0,O=w?w.valueOf:void 0;t.exports=n},function(t,e,r){function n(t,e,r,n,s,a){var c=r&i,f=o(t),p=f.length,h=o(e),l=h.length;if(p!=l&&!c)return!1;for(var d=p;d--;){var v=f[d];if(!(c?v in e:u.call(e,v)))return!1}var y=a.get(t);if(y&&a.get(e))return y==e;var m=!0;a.set(t,e),a.set(e,t);for(var b=c;++d<p;){v=f[d];var x=t[v],_=e[v];if(n)var g=c?n(_,x,v,e,t,a):n(x,_,v,t,e,a);if(!(void 0===g?x===_||s(x,_,r,n,a):g)){m=!1;break}b||(b="constructor"==v)}if(m&&!b){var j=t.constructor,w=e.constructor;j!=w&&"constructor"in t&&"constructor"in e&&!("function"==typeof j&&j instanceof j&&"function"==typeof w&&w instanceof w)&&(m=!1)}return a.delete(t),a.delete(e),m}var o=r(126),i=1,s=Object.prototype,u=s.hasOwnProperty;t.exports=n},function(t,e,r){function n(t){return s(i(t,void 0,o),t+"")}var o=r(176),i=r(60),s=r(61);t.exports=n},function(t,e,r){function n(t){return o(t,s,i)}var o=r(94),i=r(129),s=r(30);t.exports=n},function(t,e,r){function n(t){for(var e=i(t),r=e.length;r--;){var n=e[r],s=t[n];e[r]=[n,s,o(s)]}return e}var o=r(56),i=r(30);t.exports=n},function(t,e,r){function n(t){var e=s.call(t,a),r=t[a];try{t[a]=void 0;var n=!0}catch(t){}var o=u.call(t);return n&&(e?t[a]=r:delete t[a]),o}var o=r(6),i=Object.prototype,s=i.hasOwnProperty,u=i.toString,a=o?o.toStringTag:void 0;t.exports=n},function(t,e,r){var n=r(83),o=r(191),i=Object.prototype,s=i.propertyIsEnumerable,u=Object.getOwnPropertySymbols,a=u?function(t){return null==t?[]:(t=Object(t),n(u(t),function(e){return s.call(t,e)}))}:o;t.exports=a},function(t,e){function r(t,e){return null==t?void 0:t[e]}t.exports=r},function(t,e,r){function n(t,e,r){e=o(e,t);for(var n=-1,f=e.length,p=!1;++n<f;){var h=c(e[n]);if(!(p=null!=t&&r(t,h)))break;t=t[h]}return p||++n!=f?p:(f=null==t?0:t.length,!!f&&a(f)&&u(h,f)&&(s(t)||i(t)))}var o=r(14),i=r(19),s=r(0),u=r(16),a=r(29),c=r(7);t.exports=n},function(t,e){function r(t){return n.test(t)}var n=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;t.exports=r},function(t,e,r){function n(){this.__data__=o?o(null):{},this.size=0}var o=r(17);t.exports=n},function(t,e){function r(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}t.exports=r},function(t,e,r){function n(t){var e=this.__data__;if(o){var r=e[t];return r===i?void 0:r}return u.call(e,t)?e[t]:void 0}var o=r(17),i="__lodash_hash_undefined__",s=Object.prototype,u=s.hasOwnProperty;t.exports=n},function(t,e,r){function n(t){var e=this.__data__;return o?void 0!==e[t]:s.call(e,t)}var o=r(17),i=Object.prototype,s=i.hasOwnProperty;t.exports=n},function(t,e,r){function n(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=o&&void 0===e?i:e,this}var o=r(17),i="__lodash_hash_undefined__";t.exports=n},function(t,e,r){function n(t){return s(t)||i(t)||!!(u&&t&&t[u])}var o=r(6),i=r(19),s=r(0),u=o?o.isConcatSpreadable:void 0;t.exports=n},function(t,e){function r(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}t.exports=r},function(t,e,r){function n(t){return!!i&&i in t}var o=r(117),i=function(){var t=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();t.exports=n},function(t,e){function r(){this.__data__=[],this.size=0}t.exports=r},function(t,e,r){function n(t){var e=this.__data__,r=o(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():s.call(e,r,1),--this.size,!0}var o=r(13),i=Array.prototype,s=i.splice;t.exports=n},function(t,e,r){function n(t){var e=this.__data__,r=o(e,t);return r<0?void 0:e[r][1]}var o=r(13);t.exports=n},function(t,e,r){function n(t){return o(this.__data__,t)>-1}var o=r(13);t.exports=n},function(t,e,r){function n(t,e){var r=this.__data__,n=o(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var o=r(13);t.exports=n},function(t,e,r){function n(){this.size=0,this.__data__={hash:new o,map:new(s||i),string:new o}}var o=r(77),i=r(12),s=r(22);t.exports=n},function(t,e,r){function n(t){var e=o(this,t).delete(t);return this.size-=e?1:0,e}var o=r(15);t.exports=n},function(t,e,r){function n(t){return o(this,t).get(t)}var o=r(15);t.exports=n},function(t,e,r){function n(t){return o(this,t).has(t)}var o=r(15);t.exports=n},function(t,e,r){function n(t,e){var r=o(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var o=r(15);t.exports=n},function(t,e){function r(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}t.exports=r},function(t,e,r){function n(t){var e=o(t,function(t){return r.size===i&&r.clear(),t}),r=e.cache;return e}var o=r(186),i=500;t.exports=n},function(t,e,r){var n=r(59),o=n(Object.keys,Object);t.exports=o},function(t,e){function r(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}t.exports=r},function(t,e){function r(t){return o.call(t)}var n=Object.prototype,o=n.toString;t.exports=r},function(t,e){function r(t){return this.__data__.set(t,n),this}var n="__lodash_hash_undefined__";t.exports=r},function(t,e){function r(t){return this.__data__.has(t)}t.exports=r},function(t,e){function r(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}t.exports=r},function(t,e){function r(t){var e=0,r=0;return function(){var s=i(),u=o-(s-r);if(r=s,u>0){if(++e>=n)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var n=800,o=16,i=Date.now;t.exports=r},function(t,e,r){function n(){this.__data__=new o,this.size=0}var o=r(12);t.exports=n},function(t,e){function r(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}t.exports=r},function(t,e){function r(t){return this.__data__.get(t)}t.exports=r},function(t,e){function r(t){return this.__data__.has(t)}t.exports=r},function(t,e,r){function n(t,e){var r=this.__data__;if(r instanceof o){var n=r.__data__;if(!i||n.length<u-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new s(n)}return r.set(t,e),this.size=r.size,this}var o=r(12),i=r(22),s=r(23),u=200;t.exports=n},function(t,e,r){function n(t){return i(t)?s(t):o(t)}var o=r(87),i=r(54),s=r(167);t.exports=n},function(t,e,r){var n=r(152),o=/^\./,i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,s=/\\(\\)?/g,u=n(function(t){var e=[];return o.test(t)&&e.push(""),t.replace(i,function(t,r,n,o){e.push(n?o.replace(s,"$1"):r||t)}),e});t.exports=u},function(t,e){function r(t){return t.match(j)||[]}var n="\\ud800-\\udfff",o="\\u0300-\\u036f",i="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",u=o+i+s,a="\\ufe0e\\ufe0f",c="["+n+"]",f="["+u+"]",p="\\ud83c[\\udffb-\\udfff]",h="(?:"+f+"|"+p+")",l="[^"+n+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",v="[\\ud800-\\udbff][\\udc00-\\udfff]",y="\\u200d",m=h+"?",b="["+a+"]?",x="(?:"+y+"(?:"+[l,d,v].join("|")+")"+b+m+")*",_=b+m+x,g="(?:"+[l+f+"?",f,d,v,c].join("|")+")",j=RegExp(p+"(?="+p+")|"+g+_,"g");t.exports=r},function(t,e){function r(t){return t.match(F)||[]}var n="\\ud800-\\udfff",o="\\u0300-\\u036f",i="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",u=o+i+s,a="\\u2700-\\u27bf",c="a-z\\xdf-\\xf6\\xf8-\\xff",f="\\xac\\xb1\\xd7\\xf7",p="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",h="\\u2000-\\u206f",l=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",d="A-Z\\xc0-\\xd6\\xd8-\\xde",v="\\ufe0e\\ufe0f",y=f+p+h+l,m="['’]",b="["+y+"]",x="["+u+"]",_="\\d+",g="["+a+"]",j="["+c+"]",w="[^"+n+y+_+a+c+d+"]",O="\\ud83c[\\udffb-\\udfff]",A="(?:"+x+"|"+O+")",T="[^"+n+"]",k="(?:\\ud83c[\\udde6-\\uddff]){2}",E="[\\ud800-\\udbff][\\udc00-\\udfff]",R="["+d+"]",q="\\u200d",S="(?:"+j+"|"+w+")",C="(?:"+R+"|"+w+")",U="(?:"+m+"(?:d|ll|m|re|s|t|ve))?",P="(?:"+m+"(?:D|LL|M|RE|S|T|VE))?",D=A+"?",I="["+v+"]?",z="(?:"+q+"(?:"+[T,k,E].join("|")+")"+I+D+")*",N="\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)",H="\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)",L=I+D+z,B="(?:"+[g,k,E].join("|")+")"+L,F=RegExp([R+"?"+j+"+"+U+"(?="+[b,R,"$"].join("|")+")",C+"+"+P+"(?="+[b,R+S,"$"].join("|")+")",R+"?"+S+"+"+U,R+"+"+P,H,N,_,B].join("|"),"g");t.exports=r},function(t,e,r){var n=r(47),o=r(48),i=r(66),s=o(function(t,e){n(e,i(e),t)});t.exports=s},function(t,e,r){var n=r(47),o=r(48),i=r(66),s=o(function(t,e,r,o){n(e,i(e),t,o)});t.exports=s},function(t,e){function r(t){return function(){return t}}t.exports=r},function(t,e,r){function n(t){return t=i(t),t&&t.replace(s,o).replace(h,"")}var o=r(122),i=r(11),s=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,u="\\u0300-\\u036f",a="\\ufe20-\\ufe2f",c="\\u20d0-\\u20ff",f=u+a+c,p="["+f+"]",h=RegExp(p,"g");t.exports=n},function(t,e,r){function n(t,e,r){var n=null==t?0:t.length;return n?(e=r||void 0===e?1:i(e),e=n-e,o(t,0,e<0?0:e)):[]}var o=r(25),i=r(67);t.exports=n},function(t,e,r){t.exports=r(177)},function(t,e,r){t.exports=r(169)},function(t,e,r){function n(t){var e=null==t?0:t.length;return e?o(t,1):[]}var o=r(92);t.exports=n},function(t,e,r){function n(t,e){var r=u(t)?o:i;return r(t,s(e))}var o=r(35),i=r(90),s=r(115),u=r(0);t.exports=n},function(t,e,r){function n(t,e,r){var n=null==t?void 0:o(t,e);return void 0===n?r:n}var o=r(24);t.exports=n},function(t,e,r){function n(t){return t===!0||t===!1||i(t)&&o(t)==s}var o=r(1),i=r(2),s="[object Boolean]";t.exports=n},function(t,e,r){function n(t){return"number"==typeof t||i(t)&&o(t)==s}var o=r(1),i=r(2),s="[object Number]";t.exports=n},function(t,e,r){function n(t){if(!s(t)||o(t)!=u)return!1;var e=i(t);if(null===e)return!0;var r=p.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&f.call(r)==h}var o=r(1),i=r(52),s=r(2),u="[object Object]",a=Function.prototype,c=Object.prototype,f=a.toString,p=c.hasOwnProperty,h=f.call(Object);t.exports=n},function(t,e,r){var n=r(100),o=r(46),i=r(58),s=i&&i.isRegExp,u=s?o(s):n;t.exports=u},function(t,e,r){function n(t){return"string"==typeof t||!i(t)&&s(t)&&o(t)==u}var o=r(1),i=r(0),s=r(2),u="[object String]";t.exports=n},function(t,e){function r(t,e){return null==t?"":o.call(t,e)}var n=Array.prototype,o=n.join;t.exports=r},function(t,e,r){var n=r(120),o=n(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()});t.exports=o},function(t,e,r){function n(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(i);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var s=t.apply(this,n);return r.cache=i.set(o,s)||i,s};return r.cache=new(n.Cache||o),r}var o=r(23),i="Expected a function";n.Cache=o,t.exports=n},function(t,e,r){function n(t,e){return t&&t.length?o(t,i(e,2),s):void 0}var o=r(91),i=r(42),s=r(103);t.exports=n},function(t,e,r){var n=r(106),o=r(125),i=o(function(t,e){return null==t?{}:n(t,e)});t.exports=i},function(t,e,r){function n(t){return s(t)?o(u(t)):i(t)}var o=r(108),i=r(109),s=r(26),u=r(7);t.exports=n},function(t,e,r){function n(t,e,r){return r&&"number"!=typeof r&&u(t,e,r)&&(e=r=void 0),(r=void 0===r?p:r>>>0)?(t=f(t),t&&("string"==typeof e||null!=e&&!a(e))&&(e=o(e),!e&&s(t))?i(c(t),0,r):t.split(e,r)):[]}var o=r(45),i=r(116),s=r(54),u=r(55),a=r(182),c=r(165),f=r(11),p=4294967295;t.exports=n},function(t,e){function r(){return[]}t.exports=r},function(t,e){function r(){return!1}t.exports=r},function(t,e,r){function n(t,e,r){var n=null==t?0:t.length;return n?(e=r||void 0===e?1:i(e),e=n-e,o(t,e<0?0:e,n)):[]}var o=r(25),i=r(67);t.exports=n},function(t,e,r){function n(t){if(!t)return 0===t?t:0;if(t=o(t),t===i||t===-i){var e=t<0?-1:1;return e*s}return t===t?t:0}var o=r(196),i=1/0,s=1.7976931348623157e308;t.exports=n},function(t,e,r){function n(t){return o(t).toLowerCase()}var o=r(11);t.exports=n},function(t,e,r){function n(t){if("number"==typeof t)return t;if(i(t))return s;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(u,"");var r=c.test(t);return r||f.test(t)?p(t.slice(2),r?2:8):a.test(t)?s:+t}var o=r(4),i=r(10),s=NaN,u=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,f=/^0o[0-7]+$/i,p=parseInt;t.exports=n},function(t,e,r){function n(t,e,r){var n=c(t),d=n||f(t)||l(t);if(e=u(e,4),null==r){var v=t&&t.constructor;r=d?n?new v:[]:h(t)&&p(v)?i(a(t)):{}}return(d?o:s)(t,function(t,n,o){return e(r,t,n,o)}),r}var o=r(35),i=r(89),s=r(40),u=r(42),a=r(52),c=r(0),f=r(20),p=r(28),h=r(4),l=r(21);t.exports=n},function(t,e,r){function n(t,e,r){return t=s(t),e=r?void 0:e,void 0===e?i(t)?u(t):o(t):t.match(e)||[]}var o=r(88),i=r(132),s=r(11),u=r(168);t.exports=n},function(t,e,r){(function(t,n){var o;!function(i){function s(t){throw RangeError(C[t])}function u(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function a(t,e){var r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(S,".");var o=t.split("."),i=u(o,e).join(".");return n+i}function c(t){for(var e,r,n=[],o=0,i=t.length;o<i;)e=t.charCodeAt(o++),e>=55296&&e<=56319&&o<i?(r=t.charCodeAt(o++),56320==(64512&r)?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),o--)):n.push(e);return n}function f(t){return u(t,function(t){var e="";return t>65535&&(t-=65536,e+=D(t>>>10&1023|55296),t=56320|1023&t),e+=D(t)}).join("")}function p(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:g}function h(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function l(t,e,r){var n=0;for(t=r?P(t/A):t>>1,t+=P(t/e);t>U*w>>1;n+=g)t=P(t/U);return P(n+(U+1)*t/(t+O))}function d(t){var e,r,n,o,i,u,a,c,h,d,v=[],y=t.length,m=0,b=k,x=T;for(r=t.lastIndexOf(E),r<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&s("not-basic"),v.push(t.charCodeAt(n));for(o=r>0?r+1:0;o<y;){for(i=m,u=1,a=g;o>=y&&s("invalid-input"),c=p(t.charCodeAt(o++)),(c>=g||c>P((_-m)/u))&&s("overflow"),m+=c*u,h=a<=x?j:a>=x+w?w:a-x,!(c<h);a+=g)d=g-h,u>P(_/d)&&s("overflow"),u*=d;e=v.length+1,x=l(m-i,e,0==i),P(m/e)>_-b&&s("overflow"),b+=P(m/e),m%=e,v.splice(m++,0,b)}return f(v)}function v(t){var e,r,n,o,i,u,a,f,p,d,v,y,m,b,x,O=[];for(t=c(t),y=t.length,e=k,r=0,i=T,u=0;u<y;++u)v=t[u],v<128&&O.push(D(v));for(n=o=O.length,o&&O.push(E);n<y;){for(a=_,u=0;u<y;++u)v=t[u],v>=e&&v<a&&(a=v);for(m=n+1,a-e>P((_-r)/m)&&s("overflow"),r+=(a-e)*m,e=a,u=0;u<y;++u)if(v=t[u],v<e&&++r>_&&s("overflow"),v==e){for(f=r,