UNPKG

406 kBJavaScriptView Raw
1!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.AV=e():t.AV=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=272)}([function(t,e,n){"use strict";var r=n(7),i=n(73),o=n(4),a=n(8),s=n(60).f,u=n(153),c=n(6),f=n(48),l=n(37),h=n(12),d=function(t){var e=function(n,r,o){if(this instanceof e){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,r)}return new t(n,r,o)}return i(t,this,arguments)};return e.prototype=t.prototype,e};t.exports=function(t,e){var n,i,p,v,g,m,y,b,_,w=t.target,E=t.global,O=t.stat,T=t.proto,S=E?r:O?r[w]:(r[w]||{}).prototype,A=E?c:c[w]||l(c,w,{})[w],x=A.prototype;for(v in e)n=u(E?v:w+(O?".":"#")+v,t.forced),i=!n&&S&&h(S,v),m=A[v],i&&(t.dontCallGetSet?(_=s(S,v),y=_&&_.value):y=S[v]),g=i&&y?y:e[v],i&&typeof m==typeof g||(b=t.bind&&i?f(g,r):t.wrap&&i?d(g):T&&a(g)?o(g):g,(t.sham||g&&g.sham||m&&m.sham)&&l(b,"sham",!0),l(A,v,b),T&&(p=w+"Prototype",h(c,p)||l(c,p,{}),l(c[p],v,g),t.real&&x&&!x[v]&&l(x,v,g)))}},function(t,e){function n(t){return t&&t.__esModule?t:{default:t}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(312);n.d(e,"default",function(){return r.a});var i=n(131);n.d(e,"VERSION",function(){return i.VERSION}),n.d(e,"restArguments",function(){return i.restArguments}),n.d(e,"isObject",function(){return i.isObject}),n.d(e,"isNull",function(){return i.isNull}),n.d(e,"isUndefined",function(){return i.isUndefined}),n.d(e,"isBoolean",function(){return i.isBoolean}),n.d(e,"isElement",function(){return i.isElement}),n.d(e,"isString",function(){return i.isString}),n.d(e,"isNumber",function(){return i.isNumber}),n.d(e,"isDate",function(){return i.isDate}),n.d(e,"isRegExp",function(){return i.isRegExp}),n.d(e,"isError",function(){return i.isError}),n.d(e,"isSymbol",function(){return i.isSymbol}),n.d(e,"isArrayBuffer",function(){return i.isArrayBuffer}),n.d(e,"isDataView",function(){return i.isDataView}),n.d(e,"isArray",function(){return i.isArray}),n.d(e,"isFunction",function(){return i.isFunction}),n.d(e,"isArguments",function(){return i.isArguments}),n.d(e,"isFinite",function(){return i.isFinite}),n.d(e,"isNaN",function(){return i.isNaN}),n.d(e,"isTypedArray",function(){return i.isTypedArray}),n.d(e,"isEmpty",function(){return i.isEmpty}),n.d(e,"isMatch",function(){return i.isMatch}),n.d(e,"isEqual",function(){return i.isEqual}),n.d(e,"isMap",function(){return i.isMap}),n.d(e,"isWeakMap",function(){return i.isWeakMap}),n.d(e,"isSet",function(){return i.isSet}),n.d(e,"isWeakSet",function(){return i.isWeakSet}),n.d(e,"keys",function(){return i.keys}),n.d(e,"allKeys",function(){return i.allKeys}),n.d(e,"values",function(){return i.values}),n.d(e,"pairs",function(){return i.pairs}),n.d(e,"invert",function(){return i.invert}),n.d(e,"functions",function(){return i.functions}),n.d(e,"methods",function(){return i.methods}),n.d(e,"extend",function(){return i.extend}),n.d(e,"extendOwn",function(){return i.extendOwn}),n.d(e,"assign",function(){return i.assign}),n.d(e,"defaults",function(){return i.defaults}),n.d(e,"create",function(){return i.create}),n.d(e,"clone",function(){return i.clone}),n.d(e,"tap",function(){return i.tap}),n.d(e,"get",function(){return i.get}),n.d(e,"has",function(){return i.has}),n.d(e,"mapObject",function(){return i.mapObject}),n.d(e,"identity",function(){return i.identity}),n.d(e,"constant",function(){return i.constant}),n.d(e,"noop",function(){return i.noop}),n.d(e,"toPath",function(){return i.toPath}),n.d(e,"property",function(){return i.property}),n.d(e,"propertyOf",function(){return i.propertyOf}),n.d(e,"matcher",function(){return i.matcher}),n.d(e,"matches",function(){return i.matches}),n.d(e,"times",function(){return i.times}),n.d(e,"random",function(){return i.random}),n.d(e,"now",function(){return i.now}),n.d(e,"escape",function(){return i.escape}),n.d(e,"unescape",function(){return i.unescape}),n.d(e,"templateSettings",function(){return i.templateSettings}),n.d(e,"template",function(){return i.template}),n.d(e,"result",function(){return i.result}),n.d(e,"uniqueId",function(){return i.uniqueId}),n.d(e,"chain",function(){return i.chain}),n.d(e,"iteratee",function(){return i.iteratee}),n.d(e,"partial",function(){return i.partial}),n.d(e,"bind",function(){return i.bind}),n.d(e,"bindAll",function(){return i.bindAll}),n.d(e,"memoize",function(){return i.memoize}),n.d(e,"delay",function(){return i.delay}),n.d(e,"defer",function(){return i.defer}),n.d(e,"throttle",function(){return i.throttle}),n.d(e,"debounce",function(){return i.debounce}),n.d(e,"wrap",function(){return i.wrap}),n.d(e,"negate",function(){return i.negate}),n.d(e,"compose",function(){return i.compose}),n.d(e,"after",function(){return i.after}),n.d(e,"before",function(){return i.before}),n.d(e,"once",function(){return i.once}),n.d(e,"findKey",function(){return i.findKey}),n.d(e,"findIndex",function(){return i.findIndex}),n.d(e,"findLastIndex",function(){return i.findLastIndex}),n.d(e,"sortedIndex",function(){return i.sortedIndex}),n.d(e,"indexOf",function(){return i.indexOf}),n.d(e,"lastIndexOf",function(){return i.lastIndexOf}),n.d(e,"find",function(){return i.find}),n.d(e,"detect",function(){return i.detect}),n.d(e,"findWhere",function(){return i.findWhere}),n.d(e,"each",function(){return i.each}),n.d(e,"forEach",function(){return i.forEach}),n.d(e,"map",function(){return i.map}),n.d(e,"collect",function(){return i.collect}),n.d(e,"reduce",function(){return i.reduce}),n.d(e,"foldl",function(){return i.foldl}),n.d(e,"inject",function(){return i.inject}),n.d(e,"reduceRight",function(){return i.reduceRight}),n.d(e,"foldr",function(){return i.foldr}),n.d(e,"filter",function(){return i.filter}),n.d(e,"select",function(){return i.select}),n.d(e,"reject",function(){return i.reject}),n.d(e,"every",function(){return i.every}),n.d(e,"all",function(){return i.all}),n.d(e,"some",function(){return i.some}),n.d(e,"any",function(){return i.any}),n.d(e,"contains",function(){return i.contains}),n.d(e,"includes",function(){return i.includes}),n.d(e,"include",function(){return i.include}),n.d(e,"invoke",function(){return i.invoke}),n.d(e,"pluck",function(){return i.pluck}),n.d(e,"where",function(){return i.where}),n.d(e,"max",function(){return i.max}),n.d(e,"min",function(){return i.min}),n.d(e,"shuffle",function(){return i.shuffle}),n.d(e,"sample",function(){return i.sample}),n.d(e,"sortBy",function(){return i.sortBy}),n.d(e,"groupBy",function(){return i.groupBy}),n.d(e,"indexBy",function(){return i.indexBy}),n.d(e,"countBy",function(){return i.countBy}),n.d(e,"partition",function(){return i.partition}),n.d(e,"toArray",function(){return i.toArray}),n.d(e,"size",function(){return i.size}),n.d(e,"pick",function(){return i.pick}),n.d(e,"omit",function(){return i.omit}),n.d(e,"first",function(){return i.first}),n.d(e,"head",function(){return i.head}),n.d(e,"take",function(){return i.take}),n.d(e,"initial",function(){return i.initial}),n.d(e,"last",function(){return i.last}),n.d(e,"rest",function(){return i.rest}),n.d(e,"tail",function(){return i.tail}),n.d(e,"drop",function(){return i.drop}),n.d(e,"compact",function(){return i.compact}),n.d(e,"flatten",function(){return i.flatten}),n.d(e,"without",function(){return i.without}),n.d(e,"uniq",function(){return i.uniq}),n.d(e,"unique",function(){return i.unique}),n.d(e,"union",function(){return i.union}),n.d(e,"intersection",function(){return i.intersection}),n.d(e,"difference",function(){return i.difference}),n.d(e,"unzip",function(){return i.unzip}),n.d(e,"transpose",function(){return i.transpose}),n.d(e,"zip",function(){return i.zip}),n.d(e,"object",function(){return i.object}),n.d(e,"range",function(){return i.range}),n.d(e,"chunk",function(){return i.chunk}),n.d(e,"mixin",function(){return i.mixin})},function(t,e,n){var r=n(74),i=Function.prototype,o=i.bind,a=i.call,s=r&&o.bind(a,a);t.exports=r?function(t){return t&&s(t)}:function(t){return t&&function(){return a.apply(t,arguments)}}},function(t,e,n){"use strict";(function(t){n.d(e,"e",function(){return r}),n.d(e,"p",function(){return i}),n.d(e,"a",function(){return o}),n.d(e,"c",function(){return a}),n.d(e,"d",function(){return s}),n.d(e,"o",function(){return u}),n.d(e,"q",function(){return c}),n.d(e,"t",function(){return f}),n.d(e,"i",function(){return l}),n.d(e,"r",function(){return h}),n.d(e,"s",function(){return d}),n.d(e,"k",function(){return p}),n.d(e,"m",function(){return v}),n.d(e,"j",function(){return g}),n.d(e,"l",function(){return m}),n.d(e,"g",function(){return y}),n.d(e,"f",function(){return b}),n.d(e,"h",function(){return _}),n.d(e,"n",function(){return w}),n.d(e,"b",function(){return E});var r="1.12.1",i="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t||Function("return this")()||{},o=Array.prototype,a=Object.prototype,s="undefined"!=typeof Symbol?Symbol.prototype:null,u=o.push,c=o.slice,f=a.toString,l=a.hasOwnProperty,h="undefined"!=typeof ArrayBuffer,d="undefined"!=typeof DataView,p=Array.isArray,v=Object.keys,g=Object.create,m=h&&ArrayBuffer.isView,y=isNaN,b=isFinite,_=!{toString:null}.propertyIsEnumerable("toString"),w=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],E=Math.pow(2,53)-1}).call(e,n(72))},function(t,e){t.exports={}},function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(e,n(72))},function(t,e){t.exports=function(t){return"function"==typeof t}},function(t,e,n){var r=n(7),i=n(77),o=n(12),a=n(98),s=n(62),u=n(151),c=i("wks"),f=r.Symbol,l=f&&f.for,h=u?f:f&&f.withoutSetter||a;t.exports=function(t){if(!o(c,t)||!s&&"string"!=typeof c[t]){var e="Symbol."+t;s&&o(f,t)?c[t]=f[t]:c[t]=u&&l?l(e):h(e)}return c[t]}},function(t,e,n){var r=n(6),i=n(12),o=n(147),a=n(23).f;t.exports=function(t){var e=r.Symbol||(r.Symbol={});i(e,t)||a(e,t,{value:o.f(t)})}},function(t,e,n){var r=n(8);t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},function(t,e,n){var r=n(4),i=n(34),o=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return o(i(t),e)}},function(t,e,n){t.exports=n(275)},function(t,e,n){var r=n(2);t.exports=!r(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},function(t,e,n){var r=n(74),i=Function.prototype.call;t.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},function(t,e,n){"use strict";function r(t){if(!Object(i.a)(t))return[];if(o.m)return Object(o.m)(t);var e=[];for(var n in t)Object(a.a)(t,n)&&e.push(n);return o.h&&Object(s.a)(t,e),e}e.a=r;var i=n(54),o=n(5),a=n(45),s=n(184)},function(t,e,n){"use strict";function r(t){var e="[object "+t+"]";return function(t){return i.t.call(t)===e}}e.a=r;var i=n(5)},function(t,e,n){var r=n(6),i=n(7),o=n(8),a=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?a(r[t])||a(i[t]):r[t]&&r[t][e]||i[t]&&i[t][e]}},function(t,e,n){var r=n(4);t.exports=r({}.isPrototypeOf)},function(t,e,n){var r=n(11),i=String,o=TypeError;t.exports=function(t){if(r(t))return t;throw o(i(t)+" is not an object")}},function(t,e,n){"use strict";function r(t,e,n){return i.a.iteratee!==a.a?i.a.iteratee(t,e):Object(o.a)(t,e,n)}e.a=r;var i=n(25),o=n(194),a=n(195)},function(t,e,n){t.exports=n(384)},function(t,e,n){var r=n(14),i=n(152),o=n(154),a=n(20),s=n(95),u=TypeError,c=Object.defineProperty,f=Object.getOwnPropertyDescriptor;e.f=r?o?function(t,e,n){if(a(t),e=s(e),a(n),"function"==typeof t&&"prototype"===e&&"value"in n&&"writable"in n&&!n.writable){var r=f(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:"configurable"in n?n.configurable:r.configurable,enumerable:"enumerable"in n?n.enumerable:r.enumerable,writable:!1})}return c(t,e,n)}:c:function(t,e,n){if(a(t),e=s(e),a(n),i)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw u("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){"use strict";function r(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+e];switch(e){case 0:return t.call(this,r);case 1:return t.call(this,arguments[0],r);case 2:return t.call(this,arguments[0],arguments[1],r)}var o=Array(e+1);for(i=0;i<e;i++)o[i]=arguments[i];return o[e]=r,t.apply(this,o)}}e.a=r},function(t,e,n){"use strict";function r(t){return t instanceof r?t:this instanceof r?void(this._wrapped=t):new r(t)}e.a=r;var i=n(5);r.VERSION=i.e,r.prototype.value=function(){return this._wrapped},r.prototype.valueOf=r.prototype.toJSON=r.prototype.value,r.prototype.toString=function(){return String(this._wrapped)}},function(t,e,n){"use strict";var r=n(182),i=n(29);e.a=Object(r.a)(i.a)},function(t,e,n){"use strict";var r=n(1),i=r(n(22)),o=r(n(13)),a=n(3),s=n(522),u=n(3),c=u.extend,f=n(69),l=n(46),h=n(30),d=h.getSessionToken,p=n(115),v=function(t,e){var n,r=(new Date).getTime(),o=s(r+t);if(e){var a;return(0,i.default)(a="".concat(o,",")).call(a,r,",master")}return(0,i.default)(n="".concat(o,",")).call(n,r)},g=function(t,e){e?t["X-LC-Sign"]=v(f.applicationKey):t["X-LC-Key"]=f.applicationKey},m=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n={"X-LC-Id":f.applicationId,"Content-Type":"application/json;charset=UTF-8"},r=!1;return"boolean"==typeof t.useMasterKey?r=t.useMasterKey:"boolean"==typeof f._config.useMasterKey&&(r=f._config.useMasterKey),r?f.masterKey?e?n["X-LC-Sign"]=v(f.masterKey,!0):n["X-LC-Key"]="".concat(f.masterKey,",master"):(console.warn("masterKey is not set, fall back to use appKey"),g(n,e)):g(n,e),f.hookKey&&(n["X-LC-Hook-Key"]=f.hookKey),null!==f._config.production&&(n["X-LC-Prod"]=String(f._config.production)),n["X-LC-UA"]=f._sharedConfig.userAgent,o.default.resolve().then(function(){var e=d(t);if(e)n["X-LC-Session"]=e;else if(!f._config.disableCurrentUser)return f.User.currentAsync().then(function(t){return t&&t._sessionToken&&(n["X-LC-Session"]=t._sessionToken),n});return n})},y=function(t){var e=t.service,n=void 0===e?"api":e,r=t.version,i=void 0===r?"1.1":r,o=t.path,a=f._config.serverURLs[n];if(!a)throw new Error("undefined server URL for ".concat(n));return"/"!==a.charAt(a.length-1)&&(a+="/"),a+=i,o&&(a+=o),a},b=function(t){var e=t.service,n=t.version,r=t.method,o=t.path,s=t.query,u=t.data,c=t.authOptions,h=t.signKey,d=void 0===h||h;if(!f.applicationId||!f.applicationKey&&!f.masterKey)throw new Error("Not initialized");f._appRouter&&f._appRouter.refresh();var v=f._config.requestTimeout,g=y({service:e,path:o,version:n});return m(c,d).then(function(t){return p({method:r,url:g,query:s,data:u,headers:t,timeout:v}).catch(function(t){var e={code:t.code||-1,error:t.message||t.responseText};if(t.response&&t.response.code)e=t.response;else if(t.responseText)try{e=JSON.parse(t.responseText)}catch(t){}if(e.rawMessage=e.rawMessage||e.error,!f._sharedConfig.keepErrorRawMessage){var n,o;e.error+=(0,i.default)(n=(0,i.default)(o=" [".concat(t.statusCode||"N/A"," ")).call(o,r," ")).call(n,g,"]")}var s=new l(e.code,e.error);throw delete e.error,a.extend(s,e)})})},_=function(t,e,n,r,i,o,a){var s="";if(t&&(s+="/".concat(t)),e&&(s+="/".concat(e)),n&&(s+="/".concat(n)),i&&i._fetchWhenSave)throw new Error("_fetchWhenSave should be in the query");if(i&&i._where)throw new Error("_where should be in the query");return r&&"get"===r.toLowerCase()&&(a=c({},a,i),i=null),b({method:r,path:s,query:a,data:i,authOptions:o})};f.request=b,t.exports={_request:_,request:b}},function(t,e,n){"use strict";var r=n(17),i=n(5),o=Object(r.a)("Function"),a=i.p.document&&i.p.document.childNodes;"function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof a&&(o=function(t){return"function"==typeof t||!1}),e.a=o},function(t,e,n){"use strict";var r=n(183);e.a=Object(r.a)("length")},function(t,e,n){"use strict";var r=n(1),i=r(n(57)),o=r(n(227)),a=r(n(13)),s=n(3),u=function(t){return s.isNull(t)||s.isUndefined(t)},c=function(t){return s.isArray(t)?t:void 0===t||null===t?[]:[t]},f=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(0,i.default)(t),n=t.include,r=t.includeACL,o={};return e&&(o.keys=c(e).join(",")),n&&(o.include=c(n).join(",")),r&&(o.returnACL=r),o},l=function(t){return t.sessionToken?t.sessionToken:t.user&&"function"==typeof t.user.getSessionToken?t.user.getSessionToken():void 0},h=function(t){return function(e){return t(e),e}},d=function(){},p=function(t,e,n){var r;return r=e&&e.hasOwnProperty("constructor")?e.constructor:function(){t.apply(this,arguments)},s.extend(r,t),d.prototype=t.prototype,r.prototype=new d,e&&s.extend(r.prototype,e),n&&s.extend(r,n),r.prototype.constructor=r,r.__super__=t.prototype,r},v="undefined"==typeof wx?function(t){return new Date(t)}:function(t){return new Date(Date.parse(t))},g=function(t,e,n){var r=e.split("."),i=r.pop(),o=t;return r.forEach(function(t){void 0===o[t]&&(o[t]={}),o=o[t]}),o[i]=n,t},m=function(t,e){for(var n=e.split("."),r=n[0],i=n.pop(),o=t,a=0;a<n.length;a++)if(void 0===(o=o[n[a]]))return[void 0,void 0,i];return[o[i],o,i,r]},y=function(t){return s.isObject(t)&&(0,o.default)(t)===Object.prototype},b=function t(e,n){return e()?n().then(function(){return t(e,n)}):a.default.resolve()};t.exports={isNullOrUndefined:u,ensureArray:c,transformFetchOptions:f,getSessionToken:l,tap:h,inherits:p,parseDate:v,setValue:g,findValue:m,isPlainObject:y,continueWhile:b}},function(t,e,n){var r=n(8),i=n(76),o=TypeError;t.exports=function(t){if(r(t))return t;throw o(i(t)+" is not a function")}},function(t,e,n){var r=n(94),i=n(120);t.exports=function(t){return r(i(t))}},function(t,e){t.exports=!0},function(t,e,n){var r=n(120),i=Object;t.exports=function(t){return i(r(t))}},function(t,e,n){t.exports=n(389)},function(t,e,n){t.exports=n(396)},function(t,e,n){var r=n(14),i=n(23),o=n(47);t.exports=r?function(t,e,n){return i.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(6);t.exports=function(t){return r[t+"Prototype"]}},function(t,e,n){var r=n(285);t.exports=function(t){return r(t.length)}},function(t,e,n){var r=n(48),i=n(15),o=n(20),a=n(76),s=n(160),u=n(39),c=n(19),f=n(161),l=n(105),h=n(162),d=TypeError,p=function(t,e){this.stopped=t,this.result=e},v=p.prototype;t.exports=function(t,e,n){var g,m,y,b,_,w,E,O=n&&n.that,T=!(!n||!n.AS_ENTRIES),S=!(!n||!n.IS_ITERATOR),A=!(!n||!n.INTERRUPTED),x=r(e,O),I=function(t){return g&&h(g,"normal",t),new p(!0,t)},j=function(t){return T?(o(t),A?x(t[0],t[1],I):x(t[0],t[1])):A?x(t,I):x(t)};if(S)g=t;else{if(!(m=l(t)))throw d(a(t)+" is not iterable");if(s(m)){for(y=0,b=u(t);b>y;y++)if((_=j(t[y]))&&c(v,_))return _;return new p(!1)}g=f(t,m)}for(w=g.next;!(E=i(w,g)).done;){try{_=j(E.value)}catch(t){h(g,"throw",t)}if("object"==typeof _&&_&&c(v,_))return _}return new p(!1)}},function(t,e,n){"use strict";var r=n(32),i=n(163),o=n(50),a=n(42),s=n(23).f,u=n(130),c=n(33),f=n(14),l=a.set,h=a.getterFor("Array Iterator");t.exports=u(Array,"Array",function(t,e){l(this,{type:"Array Iterator",target:r(t),index:0,kind:e})},function(){var t=h(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}},"values");var d=o.Arguments=o.Array;if(i("keys"),i("values"),i("entries"),!c&&f&&"values"!==d.name)try{s(d,"name",{value:"values"})}catch(t){}},function(t,e,n){var r,i,o,a=n(164),s=n(7),u=n(4),c=n(11),f=n(37),l=n(12),h=n(122),d=n(100),p=n(78),v=s.TypeError,g=s.WeakMap,m=function(t){return o(t)?i(t):r(t,{})},y=function(t){return function(e){var n;if(!c(e)||(n=i(e)).type!==t)throw v("Incompatible receiver, "+t+" required");return n}};if(a||h.state){var b=h.state||(h.state=new g),_=u(b.get),w=u(b.has),E=u(b.set);r=function(t,e){if(w(b,t))throw new v("Object already initialized");return e.facade=t,E(b,t,e),e},i=function(t){return _(b,t)||{}},o=function(t){return w(b,t)}}else{var O=d("state");p[O]=!0,r=function(t,e){if(l(t,O))throw new v("Object already initialized");return e.facade=t,f(t,O,e),e},i=function(t){return l(t,O)?t[O]:{}},o=function(t){return l(t,O)}}t.exports={set:r,get:i,has:o,enforce:m,getterFor:y}},function(t,e,n){var r=n(37);t.exports=function(t,e,n,i){return i&&i.enumerable?t[e]=n:r(t,e,n),t}},function(t,e,n){n(41);var r=n(311),i=n(7),o=n(51),a=n(37),s=n(50),u=n(9),c=u("toStringTag");for(var f in r){var l=i[f],h=l&&l.prototype;h&&o(h)!==c&&a(h,c,f),s[f]=s.Array}},function(t,e,n){"use strict";function r(t,e){return null!=t&&i.i.call(t,e)}e.a=r;var i=n(5)},function(t,e,n){"use strict";function r(t,e){if(this instanceof r?this.constructor:void 0){var n=new Error(e);return(0,o.default)(n,(0,a.default)(this)),n.code=t,n}return new r(t,e)}var i=n(1),o=i(n(411)),a=i(n(227)),s=n(3);r.prototype=Object.create(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),(0,o.default)(r,Error),s.extend(r,{OTHER_CAUSE:-1,INTERNAL_SERVER_ERROR:1,CONNECTION_FAILED:100,OBJECT_NOT_FOUND:101,INVALID_QUERY:102,INVALID_CLASS_NAME:103,MISSING_OBJECT_ID:104,INVALID_KEY_NAME:105,INVALID_POINTER:106,INVALID_JSON:107,COMMAND_UNAVAILABLE:108,NOT_INITIALIZED:109,INCORRECT_TYPE:111,INVALID_CHANNEL_NAME:112,PUSH_MISCONFIGURED:115,OBJECT_TOO_LARGE:116,OPERATION_FORBIDDEN:119,CACHE_MISS:120,INVALID_NESTED_KEY:121,INVALID_FILE_NAME:122,INVALID_ACL:123,TIMEOUT:124,INVALID_EMAIL_ADDRESS:125,MISSING_CONTENT_TYPE:126,MISSING_CONTENT_LENGTH:127,INVALID_CONTENT_LENGTH:128,FILE_TOO_LARGE:129,FILE_SAVE_ERROR:130,FILE_DELETE_ERROR:153,DUPLICATE_VALUE:137,INVALID_ROLE_NAME:139,EXCEEDED_QUOTA:140,SCRIPT_FAILED:141,VALIDATION_ERROR:142,INVALID_IMAGE_DATA:150,UNSAVED_FILE_ERROR:151,INVALID_PUSH_TIME_ERROR:152,USERNAME_MISSING:200,PASSWORD_MISSING:201,USERNAME_TAKEN:202,EMAIL_TAKEN:203,EMAIL_MISSING:204,EMAIL_NOT_FOUND:205,SESSION_MISSING:206,MUST_CREATE_USER_THROUGH_SIGNUP:207,ACCOUNT_ALREADY_LINKED:208,LINKED_ID_MISSING:250,INVALID_LINKED_SESSION:251,UNSUPPORTED_SERVICE:252,X_DOMAIN_REQUEST:602}),t.exports=r},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(4),i=n(31),o=n(74),a=r(r.bind);t.exports=function(t,e){return i(t),void 0===e?t:o?a(t,e):function(){return t.apply(e,arguments)}}},function(t,e,n){var r,i=n(20),o=n(127),a=n(126),s=n(78),u=n(159),c=n(123),f=n(100),l=f("IE_PROTO"),h=function(){},d=function(t){return"<script>"+t+"<\/script>"},p=function(t){t.write(d("")),t.close();var e=t.parentWindow.Object;return t=null,e},v=function(){var t,e=c("iframe");return e.style.display="none",u.appendChild(e),e.src=String("javascript:"),t=e.contentWindow.document,t.open(),t.write(d("document.F=Object")),t.close(),t.F},g=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}g="undefined"!=typeof document?document.domain&&r?p(r):v():p(r);for(var t=a.length;t--;)delete g.prototype[a[t]];return g()};s[l]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(h.prototype=i(t),n=new h,h.prototype=null,n[l]=t):n=g(),void 0===e?n:o.f(n,e)}},function(t,e){t.exports={}},function(t,e,n){var r=n(128),i=n(8),o=n(61),a=n(9),s=a("toStringTag"),u=Object,c="Arguments"==o(function(){return arguments}()),f=function(t,e){try{return t[e]}catch(t){}};t.exports=r?o:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=f(e=u(t),s))?n:c?o(e):"Object"==(r=o(e))&&i(e.callee)?"Arguments":r}},function(t,e,n){var r=n(128),i=n(23).f,o=n(37),a=n(12),s=n(292),u=n(9),c=u("toStringTag");t.exports=function(t,e,n,u){if(t){var f=n?t:t.prototype;a(f,c)||i(f,c,{configurable:!0,value:e}),u&&!r&&o(f,"toString",s)}}},function(t,e,n){"use strict";var r=n(31),i=function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r}),this.resolve=r(e),this.reject=r(n)};t.exports.f=function(t){return new i(t)}},function(t,e,n){"use strict";function r(t){var e=typeof t;return"function"===e||"object"===e&&!!t}e.a=r},function(t,e,n){"use strict";var r=n(5),i=n(17);e.a=r.k||Object(i.a)("Array")},function(t,e,n){"use strict";function r(t,e,n){e=Object(i.a)(e,n);var r,s;if(Object(o.a)(t))for(r=0,s=t.length;r<s;r++)e(t[r],r,t);else{var u=Object(a.a)(t);for(r=0,s=u.length;r<s;r++)e(t[u[r]],u[r],t)}return t}e.a=r;var i=n(85),o=n(26),a=n(16)},function(t,e,n){t.exports=n(402)},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function o(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),this.useColors){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(t){"%%"!==t&&(r++,"%c"===t&&(i=r))}),e.splice(i,0,n)}}function a(){var t;return"object"===("undefined"==typeof console?"undefined":r(console))&&console.log&&(t=console).log.apply(t,arguments)}function s(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}}function u(){var t;try{t=e.storage.getItem("debug")}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t}e.log=a,e.formatArgs=o,e.save=s,e.load=u,e.useColors=i,e.storage=function(){try{return localStorage}catch(t){}}(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.exports=n(407)(e),t.exports.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},function(t,e,n){t.exports=n(234)},function(t,e,n){var r=n(14),i=n(15),o=n(119),a=n(47),s=n(32),u=n(95),c=n(12),f=n(152),l=Object.getOwnPropertyDescriptor;e.f=r?l:function(t,e){if(t=s(t),e=u(e),f)try{return l(t,e)}catch(t){}if(c(t,e))return a(!i(o.f,t,e),t[e])}},function(t,e,n){var r=n(4),i=r({}.toString),o=r("".slice);t.exports=function(t){return o(i(t),8,-1)}},function(t,e,n){var r=n(75),i=n(2);t.exports=!!Object.getOwnPropertySymbols&&!i(function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41})},function(t,e){},function(t,e,n){var r=n(7);t.exports=r.Promise},function(t,e,n){"use strict";var r=n(310).charAt,i=n(79),o=n(42),a=n(130),s=o.set,u=o.getterFor("String Iterator");a(String,"String",function(t){s(this,{type:"String Iterator",string:i(t),index:0})},function(){var t,e=u(this),n=e.string,i=e.index;return i>=n.length?{value:void 0,done:!0}:(t=r(n,i),e.index+=t.length,{value:t,done:!1})})},function(t,e,n){"use strict";function r(t){for(var e=Object(i.a)(t),n=e.length,r=Array(n),o=0;o<n;o++)r[o]=t[e[o]];return r}e.a=r;var i=n(16)},function(t,e,n){"use strict";function r(t,e,n,u){if(u=u||[],e||0===e){if(e<=0)return u.concat(t)}else e=1/0;for(var c=u.length,f=0,l=Object(i.a)(t);f<l;f++){var h=t[f];if(Object(o.a)(h)&&(Object(a.a)(h)||Object(s.a)(h)))if(e>1)r(h,e-1,n,u),c=u.length;else for(var d=0,p=h.length;d<p;)u[c++]=h[d++];else n||(u[c++]=h)}return u}e.a=r;var i=n(29),o=n(26),a=n(55),s=n(134)},function(t,e,n){"use strict";function r(t,e,n){e=Object(i.a)(e,n);for(var r=!Object(o.a)(t)&&Object(a.a)(t),s=(r||t).length,u=Array(s),c=0;c<s;c++){var f=r?r[c]:c;u[c]=e(t[f],f,t)}return u}e.a=r;var i=n(21),o=n(26),a=n(16)},function(t,e,n){"use strict";(function(e){var r=n(1),i=r(n(13)),o=r(n(22)),a=r(n(35)),s=r(n(146)),u=r(n(36)),c=r(n(90)),f=r(n(57)),l=n(3),h=n(226),d=n(58),p=n(30),v=p.inherits,g=p.parseDate,m=n(229),y=n(71),b=y.setAdapters,_=y.adapterManager,w=e.AV||{};w._config={serverURLs:{},useMasterKey:!1,production:null,realtime:null,requestTimeout:null};var E="LeanCloud-JS-SDK/".concat(m);w._sharedConfig={userAgent:E,liveQueryRealtime:null},_.on("platformInfo",function(t){var e=E;if(t)if(t.userAgent)e=t.userAgent;else{var n=t.name;t.version&&(n+="/".concat(t.version)),t.extra&&(n+="; ".concat(t.extra)),e+=" (".concat(n,")")}w._sharedConfig.userAgent=e}),w._getAVPath=function(t){if(!w.applicationId)throw new Error("You need to call AV.initialize before using AV.");if(t||(t=""),!l.isString(t))throw new Error("Tried to get a localStorage path that wasn't a String.");return"/"===t[0]&&(t=t.substring(1)),"AV/"+w.applicationId+"/"+t},w._installationId=null,w._getInstallationId=function(){if(w._installationId)return i.default.resolve(w._installationId);var t=w._getAVPath("installationId");return w.localStorage.getItemAsync(t).then(function(e){return w._installationId=e,w._installationId?e:(w._installationId=e=h(),w.localStorage.setItemAsync(t,e).then(function(){return e}))})},w._subscriptionId=null,w._refreshSubscriptionId=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w._getAVPath("subscriptionId"),e=w._subscriptionId=h();return w.localStorage.setItemAsync(t,e).then(function(){return e})},w._getSubscriptionId=function(){if(w._subscriptionId)return i.default.resolve(w._subscriptionId);var t=w._getAVPath("subscriptionId");return w.localStorage.getItemAsync(t).then(function(e){return w._subscriptionId=e,w._subscriptionId||(e=w._refreshSubscriptionId(t)),e})},w._parseDate=g,w._extend=function(t,e){var n=v(this,t,e);return n.extend=this.extend,n},w._encode=function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(t instanceof w.Object){if(n)throw new Error("AV.Objects not allowed here");return e&&!l.include(e,t)&&t._hasData?t._toFullJSON((0,o.default)(e).call(e,t),r):t._toPointer()}if(t instanceof w.ACL)return t.toJSON();if(l.isDate(t))return r?{__type:"Date",iso:t.toJSON()}:t.toJSON();if(t instanceof w.GeoPoint)return t.toJSON();if(l.isArray(t))return(0,a.default)(l).call(l,t,function(t){return w._encode(t,e,n,r)});if(l.isRegExp(t))return t.source;if(t instanceof w.Relation)return t.toJSON();if(t instanceof w.Op)return t.toJSON();if(t instanceof w.File){if(!t.url()&&!t.id)throw new Error("Tried to save an object containing an unsaved file.");return t._toFullJSON(e,r)}return l.isObject(t)?l.mapObject(t,function(t,i){return w._encode(t,e,n,r)}):t},w._decode=function(t,e){if(!l.isObject(t)||l.isDate(t))return t;if(l.isArray(t))return(0,a.default)(l).call(l,t,function(t){return w._decode(t)});if(t instanceof w.Object)return t;if(t instanceof w.File)return t;if(t instanceof w.Op)return t;if(t instanceof w.GeoPoint)return t;if(t instanceof w.ACL)return t;if("ACL"===e)return new w.ACL(t);if(t.__op)return w.Op._decode(t);var n;if("Pointer"===t.__type){n=t.className;var r=w.Object._create(n);if((0,s.default)(t).length>3){var i=l.clone(t);delete i.__type,delete i.className,r._finishFetch(i,!0)}else r._finishFetch({objectId:t.objectId},!1);return r}if("Object"===t.__type){n=t.className;var o=l.clone(t);delete o.__type,delete o.className;var u=w.Object._create(n);return u._finishFetch(o,!0),u}if("Date"===t.__type)return w._parseDate(t.iso);if("GeoPoint"===t.__type)return new w.GeoPoint({latitude:t.latitude,longitude:t.longitude});if("Relation"===t.__type){if(!e)throw new Error("key missing decoding a Relation");var c=new w.Relation(null,e);return c.targetClassName=t.className,c}if("File"===t.__type){var f=new w.File(t.name),h=l.clone(t);return delete h.__type,f._finishFetch(h),f}return l.mapObject(t,w._decode)},w.parseJSON=w._decode,w.parse=function(t){return w.parseJSON(JSON.parse(t))},w.stringify=function(t){return(0,u.default)(w._encode(t,[],!1,!0))},w._encodeObjectOrArray=function(t){var e=function(t){return t&&t._toFullJSON&&(t=t._toFullJSON([])),l.mapObject(t,function(t){return w._encode(t,[])})};return l.isArray(t)?(0,a.default)(t).call(t,function(t){return e(t)}):e(t)},w._arrayEach=l.each,w._traverse=function(t,e,n){if(t instanceof w.Object){if(n=n||[],(0,c.default)(l).call(l,n,t)>=0)return;return n.push(t),w._traverse(t.attributes,e,n),e(t)}return t instanceof w.Relation||t instanceof w.File?e(t):l.isArray(t)?(l.each(t,function(r,i){var o=w._traverse(r,e,n);o&&(t[i]=o)}),e(t)):l.isObject(t)?(w._each(t,function(r,i){var o=w._traverse(r,e,n);o&&(t[i]=o)}),e(t)):e(t)},w._objectEach=w._each=function(t,e){l.isObject(t)?l.each((0,f.default)(l).call(l,t),function(n){e(t[n],n)}):l.each(t,e)},w.debug={enable:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"leancloud*";return d.enable(t)},disable:d.disable},w.setAdapters=b,t.exports=w}).call(e,n(72))},function(t,e,n){var r=n(48),i=n(4),o=n(94),a=n(34),s=n(39),u=n(223),c=i([].push),f=function(t){var e=1==t,n=2==t,i=3==t,f=4==t,l=6==t,h=7==t,d=5==t||l;return function(p,v,g,m){for(var y,b,_=a(p),w=o(_),E=r(v,g),O=s(w),T=0,S=m||u,A=e?S(p,O):n||h?S(p,0):void 0;O>T;T++)if((d||T in w)&&(y=w[T],b=E(y,T,_),t))if(e)A[T]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return T;case 2:c(A,y)}else switch(t){case 4:return!1;case 7:c(A,y)}return l?-1:i||f?f:A}};t.exports={forEach:f(0),map:f(1),filter:f(2),some:f(3),every:f(4),find:f(5),findIndex:f(6),filterReject:f(7)}},function(t,e,n){"use strict";var r=n(1),i=r(n(57)),o=n(3),a=n(230),s=n(30),u=s.inherits,c=u(a,{constructor:function(){a.apply(this),this._adapters={}},getAdapter:function(t){var e=this._adapters[t];if(void 0===e)throw new Error("".concat(t," adapter is not configured"));return e},setAdapters:function(t){var e=this;o.extend(this._adapters,t),(0,i.default)(o).call(o,t).forEach(function(n){return e.emit(n,t[n])})}}),f=new c;t.exports={getAdapter:f.getAdapter.bind(f),setAdapters:f.setAdapters.bind(f),adapterManager:f}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(74),i=Function.prototype,o=i.apply,a=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(o):function(){return a.apply(o,arguments)})},function(t,e,n){var r=n(2);t.exports=!r(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},function(t,e,n){var r,i,o=n(7),a=n(97),s=o.process,u=o.Deno,c=s&&s.versions||u&&u.version,f=c&&c.v8;f&&(r=f.split("."),i=r[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(i=+r[1]),t.exports=i},function(t,e){var n=String;t.exports=function(t){try{return n(t)}catch(t){return"Object"}}},function(t,e,n){var r=n(33),i=n(122);(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.23.3",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.23.3/LICENSE",source:"https://github.com/zloirock/core-js"})},function(t,e){t.exports={}},function(t,e,n){var r=n(51),i=String;t.exports=function(t){if("Symbol"===r(t))throw TypeError("Cannot convert a Symbol value to a string");return i(t)}},function(t,e){t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},function(t,e,n){var r=n(7),i=n(64),o=n(8),a=n(153),s=n(129),u=n(9),c=n(301),f=n(33),l=n(75),h=i&&i.prototype,d=u("species"),p=!1,v=o(r.PromiseRejectionEvent),g=a("Promise",function(){var t=s(i),e=t!==String(i);if(!e&&66===l)return!0;if(f&&(!h.catch||!h.finally))return!0;if(l>=51&&/native code/.test(t))return!1;var n=new i(function(t){t(1)}),r=function(t){t(function(){},function(){})},o=n.constructor={};return o[d]=r,!(p=n.then(function(){})instanceof r)||!e&&c&&!v});t.exports={CONSTRUCTOR:g,REJECTION_EVENT:v,SUBCLASSING:p}},function(t,e,n){"use strict";n.d(e,"a",function(){return o}),n.d(e,"b",function(){return a});var r=n(5),i=n(318),o=r.s&&Object(i.a)(new DataView(new ArrayBuffer(8))),a="undefined"!=typeof Map&&Object(i.a)(new Map)},function(t,e,n){"use strict";function r(t){if(!Object(i.a)(t))return[];var e=[];for(var n in t)e.push(n);return o.h&&Object(a.a)(t,e),e}e.a=r;var i=n(54),o=n(5),a=n(184)},function(t,e,n){"use strict";function r(t){return i.a.toPath(t)}e.a=r;var i=n(25);n(193)},function(t,e,n){"use strict";function r(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}}e.a=r},function(t,e,n){"use strict";function r(t,e,n){var r=[];return e=Object(i.a)(e,n),Object(o.a)(t,function(t,n,i){e(t,n,i)&&r.push(t)}),r}e.a=r;var i=n(21),o=n(56)},function(t,e,n){"use strict";function r(t,e,n,r){return Object(i.a)(t)||(t=Object(o.a)(t)),("number"!=typeof n||r)&&(n=0),Object(a.a)(t,e,n)>=0}e.a=r;var i=n(26),o=n(66),a=n(209)},function(t,e,n){var r=n(61);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){"use strict";var r=n(95),i=n(23),o=n(47);t.exports=function(t,e,n){var a=r(e);a in t?i.f(t,a,o(0,n)):t[a]=n}},function(t,e,n){t.exports=n(398)},function(t,e,n){function r(e){"@babel/helpers - typeof";return t.exports=r="function"==typeof i&&"symbol"==typeof o?function(t){return typeof t}:function(t){return t&&"function"==typeof i&&t.constructor===i&&t!==i.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}var i=n(236),o=n(454);t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){t.exports=n(468)},function(t,e,n){var r=n(0),i=n(4),o=n(78),a=n(11),s=n(12),u=n(23).f,c=n(102),f=n(239),l=n(255),h=n(98),d=n(254),p=!1,v=h("meta"),g=0,m=function(t){u(t,v,{value:{objectID:"O"+g++,weakData:{}}})},y=function(t,e){if(!a(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!s(t,v)){if(!l(t))return"F";if(!e)return"E";m(t)}return t[v].objectID},b=function(t,e){if(!s(t,v)){if(!l(t))return!0;if(!e)return!1;m(t)}return t[v].weakData},_=function(t){return d&&p&&l(t)&&!s(t,v)&&m(t),t},w=function(){E.enable=function(){},p=!0;var t=c.f,e=i([].splice),n={};n[v]=1,t(n).length&&(c.f=function(n){for(var r=t(n),i=0,o=r.length;i<o;i++)if(r[i]===v){e(r,i,1);break}return r},r({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:f.f}))},E=t.exports={enable:w,fastKey:y,getWeakData:b,onFreeze:_};o[v]=!0},function(t,e,n){var r=n(4),i=n(2),o=n(61),a=Object,s=r("".split);t.exports=i(function(){return!a("z").propertyIsEnumerable(0)})?function(t){return"String"==o(t)?s(t,""):a(t)}:a},function(t,e,n){var r=n(279),i=n(96);t.exports=function(t){var e=r(t,"string");return i(e)?e:e+""}},function(t,e,n){var r=n(18),i=n(8),o=n(19),a=n(151),s=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return i(e)&&o(e.prototype,s(t))}},function(t,e,n){var r=n(18);t.exports=r("navigator","userAgent")||""},function(t,e,n){var r=n(4),i=0,o=Math.random(),a=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++i+o,36)}},function(t,e,n){var r=n(12),i=n(8),o=n(34),a=n(100),s=n(155),u=a("IE_PROTO"),c=Object,f=c.prototype;t.exports=s?c.getPrototypeOf:function(t){var e=o(t);if(r(e,u))return e[u];var n=e.constructor;return i(n)&&e instanceof n?n.prototype:e instanceof c?f:null}},function(t,e,n){var r=n(77),i=n(98),o=r("keys");t.exports=function(t){return o[t]||(o[t]=i(t))}},function(t,e,n){var r=n(4),i=n(20),o=n(282);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{t=r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set),t(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return i(n),o(r),e?t(n,r):n.__proto__=r,n}}():void 0)},function(t,e,n){var r=n(157),i=n(126),o=i.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(157),i=n(126);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e,n){var r=n(51),i=n(121),o=n(50),a=n(9),s=a("iterator");t.exports=function(t){if(void 0!=t)return i(t,s)||i(t,"@@iterator")||o[r(t)]}},function(t,e,n){var r=n(61),i=n(7);t.exports="process"==r(i.process)},function(t,e,n){var r=n(19),i=TypeError;t.exports=function(t,e){if(r(e,t))return t;throw i("Incorrect invocation")}},function(t,e,n){var r=n(4),i=n(2),o=n(8),a=n(51),s=n(18),u=n(129),c=function(){},f=[],l=s("Reflect","construct"),h=/^\s*(?:class|function)\b/,d=r(h.exec),p=!h.exec(c),v=function(t){if(!o(t))return!1;try{return l(c,f,t),!0}catch(t){return!1}},g=function(t){if(!o(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!d(h,u(t))}catch(t){return!0}};g.sham=!0,t.exports=!l||i(function(){var t;return v(v.call)||!v(Object)||!v(function(){t=!0})||t})?g:v},function(t,e,n){var r=n(4);t.exports=r([].slice)},function(t,e,n){"use strict";function r(t){return t=Object(i.a)({},t),function(e){return Object(o.a)(e,t)}}e.a=r;var i=n(138),o=n(185)},function(t,e,n){"use strict";var r=n(24),i=n(201),o=n(25),a=Object(r.a)(function(t,e){var n=a.placeholder,r=function(){for(var o=0,a=e.length,s=Array(a),u=0;u<a;u++)s[u]=e[u]===n?arguments[o++]:e[u];for(;o<arguments.length;)s.push(arguments[o++]);return Object(i.a)(t,r,this,this,s)};return r});a.placeholder=o.a,e.a=a},function(t,e,n){"use strict";function r(t,e){return function(n,r,a){var s=e?[[],[]]:{};return r=Object(i.a)(r,a),Object(o.a)(n,function(e,i){var o=r(e,i,n);t(s,e,o)}),s}}e.a=r;var i=n(21),o=n(56)},function(t,e,n){var r=n(2),i=n(9),o=n(75),a=i("species");t.exports=function(t){return o>=51||!r(function(){var e=[],n=e.constructor={};return n[a]=function(){return{foo:1}},1!==e[t](Boolean).foo})}},function(t,e,n){t.exports=n(235)},function(t,e,n){"use strict";var r=n(1),i=r(n(91)),o=r(n(243)),a=r(n(35)),s=r(n(146)),u=r(n(36)),c=r(n(22)),f=(n(3),n(244)),l=f.timeout,h=n(58),d=h("leancloud:request"),p=h("leancloud:request:error"),v=n(71),g=v.getAdapter,m=0,y=function(t){var e=t.method,n=t.url,r=t.query,f=t.data,v=t.headers,y=void 0===v?{}:v,b=t.timeout,_=t.onprogress;if(r){var w,E,O,T=(0,o.default)(w=(0,a.default)(E=(0,s.default)(r)).call(E,function(t){var e,n=r[t];if(void 0!==n){var o="object"===(0,i.default)(n)?(0,u.default)(n):n;return(0,c.default)(e="".concat(encodeURIComponent(t),"=")).call(e,encodeURIComponent(o))}})).call(w,function(t){return t}).join("&");n=(0,c.default)(O="".concat(n,"?")).call(O,T)}var S=m++;d("request(%d) %s %s %o %o %o",S,e,n,r,f,y);var A=g("request"),x=A(n,{method:e,headers:y,data:f,onprogress:_}).then(function(t){if(d("response(%d) %d %O %o",S,t.status,t.data||t.text,t.header),!1===t.ok){var e=new Error;throw e.response=t,e}return t.data}).catch(function(t){throw t.response&&(h.enabled("leancloud:request")||p("request(%d) %s %s %o %o %o",S,e,n,r,f,y),p("response(%d) %d %O %o",S,t.response.status,t.response.data||t.response.text,t.response.header),t.statusCode=t.response.status,t.responseText=t.response.text,t.response=t.response.data),t});return b?l(x,b):x};t.exports=y},function(t,e){},function(t,e,n){function r(t){return null==t?void 0===t?u:s:c&&c in Object(t)?o(t):a(t)}var i=n(265),o=n(631),a=n(632),s="[object Null]",u="[object Undefined]",c=i?i.toStringTag:void 0;t.exports=r},function(t,e){function n(t){return null!=t&&"object"==typeof t}t.exports=n},function(t,e,n){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!r.call({1:2},1);e.f=o?function(t){var e=i(this,t);return!!e&&e.enumerable}:r},function(t,e){var n=TypeError;t.exports=function(t){if(void 0==t)throw n("Can't call method on "+t);return t}},function(t,e,n){var r=n(31);t.exports=function(t,e){var n=t[e];return null==n?void 0:r(n)}},function(t,e,n){var r=n(7),i=n(281),o=r["__core-js_shared__"]||i("__core-js_shared__",{});t.exports=o},function(t,e,n){var r=n(7),i=n(11),o=r.document,a=i(o)&&i(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},function(t,e,n){var r=n(125),i=Math.max,o=Math.min;t.exports=function(t,e){var n=r(t);return n<0?i(n+e,0):o(n,e)}},function(t,e,n){var r=n(284);t.exports=function(t){var e=+t;return e!==e||0===e?0:r(e)}},function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e,n){var r=n(14),i=n(154),o=n(23),a=n(20),s=n(32),u=n(104);e.f=r&&!i?Object.defineProperties:function(t,e){a(t);for(var n,r=s(e),i=u(e),c=i.length,f=0;c>f;)o.f(t,n=i[f++],r[n]);return t}},function(t,e,n){var r=n(9),i=r("toStringTag"),o={};o[i]="z",t.exports="[object z]"===String(o)},function(t,e,n){var r=n(4),i=n(8),o=n(122),a=r(Function.toString);i(o.inspectSource)||(o.inspectSource=function(t){return a(t)}),t.exports=o.inspectSource},function(t,e,n){"use strict";var r=n(0),i=n(15),o=n(33),a=n(290),s=n(8),u=n(291),c=n(99),f=n(101),l=n(52),h=n(37),d=n(43),p=n(9),v=n(50),g=n(165),m=a.PROPER,y=a.CONFIGURABLE,b=g.IteratorPrototype,_=g.BUGGY_SAFARI_ITERATORS,w=p("iterator"),E=function(){return this};t.exports=function(t,e,n,a,p,g,O){u(n,e,a);var T,S,A,x=function(t){if(t===p&&P)return P;if(!_&&t in C)return C[t];switch(t){case"keys":case"values":case"entries":return function(){return new n(this,t)}}return function(){return new n(this)}},I=e+" Iterator",j=!1,C=t.prototype,N=C[w]||C["@@iterator"]||p&&C[p],P=!_&&N||x(p),R="Array"==e?C.entries||N:N;if(R&&(T=c(R.call(new t)))!==Object.prototype&&T.next&&(o||c(T)===b||(f?f(T,b):s(T[w])||d(T,w,E)),l(T,I,!0,!0),o&&(v[I]=E)),m&&"values"==p&&N&&"values"!==N.name&&(!o&&y?h(C,"name","values"):(j=!0,P=function(){return i(N,this)})),p)if(S={values:x("values"),keys:g?P:x("keys"),entries:x("entries")},O)for(A in S)!_&&!j&&A in C||d(C,A,S[A]);else r({target:e,proto:!0,forced:_||j},S);return o&&!O||C[w]===P||d(C,w,P,{name:p}),v[e]=P,S}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(5);n.d(e,"VERSION",function(){return r.e});var i=n(24);n.d(e,"restArguments",function(){return i.a});var o=n(54);n.d(e,"isObject",function(){return o.a});var a=n(313);n.d(e,"isNull",function(){return a.a});var s=n(174);n.d(e,"isUndefined",function(){return s.a});var u=n(175);n.d(e,"isBoolean",function(){return u.a});var c=n(314);n.d(e,"isElement",function(){return c.a});var f=n(132);n.d(e,"isString",function(){return f.a});var l=n(176);n.d(e,"isNumber",function(){return l.a});var h=n(315);n.d(e,"isDate",function(){return h.a});var d=n(316);n.d(e,"isRegExp",function(){return d.a});var p=n(317);n.d(e,"isError",function(){return p.a});var v=n(177);n.d(e,"isSymbol",function(){return v.a});var g=n(178);n.d(e,"isArrayBuffer",function(){return g.a});var m=n(133);n.d(e,"isDataView",function(){return m.a});var y=n(55);n.d(e,"isArray",function(){return y.a});var b=n(28);n.d(e,"isFunction",function(){return b.a});var _=n(134);n.d(e,"isArguments",function(){return _.a});var w=n(319);n.d(e,"isFinite",function(){return w.a});var E=n(179);n.d(e,"isNaN",function(){return E.a});var O=n(180);n.d(e,"isTypedArray",function(){return O.a});var T=n(321);n.d(e,"isEmpty",function(){return T.a});var S=n(185);n.d(e,"isMatch",function(){return S.a});var A=n(322);n.d(e,"isEqual",function(){return A.a});var x=n(324);n.d(e,"isMap",function(){return x.a});var I=n(325);n.d(e,"isWeakMap",function(){return I.a});var j=n(326);n.d(e,"isSet",function(){return j.a});var C=n(327);n.d(e,"isWeakSet",function(){return C.a});var N=n(16);n.d(e,"keys",function(){return N.a});var P=n(83);n.d(e,"allKeys",function(){return P.a});var R=n(66);n.d(e,"values",function(){return R.a});var U=n(328);n.d(e,"pairs",function(){return U.a});var k=n(186);n.d(e,"invert",function(){return k.a});var L=n(187);n.d(e,"functions",function(){return L.a}),n.d(e,"methods",function(){return L.a});var M=n(188);n.d(e,"extend",function(){return M.a});var D=n(138);n.d(e,"extendOwn",function(){return D.a}),n.d(e,"assign",function(){return D.a});var F=n(189);n.d(e,"defaults",function(){return F.a});var B=n(329);n.d(e,"create",function(){return B.a});var V=n(191);n.d(e,"clone",function(){return V.a});var q=n(330);n.d(e,"tap",function(){return q.a});var W=n(192);n.d(e,"get",function(){return W.a});var Y=n(331);n.d(e,"has",function(){return Y.a});var z=n(332);n.d(e,"mapObject",function(){return z.a});var G=n(140);n.d(e,"identity",function(){return G.a});var K=n(181);n.d(e,"constant",function(){return K.a});var Q=n(196);n.d(e,"noop",function(){return Q.a});var J=n(193);n.d(e,"toPath",function(){return J.a});var $=n(141);n.d(e,"property",function(){return $.a});var H=n(333);n.d(e,"propertyOf",function(){return H.a});var Z=n(110);n.d(e,"matcher",function(){return Z.a}),n.d(e,"matches",function(){return Z.a});var X=n(334);n.d(e,"times",function(){return X.a});var tt=n(197);n.d(e,"random",function(){return tt.a});var et=n(142);n.d(e,"now",function(){return et.a});var nt=n(335);n.d(e,"escape",function(){return nt.a});var rt=n(336);n.d(e,"unescape",function(){return rt.a});var it=n(200);n.d(e,"templateSettings",function(){return it.a});var ot=n(338);n.d(e,"template",function(){return ot.a});var at=n(339);n.d(e,"result",function(){return at.a});var st=n(340);n.d(e,"uniqueId",function(){return st.a});var ut=n(341);n.d(e,"chain",function(){return ut.a});var ct=n(195);n.d(e,"iteratee",function(){return ct.a});var ft=n(111);n.d(e,"partial",function(){return ft.a});var lt=n(202);n.d(e,"bind",function(){return lt.a});var ht=n(342);n.d(e,"bindAll",function(){return ht.a});var dt=n(343);n.d(e,"memoize",function(){return dt.a});var pt=n(203);n.d(e,"delay",function(){return pt.a});var vt=n(344);n.d(e,"defer",function(){return vt.a});var gt=n(345);n.d(e,"throttle",function(){return gt.a});var mt=n(346);n.d(e,"debounce",function(){return mt.a});var yt=n(347);n.d(e,"wrap",function(){return yt.a});var bt=n(143);n.d(e,"negate",function(){return bt.a});var _t=n(348);n.d(e,"compose",function(){return _t.a});var wt=n(349);n.d(e,"after",function(){return wt.a});var Et=n(204);n.d(e,"before",function(){return Et.a});var Ot=n(350);n.d(e,"once",function(){return Ot.a});var Tt=n(205);n.d(e,"findKey",function(){return Tt.a});var St=n(144);n.d(e,"findIndex",function(){return St.a});var At=n(207);n.d(e,"findLastIndex",function(){return At.a});var xt=n(208);n.d(e,"sortedIndex",function(){return xt.a});var It=n(209);n.d(e,"indexOf",function(){return It.a});var jt=n(351);n.d(e,"lastIndexOf",function(){return jt.a});var Ct=n(211);n.d(e,"find",function(){return Ct.a}),n.d(e,"detect",function(){return Ct.a});var Nt=n(352);n.d(e,"findWhere",function(){return Nt.a});var Pt=n(56);n.d(e,"each",function(){return Pt.a}),n.d(e,"forEach",function(){return Pt.a});var Rt=n(68);n.d(e,"map",function(){return Rt.a}),n.d(e,"collect",function(){return Rt.a});var Ut=n(353);n.d(e,"reduce",function(){return Ut.a}),n.d(e,"foldl",function(){return Ut.a}),n.d(e,"inject",function(){return Ut.a});var kt=n(354);n.d(e,"reduceRight",function(){return kt.a}),n.d(e,"foldr",function(){return kt.a});var Lt=n(86);n.d(e,"filter",function(){return Lt.a}),n.d(e,"select",function(){return Lt.a});var Mt=n(355);n.d(e,"reject",function(){return Mt.a});var Dt=n(356);n.d(e,"every",function(){return Dt.a}),n.d(e,"all",function(){return Dt.a});var Ft=n(357);n.d(e,"some",function(){return Ft.a}),n.d(e,"any",function(){return Ft.a});var Bt=n(87);n.d(e,"contains",function(){return Bt.a}),n.d(e,"includes",function(){return Bt.a}),n.d(e,"include",function(){return Bt.a});var Vt=n(358);n.d(e,"invoke",function(){return Vt.a});var qt=n(145);n.d(e,"pluck",function(){return qt.a});var Wt=n(359);n.d(e,"where",function(){return Wt.a});var Yt=n(213);n.d(e,"max",function(){return Yt.a});var zt=n(360);n.d(e,"min",function(){return zt.a});var Gt=n(361);n.d(e,"shuffle",function(){return Gt.a});var Kt=n(214);n.d(e,"sample",function(){return Kt.a});var Qt=n(362);n.d(e,"sortBy",function(){return Qt.a});var Jt=n(363);n.d(e,"groupBy",function(){return Jt.a});var $t=n(364);n.d(e,"indexBy",function(){return $t.a});var Ht=n(365);n.d(e,"countBy",function(){return Ht.a});var Zt=n(366);n.d(e,"partition",function(){return Zt.a});var Xt=n(367);n.d(e,"toArray",function(){return Xt.a});var te=n(368);n.d(e,"size",function(){return te.a});var ee=n(215);n.d(e,"pick",function(){return ee.a});var ne=n(370);n.d(e,"omit",function(){return ne.a});var re=n(371);n.d(e,"first",function(){return re.a}),n.d(e,"head",function(){return re.a}),n.d(e,"take",function(){return re.a});var ie=n(216);n.d(e,"initial",function(){return ie.a});var oe=n(372);n.d(e,"last",function(){return oe.a});var ae=n(217);n.d(e,"rest",function(){return ae.a}),n.d(e,"tail",function(){return ae.a}),n.d(e,"drop",function(){return ae.a});var se=n(373);n.d(e,"compact",function(){return se.a});var ue=n(374);n.d(e,"flatten",function(){return ue.a});var ce=n(375);n.d(e,"without",function(){return ce.a});var fe=n(219);n.d(e,"uniq",function(){return fe.a}),n.d(e,"unique",function(){return fe.a});var le=n(376);n.d(e,"union",function(){return le.a});var he=n(377);n.d(e,"intersection",function(){return he.a});var de=n(218);n.d(e,"difference",function(){return de.a});var pe=n(220);n.d(e,"unzip",function(){return pe.a}),n.d(e,"transpose",function(){return pe.a});var ve=n(378);n.d(e,"zip",function(){return ve.a});var ge=n(379);n.d(e,"object",function(){return ge.a});var me=n(380);n.d(e,"range",function(){return me.a});var ye=n(381);n.d(e,"chunk",function(){return ye.a});var be=n(382);n.d(e,"mixin",function(){return be.a});var _e=n(383);n.d(e,"default",function(){return _e.a})},function(t,e,n){"use strict";var r=n(17);e.a=Object(r.a)("String")},function(t,e,n){"use strict";function r(t){return null!=t&&Object(o.a)(t.getInt8)&&Object(a.a)(t.buffer)}var i=n(17),o=n(28),a=n(178),s=n(82),u=Object(i.a)("DataView");e.a=s.a?r:u},function(t,e,n){"use strict";var r=n(17),i=n(45),o=Object(r.a)("Arguments");!function(){o(arguments)||(o=function(t){return Object(i.a)(t,"callee")})}(),e.a=o},function(t,e,n){"use strict";var r=n(183);e.a=Object(r.a)("byteLength")},function(t,e,n){"use strict";function r(t){var e=Object(i.a)(t);return function(n){if(null==n)return!1;var r=Object(a.a)(n);if(Object(i.a)(r))return!1;for(var u=0;u<e;u++)if(!Object(o.a)(n[t[u]]))return!1;return t!==l||!Object(o.a)(n[s])}}e.a=r,n.d(e,"b",function(){return f}),n.d(e,"d",function(){return l}),n.d(e,"c",function(){return h});var i=n(29),o=n(28),a=n(83),s="forEach",u=["clear","delete"],c=["get","has","set"],f=u.concat(s,c),l=u.concat(c),h=["add"].concat(u,s,"has")},function(t,e,n){"use strict";function r(t,e){return function(n){var r=arguments.length;if(e&&(n=Object(n)),r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],a=t(o),s=a.length,u=0;u<s;u++){var c=a[u];e&&void 0!==n[c]||(n[c]=o[c])}return n}}e.a=r},function(t,e,n){"use strict";var r=n(137),i=n(16);e.a=Object(r.a)(i.a)},function(t,e,n){"use strict";function r(t,e){for(var n=e.length,r=0;r<n;r++){if(null==t)return;t=t[e[r]]}return n?t:void 0}e.a=r},function(t,e,n){"use strict";function r(t){return t}e.a=r},function(t,e,n){"use strict";function r(t){return t=Object(o.a)(t),function(e){return Object(i.a)(e,t)}}e.a=r;var i=n(139),o=n(84)},function(t,e,n){"use strict";e.a=Date.now||function(){return(new Date).getTime()}},function(t,e,n){"use strict";function r(t){return function(){return!t.apply(this,arguments)}}e.a=r},function(t,e,n){"use strict";var r=n(206);e.a=Object(r.a)(1)},function(t,e,n){"use strict";function r(t,e){return Object(i.a)(t,Object(o.a)(e))}e.a=r;var i=n(68),o=n(141)},function(t,e,n){t.exports=n(393)},function(t,e,n){var r=n(9);e.f=r},function(t,e,n){t.exports=n(497)},function(t,e,n){"use strict";t.exports=n(566)},function(t,e,n){var r=n(43);t.exports=function(t,e,n){for(var i in e)n&&n.unsafe&&t[i]?t[i]=e[i]:r(t,i,e[i],n);return t}},function(t,e,n){var r=n(62);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,e,n){var r=n(14),i=n(2),o=n(123);t.exports=!r&&!i(function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(2),i=n(8),o=/#|\.prototype\./,a=function(t,e){var n=u[s(t)];return n==f||n!=c&&(i(e)?r(e):!!e)},s=a.normalize=function(t){return String(t).replace(o,".").toLowerCase()},u=a.data={},c=a.NATIVE="N",f=a.POLYFILL="P";t.exports=a},function(t,e,n){var r=n(14),i=n(2);t.exports=r&&i(function(){return 42!=Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},function(t,e,n){var r=n(2);t.exports=!r(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},function(t,e,n){var r=n(18),i=n(4),o=n(102),a=n(103),s=n(20),u=i([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=o.f(s(t)),n=a.f;return n?u(e,n(t)):e}},function(t,e,n){var r=n(4),i=n(12),o=n(32),a=n(158).indexOf,s=n(78),u=r([].push);t.exports=function(t,e){var n,r=o(t),c=0,f=[];for(n in r)!i(s,n)&&i(r,n)&&u(f,n);for(;e.length>c;)i(r,n=e[c++])&&(~a(f,n)||u(f,n));return f}},function(t,e,n){var r=n(32),i=n(124),o=n(39),a=function(t){return function(e,n,a){var s,u=r(e),c=o(u),f=i(a,c);if(t&&n!=n){for(;c>f;)if((s=u[f++])!=s)return!0}else for(;c>f;f++)if((t||f in u)&&u[f]===n)return t||f||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},function(t,e,n){var r=n(18);t.exports=r("document","documentElement")},function(t,e,n){var r=n(9),i=n(50),o=r("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||a[o]===t)}},function(t,e,n){var r=n(15),i=n(31),o=n(20),a=n(76),s=n(105),u=TypeError;t.exports=function(t,e){var n=arguments.length<2?s(t):e;if(i(n))return o(r(n,t));throw u(a(t)+" is not iterable")}},function(t,e,n){var r=n(15),i=n(20),o=n(121);t.exports=function(t,e,n){var a,s;i(t);try{if(!(a=o(t,"return"))){if("throw"===e)throw n;return n}a=r(a,t)}catch(t){s=!0,a=t}if("throw"===e)throw n;if(s)throw a;return i(a),n}},function(t,e){t.exports=function(){}},function(t,e,n){var r=n(7),i=n(8),o=n(129),a=r.WeakMap;t.exports=i(a)&&/native code/.test(o(a))},function(t,e,n){"use strict";var r,i,o,a=n(2),s=n(8),u=n(49),c=n(99),f=n(43),l=n(9),h=n(33),d=l("iterator"),p=!1;[].keys&&(o=[].keys(),"next"in o?(i=c(c(o)))!==Object.prototype&&(r=i):p=!0),void 0==r||a(function(){var t={};return r[d].call(t)!==t})?r={}:h&&(r=u(r)),s(r[d])||f(r,d,function(){return this}),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:p}},function(t,e,n){"use strict";var r=n(18),i=n(23),o=n(9),a=n(14),s=o("species");t.exports=function(t){var e=r(t),n=i.f;a&&e&&!e[s]&&n(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,n){var r=n(20),i=n(168),o=n(9),a=o("species");t.exports=function(t,e){var n,o=r(t).constructor;return void 0===o||void 0==(n=r(o)[a])?e:i(n)}},function(t,e,n){var r=n(108),i=n(76),o=TypeError;t.exports=function(t){if(r(t))return t;throw o(i(t)+" is not a constructor")}},function(t,e,n){var r,i,o,a,s=n(7),u=n(73),c=n(48),f=n(8),l=n(12),h=n(2),d=n(159),p=n(109),v=n(123),g=n(295),m=n(170),y=n(106),b=s.setImmediate,_=s.clearImmediate,w=s.process,E=s.Dispatch,O=s.Function,T=s.MessageChannel,S=s.String,A=0,x={};try{r=s.location}catch(t){}var I=function(t){if(l(x,t)){var e=x[t];delete x[t],e()}},j=function(t){return function(){I(t)}},C=function(t){I(t.data)},N=function(t){s.postMessage(S(t),r.protocol+"//"+r.host)};b&&_||(b=function(t){g(arguments.length,1);var e=f(t)?t:O(t),n=p(arguments,1);return x[++A]=function(){u(e,void 0,n)},i(A),A},_=function(t){delete x[t]},y?i=function(t){w.nextTick(j(t))}:E&&E.now?i=function(t){E.now(j(t))}:T&&!m?(o=new T,a=o.port2,o.port1.onmessage=C,i=c(a.postMessage,a)):s.addEventListener&&f(s.postMessage)&&!s.importScripts&&r&&"file:"!==r.protocol&&!h(N)?(i=N,s.addEventListener("message",C,!1)):i="onreadystatechange"in v("script")?function(t){d.appendChild(v("script")).onreadystatechange=function(){d.removeChild(this),I(t)}}:function(t){setTimeout(j(t),0)}),t.exports={set:b,clear:_}},function(t,e,n){var r=n(97);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},function(t,e,n){var r=n(64),i=n(172),o=n(81).CONSTRUCTOR;t.exports=o||!i(function(t){r.all(t).then(void 0,function(){})})},function(t,e,n){var r=n(9),i=r("iterator"),o=!1;try{var a=0,s={next:function(){return{done:!!a++}},return:function(){o=!0}};s[i]=function(){return this},Array.from(s,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var r={};r[i]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n}},function(t,e,n){var r=n(20),i=n(11),o=n(53);t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},function(t,e,n){"use strict";function r(t){return void 0===t}e.a=r},function(t,e,n){"use strict";function r(t){return!0===t||!1===t||"[object Boolean]"===i.t.call(t)}e.a=r;var i=n(5)},function(t,e,n){"use strict";var r=n(17);e.a=Object(r.a)("Number")},function(t,e,n){"use strict";var r=n(17);e.a=Object(r.a)("Symbol")},function(t,e,n){"use strict";var r=n(17);e.a=Object(r.a)("ArrayBuffer")},function(t,e,n){"use strict";function r(t){return Object(o.a)(t)&&Object(i.g)(t)}e.a=r;var i=n(5),o=n(176)},function(t,e,n){"use strict";function r(t){return i.l?Object(i.l)(t)&&!Object(o.a)(t):Object(s.a)(t)&&u.test(i.t.call(t))}var i=n(5),o=n(133),a=n(181),s=n(320),u=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;e.a=i.r?r:Object(a.a)(!1)},function(t,e,n){"use strict";function r(t){return function(){return t}}e.a=r},function(t,e,n){"use strict";function r(t){return function(e){var n=t(e);return"number"==typeof n&&n>=0&&n<=i.b}}e.a=r;var i=n(5)},function(t,e,n){"use strict";function r(t){return function(e){return null==e?void 0:e[t]}}e.a=r},function(t,e,n){"use strict";function r(t){for(var e={},n=t.length,r=0;r<n;++r)e[t[r]]=!0;return{contains:function(t){return e[t]},push:function(n){return e[n]=!0,t.push(n)}}}function i(t,e){e=r(e);var n=o.n.length,i=t.constructor,u=Object(a.a)(i)&&i.prototype||o.c,c="constructor";for(Object(s.a)(t,c)&&!e.contains(c)&&e.push(c);n--;)(c=o.n[n])in t&&t[c]!==u[c]&&!e.contains(c)&&e.push(c)}e.a=i;var o=n(5),a=n(28),s=n(45)},function(t,e,n){"use strict";function r(t,e){var n=Object(i.a)(e),r=n.length;if(null==t)return!r;for(var o=Object(t),a=0;a<r;a++){var s=n[a];if(e[s]!==o[s]||!(s in o))return!1}return!0}e.a=r;var i=n(16)},function(t,e,n){"use strict";function r(t){for(var e={},n=Object(i.a)(t),r=0,o=n.length;r<o;r++)e[t[n[r]]]=n[r];return e}e.a=r;var i=n(16)},function(t,e,n){"use strict";function r(t){var e=[];for(var n in t)Object(i.a)(t[n])&&e.push(n);return e.sort()}e.a=r;var i=n(28)},function(t,e,n){"use strict";var r=n(137),i=n(83);e.a=Object(r.a)(i.a)},function(t,e,n){"use strict";var r=n(137),i=n(83);e.a=Object(r.a)(i.a,!0)},function(t,e,n){"use strict";function r(){return function(){}}function i(t){if(!Object(o.a)(t))return{};if(a.j)return Object(a.j)(t);var e=r();e.prototype=t;var n=new e;return e.prototype=null,n}e.a=i;var o=n(54),a=n(5)},function(t,e,n){"use strict";function r(t){return Object(i.a)(t)?Object(o.a)(t)?t.slice():Object(a.a)({},t):t}e.a=r;var i=n(54),o=n(55),a=n(188)},function(t,e,n){"use strict";function r(t,e,n){var r=Object(o.a)(t,Object(i.a)(e));return Object(a.a)(r)?n:r}e.a=r;var i=n(84),o=n(139),a=n(174)},function(t,e,n){"use strict";function r(t){return Object(o.a)(t)?t:[t]}e.a=r;var i=n(25),o=n(55);i.a.toPath=r},function(t,e,n){"use strict";function r(t,e,n){return null==t?i.a:Object(o.a)(t)?Object(f.a)(t,e,n):Object(a.a)(t)&&!Object(s.a)(t)?Object(u.a)(t):Object(c.a)(t)}e.a=r;var i=n(140),o=n(28),a=n(54),s=n(55),u=n(110),c=n(141),f=n(85)},function(t,e,n){"use strict";function r(t,e){return Object(o.a)(t,e,1/0)}e.a=r;var i=n(25),o=n(194);i.a.iteratee=r},function(t,e,n){"use strict";function r(){}e.a=r},function(t,e,n){"use strict";function r(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))}e.a=r},function(t,e,n){"use strict";function r(t){var e=function(e){return t[e]},n="(?:"+Object(i.a)(t).join("|")+")",r=RegExp(n),o=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(o,e):t}}e.a=r;var i=n(16)},function(t,e,n){"use strict";e.a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"}},function(t,e,n){"use strict";var r=n(25);e.a=r.a.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g}},function(t,e,n){"use strict";function r(t,e,n,r,a){if(!(r instanceof e))return t.apply(n,a);var s=Object(i.a)(t.prototype),u=t.apply(s,a);return Object(o.a)(u)?u:s}e.a=r;var i=n(190),o=n(54)},function(t,e,n){"use strict";var r=n(24),i=n(28),o=n(201);e.a=Object(r.a)(function(t,e,n){if(!Object(i.a)(t))throw new TypeError("Bind must be called on a function");var a=Object(r.a)(function(r){return Object(o.a)(t,a,e,this,n.concat(r))});return a})},function(t,e,n){"use strict";var r=n(24);e.a=Object(r.a)(function(t,e,n){return setTimeout(function(){return t.apply(null,n)},e)})},function(t,e,n){"use strict";function r(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}}e.a=r},function(t,e,n){"use strict";function r(t,e,n){e=Object(i.a)(e,n);for(var r,a=Object(o.a)(t),s=0,u=a.length;s<u;s++)if(r=a[s],e(t[r],r,t))return r}e.a=r;var i=n(21),o=n(16)},function(t,e,n){"use strict";function r(t){return function(e,n,r){n=Object(i.a)(n,r);for(var a=Object(o.a)(e),s=t>0?0:a-1;s>=0&&s<a;s+=t)if(n(e[s],s,e))return s;return-1}}e.a=r;var i=n(21),o=n(29)},function(t,e,n){"use strict";var r=n(206);e.a=Object(r.a)(-1)},function(t,e,n){"use strict";function r(t,e,n,r){n=Object(i.a)(n,r,1);for(var a=n(e),s=0,u=Object(o.a)(t);s<u;){var c=Math.floor((s+u)/2);n(t[c])<a?s=c+1:u=c}return s}e.a=r;var i=n(21),o=n(29)},function(t,e,n){"use strict";var r=n(208),i=n(144),o=n(210);e.a=Object(o.a)(1,i.a,r.a)},function(t,e,n){"use strict";function r(t,e,n){return function(r,s,u){var c=0,f=Object(i.a)(r);if("number"==typeof u)t>0?c=u>=0?u:Math.max(u+f,c):f=u>=0?Math.min(u+1,f):u+f+1;else if(n&&u&&f)return u=n(r,s),r[u]===s?u:-1;if(s!==s)return u=e(o.q.call(r,c,f),a.a),u>=0?u+c:-1;for(u=t>0?c:f-1;u>=0&&u<f;u+=t)if(r[u]===s)return u;return-1}}e.a=r;var i=n(29),o=n(5),a=n(179)},function(t,e,n){"use strict";function r(t,e,n){var r=Object(i.a)(t)?o.a:a.a,s=r(t,e,n);if(void 0!==s&&-1!==s)return t[s]}e.a=r;var i=n(26),o=n(144),a=n(205)},function(t,e,n){"use strict";function r(t){var e=function(e,n,r,a){var s=!Object(i.a)(e)&&Object(o.a)(e),u=(s||e).length,c=t>0?0:u-1;for(a||(r=e[s?s[c]:c],c+=t);c>=0&&c<u;c+=t){var f=s?s[c]:c;r=n(r,e[f],f,e)}return r};return function(t,n,r,i){var o=arguments.length>=3;return e(t,Object(a.a)(n,i,4),r,o)}}e.a=r;var i=n(26),o=n(16),a=n(85)},function(t,e,n){"use strict";function r(t,e,n){var r,u,c=-1/0,f=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t){t=Object(i.a)(t)?t:Object(o.a)(t);for(var l=0,h=t.length;l<h;l++)null!=(r=t[l])&&r>c&&(c=r)}else e=Object(a.a)(e,n),Object(s.a)(t,function(t,n,r){((u=e(t,n,r))>f||u===-1/0&&c===-1/0)&&(c=t,f=u)});return c}e.a=r;var i=n(26),o=n(66),a=n(21),s=n(56)},function(t,e,n){"use strict";function r(t,e,n){if(null==e||n)return Object(i.a)(t)||(t=Object(a.a)(t)),t[Object(u.a)(t.length-1)];var r=Object(i.a)(t)?Object(o.a)(t):Object(a.a)(t),c=Object(s.a)(r);e=Math.max(Math.min(e,c),0);for(var f=c-1,l=0;l<e;l++){var h=Object(u.a)(l,f),d=r[l];r[l]=r[h],r[h]=d}return r.slice(0,e)}e.a=r;var i=n(26),o=n(191),a=n(66),s=n(29),u=n(197)},function(t,e,n){"use strict";var r=n(24),i=n(28),o=n(85),a=n(83),s=n(369),u=n(67);e.a=Object(r.a)(function(t,e){var n={},r=e[0];if(null==t)return n;Object(i.a)(r)?(e.length>1&&(r=Object(o.a)(r,e[1])),e=Object(a.a)(t)):(r=s.a,e=Object(u.a)(e,!1,!1),t=Object(t));for(var c=0,f=e.length;c<f;c++){var l=e[c],h=t[l];r(h,l,t)&&(n[l]=h)}return n})},function(t,e,n){"use strict";function r(t,e,n){return i.q.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))}e.a=r;var i=n(5)},function(t,e,n){"use strict";function r(t,e,n){return i.q.call(t,null==e||n?1:e)}e.a=r;var i=n(5)},function(t,e,n){"use strict";var r=n(24),i=n(67),o=n(86),a=n(87);e.a=Object(r.a)(function(t,e){return e=Object(i.a)(e,!0,!0),Object(o.a)(t,function(t){return!Object(a.a)(e,t)})})},function(t,e,n){"use strict";function r(t,e,n,r){Object(i.a)(e)||(r=n,n=e,e=!1),null!=n&&(n=Object(o.a)(n,r));for(var u=[],c=[],f=0,l=Object(a.a)(t);f<l;f++){var h=t[f],d=n?n(h,f,t):h;e&&!n?(f&&c===d||u.push(h),c=d):n?Object(s.a)(c,d)||(c.push(d),u.push(h)):Object(s.a)(u,h)||u.push(h)}return u}e.a=r;var i=n(175),o=n(21),a=n(29),s=n(87)},function(t,e,n){"use strict";function r(t){for(var e=t&&Object(i.a)(t,o.a).length||0,n=Array(e),r=0;r<e;r++)n[r]=Object(a.a)(t,r);return n}e.a=r;var i=n(213),o=n(29),a=n(145)},function(t,e,n){"use strict";function r(t,e){return t._chain?Object(i.a)(e).chain():e}e.a=r;var i=n(25)},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(88),a=n(11),s=n(34),u=n(39),c=n(387),f=n(89),l=n(223),h=n(113),d=n(9),p=n(75),v=d("isConcatSpreadable"),g=p>=51||!i(function(){var t=[];return t[v]=!1,t.concat()[0]!==t}),m=h("concat"),y=function(t){if(!a(t))return!1;var e=t[v];return void 0!==e?!!e:o(t)};r({target:"Array",proto:!0,arity:1,forced:!g||!m},{concat:function(t){var e,n,r,i,o,a=s(this),h=l(a,0),d=0;for(e=-1,r=arguments.length;e<r;e++)if(o=-1===e?a:arguments[e],y(o))for(i=u(o),c(d+i),n=0;n<i;n++,d++)n in o&&f(h,d,o[n]);else c(d+1),f(h,d++,o);return h.length=d,h}})},function(t,e,n){var r=n(388);t.exports=function(t,e){return new(r(t))(0===e?0:e)}},function(t,e,n){var r=n(0),i=n(18),o=n(73),a=n(15),s=n(4),u=n(2),c=n(88),f=n(8),l=n(11),h=n(96),d=n(109),p=n(62),v=i("JSON","stringify"),g=s(/./.exec),m=s("".charAt),y=s("".charCodeAt),b=s("".replace),_=s(1..toString),w=/[\uD800-\uDFFF]/g,E=/^[\uD800-\uDBFF]$/,O=/^[\uDC00-\uDFFF]$/,T=!p||u(function(){var t=i("Symbol")();return"[null]"!=v([t])||"{}"!=v({a:t})||"{}"!=v(Object(t))}),S=u(function(){return'"\\udf06\\ud834"'!==v("��")||'"\\udead"'!==v("�")}),A=function(t,e){var n=d(arguments),r=e;if((l(e)||void 0!==t)&&!h(t))return c(e)||(e=function(t,e){if(f(r)&&(e=a(r,this,t,e)),!h(e))return e}),n[1]=e,o(v,null,n)},x=function(t,e,n){var r=m(n,e-1),i=m(n,e+1);return g(E,t)&&!g(O,i)||g(O,t)&&!g(E,r)?"\\u"+_(y(t,0),16):t};v&&r({target:"JSON",stat:!0,arity:3,forced:T||S},{stringify:function(t,e,n){var r=d(arguments),i=o(T?A:v,null,r);return S&&"string"==typeof i?b(i,w,x):i}})},function(t,e,n){"use strict";var r=n(2);t.exports=function(t,e){var n=[][t];return!!n&&r(function(){n.call(null,e||function(){return 1},1)})}},function(t,e,n){function r(t,e,n){var r=e&&n||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null),t=t||{};var a=t.random||(t.rng||i)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,e)for(var s=0;s<16;++s)e[r+s]=a[s];return e||o(a)}var i=n(405),o=n(406);t.exports=r},function(t,e,n){t.exports=n(228)},function(t,e,n){var r=n(409);t.exports=r},function(t,e,n){"use strict";t.exports="4.15.1"},function(t,e,n){"use strict";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(){this._events=new r,this._eventsCount=0}var a=Object.prototype.hasOwnProperty,s="~";Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(s=!1)),o.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)a.call(t,e)&&n.push(s?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},o.prototype.listeners=function(t,e){var n=s?s+t:t,r=this._events[n];if(e)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},o.prototype.emit=function(t,e,n,r,i,o){var a=s?s+t:t;if(!this._events[a])return!1;var u,c,f=this._events[a],l=arguments.length;if(f.fn){switch(f.once&&this.removeListener(t,f.fn,void 0,!0),l){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,e),!0;case 3:return f.fn.call(f.context,e,n),!0;case 4:return f.fn.call(f.context,e,n,r),!0;case 5:return f.fn.call(f.context,e,n,r,i),!0;case 6:return f.fn.call(f.context,e,n,r,i,o),!0}for(c=1,u=new Array(l-1);c<l;c++)u[c-1]=arguments[c];f.fn.apply(f.context,u)}else{var h,d=f.length;for(c=0;c<d;c++)switch(f[c].once&&this.removeListener(t,f[c].fn,void 0,!0),l){case 1:f[c].fn.call(f[c].context);break;case 2:f[c].fn.call(f[c].context,e);break;case 3:f[c].fn.call(f[c].context,e,n);break;case 4:f[c].fn.call(f[c].context,e,n,r);break;default:if(!u)for(h=1,u=new Array(l-1);h<l;h++)u[h-1]=arguments[h];f[c].fn.apply(f[c].context,u)}}return!0},o.prototype.on=function(t,e,n){var r=new i(e,n||this),o=s?s+t:t;return this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],r]:this._events[o].push(r):(this._events[o]=r,this._eventsCount++),this},o.prototype.once=function(t,e,n){var r=new i(e,n||this,!0),o=s?s+t:t;return this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],r]:this._events[o].push(r):(this._events[o]=r,this._eventsCount++),this},o.prototype.removeListener=function(t,e,n,i){var o=s?s+t:t;if(!this._events[o])return this;if(!e)return 0==--this._eventsCount?this._events=new r:delete this._events[o],this;var a=this._events[o];if(a.fn)a.fn!==e||i&&!a.once||n&&a.context!==n||(0==--this._eventsCount?this._events=new r:delete this._events[o]);else{for(var u=0,c=[],f=a.length;u<f;u++)(a[u].fn!==e||i&&!a[u].once||n&&a[u].context!==n)&&c.push(a[u]);c.length?this._events[o]=1===c.length?c[0]:c:0==--this._eventsCount?this._events=new r:delete this._events[o]}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=s?s+t:t,this._events[e]&&(0==--this._eventsCount?this._events=new r:delete this._events[e])):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prototype.setMaxListeners=function(){return this},o.prefixed=s,o.EventEmitter=o,t.exports=o},function(t,e,n){"use strict";var r=n(1),i=r(n(13)),o=n(71),a=o.getAdapter,s=["getItem","setItem","removeItem","clear"],u={get async(){return a("storage").async}};s.forEach(function(t){u[t+"Async"]=function(){var e=a("storage");return i.default.resolve(e[t].apply(e,arguments))},u[t]=function(){var e=a("storage");if(!e.async)return e[t].apply(e,arguments);var n=new Error("Synchronous API ["+t+"] is not available in this runtime.");throw n.code="SYNC_API_NOT_AVAILABLE",n}}),t.exports=u},function(t,e,n){"use strict";var r=n(1),i=r(n(22)),o=r(n(36)),a=n(231),s=n(69),u=e.removeAsync=a.removeItemAsync.bind(a),c=function(t,e){try{t=JSON.parse(t)}catch(t){return null}if(t){return t.expiredAt&&t.expiredAt<Date.now()?u(e).then(function(){return null}):t.value}return null};e.getAsync=function(t){var e;return t=(0,i.default)(e="AV/".concat(s.applicationId,"/")).call(e,t),a.getItemAsync(t).then(function(e){return c(e,t)})},e.setAsync=function(t,e,n){var r,u={value:e};return"number"==typeof n&&(u.expiredAt=Date.now()+n),a.setItemAsync((0,i.default)(r="AV/".concat(s.applicationId,"/")).call(r,t),(0,o.default)(u))}},function(t,e,n){var r=n(412);t.exports=r},function(t,e,n){var r=n(415);t.exports=r},function(t,e,n){var r=n(418);t.exports=r},function(t,e,n){t.exports=n(421)},function(t,e,n){var r=n(424);n(44),t.exports=r},function(t,e,n){n(425),n(427),n(428),n(224),n(429)},function(t,e,n){var r=n(61),i=n(32),o=n(102).f,a=n(426),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],u=function(t){try{return o(t)}catch(t){return a(s)}};t.exports.f=function(t){return s&&"Window"==r(t)?u(t):o(i(t))}},function(t,e,n){var r=n(15),i=n(18),o=n(9),a=n(43);t.exports=function(){var t=i("Symbol"),e=t&&t.prototype,n=e&&e.valueOf,s=o("toPrimitive");e&&!e[s]&&a(e,s,function(t){return r(n,this)},{arity:1})}},function(t,e,n){var r=n(62);t.exports=r&&!!Symbol.for&&!!Symbol.keyFor},function(t,e,n){n(10)("iterator")},function(t,e,n){t.exports=n(460)},function(t,e,n){"use strict";var r;t.exports.timeout=function(t,e){var n,i=new r;return Promise.race([t,new Promise(function(t,r){n=setTimeout(function(){r(i)},e)})]).then(function(t){return clearTimeout(n),t},function(t){throw clearTimeout(n),t})};r=t.exports.TimeoutError=function(){Error.call(this),this.stack=Error().stack,this.message="Timeout"},r.prototype=Object.create(Error.prototype),r.prototype.name="TimeoutError"},function(t,e,n){t.exports=n(246)},function(t,e,n){var r=n(476);t.exports=r},function(t,e,n){t.exports=n(237)},function(t,e,n){t.exports=n(480)},function(t,e,n){"use strict";var r=n(4),i=n(31),o=n(11),a=n(12),s=n(109),u=n(74),c=Function,f=r([].concat),l=r([].join),h={},d=function(t,e,n){if(!a(h,e)){for(var r=[],i=0;i<e;i++)r[i]="a["+i+"]";h[e]=c("C,a","return new C("+l(r,",")+")")}return h[e](t,n)};t.exports=u?c.bind:function(t){var e=i(this),n=e.prototype,r=s(arguments,1),a=function(){var n=f(r,s(arguments));return this instanceof a?d(e,n.length,n):e.apply(t,n)};return o(n)&&(a.prototype=n),a}},function(t,e,n){t.exports=n(501)},function(t,e,n){t.exports=n(504)},function(t,e){var n={utf8:{stringToBytes:function(t){return n.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(n.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],n=0;n<t.length;n++)e.push(255&t.charCodeAt(n));return e},bytesToString:function(t){for(var e=[],n=0;n<t.length;n++)e.push(String.fromCharCode(t[n]));return e.join("")}}};t.exports=n},function(t,e,n){t.exports=n(548)},function(t,e,n){var r=n(2);t.exports=!r(function(){return Object.isExtensible(Object.preventExtensions({}))})},function(t,e,n){var r=n(2),i=n(11),o=n(61),a=n(571),s=Object.isExtensible,u=r(function(){s(1)});t.exports=u||a?function(t){return!!i(t)&&((!a||"ArrayBuffer"!=o(t))&&(!s||s(t)))}:s},function(t,e,n){t.exports=n(572)},function(t,e,n){t.exports=n(576)},function(t,e,n){"use strict";var r=n(0),i=n(7),o=n(93),a=n(2),s=n(37),u=n(40),c=n(107),f=n(8),l=n(11),h=n(52),d=n(23).f,p=n(70).forEach,v=n(14),g=n(42),m=g.set,y=g.getterFor;t.exports=function(t,e,n){var g,b=-1!==t.indexOf("Map"),_=-1!==t.indexOf("Weak"),w=b?"set":"add",E=i[t],O=E&&E.prototype,T={};if(v&&f(E)&&(_||O.forEach&&!a(function(){(new E).entries().next()}))){g=e(function(e,n){m(c(e,S),{type:t,collection:new E}),void 0!=n&&u(n,e[w],{that:e,AS_ENTRIES:b})});var S=g.prototype,A=y(t);p(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(t){var e="add"==t||"set"==t;t in O&&(!_||"clear"!=t)&&s(S,t,function(n,r){var i=A(this).collection;if(!e&&_&&!l(n))return"get"==t&&void 0;var o=i[t](0===n?0:n,r);return e?this:o})}),_||d(S,"size",{configurable:!0,get:function(){return A(this).collection.size}})}else g=n.getConstructor(e,t,b,w),o.enable();return h(g,t,!1,!0),T[t]=g,r({global:!0,forced:!0},T),_||n.setStrong(g,t,b),g}},function(t,e,n){t.exports=n(598)},function(t,e){function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}t.exports=n},function(t,e){function n(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}t.exports=n},function(t,e,n){function r(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}var i=n(260);t.exports=r},function(t,e,n){function r(t,e){var n=-1,r=t.length,o=r-1;for(e=void 0===e?r:e;++n<e;){var a=i(n,o),s=t[a];t[a]=t[n],t[n]=s}return t.length=e,t}var i=n(622);t.exports=r},function(t,e,n){function r(t){return null==t?[]:i(t,o(t))}var i=n(624),o=n(626);t.exports=r},function(t,e,n){var r=n(266),i=r.Symbol;t.exports=i},function(t,e,n){var r=n(267),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(e,n(72))},function(t,e){var n=Array.isArray;t.exports=n},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){function n(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}var r=9007199254740991;t.exports=n},function(t,e){function n(t,e){return function(n){return t(e(n))}}t.exports=n},function(t,e,n){"use strict";var r=n(273),i=n(565);t.exports=i(r)},function(t,e,n){"use strict";t.exports=n(274)},function(t,e,n){"use strict";var r=n(1),i=r(n(13)),o=n(3),a=n(69);a._=o,a.version=n(229),a.Promise=i.default,a.localStorage=n(231),a.Cache=n(232),a.Error=n(46),n(414),n(464)(a),n(465)(a),n(466)(a),n(467)(a),n(472)(a),n(473)(a),n(526)(a),n(551)(a),n(552)(a),n(554)(a),n(555)(a),n(556)(a),n(557)(a),n(558)(a),n(559)(a),n(560)(a),n(561)(a),n(562)(a),a.Conversation=n(563),n(564),t.exports=a},function(t,e,n){var r=n(276);n(44),t.exports=r},function(t,e,n){n(277),n(41),n(63),n(293),n(307),n(308),n(309),n(65);var r=n(6);t.exports=r.Promise},function(t,e,n){n(278)},function(t,e,n){"use strict";var r=n(0),i=n(19),o=n(99),a=n(101),s=n(283),u=n(49),c=n(37),f=n(47),l=n(286),h=n(287),d=n(40),p=n(288),v=n(9),g=n(289),m=v("toStringTag"),y=Error,b=[].push,_=function(t,e){var n,r=arguments.length>2?arguments[2]:void 0,s=i(w,this);a?n=a(new y,s?o(this):w):(n=s?this:u(w),c(n,m,"Error")),void 0!==e&&c(n,"message",p(e)),g&&c(n,"stack",l(n.stack,1)),h(n,r);var f=[];return d(t,b,{that:f}),c(n,"errors",f),n};a?a(_,y):s(_,y,{name:!0});var w=_.prototype=u(y.prototype,{constructor:f(1,_),message:f(1,""),name:f(1,"AggregateError")});r({global:!0,constructor:!0,arity:2},{AggregateError:_})},function(t,e,n){var r=n(15),i=n(11),o=n(96),a=n(121),s=n(280),u=n(9),c=TypeError,f=u("toPrimitive");t.exports=function(t,e){if(!i(t)||o(t))return t;var n,u=a(t,f);if(u){if(void 0===e&&(e="default"),n=r(u,t,e),!i(n)||o(n))return n;throw c("Can't convert object to primitive value")}return void 0===e&&(e="number"),s(t,e)}},function(t,e,n){var r=n(15),i=n(8),o=n(11),a=TypeError;t.exports=function(t,e){var n,s;if("string"===e&&i(n=t.toString)&&!o(s=r(n,t)))return s;if(i(n=t.valueOf)&&!o(s=r(n,t)))return s;if("string"!==e&&i(n=t.toString)&&!o(s=r(n,t)))return s;throw a("Can't convert object to primitive value")}},function(t,e,n){var r=n(7),i=Object.defineProperty;t.exports=function(t,e){try{i(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},function(t,e,n){var r=n(8),i=String,o=TypeError;t.exports=function(t){if("object"==typeof t||r(t))return t;throw o("Can't set "+i(t)+" as a prototype")}},function(t,e,n){var r=n(12),i=n(156),o=n(60),a=n(23);t.exports=function(t,e,n){for(var s=i(e),u=a.f,c=o.f,f=0;f<s.length;f++){var l=s[f];r(t,l)||n&&r(n,l)||u(t,l,c(e,l))}}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var e=+t;return(e>0?r:n)(e)}},function(t,e,n){var r=n(125),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){var r=n(4),i=Error,o=r("".replace),a=function(t){return String(i("zxcasd").stack)}(),s=/\n\s*at [^:]*:[^\n]*/,u=s.test(a);t.exports=function(t,e){if(u&&"string"==typeof t&&!i.prepareStackTrace)for(;e--;)t=o(t,s,"");return t}},function(t,e,n){var r=n(11),i=n(37);t.exports=function(t,e){r(e)&&"cause"in e&&i(t,"cause",e.cause)}},function(t,e,n){var r=n(79);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:r(t)}},function(t,e,n){var r=n(2),i=n(47);t.exports=!r(function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",i(1,7)),7!==t.stack)})},function(t,e,n){var r=n(14),i=n(12),o=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=i(o,"name"),u=s&&"something"===function(){}.name,c=s&&(!r||r&&a(o,"name").configurable);t.exports={EXISTS:s,PROPER:u,CONFIGURABLE:c}},function(t,e,n){"use strict";var r=n(165).IteratorPrototype,i=n(49),o=n(47),a=n(52),s=n(50),u=function(){return this};t.exports=function(t,e,n,c){var f=e+" Iterator";return t.prototype=i(r,{next:o(+!c,n)}),a(t,f,!1,!0),s[f]=u,t}},function(t,e,n){"use strict";var r=n(128),i=n(51);t.exports=r?{}.toString:function(){return"[object "+i(this)+"]"}},function(t,e,n){n(294),n(302),n(303),n(304),n(305),n(306)},function(t,e,n){"use strict";var r,i,o,a=n(0),s=n(33),u=n(106),c=n(7),f=n(15),l=n(43),h=n(101),d=n(52),p=n(166),v=n(31),g=n(8),m=n(11),y=n(107),b=n(167),_=n(169).set,w=n(296),E=n(299),O=n(80),T=n(300),S=n(42),A=n(64),x=n(81),I=n(53),j=x.CONSTRUCTOR,C=x.REJECTION_EVENT,N=x.SUBCLASSING,P=S.getterFor("Promise"),R=S.set,U=A&&A.prototype,k=A,L=U,M=c.TypeError,D=c.document,F=c.process,B=I.f,V=B,q=!!(D&&D.createEvent&&c.dispatchEvent),W=function(t){var e;return!(!m(t)||!g(e=t.then))&&e},Y=function(t,e){var n,r,i,o=e.value,a=1==e.state,s=a?t.ok:t.fail,u=t.resolve,c=t.reject,l=t.domain;try{s?(a||(2===e.rejection&&J(e),e.rejection=1),!0===s?n=o:(l&&l.enter(),n=s(o),l&&(l.exit(),i=!0)),n===t.promise?c(M("Promise-chain cycle")):(r=W(n))?f(r,n,u,c):u(n)):c(o)}catch(t){l&&!i&&l.exit(),c(t)}},z=function(t,e){t.notified||(t.notified=!0,w(function(){for(var n,r=t.reactions;n=r.get();)Y(n,t);t.notified=!1,e&&!t.rejection&&K(t)}))},G=function(t,e,n){var r,i;q?(r=D.createEvent("Event"),r.promise=e,r.reason=n,r.initEvent(t,!1,!0),c.dispatchEvent(r)):r={promise:e,reason:n},!C&&(i=c["on"+t])?i(r):"unhandledrejection"===t&&E("Unhandled promise rejection",n)},K=function(t){f(_,c,function(){var e,n=t.facade,r=t.value,i=Q(t);if(i&&(e=O(function(){u?F.emit("unhandledRejection",r,n):G("unhandledrejection",n,r)}),t.rejection=u||Q(t)?2:1,e.error))throw e.value})},Q=function(t){return 1!==t.rejection&&!t.parent},J=function(t){f(_,c,function(){var e=t.facade;u?F.emit("rejectionHandled",e):G("rejectionhandled",e,t.value)})},$=function(t,e,n){return function(r){t(e,r,n)}},H=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,z(t,!0))},Z=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw M("Promise can't be resolved itself");var r=W(e);r?w(function(){var n={done:!1};try{f(r,e,$(Z,n,t),$(H,n,t))}catch(e){H(n,e,t)}}):(t.value=e,t.state=1,z(t,!1))}catch(e){H({done:!1},e,t)}}};if(j&&(k=function(t){y(this,L),v(t),f(r,this);var e=P(this);try{t($(Z,e),$(H,e))}catch(t){H(e,t)}},L=k.prototype,r=function(t){R(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:new T,rejection:!1,state:0,value:void 0})},r.prototype=l(L,"then",function(t,e){var n=P(this),r=B(b(this,k));return n.parent=!0,r.ok=!g(t)||t,r.fail=g(e)&&e,r.domain=u?F.domain:void 0,0==n.state?n.reactions.add(r):w(function(){Y(r,n)}),r.promise}),i=function(){var t=new r,e=P(t);this.promise=t,this.resolve=$(Z,e),this.reject=$(H,e)},I.f=B=function(t){return t===k||void 0===t?new i(t):V(t)},!s&&g(A)&&U!==Object.prototype)){o=U.then,N||l(U,"then",function(t,e){var n=this;return new k(function(t,e){f(o,n,t,e)}).then(t,e)},{unsafe:!0});try{delete U.constructor}catch(t){}h&&h(U,L)}a({global:!0,constructor:!0,wrap:!0,forced:j},{Promise:k}),d(k,"Promise",!1,!0),p("Promise")},function(t,e){var n=TypeError;t.exports=function(t,e){if(t<e)throw n("Not enough arguments");return t}},function(t,e,n){var r,i,o,a,s,u,c,f,l=n(7),h=n(48),d=n(60).f,p=n(169).set,v=n(170),g=n(297),m=n(298),y=n(106),b=l.MutationObserver||l.WebKitMutationObserver,_=l.document,w=l.process,E=l.Promise,O=d(l,"queueMicrotask"),T=O&&O.value;T||(r=function(){var t,e;for(y&&(t=w.domain)&&t.exit();i;){e=i.fn,i=i.next;try{e()}catch(t){throw i?a():o=void 0,t}}o=void 0,t&&t.enter()},v||y||m||!b||!_?!g&&E&&E.resolve?(c=E.resolve(void 0),c.constructor=E,f=h(c.then,c),a=function(){f(r)}):y?a=function(){w.nextTick(r)}:(p=h(p,l),a=function(){p(r)}):(s=!0,u=_.createTextNode(""),new b(r).observe(u,{characterData:!0}),a=function(){u.data=s=!s})),t.exports=T||function(t){var e={fn:t,next:void 0};o&&(o.next=e),i||(i=e,a()),o=e}},function(t,e,n){var r=n(97),i=n(7);t.exports=/ipad|iphone|ipod/i.test(r)&&void 0!==i.Pebble},function(t,e,n){var r=n(97);t.exports=/web0s(?!.*chrome)/i.test(r)},function(t,e,n){var r=n(7);t.exports=function(t,e){var n=r.console;n&&n.error&&(1==arguments.length?n.error(t):n.error(t,e))}},function(t,e){var n=function(){this.head=null,this.tail=null};n.prototype={add:function(t){var e={item:t,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}},t.exports=n},function(t,e){t.exports="object"==typeof window&&"object"!=typeof Deno},function(t,e,n){"use strict";var r=n(0),i=n(15),o=n(31),a=n(53),s=n(80),u=n(40);r({target:"Promise",stat:!0,forced:n(171)},{all:function(t){var e=this,n=a.f(e),r=n.resolve,c=n.reject,f=s(function(){var n=o(e.resolve),a=[],s=0,f=1;u(t,function(t){var o=s++,u=!1;f++,i(n,e,t).then(function(t){u||(u=!0,a[o]=t,--f||r(a))},c)}),--f||r(a)});return f.error&&c(f.value),n.promise}})},function(t,e,n){"use strict";var r=n(0),i=n(33),o=n(81).CONSTRUCTOR,a=n(64),s=n(18),u=n(8),c=n(43),f=a&&a.prototype;if(r({target:"Promise",proto:!0,forced:o,real:!0},{catch:function(t){return this.then(void 0,t)}}),!i&&u(a)){var l=s("Promise").prototype.catch;f.catch!==l&&c(f,"catch",l,{unsafe:!0})}},function(t,e,n){"use strict";var r=n(0),i=n(15),o=n(31),a=n(53),s=n(80),u=n(40);r({target:"Promise",stat:!0,forced:n(171)},{race:function(t){var e=this,n=a.f(e),r=n.reject,c=s(function(){var a=o(e.resolve);u(t,function(t){i(a,e,t).then(n.resolve,r)})});return c.error&&r(c.value),n.promise}})},function(t,e,n){"use strict";var r=n(0),i=n(15),o=n(53);r({target:"Promise",stat:!0,forced:n(81).CONSTRUCTOR},{reject:function(t){var e=o.f(this);return i(e.reject,void 0,t),e.promise}})},function(t,e,n){"use strict";var r=n(0),i=n(18),o=n(33),a=n(64),s=n(81).CONSTRUCTOR,u=n(173),c=i("Promise"),f=o&&!s;r({target:"Promise",stat:!0,forced:o||s},{resolve:function(t){return u(f&&this===c?a:this,t)}})},function(t,e,n){"use strict";var r=n(0),i=n(15),o=n(31),a=n(53),s=n(80),u=n(40);r({target:"Promise",stat:!0},{allSettled:function(t){var e=this,n=a.f(e),r=n.resolve,c=n.reject,f=s(function(){var n=o(e.resolve),a=[],s=0,c=1;u(t,function(t){var o=s++,u=!1;c++,i(n,e,t).then(function(t){u||(u=!0,a[o]={status:"fulfilled",value:t},--c||r(a))},function(t){u||(u=!0,a[o]={status:"rejected",reason:t},--c||r(a))})}),--c||r(a)});return f.error&&c(f.value),n.promise}})},function(t,e,n){"use strict";var r=n(0),i=n(15),o=n(31),a=n(18),s=n(53),u=n(80),c=n(40);r({target:"Promise",stat:!0},{any:function(t){var e=this,n=a("AggregateError"),r=s.f(e),f=r.resolve,l=r.reject,h=u(function(){var r=o(e.resolve),a=[],s=0,u=1,h=!1;c(t,function(t){var o=s++,c=!1;u++,i(r,e,t).then(function(t){c||h||(h=!0,f(t))},function(t){c||h||(c=!0,a[o]=t,--u||l(new n(a,"No one promise resolved")))})}),--u||l(new n(a,"No one promise resolved"))});return h.error&&l(h.value),r.promise}})},function(t,e,n){"use strict";var r=n(0),i=n(33),o=n(64),a=n(2),s=n(18),u=n(8),c=n(167),f=n(173),l=n(43),h=o&&o.prototype;if(r({target:"Promise",proto:!0,real:!0,forced:!!o&&a(function(){h.finally.call({then:function(){}},function(){})})},{finally:function(t){var e=c(this,s("Promise")),n=u(t);return this.then(n?function(n){return f(e,t()).then(function(){return n})}:t,n?function(n){return f(e,t()).then(function(){throw n})}:t)}}),!i&&u(o)){var d=s("Promise").prototype.finally;h.finally!==d&&l(h,"finally",d,{unsafe:!0})}},function(t,e,n){var r=n(4),i=n(125),o=n(79),a=n(120),s=r("".charAt),u=r("".charCodeAt),c=r("".slice),f=function(t){return function(e,n){var r,f,l=o(a(e)),h=i(n),d=l.length;return h<0||h>=d?t?"":void 0:(r=u(l,h),r<55296||r>56319||h+1===d||(f=u(l,h+1))<56320||f>57343?t?s(l,h):r:t?c(l,h,h+2):f-56320+(r-55296<<10)+65536)}};t.exports={codeAt:f(!1),charAt:f(!0)}},function(t,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(t,e,n){"use strict";var r=n(131),i=Object(r.mixin)(r);i._=i,e.a=i},function(t,e,n){"use strict";function r(t){return null===t}e.a=r},function(t,e,n){"use strict";function r(t){return!(!t||1!==t.nodeType)}e.a=r},function(t,e,n){"use strict";var r=n(17);e.a=Object(r.a)("Date")},function(t,e,n){"use strict";var r=n(17);e.a=Object(r.a)("RegExp")},function(t,e,n){"use strict";var r=n(17);e.a=Object(r.a)("Error")},function(t,e,n){"use strict";var r=n(17);e.a=Object(r.a)("Object")},function(t,e,n){"use strict";function r(t){return!Object(o.a)(t)&&Object(i.f)(t)&&!isNaN(parseFloat(t))}e.a=r;var i=n(5),o=n(177)},function(t,e,n){"use strict";var r=n(182),i=n(135);e.a=Object(r.a)(i.a)},function(t,e,n){"use strict";function r(t){if(null==t)return!0;var e=Object(i.a)(t);return"number"==typeof e&&(Object(o.a)(t)||Object(a.a)(t)||Object(s.a)(t))?0===e:0===Object(i.a)(Object(u.a)(t))}e.a=r;var i=n(29),o=n(55),a=n(132),s=n(134),u=n(16)},function(t,e,n){"use strict";function r(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!==t)return e!==e;var o=typeof t;return("function"===o||"object"===o||"object"==typeof e)&&i(t,e,n,r)}function i(t,e,n,o){t instanceof a.a&&(t=t._wrapped),e instanceof a.a&&(e=e._wrapped);var m=s.t.call(t);if(m!==s.t.call(e))return!1;if(l.a&&"[object Object]"==m&&Object(h.a)(t)){if(!Object(h.a)(e))return!1;m=g}switch(m){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return s.d.valueOf.call(t)===s.d.valueOf.call(e);case"[object ArrayBuffer]":case g:return i(Object(v.a)(t),Object(v.a)(e),n,o)}var y="[object Array]"===m;if(!y&&Object(c.a)(t)){if(Object(u.a)(t)!==Object(u.a)(e))return!1;if(t.buffer===e.buffer&&t.byteOffset===e.byteOffset)return!0;y=!0}if(!y){if("object"!=typeof t||"object"!=typeof e)return!1;var b=t.constructor,_=e.constructor;if(b!==_&&!(Object(f.a)(b)&&b instanceof b&&Object(f.a)(_)&&_ instanceof _)&&"constructor"in t&&"constructor"in e)return!1}n=n||[],o=o||[];for(var w=n.length;w--;)if(n[w]===t)return o[w]===e;if(n.push(t),o.push(e),y){if((w=t.length)!==e.length)return!1;for(;w--;)if(!r(t[w],e[w],n,o))return!1}else{var E,O=Object(d.a)(t);if(w=O.length,Object(d.a)(e).length!==w)return!1;for(;w--;)if(E=O[w],!Object(p.a)(e,E)||!r(t[E],e[E],n,o))return!1}return n.pop(),o.pop(),!0}function o(t,e){return r(t,e)}e.a=o;var a=n(25),s=n(5),u=n(135),c=n(180),f=n(28),l=n(82),h=n(133),d=n(16),p=n(45),v=n(323),g="[object DataView]"},function(t,e,n){"use strict";function r(t){return new Uint8Array(t.buffer||t,t.byteOffset||0,Object(i.a)(t))}e.a=r;var i=n(135)},function(t,e,n){"use strict";var r=n(17),i=n(82),o=n(136);e.a=i.b?Object(o.a)(o.b):Object(r.a)("Map")},function(t,e,n){"use strict";var r=n(17),i=n(82),o=n(136);e.a=i.b?Object(o.a)(o.d):Object(r.a)("WeakMap")},function(t,e,n){"use strict";var r=n(17),i=n(82),o=n(136);e.a=i.b?Object(o.a)(o.c):Object(r.a)("Set")},function(t,e,n){"use strict";var r=n(17);e.a=Object(r.a)("WeakSet")},function(t,e,n){"use strict";function r(t){for(var e=Object(i.a)(t),n=e.length,r=Array(n),o=0;o<n;o++)r[o]=[e[o],t[e[o]]];return r}e.a=r;var i=n(16)},function(t,e,n){"use strict";function r(t,e){var n=Object(i.a)(t);return e&&Object(o.a)(n,e),n}e.a=r;var i=n(190),o=n(138)},function(t,e,n){"use strict";function r(t,e){return e(t),t}e.a=r},function(t,e,n){"use strict";function r(t,e){e=Object(o.a)(e);for(var n=e.length,r=0;r<n;r++){var a=e[r];if(!Object(i.a)(t,a))return!1;t=t[a]}return!!n}e.a=r;var i=n(45),o=n(84)},function(t,e,n){"use strict";function r(t,e,n){e=Object(i.a)(e,n);for(var r=Object(o.a)(t),a=r.length,s={},u=0;u<a;u++){var c=r[u];s[c]=e(t[c],c,t)}return s}e.a=r;var i=n(21),o=n(16)},function(t,e,n){"use strict";function r(t){return null==t?i.a:function(e){return Object(o.a)(t,e)}}e.a=r;var i=n(196),o=n(192)},function(t,e,n){"use strict";function r(t,e,n){var r=Array(Math.max(0,t));e=Object(i.a)(e,n,1);for(var o=0;o<t;o++)r[o]=e(o);return r}e.a=r;var i=n(85)},function(t,e,n){"use strict";var r=n(198),i=n(199);e.a=Object(r.a)(i.a)},function(t,e,n){"use strict";var r=n(198),i=n(337);e.a=Object(r.a)(i.a)},function(t,e,n){"use strict";var r=n(186),i=n(199);e.a=Object(r.a)(i.a)},function(t,e,n){"use strict";function r(t){return"\\"+u[t]}function i(t,e,n){!e&&n&&(e=n),e=Object(o.a)({},e,a.a.templateSettings);var i=RegExp([(e.escape||s).source,(e.interpolate||s).source,(e.evaluate||s).source].join("|")+"|$","g"),u=0,l="__p+='";t.replace(i,function(e,n,i,o,a){return l+=t.slice(u,a).replace(c,r),u=a+e.length,n?l+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":i?l+="'+\n((__t=("+i+"))==null?'':__t)+\n'":o&&(l+="';\n"+o+"\n__p+='"),e}),l+="';\n";var h=e.variable;if(h){if(!f.test(h))throw new Error(h)}else l="with(obj||{}){\n"+l+"}\n",h="obj";l="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+l+"return __p;\n";var d;try{d=new Function(h,"_",l)}catch(t){throw t.source=l,t}var p=function(t){return d.call(this,t,a.a)};return p.source="function("+h+"){\n"+l+"}",p}e.a=i;var o=n(189),a=n(25),s=(n(200),/(.)^/),u={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},c=/\\|'|\r|\n|\u2028|\u2029/g,f=/^\s*(\w|\$)+\s*$/},function(t,e,n){"use strict";function r(t,e,n){e=Object(o.a)(e);var r=e.length;if(!r)return Object(i.a)(n)?n.call(t):n;for(var a=0;a<r;a++){var s=null==t?void 0:t[e[a]];void 0===s&&(s=n,a=r),t=Object(i.a)(s)?s.call(t):s}return t}e.a=r;var i=n(28),o=n(84)},function(t,e,n){"use strict";function r(t){var e=++i+"";return t?t+e:e}e.a=r;var i=0},function(t,e,n){"use strict";function r(t){var e=Object(i.a)(t);return e._chain=!0,e}e.a=r;var i=n(25)},function(t,e,n){"use strict";var r=n(24),i=n(67),o=n(202);e.a=Object(r.a)(function(t,e){e=Object(i.a)(e,!1,!1);var n=e.length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=e[n];t[r]=Object(o.a)(t[r],t)}return t})},function(t,e,n){"use strict";function r(t,e){var n=function(r){var o=n.cache,a=""+(e?e.apply(this,arguments):r);return Object(i.a)(o,a)||(o[a]=t.apply(this,arguments)),o[a]};return n.cache={},n}e.a=r;var i=n(45)},function(t,e,n){"use strict";var r=n(111),i=n(203),o=n(25);e.a=Object(r.a)(i.a,o.a,1)},function(t,e,n){"use strict";function r(t,e,n){var r,o,a,s,u=0;n||(n={});var c=function(){u=!1===n.leading?0:Object(i.a)(),r=null,s=t.apply(o,a),r||(o=a=null)},f=function(){var f=Object(i.a)();u||!1!==n.leading||(u=f);var l=e-(f-u);return o=this,a=arguments,l<=0||l>e?(r&&(clearTimeout(r),r=null),u=f,s=t.apply(o,a),r||(o=a=null)):r||!1===n.trailing||(r=setTimeout(c,l)),s};return f.cancel=function(){clearTimeout(r),u=0,r=o=a=null},f}e.a=r;var i=n(142)},function(t,e,n){"use strict";function r(t,e,n){var r,a,s,u,c,f=function(){var i=Object(o.a)()-a;e>i?r=setTimeout(f,e-i):(r=null,n||(u=t.apply(c,s)),r||(s=c=null))},l=Object(i.a)(function(i){return c=this,s=i,a=Object(o.a)(),r||(r=setTimeout(f,e),n&&(u=t.apply(c,s))),u});return l.cancel=function(){clearTimeout(r),r=s=c=null},l}e.a=r;var i=n(24),o=n(142)},function(t,e,n){"use strict";function r(t,e){return Object(i.a)(e,t)}e.a=r;var i=n(111)},function(t,e,n){"use strict";function r(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}}e.a=r},function(t,e,n){"use strict";function r(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}e.a=r},function(t,e,n){"use strict";var r=n(111),i=n(204);e.a=Object(r.a)(i.a,2)},function(t,e,n){"use strict";var r=n(207),i=n(210);e.a=Object(i.a)(-1,r.a)},function(t,e,n){"use strict";function r(t,e){return Object(i.a)(t,Object(o.a)(e))}e.a=r;var i=n(211),o=n(110)},function(t,e,n){"use strict";var r=n(212);e.a=Object(r.a)(1)},function(t,e,n){"use strict";var r=n(212);e.a=Object(r.a)(-1)},function(t,e,n){"use strict";function r(t,e,n){return Object(i.a)(t,Object(o.a)(Object(a.a)(e)),n)}e.a=r;var i=n(86),o=n(143),a=n(21)},function(t,e,n){"use strict";function r(t,e,n){e=Object(i.a)(e,n);for(var r=!Object(o.a)(t)&&Object(a.a)(t),s=(r||t).length,u=0;u<s;u++){var c=r?r[u]:u;if(!e(t[c],c,t))return!1}return!0}e.a=r;var i=n(21),o=n(26),a=n(16)},function(t,e,n){"use strict";function r(t,e,n){e=Object(i.a)(e,n);for(var r=!Object(o.a)(t)&&Object(a.a)(t),s=(r||t).length,u=0;u<s;u++){var c=r?r[u]:u;if(e(t[c],c,t))return!0}return!1}e.a=r;var i=n(21),o=n(26),a=n(16)},function(t,e,n){"use strict";var r=n(24),i=n(28),o=n(68),a=n(139),s=n(84);e.a=Object(r.a)(function(t,e,n){var r,u;return Object(i.a)(e)?u=e:(e=Object(s.a)(e),r=e.slice(0,-1),e=e[e.length-1]),Object(o.a)(t,function(t){var i=u;if(!i){if(r&&r.length&&(t=Object(a.a)(t,r)),null==t)return;i=t[e]}return null==i?i:i.apply(t,n)})})},function(t,e,n){"use strict";function r(t,e){return Object(i.a)(t,Object(o.a)(e))}e.a=r;var i=n(86),o=n(110)},function(t,e,n){"use strict";function r(t,e,n){var r,u,c=1/0,f=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t){t=Object(i.a)(t)?t:Object(o.a)(t);for(var l=0,h=t.length;l<h;l++)null!=(r=t[l])&&r<c&&(c=r)}else e=Object(a.a)(e,n),Object(s.a)(t,function(t,n,r){((u=e(t,n,r))<f||u===1/0&&c===1/0)&&(c=t,f=u)});return c}e.a=r;var i=n(26),o=n(66),a=n(21),s=n(56)},function(t,e,n){"use strict";function r(t){return Object(i.a)(t,1/0)}e.a=r;var i=n(214)},function(t,e,n){"use strict";function r(t,e,n){var r=0;return e=Object(i.a)(e,n),Object(o.a)(Object(a.a)(t,function(t,n,i){return{value:t,index:r++,criteria:e(t,n,i)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index}),"value")}e.a=r;var i=n(21),o=n(145),a=n(68)},function(t,e,n){"use strict";var r=n(112),i=n(45);e.a=Object(r.a)(function(t,e,n){Object(i.a)(t,n)?t[n].push(e):t[n]=[e]})},function(t,e,n){"use strict";var r=n(112);e.a=Object(r.a)(function(t,e,n){t[n]=e})},function(t,e,n){"use strict";var r=n(112),i=n(45);e.a=Object(r.a)(function(t,e,n){Object(i.a)(t,n)?t[n]++:t[n]=1})},function(t,e,n){"use strict";var r=n(112);e.a=Object(r.a)(function(t,e,n){t[n?0:1].push(e)},!0)},function(t,e,n){"use strict";function r(t){return t?Object(i.a)(t)?o.q.call(t):Object(a.a)(t)?t.match(l):Object(s.a)(t)?Object(u.a)(t,c.a):Object(f.a)(t):[]}e.a=r;var i=n(55),o=n(5),a=n(132),s=n(26),u=n(68),c=n(140),f=n(66),l=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g},function(t,e,n){"use strict";function r(t){return null==t?0:Object(i.a)(t)?t.length:Object(o.a)(t).length}e.a=r;var i=n(26),o=n(16)},function(t,e,n){"use strict";function r(t,e,n){return e in n}e.a=r},function(t,e,n){"use strict";var r=n(24),i=n(28),o=n(143),a=n(68),s=n(67),u=n(87),c=n(215);e.a=Object(r.a)(function(t,e){var n,r=e[0];return Object(i.a)(r)?(r=Object(o.a)(r),e.length>1&&(n=e[1])):(e=Object(a.a)(Object(s.a)(e,!1,!1),String),r=function(t,n){return!Object(u.a)(e,n)}),Object(c.a)(t,r,n)})},function(t,e,n){"use strict";function r(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[0]:Object(i.a)(t,t.length-e)}e.a=r;var i=n(216)},function(t,e,n){"use strict";function r(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[t.length-1]:Object(i.a)(t,Math.max(0,t.length-e))}e.a=r;var i=n(217)},function(t,e,n){"use strict";function r(t){return Object(i.a)(t,Boolean)}e.a=r;var i=n(86)},function(t,e,n){"use strict";function r(t,e){return Object(i.a)(t,e,!1)}e.a=r;var i=n(67)},function(t,e,n){"use strict";var r=n(24),i=n(218);e.a=Object(r.a)(function(t,e){return Object(i.a)(t,e)})},function(t,e,n){"use strict";var r=n(24),i=n(219),o=n(67);e.a=Object(r.a)(function(t){return Object(i.a)(Object(o.a)(t,!0,!0))})},function(t,e,n){"use strict";function r(t){for(var e=[],n=arguments.length,r=0,a=Object(i.a)(t);r<a;r++){var s=t[r];if(!Object(o.a)(e,s)){var u;for(u=1;u<n&&Object(o.a)(arguments[u],s);u++);u===n&&e.push(s)}}return e}e.a=r;var i=n(29),o=n(87)},function(t,e,n){"use strict";var r=n(24),i=n(220);e.a=Object(r.a)(i.a)},function(t,e,n){"use strict";function r(t,e){for(var n={},r=0,o=Object(i.a)(t);r<o;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n}e.a=r;var i=n(29)},function(t,e,n){"use strict";function r(t,e,n){null==e&&(e=t||0,t=0),n||(n=e<t?-1:1);for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;o<r;o++,t+=n)i[o]=t;return i}e.a=r},function(t,e,n){"use strict";function r(t,e){if(null==e||e<1)return[];for(var n=[],r=0,o=t.length;r<o;)n.push(i.q.call(t,r,r+=e));return n}e.a=r;var i=n(5)},function(t,e,n){"use strict";function r(t){return Object(o.a)(Object(a.a)(t),function(e){var n=i.a[e]=t[e];i.a.prototype[e]=function(){var t=[this._wrapped];return s.o.apply(t,arguments),Object(u.a)(this,n.apply(i.a,t))}}),i.a}e.a=r;var i=n(25),o=n(56),a=n(187),s=n(5),u=n(221)},function(t,e,n){"use strict";var r=n(25),i=n(56),o=n(5),a=n(221);Object(i.a)(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=o.a[t];r.a.prototype[t]=function(){var n=this._wrapped;return null!=n&&(e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0]),Object(a.a)(this,n)}}),Object(i.a)(["concat","join","slice"],function(t){var e=o.a[t];r.a.prototype[t]=function(){var t=this._wrapped;return null!=t&&(t=e.apply(t,arguments)),Object(a.a)(this,t)}}),e.a=r.a},function(t,e,n){var r=n(385);t.exports=r},function(t,e,n){var r=n(19),i=n(386),o=Array.prototype;t.exports=function(t){var e=t.concat;return t===o||r(o,t)&&e===o.concat?i:e}},function(t,e,n){n(222);var r=n(38);t.exports=r("Array").concat},function(t,e){var n=TypeError;t.exports=function(t){if(t>9007199254740991)throw n("Maximum allowed index exceeded");return t}},function(t,e,n){var r=n(88),i=n(108),o=n(11),a=n(9),s=a("species"),u=Array;t.exports=function(t){var e;return r(t)&&(e=t.constructor,i(e)&&(e===u||r(e.prototype))?e=void 0:o(e)&&null===(e=e[s])&&(e=void 0)),void 0===e?u:e}},function(t,e,n){var r=n(390);t.exports=r},function(t,e,n){var r=n(19),i=n(391),o=Array.prototype;t.exports=function(t){var e=t.map;return t===o||r(o,t)&&e===o.map?i:e}},function(t,e,n){n(392);var r=n(38);t.exports=r("Array").map},function(t,e,n){"use strict";var r=n(0),i=n(70).map;r({target:"Array",proto:!0,forced:!n(113)("map")},{map:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){var r=n(394);t.exports=r},function(t,e,n){n(395);var r=n(6);t.exports=r.Object.keys},function(t,e,n){var r=n(0),i=n(34),o=n(104);r({target:"Object",stat:!0,forced:n(2)(function(){o(1)})},{keys:function(t){return o(i(t))}})},function(t,e,n){var r=n(397);t.exports=r},function(t,e,n){n(224);var r=n(6),i=n(73);r.JSON||(r.JSON={stringify:JSON.stringify}),t.exports=function(t,e,n){return i(r.JSON.stringify,null,arguments)}},function(t,e,n){var r=n(399);t.exports=r},function(t,e,n){var r=n(19),i=n(400),o=Array.prototype;t.exports=function(t){var e=t.indexOf;return t===o||r(o,t)&&e===o.indexOf?i:e}},function(t,e,n){n(401);var r=n(38);t.exports=r("Array").indexOf},function(t,e,n){"use strict";var r=n(0),i=n(4),o=n(158).indexOf,a=n(225),s=i([].indexOf),u=!!s&&1/s([1],1,-0)<0,c=a("indexOf");r({target:"Array",proto:!0,forced:u||!c},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return u?s(this,t,e)||0:o(this,t,e)}})},function(t,e,n){n(44);var r=n(51),i=n(12),o=n(19),a=n(403),s=Array.prototype,u={DOMTokenList:!0,NodeList:!0};t.exports=function(t){var e=t.keys;return t===s||o(s,t)&&e===s.keys||i(u,r(t))?a:e}},function(t,e,n){var r=n(404);t.exports=r},function(t,e,n){n(41),n(63);var r=n(38);t.exports=r("Array").keys},function(t,e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);t.exports=function(){return n(r),r}}else{var i=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),i[e]=t>>>((3&e)<<3)&255;return i}}},function(t,e){function n(t,e){var n=e||0,i=r;return[i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]]].join("")}for(var r=[],i=0;i<256;++i)r[i]=(i+256).toString(16).substr(1);t.exports=n},function(t,e,n){"use strict";function r(t){function e(t){for(var e=0,n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return r.colors[Math.abs(e)%r.colors.length]}function r(t){function n(){if(n.enabled){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var o=n,s=Number(new Date),u=s-(a||s);o.diff=u,o.prev=a,o.curr=s,a=s,e[0]=r.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");var c=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,function(t,n){if("%%"===t)return t;c++;var i=r.formatters[n];if("function"==typeof i){var a=e[c];t=i.call(o,a),e.splice(c,1),c--}return t}),r.formatArgs.call(o,e);(o.log||r.log).apply(o,e)}}var a;return n.namespace=t,n.enabled=r.enabled(t),n.useColors=r.useColors(),n.color=e(t),n.destroy=i,n.extend=o,"function"==typeof r.init&&r.init(n),r.instances.push(n),n}function i(){var t=r.instances.indexOf(this);return-1!==t&&(r.instances.splice(t,1),!0)}function o(t,e){return r(this.namespace+(void 0===e?":":e)+t)}function a(t){r.save(t),r.names=[],r.skips=[];var e,n=("string"==typeof t?t:"").split(/[\s,]+/),i=n.length;for(e=0;e<i;e++)n[e]&&(t=n[e].replace(/\*/g,".*?"),"-"===t[0]?r.skips.push(new RegExp("^"+t.substr(1)+"$")):r.names.push(new RegExp("^"+t+"$")));for(e=0;e<r.instances.length;e++){var o=r.instances[e];o.enabled=r.enabled(o.namespace)}}function s(){r.enable("")}function u(t){if("*"===t[t.length-1])return!0;var e,n;for(e=0,n=r.skips.length;e<n;e++)if(r.skips[e].test(t))return!1;for(e=0,n=r.names.length;e<n;e++)if(r.names[e].test(t))return!0;return!1}function c(t){return t instanceof Error?t.stack||t.message:t}return r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=a,r.enabled=u,r.humanize=n(408),Object.keys(t).forEach(function(e){r[e]=t[e]}),r.instances=[],r.names=[],r.skips=[],r.formatters={},r.selectColor=e,r.enable(r.load()),r}t.exports=r},function(t,e){function n(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*l;case"weeks":case"week":case"w":return n*f;case"days":case"day":case"d":return n*c;case"hours":case"hour":case"hrs":case"hr":case"h":return n*u;case"minutes":case"minute":case"mins":case"min":case"m":return n*s;case"seconds":case"second":case"secs":case"sec":case"s":return n*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function r(t){var e=Math.abs(t);return e>=c?Math.round(t/c)+"d":e>=u?Math.round(t/u)+"h":e>=s?Math.round(t/s)+"m":e>=a?Math.round(t/a)+"s":t+"ms"}function i(t){var e=Math.abs(t);return e>=c?o(t,e,c,"day"):e>=u?o(t,e,u,"hour"):e>=s?o(t,e,s,"minute"):e>=a?o(t,e,a,"second"):t+" ms"}function o(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}var a=1e3,s=60*a,u=60*s,c=24*u,f=7*c,l=365.25*c;t.exports=function(t,e){e=e||{};var o=typeof t;if("string"===o&&t.length>0)return n(t);if("number"===o&&isFinite(t))return e.long?i(t):r(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e,n){n(410);var r=n(6);t.exports=r.Object.getPrototypeOf},function(t,e,n){var r=n(0),i=n(2),o=n(34),a=n(99),s=n(155);r({target:"Object",stat:!0,forced:i(function(){a(1)}),sham:!s},{getPrototypeOf:function(t){return a(o(t))}})},function(t,e,n){t.exports=n(233)},function(t,e,n){n(413);var r=n(6);t.exports=r.Object.setPrototypeOf},function(t,e,n){n(0)({target:"Object",stat:!0},{setPrototypeOf:n(101)})},function(t,e,n){"use strict";function r(t){var e,n,r,i,s;if(g(t))return{};var u=(0,o.default)(t).call(t,0,8).toLowerCase(),c="lncldglobal.com";return{push:(0,a.default)(e="https://".concat(u,".push.")).call(e,c),stats:(0,a.default)(n="https://".concat(u,".stats.")).call(n,c),engine:(0,a.default)(r="https://".concat(u,".engine.")).call(r,c),api:(0,a.default)(i="https://".concat(u,".api.")).call(i,c),rtm:(0,a.default)(s="https://".concat(u,".rtm.")).call(s,c)}}var i=n(1),o=i(n(59)),a=i(n(22)),s=i(n(114)),u=n(69),c=n(420),f=n(30),l=f.isNullOrUndefined,h=n(3),d=h.extend,p=h.isObject,v=h.isEmpty,g=function(t){return"-MdYXbMMI"!==(0,o.default)(t).call(t,-9)},m=function(t){return{push:t,stats:t,engine:t,api:t,rtm:t}},y=!1,b=!1;u.init=function(t){if(!p(t))return u.init({appId:t,appKey:arguments.length<=1?void 0:arguments[1],masterKey:arguments.length<=2?void 0:arguments[2]});var e=t.appId,n=t.appKey,i=t.masterKey,o=t.hookKey,a=t.serverURL,s=t.serverURLs,f=void 0===s?a:s,h=t.disableCurrentUser,_=t.production,w=t.realtime;if(b&&console.warn("Initializing LeanCloud Storage SDK which has already been initialized. Reinitializing the SDK might cause problems like unexpected cross-app data writing and invalid relations."),!e)throw new TypeError("appId must be a string");if(!n)throw new TypeError("appKey must be a string");if(i&&console.warn("MasterKey is not supposed to be used at client side."),g(e)&&!f&&v(u._config.serverURLs))throw new TypeError("serverURL option is required for apps from CN region");e!==u._config.applicationId?(u._config.masterKey=i,u._config.hookKey=o):(i&&(u._config.masterKey=i),o&&(u._config.hookKey=o)),u._config.applicationId=e,u._config.applicationKey=n,l(_)||u.setProduction(_),void 0!==h&&(u._config.disableCurrentUser=h);var E=y||void 0!==f;if(E||(u._appRouter=new c(u)),u._setServerURLs(d({},r(e),u._config.serverURLs,"string"==typeof f?m(f):f),E),w)u._config.realtime=w;else if(u._sharedConfig.liveQueryRealtime){var O=u._config.serverURLs,T=O.api,S=O.rtm;u._config.realtime=new u._sharedConfig.liveQueryRealtime({appId:e,appKey:n,server:{api:T,RTMRouter:S}})}b=!0},u.setProduction=function(t){l(t)?u._config.production=null:u._config.production=t?1:0},u._setServerURLs=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];"string"!=typeof t?d(u._config.serverURLs,t):u._config.serverURLs=m(t),e&&(u._appRouter?u._appRouter.disable():y=!0)},u.setServerURL=function(t){return u._setServerURLs(t)},u.setServerURLs=u.setServerURL,u.keepErrorRawMessage=function(t){u._sharedConfig.keepErrorRawMessage=t},u.setRequestTimeout=function(t){u._config.requestTimeout=t},u.initialize=u.init,["applicationId","applicationKey","masterKey","hookKey"].forEach(function(t){return(0,s.default)(u,t,{get:function(){return u._config[t]},set:function(e){u._config[t]=e}})})},function(t,e,n){var r=n(19),i=n(416),o=Array.prototype;t.exports=function(t){var e=t.slice;return t===o||r(o,t)&&e===o.slice?i:e}},function(t,e,n){n(417);var r=n(38);t.exports=r("Array").slice},function(t,e,n){"use strict";var r=n(0),i=n(88),o=n(108),a=n(11),s=n(124),u=n(39),c=n(32),f=n(89),l=n(9),h=n(113),d=n(109),p=h("slice"),v=l("species"),g=Array,m=Math.max;r({target:"Array",proto:!0,forced:!p},{slice:function(t,e){var n,r,l,h=c(this),p=u(h),y=s(t,p),b=s(void 0===e?p:e,p);if(i(h)&&(n=h.constructor,o(n)&&(n===g||i(n.prototype))?n=void 0:a(n)&&null===(n=n[v])&&(n=void 0),n===g||void 0===n))return d(h,y,b);for(r=new(void 0===n?g:n)(m(b-y,0)),l=0;y<b;y++,l++)y in h&&f(r,l,h[y]);return r.length=l,r}})},function(t,e,n){n(419);var r=n(6),i=r.Object,o=t.exports=function(t,e,n){return i.defineProperty(t,e,n)};i.defineProperty.sham&&(o.sham=!0)},function(t,e,n){var r=n(0),i=n(14),o=n(23).f;r({target:"Object",stat:!0,forced:Object.defineProperty!==o,sham:!i},{defineProperty:o})},function(t,e,n){"use strict";function r(t){var e=this;this.AV=t,this.lockedUntil=0,o.getAsync("serverURLs").then(function(t){if(!e.disabled){if(!t)return e.lock(0);var n=t.serverURLs,r=t.lockedUntil;e.AV._setServerURLs(n,!1),e.lockedUntil=r}}).catch(function(){return e.lock(0)})}var i=n(115),o=n(232);r.prototype.disable=function(){this.disabled=!0},r.prototype.lock=function(t){this.lockedUntil=Date.now()+t},r.prototype.refresh=function(){var t=this;if(!(this.disabled||Date.now()<this.lockedUntil)){this.lock(10);return i({method:"get",url:"https://app-router.com/2/route",query:{appId:this.AV.applicationId}}).then(function(e){if(!t.disabled){var n=e.ttl;if(!n)throw new Error("missing ttl");n*=1e3;var r={push:"https://"+e.push_server,stats:"https://"+e.stats_server,engine:"https://"+e.engine_server,api:"https://"+e.api_server};return t.AV._setServerURLs(r,!1),t.lock(n),o.setAsync("serverURLs",{serverURLs:r,lockedUntil:t.lockedUntil},n)}}).catch(function(e){console.warn("refresh server URLs failed: ".concat(e.message)),t.lock(600)})}},t.exports=r},function(t,e,n){t.exports=n(422)},function(t,e,n){var r=n(423);n(446),n(447),n(448),n(449),n(450),n(451),n(452),n(453),t.exports=r},function(t,e,n){var r=n(237);t.exports=r},function(t,e,n){n(222),n(63),n(238),n(430),n(431),n(432),n(433),n(242),n(434),n(435),n(436),n(437),n(438),n(439),n(440),n(441),n(442),n(443),n(444),n(445);var r=n(6);t.exports=r.Symbol},function(t,e,n){"use strict";var r=n(0),i=n(7),o=n(15),a=n(4),s=n(33),u=n(14),c=n(62),f=n(2),l=n(12),h=n(19),d=n(20),p=n(32),v=n(95),g=n(79),m=n(47),y=n(49),b=n(104),_=n(102),w=n(239),E=n(103),O=n(60),T=n(23),S=n(127),A=n(119),x=n(43),I=n(77),j=n(100),C=n(78),N=n(98),P=n(9),R=n(147),U=n(10),k=n(240),L=n(52),M=n(42),D=n(70).forEach,F=j("hidden"),B=M.set,V=M.getterFor("Symbol"),q=Object.prototype,W=i.Symbol,Y=W&&W.prototype,z=i.TypeError,G=i.QObject,K=O.f,Q=T.f,J=w.f,$=A.f,H=a([].push),Z=I("symbols"),X=I("op-symbols"),tt=I("wks"),et=!G||!G.prototype||!G.prototype.findChild,nt=u&&f(function(){return 7!=y(Q({},"a",{get:function(){return Q(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=K(q,e);r&&delete q[e],Q(t,e,n),r&&t!==q&&Q(q,e,r)}:Q,rt=function(t,e){var n=Z[t]=y(Y);return B(n,{type:"Symbol",tag:t,description:e}),u||(n.description=e),n},it=function(t,e,n){t===q&&it(X,e,n),d(t);var r=v(e);return d(n),l(Z,r)?(n.enumerable?(l(t,F)&&t[F][r]&&(t[F][r]=!1),n=y(n,{enumerable:m(0,!1)})):(l(t,F)||Q(t,F,m(1,{})),t[F][r]=!0),nt(t,r,n)):Q(t,r,n)},ot=function(t,e){d(t);var n=p(e),r=b(n).concat(ft(n));return D(r,function(e){u&&!o(st,n,e)||it(t,e,n[e])}),t},at=function(t,e){return void 0===e?y(t):ot(y(t),e)},st=function(t){var e=v(t),n=o($,this,e);return!(this===q&&l(Z,e)&&!l(X,e))&&(!(n||!l(this,e)||!l(Z,e)||l(this,F)&&this[F][e])||n)},ut=function(t,e){var n=p(t),r=v(e);if(n!==q||!l(Z,r)||l(X,r)){var i=K(n,r);return!i||!l(Z,r)||l(n,F)&&n[F][r]||(i.enumerable=!0),i}},ct=function(t){var e=J(p(t)),n=[];return D(e,function(t){l(Z,t)||l(C,t)||H(n,t)}),n},ft=function(t){var e=t===q,n=J(e?X:p(t)),r=[];return D(n,function(t){!l(Z,t)||e&&!l(q,t)||H(r,Z[t])}),r};c||(W=function(){if(h(Y,this))throw z("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?g(arguments[0]):void 0,e=N(t),n=function(t){this===q&&o(n,X,t),l(this,F)&&l(this[F],e)&&(this[F][e]=!1),nt(this,e,m(1,t))};return u&&et&&nt(q,e,{configurable:!0,set:n}),rt(e,t)},Y=W.prototype,x(Y,"toString",function(){return V(this).tag}),x(W,"withoutSetter",function(t){return rt(N(t),t)}),A.f=st,T.f=it,S.f=ot,O.f=ut,_.f=w.f=ct,E.f=ft,R.f=function(t){return rt(P(t),t)},u&&(Q(Y,"description",{configurable:!0,get:function(){return V(this).description}}),s||x(q,"propertyIsEnumerable",st,{unsafe:!0}))),r({global:!0,constructor:!0,wrap:!0,forced:!c,sham:!c},{Symbol:W}),D(b(tt),function(t){U(t)}),r({target:"Symbol",stat:!0,forced:!c},{useSetter:function(){et=!0},useSimple:function(){et=!1}}),r({target:"Object",stat:!0,forced:!c,sham:!u},{create:at,defineProperty:it,defineProperties:ot,getOwnPropertyDescriptor:ut}),r({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:ct}),k(),L(W,"Symbol"),C[F]=!0},function(t,e,n){var r=n(124),i=n(39),o=n(89),a=Array,s=Math.max;t.exports=function(t,e,n){for(var u=i(t),c=r(e,u),f=r(void 0===n?u:n,u),l=a(s(f-c,0)),h=0;c<f;c++,h++)o(l,h,t[c]);return l.length=h,l}},function(t,e,n){var r=n(0),i=n(18),o=n(12),a=n(79),s=n(77),u=n(241),c=s("string-to-symbol-registry"),f=s("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!u},{for:function(t){var e=a(t);if(o(c,e))return c[e];var n=i("Symbol")(e);return c[e]=n,f[n]=e,n}})},function(t,e,n){var r=n(0),i=n(12),o=n(96),a=n(76),s=n(77),u=n(241),c=s("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!u},{keyFor:function(t){if(!o(t))throw TypeError(a(t)+" is not a symbol");if(i(c,t))return c[t]}})},function(t,e,n){var r=n(0),i=n(62),o=n(2),a=n(103),s=n(34);r({target:"Object",stat:!0,forced:!i||o(function(){a.f(1)})},{getOwnPropertySymbols:function(t){var e=a.f;return e?e(s(t)):[]}})},function(t,e,n){n(10)("asyncIterator")},function(t,e){},function(t,e,n){n(10)("hasInstance")},function(t,e,n){n(10)("isConcatSpreadable")},function(t,e,n){n(10)("match")},function(t,e,n){n(10)("matchAll")},function(t,e,n){n(10)("replace")},function(t,e,n){n(10)("search")},function(t,e,n){n(10)("species")},function(t,e,n){n(10)("split")},function(t,e,n){var r=n(10),i=n(240);r("toPrimitive"),i()},function(t,e,n){var r=n(18),i=n(10),o=n(52);i("toStringTag"),o(r("Symbol"),"Symbol")},function(t,e,n){n(10)("unscopables")},function(t,e,n){var r=n(7);n(52)(r.JSON,"JSON",!0)},function(t,e){},function(t,e){},function(t,e,n){n(10)("asyncDispose")},function(t,e,n){n(10)("dispose")},function(t,e,n){n(10)("matcher")},function(t,e,n){n(10)("metadataKey")},function(t,e,n){n(10)("observable")},function(t,e,n){n(10)("metadata")},function(t,e,n){n(10)("patternMatch")},function(t,e,n){n(10)("replaceAll")},function(t,e,n){t.exports=n(455)},function(t,e,n){t.exports=n(456)},function(t,e,n){var r=n(457);t.exports=r},function(t,e,n){var r=n(458);t.exports=r},function(t,e,n){var r=n(459);n(44),t.exports=r},function(t,e,n){n(41),n(63),n(65),n(242);var r=n(147);t.exports=r.f("iterator")},function(t,e,n){var r=n(461);t.exports=r},function(t,e,n){var r=n(19),i=n(462),o=Array.prototype;t.exports=function(t){var e=t.filter;return t===o||r(o,t)&&e===o.filter?i:e}},function(t,e,n){n(463);var r=n(38);t.exports=r("Array").filter},function(t,e,n){"use strict";var r=n(0),i=n(70).filter;r({target:"Array",proto:!0,forced:!n(113)("filter")},{filter:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var r=n(1),i=r(n(59)),o=r(n(57)),a=r(n(22)),s=n(3);t.exports=function(t){var e=/\s+/,n=(0,i.default)(Array.prototype);t.Events={on:function(t,n,r){var i,o,a,s,u;if(!n)return this;for(t=t.split(e),i=this._callbacks||(this._callbacks={}),o=t.shift();o;)u=i[o],a=u?u.tail:{},a.next=s={},a.context=r,a.callback=n,i[o]={tail:s,next:u?u.next:a},o=t.shift();return this},off:function(t,n,r){var i,a,u,c,f,l;if(a=this._callbacks){if(!(t||n||r))return delete this._callbacks,this;for(t=t?t.split(e):(0,o.default)(s).call(s,a),i=t.shift();i;)if(u=a[i],delete a[i],u&&(n||r)){for(c=u.tail,u=u.next;u!==c;)f=u.callback,l=u.context,(n&&f!==n||r&&l!==r)&&this.on(i,f,l),u=u.next;i=t.shift()}return this}},trigger:function(t){var r,i,o,s,u,c,f;if(!(o=this._callbacks))return this;for(c=o.all,t=t.split(e),f=n.call(arguments,1),r=t.shift();r;){if(i=o[r])for(s=i.tail;(i=i.next)!==s;)i.callback.apply(i.context||this,f);if(i=c){var l;for(s=i.tail,u=(0,a.default)(l=[r]).call(l,f);(i=i.next)!==s;)i.callback.apply(i.context||this,u)}r=t.shift()}return this}},t.Events.bind=t.Events.on,t.Events.unbind=t.Events.off}},function(t,e,n){"use strict";var r=n(1),i=r(n(13)),o=n(3);t.exports=function(t){t.GeoPoint=function(e,n){o.isArray(e)?(t.GeoPoint._validate(e[0],e[1]),this.latitude=e[0],this.longitude=e[1]):o.isObject(e)?(t.GeoPoint._validate(e.latitude,e.longitude),this.latitude=e.latitude,this.longitude=e.longitude):o.isNumber(e)&&o.isNumber(n)?(t.GeoPoint._validate(e,n),this.latitude=e,this.longitude=n):(this.latitude=0,this.longitude=0);var r=this;this.__defineGetter__&&this.__defineSetter__&&(this._latitude=this.latitude,this._longitude=this.longitude,this.__defineGetter__("latitude",function(){return r._latitude}),this.__defineGetter__("longitude",function(){return r._longitude}),this.__defineSetter__("latitude",function(e){t.GeoPoint._validate(e,r.longitude),r._latitude=e}),this.__defineSetter__("longitude",function(e){t.GeoPoint._validate(r.latitude,e),r._longitude=e}))},t.GeoPoint._validate=function(t,e){if(t<-90)throw new Error("AV.GeoPoint latitude "+t+" < -90.0.");if(t>90)throw new Error("AV.GeoPoint latitude "+t+" > 90.0.");if(e<-180)throw new Error("AV.GeoPoint longitude "+e+" < -180.0.");if(e>180)throw new Error("AV.GeoPoint longitude "+e+" > 180.0.")},t.GeoPoint.current=function(){return new i.default(function(e,n){navigator.geolocation.getCurrentPosition(function(n){e(new t.GeoPoint({latitude:n.coords.latitude,longitude:n.coords.longitude}))},n)})},o.extend(t.GeoPoint.prototype,{toJSON:function(){return t.GeoPoint._validate(this.latitude,this.longitude),{__type:"GeoPoint",latitude:this.latitude,longitude:this.longitude}},radiansTo:function(t){var e=Math.PI/180,n=this.latitude*e,r=this.longitude*e,i=t.latitude*e,o=t.longitude*e,a=n-i,s=r-o,u=Math.sin(a/2),c=Math.sin(s/2),f=u*u+Math.cos(n)*Math.cos(i)*c*c;return f=Math.min(1,f),2*Math.asin(Math.sqrt(f))},kilometersTo:function(t){return 6371*this.radiansTo(t)},milesTo:function(t){return 3958.8*this.radiansTo(t)}})}},function(t,e,n){"use strict";var r=n(3);t.exports=function(t){t.ACL=function(e){var n=this;if(n.permissionsById={},r.isObject(e))if(e instanceof t.User)n.setReadAccess(e,!0),n.setWriteAccess(e,!0);else{if(r.isFunction(e))throw new Error("AV.ACL() called with a function. Did you forget ()?");t._objectEach(e,function(e,i){if(!r.isString(i))throw new Error("Tried to create an ACL with an invalid userId.");n.permissionsById[i]={},t._objectEach(e,function(t,e){if("read"!==e&&"write"!==e)throw new Error("Tried to create an ACL with an invalid permission type.");if(!r.isBoolean(t))throw new Error("Tried to create an ACL with an invalid permission value.");n.permissionsById[i][e]=t})})}},t.ACL.prototype.toJSON=function(){return r.clone(this.permissionsById)},t.ACL.prototype._setAccess=function(e,n,i){if(n instanceof t.User?n=n.id:n instanceof t.Role&&(n="role:"+n.getName()),!r.isString(n))throw new Error("userId must be a string.");if(!r.isBoolean(i))throw new Error("allowed must be either true or false.");var o=this.permissionsById[n];if(!o){if(!i)return;o={},this.permissionsById[n]=o}i?this.permissionsById[n][e]=!0:(delete o[e],r.isEmpty(o)&&delete this.permissionsById[n])},t.ACL.prototype._getAccess=function(e,n){n instanceof t.User?n=n.id:n instanceof t.Role&&(n="role:"+n.getName());var r=this.permissionsById[n];return!!r&&!!r[e]},t.ACL.prototype.setReadAccess=function(t,e){this._setAccess("read",t,e)},t.ACL.prototype.getReadAccess=function(t){return this._getAccess("read",t)},t.ACL.prototype.setWriteAccess=function(t,e){this._setAccess("write",t,e)},t.ACL.prototype.getWriteAccess=function(t){return this._getAccess("write",t)},t.ACL.prototype.setPublicReadAccess=function(t){this.setReadAccess("*",t)},t.ACL.prototype.getPublicReadAccess=function(){return this.getReadAccess("*")},t.ACL.prototype.setPublicWriteAccess=function(t){this.setWriteAccess("*",t)},t.ACL.prototype.getPublicWriteAccess=function(){return this.getWriteAccess("*")},t.ACL.prototype.getRoleReadAccess=function(e){if(e instanceof t.Role&&(e=e.getName()),r.isString(e))return this.getReadAccess("role:"+e);throw new Error("role must be a AV.Role or a String")},t.ACL.prototype.getRoleWriteAccess=function(e){if(e instanceof t.Role&&(e=e.getName()),r.isString(e))return this.getWriteAccess("role:"+e);throw new Error("role must be a AV.Role or a String")},t.ACL.prototype.setRoleReadAccess=function(e,n){if(e instanceof t.Role&&(e=e.getName()),r.isString(e))return void this.setReadAccess("role:"+e,n);throw new Error("role must be a AV.Role or a String")},t.ACL.prototype.setRoleWriteAccess=function(e,n){if(e instanceof t.Role&&(e=e.getName()),r.isString(e))return void this.setWriteAccess("role:"+e,n);throw new Error("role must be a AV.Role or a String")}}},function(t,e,n){"use strict";var r=n(1),i=r(n(22)),o=r(n(92)),a=r(n(90)),s=r(n(35)),u=n(3);t.exports=function(t){t.Op=function(){this._initialize.apply(this,arguments)},u.extend(t.Op.prototype,{_initialize:function(){}}),u.extend(t.Op,{_extend:t._extend,_opDecoderMap:{},_registerDecoder:function(e,n){t.Op._opDecoderMap[e]=n},_decode:function(e){var n=t.Op._opDecoderMap[e.__op];return n?n(e):void 0}}),t.Op._registerDecoder("Batch",function(e){var n=null;return t._arrayEach(e.ops,function(e){e=t.Op._decode(e),n=e._mergeWithPrevious(n)}),n}),t.Op.Set=t.Op._extend({_initialize:function(t){this._value=t},value:function(){return this._value},toJSON:function(){return t._encode(this.value())},_mergeWithPrevious:function(t){return this},_estimate:function(t){return this.value()}}),t.Op._UNSET={},t.Op.Unset=t.Op._extend({toJSON:function(){return{__op:"Delete"}},_mergeWithPrevious:function(t){return this},_estimate:function(e){return t.Op._UNSET}}),t.Op._registerDecoder("Delete",function(e){return new t.Op.Unset}),t.Op.Increment=t.Op._extend({_initialize:function(t){this._amount=t},amount:function(){return this._amount},toJSON:function(){return{__op:"Increment",amount:this._amount}},_mergeWithPrevious:function(e){if(e){if(e instanceof t.Op.Unset)return new t.Op.Set(this.amount());if(e instanceof t.Op.Set)return new t.Op.Set(e.value()+this.amount());if(e instanceof t.Op.Increment)return new t.Op.Increment(this.amount()+e.amount());throw new Error("Op is invalid after previous op.")}return this},_estimate:function(t){return t?t+this.amount():this.amount()}}),t.Op._registerDecoder("Increment",function(e){return new t.Op.Increment(e.amount)}),t.Op.BitAnd=t.Op._extend({_initialize:function(t){this._value=t},value:function(){return this._value},toJSON:function(){return{__op:"BitAnd",value:this.value()}},_mergeWithPrevious:function(e){if(e){if(e instanceof t.Op.Unset)return new t.Op.Set(0);if(e instanceof t.Op.Set)return new t.Op.Set(e.value()&this.value());throw new Error("Op is invalid after previous op.")}return this},_estimate:function(t){return t&this.value()}}),t.Op._registerDecoder("BitAnd",function(e){return new t.Op.BitAnd(e.value)}),t.Op.BitOr=t.Op._extend({_initialize:function(t){this._value=t},value:function(){return this._value},toJSON:function(){return{__op:"BitOr",value:this.value()}},_mergeWithPrevious:function(e){if(e){if(e instanceof t.Op.Unset)return new t.Op.Set(this.value());if(e instanceof t.Op.Set)return new t.Op.Set(e.value()|this.value());throw new Error("Op is invalid after previous op.")}return this},_estimate:function(t){return t|this.value()}}),t.Op._registerDecoder("BitOr",function(e){return new t.Op.BitOr(e.value)}),t.Op.BitXor=t.Op._extend({_initialize:function(t){this._value=t},value:function(){return this._value},toJSON:function(){return{__op:"BitXor",value:this.value()}},_mergeWithPrevious:function(e){if(e){if(e instanceof t.Op.Unset)return new t.Op.Set(this.value());if(e instanceof t.Op.Set)return new t.Op.Set(e.value()^this.value());throw new Error("Op is invalid after previous op.")}return this},_estimate:function(t){return t^this.value()}}),t.Op._registerDecoder("BitXor",function(e){return new t.Op.BitXor(e.value)}),t.Op.Add=t.Op._extend({_initialize:function(t){this._objects=t},objects:function(){return this._objects},toJSON:function(){return{__op:"Add",objects:t._encode(this.objects())}},_mergeWithPrevious:function(e){if(e){if(e instanceof t.Op.Unset)return new t.Op.Set(this.objects());if(e instanceof t.Op.Set)return new t.Op.Set(this._estimate(e.value()));if(e instanceof t.Op.Add){var n;return new t.Op.Add((0,i.default)(n=e.objects()).call(n,this.objects()))}throw new Error("Op is invalid after previous op.")}return this},_estimate:function(t){return t?(0,i.default)(t).call(t,this.objects()):u.clone(this.objects())}}),t.Op._registerDecoder("Add",function(e){return new t.Op.Add(t._decode(e.objects))}),t.Op.AddUnique=t.Op._extend({_initialize:function(t){this._objects=u.uniq(t)},objects:function(){return this._objects},toJSON:function(){return{__op:"AddUnique",objects:t._encode(this.objects())}},_mergeWithPrevious:function(e){if(e){if(e instanceof t.Op.Unset)return new t.Op.Set(this.objects());if(e instanceof t.Op.Set)return new t.Op.Set(this._estimate(e.value()));if(e instanceof t.Op.AddUnique)return new t.Op.AddUnique(this._estimate(e.objects()));throw new Error("Op is invalid after previous op.")}return this},_estimate:function(e){if(e){var n=u.clone(e);return t._arrayEach(this.objects(),function(e){if(e instanceof t.Object&&e.id){var r=(0,o.default)(u).call(u,n,function(n){return n instanceof t.Object&&n.id===e.id});if(r){var i=(0,a.default)(u).call(u,n,r);n[i]=e}else n.push(e)}else u.contains(n,e)||n.push(e)}),n}return u.clone(this.objects())}}),t.Op._registerDecoder("AddUnique",function(e){return new t.Op.AddUnique(t._decode(e.objects))}),t.Op.Remove=t.Op._extend({_initialize:function(t){this._objects=u.uniq(t)},objects:function(){return this._objects},toJSON:function(){return{__op:"Remove",objects:t._encode(this.objects())}},_mergeWithPrevious:function(e){if(e){if(e instanceof t.Op.Unset)return e;if(e instanceof t.Op.Set)return new t.Op.Set(this._estimate(e.value()));if(e instanceof t.Op.Remove)return new t.Op.Remove(u.union(e.objects(),this.objects()));throw new Error("Op is invalid after previous op.")}return this},_estimate:function(e){if(e){var n=u.difference(e,this.objects());return t._arrayEach(this.objects(),function(e){e instanceof t.Object&&e.id&&(n=u.reject(n,function(n){return n instanceof t.Object&&n.id===e.id}))}),n}return[]}}),t.Op._registerDecoder("Remove",function(e){return new t.Op.Remove(t._decode(e.objects))}),t.Op.Relation=t.Op._extend({_initialize:function(e,n){this._targetClassName=null;var r=this,i=function(e){if(e instanceof t.Object){if(!e.id)throw new Error("You can't add an unsaved AV.Object to a relation.");if(r._targetClassName||(r._targetClassName=e.className),r._targetClassName!==e.className)throw new Error("Tried to create a AV.Relation with 2 different types: "+r._targetClassName+" and "+e.className+".");return e.id}return e};this.relationsToAdd=u.uniq((0,s.default)(u).call(u,e,i)),this.relationsToRemove=u.uniq((0,s.default)(u).call(u,n,i))},added:function(){var e=this;return(0,s.default)(u).call(u,this.relationsToAdd,function(n){var r=t.Object._create(e._targetClassName);return r.id=n,r})},removed:function(){var e=this;return(0,s.default)(u).call(u,this.relationsToRemove,function(n){var r=t.Object._create(e._targetClassName);return r.id=n,r})},toJSON:function(){var t=null,e=null,n=this,r=function(t){return{__type:"Pointer",className:n._targetClassName,objectId:t}},i=null;return this.relationsToAdd.length>0&&(i=(0,s.default)(u).call(u,this.relationsToAdd,r),t={__op:"AddRelation",objects:i}),this.relationsToRemove.length>0&&(i=(0,s.default)(u).call(u,this.relationsToRemove,r),e={__op:"RemoveRelation",objects:i}),t&&e?{__op:"Batch",ops:[t,e]}:t||e||{}},_mergeWithPrevious:function(e){if(e){if(e instanceof t.Op.Unset)throw new Error("You can't modify a relation after deleting it.");if(e instanceof t.Op.Relation){if(e._targetClassName&&e._targetClassName!==this._targetClassName)throw new Error("Related object must be of class "+e._targetClassName+", but "+this._targetClassName+" was passed in.");var n=u.union(u.difference(e.relationsToAdd,this.relationsToRemove),this.relationsToAdd),r=u.union(u.difference(e.relationsToRemove,this.relationsToAdd),this.relationsToRemove),i=new t.Op.Relation(n,r);return i._targetClassName=this._targetClassName,i}throw new Error("Op is invalid after previous op.")}return this},_estimate:function(e,n,r){if(e){if(e instanceof t.Relation){if(this._targetClassName)if(e.targetClassName){if(e.targetClassName!==this._targetClassName)throw new Error("Related object must be a "+e.targetClassName+", but a "+this._targetClassName+" was passed in.")}else e.targetClassName=this._targetClassName;return e}throw new Error("Op is invalid after previous op.")}new t.Relation(n,r).targetClassName=this._targetClassName}}),t.Op._registerDecoder("AddRelation",function(e){return new t.Op.Relation(t._decode(e.objects),[])}),t.Op._registerDecoder("RemoveRelation",function(e){return new t.Op.Relation([],t._decode(e.objects))})}},function(t,e,n){var r=n(469);t.exports=r},function(t,e,n){var r=n(19),i=n(470),o=Array.prototype;t.exports=function(t){var e=t.find;return t===o||r(o,t)&&e===o.find?i:e}},function(t,e,n){n(471);var r=n(38);t.exports=r("Array").find},function(t,e,n){"use strict";var r=n(0),i=n(70).find,o=n(163),a=!0;"find"in[]&&Array(1).find(function(){a=!1}),r({target:"Array",proto:!0,forced:a},{find:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),o("find")},function(t,e,n){"use strict";var r=n(3);t.exports=function(t){t.Relation=function(t,e){if(!r.isString(e))throw new TypeError("key must be a string");this.parent=t,this.key=e,this.targetClassName=null},t.Relation.reverseQuery=function(e,n,r){var i=new t.Query(e);return i.equalTo(n,r._toPointer()),i},r.extend(t.Relation.prototype,{_ensureParentAndKey:function(t,e){if(this.parent=this.parent||t,this.key=this.key||e,this.parent!==t)throw new Error("Internal Error. Relation retrieved from two different Objects.");if(this.key!==e)throw new Error("Internal Error. Relation retrieved from two different keys.")},add:function(e){r.isArray(e)||(e=[e]);var n=new t.Op.Relation(e,[]);this.parent.set(this.key,n),this.targetClassName=n._targetClassName},remove:function(e){r.isArray(e)||(e=[e]);var n=new t.Op.Relation([],e);this.parent.set(this.key,n),this.targetClassName=n._targetClassName},toJSON:function(){return{__type:"Relation",className:this.targetClassName}},query:function(){var e,n;return this.targetClassName?(e=t.Object._getSubclass(this.targetClassName),n=new t.Query(e)):(e=t.Object._getSubclass(this.parent.className),n=new t.Query(e),n._defaultParams.redirectClassNameForKey=this.key),n._addCondition("$relatedTo","object",this.parent._toPointer()),n._addCondition("$relatedTo","key",this.key),n}})}},function(t,e,n){"use strict";var r=n(1),i=r(n(13)),o=n(3),a=n(474),s=n(475),u=n(521),c=n(46),f=n(27),l=f.request,h=f._request,d=n(30),p=d.tap,v=d.transformFetchOptions,g=n(58)("leancloud:file"),m=n(525);t.exports=function(t){var e=function(t){return o.isString(t)?t.match(/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/)[4]:""},n=function(t){if(t<26)return String.fromCharCode(65+t);if(t<52)return String.fromCharCode(t-26+97);if(t<62)return String.fromCharCode(t-52+48);if(62===t)return"+";if(63===t)return"/";throw new Error("Tried to encode large digit "+t+" in base64.")},r=function(t){var e=[];return e.length=Math.ceil(t.length/3),o.times(e.length,function(r){var i=t[3*r],o=t[3*r+1]||0,a=t[3*r+2]||0,s=3*r+1<t.length,u=3*r+2<t.length;e[r]=[n(i>>2&63),n(i<<4&48|o>>4&15),s?n(o<<2&60|a>>6&3):"=",u?n(63&a):"="].join("")}),e.join("")};t.File=function(n,i,a){if(this.attributes={name:n,url:"",metaData:{},base64:""},o.isString(i))throw new TypeError("Creating an AV.File from a String is not yet supported.");o.isArray(i)&&(this.attributes.metaData.size=i.length,i={base64:r(i)}),this._extName="",this._data=i,this._uploadHeaders={},i&&i.blob&&"string"==typeof i.blob.uri&&(this._extName=e(i.blob.uri)),"undefined"!=typeof Blob&&i instanceof Blob&&(i.size&&(this.attributes.metaData.size=i.size),i.name&&(this._extName=e(i.name)));var s;if(i&&i.owner)s=i.owner;else if(!t._config.disableCurrentUser)try{s=t.User.current()}catch(t){if("SYNC_API_NOT_AVAILABLE"!==t.code)throw t}this.attributes.metaData.owner=s?s.id:"unknown",this.set("mime_type",a)},t.File.withURL=function(e,n,r,i){if(!e||!n)throw new Error("Please provide file name and url");var o=new t.File(e,null,i);if(r)for(var a in r)o.attributes.metaData[a]||(o.attributes.metaData[a]=r[a]);return o.attributes.url=n,o.attributes.metaData.__source="external",o.attributes.metaData.size=0,o},t.File.createWithoutData=function(e){if(!e)throw new TypeError("The objectId must be provided");var n=new t.File;return n.id=e,n},t.File.censor=function(e){if(!t._config.masterKey)throw new Error("Cannot censor a file without masterKey");return l({method:"POST",path:"/files/".concat(e,"/censor"),authOptions:{useMasterKey:!0}}).then(function(t){return t.censorResult})},o.extend(t.File.prototype,{className:"_File",_toFullJSON:function(e){var n=this,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=o.clone(this.attributes);return t._objectEach(i,function(n,o){i[o]=t._encode(n,e,void 0,r)}),t._objectEach(this._operations,function(t,e){i[e]=t}),o.has(this,"id")&&(i.objectId=this.id),["createdAt","updatedAt"].forEach(function(t){if(o.has(n,t)){var e=n[t];i[t]=o.isDate(e)?e.toJSON():e}}),r&&(i.__type="File"),i},toFullJSON:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this._toFullJSON(t)},toJSON:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[this];return this._toFullJSON(n,!1)},_toPointer:function(){return{__type:"Pointer",className:this.className,objectId:this.id}},getACL:function(){return this._acl},setACL:function(e){return e instanceof t.ACL?(this._acl=e,this):new c(c.OTHER_CAUSE,"ACL must be a AV.ACL.")},name:function(){return this.get("name")},url:function(){return this.get("url")},get:function(t){switch(t){case"objectId":return this.id;case"url":case"name":case"mime_type":case"metaData":case"createdAt":case"updatedAt":return this.attributes[t];default:return this.attributes.metaData[t]}},set:function(){for(var t=this,e=function(e,n){switch(e){case"name":case"url":case"mime_type":case"base64":case"metaData":t.attributes[e]=n;break;default:t.attributes.metaData[e]=n}},n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];switch(r.length){case 1:for(var o in r[0])e(o,r[0][o]);break;case 2:e(r[0],r[1])}return this},setUploadHeader:function(t,e){return this._uploadHeaders[t]=e,this},metaData:function(t,e){return t&&e?(this.attributes.metaData[t]=e,this):t&&!e?this.attributes.metaData[t]:this.attributes.metaData},thumbnailURL:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"png",o=this.attributes.url;if(!o)throw new Error("Invalid url.");if(!t||!e||t<=0||e<=0)throw new Error("Invalid width or height value.");if(n<=0||n>100)throw new Error("Invalid quality value.");return o+"?imageView/"+(r?2:1)+"/w/"+t+"/h/"+e+"/q/"+n+"/format/"+i},size:function(){return this.metaData().size},ownerId:function(){return this.metaData().owner},destroy:function(t){return this.id?h("files",null,this.id,"DELETE",null,t):i.default.reject(new Error("The file id does not eixst."))},_fileToken:function(t,n){var r=this.attributes.name,i=e(r);!i&&this._extName&&(r+=this._extName,i=this._extName);var o={name:r,keep_file_name:n.keepFileName,key:n.key,ACL:this._acl,mime_type:t,metaData:this.attributes.metaData};return h("fileTokens",null,null,"POST",o,n)},save:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.id)throw new Error("File is already saved.");if(!this._previousSave)if(this._data){var n=this.get("mime_type");this._previousSave=this._fileToken(n,e).then(function(r){return r.mime_type&&(n=r.mime_type,t.set("mime_type",n)),t._token=r.token,i.default.resolve().then(function(){var e=t._data;if(e&&e.base64)return m(e.base64,n);if(e&&e.blob)return!e.blob.type&&n&&(e.blob.type=n),e.blob.name||(e.blob.name=t.get("name")),e.blob;if("undefined"!=typeof Blob&&e instanceof Blob)return e;throw new TypeError("malformed file data")}).then(function(n){var i=o.extend({},e);switch(e.onprogress&&(i.onprogress=function(t){if("download"!==t.direction)return e.onprogress(t)}),r.provider){case"s3":return u(r,n,t,i);case"qcloud":return a(r,n,t,i);case"qiniu":default:return s(r,n,t,i)}}).then(p(function(){return t._callback(!0)}),function(e){throw t._callback(!1),e})})}else if(this.attributes.url&&"external"===this.attributes.metaData.__source){var r={name:this.attributes.name,ACL:this._acl,metaData:this.attributes.metaData,mime_type:this.mimeType,url:this.attributes.url};this._previousSave=h("files",null,null,"post",r,e).then(function(e){return t.id=e.objectId,t})}return this._previousSave},_callback:function(t){h("fileCallback",null,null,"post",{token:this._token,result:t}).catch(g),delete this._token,delete this._data},fetch:function(t,e){if(!this.id)throw new Error("Cannot fetch unsaved file");return h("files",null,this.id,"GET",v(t),e).then(this._finishFetch.bind(this))},_finishFetch:function(e){var n=t.Object.prototype.parse(e);return n.attributes={name:n.name,url:n.url,mime_type:n.mime_type,bucket:n.bucket},n.attributes.metaData=n.metaData||{},n.id=n.objectId,delete n.objectId,delete n.metaData,delete n.url,delete n.name,delete n.mime_type,delete n.bucket,o.extend(this,n),this},censor:function(){if(!this.id)throw new Error("Cannot censor an unsaved file");return t.File.censor(this.id)}})}},function(t,e,n){"use strict";var r=n(71),i=r.getAdapter,o=n(58)("cos");t.exports=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=t.upload_url+"?sign="+encodeURIComponent(t.token),s={field:"fileContent",data:e,name:n.attributes.name},u={headers:n._uploadHeaders,data:{op:"upload"},onprogress:r.onprogress};return o("url: %s, file: %o, options: %o",a,s,u),i("upload")(a,s,u).then(function(e){if(o(e.status,e.data),!1===e.ok){var r=new Error(e.status);throw r.response=e,r}return n.attributes.url=t.url,n._bucket=t.bucket,n.id=t.objectId,n},function(t){var e=t.response;throw e&&(o(e.status,e.data),t.statusCode=e.status,t.response=e.data),t})}},function(t,e,n){"use strict";function r(t){var e=i();return function(){var n,r=(0,b.default)(t);if(e){var i=(0,b.default)(this).constructor;n=v(r,arguments,i)}else n=r.apply(this,arguments);return(0,y.default)(this,n)}}function i(){if("undefined"==typeof Reflect||!v)return!1;if(v.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(v(Boolean,[],function(){})),!0}catch(t){return!1}}function o(t,e){var n=void 0!==d&&p(t)||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=a(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function a(t,e){var n;if(t){if("string"==typeof t)return s(t,e);var r=l(n=Object.prototype.toString.call(t)).call(n,8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?h(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function u(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=t.token,o=t.upload_url||"https://upload.qiniup.com",a={field:"file",data:e,name:n.attributes.name},s={headers:n._uploadHeaders,data:{name:n.attributes.name,key:t.key,token:i},onprogress:r.onprogress};return I("url: %s, file: %o, options: %o",o,a,s),x("upload")(o,a,s).then(function(e){if(I(e.status,e.data),!1===e.ok){var r=e.status;e.data&&(r=e.data.error?e.data.error:(0,E.default)(e.data));var i=new Error(r);throw i.response=e,i}return n.attributes.url=t.url,n._bucket=t.bucket,n.id=t.objectId,n},function(t){var e=t.response;throw e&&(I(e.status,e.data),t.statusCode=e.status,t.response=e.data),t})}function c(t){var e,n=C(unescape(encodeURIComponent(t))),r="",i=o(n);try{for(i.s();!(e=i.n()).done;){var a=e.value;switch(a){case"+":r+="-";break;case"/":r+="_";break;default:r+=a}}}catch(t){i.e(t)}finally{i.f()}return r}function f(t){return"undefined"!=typeof Blob&&t instanceof Blob}var l=n(59),h=n(245),d=n(247),p=n(248),v=n(485),g=n(1),m=g(n(489)),y=g(n(511)),b=g(n(513)),_=g(n(518)),w=g(n(519)),E=g(n(36)),O=g(n(22)),T=g(n(13)),S=g(n(59)),A=n(71),x=A.getAdapter,I=n(58)("leancloud:qiniu"),j=n(115),C=n(520),N=16777216,P=function(){function t(e,n,r,i){var o,a,s=this;(0,_.default)(this,t),this.uploadInfo=e,this.data=n,this.file=r,this.size=void 0,this.offset=0,this.uploadedChunks=0;var u=c(e.key),f=e.upload_url||"https://upload.qiniup.com";this.baseURL=(0,O.default)(o=(0,O.default)(a="".concat(f,"/buckets/")).call(a,e.bucket,"/objects/")).call(o,u,"/uploads"),this.upToken="UpToken "+e.token,this.uploaded=0,i&&i.onprogress&&(this.onProgress=function(t){var e=t.loaded;(e+=s.uploadedChunks*N)<=s.uploaded||(s.size?i.onprogress({loaded:e,total:s.size,percent:e/s.size*100}):i.onprogress({loaded:e}),s.uploaded=e)})}return(0,w.default)(t,[{key:"getUploadId",value:function(){return j({method:"POST",url:this.baseURL,headers:{Authorization:this.upToken}}).then(function(t){return t.uploadId})}},{key:"getChunk",value:function(){throw new Error("Not implemented")}},{key:"uploadPart",value:function(t,e,n){var r,i;return j({method:"PUT",url:(0,O.default)(r=(0,O.default)(i="".concat(this.baseURL,"/")).call(i,t,"/")).call(r,e),headers:{Authorization:this.upToken},data:n,onprogress:this.onProgress}).then(function(t){var n=t.etag;return{partNumber:e,etag:n}})}},{key:"stopUpload",value:function(t){var e;return j({method:"DELETE",url:(0,O.default)(e="".concat(this.baseURL,"/")).call(e,t),headers:{Authorization:this.upToken}})}},{key:"upload",value:function(){var t=this,e=[];return this.getUploadId().then(function(n){return function r(){return T.default.resolve(t.getChunk()).then(function(i){if(i){var o=e.length+1;return t.uploadPart(n,o,i).then(function(n){return e.push(n),t.uploadedChunks++,r()})}}).catch(function(e){return t.stopUpload(n).then(function(){return T.default.reject(e)})})}().then(function(){var r;return j({method:"POST",url:(0,O.default)(r="".concat(t.baseURL,"/")).call(r,n),headers:{Authorization:t.upToken},data:{parts:e,fname:t.file.attributes.name,mimeType:t.file.attributes.mime_type}})})}).then(function(){return t.file.attributes.url=t.uploadInfo.url,t.file._bucket=t.uploadInfo.bucket,t.file.id=t.uploadInfo.objectId,t.file})}}]),t}(),R=function(t){function e(t,r,i,o){var a;return(0,_.default)(this,e),a=n.call(this,t,r,i,o),a.size=r.size,a}(0,m.default)(e,t);var n=r(e);return(0,w.default)(e,[{key:"getChunk",value:function(){var t;if(this.offset>=this.size)return null;var e=(0,S.default)(t=this.data).call(t,this.offset,this.offset+N);return this.offset+=e.size,e}}]),e}(P);t.exports=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return f(e)&&e.size>=67108864?new R(t,e,n,r).upload():u(t,e,n,r)}},function(t,e,n){n(65),n(477);var r=n(6);t.exports=r.Array.from},function(t,e,n){var r=n(0),i=n(478);r({target:"Array",stat:!0,forced:!n(172)(function(t){Array.from(t)})},{from:i})},function(t,e,n){"use strict";var r=n(48),i=n(15),o=n(34),a=n(479),s=n(160),u=n(108),c=n(39),f=n(89),l=n(161),h=n(105),d=Array;t.exports=function(t){var e=o(t),n=u(this),p=arguments.length,v=p>1?arguments[1]:void 0,g=void 0!==v;g&&(v=r(v,p>2?arguments[2]:void 0));var m,y,b,_,w,E,O=h(e),T=0;if(!O||this===d&&s(O))for(m=c(e),y=n?new this(m):d(m);m>T;T++)E=g?v(e[T],T):e[T],f(y,T,E);else for(_=l(e,O),w=_.next,y=n?new this:[];!(b=i(w,_)).done;T++)E=g?a(_,v,[b.value,T],!0):b.value,f(y,T,E);return y.length=T,y}},function(t,e,n){var r=n(20),i=n(162);t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(e){i(t,"throw",e)}}},function(t,e,n){t.exports=n(481)},function(t,e,n){var r=n(482);t.exports=r},function(t,e,n){var r=n(483);t.exports=r},function(t,e,n){var r=n(484);n(44),t.exports=r},function(t,e,n){n(41),n(65);var r=n(105);t.exports=r},function(t,e,n){t.exports=n(486)},function(t,e,n){var r=n(487);t.exports=r},function(t,e,n){n(488);var r=n(6);t.exports=r.Reflect.construct},function(t,e,n){var r=n(0),i=n(18),o=n(73),a=n(249),s=n(168),u=n(20),c=n(11),f=n(49),l=n(2),h=i("Reflect","construct"),d=Object.prototype,p=[].push,v=l(function(){function t(){}return!(h(function(){},[],t)instanceof t)}),g=!l(function(){h(function(){})}),m=v||g;r({target:"Reflect",stat:!0,forced:m,sham:m},{construct:function(t,e){s(t),u(e);var n=arguments.length<3?t:s(arguments[2]);if(g&&!v)return h(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return o(p,r,e),new(o(a,t,r))}var i=n.prototype,l=f(c(i)?i:d),m=o(t,l,e);return c(m)?m:l}})},function(t,e,n){function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=i(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),o(t,"prototype",{writable:!1}),e&&a(t,e)}var i=n(490),o=n(148),a=n(500);t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){t.exports=n(491)},function(t,e,n){t.exports=n(492)},function(t,e,n){var r=n(493);t.exports=r},function(t,e,n){var r=n(494);t.exports=r},function(t,e,n){var r=n(495);t.exports=r},function(t,e,n){n(496);var r=n(6),i=r.Object;t.exports=function(t,e){return i.create(t,e)}},function(t,e,n){n(0)({target:"Object",stat:!0,sham:!n(14)},{create:n(49)})},function(t,e,n){t.exports=n(498)},function(t,e,n){var r=n(499);t.exports=r},function(t,e,n){var r=n(235);t.exports=r},function(t,e,n){function r(e,n){var a;return t.exports=r=i?o(a=i).call(a):function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e,n)}var i=n(250),o=n(251);t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){t.exports=n(502)},function(t,e,n){var r=n(503);t.exports=r},function(t,e,n){var r=n(233);t.exports=r},function(t,e,n){t.exports=n(505)},function(t,e,n){var r=n(506);t.exports=r},function(t,e,n){var r=n(507);t.exports=r},function(t,e,n){var r=n(508);t.exports=r},function(t,e,n){var r=n(19),i=n(509),o=Function.prototype;t.exports=function(t){var e=t.bind;return t===o||r(o,t)&&e===o.bind?i:e}},function(t,e,n){n(510);var r=n(38);t.exports=r("Function").bind},function(t,e,n){var r=n(0),i=n(249);r({target:"Function",proto:!0,forced:Function.bind!==i},{bind:i})},function(t,e,n){function r(t,e){if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return o(t)}var i=n(91).default,o=n(512);t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){function r(e){var n;return t.exports=r=i?o(n=a).call(n):function(t){return t.__proto__||a(t)},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}var i=n(250),o=n(251),a=n(514);t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){t.exports=n(515)},function(t,e,n){t.exports=n(516)},function(t,e,n){var r=n(517);t.exports=r},function(t,e,n){var r=n(228);t.exports=r},function(t,e){function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),o(t,r.key,r)}}function i(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),o(t,"prototype",{writable:!1}),t}var o=n(148);t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";var r=n(1),i=r(n(59)),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.exports=function(t){for(var e="",n=0;n<t.length;){var r=t.charCodeAt(n++),a=t.charCodeAt(n++),s=t.charCodeAt(n++);if(r>255||a>255||s>255)throw new TypeError("Failed to encode base64: The string to be encoded contains characters outside of the Latin1 range.");var u=r<<16|a<<8|s;e+=o.charAt(u>>18&63)+o.charAt(u>>12&63)+o.charAt(u>>6&63)+o.charAt(63&u)}var c=t.length%3;return c?(0,i.default)(e).call(e,0,c-3)+"===".substring(c):e}},function(t,e,n){"use strict";var r=n(3),i=n(115);t.exports=function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return i({url:t.upload_url,method:"PUT",data:e,headers:r.extend({"Content-Type":n.get("mime_type"),"Cache-Control":"public, max-age=31536000"},n._uploadHeaders),onprogress:o.onprogress}).then(function(){return n.attributes.url=t.url,n._bucket=t.bucket,n.id=t.objectId,n})}},function(t,e,n){!function(){var e=n(523),r=n(252).utf8,i=n(524),o=n(252).bin,a=function(t,n){t.constructor==String?t=n&&"binary"===n.encoding?o.stringToBytes(t):r.stringToBytes(t):i(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());for(var s=e.bytesToWords(t),u=8*t.length,c=1732584193,f=-271733879,l=-1732584194,h=271733878,d=0;d<s.length;d++)s[d]=16711935&(s[d]<<8|s[d]>>>24)|4278255360&(s[d]<<24|s[d]>>>8);s[u>>>5]|=128<<u%32,s[14+(u+64>>>9<<4)]=u;for(var p=a._ff,v=a._gg,g=a._hh,m=a._ii,d=0;d<s.length;d+=16){var y=c,b=f,_=l,w=h;c=p(c,f,l,h,s[d+0],7,-680876936),h=p(h,c,f,l,s[d+1],12,-389564586),l=p(l,h,c,f,s[d+2],17,606105819),f=p(f,l,h,c,s[d+3],22,-1044525330),c=p(c,f,l,h,s[d+4],7,-176418897),h=p(h,c,f,l,s[d+5],12,1200080426),l=p(l,h,c,f,s[d+6],17,-1473231341),f=p(f,l,h,c,s[d+7],22,-45705983),c=p(c,f,l,h,s[d+8],7,1770035416),h=p(h,c,f,l,s[d+9],12,-1958414417),l=p(l,h,c,f,s[d+10],17,-42063),f=p(f,l,h,c,s[d+11],22,-1990404162),c=p(c,f,l,h,s[d+12],7,1804603682),h=p(h,c,f,l,s[d+13],12,-40341101),l=p(l,h,c,f,s[d+14],17,-1502002290),f=p(f,l,h,c,s[d+15],22,1236535329),c=v(c,f,l,h,s[d+1],5,-165796510),h=v(h,c,f,l,s[d+6],9,-1069501632),l=v(l,h,c,f,s[d+11],14,643717713),f=v(f,l,h,c,s[d+0],20,-373897302),c=v(c,f,l,h,s[d+5],5,-701558691),h=v(h,c,f,l,s[d+10],9,38016083),l=v(l,h,c,f,s[d+15],14,-660478335),f=v(f,l,h,c,s[d+4],20,-405537848),c=v(c,f,l,h,s[d+9],5,568446438),h=v(h,c,f,l,s[d+14],9,-1019803690),l=v(l,h,c,f,s[d+3],14,-187363961),f=v(f,l,h,c,s[d+8],20,1163531501),c=v(c,f,l,h,s[d+13],5,-1444681467),h=v(h,c,f,l,s[d+2],9,-51403784),l=v(l,h,c,f,s[d+7],14,1735328473),f=v(f,l,h,c,s[d+12],20,-1926607734),c=g(c,f,l,h,s[d+5],4,-378558),h=g(h,c,f,l,s[d+8],11,-2022574463),l=g(l,h,c,f,s[d+11],16,1839030562),f=g(f,l,h,c,s[d+14],23,-35309556),c=g(c,f,l,h,s[d+1],4,-1530992060),h=g(h,c,f,l,s[d+4],11,1272893353),l=g(l,h,c,f,s[d+7],16,-155497632),f=g(f,l,h,c,s[d+10],23,-1094730640),c=g(c,f,l,h,s[d+13],4,681279174),h=g(h,c,f,l,s[d+0],11,-358537222),l=g(l,h,c,f,s[d+3],16,-722521979),f=g(f,l,h,c,s[d+6],23,76029189),c=g(c,f,l,h,s[d+9],4,-640364487),h=g(h,c,f,l,s[d+12],11,-421815835),l=g(l,h,c,f,s[d+15],16,530742520),f=g(f,l,h,c,s[d+2],23,-995338651),c=m(c,f,l,h,s[d+0],6,-198630844),h=m(h,c,f,l,s[d+7],10,1126891415),l=m(l,h,c,f,s[d+14],15,-1416354905),f=m(f,l,h,c,s[d+5],21,-57434055),c=m(c,f,l,h,s[d+12],6,1700485571),h=m(h,c,f,l,s[d+3],10,-1894986606),l=m(l,h,c,f,s[d+10],15,-1051523),f=m(f,l,h,c,s[d+1],21,-2054922799),c=m(c,f,l,h,s[d+8],6,1873313359),h=m(h,c,f,l,s[d+15],10,-30611744),l=m(l,h,c,f,s[d+6],15,-1560198380),f=m(f,l,h,c,s[d+13],21,1309151649),c=m(c,f,l,h,s[d+4],6,-145523070),h=m(h,c,f,l,s[d+11],10,-1120210379),l=m(l,h,c,f,s[d+2],15,718787259),f=m(f,l,h,c,s[d+9],21,-343485551),c=c+y>>>0,f=f+b>>>0,l=l+_>>>0,h=h+w>>>0}return e.endian([c,f,l,h])};a._ff=function(t,e,n,r,i,o,a){var s=t+(e&n|~e&r)+(i>>>0)+a;return(s<<o|s>>>32-o)+e},a._gg=function(t,e,n,r,i,o,a){var s=t+(e&r|n&~r)+(i>>>0)+a;return(s<<o|s>>>32-o)+e},a._hh=function(t,e,n,r,i,o,a){var s=t+(e^n^r)+(i>>>0)+a;return(s<<o|s>>>32-o)+e},a._ii=function(t,e,n,r,i,o,a){var s=t+(n^(e|~r))+(i>>>0)+a;return(s<<o|s>>>32-o)+e},a._blocksize=16,a._digestsize=16,t.exports=function(t,n){if(void 0===t||null===t)throw new Error("Illegal argument "+t);var r=e.wordsToBytes(a(t,n));return n&&n.asBytes?r:n&&n.asString?o.bytesToString(r):e.bytesToHex(r)}}()},function(t,e){!function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],n=0,r=0;n<t.length;n++,r+=8)e[r>>>5]|=t[n]<<24-r%32;return e},wordsToBytes:function(t){for(var e=[],n=0;n<32*t.length;n+=8)e.push(t[n>>>5]>>>24-n%32&255);return e},bytesToHex:function(t){for(var e=[],n=0;n<t.length;n++)e.push((t[n]>>>4).toString(16)),e.push((15&t[n]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],n=0;n<t.length;n+=2)e.push(parseInt(t.substr(n,2),16));return e},bytesToBase64:function(t){for(var n=[],r=0;r<t.length;r+=3)for(var i=t[r]<<16|t[r+1]<<8|t[r+2],o=0;o<4;o++)8*r+6*o<=8*t.length?n.push(e.charAt(i>>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,i=0;r<t.length;i=++r%4)0!=i&&n.push((e.indexOf(t.charAt(r-1))&Math.pow(2,-2*i+8)-1)<<2*i|e.indexOf(t.charAt(r))>>>6-2*i);return n}};t.exports=n}()},function(t,e){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function r(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}/*!
2 * Determine if an object is a Buffer
3 *
4 * @author Feross Aboukhadijeh <https://feross.org>
5 * @license MIT
6 */
7t.exports=function(t){return null!=t&&(n(t)||r(t)||!!t._isBuffer)}},function(t,e,n){"use strict";var r=n(1),i=r(n(90)),o=function(t,e){var n,r;(0,i.default)(t).call(t,"base64")<0?r=atob(t):(0,i.default)(n=t.split(",")[0]).call(n,"base64")>=0?(e=e||t.split(",")[0].split(":")[1].split(";")[0],r=atob(t.split(",")[1])):r=unescape(t.split(",")[1]);for(var o=new Uint8Array(r.length),a=0;a<r.length;a++)o[a]=r.charCodeAt(a);return new Blob([o],{type:e})};t.exports=o},function(t,e,n){"use strict";function r(t,e){return t&&t[e]?v.isFunction(t[e])?t[e]():t[e]:null}var i=n(1),o=i(n(527)),a=i(n(35)),s=i(n(90)),u=i(n(92)),c=i(n(13)),f=i(n(22)),l=i(n(57)),h=i(n(36)),d=i(n(114)),p=i(n(253)),v=n(3),g=n(46),m=n(27),y=m._request,b=n(30),_=b.isNullOrUndefined,w=b.ensureArray,E=b.transformFetchOptions,O=b.setValue,T=b.findValue,S=b.isPlainObject,A=b.continueWhile,x=function t(e){return v.isArray(e)?(0,a.default)(e).call(e,t):S(e)?v.mapObject(e,t):v.isObject(e)&&e._toPointer?e._toPointer():e},I=["objectId","createdAt","updatedAt"],j=function(t){if(-1!==(0,s.default)(I).call(I,t))throw new Error("key[".concat(t,"] is reserved"))},C=function(t){var e=(0,u.default)(v).call(v,t,function(t){return t instanceof Error});if(!e)return t;var n=new g(e.code,e.message);throw n.results=t,n};t.exports=function(t){t.Object=function(e,n){if(v.isString(e))return t.Object._create.apply(this,arguments);e=e||{},n&&n.parse&&(e=this.parse(e),e=this._mergeMagicFields(e));var i=r(this,"defaults");i&&(e=v.extend({},i,e)),n&&n.collection&&(this.collection=n.collection),this._serverData={},this._opSetQueue=[{}],this._flags={},this.attributes={},this._hashedJSON={},this._escapedAttributes={},this.cid=v.uniqueId("c"),this.changed={},this._silent={},this._pending={},this.set(e,{silent:!0}),this.changed={},this._silent={},this._pending={},this._hasData=!0,this._previousAttributes=v.clone(this.attributes),this.initialize.apply(this,arguments)},t.Object.saveAll=function(e,n){return t.Object._deepSaveAsync(e,null,n)},t.Object.fetchAll=function(t,e){return c.default.resolve().then(function(){return y("batch",null,null,"POST",{requests:(0,a.default)(v).call(v,t,function(t){var e;if(!t.className)throw new Error("object must have className to fetch");if(!t.id)throw new Error("object must have id to fetch");if(t.dirty())throw new Error("object is modified but not saved");return{method:"GET",path:(0,f.default)(e="/1.1/classes/".concat(t.className,"/")).call(e,t.id)}})},e)}).then(function(e){var n=(0,a.default)(v).call(v,t,function(t,n){if(e[n].success){var r=t.parse(e[n].success);return t._cleanupUnsetKeys(r),t._finishFetch(r),t}return null===e[n].success?new g(g.OBJECT_NOT_FOUND,"Object not found."):new g(e[n].error.code,e[n].error.error)});return C(n)})},v.extend(t.Object.prototype,t.Events,{_fetchWhenSave:!1,initialize:function(){},fetchWhenSave:function(t){if(console.warn("AV.Object#fetchWhenSave is deprecated, use AV.Object#save with options.fetchWhenSave instead."),!v.isBoolean(t))throw new Error("Expect boolean value for fetchWhenSave");this._fetchWhenSave=t},getObjectId:function(){return this.id},getCreatedAt:function(){return this.createdAt},getUpdatedAt:function(){return this.updatedAt},toJSON:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return this._toFullJSON(n,!1)},toFullJSON:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this._toFullJSON(t)},_toFullJSON:function(e){var n=this,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=v.clone(this.attributes);if(v.isArray(e))var o=(0,f.default)(e).call(e,this);return t._objectEach(i,function(e,n){i[n]=t._encode(e,o,void 0,r)}),t._objectEach(this._operations,function(t,e){i[e]=t}),v.has(this,"id")&&(i.objectId=this.id),["createdAt","updatedAt"].forEach(function(t){if(v.has(n,t)){var e=n[t];i[t]=v.isDate(e)?e.toJSON():e}}),r&&(i.__type="Object",v.isArray(e)&&e.length&&(i.__type="Pointer"),i.className=this.className),i},_refreshCache:function(){var e=this;e._refreshingCache||(e._refreshingCache=!0,t._objectEach(this.attributes,function(n,r){n instanceof t.Object?n._refreshCache():v.isObject(n)&&e._resetCacheForKey(r)&&e.set(r,new t.Op.Set(n),{silent:!0})}),delete e._refreshingCache)},dirty:function(t){this._refreshCache();var e=v.last(this._opSetQueue);return t?!!e[t]:!this.id||(0,l.default)(v).call(v,e).length>0},dirtyKeys:function(){this._refreshCache();var t=v.last(this._opSetQueue);return(0,l.default)(v).call(v,t)},_toPointer:function(){return{__type:"Pointer",className:this.className,objectId:this.id}},get:function(t){switch(t){case"objectId":return this.id;case"createdAt":case"updatedAt":return this[t];default:return this.attributes[t]}},relation:function(e){var n=this.get(e);if(n){if(!(n instanceof t.Relation))throw new Error("Called relation() on non-relation field "+e);return n._ensureParentAndKey(this,e),n}return new t.Relation(this,e)},escape:function(t){var e=this._escapedAttributes[t];if(e)return e;var n,r=this.attributes[t];return n=_(r)?"":v.escape(r.toString()),this._escapedAttributes[t]=n,n},has:function(t){return!_(this.attributes[t])},_mergeMagicFields:function(e){var n=this,r=["objectId","createdAt","updatedAt"];return t._arrayEach(r,function(r){e[r]&&("objectId"===r?n.id=e[r]:"createdAt"!==r&&"updatedAt"!==r||v.isDate(e[r])?n[r]=e[r]:n[r]=t._parseDate(e[r]),delete e[r])}),e},_startSave:function(){this._opSetQueue.push({})},_cancelSave:function(){var e=v.first(this._opSetQueue);this._opSetQueue=v.rest(this._opSetQueue);var n=v.first(this._opSetQueue);t._objectEach(e,function(t,r){var i=e[r],o=n[r];i&&o?n[r]=o._mergeWithPrevious(i):i&&(n[r]=i)}),this._saving=this._saving-1},_finishSave:function(e){var n,r={};t._traverse(this.attributes,function(e){e instanceof t.Object&&e.id&&e._hasData&&(r[e.id]=e)});var i=v.first(this._opSetQueue);this._opSetQueue=v.rest(this._opSetQueue),this._applyOpSet(i,this._serverData),this._mergeMagicFields(e);var o=this;t._objectEach(e,function(e,n){o._serverData[n]=t._decode(e,n);var i=t._traverse(o._serverData[n],function(e){if(e instanceof t.Object&&r[e.id])return r[e.id]});i&&(o._serverData[n]=i)}),this._rebuildAllEstimatedData();var s=(0,a.default)(n=this._opSetQueue).call(n,v.clone);this._refreshCache(),this._opSetQueue=s,this._saving=this._saving-1},_finishFetch:function(e,n){this._opSetQueue=[{}],this._mergeMagicFields(e);var r=this;t._objectEach(e,function(e,n){r._serverData[n]=t._decode(e,n)}),this._rebuildAllEstimatedData(),this._refreshCache(),this._opSetQueue=[{}],this._hasData=n},_applyOpSet:function(e,n){var r=this;t._objectEach(e,function(e,i){var a=T(n,i),s=(0,o.default)(a,3),u=s[0],c=s[1],f=s[2];O(n,i,e._estimate(u,r,i)),c&&c[f]===t.Op._UNSET&&delete c[f]})},_resetCacheForKey:function(e){var n=this.attributes[e];if(v.isObject(n)&&!(n instanceof t.Object)&&!(n instanceof t.File)){var r=(0,h.default)(x(n));if(this._hashedJSON[e]!==r){var i=!!this._hashedJSON[e];return this._hashedJSON[e]=r,i}}return!1},_rebuildEstimatedDataForKey:function(e){var n=this;delete this.attributes[e],this._serverData[e]&&(this.attributes[e]=this._serverData[e]),t._arrayEach(this._opSetQueue,function(r){var i=r[e];if(i){var a=T(n.attributes,e),s=(0,o.default)(a,4),u=s[0],c=s[1],f=s[2],l=s[3];O(n.attributes,e,i._estimate(u,n,e)),c&&c[f]===t.Op._UNSET&&delete c[f],n._resetCacheForKey(l)}})},_rebuildAllEstimatedData:function(){var e=this,n=v.clone(this.attributes);this.attributes=v.clone(this._serverData),t._arrayEach(this._opSetQueue,function(n){e._applyOpSet(n,e.attributes),t._objectEach(n,function(t,n){e._resetCacheForKey(n)})}),t._objectEach(n,function(t,n){e.attributes[n]!==t&&e.trigger("change:"+n,e,e.attributes[n],{})}),t._objectEach(this.attributes,function(t,r){v.has(n,r)||e.trigger("change:"+r,e,t,{})})},set:function(e,n,r){var i;if(v.isObject(e)||_(e)?(i=v.mapObject(e,function(e,n){return j(n),t._decode(e,n)}),r=n):(i={},j(e),i[e]=t._decode(n,e)),r=r||{},!i)return this;i instanceof t.Object&&(i=i.attributes),r.unset&&t._objectEach(i,function(e,n){i[n]=new t.Op.Unset});var o=v.clone(i),a=this;t._objectEach(o,function(e,n){e instanceof t.Op&&(o[n]=e._estimate(a.attributes[n],a,n),o[n]===t.Op._UNSET&&delete o[n])}),this._validate(i,r),r.changes={};var s=this._escapedAttributes;return t._arrayEach((0,l.default)(v).call(v,i),function(e){var n=i[e];n instanceof t.Relation&&(n.parent=a),n instanceof t.Op||(n=new t.Op.Set(n));var o=!0;n instanceof t.Op.Set&&v.isEqual(a.attributes[e],n.value)&&(o=!1),o&&(delete s[e],r.silent?a._silent[e]=!0:r.changes[e]=!0);var u=v.last(a._opSetQueue);u[e]=n._mergeWithPrevious(u[e]),a._rebuildEstimatedDataForKey(e),o?(a.changed[e]=a.attributes[e],r.silent||(a._pending[e]=!0)):(delete a.changed[e],delete a._pending[e])}),r.silent||this.change(r),this},unset:function(t,e){return e=e||{},e.unset=!0,this.set(t,null,e)},increment:function(e,n){return(v.isUndefined(n)||v.isNull(n))&&(n=1),this.set(e,new t.Op.Increment(n))},add:function(e,n){return this.set(e,new t.Op.Add(w(n)))},addUnique:function(e,n){return this.set(e,new t.Op.AddUnique(w(n)))},remove:function(e,n){return this.set(e,new t.Op.Remove(w(n)))},bitAnd:function(e,n){return this.set(e,new t.Op.BitAnd(n))},bitOr:function(e,n){return this.set(e,new t.Op.BitOr(n))},bitXor:function(e,n){return this.set(e,new t.Op.BitXor(n))},op:function(t){return v.last(this._opSetQueue)[t]},clear:function(t){t=t||{},t.unset=!0;var e=v.extend(this.attributes,this._operations);return this.set(e,t)},revert:function(t){var e=v.last(this._opSetQueue);return w(t||(0,l.default)(v).call(v,e)).forEach(function(t){delete e[t]}),this._rebuildAllEstimatedData(),this},_getSaveJSON:function(){var e=v.clone(v.first(this._opSetQueue));return t._objectEach(e,function(t,n){e[n]=t.toJSON()}),e},_canBeSerialized:function(){return t.Object._canBeSerializedAsValue(this.attributes)},fetch:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;if(!this.id)throw new Error("Cannot fetch unsaved object");var n=this;return y("classes",this.className,this.id,"GET",E(t),e).then(function(e){var r=n.parse(e);return n._cleanupUnsetKeys(r,(0,l.default)(t)?w((0,l.default)(t)).join(",").split(","):void 0),n._finishFetch(r,!0),n})},_cleanupUnsetKeys:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,l.default)(v).call(v,this._serverData);v.forEach(n,function(n){void 0===t[n]&&delete e._serverData[n]})},save:function(e,n,r){var i,o,a;v.isObject(e)||_(e)?(i=e,a=n):(i={},i[e]=n,a=r),a=v.clone(a)||{},a.wait&&(o=v.clone(this.attributes));var s=v.clone(a)||{};s.wait&&(s.silent=!0),i&&this.set(i,s);var u=this,f=[],l=[];return t.Object._findUnsavedChildren(u,f,l),f.length+l.length>1?t.Object._deepSaveAsync(this,u,a):(this._startSave(),this._saving=(this._saving||0)+1,this._allPreviousSaves=this._allPreviousSaves||c.default.resolve(),this._allPreviousSaves=this._allPreviousSaves.catch(function(t){}).then(function(){var t=u.id?"PUT":"POST",e=u._getSaveJSON(),n={};if((u._fetchWhenSave||a.fetchWhenSave)&&(n.new="true"),a._failOnNotExist&&(n.failOnNotExist="true"),a.query){var r;if("function"==typeof a.query._getParams&&(r=a.query._getParams())&&(n.where=r.where),!n.where){throw new Error("options.query is not an AV.Query")}}v.extend(e,u._flags);var c="classes",f=u.className;"_User"!==u.className||u.id||(c="users",f=null);var l=a._makeRequest||y,h=l(c,f,u.id,t,e,a,n);return h=h.then(function(t){var e=u.parse(t);return a.wait&&(e=v.extend(i||{},e)),u._finishSave(e),a.wait&&u.set(o,s),u},function(t){throw u._cancelSave(),t})}),this._allPreviousSaves)},destroy:function(t){t=t||{};var e=this,n=function(){e.trigger("destroy",e,e.collection,t)};return this.id?(t.wait||n(),y("classes",this.className,this.id,"DELETE",this._flags,t).then(function(){return t.wait&&n(),e})):n()},parse:function(e){var n=v.clone(e);return["createdAt","updatedAt"].forEach(function(e){n[e]&&(n[e]=t._parseDate(n[e]))}),n.createdAt&&!n.updatedAt&&(n.updatedAt=n.createdAt),n},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.id},change:function(e){e=e||{};var n=this._changing;this._changing=!0;var r=this;t._objectEach(this._silent,function(t){r._pending[t]=!0});var i=v.extend({},e.changes,this._silent);if(this._silent={},t._objectEach(i,function(t,n){r.trigger("change:"+n,r,r.get(n),e)}),n)return this;for(var o=function(t,e){r._pending[e]||r._silent[e]||delete r.changed[e]};!v.isEmpty(this._pending);)this._pending={},this.trigger("change",this,e),t._objectEach(this.changed,o),r._previousAttributes=v.clone(this.attributes);return this._changing=!1,this},previous:function(t){return arguments.length&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return v.clone(this._previousAttributes)},isValid:function(){try{this.validate(this.attributes)}catch(t){return!1}return!0},validate:function(e){if(v.has(e,"ACL")&&!(e.ACL instanceof t.ACL))throw new g(g.OTHER_CAUSE,"ACL must be a AV.ACL.")},_validate:function(t,e){!e.silent&&this.validate&&(t=v.extend({},this.attributes,t),this.validate(t))},getACL:function(){return this.get("ACL")},setACL:function(t,e){return this.set("ACL",t,e)},disableBeforeHook:function(){this.ignoreHook("beforeSave"),this.ignoreHook("beforeUpdate"),this.ignoreHook("beforeDelete")},disableAfterHook:function(){this.ignoreHook("afterSave"),this.ignoreHook("afterUpdate"),this.ignoreHook("afterDelete")},ignoreHook:function(e){if(!v.contains(["beforeSave","afterSave","beforeUpdate","afterUpdate","beforeDelete","afterDelete"],e))throw new Error("Unsupported hookName: "+e);if(!t.hookKey)throw new Error("ignoreHook required hookKey");this._flags.__ignore_hooks||(this._flags.__ignore_hooks=[]),this._flags.__ignore_hooks.push(e)}}),t.Object.createWithoutData=function(e,n,r){var i;if(v.isString(e))i=t.Object._getSubclass(e);else{if(!(e.prototype&&e.prototype instanceof t.Object))throw new Error("class must be a string or a subclass of AV.Object.");i=e}if(!n)throw new TypeError("The objectId must be provided");var o=new i;return o.id=n,o._hasData=r,o},t.Object.destroyAll=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||0===t.length)return c.default.resolve();var n=v.groupBy(t,function(t){return(0,h.default)({className:t.className,flags:t._flags})}),r={requests:(0,a.default)(v).call(v,n,function(t){var e,n=(0,a.default)(v).call(v,t,"id").join(",");return{method:"DELETE",path:(0,f.default)(e="/1.1/classes/".concat(t[0].className,"/")).call(e,n),body:t[0]._flags}})};return y("batch",null,null,"POST",r,e).then(function(t){var e=(0,u.default)(v).call(v,t,function(t){return!t.success});if(e)throw new g(e.error.code,e.error.error)})},t.Object._getSubclass=function(e){if(!v.isString(e))throw new Error("AV.Object._getSubclass requires a string argument.");var n=t.Object._classMap[e];return n||(n=t.Object.extend(e),t.Object._classMap[e]=n),n},t.Object._create=function(e,n,r){return new(t.Object._getSubclass(e))(n,r)},t.Object._classMap={},t.Object._extend=t._extend,t.Object.new=function(e,n){return new t.Object(e,n)},t.Object.extend=function(e,n,r){if(!v.isString(e)){if(e&&v.has(e,"className"))return t.Object.extend(e.className,e,n);throw new Error("AV.Object.extend's first argument should be the className.")}"User"===e&&(e="_User");var i=null;if(v.has(t.Object._classMap,e)){var o=t.Object._classMap[e];if(!n&&!r)return o;i=o._extend(n,r)}else n=n||{},n._className=e,i=this._extend(n,r);return i.extend=function(n){var r;if(v.isString(n)||n&&v.has(n,"className"))return t.Object.extend.apply(i,arguments);var o=(0,f.default)(r=[e]).call(r,v.toArray(arguments));return t.Object.extend.apply(i,o)},(0,d.default)(i,"query",(0,p.default)(t.Object,"query")),i.new=function(t,e){return new i(t,e)},t.Object._classMap[e]=i,i},(0,d.default)(t.Object.prototype,"className",{get:function(){var t=this._className||this.constructor._LCClassName||this.constructor.name;return"User"===t?"_User":t}}),t.Object.register=function(e,n){if(!(e.prototype instanceof t.Object))throw new Error("registered class is not a subclass of AV.Object");var r=n||e.name;if(!r.length)throw new Error("registered class must be named");n&&(e._LCClassName=n),t.Object._classMap[r]=e},(0,d.default)(t.Object,"query",{get:function(){return new t.Query(this.prototype.className)}}),t.Object._findUnsavedChildren=function(e,n,r){t._traverse(e,function(e){return e instanceof t.Object?void(e.dirty()&&n.push(e)):e instanceof t.File?void(e.id||r.push(e)):void 0})},t.Object._canBeSerializedAsValue=function(e){var n=!0;return e instanceof t.Object||e instanceof t.File?n=!!e.id:v.isArray(e)?t._arrayEach(e,function(e){t.Object._canBeSerializedAsValue(e)||(n=!1)}):v.isObject(e)&&t._objectEach(e,function(e){t.Object._canBeSerializedAsValue(e)||(n=!1)}),n},t.Object._deepSaveAsync=function(e,n,r){var i=[],o=[];t.Object._findUnsavedChildren(e,i,o),o=v.uniq(o);var s=c.default.resolve();v.each(o,function(t){s=s.then(function(){return t.save()})});var u=v.uniq(i),f=v.uniq(u);return s.then(function(){return A(function(){return f.length>0},function(){var e=[],n=[];if(t._arrayEach(f,function(t){t._canBeSerialized()?e.push(t):n.push(t)}),f=n,0===e.length)return c.default.reject(new g(g.OTHER_CAUSE,"Tried to save a batch with a cycle."));var i=c.default.resolve((0,a.default)(v).call(v,e,function(t){return t._allPreviousSaves||c.default.resolve()})),o=i.then(function(){return y("batch",null,null,"POST",{requests:(0,a.default)(v).call(v,e,function(t){var e=t.id?"PUT":"POST",n=t._getSaveJSON();v.extend(n,t._flags);var i=t.className,o="/".concat("classes","/").concat(i);"_User"!==t.className||t.id||(o="/users");var o="/1.1".concat(o);return t.id&&(o=o+"/"+t.id),t._startSave(),{method:e,path:o,body:n,params:r&&r.fetchWhenSave?{fetchWhenSave:!0}:void 0}})},r).then(function(t){var n=(0,a.default)(v).call(v,e,function(e,n){return t[n].success?(e._finishSave(e.parse(t[n].success)),e):(e._cancelSave(),new g(t[n].error.code,t[n].error.error))});return C(n)})});return t._arrayEach(e,function(t){t._allPreviousSaves=o}),o})}).then(function(){return e})}}},function(t,e,n){function r(t,e){return i(t)||o(t,e)||a(t,e)||s()}var i=n(528),o=n(536),a=n(537),s=n(547);t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){function r(t){if(i(t))return t}var i=n(529);t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){t.exports=n(530)},function(t,e,n){t.exports=n(531)},function(t,e,n){var r=n(532);t.exports=r},function(t,e,n){var r=n(533);t.exports=r},function(t,e,n){var r=n(534);t.exports=r},function(t,e,n){n(535);var r=n(6);t.exports=r.Array.isArray},function(t,e,n){n(0)({target:"Array",stat:!0},{isArray:n(88)})},function(t,e,n){function r(t,e){var n=null==t?null:void 0!==i&&o(t)||t["@@iterator"];if(null!=n){var r,a,s=[],u=!0,c=!1;try{for(n=n.call(t);!(u=(r=n.next()).done)&&(s.push(r.value),!e||s.length!==e);u=!0);}catch(t){c=!0,a=t}finally{try{u||null==n.return||n.return()}finally{if(c)throw a}}return s}}var i=n(236),o=n(248);t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){function r(t,e){var n;if(t){if("string"==typeof t)return a(t,e);var r=i(n=Object.prototype.toString.call(t)).call(n,8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?o(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}var i=n(538),o=n(542),a=n(546);t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){t.exports=n(539)},function(t,e,n){t.exports=n(540)},function(t,e,n){var r=n(541);t.exports=r},function(t,e,n){var r=n(234);t.exports=r},function(t,e,n){t.exports=n(543)},function(t,e,n){t.exports=n(544)},function(t,e,n){var r=n(545);t.exports=r},function(t,e,n){var r=n(246);t.exports=r},function(t,e){function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(549);t.exports=r},function(t,e,n){n(550);var r=n(6),i=r.Object,o=t.exports=function(t,e){return i.getOwnPropertyDescriptor(t,e)};i.getOwnPropertyDescriptor.sham&&(o.sham=!0)},function(t,e,n){var r=n(0),i=n(2),o=n(32),a=n(60).f,s=n(14),u=i(function(){a(1)});r({target:"Object",stat:!0,forced:!s||u,sham:!s},{getOwnPropertyDescriptor:function(t,e){return a(o(t),e)}})},function(t,e,n){"use strict";var r=n(3),i=n(46);t.exports=function(t){t.Role=t.Object.extend("_Role",{constructor:function(e,n){if(r.isString(e)?(t.Object.prototype.constructor.call(this,null,null),this.setName(e)):t.Object.prototype.constructor.call(this,e,n),n){if(!(n instanceof t.ACL))throw new TypeError("acl must be an instance of AV.ACL");this.setACL(n)}},getName:function(){return this.get("name")},setName:function(t,e){return this.set("name",t,e)},getUsers:function(){return this.relation("users")},getRoles:function(){return this.relation("roles")},validate:function(e,n){if("name"in e&&e.name!==this.getName()){var o=e.name;if(this.id&&this.id!==e.objectId)return new i(i.OTHER_CAUSE,"A role's name can only be set before it has been saved.");if(!r.isString(o))return new i(i.OTHER_CAUSE,"A role's name must be a String.");if(!/^[0-9a-zA-Z\-_ ]+$/.test(o))return new i(i.OTHER_CAUSE,"A role's name can only contain alphanumeric characters, _, -, and spaces.")}return!!t.Object.prototype.validate&&t.Object.prototype.validate.call(this,e,n)}})}},function(t,e,n){"use strict";var r=n(1),i=r(n(553)),o=r(n(13)),a=r(n(35)),s=r(n(92)),u=r(n(36)),c=n(3),f=n(226),l=n(46),h=n(27),d=h._request,p=h.request,v=n(71),g=v.getAdapter,m=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"weixin";return function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.unionIdPlatform,o=void 0===i?t:i,a=r.asMainAccount,s=void 0!==a&&a;if("string"!=typeof n)throw new l(l.OTHER_CAUSE,"unionId is not a string");if("string"!=typeof o)throw new l(l.OTHER_CAUSE,"unionIdPlatform is not a string");return c.extend({},e,{platform:o,unionid:n,main_account:Boolean(s)})}};t.exports=function(t){t.User=t.Object.extend("_User",{_isCurrentUser:!1,_mergeMagicFields:function(e){return e.sessionToken&&(this._sessionToken=e.sessionToken,delete e.sessionToken),t.User.__super__._mergeMagicFields.call(this,e)},_cleanupAuthData:function(){if(this.isCurrent()){var e=this.get("authData");e&&t._objectEach(this.get("authData"),function(t,n){e[n]||delete e[n]})}},_synchronizeAllAuthData:function(){if(this.get("authData")){var e=this;t._objectEach(this.get("authData"),function(t,n){e._synchronizeAuthData(n)})}},_synchronizeAuthData:function(e){if(this.isCurrent()){var n;c.isString(e)?(n=e,e=t.User._authProviders[n]):n=e.getAuthType();var r=this.get("authData");if(r&&e){e.restoreAuthentication(r[n])||this.dissociateAuthData(e)}}},_handleSaveResult:function(e){return e&&!t._config.disableCurrentUser&&(this._isCurrentUser=!0),this._cleanupAuthData(),this._synchronizeAllAuthData(),delete this._serverData.password,this._rebuildEstimatedDataForKey("password"),this._refreshCache(),!e&&!this.isCurrent()||t._config.disableCurrentUser?o.default.resolve():o.default.resolve(t.User._saveCurrentUser(this))},_linkWith:function(e,n){var r,o=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=a.failOnNotExist,u=void 0!==s&&s,f=a.useMasterKey,l=a.sessionToken,h=a.user;return c.isString(e)?(r=e,e=t.User._authProviders[e]):r=e.getAuthType(),n?this.save({authData:(0,i.default)({},r,n)},{useMasterKey:f,sessionToken:l,user:h,fetchWhenSave:!!this.get("authData"),_failOnNotExist:u}).then(function(t){return t._handleSaveResult(!0).then(function(){return t})}):e.authenticate().then(function(t){return o._linkWith(e,t)})},associateWithAuthData:function(t,e){return this._linkWith(e,t)},associateWithAuthDataAndUnionId:function(t,e,n,r){return this._linkWith(e,m()(t,n,r))},associateWithMiniApp:function(t,e){var n=this;if(void 0===t){return g("getAuthInfo")().then(function(t){return n._linkWith(t.provider,t.authData,e)})}return this._linkWith(t.provider,t.authData,e)},associateWithQQApp:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.preferUnionId,r=void 0!==n&&n,i=e.unionIdPlatform,o=void 0===i?"qq":i,a=e.asMainAccount,s=void 0===a||a;return g("getAuthInfo")({preferUnionId:r,asMainAccount:s,platform:o}).then(function(e){return e.provider="lc_qqapp",t.associateWithMiniApp(e)})},associateWithWeapp:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.preferUnionId,r=void 0!==n&&n,i=e.unionIdPlatform,o=void 0===i?"weixin":i,a=e.asMainAccount,s=void 0===a||a;return g("getAuthInfo")({preferUnionId:r,asMainAccount:s,platform:o}).then(function(e){return t.associateWithMiniApp(e)})},linkWithWeapp:function(t){return console.warn("DEPRECATED: User#linkWithWeapp 已废弃,请使用 User#associateWithWeapp 代替"),this.associateWithWeapp(t)},associateWithQQAppWithUnionId:function(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.unionIdPlatform,o=void 0===i?"qq":i,a=r.asMainAccount,s=void 0!==a&&a;return g("getAuthInfo")({platform:o}).then(function(r){return r=t.User.mergeUnionId(r,e,{asMainAccount:s}),r.provider="lc_qqapp",n.associateWithMiniApp(r)})},associateWithWeappWithUnionId:function(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.unionIdPlatform,o=void 0===i?"weixin":i,a=r.asMainAccount,s=void 0!==a&&a;return g("getAuthInfo")({platform:o}).then(function(r){return r=t.User.mergeUnionId(r,e,{asMainAccount:s}),n.associateWithMiniApp(r)})},dissociateAuthData:function(t){return this.unset("authData.".concat(t)),this.save().then(function(t){return t._handleSaveResult(!0).then(function(){return t})})},_unlinkFrom:function(t){return console.warn("DEPRECATED: User#_unlinkFrom 已废弃,请使用 User#dissociateAuthData 代替"),this.dissociateAuthData(t)},_isLinked:function(t){var e;return e=c.isString(t)?t:t.getAuthType(),!!(this.get("authData")||{})[e]},isAnonymous:function(){return this._isLinked("anonymous")},logOut:function(){this._logOutWithAll(),this._isCurrentUser=!1},_logOutWithAll:function(){if(this.get("authData")){var e=this;t._objectEach(this.get("authData"),function(t,n){e._logOutWith(n)})}},_logOutWith:function(e){this.isCurrent()&&(c.isString(e)&&(e=t.User._authProviders[e]),e&&e.deauthenticate&&e.deauthenticate())},signUp:function(t,e){var n=t&&t.username||this.get("username");if(!n||""===n)throw new l(l.OTHER_CAUSE,"Cannot sign up user with an empty name.");var r=t&&t.password||this.get("password");if(!r||""===r)throw new l(l.OTHER_CAUSE,"Cannot sign up user with an empty password.");return this.save(t,e).then(function(t){return t.isAnonymous()&&(t.unset("authData.".concat("anonymous")),t._opSetQueue=[{}]),t._handleSaveResult(!0).then(function(){return t})})},signUpOrlogInWithMobilePhone:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t&&t.mobilePhoneNumber||this.get("mobilePhoneNumber");if(!n||""===n)throw new l(l.OTHER_CAUSE,"Cannot sign up or login user by mobilePhoneNumber with an empty mobilePhoneNumber.");var r=t&&t.smsCode||this.get("smsCode");if(!r||""===r)throw new l(l.OTHER_CAUSE,"Cannot sign up or login user by mobilePhoneNumber with an empty smsCode.");return e._makeRequest=function(t,e,n,r,i){return d("usersByMobilePhone",null,null,"POST",i)},this.save(t,e).then(function(t){return delete t.attributes.smsCode,delete t._serverData.smsCode,t._handleSaveResult(!0).then(function(){return t})})},loginWithAuthData:function(t,e,n){return this._linkWith(e,t,n)},loginWithAuthDataAndUnionId:function(t,e,n,r){return this.loginWithAuthData(m()(t,n,r),e,r)},loginWithWeapp:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.preferUnionId,r=void 0!==n&&n,i=e.unionIdPlatform,o=void 0===i?"weixin":i,a=e.asMainAccount,s=void 0===a||a,u=e.failOnNotExist,c=void 0!==u&&u,f=e.useMasterKey,l=e.sessionToken,h=e.user;return g("getAuthInfo")({preferUnionId:r,asMainAccount:s,platform:o}).then(function(e){return t.loginWithMiniApp(e,{failOnNotExist:c,useMasterKey:f,sessionToken:l,user:h})})},loginWithWeappWithUnionId:function(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.unionIdPlatform,o=void 0===i?"weixin":i,a=r.asMainAccount,s=void 0!==a&&a,u=r.failOnNotExist,c=void 0!==u&&u,f=r.useMasterKey,l=r.sessionToken,h=r.user;return g("getAuthInfo")({platform:o}).then(function(r){return r=t.User.mergeUnionId(r,e,{asMainAccount:s}),n.loginWithMiniApp(r,{failOnNotExist:c,useMasterKey:f,sessionToken:l,user:h})})},loginWithQQApp:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.preferUnionId,r=void 0!==n&&n,i=e.unionIdPlatform,o=void 0===i?"qq":i,a=e.asMainAccount,s=void 0===a||a,u=e.failOnNotExist,c=void 0!==u&&u,f=e.useMasterKey,l=e.sessionToken,h=e.user;return g("getAuthInfo")({preferUnionId:r,asMainAccount:s,platform:o}).then(function(e){return e.provider="lc_qqapp",t.loginWithMiniApp(e,{failOnNotExist:c,useMasterKey:f,sessionToken:l,user:h})})},loginWithQQAppWithUnionId:function(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.unionIdPlatform,o=void 0===i?"qq":i,a=r.asMainAccount,s=void 0!==a&&a,u=r.failOnNotExist,c=void 0!==u&&u,f=r.useMasterKey,l=r.sessionToken,h=r.user;return g("getAuthInfo")({platform:o}).then(function(r){return r=t.User.mergeUnionId(r,e,{asMainAccount:s}),r.provider="lc_qqapp",n.loginWithMiniApp(r,{failOnNotExist:c,useMasterKey:f,sessionToken:l,user:h})})},loginWithMiniApp:function(t,e){var n=this;if(void 0===t){return g("getAuthInfo")().then(function(t){return n.loginWithAuthData(t.authData,t.provider,e)})}return this.loginWithAuthData(t.authData,t.provider,e)},logIn:function(){var t=this;return d("login",null,null,"POST",this.toJSON()).then(function(e){var n=t.parse(e);return t._finishFetch(n),t._handleSaveResult(!0).then(function(){return n.smsCode||delete t.attributes.smsCode,t})})},save:function(e,n,r){var i,o;return c.isObject(e)||c.isNull(e)||c.isUndefined(e)?(i=e,o=n):(i={},i[e]=n,o=r),o=o||{},t.Object.prototype.save.call(this,i,o).then(function(t){return t._handleSaveResult(!1).then(function(){return t})})},follow:function(e,n){if(!this.id)throw new Error("Please signin.");var r,i;e.user?(r=e.user,i=e.attributes):r=e;var o=c.isString(r)?r:r.id;if(!o)throw new Error("Invalid target user.");var a="users/"+this.id+"/friendship/"+o;return d(a,null,null,"POST",t._encode(i),n)},unfollow:function(t,e){if(!this.id)throw new Error("Please signin.");var n;n=t.user?t.user:t;var r=c.isString(n)?n:n.id;if(!r)throw new Error("Invalid target user.");var i="users/"+this.id+"/friendship/"+r;return d(i,null,null,"DELETE",null,e)},getFollowersAndFollowees:function(e,n){if(!this.id)throw new Error("Please signin.");return p({method:"GET",path:"/users/".concat(this.id,"/followersAndFollowees"),query:{skip:e&&e.skip,limit:e&&e.limit,include:"follower,followee",keys:"follower,followee"},authOptions:n}).then(function(e){var n=e.followers,r=e.followees;return{followers:(0,a.default)(n).call(n,function(e){var n=e.follower;return t._decode(n)}),followees:(0,a.default)(r).call(r,function(e){var n=e.followee;return t._decode(n)})}})},followerQuery:function(){return t.User.followerQuery(this.id)},followeeQuery:function(){return t.User.followeeQuery(this.id)},fetch:function(e,n){return t.Object.prototype.fetch.call(this,e,n).then(function(t){return t._handleSaveResult(!1).then(function(){return t})})},updatePassword:function(t,e,n){var r=this,i="users/"+this.id+"/updatePassword";return d(i,null,null,"PUT",{old_password:t,new_password:e},n).then(function(t){return r._finishFetch(r.parse(t)),r._handleSaveResult(!0).then(function(){return t})})},isCurrent:function(){return this._isCurrentUser},getUsername:function(){return this.get("username")},getMobilePhoneNumber:function(){return this.get("mobilePhoneNumber")},setMobilePhoneNumber:function(t,e){return this.set("mobilePhoneNumber",t,e)},setUsername:function(t,e){return this.set("username",t,e)},setPassword:function(t,e){return this.set("password",t,e)},getEmail:function(){return this.get("email")},setEmail:function(t,e){return this.set("email",t,e)},authenticated:function(){return console.warn("DEPRECATED: 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id。"),!!this._sessionToken&&!t._config.disableCurrentUser&&t.User.current()&&t.User.current().id===this.id},isAuthenticated:function(){var e=this;return o.default.resolve().then(function(){return!!e._sessionToken&&t.User._fetchUserBySessionToken(e._sessionToken).then(function(){return!0},function(t){if(211===t.code)return!1;throw t})})},getSessionToken:function(){return this._sessionToken},refreshSessionToken:function(t){var e=this;return d("users/".concat(this.id,"/refreshSessionToken"),null,null,"PUT",null,t).then(function(t){return e._finishFetch(t),e._handleSaveResult(!0).then(function(){return e})})},getRoles:function(e){var n;return(0,s.default)(n=t.Relation.reverseQuery("_Role","users",this)).call(n,e)}},{_currentUser:null,_currentUserMatchesDisk:!1,_CURRENT_USER_KEY:"currentUser",_authProviders:{},signUp:function(e,n,r,i){return r=r||{},r.username=e,r.password=n,t.Object._create("_User").signUp(r,i)},logIn:function(e,n){var r=t.Object._create("_User");return r._finishFetch({username:e,password:n}),r.logIn()},become:function(t){return this._fetchUserBySessionToken(t).then(function(t){return t._handleSaveResult(!0).then(function(){return t})})},_fetchUserBySessionToken:function(e){if(void 0===e)return o.default.reject(new Error("The sessionToken cannot be undefined"));var n=t.Object._create("_User");return p({method:"GET",path:"/users/me",authOptions:{sessionToken:e}}).then(function(t){var e=n.parse(t);return n._finishFetch(e),n})},logInWithMobilePhoneSmsCode:function(e,n){var r=t.Object._create("_User");return r._finishFetch({mobilePhoneNumber:e,smsCode:n}),r.logIn()},signUpOrlogInWithMobilePhone:function(e,n,r,i){return r=r||{},r.mobilePhoneNumber=e,r.smsCode=n,t.Object._create("_User").signUpOrlogInWithMobilePhone(r,i)},logInWithMobilePhone:function(e,n){var r=t.Object._create("_User");return r._finishFetch({mobilePhoneNumber:e,password:n}),r.logIn()},loginWithEmail:function(e,n){var r=t.Object._create("_User");return r._finishFetch({email:e,password:n}),r.logIn()},loginWithAuthData:function(e,n,r){return t.User._logInWith(n,e,r)},signUpOrlogInWithAuthData:function(){return console.warn("DEPRECATED: User.signUpOrlogInWithAuthData 已废弃,请使用 User#loginWithAuthData 代替"),this.loginWithAuthData.apply(this,arguments)},loginWithAuthDataAndUnionId:function(t,e,n,r){return this.loginWithAuthData(m()(t,n,r),e,r)},signUpOrlogInWithAuthDataAndUnionId:function(){return console.warn("DEPRECATED: User.signUpOrlogInWithAuthDataAndUnionId 已废弃,请使用 User#loginWithAuthDataAndUnionId 代替"),this.loginWithAuthDataAndUnionId.apply(this,arguments)},mergeUnionId:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.asMainAccount,i=void 0!==r&&r;t=JSON.parse((0,u.default)(t));var o=t,a=o.authData,s=o.platform;return a.platform=s,a.main_account=i,a.unionid=e,t},loginWithWeapp:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.preferUnionId,r=void 0!==n&&n,i=e.unionIdPlatform,o=void 0===i?"weixin":i,a=e.asMainAccount,s=void 0===a||a,u=e.failOnNotExist,c=void 0!==u&&u,f=e.useMasterKey,l=e.sessionToken,h=e.user;return g("getAuthInfo")({preferUnionId:r,asMainAccount:s,platform:o}).then(function(e){return t.loginWithMiniApp(e,{failOnNotExist:c,useMasterKey:f,sessionToken:l,user:h})})},loginWithWeappWithUnionId:function(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.unionIdPlatform,o=void 0===i?"weixin":i,a=r.asMainAccount,s=void 0!==a&&a,u=r.failOnNotExist,c=void 0!==u&&u,f=r.useMasterKey,l=r.sessionToken,h=r.user;return g("getAuthInfo")({platform:o}).then(function(r){return r=t.User.mergeUnionId(r,e,{asMainAccount:s}),n.loginWithMiniApp(r,{failOnNotExist:c,useMasterKey:f,sessionToken:l,user:h})})},loginWithQQApp:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.preferUnionId,r=void 0!==n&&n,i=e.unionIdPlatform,o=void 0===i?"qq":i,a=e.asMainAccount,s=void 0===a||a,u=e.failOnNotExist,c=void 0!==u&&u,f=e.useMasterKey,l=e.sessionToken,h=e.user;return g("getAuthInfo")({preferUnionId:r,asMainAccount:s,platform:o}).then(function(e){return e.provider="lc_qqapp",t.loginWithMiniApp(e,{failOnNotExist:c,useMasterKey:f,sessionToken:l,user:h})})},loginWithQQAppWithUnionId:function(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.unionIdPlatform,o=void 0===i?"qq":i,a=r.asMainAccount,s=void 0!==a&&a,u=r.failOnNotExist,c=void 0!==u&&u,f=r.useMasterKey,l=r.sessionToken,h=r.user;return g("getAuthInfo")({platform:o}).then(function(r){return r=t.User.mergeUnionId(r,e,{asMainAccount:s}),r.provider="lc_qqapp",n.loginWithMiniApp(r,{failOnNotExist:c,useMasterKey:f,sessionToken:l,user:h})})},loginWithMiniApp:function(t,e){var n=this;if(void 0===t){return g("getAuthInfo")().then(function(t){return n.loginWithAuthData(t.authData,t.provider,e)})}return this.loginWithAuthData(t.authData,t.provider,e)},_genId:function(){return f()},loginAnonymously:function(){return this.loginWithAuthData({id:t.User._genId()},"anonymous")},associateWithAuthData:function(t,e,n){return console.warn("DEPRECATED: User.associateWithAuthData 已废弃,请使用 User#associateWithAuthData 代替"),t._linkWith(e,n)},logOut:function(){return t._config.disableCurrentUser?(console.warn("AV.User.current() was disabled in multi-user environment, call logOut() from user object instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html"),o.default.resolve(null)):(null!==t.User._currentUser&&(t.User._currentUser._logOutWithAll(),t.User._currentUser._isCurrentUser=!1),t.User._currentUserMatchesDisk=!0,t.User._currentUser=null,t.localStorage.removeItemAsync(t._getAVPath(t.User._CURRENT_USER_KEY)).then(function(){return t._refreshSubscriptionId()}))},followerQuery:function(e){if(!e||!c.isString(e))throw new Error("Invalid user object id.");var n=new t.FriendShipQuery("_Follower");return n._friendshipTag="follower",n.equalTo("user",t.Object.createWithoutData("_User",e)),n},followeeQuery:function(e){if(!e||!c.isString(e))throw new Error("Invalid user object id.");var n=new t.FriendShipQuery("_Followee");return n._friendshipTag="followee",n.equalTo("user",t.Object.createWithoutData("_User",e)),n},requestPasswordReset:function(t){return d("requestPasswordReset",null,null,"POST",{email:t})},requestEmailVerify:function(t){return d("requestEmailVerify",null,null,"POST",{email:t})},requestMobilePhoneVerify:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={mobilePhoneNumber:t};return e.validateToken&&(n.validate_token=e.validateToken),d("requestMobilePhoneVerify",null,null,"POST",n,e)},requestPasswordResetBySmsCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={mobilePhoneNumber:t};return e.validateToken&&(n.validate_token=e.validateToken),d("requestPasswordResetBySmsCode",null,null,"POST",n,e)},requestChangePhoneNumber:function(t,e,n){var r={mobilePhoneNumber:t};return e&&(r.ttl=n.ttl),n&&n.validateToken&&(r.validate_token=n.validateToken),d("requestChangePhoneNumber",null,null,"POST",r,n)},changePhoneNumber:function(t,e){return d("changePhoneNumber",null,null,"POST",{mobilePhoneNumber:t,code:e})},resetPasswordBySmsCode:function(t,e){return d("resetPasswordBySmsCode",null,t,"PUT",{password:e})},verifyMobilePhone:function(t){return d("verifyMobilePhone",null,t,"POST",null)},requestLoginSmsCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={mobilePhoneNumber:t};return e.validateToken&&(n.validate_token=e.validateToken),d("requestLoginSmsCode",null,null,"POST",n,e)},currentAsync:function(){return t._config.disableCurrentUser?(console.warn("AV.User.currentAsync() was disabled in multi-user environment, access user from request instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html"),o.default.resolve(null)):t.User._currentUser?o.default.resolve(t.User._currentUser):t.User._currentUserMatchesDisk?o.default.resolve(t.User._currentUser):t.localStorage.getItemAsync(t._getAVPath(t.User._CURRENT_USER_KEY)).then(function(e){if(!e)return null;t.User._currentUserMatchesDisk=!0,t.User._currentUser=t.Object._create("_User"),t.User._currentUser._isCurrentUser=!0;var n=JSON.parse(e);return t.User._currentUser.id=n._id,delete n._id,t.User._currentUser._sessionToken=n._sessionToken,delete n._sessionToken,t.User._currentUser._finishFetch(n),t.User._currentUser._synchronizeAllAuthData(),t.User._currentUser._refreshCache(),t.User._currentUser._opSetQueue=[{}],t.User._currentUser})},current:function(){if(t._config.disableCurrentUser)return console.warn("AV.User.current() was disabled in multi-user environment, access user from request instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html"),null;if(t.localStorage.async){var e=new Error("Synchronous API User.current() is not available in this runtime. Use User.currentAsync() instead.");throw e.code="SYNC_API_NOT_AVAILABLE",e}if(t.User._currentUser)return t.User._currentUser;if(t.User._currentUserMatchesDisk)return t.User._currentUser;t.User._currentUserMatchesDisk=!0;var n=t.localStorage.getItem(t._getAVPath(t.User._CURRENT_USER_KEY));if(!n)return null;t.User._currentUser=t.Object._create("_User"),t.User._currentUser._isCurrentUser=!0;var r=JSON.parse(n);return t.User._currentUser.id=r._id,delete r._id,t.User._currentUser._sessionToken=r._sessionToken,delete r._sessionToken,t.User._currentUser._finishFetch(r),t.User._currentUser._synchronizeAllAuthData(),t.User._currentUser._refreshCache(),t.User._currentUser._opSetQueue=[{}],t.User._currentUser},_saveCurrentUser:function(e){var n;return n=t.User._currentUser!==e?t.User.logOut():o.default.resolve(),n.then(function(){e._isCurrentUser=!0,t.User._currentUser=e;var n=e._toFullJSON();return n._id=e.id,n._sessionToken=e._sessionToken,t.localStorage.setItemAsync(t._getAVPath(t.User._CURRENT_USER_KEY),(0,u.default)(n)).then(function(){return t.User._currentUserMatchesDisk=!0,t._refreshSubscriptionId()})})},_registerAuthenticationProvider:function(e){t.User._authProviders[e.getAuthType()]=e,!t._config.disableCurrentUser&&t.User.current()&&t.User.current()._synchronizeAuthData(e.getAuthType())},_logInWith:function(e,n,r){return t.Object._create("_User")._linkWith(e,n,r)}})}},function(t,e,n){function r(t,e,n){return e in t?i(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var i=n(148);t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";var r=n(1),i=r(n(35)),o=r(n(13)),a=r(n(57)),s=r(n(36)),u=r(n(92)),c=r(n(22)),f=n(3),l=n(58)("leancloud:query"),h=n(46),d=n(27),p=d._request,v=d.request,g=n(30),m=g.ensureArray,y=g.transformFetchOptions,b=g.continueWhile,_=function(t,e){if(void 0===t)throw new Error(e)};t.exports=function(t){t.Query=function(e){f.isString(e)&&(e=t.Object._getSubclass(e)),this.objectClass=e,this.className=e.prototype.className,this._where={},this._include=[],this._select=[],this._limit=-1,this._skip=0,this._defaultParams={}},t.Query.or=function(){var e=f.toArray(arguments),n=null;t._arrayEach(e,function(t){if(f.isNull(n)&&(n=t.className),n!==t.className)throw new Error("All queries must be for the same class")});var r=new t.Query(n);return r._orQuery(e),r},t.Query.and=function(){var e=f.toArray(arguments),n=null;t._arrayEach(e,function(t){if(f.isNull(n)&&(n=t.className),n!==t.className)throw new Error("All queries must be for the same class")});var r=new t.Query(n);return r._andQuery(e),r},t.Query.doCloudQuery=function(e,n,r){var o={cql:e};return f.isArray(n)?o.pvalues=n:r=n,p("cloudQuery",null,null,"GET",o,r).then(function(e){var n=new t.Query(e.className);return{results:(0,i.default)(f).call(f,e.results,function(t){var r=n._newObject(e);return r._finishFetch&&r._finishFetch(n._processResult(t),!0),r}),count:e.count,className:e.className}})},t.Query.fromJSON=function(e){var n=e.className,r=e.where,i=e.include,o=e.select,a=e.includeACL,s=e.limit,u=e.skip,c=e.order;if("string"!=typeof n)throw new TypeError("Invalid Query JSON, className must be a String.");var l=new t.Query(n);return f.extend(l,{_where:r,_include:i,_select:o,_includeACL:a,_limit:s,_skip:u,_order:c}),l},t.Query._extend=t._extend,f.extend(t.Query.prototype,{_processResult:function(t){return t},get:function(t,e){if(!f.isString(t))throw new Error("objectId must be a string");if(""===t)return o.default.reject(new h(h.OBJECT_NOT_FOUND,"Object not found."));var n=this._newObject();n.id=t;var r=this._getParams(),i={};return(0,a.default)(r)&&(i.keys=(0,a.default)(r)),r.include&&(i.include=r.include),r.includeACL&&(i.includeACL=r.includeACL),p("classes",this.className,t,"GET",y(i),e).then(function(t){if(f.isEmpty(t))throw new h(h.OBJECT_NOT_FOUND,"Object not found.");return n._finishFetch(n.parse(t),!0),n})},toJSON:function(){return{className:this.className,where:this._where,include:this._include,select:this._select,includeACL:this._includeACL,limit:this._limit,skip:this._skip,order:this._order}},_getParams:function(){var t=f.extend({},this._defaultParams,{where:this._where});return this._include.length>0&&(t.include=this._include.join(",")),this._select.length>0&&(t.keys=this._select.join(",")),void 0!==this._includeACL&&(t.returnACL=this._includeACL),this._limit>=0&&(t.limit=this._limit),this._skip>0&&(t.skip=this._skip),void 0!==this._order&&(t.order=this._order),t},_newObject:function(e){return e&&e.className?new t.Object(e.className):new this.objectClass},_createRequest:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._getParams(),e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/classes/".concat(this.className);if(encodeURIComponent((0,s.default)(t)).length>2e3){var r={requests:[{method:"GET",path:"/1.1".concat(n),params:t}]};return v({path:"/batch",method:"POST",data:r,authOptions:e}).then(function(t){var e=t[0];if(e.success)return e.success;throw new h(e.error.code,e.error.error||"Unknown batch error")})}return v({method:"GET",path:n,query:t,authOptions:e})},_parseResponse:function(t){var e=this;return(0,i.default)(f).call(f,t.results,function(n){var r=e._newObject(t);return r._finishFetch&&r._finishFetch(e._processResult(n),!0),r})},find:function(t){return this._createRequest(void 0,t).then(this._parseResponse.bind(this))},findAndCount:function(t){var e=this,n=this._getParams();return n.count=1,this._createRequest(n,t).then(function(t){return[e._parseResponse(t),t.count]})},scan:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.orderedBy,r=e.batchSize,i=arguments.length>1?arguments[1]:void 0,a=this._getParams();l("scan %O",a),a.order&&(console.warn("The order of the query is ignored for Query#scan. Checkout the orderedBy option of Query#scan."),delete a.order),a.skip&&(console.warn("The skip option of the query is ignored for Query#scan."),delete a.skip),a.limit&&(console.warn("The limit option of the query is ignored for Query#scan."),delete a.limit),n&&(a.scan_key=n),r&&(a.limit=r);var s,u=[];return{next:function(){return u.length?o.default.resolve({done:!1,value:u.shift()}):null===s?o.default.resolve({done:!0}):p("scan/classes",t.className,null,"GET",s?f.extend({},a,{cursor:s}):a,i).then(function(e){if(s=e.cursor,e.results.length){t._parseResponse(e).forEach(function(t){return u.push(t)})}return null===s&&0===u.length?{done:!0}:{done:!1,value:u.shift()}})}}},destroyAll:function(e){var n=this;return(0,u.default)(n).call(n,e).then(function(n){return t.Object.destroyAll(n,e)})},count:function(t){var e=this._getParams();return e.limit=0,e.count=1,this._createRequest(e,t).then(function(t){return t.count})},first:function(t){var e=this,n=this._getParams();return n.limit=1,this._createRequest(n,t).then(function(t){return(0,i.default)(f).call(f,t.results,function(t){var n=e._newObject();return n._finishFetch&&n._finishFetch(e._processResult(t),!0),n})[0]})},skip:function(t){return _(t,"undefined is not a valid skip value"),this._skip=t,this},limit:function(t){return _(t,"undefined is not a valid limit value"),this._limit=t,this},equalTo:function(e,n){return _(e,"undefined is not a valid key"),_(n,"undefined is not a valid value"),this._where[e]=t._encode(n),this},_addCondition:function(e,n,r){return _(e,"undefined is not a valid condition key"),_(n,"undefined is not a valid condition"),_(r,"undefined is not a valid condition value"),this._where[e]||(this._where[e]={}),this._where[e][n]=t._encode(r),this},sizeEqualTo:function(t,e){return this._addCondition(t,"$size",e),this},notEqualTo:function(t,e){return this._addCondition(t,"$ne",e),this},lessThan:function(t,e){return this._addCondition(t,"$lt",e),this},greaterThan:function(t,e){return this._addCondition(t,"$gt",e),this},lessThanOrEqualTo:function(t,e){return this._addCondition(t,"$lte",e),this},greaterThanOrEqualTo:function(t,e){return this._addCondition(t,"$gte",e),this},containedIn:function(t,e){return this._addCondition(t,"$in",e),this},notContainedIn:function(t,e){return this._addCondition(t,"$nin",e),this},containsAll:function(t,e){return this._addCondition(t,"$all",e),this},exists:function(t){return this._addCondition(t,"$exists",!0),this},doesNotExist:function(t){return this._addCondition(t,"$exists",!1),this},matches:function(t,e,n){return this._addCondition(t,"$regex",e),n||(n=""),e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),n&&n.length&&this._addCondition(t,"$options",n),this},matchesQuery:function(t,e){var n=e._getParams();return n.className=e.className,this._addCondition(t,"$inQuery",n),this},doesNotMatchQuery:function(t,e){var n=e._getParams();return n.className=e.className,this._addCondition(t,"$notInQuery",n),this},matchesKeyInQuery:function(t,e,n){var r=n._getParams();return r.className=n.className,this._addCondition(t,"$select",{key:e,query:r}),this},doesNotMatchKeyInQuery:function(t,e,n){var r=n._getParams();return r.className=n.className,this._addCondition(t,"$dontSelect",{key:e,query:r}),this},_orQuery:function(t){var e=(0,i.default)(f).call(f,t,function(t){return t._getParams().where});return this._where.$or=e,this},_andQuery:function(t){var e=(0,i.default)(f).call(f,t,function(t){return t._getParams().where});return this._where.$and=e,this},_quote:function(t){return"\\Q"+t.replace("\\E","\\E\\\\E\\Q")+"\\E"},contains:function(t,e){return this._addCondition(t,"$regex",this._quote(e)),this},startsWith:function(t,e){return this._addCondition(t,"$regex","^"+this._quote(e)),this},endsWith:function(t,e){return this._addCondition(t,"$regex",this._quote(e)+"$"),this},ascending:function(t){return _(t,"undefined is not a valid key"),this._order=t,this},addAscending:function(t){return _(t,"undefined is not a valid key"),this._order?this._order+=","+t:this._order=t,this},descending:function(t){return _(t,"undefined is not a valid key"),this._order="-"+t,this},addDescending:function(t){return _(t,"undefined is not a valid key"),this._order?this._order+=",-"+t:this._order="-"+t,this},near:function(e,n){return n instanceof t.GeoPoint||(n=new t.GeoPoint(n)),this._addCondition(e,"$nearSphere",n),this},withinRadians:function(t,e,n){return this.near(t,e),this._addCondition(t,"$maxDistance",n),this},withinMiles:function(t,e,n){return this.withinRadians(t,e,n/3958.8)},withinKilometers:function(t,e,n){return this.withinRadians(t,e,n/6371)},withinGeoBox:function(e,n,r){return n instanceof t.GeoPoint||(n=new t.GeoPoint(n)),r instanceof t.GeoPoint||(r=new t.GeoPoint(r)),this._addCondition(e,"$within",{$box:[n,r]}),this},include:function(t){var e=this;return _(t,"undefined is not a valid key"),f.forEach(arguments,function(t){var n;e._include=(0,c.default)(n=e._include).call(n,m(t))}),this},includeACL:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._includeACL=t,this},select:function(t){var e=this;return _(t,"undefined is not a valid key"),f.forEach(arguments,function(t){var n;e._select=(0,c.default)(n=e._select).call(n,m(t))}),this},each:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._order||this._skip||this._limit>=0){var r=new Error("Cannot iterate on a query with sort, skip, or limit.");return o.default.reject(r)}var i=new t.Query(this.objectClass);i._limit=n.batchSize||100,i._where=f.clone(this._where),i._include=f.clone(this._include),i.ascending("objectId");var a=!1;return b(function(){return!a},function(){return(0,u.default)(i).call(i,n).then(function(t){var n=o.default.resolve();return f.each(t,function(t){n=n.then(function(){return e(t)})}),n.then(function(){t.length>=i._limit?i.greaterThan("objectId",t[t.length-1].id):a=!0})})})},subscribe:function(e){return t.LiveQuery.init(this,e)}}),t.FriendShipQuery=t.Query._extend({_newObject:function(){return new(t.Object._getSubclass("_User"))},_processResult:function(t){if(t&&t[this._friendshipTag]){var e=t[this._friendshipTag];return"Pointer"===e.__type&&"_User"===e.className&&(delete e.__type,delete e.className),e}return null}})}},function(t,e,n){"use strict";var r=n(1),i=r(n(13)),o=r(n(57)),a=n(3),s=n(230),u=n(30),c=u.inherits,f=n(27),l=f.request,h=function(t,e){return l({method:"POST",path:"/LiveQuery/subscribe",data:{query:t,id:e}})};t.exports=function(t){var e=function(){if(!t._config.realtime)throw new Error("LiveQuery not supported. Please use the LiveQuery bundle. https://url.leanapp.cn/enable-live-query")};t.LiveQuery=c(s,{constructor:function(t,e,n,r){var i=this;s.apply(this),this.id=t,this._client=e,this._client.register(this),this._queryJSON=n,this._subscriptionId=r,this._onMessage=this._dispatch.bind(this),this._onReconnect=function(){h(i._queryJSON,i._subscriptionId).catch(function(t){return console.error("LiveQuery resubscribe error: ".concat(t.message))})},e.on("message",this._onMessage),e.on("reconnect",this._onReconnect)},_dispatch:function(e){var n=this;e.forEach(function(e){var r=e.op,i=e.object,o=e.query_id,s=e.updatedKeys;if(o===n.id){var u=t.parseJSON(a.extend({__type:"_File"===i.className?"File":"Object"},i));s?n.emit(r,u,s):n.emit(r,u)}})},unsubscribe:function(){var t=this._client;return t.off("message",this._onMessage),t.off("reconnect",this._onReconnect),t.deregister(this),l({method:"POST",path:"/LiveQuery/unsubscribe",data:{id:t.id,query_id:this.id}})}},{init:function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.subscriptionId,s=void 0===a?t._getSubscriptionId():a;if(e(),!(n instanceof t.Query))throw new TypeError("LiveQuery must be inited with a Query");return i.default.resolve(s).then(function(e){return t._config.realtime.createLiveQueryClient(e).then(function(r){var i=n._getParams(),a=i.where,s=(0,o.default)(i),u=i.returnACL,c={where:a,keys:s,returnACL:u,className:n.className},f=h(c,e).then(function(n){var i=n.query_id;return new t.LiveQuery(i,r,c,e)}).finally(function(){r.deregister(f)});return r.register(f),f})})},pause:function(){return e(),t._config.realtime.pause()},resume:function(){return e(),t._config.realtime.resume()}})}},function(t,e,n){"use strict";var r=n(3),i=n(30),o=i.tap;t.exports=function(t){t.Captcha=function(t,e){this._options=t,this._authOptions=e,this.url=void 0,this.captchaToken=void 0,this.validateToken=void 0},t.Captcha.prototype.refresh=function(){var e=this;return t.Cloud._requestCaptcha(this._options,this._authOptions).then(function(t){var n=t.captchaToken,i=t.url;return r.extend(e,{captchaToken:n,url:i}),i})},t.Captcha.prototype.verify=function(e){var n=this;return t.Cloud.verifyCaptcha(e,this.captchaToken).then(o(function(t){return n.validateToken=t}))},t.Captcha.request=function(e,n){var r=new t.Captcha(e,n);return r.refresh().then(function(){return r})}}},function(t,e,n){"use strict";var r=n(1),i=r(n(13)),o=n(3),a=n(27),s=a._request,u=a.request;t.exports=function(t){t.Cloud=t.Cloud||{},o.extend(t.Cloud,{run:function(e,n,r){return u({service:"engine",method:"POST",path:"/functions/".concat(e),data:t._encode(n,null,!0),authOptions:r}).then(function(e){return t._decode(e).result})},rpc:function(e,n,r){return o.isArray(n)?i.default.reject(new Error("Can't pass Array as the param of rpc function in JavaScript SDK.")):u({service:"engine",method:"POST",path:"/call/".concat(e),data:t._encodeObjectOrArray(n),authOptions:r}).then(function(e){return t._decode(e).result})},getServerDate:function(){return s("date",null,null,"GET").then(function(e){return t._decode(e)})},requestSmsCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(o.isString(t)&&(t={mobilePhoneNumber:t}),!t.mobilePhoneNumber)throw new Error("Missing mobilePhoneNumber.");return e.validateToken&&(t=o.extend({},t,{validate_token:e.validateToken})),s("requestSmsCode",null,null,"POST",t,e)},verifySmsCode:function(t,e){if(!t)throw new Error("Missing sms code.");var n={};return o.isString(e)&&(n.mobilePhoneNumber=e),s("verifySmsCode",t,null,"POST",n)},_requestCaptcha:function(t,e){return s("requestCaptcha",null,null,"GET",t,e).then(function(t){var e=t.captcha_url;return{captchaToken:t.captcha_token,url:e}})},requestCaptcha:t.Captcha.request,verifyCaptcha:function(t,e){return s("verifyCaptcha",null,null,"POST",{captcha_code:t,captcha_token:e}).then(function(t){return t.validate_token})}})}},function(t,e,n){"use strict";var r=n(27).request;t.exports=function(t){t.Installation=t.Object.extend("_Installation"),t.Push=t.Push||{},t.Push.send=function(t,e){if(t.where&&(t.where=t.where._getParams().where),t.where&&t.cql)throw new Error("Both where and cql can't be set");if(t.push_time&&(t.push_time=t.push_time.toJSON()),t.expiration_time&&(t.expiration_time=t.expiration_time.toJSON()),t.expiration_time&&t.expiration_interval)throw new Error("Both expiration_time and expiration_interval can't be set");return r({service:"push",method:"POST",path:"/push",data:t,authOptions:e})}}},function(t,e,n){"use strict";var r=n(1),i=r(n(13)),o=r(n(91)),a=n(3),s=n(27)._request,u=n(30),c=u.getSessionToken;t.exports=function(t){var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return c(e)?t.User._fetchUserBySessionToken(c(e)):t.User.currentAsync()},n=function(n){return e(n).then(function(e){return t.Object.createWithoutData("_User",e.id)._toPointer()})};t.Status=function(t,e){return this.data={},this.inboxType="default",this.query=null,t&&"object"===(0,o.default)(t)?this.data=t:(t&&(this.data.image=t),e&&(this.data.message=e)),this},a.extend(t.Status.prototype,{get:function(t){return this.data[t]},set:function(t,e){return this.data[t]=e,this},destroy:function(t){return this.id?s("statuses",null,this.id,"DELETE",t):i.default.reject(new Error("The status id is not exists."))},toObject:function(){return this.id?t.Object.createWithoutData("_Status",this.id):null},_getDataJSON:function(){var e=a.clone(this.data);return t._encode(e)},send:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!c(r)&&!t.User.current())throw new Error("Please signin an user.");return this.query?n(r).then(function(t){var n=e.query._getParams();n.className=e.query.className;var i={};return i.query=n,e.data=e.data||{},e.data.source=e.data.source||t,i.data=e._getDataJSON(),i.inboxType=e.inboxType||"default",s("statuses",null,null,"POST",i,r)}).then(function(n){return e.id=n.objectId,e.createdAt=t._parseDate(n.createdAt),e}):t.Status.sendStatusToFollowers(this,r)},_finishFetch:function(e){this.id=e.objectId,this.createdAt=t._parseDate(e.createdAt),this.updatedAt=t._parseDate(e.updatedAt),this.messageId=e.messageId,delete e.messageId,delete e.objectId,delete e.createdAt,delete e.updatedAt,this.data=t._decode(e)}}),t.Status.sendStatusToFollowers=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!c(r)&&!t.User.current())throw new Error("Please signin an user.");return n(r).then(function(n){var i={};i.className="_Follower",i.keys="follower",i.where={user:n};var o={};return o.query=i,e.data=e.data||{},e.data.source=e.data.source||n,o.data=e._getDataJSON(),o.inboxType=e.inboxType||"default",s("statuses",null,null,"POST",o,r).then(function(n){return e.id=n.objectId,e.createdAt=t._parseDate(n.createdAt),e})})},t.Status.sendPrivateStatus=function(e,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!c(i)&&!t.User.current())throw new Error("Please signin an user.");if(!r)throw new Error("Invalid target user.");var o=a.isString(r)?r:r.id;if(!o)throw new Error("Invalid target user.");return n(i).then(function(n){var r={};r.className="_User",r.where={objectId:o};var a={};return a.query=r,e.data=e.data||{},e.data.source=e.data.source||n,a.data=e._getDataJSON(),a.inboxType="private",e.inboxType="private",s("statuses",null,null,"POST",a,i).then(function(n){return e.id=n.objectId,e.createdAt=t._parseDate(n.createdAt),e})})},t.Status.countUnreadStatuses=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(a.isString(r)||(o=r),!c(o)&&null==n&&!t.User.current())throw new Error("Please signin an user or pass the owner objectId.");return i.default.resolve(n||e(o)).then(function(e){var n={};return n.inboxType=t._encode(r),n.owner=t._encode(e),s("subscribe/statuses/count",null,null,"GET",n,o)})},t.Status.resetUnreadCount=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(a.isString(r)||(o=r),!c(o)&&null==n&&!t.User.current())throw new Error("Please signin an user or pass the owner objectId.");return i.default.resolve(n||e(o)).then(function(e){var n={};return n.inboxType=t._encode(r),n.owner=t._encode(e),s("subscribe/statuses/resetUnreadCount",null,null,"POST",n,o)})},t.Status.statusQuery=function(e){var n=new t.Query("_Status");return e&&n.equalTo("source",e),n},t.InboxQuery=t.Query._extend({_objectClass:t.Status,_sinceId:0,_maxId:0,_inboxType:"default",_owner:null,_newObject:function(){return new t.Status},_createRequest:function(e,n){return t.InboxQuery.__super__._createRequest.call(this,e,n,"/subscribe/statuses")},sinceId:function(t){return this._sinceId=t,this},maxId:function(t){return this._maxId=t,this},owner:function(t){return this._owner=t,this},inboxType:function(t){return this._inboxType=t,this},_getParams:function(){var e=t.InboxQuery.__super__._getParams.call(this);return e.owner=t._encode(this._owner),e.inboxType=t._encode(this._inboxType),e.sinceId=t._encode(this._sinceId),e.maxId=t._encode(this._maxId),e}}),t.Status.inboxQuery=function(e,n){var r=new t.InboxQuery(t.Status);return e&&(r._owner=e),n&&(r._inboxType=n),r}}},function(t,e,n){"use strict";var r=n(1),i=r(n(36)),o=r(n(35)),a=n(3),s=n(27)._request;t.exports=function(t){t.SearchSortBuilder=function(){this._sortFields=[]},a.extend(t.SearchSortBuilder.prototype,{_addField:function(t,e,n,r){var i={};return i[t]={order:e||"asc",mode:n||"avg",missing:"_"+(r||"last")},this._sortFields.push(i),this},ascending:function(t,e,n){return this._addField(t,"asc",e,n)},descending:function(t,e,n){return this._addField(t,"desc",e,n)},whereNear:function(t,e,n){n=n||{};var r={},i={lat:e.latitude,lon:e.longitude},o={order:n.order||"asc",mode:n.mode||"avg",unit:n.unit||"km"};return o[t]=i,r._geo_distance=o,this._sortFields.push(r),this},build:function(){return(0,i.default)(t._encode(this._sortFields))}}),t.SearchQuery=t.Query._extend({_sid:null,_hits:0,_queryString:null,_highlights:null,_sortBuilder:null,_clazz:null,constructor:function(e){e?this._clazz=e:e="__INVALID_CLASS",t.Query.call(this,e)},_createRequest:function(t,e){return s("search/select",null,null,"GET",t||this._getParams(),e)},sid:function(t){return this._sid=t,this},queryString:function(t){return this._queryString=t,this},highlights:function(t){var e;return e=t&&a.isString(t)?a.toArray(arguments):t,this._highlights=e,this},sortBy:function(t){return this._sortBuilder=t,this},hits:function(){return this._hits||(this._hits=0),this._hits},_processResult:function(t){return delete t.className,delete t._app_url,delete t._deeplink,t},hasMore:function(){return!this._hitEnd},reset:function(){this._hitEnd=!1,this._sid=null,this._hits=0},find:function(t){var e=this;return this._createRequest(void 0,t).then(function(t){return t.sid?(e._oldSid=e._sid,e._sid=t.sid):(e._sid=null,e._hitEnd=!0),e._hits=t.hits||0,(0,o.default)(a).call(a,t.results,function(n){n.className&&(t.className=n.className);var r=e._newObject(t);return r.appURL=n._app_url,r._finishFetch(e._processResult(n),!0),r})})},_getParams:function(){var e=t.SearchQuery.__super__._getParams.call(this);if(delete e.where,this._clazz&&(e.clazz=this.className),this._sid&&(e.sid=this._sid),!this._queryString)throw new Error("Please set query string.");if(e.q=this._queryString,this._highlights&&(e.highlights=this._highlights.join(",")),this._sortBuilder&&e.order)throw new Error("sort and order can not be set at same time.");return this._sortBuilder&&(e.sort=this._sortBuilder.build()),e}})}},function(t,e,n){"use strict";var r=n(1),i=r(n(13)),o=n(3),a=n(46),s=n(27),u=s.request;t.exports=function(t){t.Insight=t.Insight||{},o.extend(t.Insight,{startJob:function(e,n){if(!e||!e.sql)throw new Error("Please provide the sql to run the job.");var r={jobConfig:e,appId:t.applicationId};return u({path:"/bigquery/jobs",method:"POST",data:t._encode(r,null,!0),authOptions:n,signKey:!1}).then(function(e){return t._decode(e).id})},on:function(t,e){}}),t.Insight.JobQuery=function(t,e){if(!t)throw new Error("Please provide the job id.");this.id=t,this.className=e,this._skip=0,this._limit=100},o.extend(t.Insight.JobQuery.prototype,{skip:function(t){return this._skip=t,this},limit:function(t){return this._limit=t,this},find:function(t){var e={skip:this._skip,limit:this._limit};return u({path:"/bigquery/jobs/".concat(this.id),method:"GET",query:e,authOptions:t,signKey:!1}).then(function(t){return t.error?i.default.reject(new a(t.code,t.error)):i.default.resolve(t)})}})}},function(t,e,n){"use strict";var r=n(1),i=r(n(13)),o=n(3),a=n(27),s=a.request,u=n(30),c=u.getSessionToken;t.exports=function(t){var e=function(e){if(e.user){if(!e.user._sessionToken)throw new Error("authOptions.user is not signed in.");return i.default.resolve(e.user)}return e.sessionToken?t.User._fetchUserBySessionToken(e.sessionToken):t.User.currentAsync()},n=function(e){var n=c(e);return n?i.default.resolve(n):t.User.currentAsync().then(function(t){if(t)return t.getSessionToken()})};t.Friendship={request:function(n){var r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.friend?(r=n.friend,i=n.attributes):r=n;var u=o.isString(r)?t.Object.createWithoutData("_User",r):r;return e(a).then(function(t){if(!t)throw new Error("Please signin an user.");return s({method:"POST",path:"/users/friendshipRequests",data:{user:t._toPointer(),friend:u._toPointer(),friendship:i},authOptions:a})})},acceptRequest:function(e){var r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.request?(r=e.request,i=e.attributes):r=e;var u=o.isString(r)?r:r.id;return n(a).then(function(e){if(!e)throw new Error("Please signin an user.");return s({method:"PUT",path:"/users/friendshipRequests/"+u+"/accept",data:{friendship:t._encode(i)},authOptions:a})})},declineRequest:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=o.isString(t)?t:t.id;return n(e).then(function(t){if(!t)throw new Error("Please signin an user.");return s({method:"PUT",path:"/users/friendshipRequests/"+r+"/decline",authOptions:e})})}}}},function(t,e,n){"use strict";var r=n(1),i=r(n(36)),o=n(3),a=n(27),s=a._request,u=n(69),c=function(t){return"string"==typeof t?t:"function"==typeof t.getPayload?(0,i.default)(t.getPayload()):(0,i.default)(t)};t.exports=u.Object.extend("_Conversation",{constructor:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};u.Object.prototype.constructor.call(this,null,null),this.set("name",t),void 0!==e.isSystem&&this.set("sys",!!e.isSystem),void 0!==e.isTransient&&this.set("tr",!!e.isTransient)},getCreator:function(){return this.get("c")},getLastMessageAt:function(){return this.get("lm")},getMembers:function(){return this.get("m")},addMember:function(t){return this.add("m",t)},getMutedMembers:function(){return this.get("mu")},getName:function(){return this.get("name")},isTransient:function(){return this.get("tr")},isSystem:function(){return this.get("sys")},send:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i={from_peer:t,conv_id:this.id,transient:!1,message:c(e)};return void 0!==n.toClients&&(i.to_peers=n.toClients),void 0!==n.transient&&(i.transient=!!n.transient),void 0!==n.pushData&&(i.push_data=n.pushData),s("rtm","messages",null,"POST",i,r)},broadcast:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i={from_peer:t,conv_id:this.id,message:c(e)};if(void 0!==n.pushData&&(i.push=n.pushData),void 0!==n.validTill){var a=n.validTill;o.isDate(a)&&(a=a.getTime()),n.valid_till=a}return s("rtm","broadcast",null,"POST",i,r)}})},function(t,e,n){"use strict";function r(t){var e=t.name,n=t.value,r=t.version;this.name=e,this.value=n,this.version=r}var i=n(1),o=i(n(13)),a=i(n(35)),s=i(n(22)),u=n(3),c=n(27),f=c.request,l=n(30),h=l.ensureArray,d=l.parseDate,p=n(69);p.LeaderboardVersionChangeInterval={NEVER:"never",DAY:"day",WEEK:"week",MONTH:"month"},p.LeaderboardOrder={ASCENDING:"ascending",DESCENDING:"descending"},p.LeaderboardUpdateStrategy={BETTER:"better",LAST:"last",SUM:"sum"};var v=function(t){var e=p._decode(t);return new r({name:e.statisticName,value:e.statisticValue,version:e.version})};p.Leaderboard=function(t){this.statisticName=t,this.order=void 0,this.updateStrategy=void 0,this.versionChangeInterval=void 0,this.version=void 0,this.nextResetAt=void 0,this.createdAt=void 0};var g=p.Leaderboard;p.Leaderboard.createWithoutData=function(t){return new g(t)},p.Leaderboard.createLeaderboard=function(t,e){var n=t.statisticName,r=t.order,i=t.versionChangeInterval,o=t.updateStrategy;return f({method:"POST",path:"/leaderboard/leaderboards",data:{statisticName:n,order:r,versionChangeInterval:i,updateStrategy:o},authOptions:e}).then(function(t){return new g(n)._finishFetch(t)})},p.Leaderboard.getLeaderboard=function(t,e){return g.createWithoutData(t).fetch(e)},p.Leaderboard.getStatistics=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.statisticNames,r=arguments.length>2?arguments[2]:void 0;return o.default.resolve().then(function(){if(!t||!t.id)throw new Error("user must be an AV.User");return f({method:"GET",path:"/leaderboard/users/".concat(t.id,"/statistics"),query:{statistics:n?h(n).join(","):void 0},authOptions:r}).then(function(t){var e=t.results;return(0,a.default)(e).call(e,v)})})},p.Leaderboard.updateStatistics=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o.default.resolve().then(function(){if(!t||!t.id)throw new Error("user must be an AV.User");var r=(0,a.default)(u).call(u,e,function(t,e){return{statisticName:e,statisticValue:t}}),i=n.overwrite;return f({method:"POST",path:"/leaderboard/users/".concat(t.id,"/statistics"),query:{overwrite:i?1:void 0},data:r,authOptions:n}).then(function(t){var e=t.results;return(0,a.default)(e).call(e,v)})})},p.Leaderboard.deleteStatistics=function(t,e,n){return o.default.resolve().then(function(){if(!t||!t.id)throw new Error("user must be an AV.User");return f({method:"DELETE",path:"/leaderboard/users/".concat(t.id,"/statistics"),query:{statistics:h(e).join(",")},authOptions:n}).then(function(){})})},u.extend(g.prototype,{_finishFetch:function(t){var e=this;return u.forEach(t,function(t,n){"updatedAt"!==n&&"objectId"!==n&&("expiredAt"===n&&(n="nextResetAt"),"createdAt"===n&&(t=d(t)),t&&"Date"===t.__type&&(t=d(t.iso)),e[n]=t)}),this},fetch:function(t){var e=this;return f({method:"GET",path:"/leaderboard/leaderboards/".concat(this.statisticName),authOptions:t}).then(function(t){return e._finishFetch(t)})},count:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.version,n=arguments.length>1?arguments[1]:void 0;return f({method:"GET",path:"/leaderboard/leaderboards/".concat(this.statisticName,"/ranks"),query:{count:1,limit:0,version:e},authOptions:n}).then(function(t){return t.count})},_getResults:function(t,e,n){var r,i=t.skip,o=t.limit,c=t.selectUserKeys,l=t.includeUserKeys,d=t.includeStatistics,g=t.version;return f({method:"GET",path:(0,s.default)(r="/leaderboard/leaderboards/".concat(this.statisticName,"/ranks")).call(r,n?"/".concat(n):""),query:{skip:i,limit:o,selectUserKeys:u.union(h(c),h(l)).join(",")||void 0,includeUser:l?h(l).join(","):void 0,includeStatistics:d?h(d).join(","):void 0,version:g},authOptions:e}).then(function(t){var e=t.results;return(0,a.default)(e).call(e,function(t){var e=p._decode(t),n=e.user,r=e.statisticValue,i=e.rank,o=e.statistics,s=void 0===o?[]:o;return{user:n,value:r,rank:i,includedStatistics:(0,a.default)(s).call(s,v)}})})},getResults:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.skip,n=t.limit,r=t.selectUserKeys,i=t.includeUserKeys,o=t.includeStatistics,a=t.version,s=arguments.length>1?arguments[1]:void 0;return this._getResults({skip:e,limit:n,selectUserKeys:r,includeUserKeys:i,includeStatistics:o,version:a},s)},getResultsAroundUser:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if(t&&"string"!=typeof t.id)return this.getResultsAroundUser(void 0,t,e);var r=e.limit,i=e.selectUserKeys,o=e.includeUserKeys,a=e.includeStatistics,s=e.version;return this._getResults({limit:r,selectUserKeys:i,includeUserKeys:o,includeStatistics:a,version:s},n,t?t.id:"self")},_update:function(t,e){var n=this;return f({method:"PUT",path:"/leaderboard/leaderboards/".concat(this.statisticName),data:t,authOptions:e}).then(function(t){return n._finishFetch(t)})},updateVersionChangeInterval:function(t,e){return this._update({versionChangeInterval:t},e)},updateUpdateStrategy:function(t,e){return this._update({updateStrategy:t},e)},reset:function(t){var e=this;return f({method:"PUT",path:"/leaderboard/leaderboards/".concat(this.statisticName,"/incrementVersion"),authOptions:t}).then(function(t){return e._finishFetch(t)})},destroy:function(t){return p.request({method:"DELETE",path:"/leaderboard/leaderboards/".concat(this.statisticName),authOptions:t}).then(function(){})},getArchives:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.skip,r=e.limit,i=arguments.length>1?arguments[1]:void 0;return f({method:"GET",path:"/leaderboard/leaderboards/".concat(this.statisticName,"/archives"),query:{skip:n,limit:r},authOptions:i}).then(function(e){var n=e.results;return(0,a.default)(n).call(n,function(e){var n=e.version,r=e.status,i=e.url,o=e.activatedAt,a=e.deactivatedAt;return{statisticName:t.statisticName,version:n,status:r,url:i,activatedAt:d(o.iso),deactivatedAt:d(a.iso)}})})}})},function(t,e,n){"use strict";var r=n(149),i=r.Realtime,o=r.setAdapters,a=n(655),s=a.LiveQueryPlugin;i.__preRegisteredPlugins=[s],t.exports=function(t){t._sharedConfig.liveQueryRealtime=i;var e=t.setAdapters;return t.setAdapters=function(t){e(t),o(t)},t}},function(t,e,n){"use strict";(function(t){function r(t){return t&&"object"===(0,d.default)(t)&&"default"in t?t.default:t}function i(t,e){var n=(0,b.default)(t);if(_.default){var r=(0,_.default)(t);e&&(r=(0,w.default)(r).call(r,function(e){return(0,E.default)(t,e).enumerable})),n.push.apply(n,r)}return n}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach(function(e){F(t,e,n[e])}):O.default?(0,T.default)(t,(0,O.default)(n)):i(Object(n)).forEach(function(e){(0,p.default)(t,e,(0,E.default)(n,e))})}return t}function a(t,e){var n=(0,b.default)(t);if(_.default){var r=(0,_.default)(t);e&&(r=(0,w.default)(r).call(r,function(e){return(0,E.default)(t,e).enumerable})),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach(function(e){F(t,e,n[e])}):O.default?(0,T.default)(t,(0,O.default)(n)):a(Object(n)).forEach(function(e){(0,p.default)(t,e,(0,E.default)(n,e))})}return t}function u(t,e){var n=(0,b.default)(t);if(_.default){var r=(0,_.default)(t);e&&(r=(0,w.default)(r).call(r,function(e){return(0,E.default)(t,e).enumerable})),n.push.apply(n,r)}return n}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(Object(n),!0).forEach(function(e){F(t,e,n[e])}):O.default?(0,T.default)(t,(0,O.default)(n)):u(Object(n)).forEach(function(e){(0,p.default)(t,e,(0,E.default)(n,e))})}return t}var f,l,h=n(1),d=h(n(91)),p=h(n(114)),v=h(n(567)),g=h(n(256)),m=h(n(247)),y=h(n(22)),b=h(n(146)),_=h(n(257)),w=h(n(243)),E=h(n(253)),O=h(n(578)),T=h(n(582)),S=h(n(13)),A=h(n(59)),x=h(n(90)),I=h(n(586)),j=h(n(36)),C=h(n(35)),N=h(n(592)),P=h(n(92)),R=h(n(259));(0,p.default)(e,"__esModule",{value:!0});var U=r(n(603)),k=r(n(607)),L=r(n(608)),M=r(n(610)),D=r(n(611)),F=r(n(614)),B=r(n(615)),V=r(n(617)),q=r(n(618)),W=r(n(58)),Y=r(n(619)),z=r(n(264)),G=r(n(646)),K=r(n(649)),Q=r(n(650)),J=r(n(651)),$=r(n(652)),H=r(n(653)),Z=n(244),X=U.newBuilder({}).import({package:"push_server.messages2",syntax:"proto2",options:{objc_class_prefix:"AVIM"},messages:[{name:"JsonObjectMessage",syntax:"proto2",fields:[{rule:"required",type:"string",name:"data",id:1}]},{name:"UnreadTuple",syntax:"proto2",fields:[{rule:"required",type:"string",name:"cid",id:1},{rule:"required",type:"int32",name:"unread",id:2},{rule:"optional",type:"string",name:"mid",id:3},{rule:"optional",type:"int64",name:"timestamp",id:4},{rule:"optional",type:"string",name:"from",id:5},{rule:"optional",type:"string",name:"data",id:6},{rule:"optional",type:"int64",name:"patchTimestamp",id:7},{rule:"optional",type:"bool",name:"mentioned",id:8},{rule:"optional",type:"bytes",name:"binaryMsg",id:9},{rule:"optional",type:"int32",name:"convType",id:10}]},{name:"LogItem",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"from",id:1},{rule:"optional",type:"string",name:"data",id:2},{rule:"optional",type:"int64",name:"timestamp",id:3},{rule:"optional",type:"string",name:"msgId",id:4},{rule:"optional",type:"int64",name:"ackAt",id:5},{rule:"optional",type:"int64",name:"readAt",id:6},{rule:"optional",type:"int64",name:"patchTimestamp",id:7},{rule:"optional",type:"bool",name:"mentionAll",id:8},{rule:"repeated",type:"string",name:"mentionPids",id:9},{rule:"optional",type:"bool",name:"bin",id:10},{rule:"optional",type:"int32",name:"convType",id:11}]},{name:"ConvMemberInfo",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"pid",id:1},{rule:"optional",type:"string",name:"role",id:2},{rule:"optional",type:"string",name:"infoId",id:3}]},{name:"DataCommand",syntax:"proto2",fields:[{rule:"repeated",type:"string",name:"ids",id:1},{rule:"repeated",type:"JsonObjectMessage",name:"msg",id:2},{rule:"optional",type:"bool",name:"offline",id:3}]},{name:"SessionCommand",syntax:"proto2",fields:[{rule:"optional",type:"int64",name:"t",id:1},{rule:"optional",type:"string",name:"n",id:2},{rule:"optional",type:"string",name:"s",id:3},{rule:"optional",type:"string",name:"ua",id:4},{rule:"optional",type:"bool",name:"r",id:5},{rule:"optional",type:"string",name:"tag",id:6},{rule:"optional",type:"string",name:"deviceId",id:7},{rule:"repeated",type:"string",name:"sessionPeerIds",id:8},{rule:"repeated",type:"string",name:"onlineSessionPeerIds",id:9},{rule:"optional",type:"string",name:"st",id:10},{rule:"optional",type:"int32",name:"stTtl",id:11},{rule:"optional",type:"int32",name:"code",id:12},{rule:"optional",type:"string",name:"reason",id:13},{rule:"optional",type:"string",name:"deviceToken",id:14},{rule:"optional",type:"bool",name:"sp",id:15},{rule:"optional",type:"string",name:"detail",id:16},{rule:"optional",type:"int64",name:"lastUnreadNotifTime",id:17},{rule:"optional",type:"int64",name:"lastPatchTime",id:18},{rule:"optional",type:"int64",name:"configBitmap",id:19}]},{name:"ErrorCommand",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"code",id:1},{rule:"required",type:"string",name:"reason",id:2},{rule:"optional",type:"int32",name:"appCode",id:3},{rule:"optional",type:"string",name:"detail",id:4},{rule:"repeated",type:"string",name:"pids",id:5},{rule:"optional",type:"string",name:"appMsg",id:6}]},{name:"DirectCommand",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"msg",id:1},{rule:"optional",type:"string",name:"uid",id:2},{rule:"optional",type:"string",name:"fromPeerId",id:3},{rule:"optional",type:"int64",name:"timestamp",id:4},{rule:"optional",type:"bool",name:"offline",id:5},{rule:"optional",type:"bool",name:"hasMore",id:6},{rule:"repeated",type:"string",name:"toPeerIds",id:7},{rule:"optional",type:"bool",name:"r",id:10},{rule:"optional",type:"string",name:"cid",id:11},{rule:"optional",type:"string",name:"id",id:12},{rule:"optional",type:"bool",name:"transient",id:13},{rule:"optional",type:"string",name:"dt",id:14},{rule:"optional",type:"string",name:"roomId",id:15},{rule:"optional",type:"string",name:"pushData",id:16},{rule:"optional",type:"bool",name:"will",id:17},{rule:"optional",type:"int64",name:"patchTimestamp",id:18},{rule:"optional",type:"bytes",name:"binaryMsg",id:19},{rule:"repeated",type:"string",name:"mentionPids",id:20},{rule:"optional",type:"bool",name:"mentionAll",id:21},{rule:"optional",type:"int32",name:"convType",id:22}]},{name:"AckCommand",syntax:"proto2",fields:[{rule:"optional",type:"int32",name:"code",id:1},{rule:"optional",type:"string",name:"reason",id:2},{rule:"optional",type:"string",name:"mid",id:3},{rule:"optional",type:"string",name:"cid",id:4},{rule:"optional",type:"int64",name:"t",id:5},{rule:"optional",type:"string",name:"uid",id:6},{rule:"optional",type:"int64",name:"fromts",id:7},{rule:"optional",type:"int64",name:"tots",id:8},{rule:"optional",type:"string",name:"type",id:9},{rule:"repeated",type:"string",name:"ids",id:10},{rule:"optional",type:"int32",name:"appCode",id:11},{rule:"optional",type:"string",name:"appMsg",id:12}]},{name:"UnreadCommand",syntax:"proto2",fields:[{rule:"repeated",type:"UnreadTuple",name:"convs",id:1},{rule:"optional",type:"int64",name:"notifTime",id:2}]},{name:"ConvCommand",syntax:"proto2",fields:[{rule:"repeated",type:"string",name:"m",id:1},{rule:"optional",type:"bool",name:"transient",id:2},{rule:"optional",type:"bool",name:"unique",id:3},{rule:"optional",type:"string",name:"cid",id:4},{rule:"optional",type:"string",name:"cdate",id:5},{rule:"optional",type:"string",name:"initBy",id:6},{rule:"optional",type:"string",name:"sort",id:7},{rule:"optional",type:"int32",name:"limit",id:8},{rule:"optional",type:"int32",name:"skip",id:9},{rule:"optional",type:"int32",name:"flag",id:10},{rule:"optional",type:"int32",name:"count",id:11},{rule:"optional",type:"string",name:"udate",id:12},{rule:"optional",type:"int64",name:"t",id:13},{rule:"optional",type:"string",name:"n",id:14},{rule:"optional",type:"string",name:"s",id:15},{rule:"optional",type:"bool",name:"statusSub",id:16},{rule:"optional",type:"bool",name:"statusPub",id:17},{rule:"optional",type:"int32",name:"statusTTL",id:18},{rule:"optional",type:"string",name:"uniqueId",id:19},{rule:"optional",type:"string",name:"targetClientId",id:20},{rule:"optional",type:"int64",name:"maxReadTimestamp",id:21},{rule:"optional",type:"int64",name:"maxAckTimestamp",id:22},{rule:"optional",type:"bool",name:"queryAllMembers",id:23},{rule:"repeated",type:"MaxReadTuple",name:"maxReadTuples",id:24},{rule:"repeated",type:"string",name:"cids",id:25},{rule:"optional",type:"ConvMemberInfo",name:"info",id:26},{rule:"optional",type:"bool",name:"tempConv",id:27},{rule:"optional",type:"int32",name:"tempConvTTL",id:28},{rule:"repeated",type:"string",name:"tempConvIds",id:29},{rule:"repeated",type:"string",name:"allowedPids",id:30},{rule:"repeated",type:"ErrorCommand",name:"failedPids",id:31},{rule:"optional",type:"string",name:"next",id:40},{rule:"optional",type:"JsonObjectMessage",name:"results",id:100},{rule:"optional",type:"JsonObjectMessage",name:"where",id:101},{rule:"optional",type:"JsonObjectMessage",name:"attr",id:103},{rule:"optional",type:"JsonObjectMessage",name:"attrModified",id:104}]},{name:"RoomCommand",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"roomId",id:1},{rule:"optional",type:"string",name:"s",id:2},{rule:"optional",type:"int64",name:"t",id:3},{rule:"optional",type:"string",name:"n",id:4},{rule:"optional",type:"bool",name:"transient",id:5},{rule:"repeated",type:"string",name:"roomPeerIds",id:6},{rule:"optional",type:"string",name:"byPeerId",id:7}]},{name:"LogsCommand",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"cid",id:1},{rule:"optional",type:"int32",name:"l",id:2},{rule:"optional",type:"int32",name:"limit",id:3},{rule:"optional",type:"int64",name:"t",id:4},{rule:"optional",type:"int64",name:"tt",id:5},{rule:"optional",type:"string",name:"tmid",id:6},{rule:"optional",type:"string",name:"mid",id:7},{rule:"optional",type:"string",name:"checksum",id:8},{rule:"optional",type:"bool",name:"stored",id:9},{rule:"optional",type:"QueryDirection",name:"direction",id:10,options:{default:"OLD"}},{rule:"optional",type:"bool",name:"tIncluded",id:11},{rule:"optional",type:"bool",name:"ttIncluded",id:12},{rule:"optional",type:"int32",name:"lctype",id:13},{rule:"repeated",type:"LogItem",name:"logs",id:105}],enums:[{name:"QueryDirection",syntax:"proto2",values:[{name:"OLD",id:1},{name:"NEW",id:2}]}]},{name:"RcpCommand",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"id",id:1},{rule:"optional",type:"string",name:"cid",id:2},{rule:"optional",type:"int64",name:"t",id:3},{rule:"optional",type:"bool",name:"read",id:4},{rule:"optional",type:"string",name:"from",id:5}]},{name:"ReadTuple",syntax:"proto2",fields:[{rule:"required",type:"string",name:"cid",id:1},{rule:"optional",type:"int64",name:"timestamp",id:2},{rule:"optional",type:"string",name:"mid",id:3}]},{name:"MaxReadTuple",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"pid",id:1},{rule:"optional",type:"int64",name:"maxAckTimestamp",id:2},{rule:"optional",type:"int64",name:"maxReadTimestamp",id:3}]},{name:"ReadCommand",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"cid",id:1},{rule:"repeated",type:"string",name:"cids",id:2},{rule:"repeated",type:"ReadTuple",name:"convs",id:3}]},{name:"PresenceCommand",syntax:"proto2",fields:[{rule:"optional",type:"StatusType",name:"status",id:1},{rule:"repeated",type:"string",name:"sessionPeerIds",id:2},{rule:"optional",type:"string",name:"cid",id:3}]},{name:"ReportCommand",syntax:"proto2",fields:[{rule:"optional",type:"bool",name:"initiative",id:1},{rule:"optional",type:"string",name:"type",id:2},{rule:"optional",type:"string",name:"data",id:3}]},{name:"PatchItem",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"cid",id:1},{rule:"optional",type:"string",name:"mid",id:2},{rule:"optional",type:"int64",name:"timestamp",id:3},{rule:"optional",type:"bool",name:"recall",id:4},{rule:"optional",type:"string",name:"data",id:5},{rule:"optional",type:"int64",name:"patchTimestamp",id:6},{rule:"optional",type:"string",name:"from",id:7},{rule:"optional",type:"bytes",name:"binaryMsg",id:8},{rule:"optional",type:"bool",name:"mentionAll",id:9},{rule:"repeated",type:"string",name:"mentionPids",id:10},{rule:"optional",type:"int64",name:"patchCode",id:11},{rule:"optional",type:"string",name:"patchReason",id:12}]},{name:"PatchCommand",syntax:"proto2",fields:[{rule:"repeated",type:"PatchItem",name:"patches",id:1},{rule:"optional",type:"int64",name:"lastPatchTime",id:2}]},{name:"PubsubCommand",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"cid",id:1},{rule:"repeated",type:"string",name:"cids",id:2},{rule:"optional",type:"string",name:"topic",id:3},{rule:"optional",type:"string",name:"subtopic",id:4},{rule:"repeated",type:"string",name:"topics",id:5},{rule:"repeated",type:"string",name:"subtopics",id:6},{rule:"optional",type:"JsonObjectMessage",name:"results",id:7}]},{name:"BlacklistCommand",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"srcCid",id:1},{rule:"repeated",type:"string",name:"toPids",id:2},{rule:"optional",type:"string",name:"srcPid",id:3},{rule:"repeated",type:"string",name:"toCids",id:4},{rule:"optional",type:"int32",name:"limit",id:5},{rule:"optional",type:"string",name:"next",id:6},{rule:"repeated",type:"string",name:"blockedPids",id:8},{rule:"repeated",type:"string",name:"blockedCids",id:9},{rule:"repeated",type:"string",name:"allowedPids",id:10},{rule:"repeated",type:"ErrorCommand",name:"failedPids",id:11},{rule:"optional",type:"int64",name:"t",id:12},{rule:"optional",type:"string",name:"n",id:13},{rule:"optional",type:"string",name:"s",id:14}]},{name:"GenericCommand",syntax:"proto2",fields:[{rule:"optional",type:"CommandType",name:"cmd",id:1},{rule:"optional",type:"OpType",name:"op",id:2},{rule:"optional",type:"string",name:"appId",id:3},{rule:"optional",type:"string",name:"peerId",id:4},{rule:"optional",type:"int32",name:"i",id:5},{rule:"optional",type:"string",name:"installationId",id:6},{rule:"optional",type:"int32",name:"priority",id:7},{rule:"optional",type:"int32",name:"service",id:8},{rule:"optional",type:"int64",name:"serverTs",id:9},{rule:"optional",type:"int64",name:"clientTs",id:10},{rule:"optional",type:"int32",name:"notificationType",id:11},{rule:"optional",type:"DataCommand",name:"dataMessage",id:101},{rule:"optional",type:"SessionCommand",name:"sessionMessage",id:102},{rule:"optional",type:"ErrorCommand",name:"errorMessage",id:103},{rule:"optional",type:"DirectCommand",name:"directMessage",id:104},{rule:"optional",type:"AckCommand",name:"ackMessage",id:105},{rule:"optional",type:"UnreadCommand",name:"unreadMessage",id:106},{rule:"optional",type:"ReadCommand",name:"readMessage",id:107},{rule:"optional",type:"RcpCommand",name:"rcpMessage",id:108},{rule:"optional",type:"LogsCommand",name:"logsMessage",id:109},{rule:"optional",type:"ConvCommand",name:"convMessage",id:110},{rule:"optional",type:"RoomCommand",name:"roomMessage",id:111},{rule:"optional",type:"PresenceCommand",name:"presenceMessage",id:112},{rule:"optional",type:"ReportCommand",name:"reportMessage",id:113},{rule:"optional",type:"PatchCommand",name:"patchMessage",id:114},{rule:"optional",type:"PubsubCommand",name:"pubsubMessage",id:115},{rule:"optional",type:"BlacklistCommand",name:"blacklistMessage",id:116}]}],enums:[{name:"CommandType",syntax:"proto2",values:[{name:"session",id:0},{name:"conv",id:1},{name:"direct",id:2},{name:"ack",id:3},{name:"rcp",id:4},{name:"unread",id:5},{name:"logs",id:6},{name:"error",id:7},{name:"login",id:8},{name:"data",id:9},{name:"room",id:10},{name:"read",id:11},{name:"presence",id:12},{name:"report",id:13},{name:"echo",id:14},{name:"loggedin",id:15},{name:"logout",id:16},{name:"loggedout",id:17},{name:"patch",id:18},{name:"pubsub",id:19},{name:"blacklist",id:20},{name:"goaway",id:21}]},{name:"OpType",syntax:"proto2",values:[{name:"open",id:1},{name:"add",id:2},{name:"remove",id:3},{name:"close",id:4},{name:"opened",id:5},{name:"closed",id:6},{name:"query",id:7},{name:"query_result",id:8},{name:"conflict",id:9},{name:"added",id:10},{name:"removed",id:11},{name:"refresh",id:12},{name:"refreshed",id:13},{name:"start",id:30},{name:"started",id:31},{name:"joined",id:32},{name:"members_joined",id:33},{name:"left",id:39},{name:"members_left",id:40},{name:"results",id:42},{name:"count",id:43},{name:"result",id:44},{name:"update",id:45},{name:"updated",id:46},{name:"mute",id:47},{name:"unmute",id:48},{name:"status",id:49},{name:"members",id:50},{name:"max_read",id:51},{name:"is_member",id:52},{name:"member_info_update",id:53},{name:"member_info_updated",id:54},{name:"member_info_changed",id:55},{name:"join",id:80},{name:"invite",id:81},{name:"leave",id:82},{name:"kick",id:83},{name:"reject",id:84},{name:"invited",id:85},{name:"kicked",id:86},{name:"upload",id:100},{name:"uploaded",id:101},{name:"subscribe",id:120},{name:"subscribed",id:121},{name:"unsubscribe",id:122},{name:"unsubscribed",id:123},{name:"is_subscribed",id:124},{name:"modify",id:150},{name:"modified",id:151},{name:"block",id:170},{name:"unblock",id:171},{name:"blocked",id:172},{name:"unblocked",id:173},{name:"members_blocked",id:174},{name:"members_unblocked",id:175},{name:"check_block",id:176},{name:"check_result",id:177},{name:"add_shutup",id:180},{name:"remove_shutup",id:181},{name:"query_shutup",id:182},{name:"shutup_added",id:183},{name:"shutup_removed",id:184},{name:"shutup_result",id:185},{name:"shutuped",id:186},{name:"unshutuped",id:187},{name:"members_shutuped",id:188},{name:"members_unshutuped",id:189},{name:"check_shutup",id:190}]},{name:"StatusType",syntax:"proto2",values:[{name:"on",id:1},{name:"off",id:2}]}],isNamespace:!0}).build(),tt=X.push_server.messages2,et=tt.JsonObjectMessage,nt=tt.UnreadTuple,rt=tt.LogItem,it=tt.DataCommand,ot=tt.SessionCommand,at=tt.ErrorCommand,st=tt.DirectCommand,ut=tt.AckCommand,ct=tt.UnreadCommand,ft=tt.ConvCommand,lt=tt.RoomCommand,ht=tt.LogsCommand,dt=tt.RcpCommand,pt=tt.ReadTuple,vt=tt.MaxReadTuple,gt=tt.ReadCommand,mt=tt.PresenceCommand,yt=tt.ReportCommand,bt=tt.GenericCommand,_t=tt.BlacklistCommand,wt=tt.PatchCommand,Et=tt.PatchItem,Ot=tt.ConvMemberInfo,Tt=tt.CommandType,St=tt.OpType,At=tt.StatusType,xt=(0,v.default)({__proto__:null,JsonObjectMessage:et,UnreadTuple:nt,LogItem:rt,DataCommand:it,SessionCommand:ot,ErrorCommand:at,DirectCommand:st,AckCommand:ut,UnreadCommand:ct,ConvCommand:ft,RoomCommand:lt,LogsCommand:ht,RcpCommand:dt,ReadTuple:pt,MaxReadTuple:vt,ReadCommand:gt,PresenceCommand:mt,ReportCommand:yt,GenericCommand:bt,BlacklistCommand:_t,PatchCommand:wt,PatchItem:Et,ConvMemberInfo:Ot,CommandType:Tt,OpType:St,StatusType:At}),It={},jt=function(t){var e=It[t];if(void 0===e)throw new Error("".concat(t," adapter is not configured"));return e},Ct=function(t){(0,g.default)(It,t)},Nt=void 0!==t?t:"undefined"!=typeof window?window:{},Pt=(0,m.default)("expired"),Rt=W("LC:Expirable"),Ut=function(){function t(t,e){this.originalValue=t,"number"==typeof e&&(this.expiredAt=Date.now()+e)}return K(t,[{key:"value",get:function(){var t=this.expiredAt&&this.expiredAt<=Date.now();return t&&Rt("expired: ".concat(this.originalValue)),t?Pt:this.originalValue}}]),t}();Ut.EXPIRED=Pt;var kt,Lt=W("LC:Cache"),Mt=function(){function t(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"anonymous";this.name=t,this._map={}}var e=t.prototype;return e.get=function(t){var e,n=this._map[t];if(n){var r=n.value;if(r!==Ut.EXPIRED)return Lt("[%s] hit: %s",this.name,t),r;delete this._map[t]}return Lt((0,y.default)(e="[".concat(this.name,"] missed: ")).call(e,t)),null},e.set=function(t,e,n){Lt("[%s] set: %s %d",this.name,t,n),this._map[t]=new Ut(e,n)},t}(),Dt={enable:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"LC*";return W.enable(t)},disable:W.disable},Ft=function t(e){var n=new S.default(e[0]);return 1===e.length?n:n.catch(function(){return t((0,A.default)(e).call(e,1))})},Bt=function(t){return function(e){return t(e),e}},Vt=(Nt.navigator&&Nt.navigator.userAgent&&(0,x.default)(f=Nt.navigator.userAgent).call(f,"MSIE 10."),new I.default),qt=function(t){return Vt.has(t)||Vt.set(t,{}),Vt.get(t)},Wt=function t(e,n){if(!H(e))return e;var r=o({},e);return(0,b.default)(r).forEach(function(e){var i=r[e];i===n?delete r[e]:r[e]=t(i,n)}),r},Yt=function(t){return Wt(t,null)},zt=function(t){return Yt(JSON.parse((0,j.default)(t)))},Gt=function(t){return Array.isArray(t)?t:void 0===t||null===t?[]:[t]},Kt="object"===("undefined"==typeof wx?"undefined":$(wx))&&"function"==typeof wx.connectSocket,Qt=function(t){return"-MdYXbMMI"!==(0,A.default)(t).call(t,-9)},Jt=function(t,e){if(!t||!e)return!1;if(t.byteLength!==e.byteLength)return!1;var n=new Uint8Array(t),r=new Uint8Array(e);return!n.some(function(t,e){return t!==r[e]})},$t=W("LC:WebSocketPlus"),Ht=function(t){return Math.min(1e3*Math.pow(2,t),3e5)},Zt=function(t,e,n){return s(s({},n),{},{value:function(){var t,r;this.checkConnectionAvailability(e);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return(r=n.value).call.apply(r,(0,y.default)(t=[this]).call(t,o))}})},Xt=(kt=function(t){function e(e,n){var r;return r=t.call(this)||this,r.init(),r._protocol=n,S.default.resolve("function"==typeof e?e():e).then(Gt).then(function(t){return r._urls=t,r._open()}).then(function(){r.__postponeTimeoutTimer=r._postponeTimeoutTimer.bind(V(r)),Nt.addEventListener&&(r.__pause=function(){r.can("pause")&&r.pause()},r.__resume=function(){r.can("resume")&&r.resume()},Nt.addEventListener("offline",r.__pause),Nt.addEventListener("online",r.__resume)),r.open()}).catch(r.throw.bind(V(r))),r}q(e,t),K(e,[{key:"urls",get:function(){return this._urls},set:function(t){this._urls=Gt(t)}}]);var n=e.prototype;return n._open=function(){var t=this;return this._createWs(this._urls,this._protocol).then(function(e){var n,r=G(t._urls),i=r[0],o=(0,A.default)(r).call(r,1);return t._urls=(0,y.default)(n=[]).call(n,D(o),[i]),e})},n._createWs=function(t,e){var n=this;return Ft((0,C.default)(t).call(t,function(t){return function(r,i){var o;$t((0,y.default)(o="connect [".concat(t,"] ")).call(o,e));var a=jt("WebSocket"),s=e?new a(t,e):new a(t);s.binaryType=n.binaryType||"arraybuffer",s.onopen=function(){return r(s)},s.onclose=function(e){return i(e instanceof Error?e:new Error("Failed to connect [".concat(t,"]")))},s.onerror=s.onclose}})).then(function(t){return n._ws=t,n._ws.onclose=n._handleClose.bind(n),n._ws.onmessage=n._handleMessage.bind(n),t})},n._destroyWs=function(){var t=this._ws;t&&(t.onopen=null,t.onclose=null,t.onerror=null,t.onmessage=null,this._ws=null,t.close())},n.onbeforeevent=function(t,e,n){for(var r,i,o=arguments.length,a=new Array(o>3?o-3:0),s=3;s<o;s++)a[s-3]=arguments[s];$t((0,y.default)(r=(0,y.default)(i="".concat(t,": ")).call(i,e," -> ")).call(r,n," %o"),a)},n.onopen=function(){this.emit("open")},n.onconnected=function(){this._startConnectionKeeper()},n.onleaveconnected=function(t,e,n){this._stopConnectionKeeper(),this._destroyWs(),"offline"!==n&&"disconnected"!==n||this.emit("disconnect")},n.onpause=function(){this.emit("offline")},n.onbeforeresume=function(){this.emit("online")},n.onreconnect=function(){this.emit("reconnect")},n.ondisconnected=function(t,e,n){var r,i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a="offline"===e?0:Ht.call(null,o);$t((0,y.default)(r="schedule attempt=".concat(o," delay=")).call(r,a)),this.emit("schedule",o,a),this.__scheduledRetry&&clearTimeout(this.__scheduledRetry),this.__scheduledRetry=setTimeout(function(){i.is("disconnected")&&i.retry(o)},a)},n.onretry=function(t,e,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.emit("retry",i),this._open().then(function(){return r.can("reconnect")&&r.reconnect()},function(){return r.can("fail")&&r.fail(i+1)})},n.onerror=function(t,e,n,r){this.emit("error",r)},n.onclose=function(){Nt.removeEventListener&&(this.__pause&&Nt.removeEventListener("offline",this.__pause),this.__resume&&Nt.removeEventListener("online",this.__resume))},n.checkConnectionAvailability=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"API";if(!this.is("connected")){var e,n=this.current;throw console.warn((0,y.default)(e="".concat(t," should not be called when the connection is ")).call(e,n)),(this.is("disconnected")||this.is("reconnecting"))&&console.warn("disconnect and reconnect event should be handled to avoid such calls."),new Error("Connection unavailable")}},n._ping=function(){$t("ping");try{this.ping()}catch(t){console.warn("websocket ping error: ".concat(t.message))}},n.ping=function(){this._ws.ping?this._ws.ping():console.warn("The WebSocket implement does not support sending ping frame.\n Override ping method to use application defined ping/pong mechanism.")},n._postponeTimeoutTimer=function(){var t=this;$t("_postponeTimeoutTimer"),this._clearTimeoutTimers(),this._timeoutTimer=setTimeout(function(){$t("timeout"),t.disconnect()},38e4)},n._clearTimeoutTimers=function(){this._timeoutTimer&&clearTimeout(this._timeoutTimer)},n._startConnectionKeeper=function(){$t("start connection keeper"),this._heartbeatTimer=setInterval(this._ping.bind(this),18e4);var t=this._ws.addListener||this._ws.addEventListener;if(!t)return void $t("connection keeper disabled due to the lack of #addEventListener.");t.call(this._ws,"message",this.__postponeTimeoutTimer),t.call(this._ws,"pong",this.__postponeTimeoutTimer),this._postponeTimeoutTimer()},n._stopConnectionKeeper=function(){$t("stop connection keeper");var t=this._ws.removeListener||this._ws.removeEventListener;t&&(t.call(this._ws,"message",this.__postponeTimeoutTimer),t.call(this._ws,"pong",this.__postponeTimeoutTimer),this._clearTimeoutTimers()),this._heartbeatTimer&&clearInterval(this._heartbeatTimer)},n._handleClose=function(t){var e;$t((0,y.default)(e="ws closed [".concat(t.code,"] ")).call(e,t.reason)),this.isFinished()||this.handleClose(t)},n.handleClose=function(){this.disconnect()},n.send=function(t){$t("send",t),this._ws.send(t)},n._handleMessage=function(t){$t("message",t.data),this.handleMessage(t.data)},n.handleMessage=function(t){this.emit("message",t)},e}(k),Q(kt.prototype,"_ping",[Zt],(0,E.default)(kt.prototype,"_ping"),kt.prototype),Q(kt.prototype,"send",[Zt],(0,E.default)(kt.prototype,"send"),kt.prototype),kt);J.create({target:Xt.prototype,initial:{state:"initialized",event:"init",defer:!0},terminal:"closed",events:[{name:"open",from:"initialized",to:"connected"},{name:"disconnect",from:"connected",to:"disconnected"},{name:"retry",from:"disconnected",to:"reconnecting"},{name:"fail",from:"reconnecting",to:"disconnected"},{name:"reconnect",from:"reconnecting",to:"connected"},{name:"pause",from:["connected","disconnected","reconnecting"],to:"offline"},{},{name:"resume",from:"offline",to:"disconnected"},{name:"close",from:["connected","disconnected","reconnecting","offline"],to:"closed"},{name:"throw",from:"*",to:"error"}]});var te=(0,v.default)({1e3:{name:"CLOSE_NORMAL"},1006:{name:"CLOSE_ABNORMAL"},4100:{name:"APP_NOT_AVAILABLE",message:"App not exists or realtime message service is disabled."},4102:{name:"SIGNATURE_FAILED",message:"Login signature mismatch."},4103:{name:"INVALID_LOGIN",message:"Malformed clientId."},4105:{name:"SESSION_REQUIRED",message:"Message sent before session opened."},4107:{name:"READ_TIMEOUT"},4108:{name:"LOGIN_TIMEOUT"},4109:{name:"FRAME_TOO_LONG"},4110:{name:"INVALID_ORIGIN",message:"Access denied by domain whitelist."},4111:{name:"SESSION_CONFLICT"},4112:{name:"SESSION_TOKEN_EXPIRED"},4113:{name:"APP_QUOTA_EXCEEDED",message:"The daily active users limit exceeded."},4116:{name:"MESSAGE_SENT_QUOTA_EXCEEDED",message:"Command sent too fast."},4200:{name:"INTERNAL_ERROR",message:"Internal error, please contact LeanCloud for support."},4301:{name:"CONVERSATION_API_FAILED",message:"Upstream Conversatoin API failed, see error.detail for details."},4302:{name:"CONVERSATION_SIGNATURE_FAILED",message:"Conversation action signature mismatch."},4303:{name:"CONVERSATION_NOT_FOUND"},4304:{name:"CONVERSATION_FULL"},4305:{name:"CONVERSATION_REJECTED_BY_APP",message:"Conversation action rejected by hook."},4306:{name:"CONVERSATION_UPDATE_FAILED"},4307:{name:"CONVERSATION_READ_ONLY"},4308:{name:"CONVERSATION_NOT_ALLOWED"},4309:{name:"CONVERSATION_UPDATE_REJECTED",message:"Conversation update rejected because the client is not a member."},4310:{name:"CONVERSATION_QUERY_FAILED",message:"Conversation query failed because it is too expansive."},4311:{name:"CONVERSATION_LOG_FAILED"},4312:{name:"CONVERSATION_LOG_REJECTED",message:"Message query rejected because the client is not a member of the conversation."},4313:{name:"SYSTEM_CONVERSATION_REQUIRED"},4314:{name:"NORMAL_CONVERSATION_REQUIRED"},4315:{name:"CONVERSATION_BLACKLISTED",message:"Blacklisted in the conversation."},4316:{name:"TRANSIENT_CONVERSATION_REQUIRED"},4317:{name:"CONVERSATION_MEMBERSHIP_REQUIRED"},4318:{name:"CONVERSATION_API_QUOTA_EXCEEDED",message:"LeanCloud API quota exceeded. You may upgrade your plan."},4323:{name:"TEMPORARY_CONVERSATION_EXPIRED",message:"Temporary conversation expired or does not exist."},4401:{name:"INVALID_MESSAGING_TARGET",message:"Conversation does not exist or client is not a member."},4402:{name:"MESSAGE_REJECTED_BY_APP",message:"Message rejected by hook."},4403:{name:"MESSAGE_OWNERSHIP_REQUIRED"},4404:{name:"MESSAGE_NOT_FOUND"},4405:{name:"MESSAGE_UPDATE_REJECTED_BY_APP",message:"Message update rejected by hook."},4406:{name:"MESSAGE_EDIT_DISABLED"},4407:{name:"MESSAGE_RECALL_DISABLED"},5130:{name:"OWNER_PROMOTION_NOT_ALLOWED",message:"Updating a member's role to owner is not allowed."}}),ee=(0,v.default)((0,N.default)(l=(0,b.default)(te)).call(l,function(t,e){return(0,g.default)(t,F({},te[e].name,Number(e)))},{})),ne=function(t){var e=t.code,n=t.reason,r=t.appCode,i=t.detail,o=t.error,a=n||i||o,s=n;!a&&te[e]&&(s=te[e].name,a=te[e].message||s),a||(a="Unknow Error: ".concat(e));var u=new Error(a);return(0,g.default)(u,{code:e,appCode:r,detail:i,name:s})},re=W("LC:Connection"),ie=(0,m.default)("expire"),oe=function(t){return!(t.cmd===Tt.direct||t.cmd===Tt.session&&t.op===St.open||t.cmd===Tt.conv&&(t.op===St.start||t.op===St.update||t.op===St.members))},ae=function(t){function e(e,n){var r,i,o=n.format,a=n.version;re("initializing Connection");var s=(0,y.default)(r="lc.".concat(o,".")).call(r,a);return i=t.call(this,e,s)||this,i._protocolFormat=o,i._commands={},i._serialId=0,i}q(e,t);var n=e.prototype;return n.send=function(){function e(t){return n.apply(this,arguments)}var n=M(L.mark(function e(n){var r,i,o,a,s,u,c=this,f=arguments;return L.wrap(function(e){for(var l,h;;)switch(e.prev=e.next){case 0:if(!(r=!(f.length>1&&void 0!==f[1])||f[1])){e.next=11;break}if(!oe(n)){e.next=8;break}if(i=n.toArrayBuffer(),!(a=(0,P.default)(l=z(this._commands)).call(l,function(t){var e=t.buffer,r=t.command;return r.cmd===n.cmd&&r.op===n.op&&Jt(e,i)}))){e.next=8;break}return console.warn((0,y.default)(h="Duplicated command [cmd:".concat(n.cmd," op:")).call(h,n.op,"] is throttled.")),e.abrupt("return",a.promise);case 8:this._serialId+=1,o=this._serialId,n.i=o;case 11:if(re.enabled&&re("↑ %O sent",zt(n)),"proto2base64"===this._protocolFormat?s=n.toBase64():n.toArrayBuffer&&(s=n.toArrayBuffer()),s){e.next=15;break}throw new TypeError("".concat(n," is not a GenericCommand"));case 15:if(t.prototype.send.call(this,s),r){e.next=18;break}return e.abrupt("return",void 0);case 18:return u=new S.default(function(t,e){c._commands[o]={command:n,buffer:i,resolve:t,reject:e,timeout:setTimeout(function(){if(c._commands[o]){var t;re.enabled&&re("✗ %O timeout",zt(n)),e(ne({error:(0,y.default)(t="Command Timeout [cmd:".concat(n.cmd," op:")).call(t,n.op,"]"),name:"COMMAND_TIMEOUT"})),delete c._commands[o]}},2e4)}}),this._commands[o].promise=u,e.abrupt("return",u);case 21:case"end":return e.stop()}},e,this)}));return e}(),n.handleMessage=function(t){var e;try{e=bt.decode(t),re.enabled&&re("↓ %O received",zt(e))}catch(e){return void console.warn("Decode message failed:",e.message,t)}var n=e.i;if(n)this._commands[n]?(clearTimeout(this._commands[n].timeout),e.cmd===Tt.error?this._commands[n].reject(ne(e.errorMessage)):this._commands[n].resolve(e),delete this._commands[n]):console.warn("Unexpected command received with serialId [".concat(n,"],\n which have timed out or never been requested."));else switch(e.cmd){case Tt.error:return void this.emit("error",ne(e.errorMessage));case Tt.goaway:return void this.emit(ie);default:this.emit("message",e)}},n.ping=function(){return this.send(new bt({cmd:Tt.echo})).catch(function(t){return re("ping failed:",t)})},e}(Xt),se=W("LC:request"),ue=function(t){var e=t.method,n=void 0===e?"GET":e,r=t.url,i=t.query,o=t.headers,a=t.data,s=t.timeout,u=r;if(i){var c,f,l,h=(0,w.default)(c=(0,C.default)(f=(0,b.default)(i)).call(f,function(t){var e,n=i[t];if(void 0!==n){var r=H(n)?(0,j.default)(n):n;return(0,y.default)(e="".concat(encodeURIComponent(t),"=")).call(e,encodeURIComponent(r))}})).call(c,function(t){return t}).join("&");u=(0,y.default)(l="".concat(u,"?")).call(l,h)}se("Req: %O %O %O",n,u,{headers:o,data:a});var d=jt("request"),p=d(u,{method:n,headers:o,data:a}).then(function(t){if(!1===t.ok){var e=ne(t.data);throw e.response=t,e}return se("Res: %O %O %O",u,t.status,t.data),t.data}).catch(function(t){throw t.response&&se("Error: %O %O %O",u,t.response.status,t.response.data),t});return s?Z.timeout(p,s):p},ce=function(t,e){t&&t.forEach(function(t){try{t(e)}catch(e){throw t._pluginName&&(e.message+="[".concat(t._pluginName,"]")),e}})},fe=function(t,e){var n;return(0,N.default)(n=Gt(t)).call(n,function(t,n){return t.then(function(t){return!1!==t&&n.apply(void 0,D(e))}).catch(function(t){throw n._pluginName&&(t.message+="[".concat(n._pluginName,"]")),t})},S.default.resolve(!0))},le="5.0.0-rc.7",he=W("LC:Realtime"),de=new Mt("push-router"),pe={},ve=function(t){function e(n){var r,i,o=n.plugins,a=B(n,["plugins"]);he("initializing Realtime %s %O",le,a),i=t.call(this)||this;var s=a.appId;if("string"!=typeof s)throw new TypeError("appId [".concat(s,"] is not a string"));if(pe[s])throw new Error("App [".concat(s,"] is already initialized."));if(pe[s]=!0,"string"!=typeof a.appKey)throw new TypeError("appKey [".concat(a.appKey,"] is not a string"));if(Qt(s)&&!a.server)throw new TypeError("server option is required for apps from CN region");i._options=c({appId:void 0,appKey:void 0,noBinary:!1,ssl:!0,RTMServerName:"undefined"!=typeof process?process.env.RTM_SERVER_NAME:void 0},a),i._cache=new Mt("endpoints");var u=qt(V(i));u.clients=new R.default,u.pendingClients=new R.default;var f=(0,y.default)(r=[]).call(r,D(Gt(e.__preRegisteredPlugins)),D(Gt(o)));return he("Using plugins %o",(0,C.default)(f).call(f,function(t){return t.name})),i._plugins=(0,N.default)(f).call(f,function(t,e){return(0,b.default)(e).forEach(function(n){if({}.hasOwnProperty.call(e,n)&&"name"!==n){var r;e.name&&Gt(e[n]).forEach(function(t){t._pluginName=e.name}),t[n]=(0,y.default)(r=Gt(t[n])).call(r,e[n])}}),t},{}),ce(i._plugins.onRealtimeCreate,V(i)),i}q(e,t);var n=e.prototype;return n._request=function(){function t(t){return e.apply(this,arguments)}var e=M(L.mark(function t(e){var n,r,i,o,a,s,u,f,l,h,d,p,v,g;return L.wrap(function(t){for(var m,b;;)switch(t.prev=t.next){case 0:if(n=e.method,r=e.url,i=e.version,o=void 0===i?"1.1":i,a=e.path,s=e.query,u=e.headers,f=e.data,l=r){t.next=9;break}return h=this._options,d=h.appId,p=h.server,t.next=6,this.constructor._getServerUrls({appId:d,server:p});case 6:v=t.sent,g=v.api,l=(0,y.default)(m=(0,y.default)(b="".concat(g,"/")).call(b,o)).call(m,a);case 9:return t.abrupt("return",ue({url:l,method:n,query:s,headers:c({"X-LC-Id":this._options.appId,"X-LC-Key":this._options.appKey},u),data:f}));case 10:case"end":return t.stop()}},t,this)}));return t}(),n._open=function(){var t=this;if(this._openPromise)return this._openPromise;var e="protobuf2";this._options.noBinary&&(e="proto2base64");var n={format:e,version:3};return this._openPromise=new S.default(function(e,r){he("No connection established, create a new one.");var i=new ae(function(){return t._getRTMServers(t._options)},n);i.on("open",function(){return e(i)}).on("error",function(e){delete t._openPromise,r(e)}).on(ie,M(L.mark(function e(){return L.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return he("Connection expired. Refresh endpoints."),t._cache.set("endpoints",null,0),e.next=4,t._getRTMServers(t._options);case 4:i.urls=e.sent,i.disconnect();case 6:case"end":return e.stop()}},e)}))).on("message",t._dispatchCommand.bind(t)),["disconnect","reconnect","retry","schedule","offline","online"].forEach(function(e){return i.on(e,function(){for(var n,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];he("".concat(e," event emitted. %o"),i),t.emit.apply(t,(0,y.default)(n=[e]).call(n,i)),"reconnect"!==e&&qt(t).clients.forEach(function(t){var n;t.emit.apply(t,(0,y.default)(n=[e]).call(n,i))})})}),i.handleClose=function(t){[ee.APP_NOT_AVAILABLE,ee.INVALID_LOGIN,ee.INVALID_ORIGIN].some(function(e){return e===t.code})?this.throw(ne(t)):this.disconnect()},qt(t).connection=i}),this._openPromise},n._getRTMServers=function(){function t(t){return e.apply(this,arguments)}var e=M(L.mark(function t(e){var n,r,i,o,a,s;return L.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.RTMServers){t.next=2;break}return t.abrupt("return",Y(Gt(e.RTMServers)));case 2:if(!(r=this._cache.get("endpoints"))){t.next=7;break}n=r,t.next=14;break;case 7:return t.next=9,this.constructor._fetchRTMServers(e);case 9:if(n=t.sent,i=n,o=i.server,a=i.secondary,s=i.ttl,"string"==typeof o||"string"==typeof a||"number"==typeof s){t.next=13;break}throw new Error("malformed RTM route response: ".concat((0,j.default)(n)));case 13:this._cache.set("endpoints",n,1e3*n.ttl);case 14:return he("endpoint info: %O",n),t.abrupt("return",[n.server,n.secondary]);case 16:case"end":return t.stop()}},t,this)}));return t}(),e._getServerUrls=function(){function t(t){return e.apply(this,arguments)}var e=M(L.mark(function t(e){var n,r,i,o;return L.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.appId,r=e.server,he("fetch server urls"),!r){t.next=6;break}if("string"==typeof r){t.next=5;break}return t.abrupt("return",r);case 5:return t.abrupt("return",{RTMRouter:r,api:r});case 6:if(!(i=de.get(n))){t.next=9;break}return t.abrupt("return",i);case 9:return o="https://",t.abrupt("return",ue({url:"https://app-router.com/2/route",query:{appId:n},timeout:2e4}).then(Bt(he)).then(function(t){var e,r,i=t.rtm_router_server,a=t.api_server,s=t.ttl,u=void 0===s?3600:s;if(!i)throw new Error("rtm router not exists");var c={RTMRouter:(0,y.default)(e="".concat(o)).call(e,i),api:(0,y.default)(r="".concat(o)).call(r,a)};return de.set(n,c,1e3*u),c}).catch(function(){var t,e,r,i,a=(0,A.default)(n).call(n,0,8).toLowerCase();return{RTMRouter:(0,y.default)(t=(0,y.default)(e="".concat(o)).call(e,a,".rtm.")).call(t,"lncldglobal.com"),api:(0,y.default)(r=(0,y.default)(i="".concat(o)).call(i,a,".api.")).call(r,"lncldglobal.com")}}));case 11:case"end":return t.stop()}},t)}));return t}(),e._fetchRTMServers=function(t){var e=t.appId,n=t.ssl,r=t.server,i=t.RTMServerName;return he("fetch endpoint info"),this._getServerUrls({appId:e,server:r}).then(Bt(he)).then(function(t){var r=t.RTMRouter;return ue({url:"".concat(r,"/v1/route"),query:{appId:e,secure:n,features:Kt?"wechat":void 0,server:i,_t:Date.now()},timeout:2e4}).then(Bt(he))})},n._close=function(){this._openPromise&&this._openPromise.then(function(t){return t.close()}),delete this._openPromise},n.retry=function(){var t=qt(this),e=t.connection;if(!e)throw new Error("no connection established");if(e.cannot("retry"))throw new Error("retrying not allowed when not disconnected. the connection is now ".concat(e.current));return e.retry()},n.pause=function(){var t=qt(this),e=t.connection;e&&e.can("pause")&&e.pause()},n.resume=function(){var t=qt(this),e=t.connection;e&&e.can("resume")&&e.resume()},n._registerPending=function(t){qt(this).pendingClients.add(t)},n._deregisterPending=function(t){qt(this).pendingClients.delete(t)},n._register=function(t){qt(this).clients.add(t)},n._deregister=function(t){var e=qt(this);e.clients.delete(t),e.clients.size+e.pendingClients.size===0&&this._close()},n._dispatchCommand=function(t){return fe(this._plugins.beforeCommandDispatch,[t,this]).then(function(e){return!!e&&he("[WARN] Unexpected message received: %O",zt(t))})},e}(k),ge=S.default;e.EventEmitter=k,e.Promise=ge,e.Protocals=xt,e.Protocols=xt,e.Realtime=ve,e.debug=Dt,e.getAdapter=jt,e.setAdapters=Ct}).call(e,n(72))},function(t,e,n){t.exports=n(568)},function(t,e,n){var r=n(569);t.exports=r},function(t,e,n){n(570);var r=n(6);t.exports=r.Object.freeze},function(t,e,n){var r=n(0),i=n(254),o=n(2),a=n(11),s=n(93).onFreeze,u=Object.freeze;r({target:"Object",stat:!0,forced:o(function(){u(1)}),sham:!i},{freeze:function(t){return u&&a(t)?u(s(t)):t}})},function(t,e,n){var r=n(2);t.exports=r(function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})},function(t,e,n){var r=n(573);t.exports=r},function(t,e,n){n(574);var r=n(6);t.exports=r.Object.assign},function(t,e,n){var r=n(0),i=n(575);r({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},function(t,e,n){"use strict";var r=n(14),i=n(4),o=n(15),a=n(2),s=n(104),u=n(103),c=n(119),f=n(34),l=n(94),h=Object.assign,d=Object.defineProperty,p=i([].concat);t.exports=!h||a(function(){if(r&&1!==h({b:1},h(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach(function(t){e[t]=t}),7!=h({},t)[n]||s(h({},e)).join("")!=i})?function(t,e){for(var n=f(t),i=arguments.length,a=1,h=u.f,d=c.f;i>a;)for(var v,g=l(arguments[a++]),m=h?p(s(g),h(g)):s(g),y=m.length,b=0;y>b;)v=m[b++],r&&!o(d,g,v)||(n[v]=g[v]);return n}:h},function(t,e,n){var r=n(577);t.exports=r},function(t,e,n){n(238);var r=n(6);t.exports=r.Object.getOwnPropertySymbols},function(t,e,n){t.exports=n(579)},function(t,e,n){var r=n(580);t.exports=r},function(t,e,n){n(581);var r=n(6);t.exports=r.Object.getOwnPropertyDescriptors},function(t,e,n){var r=n(0),i=n(14),o=n(156),a=n(32),s=n(60),u=n(89);r({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(t){for(var e,n,r=a(t),i=s.f,c=o(r),f={},l=0;c.length>l;)void 0!==(n=i(r,e=c[l++]))&&u(f,e,n);return f}})},function(t,e,n){t.exports=n(583)},function(t,e,n){var r=n(584);t.exports=r},function(t,e,n){n(585);var r=n(6),i=r.Object,o=t.exports=function(t,e){return i.defineProperties(t,e)};i.defineProperties.sham&&(o.sham=!0)},function(t,e,n){var r=n(0),i=n(14),o=n(127).f;r({target:"Object",stat:!0,forced:Object.defineProperties!==o,sham:!i},{defineProperties:o})},function(t,e,n){t.exports=n(587)},function(t,e,n){var r=n(588);n(44),t.exports=r},function(t,e,n){n(41),n(63),n(589);var r=n(6);t.exports=r.WeakMap},function(t,e,n){n(590)},function(t,e,n){"use strict";var r,i=n(7),o=n(4),a=n(150),s=n(93),u=n(258),c=n(591),f=n(11),l=n(255),h=n(42).enforce,d=n(164),p=!i.ActiveXObject&&"ActiveXObject"in i,v=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},g=u("WeakMap",v,c);if(d&&p){r=c.getConstructor(v,"WeakMap",!0),s.enable();var m=g.prototype,y=o(m.delete),b=o(m.has),_=o(m.get),w=o(m.set);a(m,{delete:function(t){if(f(t)&&!l(t)){var e=h(this);return e.frozen||(e.frozen=new r),y(this,t)||e.frozen.delete(t)}return y(this,t)},has:function(t){if(f(t)&&!l(t)){var e=h(this);return e.frozen||(e.frozen=new r),b(this,t)||e.frozen.has(t)}return b(this,t)},get:function(t){if(f(t)&&!l(t)){var e=h(this);return e.frozen||(e.frozen=new r),b(this,t)?_(this,t):e.frozen.get(t)}return _(this,t)},set:function(t,e){if(f(t)&&!l(t)){var n=h(this);n.frozen||(n.frozen=new r),b(this,t)?w(this,t,e):n.frozen.set(t,e)}else w(this,t,e);return this}})}},function(t,e,n){"use strict";var r=n(4),i=n(150),o=n(93).getWeakData,a=n(20),s=n(11),u=n(107),c=n(40),f=n(70),l=n(12),h=n(42),d=h.set,p=h.getterFor,v=f.find,g=f.findIndex,m=r([].splice),y=0,b=function(t){return t.frozen||(t.frozen=new _)},_=function(){this.entries=[]},w=function(t,e){return v(t.entries,function(t){return t[0]===e})};_.prototype={get:function(t){var e=w(this,t);if(e)return e[1]},has:function(t){return!!w(this,t)},set:function(t,e){var n=w(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=g(this.entries,function(e){return e[0]===t});return~e&&m(this.entries,e,1),!!~e}},t.exports={getConstructor:function(t,e,n,r){var f=t(function(t,i){u(t,h),d(t,{type:e,id:y++,frozen:void 0}),void 0!=i&&c(i,t[r],{that:t,AS_ENTRIES:n})}),h=f.prototype,v=p(e),g=function(t,e,n){var r=v(t),i=o(a(e),!0);return!0===i?b(r).set(e,n):i[r.id]=n,t};return i(h,{delete:function(t){var e=v(this);if(!s(t))return!1;var n=o(t);return!0===n?b(e).delete(t):n&&l(n,e.id)&&delete n[e.id]},has:function(t){var e=v(this);if(!s(t))return!1;var n=o(t);return!0===n?b(e).has(t):n&&l(n,e.id)}}),i(h,n?{get:function(t){var e=v(this);if(s(t)){var n=o(t);return!0===n?b(e).get(t):n?n[e.id]:void 0}},set:function(t,e){return g(this,t,e)}}:{add:function(t){return g(this,t,!0)}}),f}}},function(t,e,n){t.exports=n(593)},function(t,e,n){var r=n(594);t.exports=r},function(t,e,n){var r=n(19),i=n(595),o=Array.prototype;t.exports=function(t){var e=t.reduce;return t===o||r(o,t)&&e===o.reduce?i:e}},function(t,e,n){n(596);var r=n(38);t.exports=r("Array").reduce},function(t,e,n){"use strict";var r=n(0),i=n(597).left,o=n(225),a=n(75),s=n(106),u=o("reduce"),c=!s&&a>79&&a<83;r({target:"Array",proto:!0,forced:!u||c},{reduce:function(t){var e=arguments.length;return i(this,t,e,e>1?arguments[1]:void 0)}})},function(t,e,n){var r=n(31),i=n(34),o=n(94),a=n(39),s=TypeError,u=function(t){return function(e,n,u,c){r(n);var f=i(e),l=o(f),h=a(f),d=t?h-1:0,p=t?-1:1;if(u<2)for(;;){if(d in l){c=l[d],d+=p;break}if(d+=p,t?d<0:h<=d)throw s("Reduce of empty array with no initial value")}for(;t?d>=0:h>d;d+=p)d in l&&(c=n(c,l[d],d,f));return c}};t.exports={left:u(!1),right:u(!0)}},function(t,e,n){var r=n(599);n(44),t.exports=r},function(t,e,n){n(41),n(63),n(600),n(65);var r=n(6);t.exports=r.Set},function(t,e,n){n(601)},function(t,e,n){"use strict";var r=n(258),i=n(602);r("Set",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},i)},function(t,e,n){"use strict";var r=n(23).f,i=n(49),o=n(150),a=n(48),s=n(107),u=n(40),c=n(130),f=n(166),l=n(14),h=n(93).fastKey,d=n(42),p=d.set,v=d.getterFor;t.exports={getConstructor:function(t,e,n,c){var f=t(function(t,r){s(t,d),p(t,{type:e,index:i(null),first:void 0,last:void 0,size:0}),l||(t.size=0),void 0!=r&&u(r,t[c],{that:t,AS_ENTRIES:n})}),d=f.prototype,g=v(e),m=function(t,e,n){var r,i,o=g(t),a=y(t,e);return a?a.value=n:(o.last=a={index:i=h(e,!0),key:e,value:n,previous:r=o.last,next:void 0,removed:!1},o.first||(o.first=a),r&&(r.next=a),l?o.size++:t.size++,"F"!==i&&(o.index[i]=a)),t},y=function(t,e){var n,r=g(t),i=h(e);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key==e)return n};return o(d,{clear:function(){for(var t=this,e=g(t),n=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete n[r.index],r=r.next;e.first=e.last=void 0,l?e.size=0:t.size=0},delete:function(t){var e=this,n=g(e),r=y(e,t);if(r){var i=r.next,o=r.previous;delete n.index[r.index],r.removed=!0,o&&(o.next=i),i&&(i.previous=o),n.first==r&&(n.first=i),n.last==r&&(n.last=o),l?n.size--:e.size--}return!!r},forEach:function(t){for(var e,n=g(this),r=a(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:n.first;)for(r(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!y(this,t)}}),o(d,n?{get:function(t){var e=y(this,t);return e&&e.value},set:function(t,e){return m(this,0===t?0:t,e)}}:{add:function(t){return m(this,t=0===t?0:t,t)}}),l&&r(d,"size",{get:function(){return g(this).size}}),f},setStrong:function(t,e,n){var r=e+" Iterator",i=v(e),o=v(r);c(t,e,function(t,e){p(this,{type:r,target:t,state:i(t),kind:e,last:void 0})},function(){for(var t=o(this),e=t.kind,n=t.last;n&&n.removed;)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?"keys"==e?{value:n.key,done:!1}:"values"==e?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})},n?"entries":"values",!n,!0),f(e)}}},function(t,e,n){var r,i,o;/**
8 * @license protobuf.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
9 * Released under the Apache License, Version 2.0
10 * see: https://github.com/dcodeIO/protobuf.js for details
11 */
12!function(a,s){i=[n(604)],r=s,void 0!==(o="function"==typeof r?r.apply(e,i):r)&&(t.exports=o)}(0,function(t,e){"use strict";var r={};return r.ByteBuffer=t,r.Long=t.Long||null,r.VERSION="5.0.3",r.WIRE_TYPES={},r.WIRE_TYPES.VARINT=0,r.WIRE_TYPES.BITS64=1,r.WIRE_TYPES.LDELIM=2,r.WIRE_TYPES.STARTGROUP=3,r.WIRE_TYPES.ENDGROUP=4,r.WIRE_TYPES.BITS32=5,r.PACKABLE_WIRE_TYPES=[r.WIRE_TYPES.VARINT,r.WIRE_TYPES.BITS64,r.WIRE_TYPES.BITS32],r.TYPES={int32:{name:"int32",wireType:r.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:r.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:r.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:r.WIRE_TYPES.VARINT,defaultValue:r.Long?r.Long.ZERO:void 0},uint64:{name:"uint64",wireType:r.WIRE_TYPES.VARINT,defaultValue:r.Long?r.Long.UZERO:void 0},sint64:{name:"sint64",wireType:r.WIRE_TYPES.VARINT,defaultValue:r.Long?r.Long.ZERO:void 0},bool:{name:"bool",wireType:r.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:r.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:r.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:r.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:r.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:r.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:r.WIRE_TYPES.BITS64,defaultValue:r.Long?r.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:r.WIRE_TYPES.BITS64,defaultValue:r.Long?r.Long.ZERO:void 0},float:{name:"float",wireType:r.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:r.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:r.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:r.WIRE_TYPES.STARTGROUP,defaultValue:null}},r.MAP_KEY_TYPES=[r.TYPES.int32,r.TYPES.sint32,r.TYPES.sfixed32,r.TYPES.uint32,r.TYPES.fixed32,r.TYPES.int64,r.TYPES.sint64,r.TYPES.sfixed64,r.TYPES.uint64,r.TYPES.fixed64,r.TYPES.bool,r.TYPES.string,r.TYPES.bytes],r.ID_MIN=1,r.ID_MAX=536870911,r.convertFieldsToCamelCase=!1,r.populateAccessors=!0,r.populateDefaults=!0,r.Util=function(){var t={};return t.IS_NODE=!("object"!=typeof process||process+""!="[object process]"||process.browser),t.XHR=function(){for(var t=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],e=null,n=0;n<t.length;n++){try{e=t[n]()}catch(t){continue}break}if(!e)throw Error("XMLHttpRequest is not supported");return e},t.fetch=function(e,r){if(r&&"function"!=typeof r&&(r=null),t.IS_NODE){var i=n(606);if(r)i.readFile(e,function(t,e){r(t?null:""+e)});else try{return i.readFileSync(e)}catch(t){return null}}else{var o=t.XHR();if(o.open("GET",e,!!r),o.setRequestHeader("Accept","text/plain"),"function"==typeof o.overrideMimeType&&o.overrideMimeType("text/plain"),!r)return o.send(null),200==o.status||0==o.status&&"string"==typeof o.responseText?o.responseText:null;if(o.onreadystatechange=function(){4==o.readyState&&r(200==o.status||0==o.status&&"string"==typeof o.responseText?o.responseText:null)},4==o.readyState)return;o.send(null)}},t.toCamelCase=function(t){return t.replace(/_([a-zA-Z])/g,function(t,e){return e.toUpperCase()})},t}(),r.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,FQTYPEREF:/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},r.Reflect=function(e){function n(n){if("string"==typeof n&&(n=e.TYPES[n]),void 0===n.defaultValue)throw Error("default value for type "+n.name+" is not supported");return n==e.TYPES.bytes?new t(0):n.defaultValue}function r(t,n){if(t&&"number"==typeof t.low&&"number"==typeof t.high&&"boolean"==typeof t.unsigned&&t.low===t.low&&t.high===t.high)return new e.Long(t.low,t.high,void 0===n?t.unsigned:n);if("string"==typeof t)return e.Long.fromString(t,n||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,n||!1);throw Error("not convertible to Long")}function i(t,n){var r=n.readVarint32(),o=7&r,a=r>>>3;switch(o){case e.WIRE_TYPES.VARINT:do{r=n.readUint8()}while(128==(128&r));break;case e.WIRE_TYPES.BITS64:n.offset+=8;break;case e.WIRE_TYPES.LDELIM:r=n.readVarint32(),n.offset+=r;break;case e.WIRE_TYPES.STARTGROUP:i(a,n);break;case e.WIRE_TYPES.ENDGROUP:if(a===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+a+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:n.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+o)}return!0}var o={},a=function(t,e,n){this.builder=t,this.parent=e,this.name=n,this.className},s=a.prototype;s.fqn=function(){for(var t=this.name,e=this;;){if(null==(e=e.parent))break;t=e.name+"."+t}return t},s.toString=function(t){return(t?this.className+" ":"")+this.fqn()},s.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},o.T=a;var u=function(t,e,n,r,i){a.call(this,t,e,n),this.className="Namespace",this.children=[],this.options=r||{},this.syntax=i||"proto2"},c=u.prototype=Object.create(a.prototype);c.getChildren=function(t){if(null==(t=t||null))return this.children.slice();for(var e=[],n=0,r=this.children.length;n<r;++n)this.children[n]instanceof t&&e.push(this.children[n]);return e},c.addChild=function(t){var e;if(e=this.getChild(t.name))if(e instanceof h.Field&&e.name!==e.originalName&&null===this.getChild(e.originalName))e.name=e.originalName;else{if(!(t instanceof h.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName)))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+t.name);t.name=t.originalName}this.children.push(t)},c.getChild=function(t){for(var e="number"==typeof t?"id":"name",n=0,r=this.children.length;n<r;++n)if(this.children[n][e]===t)return this.children[n];return null},c.resolve=function(t,e){var n="string"==typeof t?t.split("."):t,r=this,i=0;if(""===n[i]){for(;null!==r.parent;)r=r.parent;i++}var a;do{do{if(!(r instanceof o.Namespace)){r=null;break}if(!(a=r.getChild(n[i]))||!(a instanceof o.T)||e&&!(a instanceof o.Namespace)){r=null;break}r=a,i++}while(i<n.length);if(null!=r)break;if(null!==this.parent)return this.parent.resolve(t,e)}while(null!=r);return r},c.qn=function(t){var e=[],n=t;do{e.unshift(n.name),n=n.parent}while(null!==n);for(var r=1;r<=e.length;r++){var i=e.slice(e.length-r);if(t===this.resolve(i,t instanceof o.Namespace))return i.join(".")}return t.fqn()},c.build=function(){for(var t,e={},n=this.children,r=0,i=n.length;r<i;++r)(t=n[r])instanceof u&&(e[t.name]=t.build());return Object.defineProperty&&Object.defineProperty(e,"$options",{value:this.buildOpt()}),e},c.buildOpt=function(){for(var t={},e=Object.keys(this.options),n=0,r=e.length;n<r;++n){var i=e[n],o=this.options[e[n]];t[i]=o}return t},c.getOption=function(t){return void 0===t?this.options:void 0!==this.options[t]?this.options[t]:null},o.Namespace=u;var f=function(t,n,r,i,o){if(this.type=t,this.resolvedType=n,this.isMapKey=r,this.syntax=i,this.name=o,r&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},l=f.prototype;f.defaultFieldValue=n,l.toString=function(){return(this.name||"")+(this.isMapKey?"map":"value")+" element"},l.verifyValue=function(n){function i(t,e){throw Error("Illegal value for "+o.toString(!0)+" of type "+o.type.name+": "+t+" ("+e+")")}var o=this;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:return("number"!=typeof n||n===n&&n%1!=0)&&i(typeof n,"not an integer"),n>4294967295?0|n:n;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof n||n===n&&n%1!=0)&&i(typeof n,"not an integer"),n<0?n>>>0:n;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return r(n,!1)}catch(t){i(typeof n,t.message)}else i(typeof n,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return r(n,!0)}catch(t){i(typeof n,t.message)}else i(typeof n,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof n&&i(typeof n,"not a boolean"),n;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof n&&i(typeof n,"not a number"),n;case e.TYPES.string:return"string"==typeof n||n&&n instanceof String||i(typeof n,"not a string"),""+n;case e.TYPES.bytes:return t.isByteBuffer(n)?n:t.wrap(n,"base64");case e.TYPES.enum:var a=this.resolvedType.getChildren(e.Reflect.Enum.Value);for(u=0;u<a.length;u++){if(a[u].name==n)return a[u].id;if(a[u].id==n)return a[u].id}if("proto3"===this.syntax)return("number"!=typeof n||n===n&&n%1!=0)&&i(typeof n,"not an integer"),(n>4294967295||n<0)&&i(typeof n,"not in range for uint32"),n;i(n,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(n&&"object"==typeof n||i(typeof n,"object expected"),n instanceof this.resolvedType.clazz)return n;if(n instanceof e.Builder.Message){var s={};for(var u in n)n.hasOwnProperty(u)&&(s[u]=n[u]);n=s}return new this.resolvedType.clazz(n)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+n+" (undefined type "+this.type+")")},l.calculateLength=function(n,r){if(null===r)return 0;var i;switch(this.type){case e.TYPES.int32:return r<0?t.calculateVarint64(r):t.calculateVarint32(r);case e.TYPES.uint32:return t.calculateVarint32(r);case e.TYPES.sint32:return t.calculateVarint32(t.zigZagEncode32(r));case e.TYPES.fixed32:case e.TYPES.sfixed32:case e.TYPES.float:return 4;case e.TYPES.int64:case e.TYPES.uint64:return t.calculateVarint64(r);case e.TYPES.sint64:return t.calculateVarint64(t.zigZagEncode64(r));case e.TYPES.fixed64:case e.TYPES.sfixed64:return 8;case e.TYPES.bool:return 1;case e.TYPES.enum:return t.calculateVarint32(r);case e.TYPES.double:return 8;case e.TYPES.string:return i=t.calculateUTF8Bytes(r),t.calculateVarint32(i)+i;case e.TYPES.bytes:if(r.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+r.remaining()+" bytes remaining");return t.calculateVarint32(r.remaining())+r.remaining();case e.TYPES.message:return i=this.resolvedType.calculate(r),t.calculateVarint32(i)+i;case e.TYPES.group:return(i=this.resolvedType.calculate(r))+t.calculateVarint32(n<<3|e.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+r+" (unknown type)")},l.encodeValue=function(n,r,i){if(null===r)return i;switch(this.type){case e.TYPES.int32:r<0?i.writeVarint64(r):i.writeVarint32(r);break;case e.TYPES.uint32:i.writeVarint32(r);break;case e.TYPES.sint32:i.writeVarint32ZigZag(r);break;case e.TYPES.fixed32:i.writeUint32(r);break;case e.TYPES.sfixed32:i.writeInt32(r);break;case e.TYPES.int64:case e.TYPES.uint64:i.writeVarint64(r);break;case e.TYPES.sint64:i.writeVarint64ZigZag(r);break;case e.TYPES.fixed64:i.writeUint64(r);break;case e.TYPES.sfixed64:i.writeInt64(r);break;case e.TYPES.bool:"string"==typeof r?i.writeVarint32("false"===r.toLowerCase()?0:!!r):i.writeVarint32(r?1:0);break;case e.TYPES.enum:i.writeVarint32(r);break;case e.TYPES.float:i.writeFloat32(r);break;case e.TYPES.double:i.writeFloat64(r);break;case e.TYPES.string:i.writeVString(r);break;case e.TYPES.bytes:if(r.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+r.remaining()+" bytes remaining");var o=r.offset;i.writeVarint32(r.remaining()),i.append(r),r.offset=o;break;case e.TYPES.message:var a=(new t).LE();this.resolvedType.encode(r,a),i.writeVarint32(a.offset),i.append(a.flip());break;case e.TYPES.group:this.resolvedType.encode(r,i),i.writeVarint32(n<<3|e.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+r+" (unknown type)")}return i},l.decode=function(t,n,r){if(n!=this.type.wireType)throw Error("Unexpected wire type for element");var i,o;switch(this.type){case e.TYPES.int32:return 0|t.readVarint32();case e.TYPES.uint32:return t.readVarint32()>>>0;case e.TYPES.sint32:return 0|t.readVarint32ZigZag();case e.TYPES.fixed32:return t.readUint32()>>>0;case e.TYPES.sfixed32:return 0|t.readInt32();case e.TYPES.int64:return t.readVarint64();case e.TYPES.uint64:return t.readVarint64().toUnsigned();case e.TYPES.sint64:return t.readVarint64ZigZag();case e.TYPES.fixed64:return t.readUint64();case e.TYPES.sfixed64:return t.readInt64();case e.TYPES.bool:return!!t.readVarint32();case e.TYPES.enum:return t.readVarint32();case e.TYPES.float:return t.readFloat();case e.TYPES.double:return t.readDouble();case e.TYPES.string:return t.readVString();case e.TYPES.bytes:if(o=t.readVarint32(),t.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+t.remaining());return i=t.clone(),i.limit=i.offset+o,t.offset+=o,i;case e.TYPES.message:return o=t.readVarint32(),this.resolvedType.decode(t,o);case e.TYPES.group:return this.resolvedType.decode(t,-1,r)}throw Error("[INTERNAL] Illegal decode type")},l.valueFromString=function(n){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return this.verifyValue(parseInt(n));case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return this.verifyValue(n);case e.TYPES.bool:return"true"===n;case e.TYPES.string:return this.verifyValue(n);case e.TYPES.bytes:return t.fromBinary(n)}},l.valueToString=function(t){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===e.TYPES.bytes?t.toString("binary"):t.toString()},o.Element=f;var h=function(t,e,n,r,i,o){u.call(this,t,e,n,r,o),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},d=h.prototype=Object.create(u.prototype);d.build=function(n){if(this.clazz&&!n)return this.clazz;var r=function(e,n){function r(n,i,o,a){if(null===n||"object"!=typeof n){if(a&&a instanceof e.Reflect.Enum){var s=e.Reflect.Enum.getName(a.object,n);if(null!==s)return s}return n}if(t.isByteBuffer(n))return i?n.toBase64():n.toBuffer();if(e.Long.isLong(n))return o?n.toString():e.Long.fromValue(n);var u;if(Array.isArray(n))return u=[],n.forEach(function(t,e){u[e]=r(t,i,o,a)}),u;if(u={},n instanceof e.Map){for(var c=n.entries(),f=c.next();!f.done;f=c.next())u[n.keyElem.valueToString(f.value[0])]=r(f.value[1],i,o,n.valueElem.resolvedType);return u}var l=n.$type,h=void 0;for(var d in n)n.hasOwnProperty(d)&&(l&&(h=l.getChild(d))?u[d]=r(n[d],i,o,h.resolvedType):u[d]=r(n[d],i,o));return u}var i=n.getChildren(e.Reflect.Message.Field),o=n.getChildren(e.Reflect.Message.OneOf),a=function(r,s){e.Builder.Message.call(this);for(var u=0,c=o.length;u<c;++u)this[o[u].name]=null;for(u=0,c=i.length;u<c;++u){var f=i[u];this[f.name]=f.repeated?[]:f.map?new e.Map(f):null,!f.required&&"proto3"!==n.syntax||null===f.defaultValue||(this[f.name]=f.defaultValue)}if(arguments.length>0){var l;if(1!==arguments.length||null===r||"object"!=typeof r||!("function"!=typeof r.encode||r instanceof a)||Array.isArray(r)||r instanceof e.Map||t.isByteBuffer(r)||r instanceof ArrayBuffer||e.Long&&r instanceof e.Long)for(u=0,c=arguments.length;u<c;++u)void 0!==(l=arguments[u])&&this.$set(i[u].name,l);else this.$set(r)}},s=a.prototype=Object.create(e.Builder.Message.prototype);s.add=function(t,r,i){var o=n._fieldsByName[t];if(!i){if(!o)throw Error(this+"#"+t+" is undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+o.toString(!0));if(!o.repeated)throw Error(this+"#"+t+" is not a repeated field");r=o.verifyValue(r,!0)}return null===this[t]&&(this[t]=[]),this[t].push(r),this},s.$add=s.add,s.set=function(t,r,i){if(t&&"object"==typeof t){i=r;for(var o in t)t.hasOwnProperty(o)&&void 0!==(r=t[o])&&void 0===n._oneofsByName[o]&&this.$set(o,r,i);return this}var a=n._fieldsByName[t];if(i)this[t]=r;else{if(!a)throw Error(this+"#"+t+" is not a field: undefined");if(!(a instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+a.toString(!0));this[a.name]=r=a.verifyValue(r)}if(a&&a.oneof){var s=this[a.oneof.name];null!==r?(null!==s&&s!==a.name&&(this[s]=null),this[a.oneof.name]=a.name):s===t&&(this[a.oneof.name]=null)}return this},s.$set=s.set,s.get=function(t,r){if(r)return this[t];var i=n._fieldsByName[t];if(!(i&&i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: undefined");if(!(i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+i.toString(!0));return this[i.name]},s.$get=s.get;for(var u=0;u<i.length;u++){var c=i[u];c instanceof e.Reflect.Message.ExtensionField||n.builder.options.populateAccessors&&function(t){var e=t.originalName.replace(/(_[a-zA-Z])/g,function(t){return t.toUpperCase().replace("_","")});e=e.substring(0,1).toUpperCase()+e.substring(1);var r=t.originalName.replace(/([A-Z])/g,function(t){return"_"+t}),i=function(e,n){return this[t.name]=n?e:t.verifyValue(e),this},o=function(){return this[t.name]};null===n.getChild("set"+e)&&(s["set"+e]=i),null===n.getChild("set_"+r)&&(s["set_"+r]=i),null===n.getChild("get"+e)&&(s["get"+e]=o),null===n.getChild("get_"+r)&&(s["get_"+r]=o)}(c)}s.encode=function(e,r){"boolean"==typeof e&&(r=e,e=void 0);var i=!1;e||(e=new t,i=!0);var o=e.littleEndian;try{return n.encode(this,e.LE(),r),(i?e.flip():e).LE(o)}catch(t){throw e.LE(o),t}},a.encode=function(t,e,n){return new a(t).encode(e,n)},s.calculate=function(){return n.calculate(this)},s.encodeDelimited=function(e,r){var i=!1;e||(e=new t,i=!0);var o=(new t).LE();return n.encode(this,o,r).flip(),e.writeVarint32(o.remaining()),e.append(o),i?e.flip():e},s.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(t){throw t.encoded&&(t.encoded=t.encoded.toArrayBuffer()),t}},s.toArrayBuffer=s.encodeAB,s.encodeNB=function(){try{return this.encode().toBuffer()}catch(t){throw t.encoded&&(t.encoded=t.encoded.toBuffer()),t}},s.toBuffer=s.encodeNB,s.encode64=function(){try{return this.encode().toBase64()}catch(t){throw t.encoded&&(t.encoded=t.encoded.toBase64()),t}},s.toBase64=s.encode64,s.encodeHex=function(){try{return this.encode().toHex()}catch(t){throw t.encoded&&(t.encoded=t.encoded.toHex()),t}},s.toHex=s.encodeHex,s.toRaw=function(t,e){return r(this,!!t,!!e,this.$type)},s.encodeJSON=function(){return JSON.stringify(r(this,!0,!0,this.$type))},a.decode=function(e,r,i){"string"==typeof r&&(i=r,r=-1),"string"==typeof e?e=t.wrap(e,i||"base64"):t.isByteBuffer(e)||(e=t.wrap(e));var o=e.littleEndian;try{var a=n.decode(e.LE(),r);return e.LE(o),a}catch(t){throw e.LE(o),t}},a.decodeDelimited=function(e,r){if("string"==typeof e?e=t.wrap(e,r||"base64"):t.isByteBuffer(e)||(e=t.wrap(e)),e.remaining()<1)return null;var i=e.offset,o=e.readVarint32();if(e.remaining()<o)return e.offset=i,null;try{var a=n.decode(e.slice(e.offset,e.offset+o).LE());return e.offset+=o,a}catch(t){throw e.offset+=o,t}},a.decode64=function(t){return a.decode(t,"base64")},a.decodeHex=function(t){return a.decode(t,"hex")},a.decodeJSON=function(t){return new a(JSON.parse(t))},s.toString=function(){return n.toString()};return Object.defineProperty&&(Object.defineProperty(a,"$options",{value:n.buildOpt()}),Object.defineProperty(s,"$options",{value:a.$options}),Object.defineProperty(a,"$type",{value:n}),Object.defineProperty(s,"$type",{value:n})),a}(e,this);this._fields=[],this._fieldsById={},this._fieldsByName={},this._oneofsByName={};for(var i,o=0,a=this.children.length;o<a;o++)if((i=this.children[o])instanceof y||i instanceof h||i instanceof w){if(r.hasOwnProperty(i.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+i.toString(!0)+" cannot override static property '"+i.name+"'");r[i.name]=i.build()}else if(i instanceof h.Field)i.build(),this._fields.push(i),this._fieldsById[i.id]=i,this._fieldsByName[i.name]=i;else if(i instanceof h.OneOf)this._oneofsByName[i.name]=i;else if(!(i instanceof h.OneOf||i instanceof _))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[o].toString(!0));return this.clazz=r},d.encode=function(t,e,n){for(var r,i,o=null,a=0,s=this._fields.length;a<s;++a)r=this._fields[a],i=t[r.name],r.required&&null===i?null===o&&(o=r):r.encode(n?i:r.verifyValue(i),e,t);if(null!==o){var u=Error("Missing at least one required field for "+this.toString(!0)+": "+o);throw u.encoded=e,u}return e},d.calculate=function(t){for(var e,n,r=0,i=0,o=this._fields.length;i<o;++i){if(e=this._fields[i],n=t[e.name],e.required&&null===n)throw Error("Missing at least one required field for "+this.toString(!0)+": "+e);r+=e.calculate(n,t)}return r},d.decode=function(t,n,r){"number"!=typeof n&&(n=-1);for(var o,a,s,u,c=t.offset,f=new this.clazz;t.offset<c+n||-1===n&&t.remaining()>0;){if(o=t.readVarint32(),a=7&o,s=o>>>3,a===e.WIRE_TYPES.ENDGROUP){if(s!==r)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+s+" ("+(r?r+" expected":"not a group")+")");break}if(u=this._fieldsById[s]){if(u.repeated&&!u.options.packed)f[u.name].push(u.decode(a,t));else if(u.map){var l=u.decode(a,t);f[u.name].set(l[0],l[1])}else if(f[u.name]=u.decode(a,t),u.oneof){var h=f[u.oneof.name];null!==h&&h!==u.name&&(f[h]=null),f[u.oneof.name]=u.name}}else switch(a){case e.WIRE_TYPES.VARINT:t.readVarint32();break;case e.WIRE_TYPES.BITS32:t.offset+=4;break;case e.WIRE_TYPES.BITS64:t.offset+=8;break;case e.WIRE_TYPES.LDELIM:var d=t.readVarint32();t.offset+=d;break;case e.WIRE_TYPES.STARTGROUP:for(;i(s,t););break;default:throw Error("Illegal wire type for unknown field "+s+" in "+this.toString(!0)+"#decode: "+a)}}for(var p=0,v=this._fields.length;p<v;++p)if(u=this._fields[p],null===f[u.name])if("proto3"===this.syntax)f[u.name]=u.defaultValue;else{if(u.required){var g=Error("Missing at least one required field for "+this.toString(!0)+": "+u.name);throw g.decoded=f,g}e.populateDefaults&&null!==u.defaultValue&&(f[u.name]=u.defaultValue)}return f},o.Message=h;var p=function(t,n,r,i,o,s,u,c,f,l){a.call(this,t,n,s),this.className="Message.Field",this.required="required"===r,this.repeated="repeated"===r,this.map="map"===r,this.keyType=i||null,this.type=o,this.resolvedType=null,this.id=u,this.options=c||{},this.defaultValue=null,this.oneof=f||null,this.syntax=l||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof h.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},v=p.prototype=Object.create(a.prototype);v.build=function(){this.element=new f(this.type,this.resolvedType,!1,this.syntax,this.name),this.map&&(this.keyElement=new f(this.keyType,void 0,!0,this.syntax,this.name)),"proto3"!==this.syntax||this.repeated||this.map?void 0!==this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=f.defaultFieldValue(this.type)},v.verifyValue=function(t,n){function r(t,e){throw Error("Illegal value for "+i.toString(!0)+" of type "+i.type.name+": "+t+" ("+e+")")}n=n||!1;var i=this;if(null===t)return this.required&&r(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&r(typeof t,"proto3 field without field presence cannot be null"),null;var o;if(this.repeated&&!n){Array.isArray(t)||(t=[t]);var a=[];for(o=0;o<t.length;o++)a.push(this.element.verifyValue(t[o]));return a}return this.map&&!n?t instanceof e.Map?t:(t instanceof Object||r(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&r(typeof t,"no array expected"),this.element.verifyValue(t))},v.hasWirePresence=function(t,n){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&n[this.oneof.name]===this.name)return!0;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return 0!==t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return 0!==t.low||0!==t.high;case e.TYPES.bool:return t;case e.TYPES.float:case e.TYPES.double:return 0!==t;case e.TYPES.string:return t.length>0;case e.TYPES.bytes:return t.remaining()>0;case e.TYPES.enum:return 0!==t;case e.TYPES.message:return null!==t;default:return!0}},v.encode=function(n,r,i){if(null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===n||this.repeated&&0==n.length)return r;try{if(this.repeated){var o;if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){r.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),r.ensureCapacity(r.offset+=1);var a=r.offset;for(o=0;o<n.length;o++)this.element.encodeValue(this.id,n[o],r);var s=r.offset-a,u=t.calculateVarint32(s);if(u>1){var c=r.slice(a,r.offset);a+=u-1,r.offset=a,r.append(c)}r.writeVarint32(s,a-u)}else for(o=0;o<n.length;o++)r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,n[o],r)}else this.map?n.forEach(function(n,i,o){var a=t.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,i)+t.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,n);r.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),r.writeVarint32(a),r.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,i,r),r.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,n,r)},this):this.hasWirePresence(n,i)&&(r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,n,r))}catch(t){throw Error("Illegal value for "+this.toString(!0)+": "+n+" ("+t+")")}return r},v.calculate=function(n,r){if(n=this.verifyValue(n),null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===n||this.repeated&&0==n.length)return 0;var i=0;try{if(this.repeated){var o,a;if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(i+=t.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),a=0,o=0;o<n.length;o++)a+=this.element.calculateLength(this.id,n[o]);i+=t.calculateVarint32(a),i+=a}else for(o=0;o<n.length;o++)i+=t.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,n[o])}else this.map?n.forEach(function(n,r,o){var a=t.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,r)+t.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,n);i+=t.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),i+=t.calculateVarint32(a),i+=a},this):this.hasWirePresence(n,r)&&(i+=t.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,n))}catch(t){throw Error("Illegal value for "+this.toString(!0)+": "+n+" ("+t+")")}return i},v.decode=function(t,n,r){var i,o;if(!(!this.map&&t==this.type.wireType||!r&&this.repeated&&this.options.packed&&t==e.WIRE_TYPES.LDELIM||this.map&&t==e.WIRE_TYPES.LDELIM))throw Error("Illegal wire type for field "+this.toString(!0)+": "+t+" ("+this.type.wireType+" expected)");if(t==e.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!r){o=n.readVarint32(),o=n.offset+o;for(var a=[];n.offset<o;)a.push(this.decode(this.type.wireType,n,!0));return a}if(this.map){var s=f.defaultFieldValue(this.keyType);if(i=f.defaultFieldValue(this.type),o=n.readVarint32(),n.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+n.remaining());var u=n.clone();for(u.limit=u.offset+o,n.offset+=o;u.remaining()>0;){var c=u.readVarint32();t=7&c;var l=c>>>3;if(1===l)s=this.keyElement.decode(u,t,l);else{if(2!==l)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(u,t,l)}}return[s,i]}return this.element.decode(n,t,this.id)},o.Message.Field=p;var g=function(t,e,n,r,i,o,a){p.call(this,t,e,n,null,r,i,o,a),this.extension};g.prototype=Object.create(p.prototype),o.Message.ExtensionField=g;var m=function(t,e,n){a.call(this,t,e,n),this.fields=[]};o.Message.OneOf=m;var y=function(t,e,n,r,i){u.call(this,t,e,n,r,i),this.className="Enum",this.object=null};y.getName=function(t,e){for(var n,r=Object.keys(t),i=0;i<r.length;++i)if(t[n=r[i]]===e)return n;return null},(y.prototype=Object.create(u.prototype)).build=function(t){if(this.object&&!t)return this.object;for(var n=new e.Builder.Enum,r=this.getChildren(y.Value),i=0,o=r.length;i<o;++i)n[r[i].name]=r[i].id;return Object.defineProperty&&Object.defineProperty(n,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=n},o.Enum=y;var b=function(t,e,n,r){a.call(this,t,e,n),this.className="Enum.Value",this.id=r};b.prototype=Object.create(a.prototype),o.Enum.Value=b;var _=function(t,e,n,r){a.call(this,t,e,n),this.field=r};_.prototype=Object.create(a.prototype),o.Extension=_;var w=function(t,e,n,r){u.call(this,t,e,n,r),this.className="Service",this.clazz=null};(w.prototype=Object.create(u.prototype)).build=function(n){return this.clazz&&!n?this.clazz:this.clazz=function(e,n){for(var r=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(t,e,n){setTimeout(n.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},i=r.prototype=Object.create(e.Builder.Service.prototype),o=n.getChildren(e.Reflect.Service.RPCMethod),a=0;a<o.length;a++)!function(e){i[e.name]=function(r,i){try{try{r=e.resolvedRequestType.clazz.decode(t.wrap(r))}catch(t){if(!(t instanceof TypeError))throw t}if(null===r||"object"!=typeof r)throw Error("Illegal arguments");r instanceof e.resolvedRequestType.clazz||(r=new e.resolvedRequestType.clazz(r)),this.rpcImpl(e.fqn(),r,function(t,r){if(t)return void i(t);null===r&&(r="");try{r=e.resolvedResponseType.clazz.decode(r)}catch(t){}if(!(r&&r instanceof e.resolvedResponseType.clazz))return void i(Error("Illegal response type received in service method "+n.name+"#"+e.name));i(null,r)})}catch(t){setTimeout(i.bind(this,t),0)}},r[e.name]=function(t,n,i){new r(t)[e.name](n,i)},Object.defineProperty&&(Object.defineProperty(r[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(i[e.name],"$options",{value:r[e.name].$options}))}(o[a]);return Object.defineProperty&&(Object.defineProperty(r,"$options",{value:n.buildOpt()}),Object.defineProperty(i,"$options",{value:r.$options}),Object.defineProperty(r,"$type",{value:n}),Object.defineProperty(i,"$type",{value:n})),r}(e,this)},o.Service=w;var E=function(t,e,n,r){a.call(this,t,e,n),this.className="Service.Method",this.options=r||{}};(E.prototype=Object.create(a.prototype)).buildOpt=c.buildOpt,o.Service.Method=E;var O=function(t,e,n,r,i,o,a,s){E.call(this,t,e,n,s),this.className="Service.RPCMethod",this.requestName=r,this.responseName=i,this.requestStream=o,this.responseStream=a,this.resolvedRequestType=null,this.resolvedResponseType=null};return O.prototype=Object.create(E.prototype),o.Service.RPCMethod=O,o}(r),r.Builder=function(t,e,r){function i(t){t.messages&&t.messages.forEach(function(e){e.syntax=t.syntax,i(e)}),t.enums&&t.enums.forEach(function(e){e.syntax=t.syntax})}var o=function(t){this.ns=new r.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=t||{}},a=o.prototype;return o.isMessage=function(t){return"string"==typeof t.name&&(void 0===t.values&&void 0===t.rpc)},o.isMessageField=function(t){return"string"==typeof t.rule&&"string"==typeof t.name&&"string"==typeof t.type&&void 0!==t.id},o.isEnum=function(t){return"string"==typeof t.name&&!(void 0===t.values||!Array.isArray(t.values)||0===t.values.length)},o.isService=function(t){return!("string"!=typeof t.name||"object"!=typeof t.rpc||!t.rpc)},o.isExtend=function(t){return"string"==typeof t.ref},a.reset=function(){return this.ptr=this.ns,this},a.define=function(t){if("string"!=typeof t||!e.TYPEREF.test(t))throw Error("illegal namespace: "+t);return t.split(".").forEach(function(t){var e=this.ptr.getChild(t);null===e&&this.ptr.addChild(e=new r.Namespace(this,this.ptr,t)),this.ptr=e},this),this},a.create=function(e){if(!e)return this;if(Array.isArray(e)){if(0===e.length)return this;e=e.slice()}else e=[e];for(var n=[e];n.length>0;){if(e=n.pop(),!Array.isArray(e))throw Error("not a valid namespace: "+JSON.stringify(e));for(;e.length>0;){var i=e.shift();if(o.isMessage(i)){var a=new r.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax),s={};i.oneofs&&Object.keys(i.oneofs).forEach(function(t){a.addChild(s[t]=new r.Message.OneOf(this,a,t))},this),i.fields&&i.fields.forEach(function(t){if(null!==a.getChild(0|t.id))throw Error("duplicate or invalid field id in "+a.name+": "+t.id);if(t.options&&"object"!=typeof t.options)throw Error("illegal field options in "+a.name+"#"+t.name);var e=null;if("string"==typeof t.oneof&&!(e=s[t.oneof]))throw Error("illegal oneof in "+a.name+"#"+t.name+": "+t.oneof);t=new r.Message.Field(this,a,t.rule,t.keytype,t.type,t.name,t.id,t.options,e,i.syntax),e&&e.fields.push(t),a.addChild(t)},this);var u=[];if(i.enums&&i.enums.forEach(function(t){u.push(t)}),i.messages&&i.messages.forEach(function(t){u.push(t)}),i.services&&i.services.forEach(function(t){u.push(t)}),i.extensions&&("number"==typeof i.extensions[0]?a.extensions=[i.extensions]:a.extensions=i.extensions),this.ptr.addChild(a),u.length>0){n.push(e),e=u,u=null,this.ptr=a,a=null;continue}u=null}else if(o.isEnum(i))a=new r.Enum(this,this.ptr,i.name,i.options,i.syntax),i.values.forEach(function(t){a.addChild(new r.Enum.Value(this,a,t.name,t.id))},this),this.ptr.addChild(a);else if(o.isService(i))a=new r.Service(this,this.ptr,i.name,i.options),Object.keys(i.rpc).forEach(function(t){var e=i.rpc[t];a.addChild(new r.Service.RPCMethod(this,a,t,e.request,e.response,!!e.request_stream,!!e.response_stream,e.options))},this),this.ptr.addChild(a);else{if(!o.isExtend(i))throw Error("not a valid definition: "+JSON.stringify(i));if(a=this.ptr.resolve(i.ref,!0))i.fields.forEach(function(e){if(null!==a.getChild(0|e.id))throw Error("duplicate extended field id in "+a.name+": "+e.id);if(a.extensions){var n=!1;if(a.extensions.forEach(function(t){e.id>=t[0]&&e.id<=t[1]&&(n=!0)}),!n)throw Error("illegal extended field id in "+a.name+": "+e.id+" (not within valid ranges)")}var i=e.name;this.options.convertFieldsToCamelCase&&(i=t.Util.toCamelCase(i));var o=new r.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn()+"."+i,e.id,e.options),s=new r.Extension(this,this.ptr,e.name,o);o.extension=s,this.ptr.addChild(s),a.addChild(o)},this);else if(!/\.?google\.protobuf\./.test(i.ref))throw Error("extended message "+i.ref+" is not defined")}i=null,a=null}e=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},a.import=function(e,r){var o="/";if("string"==typeof r){if(t.Util.IS_NODE&&(r=n(116).resolve(r)),!0===this.files[r])return this.reset();this.files[r]=!0}else if("object"==typeof r){var a=r.root;t.Util.IS_NODE&&(a=n(116).resolve(a)),(a.indexOf("\\")>=0||r.file.indexOf("\\")>=0)&&(o="\\");var s;if(s=t.Util.IS_NODE?n(116).join(a,r.file):a+o+r.file,!0===this.files[s])return this.reset();this.files[s]=!0}if(e.imports&&e.imports.length>0){var u,c=!1;"object"==typeof r?(this.importRoot=r.root,c=!0,u=this.importRoot,r=r.file,(u.indexOf("\\")>=0||r.indexOf("\\")>=0)&&(o="\\")):"string"==typeof r?this.importRoot?u=this.importRoot:r.indexOf("/")>=0?""===(u=r.replace(/\/[^\/]*$/,""))&&(u="/"):r.indexOf("\\")>=0?(u=r.replace(/\\[^\\]*$/,""),o="\\"):u=".":u=null;for(var f=0;f<e.imports.length;f++)if("string"==typeof e.imports[f]){if(!u)throw Error("cannot determine import root");var l=e.imports[f];if("google/protobuf/descriptor.proto"===l)continue;if(l=t.Util.IS_NODE?n(116).join(u,l):u+o+l,!0===this.files[l])continue;/\.proto$/i.test(l)&&!t.DotProto&&(l=l.replace(/\.proto$/,".json"));var h=t.Util.fetch(l);if(null===h)throw Error("failed to import '"+l+"' in '"+r+"': file not found");/\.json$/i.test(l)?this.import(JSON.parse(h+""),l):this.import(t.DotProto.Parser.parse(h),l)}else r?/\.(\w+)$/.test(r)?this.import(e.imports[f],r.replace(/^(.+)\.(\w+)$/,function(t,e,n){return e+"_import"+f+"."+n})):this.import(e.imports[f],r+"_import"+f):this.import(e.imports[f]);c&&(this.importRoot=null)}e.package&&this.define(e.package),e.syntax&&i(e);var d=this.ptr;return e.options&&Object.keys(e.options).forEach(function(t){d.options[t]=e.options[t]}),e.messages&&(this.create(e.messages),this.ptr=d),e.enums&&(this.create(e.enums),this.ptr=d),e.services&&(this.create(e.services),this.ptr=d),e.extends&&this.create(e.extends),this.reset()},a.resolveAll=function(){var n;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof r.Namespace)this.ptr.children.forEach(function(t){this.ptr=t,this.resolveAll()},this);else if(this.ptr instanceof r.Message.Field){if(e.TYPE.test(this.ptr.type))this.ptr.type=t.TYPES[this.ptr.type];else{if(!e.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(!(n=(this.ptr instanceof r.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0)))throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=n,n instanceof r.Enum){if(this.ptr.type=t.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==n.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(n instanceof r.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=n.isGroup?t.TYPES.group:t.TYPES.message}}if(this.ptr.map){if(!e.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=t.TYPES[this.ptr.keyType]}"proto3"===this.ptr.syntax&&this.ptr.repeated&&void 0===this.ptr.options.packed&&-1!==t.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType)&&(this.ptr.options.packed=!0)}else if(this.ptr instanceof t.Reflect.Service.Method){if(!(this.ptr instanceof t.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(!((n=this.ptr.parent.resolve(this.ptr.requestName,!0))&&n instanceof t.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=n,!((n=this.ptr.parent.resolve(this.ptr.responseName,!0))&&n instanceof t.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=n}else if(!(this.ptr instanceof t.Reflect.Message.OneOf||this.ptr instanceof t.Reflect.Extension||this.ptr instanceof t.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()},a.build=function(t){if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!t)return this.result;for(var e="string"==typeof t?t.split("."):t,n=this.result,r=0;r<e.length;r++){if(!n[e[r]]){n=null;break}n=n[e[r]]}return n},a.lookup=function(t,e){return t?this.ns.resolve(t,e):this.ns},a.toString=function(){return"Builder"},o.Message=function(){},o.Enum=function(){},o.Service=function(){},o}(r,r.Lang,r.Reflect),r.Map=function(t,e){function n(t){var e=0;return{next:function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}}var r=function(t,n){if(!t.map)throw Error("field is not a map");if(this.field=t,this.keyElem=new e.Element(t.keyType,null,!0,t.syntax),this.valueElem=new e.Element(t.type,t.resolvedType,!1,t.syntax),this.map={},Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}}),n)for(var r=Object.keys(n),i=0;i<r.length;i++){var o=this.keyElem.valueFromString(r[i]),a=this.valueElem.verifyValue(n[r[i]]);this.map[this.keyElem.valueToString(o)]={key:o,value:a}}},i=r.prototype;return i.clear=function(){this.map={}},i.delete=function(t){var e=this.keyElem.valueToString(this.keyElem.verifyValue(t)),n=e in this.map;return delete this.map[e],n},i.entries=function(){for(var t,e=[],r=Object.keys(this.map),i=0;i<r.length;i++)e.push([(t=this.map[r[i]]).key,t.value]);return n(e)},i.keys=function(){for(var t=[],e=Object.keys(this.map),r=0;r<e.length;r++)t.push(this.map[e[r]].key);return n(t)},i.values=function(){for(var t=[],e=Object.keys(this.map),r=0;r<e.length;r++)t.push(this.map[e[r]].value);return n(t)},i.forEach=function(t,e){for(var n,r=Object.keys(this.map),i=0;i<r.length;i++)t.call(e,(n=this.map[r[i]]).value,n.key,this)},i.set=function(t,e){var n=this.keyElem.verifyValue(t),r=this.valueElem.verifyValue(e);return this.map[this.keyElem.valueToString(n)]={key:n,value:r},this},i.get=function(t){var e=this.keyElem.valueToString(this.keyElem.verifyValue(t));if(e in this.map)return this.map[e].value},i.has=function(t){return this.keyElem.valueToString(this.keyElem.verifyValue(t))in this.map},r}(0,r.Reflect),r.newBuilder=function(t){return t=t||{},void 0===t.convertFieldsToCamelCase&&(t.convertFieldsToCamelCase=r.convertFieldsToCamelCase),void 0===t.populateAccessors&&(t.populateAccessors=r.populateAccessors),new r.Builder(t)},r.loadJson=function(t,e,n){return("string"==typeof e||e&&"string"==typeof e.file&&"string"==typeof e.root)&&(n=e,e=null),e&&"object"==typeof e||(e=r.newBuilder()),"string"==typeof t&&(t=JSON.parse(t)),e.import(t,n),e.resolveAll(),e},r.loadJsonFile=function(t,e,n){if(e&&"object"==typeof e?(n=e,e=null):e&&"function"==typeof e||(e=null),e)return r.Util.fetch("string"==typeof t?t:t.root+"/"+t.file,function(i){if(null===i)return void e(Error("Failed to fetch file"));try{e(null,r.loadJson(JSON.parse(i),n,t))}catch(t){e(t)}});var i=r.Util.fetch("object"==typeof t?t.root+"/"+t.file:t);return null===i?null:r.loadJson(JSON.parse(i),n,t)},r})},function(t,e,n){var r,i,o;/**
13 * @license bytebuffer.js (c) 2015 Daniel Wirtz <dcode@dcode.io>
14 * Backing buffer: ArrayBuffer, Accessor: Uint8Array
15 * Released under the Apache License, Version 2.0
16 * see: https://github.com/dcodeIO/bytebuffer.js for details
17 */
18!function(a,s){i=[n(605)],r=s,void 0!==(o="function"==typeof r?r.apply(e,i):r)&&(t.exports=o)}(0,function(t){"use strict";function e(t){var e=0;return function(){return e<t.length?t.charCodeAt(e++):null}}function n(){var t=[],e=[];return function(){if(0===arguments.length)return e.join("")+u.apply(String,t);t.length+arguments.length>1024&&(e.push(u.apply(String,t)),t.length=0),Array.prototype.push.apply(t,arguments)}}function r(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,f=-7,l=n?i-1:0,h=n?-1:1,d=t[e+l];for(l+=h,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+t[e+l],l+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=r;f>0;a=256*a+t[e+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),o-=c}return(d?-1:1)*a*Math.pow(2,o-r)}function i(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+l>=1?h/u:h*Math.pow(2,1-l),e*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(e*u-1)*Math.pow(2,i),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[n+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[n+d]=255&a,d+=p,a/=256,c-=8);t[n+d-p]|=128*v}var o=function(t,e,n){if(void 0===t&&(t=o.DEFAULT_CAPACITY),void 0===e&&(e=o.DEFAULT_ENDIAN),void 0===n&&(n=o.DEFAULT_NOASSERT),!n){if((t|=0)<0)throw RangeError("Illegal capacity");e=!!e,n=!!n}this.buffer=0===t?s:new ArrayBuffer(t),this.view=0===t?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=t,this.littleEndian=e,this.noAssert=n};o.VERSION="5.0.1",o.LITTLE_ENDIAN=!0,o.BIG_ENDIAN=!1,o.DEFAULT_CAPACITY=16,o.DEFAULT_ENDIAN=o.BIG_ENDIAN,o.DEFAULT_NOASSERT=!1,o.Long=t||null;var a=o.prototype;a.__isByteBuffer__,Object.defineProperty(a,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var s=new ArrayBuffer(0),u=String.fromCharCode;o.accessor=function(){return Uint8Array},o.allocate=function(t,e,n){return new o(t,e,n)},o.concat=function(t,e,n,r){"boolean"!=typeof e&&"string"==typeof e||(r=n,n=e,e=void 0);for(var i,a=0,s=0,u=t.length;s<u;++s)o.isByteBuffer(t[s])||(t[s]=o.wrap(t[s],e)),(i=t[s].limit-t[s].offset)>0&&(a+=i);if(0===a)return new o(0,n,r);var c,f=new o(a,n,r);for(s=0;s<u;)c=t[s++],(i=c.limit-c.offset)<=0||(f.view.set(c.view.subarray(c.offset,c.limit),f.offset),f.offset+=i);return f.limit=f.offset,f.offset=0,f},o.isByteBuffer=function(t){return!0===(t&&t.__isByteBuffer__)},o.type=function(){return ArrayBuffer},o.wrap=function(t,e,n,r){if("string"!=typeof e&&(r=n,n=e,e=void 0),"string"==typeof t)switch(void 0===e&&(e="utf8"),e){case"base64":return o.fromBase64(t,n);case"hex":return o.fromHex(t,n);case"binary":return o.fromBinary(t,n);case"utf8":return o.fromUTF8(t,n);case"debug":return o.fromDebug(t,n);default:throw Error("Unsupported encoding: "+e)}if(null===t||"object"!=typeof t)throw TypeError("Illegal buffer");var i;if(o.isByteBuffer(t))return i=a.clone.call(t),i.markedOffset=-1,i;if(t instanceof Uint8Array)i=new o(0,n,r),t.length>0&&(i.buffer=t.buffer,i.offset=t.byteOffset,i.limit=t.byteOffset+t.byteLength,i.view=new Uint8Array(t.buffer));else if(t instanceof ArrayBuffer)i=new o(0,n,r),t.byteLength>0&&(i.buffer=t,i.offset=0,i.limit=t.byteLength,i.view=t.byteLength>0?new Uint8Array(t):null);else{if("[object Array]"!==Object.prototype.toString.call(t))throw TypeError("Illegal buffer");i=new o(t.length,n,r),i.limit=t.length;for(var s=0;s<t.length;++s)i.view[s]=t[s]}return i},a.writeBitSet=function(t,e){var n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if(!(t instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var r,i=e,o=t.length,a=o>>3,s=0;for(e+=this.writeVarint32(o,e);a--;)r=1&!!t[s++]|(1&!!t[s++])<<1|(1&!!t[s++])<<2|(1&!!t[s++])<<3|(1&!!t[s++])<<4|(1&!!t[s++])<<5|(1&!!t[s++])<<6|(1&!!t[s++])<<7,this.writeByte(r,e++);if(s<o){var u=0;for(r=0;s<o;)r|=(1&!!t[s++])<<u++;this.writeByte(r,e++)}return n?(this.offset=e,this):e-i},a.readBitSet=function(t){var e=void 0===t;e&&(t=this.offset);var n,r=this.readVarint32(t),i=r.value,o=i>>3,a=0,s=[];for(t+=r.length;o--;)n=this.readByte(t++),s[a++]=!!(1&n),s[a++]=!!(2&n),s[a++]=!!(4&n),s[a++]=!!(8&n),s[a++]=!!(16&n),s[a++]=!!(32&n),s[a++]=!!(64&n),s[a++]=!!(128&n);if(a<i){var u=0;for(n=this.readByte(t++);a<i;)s[a++]=!!(n>>u++&1)}return e&&(this.offset=t),s},a.readBytes=function(t,e){var n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+t>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+t+") <= "+this.buffer.byteLength)}var r=this.slice(e,e+t);return n&&(this.offset+=t),r},a.writeBytes=a.append,a.writeInt8=function(t,e){var n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=1;var r=this.buffer.byteLength;return e>r&&this.resize((r*=2)>e?r:e),e-=1,this.view[e]=t,n&&(this.offset+=1),this},a.writeByte=a.writeInt8,a.readInt8=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var n=this.view[t];return 128==(128&n)&&(n=-(255-n+1)),e&&(this.offset+=1),n},a.readByte=a.readInt8,a.writeUint8=function(t,e){var n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=1;var r=this.buffer.byteLength;return e>r&&this.resize((r*=2)>e?r:e),e-=1,this.view[e]=t,n&&(this.offset+=1),this},a.writeUInt8=a.writeUint8,a.readUint8=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var n=this.view[t];return e&&(this.offset+=1),n},a.readUInt8=a.readUint8,a.writeInt16=function(t,e){var n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=2;var r=this.buffer.byteLength;return e>r&&this.resize((r*=2)>e?r:e),e-=2,this.littleEndian?(this.view[e+1]=(65280&t)>>>8,this.view[e]=255&t):(this.view[e]=(65280&t)>>>8,this.view[e+1]=255&t),n&&(this.offset+=2),this},a.writeShort=a.writeInt16,a.readInt16=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+2) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[t],n|=this.view[t+1]<<8):(n=this.view[t]<<8,n|=this.view[t+1]),32768==(32768&n)&&(n=-(65535-n+1)),e&&(this.offset+=2),n},a.readShort=a.readInt16,a.writeUint16=function(t,e){var n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=2;var r=this.buffer.byteLength;return e>r&&this.resize((r*=2)>e?r:e),e-=2,this.littleEndian?(this.view[e+1]=(65280&t)>>>8,this.view[e]=255&t):(this.view[e]=(65280&t)>>>8,this.view[e+1]=255&t),n&&(this.offset+=2),this},a.writeUInt16=a.writeUint16,a.readUint16=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+2) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[t],n|=this.view[t+1]<<8):(n=this.view[t]<<8,n|=this.view[t+1]),e&&(this.offset+=2),n},a.readUInt16=a.readUint16,a.writeInt32=function(t,e){var n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=4;var r=this.buffer.byteLength;return e>r&&this.resize((r*=2)>e?r:e),e-=4,this.littleEndian?(this.view[e+3]=t>>>24&255,this.view[e+2]=t>>>16&255,this.view[e+1]=t>>>8&255,this.view[e]=255&t):(this.view[e]=t>>>24&255,this.view[e+1]=t>>>16&255,this.view[e+2]=t>>>8&255,this.view[e+3]=255&t),n&&(this.offset+=4),this},a.writeInt=a.writeInt32,a.readInt32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0):(n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0),n|=0,e&&(this.offset+=4),n},a.readInt=a.readInt32,a.writeUint32=function(t,e){var n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=4;var r=this.buffer.byteLength;return e>r&&this.resize((r*=2)>e?r:e),e-=4,this.littleEndian?(this.view[e+3]=t>>>24&255,this.view[e+2]=t>>>16&255,this.view[e+1]=t>>>8&255,this.view[e]=255&t):(this.view[e]=t>>>24&255,this.view[e+1]=t>>>16&255,this.view[e+2]=t>>>8&255,this.view[e+3]=255&t),n&&(this.offset+=4),this},a.writeUInt32=a.writeUint32,a.readUint32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0):(n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0),e&&(this.offset+=4),n},a.readUInt32=a.readUint32,t&&(a.writeInt64=function(e,n){var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"==typeof e)e=t.fromNumber(e);else if("string"==typeof e)e=t.fromString(e);else if(!(e&&e instanceof t))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=t.fromNumber(e):"string"==typeof e&&(e=t.fromString(e)),n+=8;var i=this.buffer.byteLength;n>i&&this.resize((i*=2)>n?i:n),n-=8;var o=e.low,a=e.high;return this.littleEndian?(this.view[n+3]=o>>>24&255,this.view[n+2]=o>>>16&255,this.view[n+1]=o>>>8&255,this.view[n]=255&o,n+=4,this.view[n+3]=a>>>24&255,this.view[n+2]=a>>>16&255,this.view[n+1]=a>>>8&255,this.view[n]=255&a):(this.view[n]=a>>>24&255,this.view[n+1]=a>>>16&255,this.view[n+2]=a>>>8&255,this.view[n+3]=255&a,n+=4,this.view[n]=o>>>24&255,this.view[n+1]=o>>>16&255,this.view[n+2]=o>>>8&255,this.view[n+3]=255&o),r&&(this.offset+=8),this},a.writeLong=a.writeInt64,a.readInt64=function(e){var n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var r=0,i=0;this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0,e+=4,i=this.view[e+2]<<16,i|=this.view[e+1]<<8,i|=this.view[e],i+=this.view[e+3]<<24>>>0):(i=this.view[e+1]<<16,i|=this.view[e+2]<<8,i|=this.view[e+3],i+=this.view[e]<<24>>>0,e+=4,r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0);var o=new t(r,i,!1);return n&&(this.offset+=8),o},a.readLong=a.readInt64,a.writeUint64=function(e,n){var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"==typeof e)e=t.fromNumber(e);else if("string"==typeof e)e=t.fromString(e);else if(!(e&&e instanceof t))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=t.fromNumber(e):"string"==typeof e&&(e=t.fromString(e)),n+=8;var i=this.buffer.byteLength;n>i&&this.resize((i*=2)>n?i:n),n-=8;var o=e.low,a=e.high;return this.littleEndian?(this.view[n+3]=o>>>24&255,this.view[n+2]=o>>>16&255,this.view[n+1]=o>>>8&255,this.view[n]=255&o,n+=4,this.view[n+3]=a>>>24&255,this.view[n+2]=a>>>16&255,this.view[n+1]=a>>>8&255,this.view[n]=255&a):(this.view[n]=a>>>24&255,this.view[n+1]=a>>>16&255,this.view[n+2]=a>>>8&255,this.view[n+3]=255&a,n+=4,this.view[n]=o>>>24&255,this.view[n+1]=o>>>16&255,this.view[n+2]=o>>>8&255,this.view[n+3]=255&o),r&&(this.offset+=8),this},a.writeUInt64=a.writeUint64,a.readUint64=function(e){var n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var r=0,i=0;this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0,e+=4,i=this.view[e+2]<<16,i|=this.view[e+1]<<8,i|=this.view[e],i+=this.view[e+3]<<24>>>0):(i=this.view[e+1]<<16,i|=this.view[e+2]<<8,i|=this.view[e+3],i+=this.view[e]<<24>>>0,e+=4,r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0);var o=new t(r,i,!0);return n&&(this.offset+=8),o},a.readUInt64=a.readUint64),a.writeFloat32=function(t,e){var n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof t)throw TypeError("Illegal value: "+t+" (not a number)");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=4;var r=this.buffer.byteLength;return e>r&&this.resize((r*=2)>e?r:e),e-=4,i(this.view,t,e,this.littleEndian,23,4),n&&(this.offset+=4),this},a.writeFloat=a.writeFloat32,a.readFloat32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var n=r(this.view,t,this.littleEndian,23,4);return e&&(this.offset+=4),n},a.readFloat=a.readFloat32,a.writeFloat64=function(t,e){var n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof t)throw TypeError("Illegal value: "+t+" (not a number)");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=8;var r=this.buffer.byteLength;return e>r&&this.resize((r*=2)>e?r:e),e-=8,i(this.view,t,e,this.littleEndian,52,8),n&&(this.offset+=8),this},a.writeDouble=a.writeFloat64,a.readFloat64=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var n=r(this.view,t,this.littleEndian,52,8);return e&&(this.offset+=8),n},a.readDouble=a.readFloat64,o.MAX_VARINT32_BYTES=5,o.calculateVarint32=function(t){return t>>>=0,t<128?1:t<16384?2:t<1<<21?3:t<1<<28?4:5},o.zigZagEncode32=function(t){return((t|=0)<<1^t>>31)>>>0},o.zigZagDecode32=function(t){return t>>>1^-(1&t)|0},a.writeVarint32=function(t,e){var n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var r,i=o.calculateVarint32(t);e+=i;var a=this.buffer.byteLength;for(e>a&&this.resize((a*=2)>e?a:e),e-=i,t>>>=0;t>=128;)r=127&t|128,this.view[e++]=r,t>>>=7;return this.view[e++]=t,n?(this.offset=e,this):i},a.writeVarint32ZigZag=function(t,e){return this.writeVarint32(o.zigZagEncode32(t),e)},a.readVarint32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var n,r=0,i=0;do{if(!this.noAssert&&t>this.limit){var o=Error("Truncated");throw o.truncated=!0,o}n=this.view[t++],r<5&&(i|=(127&n)<<7*r),++r}while(0!=(128&n));return i|=0,e?(this.offset=t,i):{value:i,length:r}},a.readVarint32ZigZag=function(t){var e=this.readVarint32(t);return"object"==typeof e?e.value=o.zigZagDecode32(e.value):e=o.zigZagDecode32(e),e},t&&(o.MAX_VARINT64_BYTES=10,o.calculateVarint64=function(e){"number"==typeof e?e=t.fromNumber(e):"string"==typeof e&&(e=t.fromString(e));var n=e.toInt()>>>0,r=e.shiftRightUnsigned(28).toInt()>>>0,i=e.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==r?n<16384?n<128?1:2:n<1<<21?3:4:r<16384?r<128?5:6:r<1<<21?7:8:i<128?9:10},o.zigZagEncode64=function(e){return"number"==typeof e?e=t.fromNumber(e,!1):"string"==typeof e?e=t.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned()),e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()},o.zigZagDecode64=function(e){return"number"==typeof e?e=t.fromNumber(e,!1):"string"==typeof e?e=t.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned()),e.shiftRightUnsigned(1).xor(e.and(t.ONE).toSigned().negate()).toSigned()},a.writeVarint64=function(e,n){var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"==typeof e)e=t.fromNumber(e);else if("string"==typeof e)e=t.fromString(e);else if(!(e&&e instanceof t))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=t.fromNumber(e,!1):"string"==typeof e?e=t.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned());var i=o.calculateVarint64(e),a=e.toInt()>>>0,s=e.shiftRightUnsigned(28).toInt()>>>0,u=e.shiftRightUnsigned(56).toInt()>>>0;n+=i;var c=this.buffer.byteLength;switch(n>c&&this.resize((c*=2)>n?c:n),n-=i,i){case 10:this.view[n+9]=u>>>7&1;case 9:this.view[n+8]=9!==i?128|u:127&u;case 8:this.view[n+7]=8!==i?s>>>21|128:s>>>21&127;case 7:this.view[n+6]=7!==i?s>>>14|128:s>>>14&127;case 6:this.view[n+5]=6!==i?s>>>7|128:s>>>7&127;case 5:this.view[n+4]=5!==i?128|s:127&s;case 4:this.view[n+3]=4!==i?a>>>21|128:a>>>21&127;case 3:this.view[n+2]=3!==i?a>>>14|128:a>>>14&127;case 2:this.view[n+1]=2!==i?a>>>7|128:a>>>7&127;case 1:this.view[n]=1!==i?128|a:127&a}return r?(this.offset+=i,this):i},a.writeVarint64ZigZag=function(t,e){return this.writeVarint64(o.zigZagEncode64(t),e)},a.readVarint64=function(e){var n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r=e,i=0,o=0,a=0,s=0;if(s=this.view[e++],i=127&s,128&s&&(s=this.view[e++],i|=(127&s)<<7,(128&s||this.noAssert&&void 0===s)&&(s=this.view[e++],i|=(127&s)<<14,(128&s||this.noAssert&&void 0===s)&&(s=this.view[e++],i|=(127&s)<<21,(128&s||this.noAssert&&void 0===s)&&(s=this.view[e++],o=127&s,(128&s||this.noAssert&&void 0===s)&&(s=this.view[e++],o|=(127&s)<<7,(128&s||this.noAssert&&void 0===s)&&(s=this.view[e++],o|=(127&s)<<14,(128&s||this.noAssert&&void 0===s)&&(s=this.view[e++],o|=(127&s)<<21,(128&s||this.noAssert&&void 0===s)&&(s=this.view[e++],a=127&s,(128&s||this.noAssert&&void 0===s)&&(s=this.view[e++],a|=(127&s)<<7,128&s||this.noAssert&&void 0===s))))))))))throw Error("Buffer overrun");var u=t.fromBits(i|o<<28,o>>>4|a<<24,!1);return n?(this.offset=e,u):{value:u,length:e-r}},a.readVarint64ZigZag=function(e){var n=this.readVarint64(e);return n&&n.value instanceof t?n.value=o.zigZagDecode64(n.value):n=o.zigZagDecode64(n),n}),a.writeCString=function(t,n){var r=void 0===n;r&&(n=this.offset);var i,o=t.length;if(!this.noAssert){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");for(i=0;i<o;++i)if(0===t.charCodeAt(i))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}o=f.calculateUTF16asUTF8(e(t))[1],n+=o+1;var a=this.buffer.byteLength;return n>a&&this.resize((a*=2)>n?a:n),n-=o+1,f.encodeUTF16toUTF8(e(t),function(t){this.view[n++]=t}.bind(this)),this.view[n++]=0,r?(this.offset=n,this):o},a.readCString=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r,i=t,o=-1;return f.decodeUTF8toUTF16(function(){if(0===o)return null;if(t>=this.limit)throw RangeError("Illegal range: Truncated data, "+t+" < "+this.limit);return o=this.view[t++],0===o?null:o}.bind(this),r=n(),!0),e?(this.offset=t,r()):{string:r(),length:t-i}},a.writeIString=function(t,n){var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,o=n;i=f.calculateUTF16asUTF8(e(t),this.noAssert)[1],n+=4+i;var a=this.buffer.byteLength;if(n>a&&this.resize((a*=2)>n?a:n),n-=4+i,this.littleEndian?(this.view[n+3]=i>>>24&255,this.view[n+2]=i>>>16&255,this.view[n+1]=i>>>8&255,this.view[n]=255&i):(this.view[n]=i>>>24&255,this.view[n+1]=i>>>16&255,this.view[n+2]=i>>>8&255,this.view[n+3]=255&i),n+=4,f.encodeUTF16toUTF8(e(t),function(t){this.view[n++]=t}.bind(this)),n!==o+4+i)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+4+i));return r?(this.offset=n,this):n-o},a.readIString=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var n=t,r=this.readUint32(t),i=this.readUTF8String(r,o.METRICS_BYTES,t+=4);return t+=i.length,e?(this.offset=t,i.string):{string:i.string,length:t-n}},o.METRICS_CHARS="c",o.METRICS_BYTES="b",a.writeUTF8String=function(t,n){var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,o=n;i=f.calculateUTF16asUTF8(e(t))[1],n+=i;var a=this.buffer.byteLength;return n>a&&this.resize((a*=2)>n?a:n),n-=i,f.encodeUTF16toUTF8(e(t),function(t){this.view[n++]=t}.bind(this)),r?(this.offset=n,this):n-o},a.writeString=a.writeUTF8String,o.calculateUTF8Chars=function(t){return f.calculateUTF16asUTF8(e(t))[0]},o.calculateUTF8Bytes=function(t){return f.calculateUTF16asUTF8(e(t))[1]},o.calculateString=o.calculateUTF8Bytes,a.readUTF8String=function(t,e,r){"number"==typeof e&&(r=e,e=void 0);var i=void 0===r;if(i&&(r=this.offset),void 0===e&&(e=o.METRICS_CHARS),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal length: "+t+" (not an integer)");if(t|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var a,s=0,u=r;if(e===o.METRICS_CHARS){if(a=n(),f.decodeUTF8(function(){return s<t&&r<this.limit?this.view[r++]:null}.bind(this),function(t){++s,f.UTF8toUTF16(t,a)}),s!==t)throw RangeError("Illegal range: Truncated data, "+s+" == "+t);return i?(this.offset=r,a()):{string:a(),length:r-u}}if(e===o.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+t>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+t+") <= "+this.buffer.byteLength)}var c=r+t;if(f.decodeUTF8toUTF16(function(){return r<c?this.view[r++]:null}.bind(this),a=n(),this.noAssert),r!==c)throw RangeError("Illegal range: Truncated data, "+r+" == "+c);return i?(this.offset=r,a()):{string:a(),length:r-u}}throw TypeError("Unsupported metrics: "+e)},a.readString=a.readUTF8String,a.writeVString=function(t,n){var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,a,s=n;i=f.calculateUTF16asUTF8(e(t),this.noAssert)[1],a=o.calculateVarint32(i),n+=a+i;var u=this.buffer.byteLength;if(n>u&&this.resize((u*=2)>n?u:n),n-=a+i,n+=this.writeVarint32(i,n),f.encodeUTF16toUTF8(e(t),function(t){this.view[n++]=t}.bind(this)),n!==s+i+a)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+i+a));return r?(this.offset=n,this):n-s},a.readVString=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var n=t,r=this.readVarint32(t),i=this.readUTF8String(r.value,o.METRICS_BYTES,t+=r.length);return t+=i.length,e?(this.offset=t,i.string):{string:i.string,length:t-n}},a.append=function(t,e,n){"number"!=typeof e&&"string"==typeof e||(n=e,e=void 0);var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}t instanceof o||(t=o.wrap(t,e));var i=t.limit-t.offset;if(i<=0)return this;n+=i;var a=this.buffer.byteLength;return n>a&&this.resize((a*=2)>n?a:n),n-=i,this.view.set(t.view.subarray(t.offset,t.limit),n),t.offset+=i,r&&(this.offset+=i),this},a.appendTo=function(t,e){return t.append(this,e),this},a.assert=function(t){return this.noAssert=!t,this},a.capacity=function(){return this.buffer.byteLength},a.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},a.clone=function(t){var e=new o(0,this.littleEndian,this.noAssert);return t?(e.buffer=new ArrayBuffer(this.buffer.byteLength),e.view=new Uint8Array(e.buffer)):(e.buffer=this.buffer,e.view=this.view),e.offset=this.offset,e.markedOffset=this.markedOffset,e.limit=this.limit,e},a.compact=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}if(0===t&&e===this.buffer.byteLength)return this;var n=e-t;if(0===n)return this.buffer=s,this.view=null,this.markedOffset>=0&&(this.markedOffset-=t),this.offset=0,this.limit=0,this;var r=new ArrayBuffer(n),i=new Uint8Array(r);return i.set(this.view.subarray(t,e)),this.buffer=r,this.view=i,this.markedOffset>=0&&(this.markedOffset-=t),this.offset=0,this.limit=n,this},a.copy=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}if(t===e)return new o(0,this.littleEndian,this.noAssert);var n=e-t,r=new o(n,this.littleEndian,this.noAssert);return r.offset=0,r.limit=n,r.markedOffset>=0&&(r.markedOffset-=t),this.copyTo(r,0,t,e),r},a.copyTo=function(t,e,n,r){var i,a;if(!this.noAssert&&!o.isByteBuffer(t))throw TypeError("Illegal target: Not a ByteBuffer");if(e=(a=void 0===e)?t.offset:0|e,n=(i=void 0===n)?this.offset:0|n,r=void 0===r?this.limit:0|r,e<0||e>t.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+e+" <= "+t.buffer.byteLength);if(n<0||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);var s=r-n;return 0===s?t:(t.ensureCapacity(e+s),t.view.set(this.view.subarray(n,r),e),i&&(this.offset+=s),a&&(t.offset+=s),this)},a.ensureCapacity=function(t){var e=this.buffer.byteLength;return e<t?this.resize((e*=2)>t?e:t):this},a.fill=function(t,e,n){var r=void 0===e;if(r&&(e=this.offset),"string"==typeof t&&t.length>0&&(t=t.charCodeAt(0)),void 0===e&&(e=this.offset),void 0===n&&(n=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,e<0||e>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+n+" <= "+this.buffer.byteLength)}if(e>=n)return this;for(;e<n;)this.view[e++]=t;return r&&(this.offset=e),this},a.flip=function(){return this.limit=this.offset,this.offset=0,this},a.mark=function(t){if(t=void 0===t?this.offset:t,!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=t,this},a.order=function(t){if(!this.noAssert&&"boolean"!=typeof t)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!t,this},a.LE=function(t){return this.littleEndian=void 0===t||!!t,this},a.BE=function(t){return this.littleEndian=void 0!==t&&!t,this},a.prepend=function(t,e,n){"number"!=typeof e&&"string"==typeof e||(n=e,e=void 0);var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}t instanceof o||(t=o.wrap(t,e));var i=t.limit-t.offset;if(i<=0)return this;var a=i-n;if(a>0){var s=new ArrayBuffer(this.buffer.byteLength+a),u=new Uint8Array(s);u.set(this.view.subarray(n,this.buffer.byteLength),i),this.buffer=s,this.view=u,this.offset+=a,this.markedOffset>=0&&(this.markedOffset+=a),this.limit+=a,n+=a}else{new Uint8Array(this.buffer)}return this.view.set(t.view.subarray(t.offset,t.limit),n-i),t.offset=t.limit,r&&(this.offset-=i),this},a.prependTo=function(t,e){return t.prepend(this,e),this},a.printDebug=function(t){"function"!=typeof t&&(t=console.log.bind(console)),t(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},a.remaining=function(){return this.limit-this.offset},a.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},a.resize=function(t){if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal capacity: "+t+" (not an integer)");if((t|=0)<0)throw RangeError("Illegal capacity: 0 <= "+t)}if(this.buffer.byteLength<t){var e=new ArrayBuffer(t),n=new Uint8Array(e);n.set(this.view),this.buffer=e,this.view=n}return this},a.reverse=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}return t===e?this:(Array.prototype.reverse.call(this.view.subarray(t,e)),this)},a.skip=function(t){if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal length: "+t+" (not an integer)");t|=0}var e=this.offset+t;if(!this.noAssert&&(e<0||e>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+t+" <= "+this.buffer.byteLength);return this.offset=e,this},a.slice=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}var n=this.clone();return n.offset=t,n.limit=e,n},a.toBuffer=function(t){var e=this.offset,n=this.limit;if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: Not an integer");if(e>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal limit: Not an integer");if(n>>>=0,e<0||e>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+n+" <= "+this.buffer.byteLength)}if(!t&&0===e&&n===this.buffer.byteLength)return this.buffer;if(e===n)return s;var r=new ArrayBuffer(n-e);return new Uint8Array(r).set(new Uint8Array(this.buffer).subarray(e,n),0),r},a.toArrayBuffer=a.toBuffer,a.toString=function(t,e,n){if(void 0===t)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof t&&(t="utf8",e=t,n=e),t){case"utf8":return this.toUTF8(e,n);case"base64":return this.toBase64(e,n);case"hex":return this.toHex(e,n);case"binary":return this.toBinary(e,n);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+t)}};var c=function(){for(var t={},e=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],n=[],r=0,i=e.length;r<i;++r)n[e[r]]=r;return t.encode=function(t,n){for(var r,i;null!==(r=t());)n(e[r>>2&63]),i=(3&r)<<4,null!==(r=t())?(i|=r>>4&15,n(e[63&(i|r>>4&15)]),i=(15&r)<<2,null!==(r=t())?(n(e[63&(i|r>>6&3)]),n(e[63&r])):(n(e[63&i]),n(61))):(n(e[63&i]),n(61),n(61))},t.decode=function(t,e){function r(t){throw Error("Illegal character code: "+t)}for(var i,o,a;null!==(i=t());)if(o=n[i],void 0===o&&r(i),null!==(i=t())&&(a=n[i],void 0===a&&r(i),e(o<<2>>>0|(48&a)>>4),null!==(i=t()))){if(void 0===(o=n[i])){if(61===i)break;r(i)}if(e((15&a)<<4>>>0|(60&o)>>2),null!==(i=t())){if(void 0===(a=n[i])){if(61===i)break;r(i)}e((3&o)<<6>>>0|a)}}},t.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)},t}();a.toBase64=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),t|=0,e|=0,t<0||e>this.capacity||t>e)throw RangeError("begin, end");var r;return c.encode(function(){return t<e?this.view[t++]:null}.bind(this),r=n()),r()},o.fromBase64=function(t,n){if("string"!=typeof t)throw TypeError("str");var r=new o(t.length/4*3,n),i=0;return c.decode(e(t),function(t){r.view[i++]=t}),r.limit=i,r},o.btoa=function(t){return o.fromBinary(t).toBase64()},o.atob=function(t){return o.fromBase64(t).toBinary()},a.toBinary=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),t|=0,e|=0,t<0||e>this.capacity()||t>e)throw RangeError("begin, end");if(t===e)return"";for(var n=[],r=[];t<e;)n.push(this.view[t++]),n.length>=1024&&(r.push(String.fromCharCode.apply(String,n)),n=[]);return r.join("")+String.fromCharCode.apply(String,n)},o.fromBinary=function(t,e){if("string"!=typeof t)throw TypeError("str");for(var n,r=0,i=t.length,a=new o(i,e);r<i;){if((n=t.charCodeAt(r))>255)throw RangeError("illegal char code: "+n);a.view[r++]=n}return a.limit=i,a},a.toDebug=function(t){for(var e,n=-1,r=this.buffer.byteLength,i="",o="",a="";n<r;){if(-1!==n&&(e=this.view[n],i+=e<16?"0"+e.toString(16).toUpperCase():e.toString(16).toUpperCase(),t&&(o+=e>32&&e<127?String.fromCharCode(e):".")),++n,t&&n>0&&n%16==0&&n!==r){for(;i.length<51;)i+=" ";a+=i+o+"\n",i=o=""}n===this.offset&&n===this.limit?i+=n===this.markedOffset?"!":"|":n===this.offset?i+=n===this.markedOffset?"[":"<":n===this.limit?i+=n===this.markedOffset?"]":">":i+=n===this.markedOffset?"'":t||0!==n&&n!==r?" ":""}if(t&&" "!==i){for(;i.length<51;)i+=" ";a+=i+o+"\n"}return t?a:i},o.fromDebug=function(t,e,n){for(var r,i,a=t.length,s=new o((a+1)/3|0,e,n),u=0,c=0,f=!1,l=!1,h=!1,d=!1,p=!1;u<a;){switch(r=t.charAt(u++)){case"!":if(!n){if(l||h||d){p=!0;break}l=h=d=!0}s.offset=s.markedOffset=s.limit=c,f=!1;break;case"|":if(!n){if(l||d){p=!0;break}l=d=!0}s.offset=s.limit=c,f=!1;break;case"[":if(!n){if(l||h){p=!0;break}l=h=!0}s.offset=s.markedOffset=c,f=!1;break;case"<":if(!n){if(l){p=!0;break}l=!0}s.offset=c,f=!1;break;case"]":if(!n){if(d||h){p=!0;break}d=h=!0}s.limit=s.markedOffset=c,f=!1;break;case">":if(!n){if(d){p=!0;break}d=!0}s.limit=c,f=!1;break;case"'":if(!n){if(h){p=!0;break}h=!0}s.markedOffset=c,f=!1;break;case" ":f=!1;break;default:if(!n&&f){p=!0;break}if(i=parseInt(r+t.charAt(u++),16),!n&&(isNaN(i)||i<0||i>255))throw TypeError("Illegal str: Not a debug encoded string");s.view[c++]=i,f=!0}if(p)throw TypeError("Illegal str: Invalid symbol at "+u)}if(!n){if(!l||!d)throw TypeError("Illegal str: Missing offset or limit");if(c<s.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+c+" < "+a)}return s},a.toHex=function(t,e){if(t=void 0===t?this.offset:t,e=void 0===e?this.limit:e,!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}for(var n,r=new Array(e-t);t<e;)n=this.view[t++],n<16?r.push("0",n.toString(16)):r.push(n.toString(16));return r.join("")},o.fromHex=function(t,e,n){if(!n){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");if(t.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(var r,i=t.length,a=new o(i/2|0,e),s=0,u=0;s<i;s+=2){if(r=parseInt(t.substring(s,s+2),16),!n&&(!isFinite(r)||r<0||r>255))throw TypeError("Illegal str: Contains non-hex characters");a.view[u++]=r}return a.limit=u,a};var f=function(){var t={};return t.MAX_CODEPOINT=1114111,t.encodeUTF8=function(t,e){var n=null;for("number"==typeof t&&(n=t,t=function(){return null});null!==n||null!==(n=t());)n<128?e(127&n):n<2048?(e(n>>6&31|192),e(63&n|128)):n<65536?(e(n>>12&15|224),e(n>>6&63|128),e(63&n|128)):(e(n>>18&7|240),e(n>>12&63|128),e(n>>6&63|128),e(63&n|128)),n=null},t.decodeUTF8=function(t,e){for(var n,r,i,o,a=function(t){t=t.slice(0,t.indexOf(null));var e=Error(t.toString());throw e.name="TruncatedError",e.bytes=t,e};null!==(n=t());)if(0==(128&n))e(n);else if(192==(224&n))null===(r=t())&&a([n,r]),e((31&n)<<6|63&r);else if(224==(240&n))(null===(r=t())||null===(i=t()))&&a([n,r,i]),e((15&n)<<12|(63&r)<<6|63&i);else{if(240!=(248&n))throw RangeError("Illegal starting byte: "+n);(null===(r=t())||null===(i=t())||null===(o=t()))&&a([n,r,i,o]),e((7&n)<<18|(63&r)<<12|(63&i)<<6|63&o)}},t.UTF16toUTF8=function(t,e){for(var n,r=null;;){if(null===(n=null!==r?r:t()))break;n>=55296&&n<=57343&&null!==(r=t())&&r>=56320&&r<=57343?(e(1024*(n-55296)+r-56320+65536),r=null):e(n)}null!==r&&e(r)},t.UTF8toUTF16=function(t,e){var n=null;for("number"==typeof t&&(n=t,t=function(){return null});null!==n||null!==(n=t());)n<=65535?e(n):(n-=65536,e(55296+(n>>10)),e(n%1024+56320)),n=null},t.encodeUTF16toUTF8=function(e,n){t.UTF16toUTF8(e,function(e){t.encodeUTF8(e,n)})},t.decodeUTF8toUTF16=function(e,n){t.decodeUTF8(e,function(e){t.UTF8toUTF16(e,n)})},t.calculateCodePoint=function(t){return t<128?1:t<2048?2:t<65536?3:4},t.calculateUTF8=function(t){for(var e,n=0;null!==(e=t());)n+=e<128?1:e<2048?2:e<65536?3:4;return n},t.calculateUTF16asUTF8=function(e){var n=0,r=0;return t.UTF16toUTF8(e,function(t){++n,r+=t<128?1:t<2048?2:t<65536?3:4}),[n,r]},t}();return a.toUTF8=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}var r;try{f.decodeUTF8toUTF16(function(){return t<e?this.view[t++]:null}.bind(this),r=n())}catch(n){if(t!==e)throw RangeError("Illegal range: Truncated data, "+t+" != "+e)}return r()},o.fromUTF8=function(t,n,r){if(!r&&"string"!=typeof t)throw TypeError("Illegal str: Not a string");var i=new o(f.calculateUTF16asUTF8(e(t),!0)[1],n,r),a=0;return f.encodeUTF16toUTF8(e(t),function(t){i.view[a++]=t}),i.limit=a,i},o})},function(t,e,n){var r,i,o;/**
19 * @license long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
20 * Released under the Apache License, Version 2.0
21 * see: https://github.com/dcodeIO/long.js for details
22 */
23!function(n,a){i=[],r=a,void 0!==(o="function"==typeof r?r.apply(e,i):r)&&(t.exports=o)}(0,function(){"use strict";function t(t,e,n){this.low=0|t,this.high=0|e,this.unsigned=!!n}function e(t){return!0===(t&&t.__isLong__)}function n(t,e){var n,r,o;return e?(t>>>=0,(o=0<=t&&t<256)&&(r=u[t])?r:(n=i(t,(0|t)<0?-1:0,!0),o&&(u[t]=n),n)):(t|=0,(o=-128<=t&&t<128)&&(r=s[t])?r:(n=i(t,t<0?-1:0,!1),o&&(s[t]=n),n))}function r(t,e){if(isNaN(t)||!isFinite(t))return e?v:p;if(e){if(t<0)return v;if(t>=l)return _}else{if(t<=-h)return w;if(t+1>=h)return b}return t<0?r(-t,e).neg():i(t%f|0,t/f|0,e)}function i(e,n,r){return new t(e,n,r)}function o(t,e,n){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return p;if("number"==typeof e?(n=e,e=!1):e=!!e,(n=n||10)<2||36<n)throw RangeError("radix");var i;if((i=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return o(t.substring(1),e,n).neg();for(var a=r(c(n,8)),s=p,u=0;u<t.length;u+=8){var f=Math.min(8,t.length-u),l=parseInt(t.substring(u,u+f),n);if(f<8){var h=r(c(n,f));s=s.mul(h).add(r(l))}else s=s.mul(a),s=s.add(r(l))}return s.unsigned=e,s}function a(e){return e instanceof t?e:"number"==typeof e?r(e):"string"==typeof e?o(e):i(e.low,e.high,e.unsigned)}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),t.isLong=e;var s={},u={};t.fromInt=n,t.fromNumber=r,t.fromBits=i;var c=Math.pow;t.fromString=o,t.fromValue=a;var f=4294967296,l=f*f,h=l/2,d=n(1<<24),p=n(0);t.ZERO=p;var v=n(0,!0);t.UZERO=v;var g=n(1);t.ONE=g;var m=n(1,!0);t.UONE=m;var y=n(-1);t.NEG_ONE=y;var b=i(-1,2147483647,!1);t.MAX_VALUE=b;var _=i(-1,-1,!0);t.MAX_UNSIGNED_VALUE=_;var w=i(0,-2147483648,!1);t.MIN_VALUE=w;var E=t.prototype;return E.toInt=function(){return this.unsigned?this.low>>>0:this.low},E.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},E.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(w)){var e=r(t),n=this.div(e),i=n.mul(e).sub(this);return n.toString(t)+i.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var o=r(c(t,6),this.unsigned),a=this,s="";;){var u=a.div(o),f=a.sub(u.mul(o)).toInt()>>>0,l=f.toString(t);if(a=u,a.isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+s}},E.getHighBits=function(){return this.high},E.getHighBitsUnsigned=function(){return this.high>>>0},E.getLowBits=function(){return this.low},E.getLowBitsUnsigned=function(){return this.low>>>0},E.getNumBitsAbs=function(){if(this.isNegative())return this.eq(w)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},E.isZero=function(){return 0===this.high&&0===this.low},E.isNegative=function(){return!this.unsigned&&this.high<0},E.isPositive=function(){return this.unsigned||this.high>=0},E.isOdd=function(){return 1==(1&this.low)},E.isEven=function(){return 0==(1&this.low)},E.equals=function(t){return e(t)||(t=a(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},E.eq=E.equals,E.notEquals=function(t){return!this.eq(t)},E.neq=E.notEquals,E.lessThan=function(t){return this.comp(t)<0},E.lt=E.lessThan,E.lessThanOrEqual=function(t){return this.comp(t)<=0},E.lte=E.lessThanOrEqual,E.greaterThan=function(t){return this.comp(t)>0},E.gt=E.greaterThan,E.greaterThanOrEqual=function(t){return this.comp(t)>=0},E.gte=E.greaterThanOrEqual,E.compare=function(t){if(e(t)||(t=a(t)),this.eq(t))return 0;var n=this.isNegative(),r=t.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},E.comp=E.compare,E.negate=function(){return!this.unsigned&&this.eq(w)?w:this.not().add(g)},E.neg=E.negate,E.add=function(t){e(t)||(t=a(t));var n=this.high>>>16,r=65535&this.high,o=this.low>>>16,s=65535&this.low,u=t.high>>>16,c=65535&t.high,f=t.low>>>16,l=65535&t.low,h=0,d=0,p=0,v=0;return v+=s+l,p+=v>>>16,v&=65535,p+=o+f,d+=p>>>16,p&=65535,d+=r+c,h+=d>>>16,d&=65535,h+=n+u,h&=65535,i(p<<16|v,h<<16|d,this.unsigned)},E.subtract=function(t){return e(t)||(t=a(t)),this.add(t.neg())},E.sub=E.subtract,E.multiply=function(t){if(this.isZero())return p;if(e(t)||(t=a(t)),t.isZero())return p;if(this.eq(w))return t.isOdd()?w:p;if(t.eq(w))return this.isOdd()?w:p;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(d)&&t.lt(d))return r(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,o=65535&this.high,s=this.low>>>16,u=65535&this.low,c=t.high>>>16,f=65535&t.high,l=t.low>>>16,h=65535&t.low,v=0,g=0,m=0,y=0;return y+=u*h,m+=y>>>16,y&=65535,m+=s*h,g+=m>>>16,m&=65535,m+=u*l,g+=m>>>16,m&=65535,g+=o*h,v+=g>>>16,g&=65535,g+=s*l,v+=g>>>16,g&=65535,g+=u*f,v+=g>>>16,g&=65535,v+=n*h+o*l+s*f+u*c,v&=65535,i(m<<16|y,v<<16|g,this.unsigned)},E.mul=E.multiply,E.divide=function(t){if(e(t)||(t=a(t)),t.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?v:p;var n,i,o;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return v;if(t.gt(this.shru(1)))return m;o=v}else{if(this.eq(w)){if(t.eq(g)||t.eq(y))return w;if(t.eq(w))return g;return n=this.shr(1).div(t).shl(1),n.eq(p)?t.isNegative()?g:y:(i=this.sub(t.mul(n)),o=n.add(i.div(t)))}if(t.eq(w))return this.unsigned?v:p;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=p}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),u=s<=48?1:c(2,s-48),f=r(n),l=f.mul(t);l.isNegative()||l.gt(i);)n-=u,f=r(n,this.unsigned),l=f.mul(t);f.isZero()&&(f=g),o=o.add(f),i=i.sub(l)}return o},E.div=E.divide,E.modulo=function(t){return e(t)||(t=a(t)),this.sub(this.div(t).mul(t))},E.mod=E.modulo,E.not=function(){return i(~this.low,~this.high,this.unsigned)},E.and=function(t){return e(t)||(t=a(t)),i(this.low&t.low,this.high&t.high,this.unsigned)},E.or=function(t){return e(t)||(t=a(t)),i(this.low|t.low,this.high|t.high,this.unsigned)},E.xor=function(t){return e(t)||(t=a(t)),i(this.low^t.low,this.high^t.high,this.unsigned)},E.shiftLeft=function(t){return e(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?i(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):i(0,this.low<<t-32,this.unsigned)},E.shl=E.shiftLeft,E.shiftRight=function(t){return e(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?i(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):i(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},E.shr=E.shiftRight,E.shiftRightUnsigned=function(t){if(e(t)&&(t=t.toInt()),0===(t&=63))return this;var n=this.high;if(t<32){return i(this.low>>>t|n<<32-t,n>>>t,this.unsigned)}return 32===t?i(n,0,this.unsigned):i(n>>>t-32,0,this.unsigned)},E.shru=E.shiftRightUnsigned,E.toSigned=function(){return this.unsigned?i(this.low,this.high,!1):this},E.toUnsigned=function(){return this.unsigned?this:i(this.low,this.high,!0)},E.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},E.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255]},E.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24&255,t>>>16&255,t>>>8&255,255&t,e>>>24&255,e>>>16&255,e>>>8&255,255&e]},t})},function(t,e){},function(t,e,n){"use strict";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,r||t,o),s=d?d+e:e;return t._events[s]?t._events[s].fn?t._events[s]=[t._events[s],a]:t._events[s].push(a):(t._events[s]=a,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}var u=n(1),c=u(n(59)),f=u(n(257)),l=u(n(22)),h=Object.prototype.hasOwnProperty,d="~";Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(d=!1)),s.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)h.call(t,e)&&n.push(d?(0,c.default)(e).call(e,1):e);return f.default?(0,l.default)(n).call(n,(0,f.default)(t)):n},s.prototype.listeners=function(t){var e=d?d+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,i=n.length,o=new Array(i);r<i;r++)o[r]=n[r].fn;return o},s.prototype.listenerCount=function(t){var e=d?d+t:t,n=this._events[e];return n?n.fn?1:n.length:0},s.prototype.emit=function(t,e,n,r,i,o){var a=d?d+t:t;if(!this._events[a])return!1;var s,u,c=this._events[a],f=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),f){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,r),!0;case 5:return c.fn.call(c.context,e,n,r,i),!0;case 6:return c.fn.call(c.context,e,n,r,i,o),!0}for(u=1,s=new Array(f-1);u<f;u++)s[u-1]=arguments[u];c.fn.apply(c.context,s)}else{var l,h=c.length;for(u=0;u<h;u++)switch(c[u].once&&this.removeListener(t,c[u].fn,void 0,!0),f){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,e);break;case 3:c[u].fn.call(c[u].context,e,n);break;case 4:c[u].fn.call(c[u].context,e,n,r);break;default:if(!s)for(l=1,s=new Array(f-1);l<f;l++)s[l-1]=arguments[l];c[u].fn.apply(c[u].context,s)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,n,r){var i=d?d+t:t;if(!this._events[i])return this;if(!e)return a(this,i),this;var o=this._events[i];if(o.fn)o.fn!==e||r&&!o.once||n&&o.context!==n||a(this,i);else{for(var s=0,u=[],c=o.length;s<c;s++)(o[s].fn!==e||r&&!o[s].once||n&&o[s].context!==n)&&u.push(o[s]);u.length?this._events[i]=1===u.length?u[0]:u:a(this,i)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=d?d+t:t,this._events[e]&&a(this,e)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=d,s.EventEmitter=s,t.exports=s},function(t,e,n){t.exports=n(609)},function(t,e,n){var r=function(t){"use strict";function e(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}function n(t,e,n,r){var o=e&&e.prototype instanceof i?e:i,a=Object.create(o.prototype),s=new d(r||[]);return a._invoke=c(t,n,s),a}function r(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function i(){}function o(){}function a(){}function s(t){["next","throw","return"].forEach(function(n){e(t,n,function(t){return this._invoke(n,t)})})}function u(t,e){function n(i,o,a,s){var u=r(t[i],t,o);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==typeof f&&y.call(f,"__await")?e.resolve(f.__await).then(function(t){n("next",t,a,s)},function(t){n("throw",t,a,s)}):e.resolve(f).then(function(t){c.value=t,a(c)},function(t){return n("throw",t,a,s)})}s(u.arg)}function i(t,r){function i(){return new e(function(e,i){n(t,r,e,i)})}return o=o?o.then(i,i):i()}var o;this._invoke=i}function c(t,e,n){var i=O;return function(o,a){if(i===S)throw new Error("Generator is already running");if(i===A){if("throw"===o)throw a;return v()}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=f(s,n);if(u){if(u===x)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===O)throw i=A,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=S;var c=r(t,e,n);if("normal"===c.type){if(i=n.done?A:T,c.arg===x)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=A,n.method="throw",n.arg=c.arg)}}}function f(t,e){var n=t.iterator[e.method];if(n===g){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=g,f(t,e),"throw"===e.method))return x;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return x}var i=r(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,x;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=g),e.delegate=null,x):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,x)}function l(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function h(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function d(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(l,this),this.reset(!0)}function p(t){if(t){var e=t[_];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(y.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=g,e.done=!0,e};return r.next=r}}return{next:v}}function v(){return{value:g,done:!0}}var g,m=Object.prototype,y=m.hasOwnProperty,b="function"==typeof Symbol?Symbol:{},_=b.iterator||"@@iterator",w=b.asyncIterator||"@@asyncIterator",E=b.toStringTag||"@@toStringTag";try{e({},"")}catch(t){e=function(t,e,n){return t[e]=n}}t.wrap=n;var O="suspendedStart",T="suspendedYield",S="executing",A="completed",x={},I={};I[_]=function(){return this};var j=Object.getPrototypeOf,C=j&&j(j(p([])));C&&C!==m&&y.call(C,_)&&(I=C);var N=a.prototype=i.prototype=Object.create(I);return o.prototype=N.constructor=a,a.constructor=o,o.displayName=e(a,E,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===o||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,a):(t.__proto__=a,e(t,E,"GeneratorFunction")),t.prototype=Object.create(N),t},t.awrap=function(t){return{__await:t}},s(u.prototype),u.prototype[w]=function(){return this},t.AsyncIterator=u,t.async=function(e,r,i,o,a){void 0===a&&(a=Promise);var s=new u(n(e,r,i,o),a);return t.isGeneratorFunction(r)?s:s.next().then(function(t){return t.done?t.value:s.next()})},s(N),e(N,E,"Generator"),N[_]=function(){return this},N.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=p,d.prototype={constructor:d,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEach(h),!t)for(var e in this)"t"===e.charAt(0)&&y.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=g)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,r){return o.type="throw",o.arg=t,n.next=e,r&&(n.method="next",n.arg=g),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=y.call(i,"catchLoc"),s=y.call(i,"finallyLoc");if(a&&s){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&y.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,x):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),x},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),h(n),x}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;h(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:p(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=g),x}},t}(t.exports);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}},function(t,e){function n(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function r(t){return function(){var e=this,r=arguments;return new Promise(function(i,o){function a(t){n(u,i,o,a,s,"next",t)}function s(t){n(u,i,o,a,s,"throw",t)}var u=t.apply(e,r);a(void 0)})}}t.exports=r},function(t,e,n){function r(t){return i(t)||o(t)||a(t)||s()}var i=n(612),o=n(261),a=n(262),s=n(613);t.exports=r},function(t,e,n){function r(t){if(Array.isArray(t))return i(t)}var i=n(260);t.exports=r},function(t,e){function n(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}t.exports=n},function(t,e){function n(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}t.exports=n},function(t,e,n){function r(t,e){if(null==t)return{};var n,r,o=i(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var i=n(616);t.exports=r},function(t,e){function n(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}t.exports=n},function(t,e){function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}t.exports=n},function(t,e){function n(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}t.exports=n},function(t,e,n){function r(t){return(a(t)?i:o)(t)}var i=n(620),o=n(623),a=n(268);t.exports=r},function(t,e,n){function r(t){return o(i(t))}var i=n(621),o=n(263);t.exports=r},function(t,e){function n(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}t.exports=n},function(t,e){function n(t,e){return t+r(i()*(e-t+1))}var r=Math.floor,i=Math.random;t.exports=n},function(t,e,n){function r(t){return i(o(t))}var i=n(263),o=n(264);t.exports=r},function(t,e,n){function r(t,e){return i(e,function(e){return t[e]})}var i=n(625);t.exports=r},function(t,e){function n(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}t.exports=n},function(t,e,n){function r(t){return a(t)?i(t):o(t)}var i=n(627),o=n(640),a=n(643);t.exports=r},function(t,e,n){function r(t,e){var n=a(t),r=!n&&o(t),f=!n&&!r&&s(t),h=!n&&!r&&!f&&c(t),d=n||r||f||h,p=d?i(t.length,String):[],v=p.length;for(var g in t)!e&&!l.call(t,g)||d&&("length"==g||f&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||u(g,v))||p.push(g);return p}var i=n(628),o=n(629),a=n(268),s=n(633),u=n(635),c=n(636),f=Object.prototype,l=f.hasOwnProperty;t.exports=r},function(t,e){function n(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}t.exports=n},function(t,e,n){var r=n(630),i=n(118),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(t){return i(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=u},function(t,e,n){function r(t){return o(t)&&i(t)==a}var i=n(117),o=n(118),a="[object Arguments]";t.exports=r},function(t,e,n){function r(t){var e=a.call(t,u),n=t[u];try{t[u]=void 0;var r=!0}catch(t){}var i=s.call(t);return r&&(e?t[u]=n:delete t[u]),i}var i=n(265),o=Object.prototype,a=o.hasOwnProperty,s=o.toString,u=i?i.toStringTag:void 0;t.exports=r},function(t,e){function n(t){return i.call(t)}var r=Object.prototype,i=r.toString;t.exports=n},function(t,e,n){(function(t){var r=n(266),i=n(634),o="object"==typeof e&&e&&!e.nodeType&&e,a=o&&"object"==typeof t&&t&&!t.nodeType&&t,s=a&&a.exports===o,u=s?r.Buffer:void 0,c=u?u.isBuffer:void 0,f=c||i;t.exports=f}).call(e,n(269)(t))},function(t,e){function n(){return!1}t.exports=n},function(t,e){function n(t,e){var n=typeof t;return!!(e=null==e?r:e)&&("number"==n||"symbol"!=n&&i.test(t))&&t>-1&&t%1==0&&t<e}var r=9007199254740991,i=/^(?:0|[1-9]\d*)$/;t.exports=n},function(t,e,n){var r=n(637),i=n(638),o=n(639),a=o&&o.isTypedArray,s=a?i(a):r;t.exports=s},function(t,e,n){function r(t){return a(t)&&o(t.length)&&!!s[i(t)]}var i=n(117),o=n(270),a=n(118),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,t.exports=r},function(t,e){function n(t){return function(e){return t(e)}}t.exports=n},function(t,e,n){(function(t){var r=n(267),i="object"==typeof e&&e&&!e.nodeType&&e,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i,s=a&&r.process,u=function(){try{var t=o&&o.require&&o.require("util").types;return t||s&&s.binding&&s.binding("util")}catch(t){}}();t.exports=u}).call(e,n(269)(t))},function(t,e,n){function r(t){if(!i(t))return o(t);var e=[];for(var n in Object(t))s.call(t,n)&&"constructor"!=n&&e.push(n);return e}var i=n(641),o=n(642),a=Object.prototype,s=a.hasOwnProperty;t.exports=r},function(t,e){function n(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||r)}var r=Object.prototype;t.exports=n},function(t,e,n){var r=n(271),i=r(Object.keys,Object);t.exports=i},function(t,e,n){function r(t){return null!=t&&o(t.length)&&!i(t)}var i=n(644),o=n(270);t.exports=r},function(t,e,n){function r(t){if(!o(t))return!1;var e=i(t);return e==s||e==u||e==a||e==c}var i=n(117),o=n(645),a="[object AsyncFunction]",s="[object Function]",u="[object GeneratorFunction]",c="[object Proxy]";t.exports=r},function(t,e){function n(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}t.exports=n},function(t,e,n){function r(t){return i(t)||o(t)||a(t)||s()}var i=n(647),o=n(261),a=n(262),s=n(648);t.exports=r},function(t,e){function n(t){if(Array.isArray(t))return t}t.exports=n},function(t,e){function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}t.exports=n},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function r(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}t.exports=r},function(t,e){function n(t,e,n,r,i){var o={};return Object.keys(r).forEach(function(t){o[t]=r[t]}),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=n.slice().reverse().reduce(function(n,r){return r(t,e,n)||n},o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(t,e,o),o=null),o}t.exports=n},function(t,e,n){!function(){var n={VERSION:"2.4.0",Result:{SUCCEEDED:1,NOTRANSITION:2,CANCELLED:3,PENDING:4},Error:{INVALID_TRANSITION:100,PENDING_TRANSITION:200,INVALID_CALLBACK:300},WILDCARD:"*",ASYNC:"async",create:function(t,e){var r="string"==typeof t.initial?{state:t.initial}:t.initial,i=t.terminal||t.final,o=e||t.target||{},a=t.events||[],s=t.callbacks||{},u={},c={},f=function(t){var e=Array.isArray(t.from)?t.from:t.from?[t.from]:[n.WILDCARD];u[t.name]=u[t.name]||{};for(var r=0;r<e.length;r++)c[e[r]]=c[e[r]]||[],c[e[r]].push(t.name),u[t.name][e[r]]=t.to||e[r];t.to&&(c[t.to]=c[t.to]||[])};r&&(r.event=r.event||"startup",f({name:r.event,from:"none",to:r.state}));for(var l=0;l<a.length;l++)f(a[l]);for(var h in u)u.hasOwnProperty(h)&&(o[h]=n.buildEvent(h,u[h]));for(var h in s)s.hasOwnProperty(h)&&(o[h]=s[h]);return o.current="none",o.is=function(t){return Array.isArray(t)?t.indexOf(this.current)>=0:this.current===t},o.can=function(t){return!this.transition&&void 0!==u[t]&&(u[t].hasOwnProperty(this.current)||u[t].hasOwnProperty(n.WILDCARD))},o.cannot=function(t){return!this.can(t)},o.transitions=function(){return(c[this.current]||[]).concat(c[n.WILDCARD]||[])},o.isFinished=function(){return this.is(i)},o.error=t.error||function(t,e,n,r,i,o,a){throw a||o},o.states=function(){return Object.keys(c).sort()},r&&!r.defer&&o[r.event](),o},doCallback:function(t,e,r,i,o,a){if(e)try{return e.apply(t,[r,i,o].concat(a))}catch(e){return t.error(r,i,o,a,n.Error.INVALID_CALLBACK,"an exception occurred in a caller-provided callback function",e)}},beforeAnyEvent:function(t,e,r,i,o){return n.doCallback(t,t.onbeforeevent,e,r,i,o)},afterAnyEvent:function(t,e,r,i,o){return n.doCallback(t,t.onafterevent||t.onevent,e,r,i,o)},leaveAnyState:function(t,e,r,i,o){return n.doCallback(t,t.onleavestate,e,r,i,o)},enterAnyState:function(t,e,r,i,o){return n.doCallback(t,t.onenterstate||t.onstate,e,r,i,o)},changeState:function(t,e,r,i,o){return n.doCallback(t,t.onchangestate,e,r,i,o)},beforeThisEvent:function(t,e,r,i,o){return n.doCallback(t,t["onbefore"+e],e,r,i,o)},afterThisEvent:function(t,e,r,i,o){return n.doCallback(t,t["onafter"+e]||t["on"+e],e,r,i,o)},leaveThisState:function(t,e,r,i,o){return n.doCallback(t,t["onleave"+r],e,r,i,o)},enterThisState:function(t,e,r,i,o){return n.doCallback(t,t["onenter"+i]||t["on"+i],e,r,i,o)},beforeEvent:function(t,e,r,i,o){if(!1===n.beforeThisEvent(t,e,r,i,o)||!1===n.beforeAnyEvent(t,e,r,i,o))return!1},afterEvent:function(t,e,r,i,o){n.afterThisEvent(t,e,r,i,o),n.afterAnyEvent(t,e,r,i,o)},leaveState:function(t,e,r,i,o){var a=n.leaveThisState(t,e,r,i,o),s=n.leaveAnyState(t,e,r,i,o);return!1!==a&&!1!==s&&(n.ASYNC===a||n.ASYNC===s?n.ASYNC:void 0)},enterState:function(t,e,r,i,o){n.enterThisState(t,e,r,i,o),n.enterAnyState(t,e,r,i,o)},buildEvent:function(t,e){return function(){var r=this.current,i=e[r]||(e[n.WILDCARD]!=n.WILDCARD?e[n.WILDCARD]:r)||r,o=Array.prototype.slice.call(arguments);if(this.transition)return this.error(t,r,i,o,n.Error.PENDING_TRANSITION,"event "+t+" inappropriate because previous transition did not complete");if(this.cannot(t))return this.error(t,r,i,o,n.Error.INVALID_TRANSITION,"event "+t+" inappropriate in current state "+this.current);if(!1===n.beforeEvent(this,t,r,i,o))return n.Result.CANCELLED;if(r===i)return n.afterEvent(this,t,r,i,o),n.Result.NOTRANSITION;var a=this;this.transition=function(){return a.transition=null,a.current=i,n.enterState(a,t,r,i,o),n.changeState(a,t,r,i,o),n.afterEvent(a,t,r,i,o),n.Result.SUCCEEDED},this.transition.cancel=function(){a.transition=null,n.afterEvent(a,t,r,i,o)};var s=n.leaveState(this,t,r,i,o);return!1===s?(this.transition=null,n.Result.CANCELLED):n.ASYNC===s?n.Result.PENDING:this.transition?this.transition():void 0}}};void 0!==t&&t.exports&&(e=t.exports=n),e.StateMachine=n}()},function(t,e){function n(e){"@babel/helpers - typeof";return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}t.exports=n},function(t,e,n){function r(t){if(!a(t)||i(t)!=s)return!1;var e=o(t);if(null===e)return!0;var n=l.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&f.call(n)==h}var i=n(117),o=n(654),a=n(118),s="[object Object]",u=Function.prototype,c=Object.prototype,f=u.toString,l=c.hasOwnProperty,h=f.call(Object);t.exports=r},function(t,e,n){var r=n(271),i=r(Object.getPrototypeOf,Object);t.exports=i},function(t,e,n){"use strict";var r,i,o,a=n(1),s=a(n(656)),u=a(n(245)),c=a(n(259)),f=a(n(22)),l=a(n(256)),h=a(n(35)),d=a(n(114)),p=a(n(91));!function(a,s){"object"===(0,p.default)(e)&&void 0!==t?s(e,n(149)):(i=[e,n(149)],r=s,void 0!==(o="function"==typeof r?r.apply(e,i):r)&&(t.exports=o))}(0,function(t,e){function n(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function r(t){return i(t)||o(t)||a()}function i(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}function o(t){if((0,s.default)(Object(t))||"[object Arguments]"===Object.prototype.toString.call(t))return(0,u.default)(t)}function a(){throw new TypeError("Invalid attempt to spread non-iterable instance")}if(!e.Protocals)throw new Error("LeanCloud Realtime SDK not installed");var p=e.Protocals.CommandType,v=e.Protocals.GenericCommand,g=e.Protocals.AckCommand,m=function(t){return console.warn(t.message)},y=function(t){function r(n,r,i){var o;return o=t.call(this)||this,o._appId=n,o.id=r,o._connection=i,o._eventemitter=new e.EventEmitter,o._querys=new c.default,o}n(r,t);var i=r.prototype;return i._send=function(t){for(var e,n,r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return(n=this._connection).send.apply(n,(0,f.default)(e=[(0,l.default)(t,{appId:this._appId,installationId:this.id,service:1})]).call(e,i))},i._open=function(){return this._send(new v({cmd:p.login}))},i.close=function(){var t=this._eventemitter;return t.emit("beforeclose"),this._send(new v({cmd:p.logout})).then(function(){return t.emit("close")})},i.register=function(t){this._querys.add(t)},i.deregister=function(t){var e=this;this._querys.delete(t),setTimeout(function(){e._querys.size||e.close().catch(m)},0)},i._dispatchCommand=function(t){return t.cmd!==p.data?(this.emit("unhandledmessage",t),e.Promise.resolve()):this._dispatchDataCommand(t)},i._dispatchDataCommand=function(t){var e=t.dataMessage,n=e.ids,r=e.msg;this.emit("message",(0,h.default)(r).call(r,function(t){var e=t.data;return JSON.parse(e)}));var i=new v({cmd:p.ack,ackMessage:new g({ids:n})});return this._send(i,!1).catch(m)},r}(e.EventEmitter),b=function(t){return[function(e){return t(),e},function(e){throw t(),e}]},_=function(t){t._liveQueryClients={},t.createLiveQueryClient=function(n){var i;if(void 0!==t._liveQueryClients[n])return e.Promise.resolve(t._liveQueryClients[n]);var o=(i=t._open().then(function(e){var r=new y(t._options.appId,n,e);return e.on("reconnect",function(){return r._open().then(function(){return r.emit("reconnect")},function(t){return r.emit("reconnecterror",t)})}),r._eventemitter.on("beforeclose",function(){delete t._liveQueryClients[r.id]},t),r._eventemitter.on("close",function(){t._deregister(r)},t),r._open().then(function(){return t._liveQueryClients[r.id]=r,t._register(r),r})})).then.apply(i,r(b(function(){t._deregisterPending&&t._deregisterPending(o)})));return t._liveQueryClients[n]=o,t._registerPending&&t._registerPending(o),o}},w=function(t,e){if(!t.installationId||1!==t.service)return!0;var n=e._liveQueryClients[t.installationId];return n?n._dispatchCommand(t).catch(function(t){return console.warn(t)}):console.warn("Unexpected message received without any live client match: %O",t),!1},E={name:"leancloud-realtime-plugin-live-query",onRealtimeCreate:_,beforeCommandDispatch:w};t.LiveQueryPlugin=E,(0,d.default)(t,"__esModule",{value:!0})})},function(t,e,n){t.exports=n(657)},function(t,e,n){t.exports=n(658)},function(t,e,n){var r=n(659);t.exports=r},function(t,e,n){var r=n(660);t.exports=r},function(t,e,n){var r=n(661);n(44),t.exports=r},function(t,e,n){n(41),n(65);var r=n(662);t.exports=r},function(t,e,n){var r=n(51),i=n(12),o=n(9),a=n(50),s=o("iterator"),u=Object;t.exports=function(t){var e=u(t);return void 0!==e[s]||"@@iterator"in e||i(a,r(e))}}])});
24//# sourceMappingURL=av-live-query-core-min.js.map
\No newline at end of file