@be-link/request 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/callFunction.d.ts +36 -0
- package/dist/index.d.ts +2 -35
- package/dist/index.js +8 -1
- package/dist/request.d.ts +12 -0
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
import{Buffer as e}from"buffer";function t(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}function n(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}"function"==typeof SuppressedError&&SuppressedError;var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function i(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){if(this instanceof e){var n=[null];return n.push.apply(n,arguments),new(Function.bind.apply(t,n))}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var s={},a={},c={};Object.defineProperty(c,"__esModule",{value:!0}),c.COMMUNITY_SITE_URL=c.IS_DEBUG_MODE=c.getProtocol=c.setProtocol=c.getSdkName=c.setSdkName=void 0;var u="@cloudbase/js-sdk";c.setSdkName=function(e){u=e},c.getSdkName=function(){return u};var f="undefined"!=typeof location&&"http:"===location.protocol?"http:":"https:";c.setProtocol=function(e){f=e},c.getProtocol=function(){return f},c.IS_DEBUG_MODE="development"===process.env.NODE_ENV,c.COMMUNITY_SITE_URL="https://support.qq.com/products/148793";var l={};Object.defineProperty(l,"__esModule",{value:!0}),l.ERRORS=void 0,l.ERRORS={INVALID_PARAMS:"INVALID_PARAMS",INVALID_SYNTAX:"INVALID_SYNTAX",INVALID_OPERATION:"INVALID_OPERATION",OPERATION_FAIL:"OPERATION_FAIL",NETWORK_ERROR:"NETWORK_ERROR",UNKOWN_ERROR:"UNKOWN_ERROR"},function(e){var t=r&&r.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=r&&r.__exportStar||function(e,n){for(var r in e)"default"===r||n.hasOwnProperty(r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(c,e),n(l,e)}(a);var h,p={},d={};!function(e){e.local="local",e.none="none",e.session="session"}(h||(h={}));var y=function(){},g=function(){};function v(e,t,n){void 0===n&&(n={});var r=/\?/.test(t),o="";for(var i in n)""===o?!r&&(t+="?"):o+="&",o+=i+"="+encodeURIComponent(n[i]);return/^http(s)?\:\/\//.test(t+=o)?t:""+e+t}var m,_=i(Object.freeze({__proto__:null,AbstractSDKRequest:y,AbstractStorage:g,get StorageType(){return h},formatUrl:v})),b={},w={exports:{}},E={exports:{}};function S(){return m||(m=1,E.exports=(e=e||function(e,t){var n=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),r={},o=r.lib={},i=o.Base={extend:function(e){var t=n(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},s=o.WordArray=i.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i<o;i++){var s=n[i>>>2]>>>24-i%4*8&255;t[r+i>>>2]|=s<<24-(r+i)%4*8}else for(i=0;i<o;i+=4)t[r+i>>>2]=n[i>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n,r=[],o=function(t){var n=987654321,r=4294967295;return function(){var o=((n=36969*(65535&n)+(n>>16)&r)<<16)+(t=18e3*(65535&t)+(t>>16)&r)&r;return o/=4294967296,(o+=.5)*(e.random()>.5?1:-1)}},i=0;i<t;i+=4){var a=o(4294967296*(n||e.random()));n=987654071*a(),r.push(4294967296*a()|0)}return new s.init(r,t)}}),a=r.enc={},c=a.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new s.init(n,t/2)}},u=a.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new s.init(n,t)}},f=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},l=o.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,o=n.sigBytes,i=this.blockSize,a=o/(4*i),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*i,u=e.min(4*c,o);if(c){for(var f=0;f<c;f+=i)this._doProcessBlock(r,f);var l=r.splice(0,c);n.sigBytes-=u}return new s.init(l,u)},clone:function(){var e=i.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});o.Hasher=l.extend({cfg:i.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new h.HMAC.init(e,n).finalize(t)}}});var h=r.algo={};return r}(Math),e)),E.exports;var e}var I,O={exports:{}};function A(){return I?O.exports:(I=1,O.exports=(e=S(),function(t){var n=e,r=n.lib,o=r.WordArray,i=r.Hasher,s=n.algo,a=[],c=[];!function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,o=0;o<64;)e(r)&&(o<8&&(a[o]=n(t.pow(r,.5))),c[o]=n(t.pow(r,1/3)),o++),r++}();var u=[],f=s.SHA256=i.extend({_doReset:function(){this._hash=new o.init(a.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],a=n[4],f=n[5],l=n[6],h=n[7],p=0;p<64;p++){if(p<16)u[p]=0|e[t+p];else{var d=u[p-15],y=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,g=u[p-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;u[p]=y+u[p-7]+v+u[p-16]}var m=r&o^r&i^o&i,_=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),b=h+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&f^~a&l)+c[p]+u[p];h=l,l=f,f=a,a=s+b|0,s=i,i=o,o=r,r=b+(_+m)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0,n[5]=n[5]+f|0,n[6]=n[6]+l|0,n[7]=n[7]+h|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,o=8*e.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=t.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=i._createHelper(f),n.HmacSHA256=i._createHmacHelper(f)}(Math),e.SHA256));var e}var N,T,R,P,x,L={exports:{}};w.exports=function(e){return e.HmacSHA256}(S(),A(),N||(N=1,L.exports=(T=S(),P=(R=T).lib.Base,x=R.enc.Utf8,void(R.algo.HMAC=P.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=x.parse(t));var n=e.blockSize,r=4*n;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),i=this._iKey=t.clone(),s=o.words,a=i.words,c=0;c<n;c++)s[c]^=1549556828,a[c]^=909522486;o.sigBytes=i.sigBytes=r,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})))));var C=w.exports,k={exports:{}};k.exports=function(e){return function(){var t=e,n=t.lib.WordArray;function r(e,t,r){for(var o=[],i=0,s=0;s<t;s++)if(s%4){var a=r[e.charCodeAt(s-1)]<<s%4*2,c=r[e.charCodeAt(s)]>>>6-s%4*2;o[i>>>2]|=(a|c)<<24-i%4*8,i++}return n.create(o,i)}t.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var o=[],i=0;i<n;i+=3)for(var s=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a<n;a++)o.push(r.charAt(s>>>6*(3-a)&63));var c=r.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e){var t=e.length,n=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<n.length;i++)o[n.charCodeAt(i)]=i}var s=n.charAt(64);if(s){var a=e.indexOf(s);-1!==a&&(t=a)}return r(e,t,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64}(S());var D=k.exports,j={exports:{}};j.exports=function(e){return e.enc.Utf8}(S());var U=j.exports,M=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(b,"__esModule",{value:!0}),b.transformPhone=b.sleep=b.printGroupLog=b.throwError=b.printInfo=b.printError=b.printWarn=b.execCallback=b.createPromiseCallback=b.removeParam=b.getHash=b.getQuery=b.toQueryString=b.createSign=b.formatUrl=b.genSeqId=b.isFormData=b.isInstanceOf=b.isNull=b.isPalinObject=b.isUndefined=b.isString=b.isArray=void 0;var q=M(C),W=M(D),F=M(U),B=a;function $(e){var t=W.default.stringify(e);return t=(t=(t=t.replace(/=+$/,"")).replace(/\+/g,"-")).replace(/\//g,"_")}b.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},b.isString=function(e){return"string"==typeof e},b.isUndefined=function(e){return void 0===e},b.isPalinObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},b.isNull=function(e){return"[object Null]"===Object.prototype.toString.call(e)},b.isInstanceOf=function(e,t){return e instanceof t},b.isFormData=function(e){return"[object FormData]"===Object.prototype.toString.call(e)},b.genSeqId=function(){return Math.random().toString(16).slice(2)},b.formatUrl=function(e,t,n){void 0===n&&(n={});var r=/\?/.test(t),o="";for(var i in n)""===o?!r&&(t+="?"):o+="&",o+=i+"="+encodeURIComponent(n[i]);return/^http(s)?\:\/\//.test(t+=o)?t:""+e+t},b.createSign=function(e,t){var n=$(F.default.parse(JSON.stringify({alg:"HS256",typ:"JWT"})))+"."+$(F.default.parse(JSON.stringify(e)));return n+"."+$(q.default(n,t))},b.toQueryString=function(e){void 0===e&&(e={});var t=[];for(var n in e)t.push(n+"="+encodeURIComponent(e[n]));return t.join("&")},b.getQuery=function(e,t){if("undefined"==typeof window)return!1;var n=t||window.location.search,r=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),o=n.substr(n.indexOf("?")+1).match(r);return null!=o?o[2]:""},b.getHash=function(e){if("undefined"==typeof window)return"";var t=window.location.hash.match(new RegExp("[#?&/]"+e+"=([^&#]*)"));return t?t[1]:""},b.removeParam=function(e,t){var n=t.split("?")[0],r=[],o=-1!==t.indexOf("?")?t.split("?")[1]:"";if(""!==o){for(var i=(r=o.split("&")).length-1;i>=0;i-=1)r[i].split("=")[0]===e&&r.splice(i,1);n=n+"?"+r.join("&")}return n},b.createPromiseCallback=function(){var e;if(!Promise){(e=function(){}).promise={};var t=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}var n=new Promise((function(t,n){e=function(e,r){return e?n(e):t(r)}}));return e.promise=n,e},b.execCallback=function(e,t,n){if(void 0===n&&(n=null),e&&"function"==typeof e)return e(t,n);if(t)throw t;return n},b.printWarn=function(e,t){console.warn("["+B.getSdkName()+"]["+e+"]:"+t)},b.printError=function(e,t){console.error({code:e,msg:"["+B.getSdkName()+"]["+e+"]:"+t})},b.printInfo=function(e,t){console.log("["+B.getSdkName()+"]["+e+"]:"+t)},b.throwError=function(e,t){throw new Error(JSON.stringify({code:e,msg:"["+B.getSdkName()+"]["+e+"]:"+t}))},b.printGroupLog=function(e){var t=e.title,n=e.subtitle,r=void 0===n?"":n,o=e.content,i=void 0===o?[]:o,s=e.printTrace,a=void 0!==s&&s,c=e.collapsed;void 0!==c&&c?console.groupCollapsed(t,r):console.group(t,r);for(var u=0,f=i;u<f.length;u++){var l=f[u],h=l.type,p=l.body;switch(h){case"info":console.log(p);break;case"warn":console.warn(p);break;case"error":console.error(p)}}a&&console.trace("stack trace:"),console.groupEnd()},b.sleep=function(e){return void 0===e&&(e=0),new Promise((function(t){return setTimeout(t,e)}))},b.transformPhone=function(e){return"+86"+e};var H,G=r&&r.__extends||(H=function(e,t){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},H(e,t)},function(e,t){function n(){this.constructor=e}H(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),K=r&&r.__assign||function(){return K=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},K.apply(this,arguments)},V=r&&r.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},J=r&&r.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(d,"__esModule",{value:!0}),d.WebRequest=d.genAdapter=void 0;var Y=b,Z=c,X=function(e){function t(t){var n=e.call(this)||this,r=t.timeout,o=t.timeoutMsg,i=t.restrictedMethods;return n._timeout=r||0,n._timeoutMsg=o||"请求超时",n._restrictedMethods=i||["get","post","upload","download"],n}return G(t,e),t.prototype.get=function(e){return this._request(K(K({},e),{method:"get"}),this._restrictedMethods.includes("get"))},t.prototype.post=function(e){return this._request(K(K({},e),{method:"post"}),this._restrictedMethods.includes("post"))},t.prototype.put=function(e){return this._request(K(K({},e),{method:"put"}))},t.prototype.upload=function(e){var t=e.data,n=e.file,r=e.name,o=new FormData;for(var i in t)o.append(i,t[i]);return o.append("key",r),o.append("file",n),this._request(K(K({},e),{data:o,method:"post"}),this._restrictedMethods.includes("upload"))},t.prototype.download=function(e){return V(this,void 0,void 0,(function(){var t,n,r,o;return J(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.get(K(K({},e),{headers:{},responseType:"blob"}))];case 1:return t=i.sent().data,n=window.URL.createObjectURL(new Blob([t])),r=decodeURIComponent(new URL(e.url).pathname.split("/").pop()||""),(o=document.createElement("a")).href=n,o.setAttribute("download",r),o.style.display="none",document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(n),document.body.removeChild(o),[3,3];case 2:return i.sent(),[3,3];case 3:return[2,new Promise((function(t){t({statusCode:200,tempFilePath:e.url})}))]}}))}))},t.prototype._request=function(e,t){var n=this;void 0===t&&(t=!1);var r=String(e.method).toLowerCase()||"get";return new Promise((function(o){var i,s,a=e.url,c=e.headers,u=void 0===c?{}:c,f=e.data,l=e.responseType,h=e.withCredentials,p=e.body,d=e.onUploadProgress,y=Y.formatUrl(Z.getProtocol(),a,"get"===r?f:{}),g=new XMLHttpRequest;for(var v in g.open(r,y),l&&(g.responseType=l),u)g.setRequestHeader(v,u[v]);d&&g.upload.addEventListener("progress",d),g.onreadystatechange=function(){var e={};if(4===g.readyState){var t=g.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};t.forEach((function(e){var t=e.split(": "),r=t.shift().toLowerCase(),o=t.join(": ");n[r]=o})),e.header=n,e.statusCode=g.status;try{e.data="blob"===l?g.response:JSON.parse(g.responseText)}catch(t){e.data="blob"===l?g.response:g.responseText}clearTimeout(i),o(e)}},t&&n._timeout&&(i=setTimeout((function(){console.warn(n._timeoutMsg),g.abort()}),n._timeout)),s=Y.isFormData(f)?f:"application/x-www-form-urlencoded"===u["content-type"]?Y.toQueryString(f):p||(f?JSON.stringify(f):void 0),h&&(g.withCredentials=!0),g.send(s)}))},t}(_.AbstractSDKRequest);d.WebRequest=X,d.genAdapter=function(){return{root:window,reqClass:X,wsClass:WebSocket,localStorage:localStorage,sessionStorage:sessionStorage}},function(e){var t=r&&r.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&t(r,e,o);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.useDefaultAdapter=e.useAdapters=e.RUNTIME=void 0;var i,s=o(d),a=b;!function(e){e.WEB="web",e.WX_MP="wx_mp"}(i=e.RUNTIME||(e.RUNTIME={})),e.useAdapters=function(e){for(var t=0,n=a.isArray(e)?e:[e];t<n.length;t++){var r=n[t],o=r.isMatch,i=r.genAdapter,s=r.runtime;if(o())return{adapter:i(),runtime:s}}},e.useDefaultAdapter=function(){return{adapter:s.genAdapter(),runtime:i.WEB}}}(p);var z={},Q=r&&r.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ee=r&&r.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},te=r&&r.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(z,"__esModule",{value:!0}),z.CloudbaseCache=void 0;var ne=b,re=a,oe=function(e){function t(t){var n=e.call(this)||this;return n._root=t,t.tcbCacheObject||(t.tcbCacheObject={}),n}return Q(t,e),t.prototype.setItem=function(e,t){this._root.tcbCacheObject[e]=t},t.prototype.getItem=function(e){return this._root.tcbCacheObject[e]},t.prototype.removeItem=function(e){delete this._root.tcbCacheObject[e]},t.prototype.clear=function(){delete this._root.tcbCacheObject},t}(_.AbstractStorage);function ie(e,t){switch(e){case"local":default:return t.localStorage?t.localStorage:(ne.printWarn(re.ERRORS.INVALID_PARAMS,"localStorage is not supported on current platform"),new oe(t.root));case"none":return new oe(t.root);case"session":return t.sessionStorage?t.sessionStorage:(ne.printWarn(re.ERRORS.INVALID_PARAMS,"sessionStorage is not supported on current platform"),new oe(t.root))}}var se=function(){function e(e){this.keys={};var t=e.persistence,n=e.platformInfo,r=void 0===n?{}:n,o=e.keys,i=void 0===o?{}:o,s=e.alwaysLocalKeys,a=void 0===s?[]:s;this._platformInfo=r,this._alwaysLocalKeys=a,this._storage||(this._persistence=r.adapter.primaryStorage||t,this._storage=ie(this._persistence,r.adapter),this.keys=i)}return Object.defineProperty(e.prototype,"mode",{get:function(){return this._storage.mode||"sync"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"persistence",{get:function(){return this._persistence},enumerable:!1,configurable:!0}),e.prototype.updatePersistence=function(e){if("async"!==this.mode){if(e!==this._persistence){var t="local"===this._persistence;this._persistence=e;var n=ie(e,this._platformInfo.adapter);for(var r in this.keys){var o=this.keys[r];if(!t||!this._alwaysLocalKeys.includes(r)){var i=this._storage.getItem(o);ne.isUndefined(i)||ne.isNull(i)||(n.setItem(o,i),this._storage.removeItem(o))}}this._storage=n}}else ne.printWarn(re.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use updatePersistenceAsync insteed")},e.prototype.updatePersistenceAsync=function(e){return ee(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,c;return te(this,(function(u){switch(u.label){case 0:if(e===this._persistence)return[2];for(o in t="local"===this._persistence,this._persistence=e,n=ie(e,this._platformInfo.adapter),r=[],this.keys)r.push(o);i=0,u.label=1;case 1:return i<r.length?(s=r[i],a=this.keys[s],t&&this._alwaysLocalKeys.includes(s)?[3,4]:[4,this._storage.getItem(a)]):[3,5];case 2:return c=u.sent(),ne.isUndefined(c)||ne.isNull(c)?[3,4]:(n.setItem(a,c),[4,this._storage.removeItem(a)]);case 3:u.sent(),u.label=4;case 4:return i++,[3,1];case 5:return this._storage=n,[2]}}))}))},e.prototype.setStore=function(e,t,n){if("async"!==this.mode){if(this._storage)try{var r={version:n||"localCachev1",content:t};this._storage.setItem(e,JSON.stringify(r))}catch(e){throw new Error(JSON.stringify({code:re.ERRORS.OPERATION_FAIL,msg:"["+re.getSdkName()+"]["+re.ERRORS.OPERATION_FAIL+"]setStore failed",info:e}))}}else ne.printWarn(re.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},e.prototype.setStoreAsync=function(e,t,n){return ee(this,void 0,void 0,(function(){var r;return te(this,(function(o){switch(o.label){case 0:if(!this._storage)return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),r={version:n||"localCachev1",content:t},[4,this._storage.setItem(e,JSON.stringify(r))];case 2:return o.sent(),[3,4];case 3:return o.sent(),[2];case 4:return[2]}}))}))},e.prototype.getStore=function(e,t){var n;if("async"!==this.mode){try{if("undefined"!=typeof process&&(null===(n=process.env)||void 0===n?void 0:n.tcb_token))return process.env.tcb_token;if(!this._storage)return""}catch(e){return""}t=t||"localCachev1";var r=this._storage.getItem(e);return r&&r.indexOf(t)>=0?JSON.parse(r).content:""}ne.printWarn(re.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},e.prototype.getStoreAsync=function(e,t){var n;return ee(this,void 0,void 0,(function(){var r;return te(this,(function(o){switch(o.label){case 0:try{if("undefined"!=typeof process&&(null===(n=process.env)||void 0===n?void 0:n.tcb_token))return[2,process.env.tcb_token];if(!this._storage)return[2,""]}catch(e){return[2,""]}return t=t||"localCachev1",[4,this._storage.getItem(e)];case 1:return(r=o.sent())&&r.indexOf(t)>=0?[2,JSON.parse(r).content]:[2,""]}}))}))},e.prototype.removeStore=function(e){"async"!==this.mode?this._storage.removeItem(e):ne.printWarn(re.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},e.prototype.removeStoreAsync=function(e){return ee(this,void 0,void 0,(function(){return te(this,(function(t){switch(t.label){case 0:return[4,this._storage.removeItem(e)];case 1:return t.sent(),[2]}}))}))},e}();z.CloudbaseCache=se;var ae={},ce=r&&r.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ue=r&&r.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r};Object.defineProperty(ae,"__esModule",{value:!0}),ae.removeEventListener=ae.activateEvent=ae.addEventListener=ae.CloudbaseEventEmitter=ae.IErrorEvent=ae.CloudbaseEvent=void 0;var fe=b;var le=function(e,t){this.data=t||null,this.name=e};ae.CloudbaseEvent=le;var he=function(e){function t(t,n){var r=e.call(this,"error",{error:t,data:n})||this;return r.error=t,r}return ce(t,e),t}(le);ae.IErrorEvent=he;var pe=function(){function e(){this._listeners={}}return e.prototype.on=function(e,t){return function(e,t,n){n[e]=n[e]||[],n[e].push(t)}(e,t,this._listeners),this},e.prototype.off=function(e,t){return function(e,t,n){if(null==n?void 0:n[e]){var r=n[e].indexOf(t);-1!==r&&n[e].splice(r,1)}}(e,t,this._listeners),this},e.prototype.fire=function(e,t){if(fe.isInstanceOf(e,he))return console.error(e.error),this;var n=fe.isString(e)?new le(e,t||{}):e,r=n.name;if(this._listens(r)){n.target=this;for(var o=0,i=this._listeners[r]?ue(this._listeners[r]):[];o<i.length;o++){i[o].call(this,n)}}return this},e.prototype._listens=function(e){return this._listeners[e]&&this._listeners[e].length>0},e}();ae.CloudbaseEventEmitter=pe;var de=new pe;ae.addEventListener=function(e,t){de.on(e,t)},ae.activateEvent=function(e,t){void 0===t&&(t={}),de.fire(e,t)},ae.removeEventListener=function(e,t){de.off(e,t)};var ye={},ge={},ve=r&&r.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},me=r&&r.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(ge,"__esModule",{value:!0}),ge.catchErrorsDecorator=void 0;var _e=b,be=a,we=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(we=-1!==navigator.userAgent.indexOf("Firefox"));var Ee=we?/(\.js\/)?__decorate(\$\d+)?<@.*\d$/:/(\/\w+\.js\.)?__decorate(\$\d+)?\s*\(.*\)$/,Se=/https?\:\/\/.+\:\d*\/.*\.js\:\d+\:\d+/;function Ie(e){var t=e.err,n=e.className,r=e.methodName,o=e.sourceLink;if(!o)return null;var i,s=t.stack.split("\n"),a=we?/^catchErrorsDecorator\/<\/descriptor.value@.*\d$/:new RegExp(n+"\\.descriptor.value\\s*\\[as\\s"+r+"\\]\\s*\\(.*\\)$"),c=we?/^catchErrorsDecorator\/<\/descriptor.value/:new RegExp(n+"\\.descriptor.value\\s*\\[as\\s"+r+"\\]"),u=s.findIndex((function(e){return a.test(e)}));if(-1!==u){var f=s.filter((function(e,t){return t>u}));f.unshift(s[u].replace(c,n+"."+r).replace(Se,o)),(i=new Error).stack=(we?"@debugger":"Error")+"\n"+f.join("\n")}return i}ge.catchErrorsDecorator=function(e){var t=e.mode,n=void 0===t?"async":t,r=e.customInfo,o=void 0===r?{}:r,i=e.title,s=e.messages,a=void 0===s?[]:s;return function(e,t,r){if(be.IS_DEBUG_MODE){var s=o.className||e.constructor.name,c=o.methodName||t,u=r.value,f=function(e){var t="",n=e.stack.split("\n"),r=n.findIndex((function(e){return Ee.test(e)}));if(-1!==r){var o=Se.exec(n[r+1]||"");t=o?o[0]:""}return t}(new Error);r.value="sync"===n?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Ie({err:new Error,className:s,methodName:c,sourceLink:f});try{return u.apply(this,e)}catch(e){var r=e,o=e.message,l={title:i||s+"."+c+" failed",content:[{type:"error",body:e}]};if(o&&/^\{.*\}$/.test(o)){var h=JSON.parse(o);l.subtitle=o,h.code&&(n?(n.code=h.code,n.msg=h.msg):(e.code=h.code,e.message=h.msg),r=n||e,l.content=a.map((function(e){return{type:"info",body:e}})))}throw _e.printGroupLog(l),r}}:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ve(this,void 0,void 0,(function(){var t,n,r,o,l,h;return me(this,(function(p){switch(p.label){case 0:t=Ie({err:new Error,className:s,methodName:c,sourceLink:f}),p.label=1;case 1:return p.trys.push([1,3,,4]),[4,u.apply(this,e)];case 2:return[2,p.sent()];case 3:throw n=p.sent(),r=n,o=n.message,l={title:i||s+"."+c+" failed",content:[{type:"error",body:n}]},o&&/^\{.*\}$/.test(o)&&(h=JSON.parse(o),l.subtitle=h,h.code&&(t?(t.code=h.code,t.message=h.msg):(n.code=h.code,n.message=h.msg),r=t||n,l.content=a.map((function(e){return{type:"info",body:e}})))),_e.printGroupLog(l),r;case 4:return[2]}}))}))}}}},function(e){var t=r&&r.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=r&&r.__exportStar||function(e,n){for(var r in e)"default"===r||n.hasOwnProperty(r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(ge,e)}(ye);var Oe=r&&r.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),Ae=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Ne=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&Oe(t,e,n);return Ae(t,e),t};Object.defineProperty(s,"__esModule",{value:!0});var Te=s.helpers=s.utils=s.events=s.cache=s.adapters=s.constants=void 0,Re=Ne(a),Pe=s.constants=Re,xe=Ne(p),Le=s.adapters=xe,Ce=Ne(z),ke=s.cache=Ce,De=Ne(ae),je=s.events=De,Ue=Ne(b),Me=s.utils=Ue,qe=Ne(ye);Te=s.helpers=qe;var We=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Fe=function(){return Fe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Fe.apply(this,arguments)},Be=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},$e=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};var He=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this,r=t.timeout,o=t.timeoutMsg,i=t.restrictedMethods;return n._timeout=r||0,n._timeoutMsg=o||"请求超时",n._restrictedMethods=i||["get","post","upload","download"],n}return We(t,e),t.prototype.post=function(e){var t=this;return new Promise((function(n,r){var o=e.url,i=e.data,s=e.headers,a=wx.request({url:v("https:",o),data:i,timeout:t._timeout,method:"POST",header:s,success:function(e){n(e)},fail:function(e){r(e)},complete:function(e){if(e&&e.errMsg&&(t._timeout&&-1!==t._restrictedMethods.indexOf("post")&&"request:fail timeout"===e.errMsg)){console.warn(t._timeoutMsg);try{a.abort()}catch(e){}}}})}))},t.prototype.upload=function(e){var t=this,n=this;return new Promise((function(r){return Be(t,void 0,void 0,(function(){var t,o,i,s,a,c;return $e(this,(function(u){return t=e.url,o=e.file,i=e.data,s=e.headers,a=e.onUploadProgress,c=wx.uploadFile({url:t,filePath:o,name:"file",formData:Fe({},i),header:s,timeout:this._timeout,success:function(e){var t={statusCode:e.statusCode,data:e.data||{}};200===e.statusCode&&i.success_action_status&&(t.statusCode=parseInt(i.success_action_status,10)),r(t)},fail:function(e){r(e)},complete:function(e){if(e&&e.errMsg&&(n._timeout&&-1!==n._restrictedMethods.indexOf("upload")&&"request:fail timeout"===e.errMsg)){console.warn(n._timeoutMsg);try{c.abort()}catch(e){}}}}),a&&c.onProgressUpdate((function(e){a(e)})),[2]}))}))}))},t.prototype.download=function(e){var t=this,n=this;return new Promise((function(r,o){var i=e.url,s=e.headers,a=wx.downloadFile({url:v("https:",i),header:s,timeout:t._timeout,success:function(e){200===e.statusCode&&e.tempFilePath?r({statusCode:200,tempFilePath:e.tempFilePath}):r(e)},fail:function(e){o(e)},complete:function(e){if(e&&e.errMsg&&(n._timeout&&-1!==n._restrictedMethods.indexOf("download")&&"request:fail timeout"===e.errMsg)){console.warn(n._timeoutMsg);try{a.abort()}catch(e){}}}})}))},t}(y),Ge={setItem:function(e,t){wx.setStorageSync(e,t)},getItem:function(e){return wx.getStorageSync(e)},removeItem:function(e){wx.removeStorageSync(e)},clear:function(){wx.clearStorageSync()}},Ke=function(e,t){void 0===t&&(t={});var n=wx.connectSocket(Fe({url:e},t));return{set onopen(e){n.onOpen(e)},set onmessage(e){n.onMessage(e)},set onclose(e){n.onClose(e)},set onerror(e){n.onError(e)},send:function(e){return n.send({data:e})},close:function(e,t){return n.close({code:e,reason:t})},get readyState(){return n.readyState},CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3}};var Ve={genAdapter:function(){return{root:{},reqClass:He,wsClass:Ke,localStorage:Ge,primaryStorage:h.local,getAppSign:function(){var e=wx.getAccountInfoSync();return"undefined"!=typeof App||"undefined"!=typeof getApp||wx.onAppHide||wx.offAppHide||wx.onAppShow||wx.offAppShow?e&&e.miniProgram?e.miniProgram.appId:"":e&&e.plugin?e.plugin.appId:""}}},isMatch:function(){if("undefined"==typeof wx)return!1;if("undefined"==typeof Page)return!1;if(!wx.getSystemInfoSync)return!1;if(!wx.getStorageSync)return!1;if(!wx.setStorageSync)return!1;if(!wx.connectSocket)return!1;if(!wx.request)return!1;try{if(!wx.getSystemInfoSync())return!1;if("qq"===wx.getSystemInfoSync().AppPlatform)return!1}catch(e){return!1}return!0},runtime:"wx_mp"},Je=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r},Ye=Pe.ERRORS,Ze={};function Xe(e,t){var n=t.name,r=t.namespace,o=t.entity,i=t.injectEvents,s=t.IIFE,a=void 0!==s&&s;if(Ze[n]||r&&e[r])throw new Error(JSON.stringify({code:Ye.INVALID_OPERATION,msg:"Duplicate component "+n}));if(a){if(!o||"function"!=typeof o)throw new Error(JSON.stringify({code:Ye.INVALID_PARAMS,msg:"IIFE component's entity must be a function"}));o.call(e)}if(Ze[n]=t,r?e.prototype[r]=o:ze(e.prototype,o),i){var c=i.bus,u=i.events;if(!c||!u||0===u.length)return;var f=e.prototype.fire||function(){};e.prototype.events||(e.prototype.events={}),(e.prototype.events||{})[n]?e.prototype.events[n].events=Je(e.prototype.events[n].events,u):e.prototype.events[n]={bus:c,events:u},e.prototype.fire=function(e,t){for(var n in f(e,t),this.events){var r=this.events[n],o=r.bus;if(r.events.includes(e)){o.fire(e,t);break}}}}}function ze(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var n in t)t.hasOwnProperty(n)&&(e[n]=ze(e[n],t[n]));return e}var Qe={},et=function(){return et=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},et.apply(this,arguments)},tt=ke.CloudbaseCache,nt={},rt={};function ot(e){var t=e.env,n=e.persistence,r=e.platformInfo,o={accessTokenKey:"access_token_"+t,accessTokenExpireKey:"access_token_expire_"+t,refreshTokenKey:"refresh_token_"+t,anonymousUuidKey:"anonymous_uuid_"+t,loginTypeKey:"login_type_"+t,userInfoKey:"user_info_"+t};nt[t]?nt[t].updatePersistence(n):nt[t]=new tt(et(et({},e),{keys:o,platformInfo:r,alwaysLocalKeys:["anonymousUuidKey"]})),rt[t]=rt[t]||new tt(et(et({},e),{keys:o,platformInfo:r,persistence:"local"}))}function it(e){return nt[e]}function st(e){return rt[e]}var at=Pe.setSdkName,ct=Pe.setProtocol,ut="",ft="@cloudbase/js-sdk";var lt,ht="undefined"!=typeof location&&"http:"===location.protocol?"http:":"https:",pt="undefined"!=typeof process&&"e2e"===process.env.NODE_ENV&&"pre"===process.env.END_POINT?"//tcb-pre.tencentcloudapi.com/web":"//tcb-api.tencentcloudapi.com/web";function dt(e,t){pt=e,t&&(ht=t,ct(t))}function yt(){return{BASE_URL:pt,PROTOCOL:ht}}!function(e){e.ANONYMOUS="ANONYMOUS",e.WECHAT="WECHAT",e.CUSTOM="CUSTOM",e.NULL="NULL"}(lt||(lt={}));var gt="loginStateExpire",vt="refreshAccessToken",mt=function(){return mt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},mt.apply(this,arguments)},_t=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},bt=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},wt=Pe.ERRORS,Et=Me.genSeqId,St=Me.isFormData,It=Me.formatUrl,Ot=Me.createSign,At=Le.RUNTIME,Nt=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"];function Tt(e,t,n){var r=e[t];e[t]=function(t){var o={},i={};n.forEach((function(n){var r=n.call(e,t),s=r.data,a=r.headers;Object.assign(o,s),Object.assign(i,a)}));var s=t.data;return s&&function(){if(St(s))for(var e in o)s.append(e,o[e]);else t.data=mt(mt({},s),o)}(),t.headers=mt(mt({},t.headers||{}),i),r.call(e,t)}}function Rt(){var e=Et();return{data:{seqId:e},headers:{"X-SDK-Version":"@cloudbase/js-sdk/"+ut,"x-seqid":e}}}var Pt=function(){function e(e){this._throwWhenRequestFail=!1,this.config=e,this._reqClass=new Qe.adapter.reqClass({timeout:this.config.timeout,timeoutMsg:"[@cloudbase/js-sdk] 请求在"+this.config.timeout/1e3+"s内未完成,已中断",restrictedMethods:["post"]}),this._throwWhenRequestFail=e.throw||!1,this._cache=it(this.config.env),this._localCache=st(this.config.env),Tt(this._reqClass,"post",[Rt]),Tt(this._reqClass,"upload",[Rt]),Tt(this._reqClass,"download",[Rt])}return e.prototype.post=function(e){return _t(this,void 0,void 0,(function(){return bt(this,(function(t){switch(t.label){case 0:return[4,this._reqClass.post(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.upload=function(e){return _t(this,void 0,void 0,(function(){return bt(this,(function(t){switch(t.label){case 0:return[4,this._reqClass.upload(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.download=function(e){return _t(this,void 0,void 0,(function(){return bt(this,(function(t){switch(t.label){case 0:return[4,this._reqClass.download(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.refreshAccessToken=function(){return _t(this,void 0,void 0,(function(){var e,t,n;return bt(this,(function(r){switch(r.label){case 0:this._refreshAccessTokenPromise||(this._refreshAccessTokenPromise=this._refreshAccessToken()),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this._refreshAccessTokenPromise];case 2:return e=r.sent(),[3,4];case 3:return n=r.sent(),t=n,[3,4];case 4:if(this._refreshAccessTokenPromise=null,this._shouldRefreshAccessTokenHook=null,t)throw t;return[2,e]}}))}))},e.prototype.getAccessToken=function(){return _t(this,void 0,void 0,(function(){var e,t,n,r,o,i,s,a,c;return bt(this,(function(u){switch(u.label){case 0:return e=this._cache.keys,t=e.accessTokenKey,n=e.accessTokenExpireKey,r=e.refreshTokenKey,[4,this._cache.getStoreAsync(r)];case 1:if(!u.sent())throw new Error(JSON.stringify({code:wt.OPERATION_FAIL,msg:"refresh token is not exist, your local data might be messed up, please retry after clear localStorage or sessionStorage"}));return[4,this._cache.getStoreAsync(t)];case 2:return o=u.sent(),s=Number,[4,this._cache.getStoreAsync(n)];case 3:return i=s.apply(void 0,[u.sent()]),a=!0,(c=this._shouldRefreshAccessTokenHook)?[4,this._shouldRefreshAccessTokenHook(o,i)]:[3,5];case 4:c=!u.sent(),u.label=5;case 5:return c&&(a=!1),o&&i&&!(i<Date.now())||!a?[3,7]:[4,this.refreshAccessToken()];case 6:return[2,u.sent()];case 7:return[2,{accessToken:o,accessTokenExpire:i}]}}))}))},e.prototype.request=function(e,t,n){return _t(this,void 0,void 0,(function(){var r,o,i,s,a,c,u,f,l,h,p,d,y,g,v,m,_,b,w,E,S,I,O,A,N,T;return bt(this,(function(R){switch(R.label){case 0:return r="x-tcb-trace_"+this.config.env,o="application/x-www-form-urlencoded",i=mt({action:e,dataVersion:"2020-01-10",env:this.config.env},t),-1!==Nt.indexOf(e)?[3,3]:(s=this._cache.keys.refreshTokenKey,[4,this._cache.getStoreAsync(s)]);case 1:return R.sent()?(a=i,[4,this.getAccessToken()]):[3,3];case 2:a.access_token=R.sent().accessToken,R.label=3;case 3:if("storage.uploadFile"===e){for(u in c=new FormData)c.hasOwnProperty(u)&&void 0!==c[u]&&c.append(u,i[u]);o="multipart/form-data"}else for(u in o="application/json;charset=UTF-8",c={},i)void 0!==i[u]&&(c[u]=i[u]);return f={headers:{"content-type":o}},(null==n?void 0:n.onUploadProgress)&&(f.onUploadProgress=n.onUploadProgress),this.config.region&&(f.headers["X-TCB-Region"]=this.config.region),(l=this._localCache.getStore(r))&&(f.headers["X-TCB-Trace"]=l),Qe.runtime!==At.WEB&&(h=this.config,p=h.appSign,d=h.appSecret,y=Date.now(),g=d.appAccessKey,v=d.appAccessKeyId,m=Ot({data:{},timestamp:y,appAccessKeyId:v,appSign:p},g),f.headers["X-TCB-App-Source"]="timestamp="+y+";appAccessKeyId="+v+";appSign="+p+";sign="+m),_=t.parse,b=t.inQuery,w=t.search,E={env:this.config.env},_&&(E.parse=!0),b&&(E=mt(mt({},b),E)),S=yt(),I=S.BASE_URL,O=S.PROTOCOL,A=It(O,I,E),w&&(A+=w),[4,this.post(mt({url:A,data:c},f))];case 4:if(N=R.sent(),(T=N.header&&N.header["x-tcb-trace"])&&this._localCache.setStore(r,T),200!==Number(N.status)&&200!==Number(N.statusCode)||!N.data)throw new Error("network request error");return[2,N]}}))}))},e.prototype.send=function(e,t){return void 0===t&&(t={}),_t(this,void 0,void 0,(function(){var n;return bt(this,(function(r){switch(r.label){case 0:return[4,this.request(e,t,{onUploadProgress:t.onUploadProgress})];case 1:return"ACCESS_TOKEN_EXPIRED"!==(n=r.sent()).data.code||-1!==Nt.indexOf(e)?[3,4]:[4,this.refreshAccessToken()];case 2:return r.sent(),[4,this.request(e,t,{onUploadProgress:t.onUploadProgress})];case 3:n=r.sent(),r.label=4;case 4:if(n.data.code&&this._throwWhenRequestFail)throw new Error(JSON.stringify({code:wt.OPERATION_FAIL,msg:"["+n.data.code+"] "+n.data.message}));return[2,n.data]}}))}))},e.prototype._refreshAccessToken=function(e){return void 0===e&&(e=1),_t(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,c,u,f,l,h,p;return bt(this,(function(d){switch(d.label){case 0:return t=this._cache.keys,n=t.accessTokenKey,r=t.accessTokenExpireKey,o=t.refreshTokenKey,i=t.loginTypeKey,s=t.anonymousUuidKey,[4,this._cache.removeStoreAsync(n)];case 1:return d.sent(),[4,this._cache.removeStoreAsync(r)];case 2:return d.sent(),[4,this._cache.getStoreAsync(o)];case 3:if(!(a=d.sent()))throw new Error(JSON.stringify({code:wt.INVALID_OPERATION,msg:"not login"}));return c={refresh_token:a},[4,this.request("auth.fetchAccessTokenWithRefreshToken",c)];case 4:return(u=d.sent()).data.code?"SIGN_PARAM_INVALID"!==(f=u.data.code)&&"REFRESH_TOKEN_EXPIRED"!==f&&"INVALID_REFRESH_TOKEN"!==f?[3,11]:[4,this._cache.getStoreAsync(i)]:[3,12];case 5:return d.sent()===lt.ANONYMOUS&&"INVALID_REFRESH_TOKEN"===f?[4,this._cache.getStoreAsync(s)]:[3,9];case 6:return l=d.sent(),[4,this._cache.getStoreAsync(o)];case 7:return h=d.sent(),[4,this.send("auth.signInAnonymously",{anonymous_uuid:l,refresh_token:h})];case 8:if(p=d.sent(),this._setRefreshToken(p.refresh_token),e>=1)return[2,this._refreshAccessToken(--e)];throw new Error(JSON.stringify({code:wt.OPERATION_FAIL,message:"重试获取 refresh token 失败"}));case 9:return Jt.fire(gt),[4,this._cache.removeStoreAsync(o)];case 10:d.sent(),d.label=11;case 11:throw new Error(JSON.stringify({code:wt.NETWORK_ERROR,msg:"refresh access_token failed:"+u.data.code}));case 12:return u.data.access_token?(Jt.fire(vt),[4,this._cache.setStoreAsync(n,u.data.access_token)]):[3,15];case 13:return d.sent(),[4,this._cache.setStoreAsync(r,u.data.access_token_expire+Date.now())];case 14:return d.sent(),[2,{accessToken:u.data.access_token,accessTokenExpire:u.data.access_token_expire}];case 15:return u.data.refresh_token?[4,this._cache.removeStoreAsync(o)]:[3,19];case 16:return d.sent(),[4,this._cache.setStoreAsync(o,u.data.refresh_token)];case 17:return d.sent(),[4,this._refreshAccessToken()];case 18:d.sent(),d.label=19;case 19:return[2]}}))}))},e.prototype._setRefreshToken=function(e){return _t(this,void 0,void 0,(function(){var t,n,r,o;return bt(this,(function(i){switch(i.label){case 0:return t=this._cache.keys,n=t.accessTokenKey,r=t.accessTokenExpireKey,o=t.refreshTokenKey,[4,this._cache.removeStoreAsync(n)];case 1:return i.sent(),[4,this._cache.removeStoreAsync(r)];case 2:return i.sent(),[4,this._cache.setStoreAsync(o,e)];case 3:return i.sent(),[2]}}))}))},e}(),xt={};var Lt=function(){return Lt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Lt.apply(this,arguments)},Ct=function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},kt=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Dt=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},jt=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Ut=Le.useAdapters,Mt=Le.useDefaultAdapter,qt=Le.RUNTIME,Wt=Pe.ERRORS,Ft=Pe.COMMUNITY_SITE_URL,Bt=Me.printWarn,$t=Te.catchErrorsDecorator,Ht={timeout:15e3,persistence:"local"},Gt=6e5,Kt={},Vt=function(){function e(e){this._config=e||this._config,this.authInstance=null}return Object.defineProperty(e.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"platform",{get:function(){return Qe},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cache",{get:function(){return it(this._config.env)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localCache",{get:function(){return st(this._config.env)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){return e=this._config.env,xt[e];var e},enumerable:!1,configurable:!0}),e.prototype.init=function(t){if(!t.env)throw new Error(JSON.stringify({code:Wt.INVALID_PARAMS,msg:"env must not be specified"}));if(Qe.adapter||this._useDefaultAdapter(),this.requestClient=new Qe.adapter.reqClass({timeout:t.timeout||5e3,timeoutMsg:"["+ft+"][REQUEST TIMEOUT] request had been abort since didn't finished within"+t.timeout/1e3+"s"}),Qe.runtime!==qt.WEB){if(!t.appSecret)throw new Error(JSON.stringify({code:Wt.INVALID_PARAMS,msg:"invalid appSecret"}));var n=Qe.adapter.getAppSign?Qe.adapter.getAppSign():"";if(t.appSign&&n&&t.appSign!==n)throw new Error(JSON.stringify({code:Wt.INVALID_PARAMS,msg:"invalid appSign"}));if(n&&(t.appSign=n),!t.appSign)throw new Error(JSON.stringify({code:Wt.INVALID_PARAMS,msg:"invalid appSign"}))}this._config=Lt(Lt({},Ht),t),this._config.timeout=this._formatTimeout(this._config.timeout);var r=this._config,o=r.env,i=r.persistence,s=r.debug,a=r.timeout,c=r.appSecret,u=r.appSign;ot({env:o,persistence:i,debug:s,platformInfo:this.platform}),function(e){xt[e.env]=new Pt(mt(mt({},e),{throw:!0}))}({env:o,region:t.region||"",timeout:a,appSecret:c,appSign:u}),t.region&&function(e,t,n){dt(t?"//"+e+"."+t+".tcb-api.tencentcloudapi.com/web":"//"+e+".ap-shanghai.tcb-api.tencentcloudapi.com/web",n)}(o,t.region||"");var f=new e(this._config);return f.requestClient=this.requestClient,f},e.prototype.updateConfig=function(e){var t=e.persistence,n=e.debug;this._config.persistence=t,this._config.debug=n,ot({env:this._config.env,persistence:t,debug:n,platformInfo:this.platform})},e.prototype.registerExtension=function(e){Kt[e.name]=e},e.prototype.invokeExtension=function(e,t){return Dt(this,void 0,void 0,(function(){var n;return jt(this,(function(r){switch(r.label){case 0:if(!(n=Kt[e]))throw new Error(JSON.stringify({code:Wt.INVALID_PARAMS,msg:"extension:"+e+" must be registered before invoke"}));return[4,n.invoke(t,this)];case 1:return[2,r.sent()]}}))}))},e.prototype.useAdapters=function(e){var t=Ut(e)||{},n=t.adapter,r=t.runtime;n&&(Qe.adapter=n),r&&(Qe.runtime=r)},e.prototype.registerHook=function(t){!function(e,t){var n=t.entity,r=t.target;if(!e.prototype.hasOwnProperty(r))throw new Error(JSON.stringify({code:Ye.INVALID_OPERATION,msg:"target:"+r+" is not exist"}));var o=e.prototype[r];if("function"!=typeof o)throw new Error(JSON.stringify({code:Ye.INVALID_OPERATION,msg:"target:"+r+" is not a function which is the only type supports hook"}));e.prototype[r]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.call.apply(n,Je([this],e)),o.call.apply(o,Je([this],e))}}(e,t)},e.prototype.registerComponent=function(t){Xe(e,t)},e.prototype.registerVersion=function(e){!function(e){ut=e}(e)},e.prototype.registerSdkName=function(e){!function(e){ft=e,at(e)}(e)},e.prototype.registerEndPoint=function(e,t){dt(e,t)},e.prototype._useDefaultAdapter=function(){var e=Mt(),t=e.adapter,n=e.runtime;Qe.adapter=t,Qe.runtime=n},e.prototype._formatTimeout=function(e){switch(!0){case e>Gt:return Bt(Wt.INVALID_PARAMS,"timeout is greater than maximum value[10min]"),Gt;case e<100:return Bt(Wt.INVALID_PARAMS,"timeout is less than maximum value[100ms]"),100;default:return e}},Ct([$t({mode:"sync",title:"Cloudbase 初始化失败",messages:["请确认以下各项:"," 1 - 调用 cloudbase.init() 的语法或参数是否正确"," 2 - 如果是非浏览器环境,是否配置了安全应用来源(https://docs.cloudbase.net/api-reference/webv2/adapter.html#jie-ru-liu-cheng)","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+Ft]}),kt("design:type",Function),kt("design:paramtypes",[Object]),kt("design:returntype",e)],e.prototype,"init",null),Ct([$t({title:"调用扩展能力失败",messages:["请确认以下各项:"," 1 - 调用 invokeExtension() 的语法或参数是否正确"," 2 - 被调用的扩展能力是否已经安装并通过 registerExtension() 注册","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+Ft]}),kt("design:type",Function),kt("design:paramtypes",[String,Object]),kt("design:returntype",Promise)],e.prototype,"invokeExtension",null),e}(),Jt=new Vt;Jt.useAdapters(Ve);var Yt,Zt=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Xt=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},zt=function(){function e(e){this._config=e,this._cache=e.cache,this._request=e.request}return e.prototype.checkLocalLoginState=function(){return Zt(this,void 0,void 0,(function(){var e,t,n,r,o,i;return Xt(this,(function(s){switch(s.label){case 0:return e=this._cache.keys,t=e.accessTokenKey,n=e.accessTokenExpireKey,[4,this._cache.getStoreAsync(t)];case 1:return r=s.sent(),[4,this._cache.getStoreAsync(n)];case 2:return o=s.sent(),r?o&&o>Date.now()?[4,(i=new Dr({envId:this._config.env,cache:this._cache,request:this._request})).checkLocalStateAsync()]:[3,4]:[3,7];case 3:return s.sent(),[2,i];case 4:return[4,this._cache.removeStoreAsync(t)];case 5:return s.sent(),[4,this._cache.removeStoreAsync(n)];case 6:s.sent(),s.label=7;case 7:return[2]}}))}))},e.prototype.setRefreshToken=function(e){return Zt(this,void 0,void 0,(function(){var t,n,r,o;return Xt(this,(function(i){switch(i.label){case 0:return t=this._cache.keys,n=t.accessTokenKey,r=t.accessTokenExpireKey,o=t.refreshTokenKey,[4,this._cache.removeStoreAsync(n)];case 1:return i.sent(),[4,this._cache.removeStoreAsync(r)];case 2:return i.sent(),[4,this._cache.setStoreAsync(o,e)];case 3:return i.sent(),[2]}}))}))},e.prototype.setAccessToken=function(e,t){return Zt(this,void 0,void 0,(function(){var n,r,o;return Xt(this,(function(i){switch(i.label){case 0:return n=this._cache.keys,r=n.accessTokenKey,o=n.accessTokenExpireKey,[4,this._cache.setStoreAsync(r,e)];case 1:return i.sent(),[4,this._cache.setStoreAsync(o,t)];case 2:return i.sent(),[2]}}))}))},e.prototype.refreshUserInfo=function(){return Zt(this,void 0,void 0,(function(){var e;return Xt(this,(function(t){switch(t.label){case 0:return"auth.getUserInfo",[4,this._request.send("auth.getUserInfo",{})];case 1:return e=t.sent().data,[4,this.setLocalUserInfo(e)];case 2:return t.sent(),[2,e]}}))}))},e.prototype.setLocalUserInfo=function(e){return Zt(this,void 0,void 0,(function(){var t;return Xt(this,(function(n){switch(n.label){case 0:return t=this._cache.keys.userInfoKey,[4,this._cache.setStoreAsync(t,e)];case 1:return n.sent(),[2]}}))}))},e}();!function(e){e.ANONYMOUS="ANONYMOUS",e.WECHAT="WECHAT",e.WECHAT_PUBLIC="WECHAT-PUBLIC",e.WECHAT_OPEN="WECHAT-OPEN",e.CUSTOM="CUSTOM",e.EMAIL="EMAIL",e.USERNAME="USERNAME",e.NULL="NULL",e.PHONE="PHONE"}(Yt||(Yt={}));var Qt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),en=function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},tn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},nn=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},rn=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},on=Pe.getSdkName,sn=Pe.ERRORS,an=Pe.COMMUNITY_SITE_URL,cn=Le.RUNTIME,un=Me.getQuery,fn=Me.getHash,ln=Me.removeParam,hn=Me.printWarn,pn=Te.catchErrorsDecorator,dn=function(e){function t(t,n,r,o){var i=e.call(this,t)||this;return i._runtime=t.runtime,i._appid=n,i._scope=r,i._state=o||"weixin",i}return Qt(t,e),t.prototype.signIn=function(){return nn(this,void 0,void 0,(function(){return rn(this,(function(e){return[2,hn(sn.OPERATION_FAIL,"API signIn has been deprecated, please use signInWithRedirect insteed")]}))}))},t.prototype.signInWithRedirect=function(){return nn(this,void 0,void 0,(function(){return rn(this,(function(e){return[2,this._redirect()]}))}))},t.prototype.getRedirectResult=function(e){return nn(this,void 0,void 0,(function(){var t;return rn(this,(function(n){return(t=yn())?[2,this._signInWithCode(t,e)]:[2,null]}))}))},t.prototype.getLinkRedirectResult=function(e){return void 0===e&&(e={}),nn(this,void 0,void 0,(function(){var t,n,r,o,i,s;return rn(this,(function(a){return t=e.withUnionId,n=void 0!==t&&t,(r=yn())?(o=this._appid,c=this._scope,i="snsapi_login"===c?"WECHAT-OPEN":"WECHAT-PUBLIC",s=this._runtime===cn.WX_MP?"1":"0",[2,this._request.send("auth.linkWithWeixinCode",{payload:{appid:o,loginType:i,code:r,hybridMiniapp:s,withUnionId:n}})]):[2,null];var c}))}))},t.prototype._redirect=function(){var e=ln("code",location.href);e=ln("state",e),e=encodeURIComponent(e);var t="//open.weixin.qq.com/connect/oauth2/authorize";"snsapi_login"===this._scope&&(t="//open.weixin.qq.com/connect/qrconnect");try{location.href=t+"?appid="+this._appid+"&redirect_uri="+e+"&response_type=code&scope="+this._scope+"&state="+this._state+"#wechat_redirect"}catch(e){throw new Error("["+on()+"]["+sn.UNKOWN_ERROR+"]"+e)}},t.prototype._signInWithCode=function(e,t){return nn(this,void 0,void 0,(function(){var n,r,o,i,s,a,c,u;return rn(this,(function(f){switch(f.label){case 0:return n=this._cache.keys,r=n.accessTokenKey,o=n.accessTokenExpireKey,i=n.refreshTokenKey,l=this._scope,s="snsapi_login"===l?"WECHAT-OPEN":"WECHAT-PUBLIC",[4,this._getRefreshTokenByWXCode(this._appid,s,e,t)];case 1:return a=f.sent(),c=a.refreshToken,[4,this._cache.setStoreAsync(i,c)];case 2:return f.sent(),a.accessToken?[4,this._cache.setStoreAsync(r,a.accessToken)]:[3,4];case 3:f.sent(),f.label=4;case 4:return a.accessTokenExpire?[4,this._cache.setStoreAsync(o,String(a.accessTokenExpire+Date.now()))]:[3,6];case 5:f.sent(),f.label=6;case 6:return Cr.fire(Ur.LOGIN_STATE_CHANGED),Cr.fire(Ur.LOGIN_TYPE_CHANGED,{env:this._config.env,loginType:Yt.WECHAT,persistence:this._config.persistence}),[4,this.refreshUserInfo()];case 7:return f.sent(),[4,(u=new Dr({envId:this._config.env,cache:this._cache,request:this._request})).checkLocalStateAsync()];case 8:return f.sent(),[2,u]}var l}))}))},t.prototype._getRefreshTokenByWXCode=function(e,t,n,r){return void 0===r&&(r={}),nn(this,void 0,void 0,(function(){var o,i,s,a,c,u;return rn(this,(function(f){return o=r.withUnionId,i=void 0!==o&&o,s=r.createUser,a=void 0===s||s,c="snsapi_base"!==this._scope&&(r.syncUserInfo||!1),"auth.signIn",u=this._runtime===cn.WX_MP?"1":"0",[2,this._request.send("auth.signIn",{appid:e,loginType:t,hybridMiniapp:u,syncUserInfo:c,loginCredential:n,withUnionId:i,createUser:a}).then((function(e){if(e.code)throw new Error("["+on()+"]["+sn.OPERATION_FAIL+"] failed login via wechat: "+e.code);if(e.refresh_token)return{refreshToken:e.refresh_token,accessToken:e.access_token,accessTokenExpire:e.access_token_expire};throw new Error("["+on()+"]["+sn.OPERATION_FAIL+"] action:getJwt not return refreshToken")}))]}))}))},en([pn({title:"跳转微信公众号授权失败",messages:["请确认以下各项:"," 1 - 调用 auth().weixinAuthProvider().signInWithRedirect() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+an]}),tn("design:type",Function),tn("design:paramtypes",[]),tn("design:returntype",Promise)],t.prototype,"signInWithRedirect",null),en([pn({title:"微信公众号登录失败",messages:["请确认以下各项:"," 1 - 调用 auth().weixinAuthProvider().getRedirectResult() 的语法或参数是否正确"," 2 - 当前环境是否开通了微信公众号登录授权"," 3 - 微信公众号的 AppId 与 AppSecret 配置是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+an]}),tn("design:type",Function),tn("design:paramtypes",[Object]),tn("design:returntype",Promise)],t.prototype,"getRedirectResult",null),en([pn({title:"获取微信重定向绑定结果",messages:["请确认以下各项:"," 1 - 调用 auth().weixinAuthProvider().getLinkRedirectResult() 的语法或参数是否正确"," 2 - 当前环境是否开通了微信公众号登录授权"," 3 - 微信公众号的 AppId 与 AppSecret 配置是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+an]}),tn("design:type",Function),tn("design:paramtypes",[Object]),tn("design:returntype",Promise)],t.prototype,"getLinkRedirectResult",null),t}(zt);function yn(){return un("code")||fn("code")}var gn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vn=function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},mn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},_n=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},bn=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},wn=Pe.ERRORS,En=Pe.COMMUNITY_SITE_URL,Sn=Me.throwError,In=Me.isString,On=je.addEventListener,An=Te.catchErrorsDecorator,Nn=function(e){function t(t){var n=e.call(this,t)||this;return n._onConverted=n._onConverted.bind(n),On(Ur.ANONYMOUS_CONVERTED,n._onConverted),n}return gn(t,e),t.prototype.signIn=function(){return _n(this,void 0,void 0,(function(){var e,t,n,r,o,i,s;return bn(this,(function(a){switch(a.label){case 0:return[4,this._cache.updatePersistenceAsync("local")];case 1:return a.sent(),e=this._cache.keys,t=e.anonymousUuidKey,n=e.refreshTokenKey,[4,this._cache.getStoreAsync(t)];case 2:return r=a.sent(),[4,this._cache.getStoreAsync(n)];case 3:return o=a.sent(),[4,this._request.send("auth.signInAnonymously",{anonymous_uuid:r,refresh_token:o})];case 4:return(i=a.sent()).uuid&&i.refresh_token?[4,this._setAnonymousUUID(i.uuid)]:[3,10];case 5:return a.sent(),[4,this.setRefreshToken(i.refresh_token)];case 6:return a.sent(),[4,this._request.refreshAccessToken()];case 7:return a.sent(),Cr.fire(Ur.LOGIN_TYPE_CHANGED,{env:this._config.env,loginType:Yt.ANONYMOUS,persistence:"local"}),Cr.fire(Ur.LOGIN_STATE_CHANGED),[4,(s=new Dr({envId:this._config.env,cache:this._cache,request:this._request})).checkLocalStateAsync()];case 8:return a.sent(),[4,s.user.refresh()];case 9:return a.sent(),[2,s];case 10:throw new Error(JSON.stringify({code:wn.OPERATION_FAIL,msg:JSON.stringify(i)||"anonymous signIn failed"}))}}))}))},t.prototype.linkAndRetrieveDataWithTicket=function(e){return _n(this,void 0,void 0,(function(){var t,n,r,o,i,s,a;return bn(this,(function(c){switch(c.label){case 0:return In(e)||Sn(wn.INVALID_PARAMS,"ticket must be a string"),t=this._cache.keys,n=t.anonymousUuidKey,r=t.refreshTokenKey,[4,this._cache.getStoreAsync(n)];case 1:return o=c.sent(),[4,this._cache.getStoreAsync(r)];case 2:return i=c.sent(),[4,this._request.send("auth.linkAndRetrieveDataWithTicket",{anonymous_uuid:o,refresh_token:i,ticket:e})];case 3:return(s=c.sent()).refresh_token?[4,this._clearAnonymousUUID()]:[3,8];case 4:return c.sent(),[4,this.setRefreshToken(s.refresh_token)];case 5:return c.sent(),[4,this._request.refreshAccessToken()];case 6:return c.sent(),Cr.fire(Ur.ANONYMOUS_CONVERTED,{env:this._config.env}),Cr.fire(Ur.LOGIN_TYPE_CHANGED,{loginType:Yt.CUSTOM,persistence:"local"}),[4,(a=new Dr({envId:this._config.env,cache:this._cache,request:this._request})).checkLocalStateAsync()];case 7:return c.sent(),[2,a];case 8:Sn(wn.OPERATION_FAIL,JSON.stringify(s)||"linkAndRetrieveDataWithTicket failed"),c.label=9;case 9:return[2]}}))}))},t.prototype._setAnonymousUUID=function(e){return _n(this,void 0,void 0,(function(){var t,n,r;return bn(this,(function(o){switch(o.label){case 0:return t=this._cache.keys,n=t.anonymousUuidKey,r=t.loginTypeKey,[4,this._cache.removeStoreAsync(n)];case 1:return o.sent(),[4,this._cache.setStoreAsync(n,e)];case 2:return o.sent(),[4,this._cache.setStoreAsync(r,Yt.ANONYMOUS)];case 3:return o.sent(),[2]}}))}))},t.prototype._clearAnonymousUUID=function(){return _n(this,void 0,void 0,(function(){return bn(this,(function(e){switch(e.label){case 0:return[4,this._cache.removeStoreAsync(this._cache.keys.anonymousUuidKey)];case 1:return e.sent(),[2]}}))}))},t.prototype._onConverted=function(e){return _n(this,void 0,void 0,(function(){return bn(this,(function(t){switch(t.label){case 0:return e.data.env!==this._config.env?[2]:[4,this._cache.updatePersistenceAsync(this._config.persistence)];case 1:return t.sent(),[2]}}))}))},vn([An({title:"匿名登录失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了匿名登录"," 2 - 调用 auth().anonymouseProvider().signIn() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+En]}),mn("design:type",Function),mn("design:paramtypes",[]),mn("design:returntype",Promise)],t.prototype,"signIn",null),t}(zt),Tn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rn=function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},Pn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},xn=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Ln=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Cn=Pe.ERRORS,kn=Pe.COMMUNITY_SITE_URL,Dn=Me.isString,jn=Te.catchErrorsDecorator,Un=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Tn(t,e),t.prototype.signIn=function(e){return xn(this,void 0,void 0,(function(){var t,n,r,o,i,s,a;return Ln(this,(function(c){switch(c.label){case 0:if(!Dn(e))throw new Error(JSON.stringify({code:Cn.INVALID_PARAMS,msg:"ticket must be a string"}));return t=this._cache.keys.refreshTokenKey,o=(r=this._request).send,i=["auth.signInWithTicket"],s={ticket:e},[4,this._cache.getStoreAsync(t)];case 1:return[4,o.apply(r,i.concat([(s.refresh_token=c.sent()||"",s)]))];case 2:return(n=c.sent()).refresh_token?[4,this.setRefreshToken(n.refresh_token)]:[3,7];case 3:return c.sent(),[4,this._request.refreshAccessToken()];case 4:return c.sent(),Cr.fire(Ur.LOGIN_TYPE_CHANGED,{env:this._config.env,loginType:Yt.CUSTOM,persistence:this._config.persistence}),Cr.fire(Ur.LOGIN_STATE_CHANGED),[4,this.refreshUserInfo()];case 5:return c.sent(),[4,(a=new Dr({envId:this._config.env,cache:this._cache,request:this._request})).checkLocalStateAsync()];case 6:return c.sent(),[2,a];case 7:throw new Error(JSON.stringify({code:Cn.OPERATION_FAIL,msg:"custom signIn failed"}))}}))}))},Rn([jn({title:"自定义登录失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了自定义登录"," 2 - 调用 auth().customAuthProvider().signIn() 的语法或参数是否正确"," 3 - ticket 是否归属于当前环境"," 4 - 创建 ticket 的自定义登录私钥是否过期","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+kn]}),Pn("design:type",Function),Pn("design:paramtypes",[String]),Pn("design:returntype",Promise)],t.prototype,"signIn",null),t}(zt),Mn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qn=function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},Wn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Fn=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Bn=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},$n=Me.throwError,Hn=Me.isString,Gn=Pe.ERRORS,Kn=Pe.COMMUNITY_SITE_URL,Vn=Te.catchErrorsDecorator,Jn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Mn(t,e),t.prototype.signIn=function(e,t){return Fn(this,void 0,void 0,(function(){var n,r,o,i,s;return Bn(this,(function(a){switch(a.label){case 0:return Hn(e)||$n(Gn.INVALID_PARAMS,"email must be a string"),n=this._cache.keys.refreshTokenKey,[4,this._request.send("auth.signIn",{loginType:"EMAIL",email:e,password:t,refresh_token:this._cache.getStore(n)||""})];case 1:return r=a.sent(),o=r.refresh_token,i=r.access_token,s=r.access_token_expire,o?[4,this.setRefreshToken(o)]:[3,8];case 2:return a.sent(),i&&s?[4,this.setAccessToken(i,s)]:[3,4];case 3:return a.sent(),[3,6];case 4:return[4,this._request.refreshAccessToken()];case 5:a.sent(),a.label=6;case 6:return[4,this.refreshUserInfo()];case 7:return a.sent(),Cr.fire(Ur.LOGIN_STATE_CHANGED),Cr.fire(Ur.LOGIN_TYPE_CHANGED,{env:this._config.env,loginType:Yt.EMAIL,persistence:this._config.persistence}),[2,new Dr({envId:this._config.env,cache:this._cache,request:this._request})];case 8:r.code?$n(Gn.OPERATION_FAIL,"Email login fail["+r.code+"] "+r.message):$n(Gn.OPERATION_FAIL,"Email login fail"),a.label=9;case 9:return[2]}}))}))},t.prototype.signUp=function(e,t){return Fn(this,void 0,void 0,(function(){return Bn(this,(function(n){return[2,this._request.send("auth.signUpWithEmailAndPassword",{email:e,password:t})]}))}))},t.prototype.resetPassword=function(e){return Fn(this,void 0,void 0,(function(){return Bn(this,(function(t){return[2,this._request.send("auth.sendPasswordResetEmail",{email:e})]}))}))},t.prototype.resetPasswordWithToken=function(e,t){return Fn(this,void 0,void 0,(function(){return Bn(this,(function(n){return[2,this._request.send("auth.resetPasswordWithToken",{token:e,newPassword:t})]}))}))},t.prototype.activate=function(e){return Fn(this,void 0,void 0,(function(){return Bn(this,(function(t){return[2,this._request.send("auth.activateEndUserMail",{token:e})]}))}))},qn([Vn({title:"邮箱密码登录失败",messages:["请确认以下各项:"," 1 - 调用 auth().emailAuthProvider() 的语法或参数是否正确"," 2 - 当前环境是否开通了邮箱登录"," 3 - 邮箱地址与密码是否匹配","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+Kn]}),Wn("design:type",Function),Wn("design:paramtypes",[String,String]),Wn("design:returntype",Promise)],t.prototype,"signIn",null),qn([Vn({title:"邮箱注册失败",messages:["请确认以下各项:"," 1 - 调用 auth().signUpWithEmailAndPassword() 的语法或参数是否正确"," 2 - 当前环境是否开通了邮箱登录"," 3 - 此邮箱地址是否已经被其他用户占用","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+Kn]}),Wn("design:type",Function),Wn("design:paramtypes",[String,String]),Wn("design:returntype",Promise)],t.prototype,"signUp",null),qn([Vn({title:"重置密码失败",messages:["请确认以下各项:"," 1 - 调用 auth().sendPasswordResetEmail() 的语法或参数是否正确"," 2 - 当前环境是否开通了邮箱登录"," 3 - 此邮箱地址是否已经与当前用户绑定"," 4 - 此邮箱地址是否已经被其他用户占用","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+Kn]}),Wn("design:type",Function),Wn("design:paramtypes",[String]),Wn("design:returntype",Promise)],t.prototype,"resetPassword",null),qn([Vn({title:"重置密码失败",messages:["请确认以下各项:"," 1 - 调用语法或参数是否正确"," 2 - 当前环境是否开通了邮箱登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+Kn]}),Wn("design:type",Function),Wn("design:paramtypes",[String,String]),Wn("design:returntype",Promise)],t.prototype,"resetPasswordWithToken",null),qn([Vn({title:"邮箱激活失败",messages:["请确认以下各项:"," 1 - 调用语法或参数是否正确"," 2 - 当前环境是否开通了邮箱登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+Kn]}),Wn("design:type",Function),Wn("design:paramtypes",[String]),Wn("design:returntype",Promise)],t.prototype,"activate",null),t}(zt),Yn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zn=function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},Xn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},zn=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Qn=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},er=Me.printWarn,tr=Pe.ERRORS,nr=Pe.COMMUNITY_SITE_URL,rr=Te.catchErrorsDecorator,or=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Yn(t,e),t.prototype.signIn=function(e,t){return zn(this,void 0,void 0,(function(){var n,r,o,i,s,a,c,u,f;return Qn(this,(function(l){switch(l.label){case 0:if("string"!=typeof e)throw new Error(JSON.stringify({code:tr.INVALID_PARAMS,msg:"username must be a string"}));return"string"!=typeof t&&(t="",er(tr.INVALID_PARAMS,"password is empty")),n=this._cache.keys.refreshTokenKey,i=(o=this._request).send,s=["auth.signIn"],a={loginType:Yt.USERNAME,username:e,password:t},[4,this._cache.getStoreAsync(n)];case 1:return[4,i.apply(o,s.concat([(a.refresh_token=l.sent()||"",a)]))];case 2:return r=l.sent(),c=r.refresh_token,u=r.access_token_expire,f=r.access_token,c?[4,this.setRefreshToken(c)]:[3,9];case 3:return l.sent(),f&&u?[4,this.setAccessToken(f,u)]:[3,5];case 4:return l.sent(),[3,7];case 5:return[4,this._request.refreshAccessToken()];case 6:l.sent(),l.label=7;case 7:return[4,this.refreshUserInfo()];case 8:return l.sent(),Cr.fire(Ur.LOGIN_STATE_CHANGED),Cr.fire(Ur.LOGIN_TYPE_CHANGED,{env:this._config.env,loginType:Yt.USERNAME,persistence:this._config.persistence}),[2,new Dr({envId:this._config.env,cache:this._cache,request:this._request})];case 9:throw r.code?new Error(JSON.stringify({code:tr.OPERATION_FAIL,msg:"login by username failed:["+r.code+"] "+r.message})):new Error(JSON.stringify({code:tr.OPERATION_FAIL,msg:"login by username failed"}));case 10:return[2]}}))}))},Zn([rr({title:"用户名密码登录失败",messages:["请确认以下各项:"," 1 - 调用 auth().signInWithUsernameAndPassword() 的语法或参数是否正确"," 2 - 当前环境是否开通了用户名密码登录"," 3 - 用户名密码是否匹配","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+nr]}),Xn("design:type",Function),Xn("design:paramtypes",[String,String]),Xn("design:returntype",Promise)],t.prototype,"signIn",null),t}(zt),ir=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sr=function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},ar=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},cr=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},ur=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},fr=Me.throwError,lr=Me.isString,hr=Me.transformPhone,pr=Pe.ERRORS,dr=Pe.COMMUNITY_SITE_URL,yr=Te.catchErrorsDecorator,gr="SIGNIN",vr="SIGNUP",mr="FORCERESETPWD",_r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ir(t,e),t.prototype.signIn=function(e){return cr(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,c,u;return ur(this,(function(f){switch(f.label){case 0:return t=e.phoneNumber,n=e.phoneCode,r=e.password,o=e.signMethod,lr(t)||fr(pr.INVALID_PARAMS,"phoneNumber must be a string"),lr(n)||lr(r)||fr(pr.INVALID_PARAMS,"phoneCode or password must be a string"),o||(o=gr),i=this._cache.keys.refreshTokenKey,[4,this._request.send("auth.signIn",{loginType:Yt.PHONE,phoneNumber:hr(t),phoneCode:n,password:r,refresh_token:this._cache.getStore(i)||"",signMethod:o})];case 1:return s=f.sent(),a=s.refresh_token,c=s.access_token,u=s.access_token_expire,a?[4,this.setRefreshToken(a)]:[3,8];case 2:return f.sent(),c&&u?[4,this.setAccessToken(c,u)]:[3,4];case 3:return f.sent(),[3,6];case 4:return[4,this._request.refreshAccessToken()];case 5:f.sent(),f.label=6;case 6:return[4,this.refreshUserInfo()];case 7:return f.sent(),Cr.fire(Ur.LOGIN_STATE_CHANGED),Cr.fire(Ur.LOGIN_TYPE_CHANGED,{env:this._config.env,loginType:Yt.PHONE,persistence:this._config.persistence}),[2,new Dr({envId:this._config.env,cache:this._cache,request:this._request})];case 8:s.code?fr(pr.OPERATION_FAIL,"Phone login fail["+s.code+"] "+s.message):fr(pr.OPERATION_FAIL,"Phone login fail"),f.label=9;case 9:return[2]}}))}))},t.prototype.signUp=function(e,t,n){return cr(this,void 0,void 0,(function(){return ur(this,(function(r){return[2,this.signIn({phoneNumber:e,phoneCode:t,password:n,signMethod:vr})]}))}))},t.prototype.forceResetPwd=function(e,t,n){return cr(this,void 0,void 0,(function(){return ur(this,(function(r){return[2,this.signIn({phoneNumber:e,phoneCode:t,password:n,signMethod:mr})]}))}))},sr([yr({title:"手机号登录失败",messages:["请确认以下各项:"," 1 - 调用 auth().SmsAuthProvider() 的语法或参数是否正确"," 2 - 当前环境是否开通了短信验证码登录"," 3 - 短信验证码/密码是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+dr]}),ar("design:type",Function),ar("design:paramtypes",[Object]),ar("design:returntype",Promise)],t.prototype,"signIn",null),sr([yr({title:"手机短信注册失败",messages:["请确认以下各项:"," 1 - 调用 auth().signUpWithPhoneCode() 的语法或参数是否正确"," 2 - 当前环境是否开通了短信验证码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+dr]}),ar("design:type",Function),ar("design:paramtypes",[String,String,String]),ar("design:returntype",Promise)],t.prototype,"signUp",null),sr([yr({title:"手机密码重置失败",messages:["请确认以下各项:"," 1 - 调用 auth().forceResetPwd() 的语法或参数是否正确"," 2 - 当前环境是否开通了短信验证码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+dr]}),ar("design:type",Function),ar("design:paramtypes",[String,String,String]),ar("design:returntype",Promise)],t.prototype,"forceResetPwd",null),t}(zt),br=function(){return br=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},br.apply(this,arguments)},wr=function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},Er=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Sr=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Ir=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Or=je.CloudbaseEventEmitter,Ar=Le.RUNTIME,Nr=Me.printWarn,Tr=Me.throwError,Rr=Me.transformPhone,Pr=Pe.ERRORS,xr=Pe.COMMUNITY_SITE_URL,Lr=Te.catchErrorsDecorator,Cr=new Or,kr=function(){function e(e){var t=e.cache,n=e.request;this._cache=t,this._request=n,this._setUserInfo()}return e.prototype.checkLocalInfo=function(){return Sr(this,void 0,void 0,(function(){return Ir(this,(function(e){return this.uid=this._getLocalUserInfo("uid"),this.loginType=this._getLocalUserInfo("loginType"),this.openid=this._getLocalUserInfo("wxOpenId"),this.wxOpenId=this._getLocalUserInfo("wxOpenId"),this.wxPublicId=this._getLocalUserInfo("wxPublicId"),this.unionId=this._getLocalUserInfo("wxUnionId"),this.qqMiniOpenId=this._getLocalUserInfo("qqMiniOpenId"),this.customUserId=this._getLocalUserInfo("customUserId"),this.nickName=this._getLocalUserInfo("nickName"),this.gender=this._getLocalUserInfo("gender"),this.avatarUrl=this._getLocalUserInfo("avatarUrl"),this.email=this._getLocalUserInfo("email"),this.hasPassword=Boolean(this._getLocalUserInfo("hasPassword")),this.phone=this._getLocalUserInfo("phone"),this.username=this._getLocalUserInfo("username"),this.location={country:this._getLocalUserInfo("country"),province:this._getLocalUserInfo("province"),city:this._getLocalUserInfo("city")},[2]}))}))},e.prototype.checkLocalInfoAsync=function(){return Sr(this,void 0,void 0,(function(){var e,t,n,r,o,i,s,a,c,u,f,l,h,p,d,y,g,v;return Ir(this,(function(m){switch(m.label){case 0:return e=this,[4,this._getLocalUserInfoAsync("uid")];case 1:return e.uid=m.sent(),t=this,[4,this._getLocalUserInfoAsync("loginType")];case 2:return t.loginType=m.sent(),n=this,[4,this._getLocalUserInfoAsync("wxOpenId")];case 3:return n.openid=m.sent(),r=this,[4,this._getLocalUserInfoAsync("wxOpenId")];case 4:return r.wxOpenId=m.sent(),o=this,[4,this._getLocalUserInfoAsync("wxPublicId")];case 5:return o.wxPublicId=m.sent(),i=this,[4,this._getLocalUserInfoAsync("wxUnionId")];case 6:return i.unionId=m.sent(),s=this,[4,this._getLocalUserInfoAsync("qqMiniOpenId")];case 7:return s.qqMiniOpenId=m.sent(),a=this,[4,this._getLocalUserInfoAsync("customUserId")];case 8:return a.customUserId=m.sent(),c=this,[4,this._getLocalUserInfoAsync("nickName")];case 9:return c.nickName=m.sent(),u=this,[4,this._getLocalUserInfoAsync("gender")];case 10:return u.gender=m.sent(),f=this,[4,this._getLocalUserInfoAsync("avatarUrl")];case 11:return f.avatarUrl=m.sent(),l=this,[4,this._getLocalUserInfoAsync("email")];case 12:return l.email=m.sent(),h=this,p=Boolean,[4,this._getLocalUserInfoAsync("hasPassword")];case 13:return h.hasPassword=p.apply(void 0,[m.sent()]),d=this,[4,this._getLocalUserInfoAsync("phone")];case 14:return d.phone=m.sent(),y=this,[4,this._getLocalUserInfoAsync("username")];case 15:return y.username=m.sent(),g=this,v={},[4,this._getLocalUserInfoAsync("country")];case 16:return v.country=m.sent(),[4,this._getLocalUserInfoAsync("province")];case 17:return v.province=m.sent(),[4,this._getLocalUserInfoAsync("city")];case 18:return g.location=(v.city=m.sent(),v),[2]}}))}))},e.prototype.linkWithTicket=function(e){if("string"!=typeof e)throw new Error("ticket must be string");return this._request.send("auth.linkWithTicket",{ticket:e})},e.prototype.linkWithRedirect=function(e){e.signInWithRedirect()},e.prototype.getLinkedUidList=function(){return Sr(this,void 0,void 0,(function(){var e,t,n,r,o,i;return Ir(this,(function(s){switch(s.label){case 0:return[4,this._request.send("auth.getLinkedUidList",{})];case 1:for(e=s.sent().data,t=!1,n=e.users,r=0,o=n;r<o.length;r++)if((i=o[r]).wxOpenId&&i.wxPublicId){t=!0;break}return[2,{users:n,hasPrimaryUid:t}]}}))}))},e.prototype.setPrimaryUid=function(e){return this._request.send("auth.setPrimaryUid",{uid:e})},e.prototype.unlink=function(e){return this._request.send("auth.unlink",{platform:e})},e.prototype.update=function(e){return Sr(this,void 0,void 0,(function(){var t,n,r,o,i,s,a;return Ir(this,(function(c){switch(c.label){case 0:return t=e.nickName,n=e.gender,r=e.avatarUrl,o=e.province,i=e.country,s=e.city,[4,this._request.send("auth.updateUserInfo",{nickName:t,gender:n,avatarUrl:r,province:o,country:i,city:s})];case 1:return a=c.sent().data,this._setLocalUserInfo(a),[2]}}))}))},e.prototype.updatePassword=function(e,t){return this._request.send("auth.updatePassword",{oldPassword:t,newPassword:e})},e.prototype.updateEmail=function(e,t){return this._request.send("auth.updateEmail",{newEmail:e,password:t})},e.prototype.updateUsername=function(e){return"string"!=typeof e&&Tr(Pr.INVALID_PARAMS,"username must be a string"),this._request.send("auth.updateUsername",{username:e})},e.prototype.refresh=function(){return Sr(this,void 0,void 0,(function(){var e;return Ir(this,(function(t){switch(t.label){case 0:return"auth.getUserInfo",[4,this._request.send("auth.getUserInfo",{})];case 1:return e=t.sent().data,this._setLocalUserInfo(e),[2,e]}}))}))},e.prototype.linkWithPhoneNumber=function(e,t){return Sr(this,void 0,void 0,(function(){return Ir(this,(function(n){return[2,this._request.send("auth.linkOrUpdatePhoneNumber",{phoneNumber:Rr(e),phoneCode:t})]}))}))},e.prototype.updatePhoneNumber=function(e,t){return Sr(this,void 0,void 0,(function(){return Ir(this,(function(n){return[2,this._request.send("auth.linkOrUpdatePhoneNumber",{phoneNumber:Rr(e),phoneCode:t})]}))}))},e.prototype._getLocalUserInfo=function(e){var t=this._cache.keys.userInfoKey;return this._cache.getStore(t)[e]},e.prototype._getLocalUserInfoAsync=function(e){return Sr(this,void 0,void 0,(function(){var t;return Ir(this,(function(n){switch(n.label){case 0:return t=this._cache.keys.userInfoKey,[4,this._cache.getStoreAsync(t)];case 1:return[2,n.sent()[e]]}}))}))},e.prototype._setUserInfo=function(){var e=this,t=this._cache.keys.userInfoKey,n=this._cache.getStore(t);["uid","loginType","openid","wxOpenId","wxPublicId","unionId","qqMiniOpenId","email","hasPassword","customUserId","nickName","gender","avatarUrl","phone","username"].forEach((function(t){e[t]=n[t]})),this.location={country:n.country,province:n.province,city:n.city}},e.prototype._setLocalUserInfo=function(e){var t=this._cache.keys.userInfoKey;this._cache.setStore(t,e),this._setUserInfo()},wr([Lr({title:"绑定自定义登录失败",messages:["请确认以下各项:"," 1 - 调用 User.linkWithTicket() 的语法或参数是否正确"," 2 - 此账户是否已经绑定自定义登录"," 3 - ticket 参数是否归属当前环境"," 4 - 创建 ticket 的自定义登录私钥是否过期","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+xr]}),Er("design:type",Function),Er("design:paramtypes",[String]),Er("design:returntype",Promise)],e.prototype,"linkWithTicket",null),wr([Lr({title:"绑定第三方登录方式失败",messages:["请确认以下各项:"," 1 - 调用 User.linkWithRedirect() 的语法或参数是否正确"," 2 - 此账户是否已经绑定此第三方"," 3 - 此第三方是否已经授权","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+xr]}),Er("design:type",Function),Er("design:paramtypes",[Object]),Er("design:returntype",void 0)],e.prototype,"linkWithRedirect",null),wr([Lr({title:"获取账户列表失败",messages:["请确认以下各项:"," 1 - 调用 User.getLinkedUidList() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+xr]}),Er("design:type",Function),Er("design:paramtypes",[]),Er("design:returntype",Promise)],e.prototype,"getLinkedUidList",null),wr([Lr({title:"设置微信主账号失败",messages:["请确认以下各项:"," 1 - 调用 User.setPrimaryUid() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+xr]}),Er("design:type",Function),Er("design:paramtypes",[String]),Er("design:returntype",void 0)],e.prototype,"setPrimaryUid",null),wr([Lr({title:"接触绑定失败",messages:["请确认以下各项:"," 1 - 调用 User.unlink() 的语法或参数是否正确"," 2 - 当前账户是否已经与此登录方式解绑","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+xr]}),Er("design:type",Function),Er("design:paramtypes",[String]),Er("design:returntype",void 0)],e.prototype,"unlink",null),wr([Lr({title:"更新用户信息失败",messages:["请确认以下各项:"," 1 - 调用 User.update() 的语法或参数是否正确"," 2 - 用户信息中是否包含非法值","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+xr]}),Er("design:type",Function),Er("design:paramtypes",[Object]),Er("design:returntype",Promise)],e.prototype,"update",null),wr([Lr({title:"更新密码失败",messages:["请确认以下各项:"," 1 - 调用 User.updatePassword() 的语法或参数是否正确"," 3 - 新密码中是否包含非法字符","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+xr]}),Er("design:type",Function),Er("design:paramtypes",[String,String]),Er("design:returntype",void 0)],e.prototype,"updatePassword",null),wr([Lr({title:"更新邮箱地址失败",messages:["请确认以下各项:"," 1 - 调用 User.updateEmail() 的语法或参数是否正确"," 2 - 当前环境是否开通了邮箱密码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+xr]}),Er("design:type",Function),Er("design:paramtypes",[String,String]),Er("design:returntype",void 0)],e.prototype,"updateEmail",null),wr([Lr({title:"更新用户名失败",messages:["请确认以下各项:"," 1 - 调用 User.updateUsername() 的语法或参数是否正确"," 2 - 当前环境是否开通了用户名密码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+xr]}),Er("design:type",Function),Er("design:paramtypes",[String]),Er("design:returntype",void 0)],e.prototype,"updateUsername",null),wr([Lr({title:"刷新本地用户信息失败",messages:["请确认以下各项:"," 1 - 调用 User.refresh() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+xr]}),Er("design:type",Function),Er("design:paramtypes",[]),Er("design:returntype",Promise)],e.prototype,"refresh",null),wr([Lr({title:"绑定手机号失败",messages:["请确认以下各项:"," 1 - 调用 auth().linkWithPhoneNumber() 的语法或参数是否正确"," 2 - 当前环境是否开通了短信验证码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+xr]}),Er("design:type",Function),Er("design:paramtypes",[String,String]),Er("design:returntype",Promise)],e.prototype,"linkWithPhoneNumber",null),wr([Lr({title:"更新手机号失败",messages:["请确认以下各项:"," 1 - 调用语法或参数是否正确"," 2 - 当前环境是否开通了短信验证码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+xr]}),Er("design:type",Function),Er("design:paramtypes",[String,String]),Er("design:returntype",Promise)],e.prototype,"updatePhoneNumber",null),e}(),Dr=function(){function e(e){var t=e.envId,n=e.cache,r=e.request;t||Tr(Pr.INVALID_PARAMS,"envId is not defined"),this._cache=n,this.user=new kr({cache:n,request:r})}return e.prototype.checkLocalState=function(){return Sr(this,void 0,void 0,(function(){var e,t,n,r,o,i,s;return Ir(this,(function(a){return e=this._cache.keys,t=e.refreshTokenKey,n=e.accessTokenKey,r=e.accessTokenExpireKey,o=this._cache.getStore(t),i=this._cache.getStore(n),s=this._cache.getStore(r),this.credential={refreshToken:o,accessToken:i,accessTokenExpire:s},this._loginType=this._cache.getStore(this._cache.keys.loginTypeKey),this.user.checkLocalInfo(),[2]}))}))},e.prototype.checkLocalStateAsync=function(){return Sr(this,void 0,void 0,(function(){var e,t,n,r,o,i,s,a;return Ir(this,(function(c){switch(c.label){case 0:return e=this._cache.keys,t=e.refreshTokenKey,n=e.accessTokenKey,r=e.accessTokenExpireKey,[4,this._cache.getStoreAsync(t)];case 1:return o=c.sent(),[4,this._cache.getStoreAsync(n)];case 2:return i=c.sent(),[4,this._cache.getStoreAsync(r)];case 3:return s=c.sent(),this.credential={refreshToken:o,accessToken:i,accessTokenExpire:s},a=this,[4,this._cache.getStoreAsync(this._cache.keys.loginTypeKey)];case 4:return a._loginType=c.sent(),[4,this.user.checkLocalInfoAsync()];case 5:return c.sent(),[2]}}))}))},Object.defineProperty(e.prototype,"isAnonymousAuth",{get:function(){return this.loginType===Yt.ANONYMOUS},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isCustomAuth",{get:function(){return this.loginType===Yt.CUSTOM},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isWeixinAuth",{get:function(){return this.loginType===Yt.WECHAT||this.loginType===Yt.WECHAT_OPEN||this.loginType===Yt.WECHAT_PUBLIC},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isUsernameAuth",{get:function(){return this.loginType===Yt.USERNAME},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loginType",{get:function(){return this._loginType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isPhoneAuth",{get:function(){return this.loginType===Yt.PHONE},enumerable:!1,configurable:!0}),e}(),jr=function(){function e(e){this._config=e,this._cache=e.cache,this._request=e.request,this._runtime=e.runtime||Ar.WEB,Cr.on(Ur.LOGIN_TYPE_CHANGED,this._onLoginTypeChanged.bind(this))}return Object.defineProperty(e.prototype,"currentUser",{get:function(){if("async"!==this._cache.mode){var e=this.hasLoginState();return e&&e.user||null}Nr(Pr.INVALID_OPERATION,"current platform's storage is asynchronous, please use getCurrenUser insteed")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loginType",{get:function(){return this._cache.getStore(this._cache.keys.loginTypeKey)},enumerable:!1,configurable:!0}),e.prototype.getCurrenUser=function(){return Sr(this,void 0,void 0,(function(){var e;return Ir(this,(function(t){switch(t.label){case 0:return[4,this.getLoginState()];case 1:return(e=t.sent())?[4,e.user.checkLocalInfoAsync()]:[3,3];case 2:return t.sent(),[2,e.user||null];case 3:return[2,null]}}))}))},e.prototype.getLoginType=function(){return Sr(this,void 0,void 0,(function(){return Ir(this,(function(e){switch(e.label){case 0:return[4,this._cache.getStoreAsync(this._cache.keys.loginTypeKey)];case 1:return[2,e.sent()]}}))}))},e.prototype.getAccessToken=function(){return Sr(this,void 0,void 0,(function(){var e;return Ir(this,(function(t){switch(t.label){case 0:return e={},[4,this._request.getAccessToken()];case 1:return[2,(e.accessToken=t.sent().accessToken,e.env=this._config.env,e)]}}))}))},e.prototype.weixinAuthProvider=function(e){var t=e.appid,n=e.scope,r=e.state;return this._weixinAuthProvider||(this._weixinAuthProvider=new dn(br(br({},this._config),{cache:this._cache,request:this._request,runtime:this._runtime}),t,n,r)),this._weixinAuthProvider},e.prototype.anonymousAuthProvider=function(){return this._anonymousAuthProvider||(this._anonymousAuthProvider=new Nn(br(br({},this._config),{cache:this._cache,request:this._request}))),this._anonymousAuthProvider},e.prototype.customAuthProvider=function(){return this._customAuthProvider||(this._customAuthProvider=new Un(br(br({},this._config),{cache:this._cache,request:this._request}))),this._customAuthProvider},e.prototype.emailAuthProvider=function(){return this._emailAuthProvider||(this._emailAuthProvider=new Jn(br(br({},this._config),{cache:this._cache,request:this._request}))),this._emailAuthProvider},e.prototype.usernameAuthProvider=function(){return this._usernameAuthProvider||(this._usernameAuthProvider=new or(br(br({},this._config),{cache:this._cache,request:this._request}))),this._usernameAuthProvider},e.prototype.phoneAuthProvider=function(){return this._phoneAuthProvider||(this._phoneAuthProvider=new _r(br(br({},this._config),{cache:this._cache,request:this._request}))),this._phoneAuthProvider},e.prototype.signInWithUsernameAndPassword=function(e,t){return Sr(this,void 0,void 0,(function(){return Ir(this,(function(n){return[2,this.usernameAuthProvider().signIn(e,t)]}))}))},e.prototype.isUsernameRegistered=function(e){return Sr(this,void 0,void 0,(function(){var t;return Ir(this,(function(n){switch(n.label){case 0:return"string"!=typeof e&&Tr(Pr.INVALID_PARAMS,"username must be a string"),[4,this._request.send("auth.isUsernameRegistered",{username:e})];case 1:return[2,null==(t=n.sent().data)?void 0:t.isRegistered]}}))}))},e.prototype.signInWithEmailAndPassword=function(e,t){return Sr(this,void 0,void 0,(function(){return Ir(this,(function(n){return[2,this.emailAuthProvider().signIn(e,t)]}))}))},e.prototype.signUpWithEmailAndPassword=function(e,t){return Sr(this,void 0,void 0,(function(){return Ir(this,(function(n){return[2,this.emailAuthProvider().signUp(e,t)]}))}))},e.prototype.sendPasswordResetEmail=function(e){return Sr(this,void 0,void 0,(function(){return Ir(this,(function(t){return[2,this.emailAuthProvider().resetPassword(e)]}))}))},e.prototype.signOut=function(){return Sr(this,void 0,void 0,(function(){var e,t,n,r,o,i,s;return Ir(this,(function(a){switch(a.label){case 0:return e=this._cache.keys,t=e.refreshTokenKey,n=e.accessTokenKey,r=e.accessTokenExpireKey,o="auth.logout",[4,this._cache.getStoreAsync(t)];case 1:return(i=a.sent())?[4,this._request.send(o,{refresh_token:i})]:[2];case 2:return s=a.sent(),this._cache.removeStoreAsync(t),this._cache.removeStoreAsync(n),this._cache.removeStoreAsync(r),Cr.fire(Ur.LOGIN_STATE_CHANGED),Cr.fire(Ur.LOGIN_TYPE_CHANGED,{env:this._config.env,loginType:Yt.NULL,persistence:this._config.persistence}),[2,s]}}))}))},e.prototype.onLoginStateChanged=function(e){return Sr(this,void 0,void 0,(function(){var t,n=this;return Ir(this,(function(r){switch(r.label){case 0:return Cr.on(Ur.LOGIN_STATE_CHANGED,(function(){return Sr(n,void 0,void 0,(function(){var t;return Ir(this,(function(n){switch(n.label){case 0:return[4,this.getLoginState()];case 1:return t=n.sent(),e.call(this,t),[2]}}))}))})),[4,this.getLoginState()];case 1:return t=r.sent(),e.call(this,t),[2]}}))}))},e.prototype.onLoginStateExpired=function(e){Cr.on(Ur.LOGIN_STATE_EXPIRED,e.bind(this))},e.prototype.onAccessTokenRefreshed=function(e){Cr.on(Ur.ACCESS_TOKEN_REFRESHD,e.bind(this))},e.prototype.onAnonymousConverted=function(e){Cr.on(Ur.ANONYMOUS_CONVERTED,e.bind(this))},e.prototype.onLoginTypeChanged=function(e){var t=this;Cr.on(Ur.LOGIN_TYPE_CHANGED,(function(){return Sr(t,void 0,void 0,(function(){var t;return Ir(this,(function(n){switch(n.label){case 0:return[4,this.getLoginState()];case 1:return t=n.sent(),e.call(this,t),[2]}}))}))}))},e.prototype.hasLoginState=function(){if("async"!==this._cache.mode){var e=this._cache.keys.refreshTokenKey;if(this._cache.getStore(e)){var t=new Dr({envId:this._config.env,cache:this._cache,request:this._request});return t.checkLocalState(),t}return null}Nr(Pr.INVALID_OPERATION,"current platform's storage is asynchronous, please use getLoginState insteed")},e.prototype.getLoginState=function(){return Sr(this,void 0,void 0,(function(){var e,t;return Ir(this,(function(n){switch(n.label){case 0:return e=this._cache.keys.refreshTokenKey,[4,this._cache.getStoreAsync(e)];case 1:return n.sent()?[4,(t=new Dr({envId:this._config.env,cache:this._cache,request:this._request})).checkLocalStateAsync()]:[3,3];case 2:return n.sent(),[2,t];case 3:return[2,null]}}))}))},e.prototype.shouldRefreshAccessToken=function(e){this._request._shouldRefreshAccessTokenHook=e.bind(this)},e.prototype.getUserInfo=function(){return Sr(this,void 0,void 0,(function(){var e;return Ir(this,(function(t){switch(t.label){case 0:return"auth.getUserInfo",[4,this._request.send("auth.getUserInfo",{})];case 1:return(e=t.sent()).code?[2,e]:[2,br(br({},e.data),{requestId:e.seqId})]}}))}))},e.prototype.getAuthHeader=function(){var e=this._cache.keys,t=e.refreshTokenKey,n=e.accessTokenKey,r=this._cache.getStore(t);return{"x-cloudbase-credentials":this._cache.getStore(n)+"/@@/"+r}},e.prototype.getAuthHeaderAsync=function(){return Sr(this,void 0,void 0,(function(){var e,t,n,r;return Ir(this,(function(o){switch(o.label){case 0:return[4,this._request.refreshAccessToken()];case 1:return o.sent(),e=this._cache.keys,t=e.refreshTokenKey,n=e.accessTokenKey,[4,this._cache.getStoreAsync(t)];case 2:return r=o.sent(),[4,this._cache.getStoreAsync(n)];case 3:return[2,{"x-cloudbase-credentials":o.sent()+"/@@/"+r}]}}))}))},e.prototype.sendPhoneCode=function(e){return Sr(this,void 0,void 0,(function(){return Ir(this,(function(t){switch(t.label){case 0:return[4,this._request.send("auth.sendPhoneCode",{phoneNumber:Rr(e)})];case 1:return[2,"Ok"===t.sent().data.SendStatus]}}))}))},e.prototype.signUpWithPhoneCode=function(e,t,n){return Sr(this,void 0,void 0,(function(){return Ir(this,(function(r){return[2,this.phoneAuthProvider().signUp(e,t,n)]}))}))},e.prototype.signInWithPhoneCodeOrPassword=function(e){return Sr(this,void 0,void 0,(function(){return Ir(this,(function(t){return[2,this.phoneAuthProvider().signIn(e)]}))}))},e.prototype.forceResetPwdByPhoneCode=function(e){return Sr(this,void 0,void 0,(function(){return Ir(this,(function(t){return[2,this.phoneAuthProvider().signIn(br(br({},e),{signMethod:mr}))]}))}))},e.prototype._onLoginTypeChanged=function(e){return Sr(this,void 0,void 0,(function(){var t,n,r;return Ir(this,(function(o){switch(o.label){case 0:return t=e.data,n=t.loginType,r=t.persistence,t.env!==this._config.env?[2]:[4,this._cache.updatePersistenceAsync(r)];case 1:return o.sent(),[4,this._cache.setStoreAsync(this._cache.keys.loginTypeKey,n)];case 2:return o.sent(),[2]}}))}))},wr([Lr({title:"获取用户信息失败",messages:["请确认以下各项:"," 1 - 调用 auth().getCurrenUser() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+xr]}),Er("design:type",Function),Er("design:paramtypes",[]),Er("design:returntype",Promise)],e.prototype,"getCurrenUser",null),wr([Lr({title:"获取用户是否被占用失败",messages:["请确认以下各项:"," 1 - 调用 auth().isUsernameRegistered() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+xr]}),Er("design:type",Function),Er("design:paramtypes",[String]),Er("design:returntype",Promise)],e.prototype,"isUsernameRegistered",null),wr([Lr({title:"用户登出失败",messages:["请确认以下各项:"," 1 - 调用 auth().signOut() 的语法或参数是否正确"," 2 - 当前用户是否为匿名登录(匿名登录不支持signOut)","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+xr]}),Er("design:type",Function),Er("design:paramtypes",[]),Er("design:returntype",Promise)],e.prototype,"signOut",null),wr([Lr({title:"获取本地登录态失败",messages:["请确认以下各项:"," 1 - 调用 auth().getLoginState() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+xr]}),Er("design:type",Function),Er("design:paramtypes",[]),Er("design:returntype",Promise)],e.prototype,"getLoginState",null),wr([Lr({title:"获取用户信息失败",messages:["请确认以下各项:"," 1 - 是否已登录"," 2 - 调用 auth().getUserInfo() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+xr]}),Er("design:type",Function),Er("design:paramtypes",[]),Er("design:returntype",Promise)],e.prototype,"getUserInfo",null),wr([Lr({title:"发送短信验证码失败",messages:["请确认以下各项:"," 1 - 调用语法或参数是否正确"," 2 - 当前环境是否开通了短信验证码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+xr]}),Er("design:type",Function),Er("design:paramtypes",[String]),Er("design:returntype",Promise)],e.prototype,"sendPhoneCode",null),e}(),Ur={LOGIN_STATE_CHANGED:"loginStateChanged",LOGIN_STATE_EXPIRED:"loginStateExpire",LOGIN_TYPE_CHANGED:"loginTypeChanged",ANONYMOUS_CONVERTED:"anonymousConverted",ACCESS_TOKEN_REFRESHD:"refreshAccessToken"},Mr={name:"auth",namespace:"auth",injectEvents:{bus:Cr,events:[Ur.LOGIN_TYPE_CHANGED,Ur.LOGIN_STATE_EXPIRED,Ur.LOGIN_STATE_CHANGED,Ur.ACCESS_TOKEN_REFRESHD,Ur.ANONYMOUS_CONVERTED]},entity:function(e){if(void 0===e&&(e={region:"",persistence:"local"}),this.authInstance)return Nr(Pr.INVALID_OPERATION,"every cloudbase instance should has only one auth object"),this.authInstance;var t=this.platform,n=t.adapter,r=t.runtime,o=e.persistence||n.primaryStorage;o&&o!==this.config.persistence&&this.updateConfig({persistence:o});var i=this.config,s=i.env,a=i.persistence,c=i.debug;return this.authInstance=new jr({env:s,region:e.region,persistence:a,debug:c,cache:this.cache,request:this.request,runtime:r}),this.authInstance}};try{cloudbase.registerComponent(Mr)}catch(e){}var qr=function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},Wr=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Fr=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Br=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},$r=Pe.getSdkName,Hr=Pe.ERRORS,Gr=Pe.COMMUNITY_SITE_URL,Kr=Me.execCallback,Vr=Te.catchErrorsDecorator,Jr="functions",Yr=function(){function e(){}return e.prototype.callFunction=function(e,t){return Fr(this,void 0,void 0,(function(){var n,r,o,i,s,a,c,u,f,l,h,p;return Br(this,(function(d){switch(d.label){case 0:if(n=e.name,r=e.data,o=e.query,i=e.parse,s=e.search,!n)throw new Error(JSON.stringify({code:Hr.INVALID_PARAMS,msg:"["+Jr+".callFunction] invalid function name"}));try{a=r?JSON.stringify(r):""}catch(e){throw new Error(JSON.stringify({code:Hr.INVALID_PARAMS,msg:"["+Jr+".callFunction] invalid data"}))}c="functions.invokeFunction",u={inQuery:o,parse:i,search:s,function_name:n,request_data:a},f=this.request,d.label=1;case 1:return d.trys.push([1,3,,4]),[4,f.send(c,u)];case 2:if((l=d.sent()).code)return[2,Kr(t,null,l)];if(h=l.data.response_data,i)return[2,Kr(t,null,{result:h,requestId:l.requestId})];try{return h=JSON.parse(l.data.response_data),[2,Kr(t,null,{result:h,requestId:l.requestId})]}catch(e){Kr(t,new Error("["+$r()+"]["+Hr.INVALID_PARAMS+"]["+Jr+".callFunction] response data must be json"))}return[3,4];case 3:return p=d.sent(),Kr(t,p),[3,4];case 4:return[2]}}))}))},qr([Vr({customInfo:{className:"Cloudbase",methodName:"callFunction"},title:"函数调用失败",messages:["请确认以下各项:"," 1 - 调用 callFunction() 的语法或参数是否正确"," 2 - 当前环境下是否存在此函数"," 3 - 函数安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+Gr]}),Wr("design:type",Function),Wr("design:paramtypes",[Object,Function]),Wr("design:returntype",Promise)],e.prototype,"callFunction",null),e}(),Zr=new Yr,Xr={name:Jr,entity:{callFunction:Zr.callFunction}};try{cloudbase.registerComponent(Xr)}catch(e){}var zr=function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},Qr=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},eo=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},to=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},no=Pe.getSdkName,ro=Pe.ERRORS,oo=Pe.COMMUNITY_SITE_URL,io=Me.isArray,so=Me.isString,ao=Me.isPalinObject,co=Me.execCallback,uo=Te.catchErrorsDecorator,fo="storage",lo=function(){function e(){}return e.prototype.uploadFile=function(e,t){return eo(this,void 0,void 0,(function(){var n,r,o,i,s,a,c,u,f,l,h,p,d,y,g;return to(this,(function(v){switch(v.label){case 0:if(n=e.cloudPath,r=e.filePath,o=e.onUploadProgress,!so(n)||!r)throw new Error(JSON.stringify({code:ro.INVALID_PARAMS,msg:"["+fo+".uploadFile] invalid params"}));return"storage.getUploadMetadata",[4,(i=this.request).send("storage.getUploadMetadata",{path:n})];case 1:return s=v.sent(),a=s.data,c=a.url,u=a.authorization,f=a.token,l=a.fileId,h=a.cosFileId,p=a.download_url,d=s.requestId,y={key:n,signature:u,"x-cos-meta-fileid":h,success_action_status:"201","x-cos-security-token":f},[4,i.upload({url:c,data:y,file:r,name:n,onUploadProgress:o})];case 2:return 201===(g=v.sent()).statusCode?[2,co(t,null,{fileID:l,download_url:p,requestId:d})]:[2,co(t,new Error("["+no()+"]["+ro.OPERATION_FAIL+"]["+fo+"]:"+g.data))]}}))}))},e.prototype.getUploadMetadata=function(e,t){return eo(this,void 0,void 0,(function(){var n,r,o,i,s;return to(this,(function(a){switch(a.label){case 0:if(n=e.cloudPath,!so(n))throw new Error(JSON.stringify({code:ro.INVALID_PARAMS,msg:"["+fo+".getUploadMetadata] invalid cloudPath"}));r=this.request,o="storage.getUploadMetadata",a.label=1;case 1:return a.trys.push([1,3,,4]),[4,r.send(o,{path:n})];case 2:return i=a.sent(),[2,co(t,null,i)];case 3:return s=a.sent(),[2,co(t,s)];case 4:return[2]}}))}))},e.prototype.deleteFile=function(e,t){return eo(this,void 0,void 0,(function(){var n,r,o,i,s,a;return to(this,(function(c){switch(c.label){case 0:if(!(n=e.fileList)||!io(n)||0===n.length)throw new Error(JSON.stringify({code:ro.INVALID_PARAMS,msg:"["+fo+".deleteFile] fileList must not be empty"}));for(r=0,o=n;r<o.length;r++)if(!(i=o[r])||!so(i))throw new Error(JSON.stringify({code:ro.INVALID_PARAMS,msg:"["+fo+".deleteFile] fileID must be string"}));return"storage.batchDeleteFile",[4,this.request.send("storage.batchDeleteFile",{fileid_list:n})];case 1:return(s=c.sent()).code?[2,co(t,null,s)]:(a={fileList:s.data.delete_list,requestId:s.requestId},[2,co(t,null,a)])}}))}))},e.prototype.getTempFileURL=function(e,t){return eo(this,void 0,void 0,(function(){var n,r,o,i,s,a;return to(this,(function(c){switch(c.label){case 0:if(!(n=e.fileList)||!io(n)||0===n.length)throw new Error(JSON.stringify({code:ro.INVALID_PARAMS,msg:"["+fo+".getTempFileURL] fileList must not be empty"}));for(r=[],o=0,i=n;o<i.length;o++)if(s=i[o],ao(s)){if(!s.hasOwnProperty("fileID")||!s.hasOwnProperty("maxAge"))throw new Error(JSON.stringify({code:ro.INVALID_PARAMS,msg:"["+fo+".getTempFileURL] file info must include fileID and maxAge"}));r.push({fileid:s.fileID,max_age:s.maxAge})}else{if(!so(s))throw new Error(JSON.stringify({code:ro.INVALID_PARAMS,msg:"["+fo+".getTempFileURL] invalid fileList"}));r.push({fileid:s})}return"storage.batchGetDownloadUrl",[4,this.request.send("storage.batchGetDownloadUrl",{file_list:r})];case 1:return(a=c.sent()).code?[2,co(t,null,a)]:[2,co(t,null,{fileList:a.data.download_list,requestId:a.requestId})]}}))}))},e.prototype.downloadFile=function(e,t){return eo(this,void 0,void 0,(function(){var n,r,o,i,s,a;return to(this,(function(c){switch(c.label){case 0:if(n=e.fileID,!so(n))throw new Error(JSON.stringify({code:ro.INVALID_PARAMS,msg:"["+fo+".getTempFileURL] fileID must be string"}));return[4,this.getTempFileURL.call(this,{fileList:[{fileID:n,maxAge:600}]})];case 1:return r=c.sent(),"SUCCESS"!==(o=r.fileList[0]).code?[2,co(t,o)]:(i=this.request,s=encodeURI(o.download_url),[4,i.download({url:s})]);case 2:return a=c.sent(),[2,co(t,null,a)]}}))}))},zr([uo({customInfo:{className:"Cloudbase",methodName:"uploadFile"},title:"上传文件失败",messages:["请确认以下各项:"," 1 - 调用 uploadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+oo]}),Qr("design:type",Function),Qr("design:paramtypes",[Object,Function]),Qr("design:returntype",Promise)],e.prototype,"uploadFile",null),zr([uo({customInfo:{className:"Cloudbase",methodName:"getUploadMetadata"},title:"获取上传元信息失败",messages:["请确认以下各项:"," 1 - 调用 getUploadMetadata() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+oo]}),Qr("design:type",Function),Qr("design:paramtypes",[Object,Function]),Qr("design:returntype",Promise)],e.prototype,"getUploadMetadata",null),zr([uo({customInfo:{className:"Cloudbase",methodName:"deleteFile"},title:"删除文件失败",messages:["请确认以下各项:"," 1 - 调用 deleteFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+oo]}),Qr("design:type",Function),Qr("design:paramtypes",[Object,Function]),Qr("design:returntype",Promise)],e.prototype,"deleteFile",null),zr([uo({customInfo:{className:"Cloudbase",methodName:"getTempFileURL"},title:"获取文件下载链接",messages:["请确认以下各项:"," 1 - 调用 getTempFileURL() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+oo]}),Qr("design:type",Function),Qr("design:paramtypes",[Object,Function]),Qr("design:returntype",Promise)],e.prototype,"getTempFileURL",null),zr([uo({customInfo:{className:"Cloudbase",methodName:"downloadFile"},title:"下载文件失败",messages:["请确认以下各项:"," 1 - 调用 downloadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+oo]}),Qr("design:type",Function),Qr("design:paramtypes",[Object,Function]),Qr("design:returntype",Promise)],e.prototype,"downloadFile",null),e}(),ho=new lo,po={name:fo,entity:{uploadFile:ho.uploadFile,deleteFile:ho.deleteFile,getTempFileURL:ho.getTempFileURL,downloadFile:ho.downloadFile,getUploadMetadata:ho.getUploadMetadata}};try{cloudbase.registerComponent(po)}catch(e){}var yo="__lodash_hash_undefined__",go=1/0,vo=9007199254740991,mo="[object Function]",_o="[object GeneratorFunction]",bo="[object Symbol]",wo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Eo=/^\w*$/,So=/^\./,Io=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Oo=/\\(\\)?/g,Ao=/^\[object .+?Constructor\]$/,No=/^(?:0|[1-9]\d*)$/,To="object"==typeof r&&r&&r.Object===Object&&r,Ro="object"==typeof self&&self&&self.Object===Object&&self,Po=To||Ro||Function("return this")();var xo,Lo=Array.prototype,Co=Function.prototype,ko=Object.prototype,Do=Po["__core-js_shared__"],jo=(xo=/[^.]+$/.exec(Do&&Do.keys&&Do.keys.IE_PROTO||""))?"Symbol(src)_1."+xo:"",Uo=Co.toString,Mo=ko.hasOwnProperty,qo=ko.toString,Wo=RegExp("^"+Uo.call(Mo).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fo=Po.Symbol,Bo=Lo.splice,$o=ti(Po,"Map"),Ho=ti(Object,"create"),Go=Fo?Fo.prototype:void 0,Ko=Go?Go.toString:void 0;function Vo(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Jo(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yo(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Zo(e,t,n){var r=e[t];Mo.call(e,t)&&si(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function Xo(e,t){for(var n=e.length;n--;)if(si(e[n][0],t))return n;return-1}function zo(e){if(!ci(e)||(t=e,jo&&jo in t))return!1;var t,n=function(e){var t=ci(e)?qo.call(e):"";return t==mo||t==_o}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?Wo:Ao;return n.test(function(e){if(null!=e){try{return Uo.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function Qo(e,t,n,r){if(!ci(e))return e;t=function(e,t){if(ai(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||ui(e))return!0;return Eo.test(e)||!wo.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:function(e){return ai(e)?e:ri(e)}(t);for(var o=-1,i=t.length,s=i-1,a=e;null!=a&&++o<i;){var c=oi(t[o]),u=n;if(o!=s){var f=a[c];void 0===(u=r?r(f,c,a):void 0)&&(u=ci(f)?f:ni(t[o+1])?[]:{})}Zo(a,c,u),a=a[c]}return e}function ei(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function ti(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return zo(n)?n:void 0}function ni(e,t){return!!(t=null==t?vo:t)&&("number"==typeof e||No.test(e))&&e>-1&&e%1==0&&e<t}Vo.prototype.clear=function(){this.__data__=Ho?Ho(null):{}},Vo.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Vo.prototype.get=function(e){var t=this.__data__;if(Ho){var n=t[e];return n===yo?void 0:n}return Mo.call(t,e)?t[e]:void 0},Vo.prototype.has=function(e){var t=this.__data__;return Ho?void 0!==t[e]:Mo.call(t,e)},Vo.prototype.set=function(e,t){return this.__data__[e]=Ho&&void 0===t?yo:t,this},Jo.prototype.clear=function(){this.__data__=[]},Jo.prototype.delete=function(e){var t=this.__data__,n=Xo(t,e);return!(n<0)&&(n==t.length-1?t.pop():Bo.call(t,n,1),!0)},Jo.prototype.get=function(e){var t=this.__data__,n=Xo(t,e);return n<0?void 0:t[n][1]},Jo.prototype.has=function(e){return Xo(this.__data__,e)>-1},Jo.prototype.set=function(e,t){var n=this.__data__,r=Xo(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Yo.prototype.clear=function(){this.__data__={hash:new Vo,map:new($o||Jo),string:new Vo}},Yo.prototype.delete=function(e){return ei(this,e).delete(e)},Yo.prototype.get=function(e){return ei(this,e).get(e)},Yo.prototype.has=function(e){return ei(this,e).has(e)},Yo.prototype.set=function(e,t){return ei(this,e).set(e,t),this};var ri=ii((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(ui(e))return Ko?Ko.call(e):"";var t=e+"";return"0"==t&&1/e==-go?"-0":t}(t);var n=[];return So.test(e)&&n.push(""),e.replace(Io,(function(e,t,r,o){n.push(r?o.replace(Oo,"$1"):t||e)})),n}));function oi(e){if("string"==typeof e||ui(e))return e;var t=e+"";return"0"==t&&1/e==-go?"-0":t}function ii(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=e.apply(this,r);return n.cache=i.set(o,s),s};return n.cache=new(ii.Cache||Yo),n}function si(e,t){return e===t||e!=e&&t!=t}ii.Cache=Yo;var ai=Array.isArray;function ci(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ui(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&qo.call(e)==bo}var fi=o((function(e,t,n){return null==e?e:Qo(e,t,n)})),li="__lodash_hash_undefined__",hi=1/0,pi="[object Function]",di="[object GeneratorFunction]",yi="[object Symbol]",gi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vi=/^\w*$/,mi=/^\./,_i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,bi=/\\(\\)?/g,wi=/^\[object .+?Constructor\]$/,Ei="object"==typeof r&&r&&r.Object===Object&&r,Si="object"==typeof self&&self&&self.Object===Object&&self,Ii=Ei||Si||Function("return this")();var Oi=Array.prototype,Ai=Function.prototype,Ni=Object.prototype,Ti=Ii["__core-js_shared__"],Ri=function(){var e=/[^.]+$/.exec(Ti&&Ti.keys&&Ti.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Pi=Ai.toString,xi=Ni.hasOwnProperty,Li=Ni.toString,Ci=RegExp("^"+Pi.call(xi).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ki=Ii.Symbol,Di=Oi.splice,ji=Ji(Ii,"Map"),Ui=Ji(Object,"create"),Mi=ki?ki.prototype:void 0,qi=Mi?Mi.toString:void 0;function Wi(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Fi(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Bi(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $i(e,t){for(var n,r,o=e.length;o--;)if((n=e[o][0])===(r=t)||n!=n&&r!=r)return o;return-1}function Hi(e){if(!es(e)||(t=e,Ri&&Ri in t))return!1;var t,n=function(e){var t=es(e)?Li.call(e):"";return t==pi||t==di}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?Ci:wi;return n.test(function(e){if(null!=e){try{return Pi.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function Gi(e,t){e=function(e,t){return 1==t.length?e:function(e,t){for(var n=0,r=(t=Yi(t,e)?[t]:Ki(t)).length;null!=e&&n<r;)e=e[Xi(t[n++])];return n&&n==r?e:void 0}(e,function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}(t,0,-1))}(e,t=Yi(t,e)?[t]:Ki(t));var n,r,o=Xi((r=(n=t)?n.length:0)?n[r-1]:void 0);return!(null!=e&&xi.call(e,o))||delete e[o]}function Ki(e){return Qi(e)?e:Zi(e)}function Vi(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Ji(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Hi(n)?n:void 0}function Yi(e,t){if(Qi(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ts(e))||(vi.test(e)||!gi.test(e)||null!=t&&e in Object(t))}Wi.prototype.clear=function(){this.__data__=Ui?Ui(null):{}},Wi.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Wi.prototype.get=function(e){var t=this.__data__;if(Ui){var n=t[e];return n===li?void 0:n}return xi.call(t,e)?t[e]:void 0},Wi.prototype.has=function(e){var t=this.__data__;return Ui?void 0!==t[e]:xi.call(t,e)},Wi.prototype.set=function(e,t){return this.__data__[e]=Ui&&void 0===t?li:t,this},Fi.prototype.clear=function(){this.__data__=[]},Fi.prototype.delete=function(e){var t=this.__data__,n=$i(t,e);return!(n<0)&&(n==t.length-1?t.pop():Di.call(t,n,1),!0)},Fi.prototype.get=function(e){var t=this.__data__,n=$i(t,e);return n<0?void 0:t[n][1]},Fi.prototype.has=function(e){return $i(this.__data__,e)>-1},Fi.prototype.set=function(e,t){var n=this.__data__,r=$i(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Bi.prototype.clear=function(){this.__data__={hash:new Wi,map:new(ji||Fi),string:new Wi}},Bi.prototype.delete=function(e){return Vi(this,e).delete(e)},Bi.prototype.get=function(e){return Vi(this,e).get(e)},Bi.prototype.has=function(e){return Vi(this,e).has(e)},Bi.prototype.set=function(e,t){return Vi(this,e).set(e,t),this};var Zi=zi((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(ts(e))return qi?qi.call(e):"";var t=e+"";return"0"==t&&1/e==-hi?"-0":t}(t);var n=[];return mi.test(e)&&n.push(""),e.replace(_i,(function(e,t,r,o){n.push(r?o.replace(bi,"$1"):t||e)})),n}));function Xi(e){if("string"==typeof e||ts(e))return e;var t=e+"";return"0"==t&&1/e==-hi?"-0":t}function zi(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=e.apply(this,r);return n.cache=i.set(o,s),s};return n.cache=new(zi.Cache||Bi),n}zi.Cache=Bi;var Qi=Array.isArray;function es(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ts(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&Li.call(e)==yi}var ns=o((function(e,t){return null==e||Gi(e,t)})),rs={exports:{}};!function(e,t){var n="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",s="[object Boolean]",a="[object Date]",c="[object Function]",u="[object GeneratorFunction]",f="[object Map]",l="[object Number]",h="[object Object]",p="[object Promise]",d="[object RegExp]",y="[object Set]",g="[object String]",v="[object Symbol]",m="[object WeakMap]",_="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",E="[object Float64Array]",S="[object Int8Array]",I="[object Int16Array]",O="[object Int32Array]",A="[object Uint8Array]",N="[object Uint8ClampedArray]",T="[object Uint16Array]",R="[object Uint32Array]",P=/\w*$/,x=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,C={};C[i]=C["[object Array]"]=C[_]=C[b]=C[s]=C[a]=C[w]=C[E]=C[S]=C[I]=C[O]=C[f]=C[l]=C[h]=C[d]=C[y]=C[g]=C[v]=C[A]=C[N]=C[T]=C[R]=!0,C["[object Error]"]=C[c]=C[m]=!1;var k="object"==typeof r&&r&&r.Object===Object&&r,D="object"==typeof self&&self&&self.Object===Object&&self,j=k||D||Function("return this")(),U=t&&!t.nodeType&&t,M=U&&e&&!e.nodeType&&e,q=M&&M.exports===U;function W(e,t){return e.set(t[0],t[1]),e}function F(e,t){return e.add(t),e}function B(e,t,n,r){var o=-1,i=e?e.length:0;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function $(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function H(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function G(e,t){return function(n){return e(t(n))}}function K(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var V=Array.prototype,J=Function.prototype,Y=Object.prototype,Z=j["__core-js_shared__"],X=function(){var e=/[^.]+$/.exec(Z&&Z.keys&&Z.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),z=J.toString,Q=Y.hasOwnProperty,ee=Y.toString,te=RegExp("^"+z.call(Q).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=q?j.Buffer:void 0,re=j.Symbol,oe=j.Uint8Array,ie=G(Object.getPrototypeOf,Object),se=Object.create,ae=Y.propertyIsEnumerable,ce=V.splice,ue=Object.getOwnPropertySymbols,fe=ne?ne.isBuffer:void 0,le=G(Object.keys,Object),he=Ue(j,"DataView"),pe=Ue(j,"Map"),de=Ue(j,"Promise"),ye=Ue(j,"Set"),ge=Ue(j,"WeakMap"),ve=Ue(Object,"create"),me=Be(he),_e=Be(pe),be=Be(de),we=Be(ye),Ee=Be(ge),Se=re?re.prototype:void 0,Ie=Se?Se.valueOf:void 0;function Oe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ae(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ne(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Te(e){this.__data__=new Ae(e)}function Re(e,t){var n=He(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ge(e)}(e)&&Q.call(e,"callee")&&(!ae.call(e,"callee")||ee.call(e)==i)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,o=!!r;for(var s in e)!t&&!Q.call(e,s)||o&&("length"==s||We(s,r))||n.push(s);return n}function Pe(e,t,n){var r=e[t];Q.call(e,t)&&$e(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function xe(e,t){for(var n=e.length;n--;)if($e(e[n][0],t))return n;return-1}function Le(e,t,n,r,o,p,m){var x;if(r&&(x=p?r(e,o,p,m):r(e)),void 0!==x)return x;if(!Je(e))return e;var L=He(e);if(L){if(x=function(e){var t=e.length,n=e.constructor(t);t&&"string"==typeof e[0]&&Q.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!t)return function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(e,x)}else{var k=qe(e),D=k==c||k==u;if(Ke(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(k==h||k==i||D&&!p){if($(e))return p?e:{};if(x=function(e){return"function"!=typeof e.constructor||Fe(e)?{}:(t=ie(e),Je(t)?se(t):{});var t}(D?{}:e),!t)return function(e,t){return De(e,Me(e),t)}(e,function(e,t){return e&&De(t,Ye(t),e)}(x,e))}else{if(!C[k])return p?e:{};x=function(e,t,n,r){var o=e.constructor;switch(t){case _:return ke(e);case s:case a:return new o(+e);case b:return function(e,t){var n=t?ke(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case w:case E:case S:case I:case O:case A:case N:case T:case R:return function(e,t){var n=t?ke(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case f:return function(e,t,n){var r=t?n(H(e),!0):H(e);return B(r,W,new e.constructor)}(e,r,n);case l:case g:return new o(e);case d:return function(e){var t=new e.constructor(e.source,P.exec(e));return t.lastIndex=e.lastIndex,t}(e);case y:return function(e,t,n){var r=t?n(K(e),!0):K(e);return B(r,F,new e.constructor)}(e,r,n);case v:return i=e,Ie?Object(Ie.call(i)):{}}var i}(e,k,Le,t)}}m||(m=new Te);var j=m.get(e);if(j)return j;if(m.set(e,x),!L)var U=n?function(e){return function(e,t,n){var r=t(e);return He(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Ye,Me)}(e):Ye(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););}(U||e,(function(o,i){U&&(o=e[i=o]),Pe(x,i,Le(o,t,n,r,i,e,m))})),x}function Ce(e){return!(!Je(e)||(t=e,X&&X in t))&&(Ve(e)||$(e)?te:x).test(Be(e));var t}function ke(e){var t=new e.constructor(e.byteLength);return new oe(t).set(new oe(e)),t}function De(e,t,n,r){n||(n={});for(var o=-1,i=t.length;++o<i;){var s=t[o],a=r?r(n[s],e[s],s,n,e):void 0;Pe(n,s,void 0===a?e[s]:a)}return n}function je(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Ue(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Ce(n)?n:void 0}Oe.prototype.clear=function(){this.__data__=ve?ve(null):{}},Oe.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Oe.prototype.get=function(e){var t=this.__data__;if(ve){var r=t[e];return r===n?void 0:r}return Q.call(t,e)?t[e]:void 0},Oe.prototype.has=function(e){var t=this.__data__;return ve?void 0!==t[e]:Q.call(t,e)},Oe.prototype.set=function(e,t){return this.__data__[e]=ve&&void 0===t?n:t,this},Ae.prototype.clear=function(){this.__data__=[]},Ae.prototype.delete=function(e){var t=this.__data__,n=xe(t,e);return!(n<0)&&(n==t.length-1?t.pop():ce.call(t,n,1),!0)},Ae.prototype.get=function(e){var t=this.__data__,n=xe(t,e);return n<0?void 0:t[n][1]},Ae.prototype.has=function(e){return xe(this.__data__,e)>-1},Ae.prototype.set=function(e,t){var n=this.__data__,r=xe(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Ne.prototype.clear=function(){this.__data__={hash:new Oe,map:new(pe||Ae),string:new Oe}},Ne.prototype.delete=function(e){return je(this,e).delete(e)},Ne.prototype.get=function(e){return je(this,e).get(e)},Ne.prototype.has=function(e){return je(this,e).has(e)},Ne.prototype.set=function(e,t){return je(this,e).set(e,t),this},Te.prototype.clear=function(){this.__data__=new Ae},Te.prototype.delete=function(e){return this.__data__.delete(e)},Te.prototype.get=function(e){return this.__data__.get(e)},Te.prototype.has=function(e){return this.__data__.has(e)},Te.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ae){var r=n.__data__;if(!pe||r.length<199)return r.push([e,t]),this;n=this.__data__=new Ne(r)}return n.set(e,t),this};var Me=ue?G(ue,Object):function(){return[]},qe=function(e){return ee.call(e)};function We(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||L.test(e))&&e>-1&&e%1==0&&e<t}function Fe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Y)}function Be(e){if(null!=e){try{return z.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function $e(e,t){return e===t||e!=e&&t!=t}(he&&qe(new he(new ArrayBuffer(1)))!=b||pe&&qe(new pe)!=f||de&&qe(de.resolve())!=p||ye&&qe(new ye)!=y||ge&&qe(new ge)!=m)&&(qe=function(e){var t=ee.call(e),n=t==h?e.constructor:void 0,r=n?Be(n):void 0;if(r)switch(r){case me:return b;case _e:return f;case be:return p;case we:return y;case Ee:return m}return t});var He=Array.isArray;function Ge(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}(e.length)&&!Ve(e)}var Ke=fe||function(){return!1};function Ve(e){var t=Je(e)?ee.call(e):"";return t==c||t==u}function Je(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ye(e){return Ge(e)?Re(e):function(e){if(!Fe(e))return le(e);var t=[];for(var n in Object(e))Q.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Le(e,!0,!0)}}(rs,rs.exports);var os=o(rs.exports);function is(e){return void 0===e&&(e=""),(e?e+"_":"")+ +new Date+"_"+Math.random()}var ss,as=function(e){this.close=e.close,this.onChange=e.onChange,this.onError=e.onError,e.debug&&Object.defineProperty(this,"virtualClient",{get:function(){return e.virtualClient}})},cs=function(e){var t,n,r=e.id,o=e.docChanges,i=e.docs,s=e.msgType,a=e.type;Object.defineProperties(this,{id:{get:function(){return r},enumerable:!0},docChanges:{get:function(){return t||(t=JSON.parse(JSON.stringify(o))),t},enumerable:!0},docs:{get:function(){return n||(n=JSON.parse(JSON.stringify(i))),n},enumerable:!0},msgType:{get:function(){return s},enumerable:!0},type:{get:function(){return a},enumerable:!0}})},us=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fs=function(e){function t(t){var n=e.call(this,"Watch Error "+JSON.stringify(t.msgData)+" (requestid: "+t.requestId+")")||this;return n.isRealtimeErrorMessageError=!0,n.payload=t,n}return us(t,e),t}(Error),ls=function(e){return null==e?void 0:e.isRealtimeErrorMessageError},hs=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="timeout",t.payload=null,t.generic=!0,t}return us(t,e),t}(Error),ps=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="cancelled",t.payload=null,t.generic=!0,t}return us(t,e),t}(Error),ds=function(e){function t(t){var n=e.call(this,t.errMsg)||this;return n.errCode="UNKNOWN_ERROR",Object.defineProperties(n,{message:{get:function(){return"errCode: "+this.errCode+" "+(ys[this.errCode]||"")+" | errMsg: "+this.errMsg},set:function(e){this.errMsg=e}}}),n.errCode=t.errCode||"UNKNOWN_ERROR",n.errMsg=t.errMsg,n}return us(t,e),Object.defineProperty(t.prototype,"message",{get:function(){return"errCode: "+this.errCode+" | errMsg: "+this.errMsg},set:function(e){this.errMsg=e},enumerable:!1,configurable:!0}),t}(Error),ys={UNKNOWN_ERROR:"UNKNOWN_ERROR",SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_CLOSE_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_CLOSE_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_SERVER_ERROR_MSG:"SDK_DATABASE_REALTIME_LISTENER_SERVER_ERROR_MSG",SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA:"SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA",SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR:"SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR",SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED:"SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED",SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL:"SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL",SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR:"SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR"},gs=function(e){return void 0===e&&(e=0),new Promise((function(t){return setTimeout(t,e)}))},vs=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},ms=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},_s=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r};!function(e){e.LOGGINGIN="LOGGINGIN",e.INITING="INITING",e.REBUILDING="REBUILDING",e.ACTIVE="ACTIVE",e.ERRORED="ERRORED",e.CLOSING="CLOSING",e.CLOSED="CLOSED",e.PAUSED="PAUSED",e.RESUMING="RESUMING"}(ss||(ss={}));var bs=function(){function e(e){var t=this;this.watchStatus=ss.INITING,this._login=function(e,n){return vs(t,void 0,void 0,(function(){var t;return ms(this,(function(r){switch(r.label){case 0:return this.watchStatus=ss.LOGGINGIN,[4,this.login(e,n)];case 1:return t=r.sent(),this.envId||(this.envId=t.envId),[2,t]}}))}))},this.initWatch=function(e){return vs(t,void 0,void 0,(function(){var t,n=this;return ms(this,(function(r){switch(r.label){case 0:if(this._initWatchPromise)return[2,this._initWatchPromise];this._initWatchPromise=new Promise((function(t,r){return vs(n,void 0,void 0,(function(){var n,o,i,s,a,c,u,f,l,h;return ms(this,(function(p){switch(p.label){case 0:return p.trys.push([0,3,,4]),this.watchStatus===ss.PAUSED?(console.log("[realtime] initWatch cancelled on pause"),[2,t()]):[4,this._login(this.envId,e)];case 1:return n=p.sent().envId,this.watchStatus===ss.PAUSED?(console.log("[realtime] initWatch cancelled on pause"),[2,t()]):(this.watchStatus=ss.INITING,o={watchId:this.watchId,requestId:is(),msgType:"INIT_WATCH",msgData:{envId:n,collName:this.collectionName,query:this.query,limit:this.limit,orderBy:this.orderBy}},[4,this.send({msg:o,waitResponse:!0,skipOnMessage:!0,timeout:1e4})]);case 2:if(i=p.sent(),s=i.msgData,a=s.events,c=s.currEvent,this.sessionInfo={queryID:i.msgData.queryID,currentEventId:c-1,currentDocs:[]},a.length>0){for(u=0,f=a;u<f.length;u++)f[u].ID=c;this.handleServerEvents(i)}else this.sessionInfo.currentEventId=c,l=new cs({id:c,docChanges:[],docs:[],type:"init"}),this.listener.onChange(l),this.scheduleSendACK();return this.onWatchStart(this,this.sessionInfo.queryID),this.watchStatus=ss.ACTIVE,this._availableRetries.INIT_WATCH=2,t(),[3,4];case 3:return h=p.sent(),this.handleWatchEstablishmentError(h,{operationName:"INIT_WATCH",resolve:t,reject:r}),[3,4];case 4:return[2]}}))}))})),t=!1,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this._initWatchPromise];case 2:return r.sent(),t=!0,[3,4];case 3:return this._initWatchPromise=void 0,[7];case 4:return console.log("[realtime] initWatch "+(t?"success":"fail")),[2]}}))}))},this.rebuildWatch=function(e){return vs(t,void 0,void 0,(function(){var t,n=this;return ms(this,(function(r){switch(r.label){case 0:if(this._rebuildWatchPromise)return[2,this._rebuildWatchPromise];this._rebuildWatchPromise=new Promise((function(t,r){return vs(n,void 0,void 0,(function(){var n,o,i,s;return ms(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),this.watchStatus===ss.PAUSED?(console.log("[realtime] rebuildWatch cancelled on pause"),[2,t()]):[4,this._login(this.envId,e)];case 1:if(n=a.sent().envId,!this.sessionInfo)throw new Error("can not rebuildWatch without a successful initWatch (lack of sessionInfo)");return this.watchStatus===ss.PAUSED?(console.log("[realtime] rebuildWatch cancelled on pause"),[2,t()]):(this.watchStatus=ss.REBUILDING,o={watchId:this.watchId,requestId:is(),msgType:"REBUILD_WATCH",msgData:{envId:n,collName:this.collectionName,queryID:this.sessionInfo.queryID,eventID:this.sessionInfo.currentEventId}},[4,this.send({msg:o,waitResponse:!0,skipOnMessage:!1,timeout:1e4})]);case 2:return i=a.sent(),this.handleServerEvents(i),this.watchStatus=ss.ACTIVE,this._availableRetries.REBUILD_WATCH=2,t(),[3,4];case 3:return s=a.sent(),this.handleWatchEstablishmentError(s,{operationName:"REBUILD_WATCH",resolve:t,reject:r}),[3,4];case 4:return[2]}}))}))})),t=!1,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this._rebuildWatchPromise];case 2:return r.sent(),t=!0,[3,4];case 3:return this._rebuildWatchPromise=void 0,[7];case 4:return console.log("[realtime] rebuildWatch "+(t?"success":"fail")),[2]}}))}))},this.handleWatchEstablishmentError=function(e,n){return vs(t,void 0,void 0,(function(){var t,r,o,i=this;return ms(this,(function(s){return t="INIT_WATCH"===n.operationName,r=function(){i.closeWithError(new ds({errCode:t?ys.SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL:ys.SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL,errMsg:e})),n.reject(e)},o=function(e){i.useRetryTicket(n.operationName)?t?(i._initWatchPromise=void 0,n.resolve(i.initWatch(e))):(i._rebuildWatchPromise=void 0,n.resolve(i.rebuildWatch(e))):r()},this.handleCommonError(e,{onSignError:function(){return o(!0)},onTimeoutError:function(){return o(!1)},onNotRetryableError:r,onCancelledError:n.reject,onUnknownError:function(){return vs(i,void 0,void 0,(function(){var e,t=this;return ms(this,(function(r){switch(r.label){case 0:return r.trys.push([0,8,,9]),e=function(){return vs(t,void 0,void 0,(function(){return ms(this,(function(e){switch(e.label){case 0:return this.pause(),[4,this.onceWSConnected()];case 1:return e.sent(),o(!0),[2]}}))}))},this.isWSConnected()?[3,2]:[4,e()];case 1:return r.sent(),[3,7];case 2:return[4,gs(100)];case 3:return r.sent(),this.watchStatus!==ss.PAUSED?[3,4]:(n.reject(new ps(n.operationName+" cancelled due to pause after unknownError")),[3,7]);case 4:return this.isWSConnected()?[3,6]:[4,e()];case 5:return r.sent(),[3,7];case 6:o(!1),r.label=7;case 7:return[3,9];case 8:return r.sent(),o(!0),[3,9];case 9:return[2]}}))}))}}),[2]}))}))},this.closeWatch=function(){return vs(t,void 0,void 0,(function(){var e,t,n;return ms(this,(function(r){switch(r.label){case 0:if(e=this.sessionInfo?this.sessionInfo.queryID:"",this.watchStatus!==ss.ACTIVE)return this.watchStatus=ss.CLOSED,this.onWatchClose(this,e),[2];r.label=1;case 1:return r.trys.push([1,3,4,5]),this.watchStatus=ss.CLOSING,t={watchId:this.watchId,requestId:is(),msgType:"CLOSE_WATCH",msgData:null},[4,this.send({msg:t})];case 2:return r.sent(),this.sessionInfo=void 0,this.watchStatus=ss.CLOSED,[3,5];case 3:return n=r.sent(),this.closeWithError(new ds({errCode:ys.SDK_DATABASE_REALTIME_LISTENER_CLOSE_WATCH_FAIL,errMsg:n})),[3,5];case 4:return this.onWatchClose(this,e),[7];case 5:return[2]}}))}))},this.scheduleSendACK=function(){t.clearACKSchedule(),t._ackTimeoutId=setTimeout((function(){t._waitExpectedTimeoutId?t.scheduleSendACK():t.sendACK()}),1e4)},this.clearACKSchedule=function(){t._ackTimeoutId&&clearTimeout(t._ackTimeoutId)},this.sendACK=function(){return vs(t,void 0,void 0,(function(){var e,t,n;return ms(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this.watchStatus!==ss.ACTIVE?(this.scheduleSendACK(),[2]):this.sessionInfo?(e={watchId:this.watchId,requestId:is(),msgType:"CHECK_LAST",msgData:{queryID:this.sessionInfo.queryID,eventID:this.sessionInfo.currentEventId}},[4,this.send({msg:e})]):(console.warn("[realtime listener] can not send ack without a successful initWatch (lack of sessionInfo)"),[2]);case 1:return r.sent(),this.scheduleSendACK(),[3,3];case 2:if(t=r.sent(),ls(t))switch((n=t.payload).msgData.code){case"CHECK_LOGIN_FAILED":case"SIGN_EXPIRED_ERROR":case"SIGN_INVALID_ERROR":case"SIGN_PARAM_INVALID":return this.rebuildWatch(),[2];case"QUERYID_INVALID_ERROR":case"SYS_ERR":case"INVALIID_ENV":case"COLLECTION_PERMISSION_DENIED":return this.closeWithError(new ds({errCode:ys.SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL,errMsg:n.msgData.code})),[2]}return this._availableRetries.CHECK_LAST&&this._availableRetries.CHECK_LAST>0?(this._availableRetries.CHECK_LAST--,this.scheduleSendACK()):this.closeWithError(new ds({errCode:ys.SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL,errMsg:t})),[3,3];case 3:return[2]}}))}))},this.handleCommonError=function(e,t){if(ls(e)){switch(e.payload.msgData.code){case"CHECK_LOGIN_FAILED":case"SIGN_EXPIRED_ERROR":case"SIGN_INVALID_ERROR":case"SIGN_PARAM_INVALID":return void t.onSignError(e);default:return void t.onNotRetryableError(e)}}else{if(function(e){return"timeout"===e.type}(e))return void t.onTimeoutError(e);if(function(e){return"cancelled"===e.type}(e))return void t.onCancelledError(e)}t.onUnknownError(e)},this.watchId="watchid_"+ +new Date+"_"+Math.random(),this.envId=e.envId,this.collectionName=e.collectionName,this.query=e.query,this.limit=e.limit,this.orderBy=e.orderBy,this.send=e.send,this.login=e.login,this.isWSConnected=e.isWSConnected,this.onceWSConnected=e.onceWSConnected,this.getWaitExpectedTimeoutLength=e.getWaitExpectedTimeoutLength,this.onWatchStart=e.onWatchStart,this.onWatchClose=e.onWatchClose,this.debug=e.debug,this._availableRetries={INIT_WATCH:2,REBUILD_WATCH:2,CHECK_LAST:2},this.listener=new as({close:this.closeWatch,onChange:e.onChange,onError:e.onError,debug:this.debug,virtualClient:this}),this.initWatch()}return e.prototype.onMessage=function(e){var t=this;switch(this.watchStatus){case ss.PAUSED:if("ERROR"!==e.msgType)return;break;case ss.LOGGINGIN:case ss.INITING:case ss.REBUILDING:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received while "+this.watchStatus);case ss.CLOSED:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received when the watch has closed");case ss.ERRORED:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received when the watch has ended with error")}if(this.sessionInfo)switch(this.scheduleSendACK(),e.msgType){case"NEXT_EVENT":console.warn("nextevent "+e.msgData.currEvent+" ignored",e),this.handleServerEvents(e);break;case"CHECK_EVENT":this.sessionInfo.currentEventId<e.msgData.currEvent&&(this.sessionInfo.expectEventId=e.msgData.currEvent,this.clearWaitExpectedEvent(),this._waitExpectedTimeoutId=setTimeout((function(){t.rebuildWatch()}),this.getWaitExpectedTimeoutLength()),console.log("[realtime] waitExpectedTimeoutLength "+this.getWaitExpectedTimeoutLength()));break;case"ERROR":this.closeWithError(new ds({errCode:ys.SDK_DATABASE_REALTIME_LISTENER_SERVER_ERROR_MSG,errMsg:e.msgData.code+" - "+e.msgData.message}));break;default:console.warn("[realtime listener] virtual client receive unexpected msg "+e.msgType+": ",e)}else console.warn("[realtime listener] internal non-fatal error: sessionInfo not found while message is received.")},e.prototype.closeWithError=function(e){this.watchStatus=ss.ERRORED,this.clearACKSchedule(),this.listener.onError(e),this.onWatchClose(this,this.sessionInfo&&this.sessionInfo.queryID||""),console.log("[realtime] client closed ("+this.collectionName+" "+this.query+") (watchId "+this.watchId+")")},e.prototype.pause=function(){this.watchStatus=ss.PAUSED,console.log("[realtime] client paused ("+this.collectionName+" "+this.query+") (watchId "+this.watchId+")")},e.prototype.resume=function(){return vs(this,void 0,void 0,(function(){var e;return ms(this,(function(t){switch(t.label){case 0:this.watchStatus=ss.RESUMING,console.log("[realtime] client resuming with "+(this.sessionInfo?"REBUILD_WATCH":"INIT_WATCH")+" ("+this.collectionName+" "+this.query+") ("+this.watchId+")"),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.sessionInfo?this.rebuildWatch():this.initWatch()];case 2:return t.sent(),console.log("[realtime] client successfully resumed ("+this.collectionName+" "+this.query+") ("+this.watchId+")"),[3,4];case 3:return e=t.sent(),console.error("[realtime] client resume failed ("+this.collectionName+" "+this.query+") ("+this.watchId+")",e),[3,4];case 4:return[2]}}))}))},e.prototype.useRetryTicket=function(e){return!!(this._availableRetries[e]&&this._availableRetries[e]>0)&&(this._availableRetries[e]--,console.log("[realtime] "+e+" use a retry ticket, now only "+this._availableRetries[e]+" retry left"),!0)},e.prototype.handleServerEvents=function(e){return vs(this,void 0,void 0,(function(){var t;return ms(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.scheduleSendACK(),[4,this._handleServerEvents(e)];case 1:return n.sent(),this._postHandleServerEventsValidityCheck(e),[3,3];case 2:throw t=n.sent(),console.error("[realtime listener] internal non-fatal error: handle server events failed with error: ",t),t;case 3:return[2]}}))}))},e.prototype._handleServerEvents=function(e){return vs(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,c,u,f,l,h;return ms(this,(function(p){switch(p.label){case 0:if(t=e.requestId,n=e.msgData.events,r=e.msgType,!n.length||!this.sessionInfo)return[2];o=this.sessionInfo;try{i=n.map(ws)}catch(e){return this.closeWithError(new ds({errCode:ys.SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA,errMsg:e})),[2]}s=_s(o.currentDocs),a=!1,c=function(n,c){var f,l,h,p,d,y,g,v,m,_,b;return ms(this,(function(w){switch(w.label){case 0:return f=i[n],o.currentEventId>=f.id?(!i[n-1]||f.id>i[n-1].id?console.warn("[realtime] duplicate event received, cur "+o.currentEventId+" but got "+f.id):console.error("[realtime listener] server non-fatal error: events out of order (the latter event's id is smaller than that of the former) (requestId "+t+")"),[2,"continue"]):[3,1];case 1:if(o.currentEventId!==f.id-1)return[3,2];switch(f.dataType){case"update":if(!f.doc)switch(f.queueType){case"update":case"dequeue":if(l=s.find((function(e){return e._id===f.docId})),l){if(y=os(l),f.updatedFields)for(d in f.updatedFields)fi(y,d,f.updatedFields[d]);if(f.removedFields)for(h=0,p=f.removedFields;h<p.length;h++)d=p[h],ns(y,d);f.doc=y}else console.error("[realtime listener] internal non-fatal server error: unexpected update dataType event where no doc is associated.");break;case"enqueue":throw g=new ds({errCode:ys.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="update" and queueType="enqueue" (requestId '+e.requestId+")"}),u.closeWithError(g),g}break;case"replace":if(!f.doc)throw g=new ds({errCode:ys.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="replace" (requestId '+e.requestId+")"}),u.closeWithError(g),g;break;case"remove":(y=s.find((function(e){return e._id===f.docId})))?f.doc=y:console.error("[realtime listener] internal non-fatal server error: unexpected remove event where no doc is associated.");break;case"limit":if(!f.doc)switch(f.queueType){case"dequeue":(y=s.find((function(e){return e._id===f.docId})))?f.doc=y:console.error("[realtime listener] internal non-fatal server error: unexpected limit dataType event where no doc is associated.");break;case"enqueue":throw g=new ds({errCode:ys.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="limit" and queueType="enqueue" (requestId '+e.requestId+")"}),u.closeWithError(g),g}}switch(f.queueType){case"init":a?s.push(f.doc):(a=!0,s=[f.doc]);break;case"enqueue":s.push(f.doc);break;case"dequeue":v=s.findIndex((function(e){return e._id===f.docId})),v>-1?s.splice(v,1):console.error("[realtime listener] internal non-fatal server error: unexpected dequeue event where no doc is associated.");break;case"update":v=s.findIndex((function(e){return e._id===f.docId})),v>-1?s[v]=f.doc:console.error("[realtime listener] internal non-fatal server error: unexpected queueType update event where no doc is associated.")}return(n===c-1||i[n+1]&&i[n+1].id!==f.id)&&(m=_s(s),_=i.slice(0,n+1).filter((function(e){return e.id===f.id})),u.sessionInfo.currentEventId=f.id,u.sessionInfo.currentDocs=s,b=new cs({id:f.id,docChanges:_,docs:m,msgType:r}),u.listener.onChange(b)),[3,4];case 2:return console.warn("[realtime listener] event received is out of order, cur "+u.sessionInfo.currentEventId+" but got "+f.id),[4,u.rebuildWatch()];case 3:return w.sent(),[2,{value:void 0}];case 4:return[2]}}))},u=this,f=0,l=i.length,p.label=1;case 1:return f<l?[5,c(f,l)]:[3,4];case 2:if("object"==typeof(h=p.sent()))return[2,h.value];p.label=3;case 3:return f++,[3,1];case 4:return[2]}}))}))},e.prototype._postHandleServerEventsValidityCheck=function(e){this.sessionInfo?(this.sessionInfo.expectEventId&&this.sessionInfo.currentEventId>=this.sessionInfo.expectEventId&&this.clearWaitExpectedEvent(),this.sessionInfo.currentEventId<e.msgData.currEvent&&console.warn("[realtime listener] internal non-fatal error: client eventId does not match with server event id after server event handling")):console.error("[realtime listener] internal non-fatal error: sessionInfo lost after server event handling, this should never occur")},e.prototype.clearWaitExpectedEvent=function(){this._waitExpectedTimeoutId&&(clearTimeout(this._waitExpectedTimeoutId),this._waitExpectedTimeoutId=void 0)},e}();function ws(e){var t={id:e.ID,dataType:e.DataType,queueType:e.QueueType,docId:e.DocID,doc:e.Doc&&"{}"!==e.Doc?JSON.parse(e.Doc):void 0};return"update"===e.DataType&&(e.UpdatedFields&&(t.updatedFields=JSON.parse(e.UpdatedFields)),(e.removedFields||e.RemovedFields)&&(t.removedFields=JSON.parse(e.removedFields))),t}var Es,Ss={1e3:{code:1e3,name:"Normal Closure",description:"Normal closure; the connection successfully completed whatever purpose for which it was created."},1001:{code:1001,name:"Going Away",description:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection."},1002:{code:1002,name:"Protocol Error",description:"The endpoint is terminating the connection due to a protocol error."},1003:{code:1003,name:"Unsupported Data",description:"The connection is being terminated because the endpoint received data of a type it cannot accept (for example, a text-only endpoint received binary data)."},1005:{code:1005,name:"No Status Received",description:"Indicates that no status code was provided even though one was expected."},1006:{code:1006,name:"Abnormal Closure",description:"Used to indicate that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},1007:{code:1007,name:"Invalid frame payload data",description:"The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},1008:{code:1008,name:"Policy Violation",description:"The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},1009:{code:1009,name:"Message too big",description:"The endpoint is terminating the connection because a data frame was received that is too large."},1010:{code:1010,name:"Missing Extension",description:"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},1011:{code:1011,name:"Internal Error",description:"The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."},1012:{code:1012,name:"Service Restart",description:"The server is terminating the connection because it is restarting."},1013:{code:1013,name:"Try Again Later",description:"The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients."},1014:{code:1014,name:"Bad Gateway",description:"The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code."},1015:{code:1015,name:"TLS Handshake",description:"Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."},3e3:{code:3e3,name:"Reconnect WebSocket",description:"The client is terminating the connection because it wants to reconnect"},3001:{code:3001,name:"No Realtime Listeners",description:"The client is terminating the connection because no more realtime listeners exist"},3002:{code:3002,name:"Heartbeat Ping Error",description:"The client is terminating the connection due to its failure in sending heartbeat messages"},3003:{code:3003,name:"Heartbeat Pong Timeout Error",description:"The client is terminating the connection because no heartbeat response is received from the server"},3050:{code:3050,name:"Server Close",description:"The client is terminating the connection because no heartbeat response is received from the server"}};!function(e){e[e.NormalClosure=1e3]="NormalClosure",e[e.GoingAway=1001]="GoingAway",e[e.ProtocolError=1002]="ProtocolError",e[e.UnsupportedData=1003]="UnsupportedData",e[e.NoStatusReceived=1005]="NoStatusReceived",e[e.AbnormalClosure=1006]="AbnormalClosure",e[e.InvalidFramePayloadData=1007]="InvalidFramePayloadData",e[e.PolicyViolation=1008]="PolicyViolation",e[e.MessageTooBig=1009]="MessageTooBig",e[e.MissingExtension=1010]="MissingExtension",e[e.InternalError=1011]="InternalError",e[e.ServiceRestart=1012]="ServiceRestart",e[e.TryAgainLater=1013]="TryAgainLater",e[e.BadGateway=1014]="BadGateway",e[e.TLSHandshake=1015]="TLSHandshake",e[e.ReconnectWebSocket=3e3]="ReconnectWebSocket",e[e.NoRealtimeListeners=3001]="NoRealtimeListeners",e[e.HeartbeatPingError=3002]="HeartbeatPingError",e[e.HeartbeatPongTimeoutError=3003]="HeartbeatPongTimeoutError",e[e.NoAuthentication=3050]="NoAuthentication"}(Es||(Es={}));var Is=function(e,t){var n=Ss[e],r=n?n.name+", code "+e+", reason "+(t||n.description):"code "+e;return new ds({errCode:ys.SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED,errMsg:r})},Os=null,As="web";function Ns(){return Os}function Ts(){return As}function Rs(e){As=e}var Ps=function(){return Ps=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ps.apply(this,arguments)},xs=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Ls=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Cs=1,ks=function(){function e(e){var t=this;this._virtualWSClient=new Set,this._queryIdClientMap=new Map,this._watchIdClientMap=new Map,this._pingFailed=0,this._pongMissed=0,this._logins=new Map,this._wsReadySubsribers=[],this._wsResponseWait=new Map,this._rttObserved=[],this.send=function(e){return xs(t,void 0,void 0,(function(){var t=this;return Ls(this,(function(n){return[2,new Promise((function(n,r){return xs(t,void 0,void 0,(function(){var t,o,i,s,a,c,u,f=this;return Ls(this,(function(l){switch(l.label){case 0:o=!1,i=!1,s=function(e){o=!0,t&&clearTimeout(t),n(e)},a=function(e){i=!0,t&&clearTimeout(t),r(e)},e.timeout&&(t=setTimeout((function(){return xs(f,void 0,void 0,(function(){return Ls(this,(function(e){switch(e.label){case 0:return o&&i?[3,2]:[4,gs(0)];case 1:e.sent(),o&&i||a(new hs("wsclient.send timedout")),e.label=2;case 2:return[2]}}))}))}),e.timeout)),l.label=1;case 1:return l.trys.push([1,8,,9]),this._wsInitPromise?[4,this._wsInitPromise]:[3,3];case 2:l.sent(),l.label=3;case 3:if(!this._ws)return a(new Error("invalid state: ws connection not exists, can not send message")),[2];if(this._ws.readyState!==Cs)return a(new Error("ws readyState invalid: "+this._ws.readyState+", can not send message")),[2];e.waitResponse&&this._wsResponseWait.set(e.msg.requestId,{resolve:s,reject:a,skipOnMessage:e.skipOnMessage}),l.label=4;case 4:return l.trys.push([4,6,,7]),[4,this._ws.send(JSON.stringify(e.msg))];case 5:return l.sent(),e.waitResponse||s(),[3,7];case 6:return(c=l.sent())&&(a(c),e.waitResponse&&this._wsResponseWait.delete(e.msg.requestId)),[3,7];case 7:return[3,9];case 8:return u=l.sent(),a(u),[3,9];case 9:return[2]}}))}))}))]}))}))},this.closeAllClients=function(e){t._virtualWSClient.forEach((function(t){t.closeWithError(e)}))},this.pauseClients=function(e){(e||t._virtualWSClient).forEach((function(e){e.pause()}))},this.resumeClients=function(e){(e||t._virtualWSClient).forEach((function(e){e.resume()}))},this.initWebSocketConnection=function(e,n){return void 0===n&&(n=t._maxReconnect),xs(t,void 0,void 0,(function(){var t=this;return Ls(this,(function(r){switch(r.label){case 0:if(e&&this._reconnectState)return[2];if(e&&(this._reconnectState=!0),this._wsInitPromise)return[2,this._wsInitPromise];e&&this.pauseClients(),this.close(Es.ReconnectWebSocket),this._wsInitPromise=new Promise((function(r,o){return xs(t,void 0,void 0,(function(){var t,i,s=this;return Ls(this,(function(a){switch(a.label){case 0:return a.trys.push([0,6,,11]),[4,this.getWsSign()];case 1:return t=a.sent(),[4,new Promise((function(e){var n=t.wsUrl||"wss://tcb-ws.tencentcloudapi.com",r=Ns();s._ws=r?new r(n):new WebSocket(n),e()}))];case 2:return a.sent(),this._ws.connect?[4,this._ws.connect()]:[3,4];case 3:a.sent(),a.label=4;case 4:return[4,this.initWebSocketEvent()];case 5:return a.sent(),r(),e&&(this.resumeClients(),this._reconnectState=!1),[3,11];case 6:return i=a.sent(),console.error("[realtime] initWebSocketConnection connect fail",i),n>0?(!0,this._wsInitPromise=void 0,[4,gs(this._reconnectInterval)]):[3,9];case 7:a.sent(),e&&(this._reconnectState=!1),a.label=8;case 8:return r(this.initWebSocketConnection(e,n-1)),[3,10];case 9:o(i),e&&this.closeAllClients(new ds({errCode:ys.SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL,errMsg:i})),a.label=10;case 10:return[3,11];case 11:return[2]}}))}))})),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,this._wsInitPromise];case 2:return r.sent(),this._wsReadySubsribers.forEach((function(e){return(0,e.resolve)()})),[3,5];case 3:return r.sent(),this._wsReadySubsribers.forEach((function(e){return(0,e.reject)()})),[3,5];case 4:return this._wsInitPromise=void 0,this._wsReadySubsribers=[],[7];case 5:return[2]}}))}))},this.initWebSocketEvent=function(){return new Promise((function(e,n){if(!t._ws)throw new Error("can not initWebSocketEvent, ws not exists");var r=!1;t._ws.onopen=function(t){console.warn("[realtime] ws event: open",t),r=!0,e()},t._ws.onerror=function(e){t._logins=new Map,r?(console.error("[realtime] ws event: error",e),t.clearHeartbeat(),t._virtualWSClient.forEach((function(t){return t.closeWithError(new ds({errCode:ys.SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR,errMsg:e}))}))):(console.error("[realtime] ws open failed with ws event: error",e),n(e))},t._ws.onclose=function(e){switch(console.warn("[realtime] ws event: close",e),t._logins=new Map,t.clearHeartbeat(),e.code){case Es.ReconnectWebSocket:case Es.NoRealtimeListeners:break;case Es.HeartbeatPingError:case Es.HeartbeatPongTimeoutError:case Es.NormalClosure:case Es.AbnormalClosure:t._maxReconnect>0?t.initWebSocketConnection(!0,t._maxReconnect):t.closeAllClients(Is(e.code));break;case Es.NoAuthentication:t.closeAllClients(Is(e.code,e.reason));break;default:t._maxReconnect>0?t.initWebSocketConnection(!0,t._maxReconnect):t.closeAllClients(Is(e.code))}},t._ws.onmessage=function(e){var n,r=e.data;t.heartbeat();try{n=JSON.parse(r)}catch(e){throw new Error("[realtime] onMessage parse res.data error: "+e)}if("ERROR"===n.msgType){var o=null;t._virtualWSClient.forEach((function(e){e.watchId===n.watchId&&(o=e)})),o&&o.listener.onError(n)}var i=t._wsResponseWait.get(n.requestId);if(i){try{"ERROR"===n.msgType?i.reject(new fs(n)):i.resolve(n)}catch(e){console.error("ws onMessage responseWaitSpec.resolve(msg) errored:",e)}finally{t._wsResponseWait.delete(n.requestId)}if(i.skipOnMessage)return}if("PONG"!==n.msgType){var s=n.watchId&&t._watchIdClientMap.get(n.watchId);if(s)s.onMessage(n);else switch(console.error("[realtime] no realtime listener found responsible for watchId "+n.watchId+": ",n),n.msgType){case"INIT_EVENT":case"NEXT_EVENT":case"CHECK_EVENT":(s=t._queryIdClientMap.get(n.msgData.queryID))&&s.onMessage(n);break;default:for(var a=0,c=Array.from(t._watchIdClientMap.entries());a<c.length;a++){c[a][1].onMessage(n);break}}}else if(t._lastPingSendTS){var u=Date.now()-t._lastPingSendTS;if(u>1e4)return void console.warn("[realtime] untrusted rtt observed: "+u);t._rttObserved.length>=3&&t._rttObserved.splice(0,t._rttObserved.length-3+1),t._rttObserved.push(u)}},t.heartbeat()}))},this.isWSConnected=function(){return Boolean(t._ws&&t._ws.readyState===Cs)},this.onceWSConnected=function(){return xs(t,void 0,void 0,(function(){var e=this;return Ls(this,(function(t){return this.isWSConnected()?[2]:this._wsInitPromise?[2,this._wsInitPromise]:[2,new Promise((function(t,n){e._wsReadySubsribers.push({resolve:t,reject:n})}))]}))}))},this.webLogin=function(e,n){return xs(t,void 0,void 0,(function(){var t,r,o,i,s,a,c,u,f=this;return Ls(this,(function(l){switch(l.label){case 0:if(!n)if(e){if(t=this._logins.get(e)){if(t.loggedIn&&t.loginResult)return[2,t.loginResult];if(t.loggingInPromise)return[2,t.loggingInPromise]}}else if(null==(r=this._logins.get(""))?void 0:r.loggingInPromise)return[2,r.loggingInPromise];o=new Promise((function(e,t){return xs(f,void 0,void 0,(function(){var n,r,o,i,s;return Ls(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.getWsSign()];case 1:return n=a.sent(),r={envId:n.envId||"",accessToken:"",referrer:"web",sdkVersion:"",dataVersion:""},o={watchId:void 0,requestId:is(),msgType:"LOGIN",msgData:r,exMsgData:{runtime:Ts(),signStr:n.signStr,secretVersion:n.secretVersion}},[4,this.send({msg:o,waitResponse:!0,skipOnMessage:!0,timeout:5e3})];case 2:return(i=a.sent()).msgData.code?t(new Error(i.msgData.code+" "+i.msgData.message)):e({envId:n.envId}),[3,4];case 3:return s=a.sent(),t(s),[3,4];case 4:return[2]}}))}))})),i=e&&this._logins.get(e),s=Date.now(),i?(i.loggedIn=!1,i.loggingInPromise=o,i.loginStartTS=s):(i={loggedIn:!1,loggingInPromise:o,loginStartTS:s},this._logins.set(e||"",i)),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,o];case 2:if(a=l.sent(),(c=e&&this._logins.get(e))&&c===i&&c.loginStartTS===s)return i.loggedIn=!0,i.loggingInPromise=void 0,i.loginStartTS=void 0,i.loginResult=a,[2,a];if(c){if(c.loggedIn&&c.loginResult)return[2,c.loginResult];if(c.loggingInPromise)return[2,c.loggingInPromise];throw new Error("ws unexpected login info")}throw new Error("ws login info reset");case 3:throw u=l.sent(),i.loggedIn=!1,i.loggingInPromise=void 0,i.loginStartTS=void 0,i.loginResult=void 0,u;case 4:return[2]}}))}))},this.getWsSign=function(){return xs(t,void 0,void 0,(function(){var e,t,n,r,o,i,s;return Ls(this,(function(a){switch(a.label){case 0:return this._wsSign&&this._wsSign.expiredTs>Date.now()?[2,this._wsSign]:(e=Date.now()+6e4,[4,this._context.appConfig.request.send("auth.wsWebSign",{runtime:Ts()})]);case 1:if((t=a.sent()).code)throw new Error("[tcb-js-sdk] 获取实时数据推送登录票据失败: "+t.code);if(t.data)return n=t.data,r=n.signStr,o=n.wsUrl,i=n.secretVersion,s=n.envId,[2,{signStr:r,wsUrl:o,secretVersion:i,envId:s,expiredTs:e}];throw new Error("[tcb-js-sdk] 获取实时数据推送登录票据失败")}}))}))},this.getWaitExpectedTimeoutLength=function(){return t._rttObserved.length?t._rttObserved.reduce((function(e,t){return e+t}))/t._rttObserved.length*1.5:5e3},this.ping=function(){return xs(t,void 0,void 0,(function(){var e;return Ls(this,(function(t){switch(t.label){case 0:return e={watchId:void 0,requestId:is(),msgType:"PING",msgData:null},[4,this.send({msg:e})];case 1:return t.sent(),[2]}}))}))},this.onWatchStart=function(e,n){t._queryIdClientMap.set(n,e)},this.onWatchClose=function(e,n){n&&t._queryIdClientMap.delete(n),t._watchIdClientMap.delete(e.watchId),t._virtualWSClient.delete(e),t._virtualWSClient.size||t.close(Es.NoRealtimeListeners)},this._maxReconnect=e.maxReconnect||5,this._reconnectInterval=e.reconnectInterval||1e4,this._context=e.context}return e.prototype.clearHeartbeat=function(){this._pingTimeoutId&&clearTimeout(this._pingTimeoutId),this._pongTimeoutId&&clearTimeout(this._pongTimeoutId)},e.prototype.close=function(e){this.clearHeartbeat(),this._ws&&(this._ws.close(e,Ss[e].name),this._ws=void 0)},e.prototype.watch=function(e){this._ws||this._wsInitPromise||this.initWebSocketConnection(!1);var t=new bs(Ps(Ps({},e),{send:this.send,login:this.webLogin,isWSConnected:this.isWSConnected,onceWSConnected:this.onceWSConnected,getWaitExpectedTimeoutLength:this.getWaitExpectedTimeoutLength,onWatchStart:this.onWatchStart,onWatchClose:this.onWatchClose,debug:!0}));return this._virtualWSClient.add(t),this._watchIdClientMap.set(t.watchId,t),t.listener},e.prototype.heartbeat=function(e){var t=this;this.clearHeartbeat(),this._pingTimeoutId=setTimeout((function(){return xs(t,void 0,void 0,(function(){var e=this;return Ls(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),this._ws&&this._ws.readyState===Cs?(this._lastPingSendTS=Date.now(),[4,this.ping()]):[2];case 1:return t.sent(),this._pingFailed=0,this._pongTimeoutId=setTimeout((function(){console.error("pong timed out"),e._pongMissed<2?(e._pongMissed++,e.heartbeat(!0)):e.initWebSocketConnection(!0)}),this._context.appConfig.realtimePongWaitTimeout),[3,3];case 2:return t.sent(),this._pingFailed<2?(this._pingFailed++,this.heartbeat()):this.close(Es.HeartbeatPingError),[3,3];case 3:return[2]}}))}))}),e?0:this._context.appConfig.realtimePingInterval)},e}(),Ds={target:"database",entity:function(){var e,t=this.platform,n=t.adapter,r=t.runtime;e=n.wsClass,Os=e,Rs(r)}},js={name:"realtime",IIFE:!0,entity:function(){this.prototype.wsClientClass=ks}};try{cloudbase.registerComponent(js),cloudbase.registerHook(Ds)}catch(e){}var Us=function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},Ms=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},qs=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Ws=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Fs=Pe.ERRORS,Bs=Pe.COMMUNITY_SITE_URL,$s=Te.catchErrorsDecorator,Hs="analytics",Gs=["mall"];var Ks,Vs,Js=new(function(){function e(){}return e.prototype.analytics=function(e){return qs(this,void 0,void 0,(function(){var t,n,r;return Ws(this,(function(o){if(!function(e){if("Object"!==Object.prototype.toString.call(e).slice(8,-1))return!1;var t=e.report_data,n=e.report_type;return!1!==Gs.includes(n)&&"Object"===Object.prototype.toString.call(t).slice(8,-1)&&!(void 0!==t.action_time&&!Number.isInteger(t.action_time))&&"string"==typeof t.action_type}(e))throw new Error(JSON.stringify({code:Fs.INVALID_PARAMS,msg:"["+Hs+".analytics] invalid report data"}));return"analytics.report",t=void 0===e.report_data.action_time?Math.floor(Date.now()/1e3):e.report_data.action_time,n={analytics_scene:e.report_type,analytics_data:Object.assign({},e.report_data,{action_time:t})},r={requestData:n},this.request.send("analytics.report",r),[2]}))}))},Us([$s({customInfo:{className:"Cloudbase",methodName:"analytics"},title:"上报调用失败",messages:["请确认以下各项:"," 1 - 调用 analytics() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+Bs]}),Ms("design:type",Function),Ms("design:paramtypes",[Object]),Ms("design:returntype",Promise)],e.prototype,"analytics",null),e}()),Ys={name:Hs,entity:{analytics:Js.analytics}};try{cloudbase.registerComponent(Ys)}catch(e){}!function(e){e.DocIDError="文档ID不合法",e.CollNameError="集合名称不合法",e.OpStrError="操作符不合法",e.DirectionError="排序字符不合法",e.IntergerError="must be integer",e.QueryParamTypeError="查询参数必须为对象",e.QueryParamValueError="查询参数对象值不能均为undefined"}(Vs||(Vs={}));var Zs,Xs,zs="Number",Qs="Object",ea="Array",ta="GeoPoint",na="GeoLineString",ra="GeoPolygon",oa="GeoMultiPoint",ia="GeoMultiLineString",sa="GeoMultiPolygon",aa="Date",ca="ServerDate",ua="BsonDate",fa=["desc","asc"],la=["<","<=","==",">=",">"];!function(e){e.lt="<",e.gt=">",e.lte="<=",e.gte=">=",e.eq="=="}(Zs||(Zs={})),(Ks={})[Zs.eq]="$eq",Ks[Zs.lt]="$lt",Ks[Zs.lte]="$lte",Ks[Zs.gt]="$gt",Ks[Zs.gte]="$gte",function(e){e.WHERE="WHERE",e.DOC="DOC"}(Xs||(Xs={}));var ha=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pa=[],da={},ya=function(e){function t(t,n){if(n!==da)throw new TypeError("InternalSymbol cannot be constructed with new operator");return e.call(this,t)||this}return ha(t,e),t.for=function(e){for(var n=0,r=pa.length;n<r;n++)if(pa[n].target===e)return pa[n].instance;var o=new t(e,da);return pa.push({target:e,instance:o}),o},t}((function(e){Object.defineProperties(this,{target:{enumerable:!1,writable:!1,configurable:!1,value:e}})})),ga=ya,va=ga.for("UNSET_FIELD_NAME"),ma=ga.for("UPDATE_COMMAND"),_a=ga.for("QUERY_COMMAND"),ba=ga.for("LOGIC_COMMAND"),wa=ga.for("GEO_POINT"),Ea=ga.for("SYMBOL_GEO_LINE_STRING"),Sa=ga.for("SYMBOL_GEO_POLYGON"),Ia=ga.for("SYMBOL_GEO_MULTI_POINT"),Oa=ga.for("SYMBOL_GEO_MULTI_LINE_STRING"),Aa=ga.for("SYMBOL_GEO_MULTI_POLYGON"),Na=ga.for("SERVER_DATE"),Ta=ga.for("REGEXP"),Ra=function(){function e(e){var t=(void 0===e?{}:e).offset,n=void 0===t?0:t;this.offset=n}return Object.defineProperty(e.prototype,"_internalType",{get:function(){return Na},enumerable:!0,configurable:!0}),e.prototype.parse=function(){return{$date:{offset:this.offset}}},e}();function Pa(e){return new Ra(e)}var xa,La=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},Ca=function(){function e(){}return e.formatResDocumentData=function(t){return t.map((function(t){return e.formatField(t)}))},e.formatField=function(t){var n=Object.keys(t),r={};return Array.isArray(t)&&(r=[]),n.forEach((function(n){var o,i=t[n];switch(e.whichType(i)){case ta:o=new Ba(i.coordinates[0],i.coordinates[1]);break;case na:o=new Ha(i.coordinates.map((function(e){return new Ba(e[0],e[1])})));break;case ra:o=new Ka(i.coordinates.map((function(e){return new Ha(e.map((function(e){var t=La(e,2),n=t[0],r=t[1];return new Ba(n,r)})))})));break;case oa:o=new Ja(i.coordinates.map((function(e){return new Ba(e[0],e[1])})));break;case ia:o=new Za(i.coordinates.map((function(e){return new Ha(e.map((function(e){var t=La(e,2),n=t[0],r=t[1];return new Ba(n,r)})))})));break;case sa:o=new za(i.coordinates.map((function(e){return new Ka(e.map((function(e){return new Ha(e.map((function(e){var t=La(e,2),n=t[0],r=t[1];return new Ba(n,r)})))})))})));break;case aa:o=new Date(1e3*i.$timestamp);break;case Qs:case ea:o=e.formatField(i);break;case ca:o=new Date(i.$date);break;default:o=i}Array.isArray(r)?r.push(o):r[n]=o})),r},e.whichType=function(e){var t=Object.prototype.toString.call(e).slice(8,-1);if(t===aa)return ua;if(t===Qs){if(e instanceof Ba)return ta;if(e instanceof Date)return aa;if(e instanceof Ra)return ca;e.$timestamp?t=aa:e.$date?t=ca:Ba.validate(e)?t=ta:Ha.validate(e)?t=na:Ka.validate(e)?t=ra:Ja.validate(e)?t=oa:Za.validate(e)?t=ia:za.validate(e)&&(t=sa)}return t},e.generateDocId=function(){for(var e="ABCDEFabcdef0123456789",t="",n=0;n<24;n++)t+=e.charAt(Math.floor(22*Math.random()));return t},e}(),ka=function(){function e(){}return e.isGeopoint=function(e,t){if(Ca.whichType(t)!==zs)throw new Error("Geo Point must be number type");var n=Math.abs(t);if("latitude"===e&&n>90)throw new Error("latitude should be a number ranges from -90 to 90");if("longitude"===e&&n>180)throw new Error("longitude should be a number ranges from -180 to 180");return!0},e.isInteger=function(e,t){if(!Number.isInteger(t))throw new Error(e+Vs.IntergerError);return!0},e.isFieldOrder=function(e){if(-1===fa.indexOf(e))throw new Error(Vs.DirectionError);return!0},e.isFieldPath=function(e){if(!/^[a-zA-Z0-9-_\.]/.test(e))throw new Error;return!0},e.isOperator=function(e){if(-1===la.indexOf(e))throw new Error(Vs.OpStrError);return!0},e.isCollName=function(e){if(!/^[a-zA-Z0-9]([a-zA-Z0-9-_]){1,32}$/.test(e))throw new Error(Vs.CollNameError);return!0},e.isDocID=function(e){if(!/^([a-fA-F0-9]){24}$/.test(e))throw new Error(Vs.DocIDError);return!0},e}(),Da=function(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()},ja=function(e){return"object"===Da(e)},Ua=function(e){return"number"===Da(e)},Ma=function(e){return Array.isArray(e)},qa=function(e){return"date"===Da(e)},Wa=function(e){return"regexp"===Da(e)},Fa=function(e){return e&&e._internalType instanceof ya},Ba=function(){function e(e,t){ka.isGeopoint("longitude",e),ka.isGeopoint("latitude",t),this.longitude=e,this.latitude=t}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"Point",coordinates:[this.longitude,this.latitude]},t},e.prototype.toJSON=function(){return{type:"Point",coordinates:[this.longitude,this.latitude]}},e.prototype.toReadableString=function(){return"["+this.longitude+","+this.latitude+"]"},e.validate=function(e){return"Point"===e.type&&Ma(e.coordinates)&&ka.isGeopoint("longitude",e.coordinates[0])&&ka.isGeopoint("latitude",e.coordinates[1])},Object.defineProperty(e.prototype,"_internalType",{get:function(){return wa},enumerable:!0,configurable:!0}),e}(),$a=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ha=function(){function e(e){if(!Ma(e))throw new TypeError('"points" must be of type Point[]. Received type '+typeof e);if(e.length<2)throw new Error('"points" must contain 2 points at least');e.forEach((function(e){if(!(e instanceof Ba))throw new TypeError('"points" must be of type Point[]. Received type '+typeof e+"[]")})),this.points=e}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"LineString",coordinates:this.points.map((function(e){return e.toJSON().coordinates}))},t},e.prototype.toJSON=function(){return{type:"LineString",coordinates:this.points.map((function(e){return e.toJSON().coordinates}))}},e.validate=function(e){var t,n;if("LineString"!==e.type||!Ma(e.coordinates))return!1;try{for(var r=$a(e.coordinates),o=r.next();!o.done;o=r.next()){var i=o.value;if(!Ua(i[0])||!Ua(i[1]))return!1}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!0},e.isClosed=function(e){var t=e.points[0],n=e.points[e.points.length-1];if(t.latitude===n.latitude&&t.longitude===n.longitude)return!0},Object.defineProperty(e.prototype,"_internalType",{get:function(){return Ea},enumerable:!0,configurable:!0}),e}(),Ga=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ka=function(){function e(e){if(!Ma(e))throw new TypeError('"lines" must be of type LineString[]. Received type '+typeof e);if(0===e.length)throw new Error("Polygon must contain 1 linestring at least");e.forEach((function(e){if(!(e instanceof Ha))throw new TypeError('"lines" must be of type LineString[]. Received type '+typeof e+"[]");if(!Ha.isClosed(e))throw new Error("LineString "+e.points.map((function(e){return e.toReadableString()}))+" is not a closed cycle")})),this.lines=e}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"Polygon",coordinates:this.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))},t},e.prototype.toJSON=function(){return{type:"Polygon",coordinates:this.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))}},e.validate=function(e){var t,n,r,o;if("Polygon"!==e.type||!Ma(e.coordinates))return!1;try{for(var i=Ga(e.coordinates),s=i.next();!s.done;s=i.next()){var a=s.value;if(!this.isCloseLineString(a))return!1;try{for(var c=(r=void 0,Ga(a)),u=c.next();!u.done;u=c.next()){var f=u.value;if(!Ua(f[0])||!Ua(f[1]))return!1}}catch(e){r={error:e}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return!0},e.isCloseLineString=function(e){var t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]},Object.defineProperty(e.prototype,"_internalType",{get:function(){return Aa},enumerable:!0,configurable:!0}),e}(),Va=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ja=function(){function e(e){if(!Ma(e))throw new TypeError('"points" must be of type Point[]. Received type '+typeof e);if(0===e.length)throw new Error('"points" must contain 1 point at least');e.forEach((function(e){if(!(e instanceof Ba))throw new TypeError('"points" must be of type Point[]. Received type '+typeof e+"[]")})),this.points=e}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"MultiPoint",coordinates:this.points.map((function(e){return e.toJSON().coordinates}))},t},e.prototype.toJSON=function(){return{type:"MultiPoint",coordinates:this.points.map((function(e){return e.toJSON().coordinates}))}},e.validate=function(e){var t,n;if("MultiPoint"!==e.type||!Ma(e.coordinates))return!1;try{for(var r=Va(e.coordinates),o=r.next();!o.done;o=r.next()){var i=o.value;if(!Ua(i[0])||!Ua(i[1]))return!1}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!0},Object.defineProperty(e.prototype,"_internalType",{get:function(){return Ia},enumerable:!0,configurable:!0}),e}(),Ya=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Za=function(){function e(e){if(!Ma(e))throw new TypeError('"lines" must be of type LineString[]. Received type '+typeof e);if(0===e.length)throw new Error("Polygon must contain 1 linestring at least");e.forEach((function(e){if(!(e instanceof Ha))throw new TypeError('"lines" must be of type LineString[]. Received type '+typeof e+"[]")})),this.lines=e}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"MultiLineString",coordinates:this.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))},t},e.prototype.toJSON=function(){return{type:"MultiLineString",coordinates:this.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))}},e.validate=function(e){var t,n,r,o;if("MultiLineString"!==e.type||!Ma(e.coordinates))return!1;try{for(var i=Ya(e.coordinates),s=i.next();!s.done;s=i.next()){var a=s.value;try{for(var c=(r=void 0,Ya(a)),u=c.next();!u.done;u=c.next()){var f=u.value;if(!Ua(f[0])||!Ua(f[1]))return!1}}catch(e){r={error:e}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return!0},Object.defineProperty(e.prototype,"_internalType",{get:function(){return Oa},enumerable:!0,configurable:!0}),e}(),Xa=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},za=function(){function e(e){var t,n;if(!Ma(e))throw new TypeError('"polygons" must be of type Polygon[]. Received type '+typeof e);if(0===e.length)throw new Error("MultiPolygon must contain 1 polygon at least");try{for(var r=Xa(e),o=r.next();!o.done;o=r.next()){var i=o.value;if(!(i instanceof Ka))throw new TypeError('"polygon" must be of type Polygon[]. Received type '+typeof i+"[]")}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}this.polygons=e}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"MultiPolygon",coordinates:this.polygons.map((function(e){return e.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))}))},t},e.prototype.toJSON=function(){return{type:"MultiPolygon",coordinates:this.polygons.map((function(e){return e.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))}))}},e.validate=function(e){var t,n,r,o,i,s;if("MultiPolygon"!==e.type||!Ma(e.coordinates))return!1;try{for(var a=Xa(e.coordinates),c=a.next();!c.done;c=a.next()){var u=c.value;try{for(var f=(r=void 0,Xa(u)),l=f.next();!l.done;l=f.next()){var h=l.value;try{for(var p=(i=void 0,Xa(h)),d=p.next();!d.done;d=p.next()){var y=d.value;if(!Ua(y[0])||!Ua(y[1]))return!1}}catch(e){i={error:e}}finally{try{d&&!d.done&&(s=p.return)&&s.call(p)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return!0},Object.defineProperty(e.prototype,"_internalType",{get:function(){return Sa},enumerable:!0,configurable:!0}),e}(),Qa=Object.freeze({__proto__:null,LineString:Ha,MultiLineString:Za,MultiPoint:Ja,MultiPolygon:za,Point:Ba,Polygon:Ka}),ec=function(){var e;if(!Promise){(e=function(){}).promise={};var t=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}var n=new Promise((function(t,n){e=function(e,r){return e?n(e):t(r)}}));return e.promise=n,e};!function(e){e.SET="set",e.REMOVE="remove",e.INC="inc",e.MUL="mul",e.PUSH="push",e.PULL="pull",e.PULL_ALL="pullAll",e.POP="pop",e.SHIFT="shift",e.UNSHIFT="unshift",e.ADD_TO_SET="addToSet",e.BIT="bit",e.RENAME="rename",e.MAX="max",e.MIN="min"}(xa||(xa={}));var tc,nc=function(){function e(e,t,n){this._internalType=ma,Object.defineProperties(this,{_internalType:{enumerable:!1,configurable:!1}}),this.operator=e,this.operands=t,this.fieldName=n||va}return e.prototype._setFieldName=function(t){return new e(this.operator,this.operands,t)},e}();function rc(e){return e&&e instanceof nc&&e._internalType===ma}!function(e){e.AND="and",e.OR="or",e.NOT="not",e.NOR="nor"}(tc||(tc={}));var oc=function(){function e(e,t,n){if(this._internalType=ba,Object.defineProperties(this,{_internalType:{enumerable:!1,configurable:!1}}),this.operator=e,this.operands=t,this.fieldName=n||va,this.fieldName!==va)if(Array.isArray(t)){t=t.slice(),this.operands=t;for(var r=0,o=t.length;r<o;r++){(ic(i=t[r])||uc(i))&&(t[r]=i._setFieldName(this.fieldName))}}else{var i;(ic(i=t)||uc(i))&&(t=i._setFieldName(this.fieldName))}}return e.prototype._setFieldName=function(t){var n=this.operands.map((function(n){return n instanceof e?n._setFieldName(t):n}));return new e(this.operator,n,t)},e.prototype.and=function(){var t=Array.isArray(arguments[0])?arguments[0]:Array.from(arguments);return t.unshift(this),new e(tc.AND,t,this.fieldName)},e.prototype.or=function(){var t=Array.isArray(arguments[0])?arguments[0]:Array.from(arguments);return t.unshift(this),new e(tc.OR,t,this.fieldName)},e}();function ic(e){return e&&e instanceof oc&&e._internalType===ba}var sc,ac=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){e.EQ="eq",e.NEQ="neq",e.GT="gt",e.GTE="gte",e.LT="lt",e.LTE="lte",e.IN="in",e.NIN="nin",e.ALL="all",e.ELEM_MATCH="elemMatch",e.EXISTS="exists",e.SIZE="size",e.MOD="mod",e.GEO_NEAR="geoNear",e.GEO_WITHIN="geoWithin",e.GEO_INTERSECTS="geoIntersects"}(sc||(sc={}));var cc=function(e){function t(t,n,r){var o=e.call(this,t,n,r)||this;return o.operator=t,o._internalType=_a,o}return ac(t,e),t.prototype.toJSON=function(){var e,t;switch(this.operator){case sc.IN:case sc.NIN:return(e={})["$"+this.operator]=this.operands,e;default:return(t={})["$"+this.operator]=this.operands[0],t}},t.prototype._setFieldName=function(e){return new t(this.operator,this.operands,e)},t.prototype.eq=function(e){var n=new t(sc.EQ,[e],this.fieldName);return this.and(n)},t.prototype.neq=function(e){var n=new t(sc.NEQ,[e],this.fieldName);return this.and(n)},t.prototype.gt=function(e){var n=new t(sc.GT,[e],this.fieldName);return this.and(n)},t.prototype.gte=function(e){var n=new t(sc.GTE,[e],this.fieldName);return this.and(n)},t.prototype.lt=function(e){var n=new t(sc.LT,[e],this.fieldName);return this.and(n)},t.prototype.lte=function(e){var n=new t(sc.LTE,[e],this.fieldName);return this.and(n)},t.prototype.in=function(e){var n=new t(sc.IN,e,this.fieldName);return this.and(n)},t.prototype.nin=function(e){var n=new t(sc.NIN,e,this.fieldName);return this.and(n)},t.prototype.geoNear=function(e){if(!(e.geometry instanceof Ba))throw new TypeError('"geometry" must be of type Point. Received type '+typeof e.geometry);if(void 0!==e.maxDistance&&!Ua(e.maxDistance))throw new TypeError('"maxDistance" must be of type Number. Received type '+typeof e.maxDistance);if(void 0!==e.minDistance&&!Ua(e.minDistance))throw new TypeError('"minDistance" must be of type Number. Received type '+typeof e.minDistance);var n=new t(sc.GEO_NEAR,[e],this.fieldName);return this.and(n)},t.prototype.geoWithin=function(e){if(!(e.geometry instanceof za||e.geometry instanceof Ka))throw new TypeError('"geometry" must be of type Polygon or MultiPolygon. Received type '+typeof e.geometry);var n=new t(sc.GEO_WITHIN,[e],this.fieldName);return this.and(n)},t.prototype.geoIntersects=function(e){if(!(e.geometry instanceof Ba||e.geometry instanceof Ha||e.geometry instanceof Ka||e.geometry instanceof Ja||e.geometry instanceof Za||e.geometry instanceof za))throw new TypeError('"geometry" must be of type Point, LineString, Polygon, MultiPoint, MultiLineString or MultiPolygon. Received type '+typeof e.geometry);var n=new t(sc.GEO_INTERSECTS,[e],this.fieldName);return this.and(n)},t}(oc);function uc(e){return e&&e instanceof cc&&e._internalType===_a}function fc(e){return uc(e)}var lc={};for(var hc in sc)lc[hc]="$"+hc;for(var hc in tc)lc[hc]="$"+hc;for(var hc in xa)lc[hc]="$"+hc;function pc(e){return lc[e]||"$"+e}lc[sc.NEQ]="$ne",lc[xa.REMOVE]="$unset",lc[xa.SHIFT]="$pop",lc[xa.UNSHIFT]="$push";var dc=function(){return dc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},dc.apply(this,arguments)},yc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},gc=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(yc(arguments[t]));return e};function vc(e){return mc(e,[e])}function mc(e,t){if(!Fa(e)){if(qa(e))return{$date:+e};if(Wa(e))return{$regex:e.source,$options:e.flags};if(Ma(e))return e.map((function(e){if(t.indexOf(e)>-1)throw new Error("Cannot convert circular structure to JSON");return mc(e,gc(t,[e]))}));if(ja(e)){var n=dc({},e);for(var r in n){if(t.indexOf(n[r])>-1)throw new Error("Cannot convert circular structure to JSON");n[r]=mc(n[r],gc(t,[n[r]]))}return n}return e}switch(e._internalType){case wa:return e.toJSON();case Na:case Ta:return e.parse();default:return e.toJSON?e.toJSON():e}}var _c=function(){return _c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},_c.apply(this,arguments)},bc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},wc=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(bc(arguments[t]));return e};function Ec(e,t,n,r){var o=_c({},e);for(var i in e)if(!/^\$/.test(i)){var s=e[i];if(s&&ja(s)&&!t(s)){if(r.indexOf(s)>-1)throw new Error("Cannot convert circular structure to JSON");var a=Ec(s,t,wc(n,[i]),wc(r,[s]));o[i]=a;var c=!1;for(var u in a)/^\$/.test(u)?c=!0:(o[i+"."+u]=a[u],delete o[i][u]);c||delete o[i]}}return o}function Sc(e){return Ec(e,Oc,[],[e])}function Ic(e,t,n){for(var r in t[n]||delete e[n],t)e[r]?Ma(e[r])?e[r].push(t[r]):ja(e[r])?ja(t[r])?Object.assign(e[r],t[r]):(console.warn("unmergable condition, query is object but condition is "+Da(t)+", can only overwrite",t,n),e[r]=t[r]):(console.warn("to-merge query is of type "+Da(e)+", can only overwrite",e,t,n),e[r]=t[r]):e[r]=t[r]}function Oc(e){return Fa(e)||qa(e)||Wa(e)}function Ac(e){return vc(e)}var Nc=function(){function e(){}return e.encode=function(t){return(new e).encodeUpdate(t)},e.prototype.encodeUpdate=function(e){return rc(e)?this.encodeUpdateCommand(e):"object"===Da(e)?this.encodeUpdateObject(e):e},e.prototype.encodeUpdateCommand=function(e){if(e.fieldName===va)throw new Error("Cannot encode a comparison command with unset field name");switch(e.operator){case xa.PUSH:case xa.PULL:case xa.PULL_ALL:case xa.POP:case xa.SHIFT:case xa.UNSHIFT:case xa.ADD_TO_SET:return this.encodeArrayUpdateCommand(e);default:return this.encodeFieldUpdateCommand(e)}},e.prototype.encodeFieldUpdateCommand=function(e){var t,n,r,o,i=pc(e.operator);return e.operator===xa.REMOVE?((t={})[i]=((n={})[e.fieldName]="",n),t):((r={})[i]=((o={})[e.fieldName]=e.operands[0],o),r)},e.prototype.encodeArrayUpdateCommand=function(e){var t,n,r,o,i,s,a,c,u,f,l=pc(e.operator);switch(e.operator){case xa.PUSH:var h=void 0;return h=Ma(e.operands)?{$each:e.operands.map(Ac)}:e.operands,(t={})[l]=((n={})[e.fieldName]=h,n),t;case xa.UNSHIFT:h={$each:e.operands.map(Ac),$position:0};return(r={})[l]=((o={})[e.fieldName]=h,o),r;case xa.POP:return(i={})[l]=((s={})[e.fieldName]=1,s),i;case xa.SHIFT:return(a={})[l]=((c={})[e.fieldName]=-1,c),a;default:return(u={})[l]=((f={})[e.fieldName]=Ac(e.operands),f),u}},e.prototype.encodeUpdateObject=function(e){var t=Sc(e);for(var n in t)if(!/^\$/.test(n)){var r=t[n];if(rc(r)){t[n]=r._setFieldName(n),Ic(t,this.encodeUpdateCommand(t[n]),n)}else{t[n]=r=Ac(r);var o=new nc(xa.SET,[r],n);Ic(t,this.encodeUpdateCommand(o),n)}}return t},e}(),Tc={};function Rc(e){if(!bf.wsClientClass)throw new Error("to use realtime you must import realtime module first");var t=e.config.env;return Tc[t]||(Tc[t]=new bf.wsClientClass({context:{appConfig:{docSizeLimit:1e3,realtimePingInterval:1e4,realtimePongWaitTimeout:5e3,request:new bf.reqClass(e.config)}}})),Tc[t]}var Pc=function(){return Pc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Pc.apply(this,arguments)},xc=function(){function e(e,t,n,r){var o=this;void 0===r&&(r={}),this.watch=function(e){return Rc(o._db).watch(Pc(Pc({},e),{envId:o._db.config.env,collectionName:o._coll,query:JSON.stringify({_id:o.id})}))},this._db=e,this._coll=t,this.id=n,this.request=new bf.reqClass(this._db.config),this.projection=r}return e.prototype.create=function(e,t){t=t||ec();var n={collectionName:this._coll,data:vc(e)};return this.id&&(n._id=this.id),this.request.send("database.addDocument",n).then((function(e){e.code?t(0,e):t(0,{id:e.data._id,requestId:e.requestId})})).catch((function(e){t(e)})),t.promise},e.prototype.set=function(e,t){if(t=t||ec(),!this.id)return Promise.resolve({code:"INVALID_PARAM",message:"docId不能为空"});if(!e||"object"!=typeof e)return Promise.resolve({code:"INVALID_PARAM",message:"参数必需是非空对象"});if(e.hasOwnProperty("_id"))return Promise.resolve({code:"INVALID_PARAM",message:"不能更新_id的值"});var n=!1,r=function(e){if("object"==typeof e)for(var t in e)e[t]instanceof nc?n=!0:"object"==typeof e[t]&&r(e[t])};if(r(e),n)return Promise.resolve({code:"DATABASE_REQUEST_FAILED",message:"update operator complicit"});var o={collectionName:this._coll,queryType:Xs.DOC,data:vc(e),multi:!1,merge:!1,upsert:!0};return this.id&&(o.query={_id:this.id}),this.request.send("database.updateDocument",o).then((function(e){e.code?t(0,e):t(0,{updated:e.data.updated,upsertedId:e.data.upserted_id,requestId:e.requestId})})).catch((function(e){t(e)})),t.promise},e.prototype.update=function(e,t){if(t=t||ec(),!e||"object"!=typeof e)return Promise.resolve({code:"INVALID_PARAM",message:"参数必需是非空对象"});if(e.hasOwnProperty("_id"))return Promise.resolve({code:"INVALID_PARAM",message:"不能更新_id的值"});var n={_id:this.id},r={collectionName:this._coll,data:Nc.encode(e),query:n,queryType:Xs.DOC,multi:!1,merge:!0,upsert:!1};return this.request.send("database.updateDocument",r).then((function(e){e.code?t(0,e):t(0,{updated:e.data.updated,upsertedId:e.data.upserted_id,requestId:e.requestId})})).catch((function(e){t(e)})),t.promise},e.prototype.remove=function(e){e=e||ec();var t={_id:this.id},n={collectionName:this._coll,query:t,queryType:Xs.DOC,multi:!1};return this.request.send("database.deleteDocument",n).then((function(t){t.code?e(0,t):e(0,{deleted:t.data.deleted,requestId:t.requestId})})).catch((function(t){e(t)})),e.promise},e.prototype.get=function(e){e=e||ec();var t={_id:this.id},n={collectionName:this._coll,query:t,queryType:Xs.DOC,multi:!1,projection:this.projection};return this.request.send("database.queryDocument",n).then((function(t){if(t.code)e(0,t);else{var n=Ca.formatResDocumentData(t.data.list);e(0,{data:n,requestId:t.requestId,total:t.TotalCount,limit:t.Limit,offset:t.Offset})}})).catch((function(t){e(t)})),e.promise},e.prototype.field=function(t){for(var n in t)t[n]?t[n]=1:t[n]=0;return new e(this._db,this._coll,this.id,t)},e}(),Lc=function(){function e(){}return e.encode=function(e){return(new Cc).encodeQuery(e)},e}(),Cc=function(){function e(){}return e.prototype.encodeQuery=function(e,t){var n;return Oc(e)?ic(e)?this.encodeLogicCommand(e):uc(e)?this.encodeQueryCommand(e):((n={})[t]=this.encodeQueryObject(e),n):ja(e)?this.encodeQueryObject(e):e},e.prototype.encodeRegExp=function(e){return{$regex:e.source,$options:e.flags}},e.prototype.encodeLogicCommand=function(e){var t,n,r,o,i,s,a,c=this;switch(e.operator){case tc.NOR:case tc.AND:case tc.OR:var u=pc(e.operator),f=e.operands.map((function(t){return c.encodeQuery(t,e.fieldName)}));return(t={})[u]=f,t;case tc.NOT:u=pc(e.operator);var l=e.operands[0];if(Wa(l))return(n={})[e.fieldName]=((r={})[u]=this.encodeRegExp(l),r),n;f=this.encodeQuery(l)[e.fieldName];return(o={})[e.fieldName]=((i={})[u]=f,i),o;default:u=pc(e.operator);if(1===e.operands.length){var h=this.encodeQuery(e.operands[0]);return(s={})[u]=h,s}f=e.operands.map(this.encodeQuery.bind(this));return(a={})[u]=f,a}},e.prototype.encodeQueryCommand=function(e){return fc(e),this.encodeComparisonCommand(e)},e.prototype.encodeComparisonCommand=function(e){var t,n,r,o,i,s,a,c,u;if(e.fieldName===va)throw new Error("Cannot encode a comparison command with unset field name");var f=pc(e.operator);switch(e.operator){case sc.EQ:case sc.NEQ:case sc.LT:case sc.LTE:case sc.GT:case sc.GTE:case sc.ELEM_MATCH:case sc.EXISTS:case sc.SIZE:case sc.MOD:return(t={})[e.fieldName]=((n={})[f]=Ac(e.operands[0]),n),t;case sc.IN:case sc.NIN:case sc.ALL:return(r={})[e.fieldName]=((o={})[f]=Ac(e.operands),o),r;case sc.GEO_NEAR:var l=e.operands[0];return(i={})[e.fieldName]={$nearSphere:{$geometry:l.geometry.toJSON(),$maxDistance:l.maxDistance,$minDistance:l.minDistance}},i;case sc.GEO_WITHIN:l=e.operands[0];return(s={})[e.fieldName]={$geoWithin:{$geometry:l.geometry.toJSON()}},s;case sc.GEO_INTERSECTS:l=e.operands[0];return(a={})[e.fieldName]={$geoIntersects:{$geometry:l.geometry.toJSON()}},a;default:return(c={})[e.fieldName]=((u={})[f]=Ac(e.operands[0]),u),c}},e.prototype.encodeQueryObject=function(e){var t=Sc(e);for(var n in t){var r=t[n];if(ic(r)){t[n]=r._setFieldName(n);var o=this.encodeLogicCommand(t[n]);this.mergeConditionAfterEncode(t,o,n)}else if(fc(r)){t[n]=r._setFieldName(n);o=this.encodeComparisonCommand(t[n]);this.mergeConditionAfterEncode(t,o,n)}else Oc(r)&&(t[n]=Ac(r))}return t},e.prototype.mergeConditionAfterEncode=function(e,t,n){for(var r in t[n]||delete e[n],t)e[r]?Ma(e[r])?e[r]=e[r].concat(t[r]):ja(e[r])?ja(t[r])?Object.assign(e,t):(console.warn("unmergable condition, query is object but condition is "+Da(t)+", can only overwrite",t,n),e[r]=t[r]):(console.warn("to-merge query is of type "+Da(e)+", can only overwrite",e,t,n),e[r]=t[r]):e[r]=t[r]},e}(),kc=function(){return kc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},kc.apply(this,arguments)},Dc=function(){function e(e,t,n,r,o){var i=this;this.watch=function(e){return Rc(i._db).watch(kc(kc({},e),{envId:i._db.config.env,collectionName:i._coll,query:JSON.stringify(i._fieldFilters||{}),limit:i._queryOptions.limit,orderBy:i._fieldOrders?i._fieldOrders.reduce((function(e,t){return e[t.field]=t.direction,e}),{}):void 0}))},this._db=e,this._coll=t,this._fieldFilters=n,this._fieldOrders=r||[],this._queryOptions=o||{},this._request=new bf.reqClass(this._db.config)}return e.prototype.get=function(e){e=e||ec();var t=[];this._fieldOrders&&this._fieldOrders.forEach((function(e){t.push(e)}));var n={collectionName:this._coll,queryType:Xs.WHERE};return this._fieldFilters&&(n.query=this._fieldFilters),t.length>0&&(n.order=t),this._queryOptions.offset&&(n.offset=this._queryOptions.offset),this._queryOptions.limit?n.limit=this._queryOptions.limit<1e3?this._queryOptions.limit:1e3:n.limit=100,this._queryOptions.projection&&(n.projection=this._queryOptions.projection),this._request.send("database.queryDocument",n).then((function(t){if(t.code)e(0,t);else{var n={data:Ca.formatResDocumentData(t.data.list),requestId:t.requestId};t.TotalCount&&(n.total=t.TotalCount),t.Limit&&(n.limit=t.Limit),t.Offset&&(n.offset=t.Offset),e(0,n)}})).catch((function(t){e(t)})),e.promise},e.prototype.count=function(e){e=e||ec();var t={collectionName:this._coll,queryType:Xs.WHERE};return this._fieldFilters&&(t.query=this._fieldFilters),this._request.send("database.countDocument",t).then((function(t){t.code?e(0,t):e(0,{requestId:t.requestId,total:t.data.total})})).catch((function(t){e(t)})),e.promise},e.prototype.where=function(t){if("Object"!==Object.prototype.toString.call(t).slice(8,-1))throw Error(Vs.QueryParamTypeError);var n=Object.keys(t),r=n.some((function(e){return void 0!==t[e]}));if(n.length&&!r)throw Error(Vs.QueryParamValueError);return new e(this._db,this._coll,Lc.encode(t),this._fieldOrders,this._queryOptions)},e.prototype.orderBy=function(t,n){ka.isFieldPath(t),ka.isFieldOrder(n);var r={field:t,direction:n},o=this._fieldOrders.concat(r);return new e(this._db,this._coll,this._fieldFilters,o,this._queryOptions)},e.prototype.limit=function(t){ka.isInteger("limit",t);var n=kc({},this._queryOptions);return n.limit=t,new e(this._db,this._coll,this._fieldFilters,this._fieldOrders,n)},e.prototype.skip=function(t){ka.isInteger("offset",t);var n=kc({},this._queryOptions);return n.offset=t,new e(this._db,this._coll,this._fieldFilters,this._fieldOrders,n)},e.prototype.update=function(e,t){if(t=t||ec(),!e||"object"!=typeof e)return Promise.resolve({code:"INVALID_PARAM",message:"参数必需是非空对象"});if(e.hasOwnProperty("_id"))return Promise.resolve({code:"INVALID_PARAM",message:"不能更新_id的值"});var n={collectionName:this._coll,query:this._fieldFilters,queryType:Xs.WHERE,multi:!0,merge:!0,upsert:!1,data:Nc.encode(e)};return this._request.send("database.updateDocument",n).then((function(e){e.code?t(0,e):t(0,{requestId:e.requestId,updated:e.data.updated,upsertId:e.data.upsert_id})})).catch((function(e){t(e)})),t.promise},e.prototype.field=function(t){for(var n in t)t[n]?"object"!=typeof t[n]&&(t[n]=1):t[n]=0;var r=kc({},this._queryOptions);return r.projection=t,new e(this._db,this._coll,this._fieldFilters,this._fieldOrders,r)},e.prototype.remove=function(e){e=e||ec(),Object.keys(this._queryOptions).length>0&&console.warn("`offset`, `limit` and `projection` are not supported in remove() operation"),this._fieldOrders.length>0&&console.warn("`orderBy` is not supported in remove() operation");var t={collectionName:this._coll,query:Lc.encode(this._fieldFilters),queryType:Xs.WHERE,multi:!0};return this._request.send("database.deleteDocument",t).then((function(t){t.code?e(0,t):e(0,{requestId:t.requestId,deleted:t.data.deleted})})).catch((function(t){e(t)})),e.promise},e}(),jc=function(e,t){return jc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},jc(e,t)};function Uc(e,t){function n(){this.constructor=e}jc(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Mc=function(e){function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return Uc(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),t}(Error),qc=function(e){function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return Uc(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),t}(TypeError);function Wc(e){return e&&e.Math==Math&&e}function Fc(){return Wc("object"==typeof globalThis&&globalThis)||Wc("object"==typeof window&&window)||Wc("object"==typeof self&&self)||Wc("object"==typeof global&&global)||Function("return this")()}var Bc=function(t){var n,r="object"==typeof(n=Fc()).navigator&&"ReactNative"===n.navigator.product?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(r);for(var o=e.alloc(t),i=0;i<t;++i)o[i]=Math.floor(256*Math.random());return o},$c=function(){var e=void 0;try{e=require("crypto").randomBytes}catch(e){}return e||Bc}();function Hc(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)}function Gc(e){return"object"==typeof e&&null!==e}function Kc(e,t){var n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(console.warn(t),n=!0),e.apply(this,r)}}function Vc(t){if(ArrayBuffer.isView(t))return e.from(t.buffer,t.byteOffset,t.byteLength);if(n=t,["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(n)))return e.from(t);var n;throw new qc("Must use either Buffer or TypedArray")}var Jc=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i,Yc=function(e){return"string"==typeof e&&Jc.test(e)},Zc=function(t){if(!Yc(t))throw new qc('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".');var n=t.replace(/-/g,"");return e.from(n,"hex")},Xc=function(e,t){return void 0===t&&(t=!0),t?e.toString("hex",0,4)+"-"+e.toString("hex",4,6)+"-"+e.toString("hex",6,8)+"-"+e.toString("hex",8,10)+"-"+e.toString("hex",10,16):e.toString("hex")},zc=Math.pow(2,53),Qc=-Math.pow(2,53),eu=function(){function t(n,r){if(!(this instanceof t))return new t(n,r);if(!(null==n||"string"==typeof n||ArrayBuffer.isView(n)||n instanceof ArrayBuffer||Array.isArray(n)))throw new qc("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=null!=r?r:t.BSON_BINARY_SUBTYPE_DEFAULT,null==n?(this.buffer=e.alloc(t.BUFFER_SIZE),this.position=0):("string"==typeof n?this.buffer=e.from(n,"binary"):Array.isArray(n)?this.buffer=e.from(n):this.buffer=Vc(n),this.position=this.buffer.byteLength)}return t.prototype.put=function(n){if("string"==typeof n&&1!==n.length)throw new qc("only accepts single character String");if("number"!=typeof n&&1!==n.length)throw new qc("only accepts single character Uint8Array or Array");var r;if((r="string"==typeof n?n.charCodeAt(0):"number"==typeof n?n:n[0])<0||r>255)throw new qc("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=r;else{var o=e.alloc(t.BUFFER_SIZE+this.buffer.length);this.buffer.copy(o,0,0,this.buffer.length),this.buffer=o,this.buffer[this.position++]=r}},t.prototype.write=function(t,n){if(n="number"==typeof n?n:this.position,this.buffer.length<n+t.length){var r=e.alloc(this.buffer.length+t.length);this.buffer.copy(r,0,0,this.buffer.length),this.buffer=r}ArrayBuffer.isView(t)?(this.buffer.set(Vc(t),n),this.position=n+t.byteLength>this.position?n+t.length:this.position):"string"==typeof t&&(this.buffer.write(t,n,t.length,"binary"),this.position=n+t.length>this.position?n+t.length:this.position)},t.prototype.read=function(e,t){return t=t&&t>0?t:this.position,this.buffer.slice(e,e+t)},t.prototype.value=function(e){return(e=!!e)&&this.buffer.length===this.position?this.buffer:e?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)},t.prototype.length=function(){return this.position},t.prototype.toJSON=function(){return this.buffer.toString("base64")},t.prototype.toString=function(e){return this.buffer.toString(e)},t.prototype.toExtendedJSON=function(e){e=e||{};var t=this.buffer.toString("base64"),n=Number(this.sub_type).toString(16);return e.legacy?{$binary:t,$type:1===n.length?"0"+n:n}:{$binary:{base64:t,subType:1===n.length?"0"+n:n}}},t.prototype.toUUID=function(){if(this.sub_type===t.SUBTYPE_UUID)return new tu(this.buffer.slice(0,this.position));throw new Mc('Binary sub_type "'.concat(this.sub_type,'" is not supported for converting to UUID. Only "').concat(t.SUBTYPE_UUID,'" is currently supported.'))},t.fromExtendedJSON=function(n,r){var o,i;if(r=r||{},"$binary"in n?r.legacy&&"string"==typeof n.$binary&&"$type"in n?(i=n.$type?parseInt(n.$type,16):0,o=e.from(n.$binary,"base64")):"string"!=typeof n.$binary&&(i=n.$binary.subType?parseInt(n.$binary.subType,16):0,o=e.from(n.$binary.base64,"base64")):"$uuid"in n&&(i=4,o=Zc(n.$uuid)),!o)throw new qc("Unexpected Binary Extended JSON format ".concat(JSON.stringify(n)));return 4===i?new tu(o):new t(o,i)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.value(!0);return'new Binary(Buffer.from("'.concat(e.toString("hex"),'", "hex"), ').concat(this.sub_type,")")},t.BSON_BINARY_SUBTYPE_DEFAULT=0,t.BUFFER_SIZE=256,t.SUBTYPE_DEFAULT=0,t.SUBTYPE_FUNCTION=1,t.SUBTYPE_BYTE_ARRAY=2,t.SUBTYPE_UUID_OLD=3,t.SUBTYPE_UUID=4,t.SUBTYPE_MD5=5,t.SUBTYPE_ENCRYPTED=6,t.SUBTYPE_COLUMN=7,t.SUBTYPE_USER_DEFINED=128,t}();Object.defineProperty(eu.prototype,"_bsontype",{value:"Binary"});var tu=function(t){function n(r){var o,i,s=this;if(null==r)o=n.generate();else if(r instanceof n)o=e.from(r.buffer),i=r.__id;else if(ArrayBuffer.isView(r)&&16===r.byteLength)o=Vc(r);else{if("string"!=typeof r)throw new qc("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");o=Zc(r)}return(s=t.call(this,o,4)||this).__id=i,s}return Uc(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.buffer},set:function(e){this.buffer=e,n.cacheHexString&&(this.__id=Xc(e))},enumerable:!1,configurable:!0}),n.prototype.toHexString=function(e){if(void 0===e&&(e=!0),n.cacheHexString&&this.__id)return this.__id;var t=Xc(this.id,e);return n.cacheHexString&&(this.__id=t),t},n.prototype.toString=function(e){return e?this.id.toString(e):this.toHexString()},n.prototype.toJSON=function(){return this.toHexString()},n.prototype.equals=function(e){if(!e)return!1;if(e instanceof n)return e.id.equals(this.id);try{return new n(e).id.equals(this.id)}catch(e){return!1}},n.prototype.toBinary=function(){return new eu(this.id,eu.SUBTYPE_UUID)},n.generate=function(){var t=$c(16);return t[6]=15&t[6]|64,t[8]=63&t[8]|128,e.from(t)},n.isValid=function(e){return!!e&&(e instanceof n||("string"==typeof e?Yc(e):!!Hc(e)&&(16===e.length&&(64==(240&e[6])&&128==(128&e[8])))))},n.createFromHexString=function(e){return new n(Zc(e))},n.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},n.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},n}(eu),nu=function(){function e(t,n){if(!(this instanceof e))return new e(t,n);this.code=t,this.scope=n}return e.prototype.toJSON=function(){return{code:this.code,scope:this.scope}},e.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},e.fromExtendedJSON=function(t){return new e(t.$code,t.$scope)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var e=this.toJSON();return'new Code("'.concat(String(e.code),'"').concat(e.scope?", ".concat(JSON.stringify(e.scope)):"",")")},e}();Object.defineProperty(nu.prototype,"_bsontype",{value:"Code"});var ru=function(){function e(t,n,r,o){if(!(this instanceof e))return new e(t,n,r,o);var i=t.split(".");2===i.length&&(r=i.shift(),t=i.shift()),this.collection=t,this.oid=n,this.db=r,this.fields=o||{}}return Object.defineProperty(e.prototype,"namespace",{get:function(){return this.collection},set:function(e){this.collection=e},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){var e=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return null!=this.db&&(e.$db=this.db),e},e.prototype.toExtendedJSON=function(e){e=e||{};var t={$ref:this.collection,$id:this.oid};return e.legacy?t:(this.db&&(t.$db=this.db),t=Object.assign(t,this.fields))},e.fromExtendedJSON=function(t){var n=Object.assign({},t);return delete n.$ref,delete n.$id,delete n.$db,new e(t.$ref,t.$id,t.$db,n)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var e=void 0===this.oid||void 0===this.oid.toString?this.oid:this.oid.toString();return'new DBRef("'.concat(this.namespace,'", new ObjectId("').concat(String(e),'")').concat(this.db?', "'.concat(this.db,'"'):"",")")},e}();Object.defineProperty(ru.prototype,"_bsontype",{value:"DBRef"});var ou=void 0;try{ou=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(Ks){}var iu=4294967296,su=0x10000000000000000,au=su/2,cu={},uu={},fu=function(){function e(t,n,r){if(void 0===t&&(t=0),!(this instanceof e))return new e(t,n,r);"bigint"==typeof t?Object.assign(this,e.fromBigInt(t,!!n)):"string"==typeof t?Object.assign(this,e.fromString(t,!!n)):(this.low=0|t,this.high=0|n,this.unsigned=!!r),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return e.fromBits=function(t,n,r){return new e(t,n,r)},e.fromInt=function(t,n){var r,o,i;return n?(i=0<=(t>>>=0)&&t<256)&&(o=uu[t])?o:(r=e.fromBits(t,(0|t)<0?-1:0,!0),i&&(uu[t]=r),r):(i=-128<=(t|=0)&&t<128)&&(o=cu[t])?o:(r=e.fromBits(t,t<0?-1:0,!1),i&&(cu[t]=r),r)},e.fromNumber=function(t,n){if(isNaN(t))return n?e.UZERO:e.ZERO;if(n){if(t<0)return e.UZERO;if(t>=su)return e.MAX_UNSIGNED_VALUE}else{if(t<=-au)return e.MIN_VALUE;if(t+1>=au)return e.MAX_VALUE}return t<0?e.fromNumber(-t,n).neg():e.fromBits(t%iu|0,t/iu|0,n)},e.fromBigInt=function(t,n){return e.fromString(t.toString(),n)},e.fromString=function(t,n,r){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return e.ZERO;if("number"==typeof n?(r=n,n=!1):n=!!n,(r=r||10)<2||36<r)throw RangeError("radix");var o;if((o=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===o)return e.fromString(t.substring(1),n,r).neg();for(var i=e.fromNumber(Math.pow(r,8)),s=e.ZERO,a=0;a<t.length;a+=8){var c=Math.min(8,t.length-a),u=parseInt(t.substring(a,a+c),r);if(c<8){var f=e.fromNumber(Math.pow(r,c));s=s.mul(f).add(e.fromNumber(u))}else s=(s=s.mul(i)).add(e.fromNumber(u))}return s.unsigned=n,s},e.fromBytes=function(t,n,r){return r?e.fromBytesLE(t,n):e.fromBytesBE(t,n)},e.fromBytesLE=function(t,n){return new e(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,n)},e.fromBytesBE=function(t,n){return new e(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],n)},e.isLong=function(e){return Gc(e)&&!0===e.__isLong__},e.fromValue=function(t,n){return"number"==typeof t?e.fromNumber(t,n):"string"==typeof t?e.fromString(t,n):e.fromBits(t.low,t.high,"boolean"==typeof n?n:t.unsigned)},e.prototype.add=function(t){e.isLong(t)||(t=e.fromValue(t));var n=this.high>>>16,r=65535&this.high,o=this.low>>>16,i=65535&this.low,s=t.high>>>16,a=65535&t.high,c=t.low>>>16,u=0,f=0,l=0,h=0;return l+=(h+=i+(65535&t.low))>>>16,h&=65535,f+=(l+=o+c)>>>16,l&=65535,u+=(f+=r+a)>>>16,f&=65535,u+=n+s,u&=65535,e.fromBits(l<<16|h,u<<16|f,this.unsigned)},e.prototype.and=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low&t.low,this.high&t.high,this.unsigned)},e.prototype.compare=function(t){if(e.isLong(t)||(t=e.fromValue(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.prototype.comp=function(e){return this.compare(e)},e.prototype.divide=function(t){if(e.isLong(t)||(t=e.fromValue(t)),t.isZero())throw Error("division by zero");if(ou){if(!this.unsigned&&-2147483648===this.high&&-1===t.low&&-1===t.high)return this;var n=(this.unsigned?ou.div_u:ou.div_s)(this.low,this.high,t.low,t.high);return e.fromBits(n,ou.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var r,o,i;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return e.UZERO;if(t.gt(this.shru(1)))return e.UONE;i=e.UZERO}else{if(this.eq(e.MIN_VALUE))return t.eq(e.ONE)||t.eq(e.NEG_ONE)?e.MIN_VALUE:t.eq(e.MIN_VALUE)?e.ONE:(r=this.shr(1).div(t).shl(1)).eq(e.ZERO)?t.isNegative()?e.ONE:e.NEG_ONE:(o=this.sub(t.mul(r)),i=r.add(o.div(t)));if(t.eq(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;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();i=e.ZERO}for(o=this;o.gte(t);){r=Math.max(1,Math.floor(o.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),a=s<=48?1:Math.pow(2,s-48),c=e.fromNumber(r),u=c.mul(t);u.isNegative()||u.gt(o);)r-=a,u=(c=e.fromNumber(r,this.unsigned)).mul(t);c.isZero()&&(c=e.ONE),i=i.add(c),o=o.sub(u)}return i},e.prototype.div=function(e){return this.divide(e)},e.prototype.equals=function(t){return e.isLong(t)||(t=e.fromValue(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},e.prototype.eq=function(e){return this.equals(e)},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(e.MIN_VALUE)?64:this.neg().getNumBitsAbs();var t,n=0!==this.high?this.high:this.low;for(t=31;t>0&&0==(n&1<<t);t--);return 0!==this.high?t+33:t+1},e.prototype.greaterThan=function(e){return this.comp(e)>0},e.prototype.gt=function(e){return this.greaterThan(e)},e.prototype.greaterThanOrEqual=function(e){return this.comp(e)>=0},e.prototype.gte=function(e){return this.greaterThanOrEqual(e)},e.prototype.ge=function(e){return this.greaterThanOrEqual(e)},e.prototype.isEven=function(){return 0==(1&this.low)},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isOdd=function(){return 1==(1&this.low)},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isZero=function(){return 0===this.high&&0===this.low},e.prototype.lessThan=function(e){return this.comp(e)<0},e.prototype.lt=function(e){return this.lessThan(e)},e.prototype.lessThanOrEqual=function(e){return this.comp(e)<=0},e.prototype.lte=function(e){return this.lessThanOrEqual(e)},e.prototype.modulo=function(t){if(e.isLong(t)||(t=e.fromValue(t)),ou){var n=(this.unsigned?ou.rem_u:ou.rem_s)(this.low,this.high,t.low,t.high);return e.fromBits(n,ou.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},e.prototype.mod=function(e){return this.modulo(e)},e.prototype.rem=function(e){return this.modulo(e)},e.prototype.multiply=function(t){if(this.isZero())return e.ZERO;if(e.isLong(t)||(t=e.fromValue(t)),ou){var n=ou.mul(this.low,this.high,t.low,t.high);return e.fromBits(n,ou.get_high(),this.unsigned)}if(t.isZero())return e.ZERO;if(this.eq(e.MIN_VALUE))return t.isOdd()?e.MIN_VALUE:e.ZERO;if(t.eq(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;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(e.TWO_PWR_24)&&t.lt(e.TWO_PWR_24))return e.fromNumber(this.toNumber()*t.toNumber(),this.unsigned);var r=this.high>>>16,o=65535&this.high,i=this.low>>>16,s=65535&this.low,a=t.high>>>16,c=65535&t.high,u=t.low>>>16,f=65535&t.low,l=0,h=0,p=0,d=0;return p+=(d+=s*f)>>>16,d&=65535,h+=(p+=i*f)>>>16,p&=65535,h+=(p+=s*u)>>>16,p&=65535,l+=(h+=o*f)>>>16,h&=65535,l+=(h+=i*u)>>>16,h&=65535,l+=(h+=s*c)>>>16,h&=65535,l+=r*f+o*u+i*c+s*a,l&=65535,e.fromBits(p<<16|d,l<<16|h,this.unsigned)},e.prototype.mul=function(e){return this.multiply(e)},e.prototype.negate=function(){return!this.unsigned&&this.eq(e.MIN_VALUE)?e.MIN_VALUE:this.not().add(e.ONE)},e.prototype.neg=function(){return this.negate()},e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.notEquals=function(e){return!this.equals(e)},e.prototype.neq=function(e){return this.notEquals(e)},e.prototype.ne=function(e){return this.notEquals(e)},e.prototype.or=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low|t.low,this.high|t.high,this.unsigned)},e.prototype.shiftLeft=function(t){return e.isLong(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?e.fromBits(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):e.fromBits(0,this.low<<t-32,this.unsigned)},e.prototype.shl=function(e){return this.shiftLeft(e)},e.prototype.shiftRight=function(t){return e.isLong(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?e.fromBits(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):e.fromBits(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=function(e){return this.shiftRight(e)},e.prototype.shiftRightUnsigned=function(t){if(e.isLong(t)&&(t=t.toInt()),0===(t&=63))return this;var n=this.high;if(t<32){var r=this.low;return e.fromBits(r>>>t|n<<32-t,n>>>t,this.unsigned)}return 32===t?e.fromBits(n,0,this.unsigned):e.fromBits(n>>>t-32,0,this.unsigned)},e.prototype.shr_u=function(e){return this.shiftRightUnsigned(e)},e.prototype.shru=function(e){return this.shiftRightUnsigned(e)},e.prototype.subtract=function(t){return e.isLong(t)||(t=e.fromValue(t)),this.add(t.neg())},e.prototype.sub=function(e){return this.subtract(e)},e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*iu+(this.low>>>0):this.high*iu+(this.low>>>0)},e.prototype.toBigInt=function(){return BigInt(this.toString())},e.prototype.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},e.prototype.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},e.prototype.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},e.prototype.toSigned=function(){return this.unsigned?e.fromBits(this.low,this.high,!1):this},e.prototype.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(e.MIN_VALUE)){var n=e.fromNumber(t),r=this.div(n),o=r.mul(n).sub(this);return r.toString(t)+o.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var i=e.fromNumber(Math.pow(t,6),this.unsigned),s=this,a="";;){var c=s.div(i),u=(s.sub(c.mul(i)).toInt()>>>0).toString(t);if((s=c).isZero())return u+a;for(;u.length<6;)u="0"+u;a=""+u+a}},e.prototype.toUnsigned=function(){return this.unsigned?this:e.fromBits(this.low,this.high,!0)},e.prototype.xor=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low^t.low,this.high^t.high,this.unsigned)},e.prototype.eqz=function(){return this.isZero()},e.prototype.le=function(e){return this.lessThanOrEqual(e)},e.prototype.toExtendedJSON=function(e){return e&&e.relaxed?this.toNumber():{$numberLong:this.toString()}},e.fromExtendedJSON=function(t,n){var r=e.fromString(t.$numberLong);return n&&n.relaxed?r.toNumber():r},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new Long("'.concat(this.toString(),'"').concat(this.unsigned?", true":"",")")},e.TWO_PWR_24=e.fromInt(16777216),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e}();Object.defineProperty(fu.prototype,"__isLong__",{value:!0}),Object.defineProperty(fu.prototype,"_bsontype",{value:"Long"});var lu=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,hu=/^(\+|-)?(Infinity|inf)$/i,pu=/^(\+|-)?NaN$/i,du=6111,yu=-6176,gu=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),vu=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),mu=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),_u=/^([-+])?(\d+)?$/;function bu(e){return!isNaN(parseInt(e,10))}function wu(e){var t=fu.fromNumber(1e9),n=fu.fromNumber(0);if(!(e.parts[0]||e.parts[1]||e.parts[2]||e.parts[3]))return{quotient:e,rem:n};for(var r=0;r<=3;r++)n=(n=n.shiftLeft(32)).add(new fu(e.parts[r],0)),e.parts[r]=n.div(t).low,n=n.modulo(t);return{quotient:e,rem:n}}function Eu(e,t){throw new qc('"'.concat(e,'" is not a valid Decimal128 string - ').concat(t))}var Su=function(){function t(e){if(!(this instanceof t))return new t(e);if("string"==typeof e)this.bytes=t.fromString(e).bytes;else{if(!Hc(e))throw new qc("Decimal128 must take a Buffer or string");if(16!==e.byteLength)throw new qc("Decimal128 must take a Buffer of 16 bytes");this.bytes=e}}return t.fromString=function(n){var r,o=!1,i=!1,s=!1,a=0,c=0,u=0,f=0,l=0,h=[0],p=0,d=0,y=0,g=0,v=0,m=0,_=new fu(0,0),b=new fu(0,0),w=0;if(n.length>=7e3)throw new qc(n+" not a valid Decimal128 string");var E=n.match(lu),S=n.match(hu),I=n.match(pu);if(!E&&!S&&!I||0===n.length)throw new qc(n+" not a valid Decimal128 string");if(E){var O=E[2],A=E[4],N=E[5],T=E[6];A&&void 0===T&&Eu(n,"missing exponent power"),A&&void 0===O&&Eu(n,"missing exponent base"),void 0===A&&(N||T)&&Eu(n,"missing e before exponent")}if("+"!==n[w]&&"-"!==n[w]||(o="-"===n[w++]),!bu(n[w])&&"."!==n[w]){if("i"===n[w]||"I"===n[w])return new t(e.from(o?vu:mu));if("N"===n[w])return new t(e.from(gu))}for(;bu(n[w])||"."===n[w];)"."!==n[w]?(p<34&&("0"!==n[w]||s)&&(s||(l=c),s=!0,h[d++]=parseInt(n[w],10),p+=1),s&&(u+=1),i&&(f+=1),c+=1,w+=1):(i&&Eu(n,"contains multiple periods"),i=!0,w+=1);if(i&&!c)throw new qc(n+" not a valid Decimal128 string");if("e"===n[w]||"E"===n[w]){var R=n.substr(++w).match(_u);if(!R||!R[2])return new t(e.from(gu));v=parseInt(R[0],10),w+=R[0].length}if(n[w])return new t(e.from(gu));if(y=0,p){if(g=p-1,1!==(a=u))for(;0===h[l+a-1];)a-=1}else y=0,g=0,h[0]=0,u=1,p=1,a=0;for(v<=f&&f-v>16384?v=yu:v-=f;v>du;){if((g+=1)-y>34){if(h.join("").match(/^0+$/)){v=du;break}Eu(n,"overflow")}v-=1}for(;v<yu||p<u;){if(0===g&&a<p){v=yu,a=0;break}if(p<u?u-=1:g-=1,v<du)v+=1;else{if(h.join("").match(/^0+$/)){v=du;break}Eu(n,"overflow")}}if(g-y+1<a){var P=c;i&&(l+=1,P+=1),o&&(l+=1,P+=1);var x=parseInt(n[l+g+1],10),L=0;if(x>=5&&(L=1,5===x))for(L=h[g]%2==1?1:0,m=l+g+2;m<P;m++)if(parseInt(n[m],10)){L=1;break}if(L)for(var C=g;C>=0;C--)if(++h[C]>9&&(h[C]=0,0===C)){if(!(v<du))return new t(e.from(o?vu:mu));v+=1,h[C]=1}}if(_=fu.fromNumber(0),b=fu.fromNumber(0),0===a)_=fu.fromNumber(0),b=fu.fromNumber(0);else if(g-y<17){C=y;for(b=fu.fromNumber(h[C++]),_=new fu(0,0);C<=g;C++)b=(b=b.multiply(fu.fromNumber(10))).add(fu.fromNumber(h[C]))}else{C=y;for(_=fu.fromNumber(h[C++]);C<=g-17;C++)_=(_=_.multiply(fu.fromNumber(10))).add(fu.fromNumber(h[C]));for(b=fu.fromNumber(h[C++]);C<=g;C++)b=(b=b.multiply(fu.fromNumber(10))).add(fu.fromNumber(h[C]))}var k,D,j,U,M=function(e,t){if(!e&&!t)return{high:fu.fromNumber(0),low:fu.fromNumber(0)};var n=e.shiftRightUnsigned(32),r=new fu(e.getLowBits(),0),o=t.shiftRightUnsigned(32),i=new fu(t.getLowBits(),0),s=n.multiply(o),a=n.multiply(i),c=r.multiply(o),u=r.multiply(i);return s=s.add(a.shiftRightUnsigned(32)),a=new fu(a.getLowBits(),0).add(c).add(u.shiftRightUnsigned(32)),{high:s=s.add(a.shiftRightUnsigned(32)),low:u=a.shiftLeft(32).add(new fu(u.getLowBits(),0))}}(_,fu.fromString("100000000000000000"));M.low=M.low.add(b),k=M.low,D=b,j=k.high>>>0,U=D.high>>>0,(j<U||j===U&&k.low>>>0<D.low>>>0)&&(M.high=M.high.add(fu.fromNumber(1))),r=v+6176;var q={low:fu.fromNumber(0),high:fu.fromNumber(0)};M.high.shiftRightUnsigned(49).and(fu.fromNumber(1)).equals(fu.fromNumber(1))?(q.high=q.high.or(fu.fromNumber(3).shiftLeft(61)),q.high=q.high.or(fu.fromNumber(r).and(fu.fromNumber(16383).shiftLeft(47))),q.high=q.high.or(M.high.and(fu.fromNumber(0x7fffffffffff)))):(q.high=q.high.or(fu.fromNumber(16383&r).shiftLeft(49)),q.high=q.high.or(M.high.and(fu.fromNumber(562949953421311)))),q.low=M.low,o&&(q.high=q.high.or(fu.fromString("9223372036854775808")));var W=e.alloc(16);return w=0,W[w++]=255&q.low.low,W[w++]=q.low.low>>8&255,W[w++]=q.low.low>>16&255,W[w++]=q.low.low>>24&255,W[w++]=255&q.low.high,W[w++]=q.low.high>>8&255,W[w++]=q.low.high>>16&255,W[w++]=q.low.high>>24&255,W[w++]=255&q.high.low,W[w++]=q.high.low>>8&255,W[w++]=q.high.low>>16&255,W[w++]=q.high.low>>24&255,W[w++]=255&q.high.high,W[w++]=q.high.high>>8&255,W[w++]=q.high.high>>16&255,W[w++]=q.high.high>>24&255,new t(W)},t.prototype.toString=function(){for(var e,t=0,n=new Array(36),r=0;r<n.length;r++)n[r]=0;var o,i,s,a=0,c=!1,u={parts:[0,0,0,0]},f=[];a=0;var l=this.bytes,h=l[a++]|l[a++]<<8|l[a++]<<16|l[a++]<<24,p=l[a++]|l[a++]<<8|l[a++]<<16|l[a++]<<24,d=l[a++]|l[a++]<<8|l[a++]<<16|l[a++]<<24,y=l[a++]|l[a++]<<8|l[a++]<<16|l[a++]<<24;a=0,{low:new fu(h,p),high:new fu(d,y)}.high.lessThan(fu.ZERO)&&f.push("-");var g=y>>26&31;if(g>>3==3){if(30===g)return f.join("")+"Infinity";if(31===g)return"NaN";e=y>>15&16383,o=8+(y>>14&1)}else o=y>>14&7,e=y>>17&16383;var v=e-6176;if(u.parts[0]=(16383&y)+((15&o)<<14),u.parts[1]=d,u.parts[2]=p,u.parts[3]=h,0===u.parts[0]&&0===u.parts[1]&&0===u.parts[2]&&0===u.parts[3])c=!0;else for(s=3;s>=0;s--){var m=0,_=wu(u);if(u=_.quotient,m=_.rem.low)for(i=8;i>=0;i--)n[9*s+i]=m%10,m=Math.floor(m/10)}if(c)t=1,n[a]=0;else for(t=36;!n[a];)t-=1,a+=1;var b=t-1+v;if(b>=34||b<=-7||v>0){if(t>34)return f.push("".concat(0)),v>0?f.push("E+".concat(v)):v<0&&f.push("E".concat(v)),f.join("");f.push("".concat(n[a++])),(t-=1)&&f.push(".");for(r=0;r<t;r++)f.push("".concat(n[a++]));f.push("E"),b>0?f.push("+".concat(b)):f.push("".concat(b))}else if(v>=0)for(r=0;r<t;r++)f.push("".concat(n[a++]));else{var w=t+v;if(w>0)for(r=0;r<w;r++)f.push("".concat(n[a++]));else f.push("0");for(f.push(".");w++<0;)f.push("0");for(r=0;r<t-Math.max(w-1,0);r++)f.push("".concat(n[a++]))}return f.join("")},t.prototype.toJSON=function(){return{$numberDecimal:this.toString()}},t.prototype.toExtendedJSON=function(){return{$numberDecimal:this.toString()}},t.fromExtendedJSON=function(e){return t.fromString(e.$numberDecimal)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Decimal128("'.concat(this.toString(),'")')},t}();Object.defineProperty(Su.prototype,"_bsontype",{value:"Decimal128"});var Iu=function(){function e(t){if(!(this instanceof e))return new e(t);t instanceof Number&&(t=t.valueOf()),this.value=+t}return e.prototype.valueOf=function(){return this.value},e.prototype.toJSON=function(){return this.value},e.prototype.toString=function(e){return this.value.toString(e)},e.prototype.toExtendedJSON=function(e){return e&&(e.legacy||e.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-".concat(this.value.toFixed(1))}:{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}},e.fromExtendedJSON=function(t,n){var r=parseFloat(t.$numberDouble);return n&&n.relaxed?r:new e(r)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var e=this.toExtendedJSON();return"new Double(".concat(e.$numberDouble,")")},e}();Object.defineProperty(Iu.prototype,"_bsontype",{value:"Double"});var Ou=function(){function e(t){if(!(this instanceof e))return new e(t);t instanceof Number&&(t=t.valueOf()),this.value=0|+t}return e.prototype.valueOf=function(){return this.value},e.prototype.toString=function(e){return this.value.toString(e)},e.prototype.toJSON=function(){return this.value},e.prototype.toExtendedJSON=function(e){return e&&(e.relaxed||e.legacy)?this.value:{$numberInt:this.value.toString()}},e.fromExtendedJSON=function(t,n){return n&&n.relaxed?parseInt(t.$numberInt,10):new e(t.$numberInt)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new Int32(".concat(this.valueOf(),")")},e}();Object.defineProperty(Ou.prototype,"_bsontype",{value:"Int32"});var Au=function(){function e(){if(!(this instanceof e))return new e}return e.prototype.toExtendedJSON=function(){return{$maxKey:1}},e.fromExtendedJSON=function(){return new e},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new MaxKey()"},e}();Object.defineProperty(Au.prototype,"_bsontype",{value:"MaxKey"});var Nu=function(){function e(){if(!(this instanceof e))return new e}return e.prototype.toExtendedJSON=function(){return{$minKey:1}},e.fromExtendedJSON=function(){return new e},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new MinKey()"},e}();Object.defineProperty(Nu.prototype,"_bsontype",{value:"MinKey"});var Tu=new RegExp("^[0-9a-fA-F]{24}$"),Ru=null,Pu=Symbol("id"),xu=function(){function t(n){if(!(this instanceof t))return new t(n);var r;if("object"==typeof n&&n&&"id"in n){if("string"!=typeof n.id&&!ArrayBuffer.isView(n.id))throw new qc("Argument passed in must have an id that is of type string or Buffer");r="toHexString"in n&&"function"==typeof n.toHexString?e.from(n.toHexString(),"hex"):n.id}else r=n;if(null==r||"number"==typeof r)this[Pu]=t.generate("number"==typeof r?r:void 0);else if(ArrayBuffer.isView(r)&&12===r.byteLength)this[Pu]=r instanceof e?r:Vc(r);else{if("string"!=typeof r)throw new qc("Argument passed in does not match the accepted types");if(12===r.length){var o=e.from(r);if(12!==o.byteLength)throw new qc("Argument passed in must be a string of 12 bytes");this[Pu]=o}else{if(24!==r.length||!Tu.test(r))throw new qc("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");this[Pu]=e.from(r,"hex")}}t.cacheHexString&&(this.__id=this.id.toString("hex"))}return Object.defineProperty(t.prototype,"id",{get:function(){return this[Pu]},set:function(e){this[Pu]=e,t.cacheHexString&&(this.__id=e.toString("hex"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generationTime",{get:function(){return this.id.readInt32BE(0)},set:function(e){this.id.writeUInt32BE(e,0)},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(){if(t.cacheHexString&&this.__id)return this.__id;var e=this.id.toString("hex");return t.cacheHexString&&!this.__id&&(this.__id=e),e},t.getInc=function(){return t.index=(t.index+1)%16777215},t.generate=function(n){"number"!=typeof n&&(n=Math.floor(Date.now()/1e3));var r=t.getInc(),o=e.alloc(12);return o.writeUInt32BE(n,0),null===Ru&&(Ru=$c(5)),o[4]=Ru[0],o[5]=Ru[1],o[6]=Ru[2],o[7]=Ru[3],o[8]=Ru[4],o[11]=255&r,o[10]=r>>8&255,o[9]=r>>16&255,o},t.prototype.toString=function(e){return e?this.id.toString(e):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(n){if(null==n)return!1;if(n instanceof t)return this[Pu][11]===n[Pu][11]&&this[Pu].equals(n[Pu]);if("string"==typeof n&&t.isValid(n)&&12===n.length&&Hc(this.id))return n===e.prototype.toString.call(this.id,"latin1");if("string"==typeof n&&t.isValid(n)&&24===n.length)return n.toLowerCase()===this.toHexString();if("string"==typeof n&&t.isValid(n)&&12===n.length)return e.from(n).equals(this.id);if("object"==typeof n&&"toHexString"in n&&"function"==typeof n.toHexString){var r=n.toHexString(),o=this.toHexString().toLowerCase();return"string"==typeof r&&r.toLowerCase()===o}return!1},t.prototype.getTimestamp=function(){var e=new Date,t=this.id.readUInt32BE(0);return e.setTime(1e3*Math.floor(t)),e},t.createPk=function(){return new t},t.createFromTime=function(n){var r=e.from([0,0,0,0,0,0,0,0,0,0,0,0]);return r.writeUInt32BE(n,0),new t(r)},t.createFromHexString=function(n){if(void 0===n||null!=n&&24!==n.length)throw new qc("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new t(e.from(n,"hex"))},t.isValid=function(e){if(null==e)return!1;try{return new t(e),!0}catch(e){return!1}},t.prototype.toExtendedJSON=function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}},t.fromExtendedJSON=function(e){return new t(e.$oid)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new ObjectId("'.concat(this.toHexString(),'")')},t.index=Math.floor(16777215*Math.random()),t}();Object.defineProperty(xu.prototype,"generate",{value:Kc((function(e){return xu.generate(e)}),"Please use the static `ObjectId.generate(time)` instead")}),Object.defineProperty(xu.prototype,"getInc",{value:Kc((function(){return xu.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(xu.prototype,"get_inc",{value:Kc((function(){return xu.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(xu,"get_inc",{value:Kc((function(){return xu.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(xu.prototype,"_bsontype",{value:"ObjectID"});var Lu=function(){function e(t,n){if(!(this instanceof e))return new e(t,n);if(this.pattern=t,this.options=(null!=n?n:"").split("").sort().join(""),-1!==this.pattern.indexOf("\0"))throw new Mc("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(-1!==this.options.indexOf("\0"))throw new Mc("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var r=0;r<this.options.length;r++)if("i"!==this.options[r]&&"m"!==this.options[r]&&"x"!==this.options[r]&&"l"!==this.options[r]&&"s"!==this.options[r]&&"u"!==this.options[r])throw new Mc("The regular expression option [".concat(this.options[r],"] is not supported"))}return e.parseOptions=function(e){return e?e.split("").sort().join(""):""},e.prototype.toExtendedJSON=function(e){return(e=e||{}).legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},e.fromExtendedJSON=function(t){if("$regex"in t){if("string"==typeof t.$regex)return new e(t.$regex,e.parseOptions(t.$options));if("BSONRegExp"===t.$regex._bsontype)return t}if("$regularExpression"in t)return new e(t.$regularExpression.pattern,e.parseOptions(t.$regularExpression.options));throw new qc("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(t)))},e}();Object.defineProperty(Lu.prototype,"_bsontype",{value:"BSONRegExp"});var Cu=function(){function e(t){if(!(this instanceof e))return new e(t);this.value=t}return e.prototype.valueOf=function(){return this.value},e.prototype.toString=function(){return this.value},e.prototype.inspect=function(){return'new BSONSymbol("'.concat(this.value,'")')},e.prototype.toJSON=function(){return this.value},e.prototype.toExtendedJSON=function(){return{$symbol:this.value}},e.fromExtendedJSON=function(t){return new e(t.$symbol)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e}();Object.defineProperty(Cu.prototype,"_bsontype",{value:"Symbol"});var ku=function(e){function t(n,r){var o=this;return o instanceof t?(o=fu.isLong(n)?e.call(this,n.low,n.high,!0)||this:Gc(n)&&void 0!==n.t&&void 0!==n.i?e.call(this,n.i,n.t,!0)||this:e.call(this,n,r,!0)||this,Object.defineProperty(o,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1}),o):new t(n,r)}return Uc(t,e),t.prototype.toJSON=function(){return{$timestamp:this.toString()}},t.fromInt=function(e){return new t(fu.fromInt(e,!0))},t.fromNumber=function(e){return new t(fu.fromNumber(e,!0))},t.fromBits=function(e,n){return new t(e,n)},t.fromString=function(e,n){return new t(fu.fromString(e,!0,n))},t.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},t.fromExtendedJSON=function(e){return new t(e.$timestamp)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Timestamp({ t: ".concat(this.getHighBits(),", i: ").concat(this.getLowBits()," })")},t.MAX_VALUE=fu.MAX_UNSIGNED_VALUE,t}(fu);var Du=2147483647,ju=-2147483648,Uu=0x8000000000000000,Mu=-0x8000000000000000,qu={$oid:xu,$binary:eu,$uuid:eu,$symbol:Cu,$numberInt:Ou,$numberDecimal:Su,$numberDouble:Iu,$numberLong:fu,$minKey:Nu,$maxKey:Au,$regex:Lu,$regularExpression:Lu,$timestamp:ku};function Wu(e,t){if(void 0===t&&(t={}),"number"==typeof e){if(t.relaxed||t.legacy)return e;if(Math.floor(e)===e){if(e>=ju&&e<=Du)return new Ou(e);if(e>=Mu&&e<=Uu)return fu.fromNumber(e)}return new Iu(e)}if(null==e||"object"!=typeof e)return e;if(e.$undefined)return null;for(var n=Object.keys(e).filter((function(t){return t.startsWith("$")&&null!=e[t]})),r=0;r<n.length;r++){var o=qu[n[r]];if(o)return o.fromExtendedJSON(e,t)}if(null!=e.$date){var i=e.$date,s=new Date;return t.legacy?"number"==typeof i?s.setTime(i):"string"==typeof i&&s.setTime(Date.parse(i)):"string"==typeof i?s.setTime(Date.parse(i)):fu.isLong(i)?s.setTime(i.toNumber()):"number"==typeof i&&t.relaxed&&s.setTime(i),s}if(null!=e.$code){var a=Object.assign({},e);return e.$scope&&(a.$scope=Wu(e.$scope)),nu.fromExtendedJSON(e)}if(function(e){return Gc(e)&&null!=e.$id&&"string"==typeof e.$ref&&(null==e.$db||"string"==typeof e.$db)}(e)||e.$dbPointer){var c=e.$ref?e:e.$dbPointer;if(c instanceof ru)return c;var u=Object.keys(c).filter((function(e){return e.startsWith("$")})),f=!0;if(u.forEach((function(e){-1===["$ref","$id","$db"].indexOf(e)&&(f=!1)})),f)return ru.fromExtendedJSON(c)}return e}function Fu(e){var t=e.toISOString();return 0!==e.getUTCMilliseconds()?t:t.slice(0,-5)+"Z"}function Bu(e,t){if(("object"==typeof e||"function"==typeof e)&&null!==e){var n=t.seenObjects.findIndex((function(t){return t.obj===e}));if(-1!==n){var r=t.seenObjects.map((function(e){return e.propertyName})),o=r.slice(0,n).map((function(e){return"".concat(e," -> ")})).join(""),i=r[n],s=" -> "+r.slice(n+1,r.length-1).map((function(e){return"".concat(e," -> ")})).join(""),a=r[r.length-1],c=" ".repeat(o.length+i.length/2),u="-".repeat(s.length+(i.length+a.length)/2-1);throw new qc("Converting circular structure to EJSON:\n"+" ".concat(o).concat(i).concat(s).concat(a,"\n")+" ".concat(c,"\\").concat(u,"/"))}t.seenObjects[t.seenObjects.length-1].obj=e}if(Array.isArray(e))return function(e,t){return e.map((function(e,n){t.seenObjects.push({propertyName:"index ".concat(n),obj:null});try{return Bu(e,t)}finally{t.seenObjects.pop()}}))}(e,t);if(void 0===e)return null;if(e instanceof Date||Gc(h=e)&&"[object Date]"===Object.prototype.toString.call(h)){var f=e.getTime(),l=f>-1&&f<2534023188e5;return t.legacy?t.relaxed&&l?{$date:e.getTime()}:{$date:Fu(e)}:t.relaxed&&l?{$date:Fu(e)}:{$date:{$numberLong:e.getTime().toString()}}}var h;if(!("number"!=typeof e||t.relaxed&&isFinite(e))){if(Math.floor(e)===e){var p=e>=Mu&&e<=Uu;if(e>=ju&&e<=Du)return{$numberInt:e.toString()};if(p)return{$numberLong:e.toString()}}return{$numberDouble:e.toString()}}if(e instanceof RegExp||function(e){return"[object RegExp]"===Object.prototype.toString.call(e)}(e)){var d=e.flags;if(void 0===d){var y=e.toString().match(/[gimuy]*$/);y&&(d=y[0])}return new Lu(e.source,d).toExtendedJSON(t)}return null!=e&&"object"==typeof e?function(e,t){if(null==e||"object"!=typeof e)throw new Mc("not an object instance");var n=e._bsontype;if(void 0===n){var r={};for(var o in e){t.seenObjects.push({propertyName:o,obj:null});try{var i=Bu(e[o],t);"__proto__"===o?Object.defineProperty(r,o,{value:i,writable:!0,enumerable:!0,configurable:!0}):r[o]=i}finally{t.seenObjects.pop()}}return r}if(function(e){return Gc(e)&&Reflect.has(e,"_bsontype")&&"string"==typeof e._bsontype}(e)){var s=e;if("function"!=typeof s.toExtendedJSON){var a=Hu[e._bsontype];if(!a)throw new qc("Unrecognized or invalid _bsontype: "+e._bsontype);s=a(s)}return"Code"===n&&s.scope?s=new nu(s.code,Bu(s.scope,t)):"DBRef"===n&&s.oid&&(s=new ru(Bu(s.collection,t),Bu(s.oid,t),Bu(s.db,t),Bu(s.fields,t))),s.toExtendedJSON(t)}throw new Mc("_bsontype must be a string, but was: "+typeof n)}(e,t):e}var $u,Hu={Binary:function(e){return new eu(e.value(),e.sub_type)},Code:function(e){return new nu(e.code,e.scope)},DBRef:function(e){return new ru(e.collection||e.namespace,e.oid,e.db,e.fields)},Decimal128:function(e){return new Su(e.bytes)},Double:function(e){return new Iu(e.value)},Int32:function(e){return new Ou(e.value)},Long:function(e){return fu.fromBits(null!=e.low?e.low:e.low_,null!=e.low?e.high:e.high_,null!=e.low?e.unsigned:e.unsigned_)},MaxKey:function(){return new Au},MinKey:function(){return new Nu},ObjectID:function(e){return new xu(e)},ObjectId:function(e){return new xu(e)},BSONRegExp:function(e){return new Lu(e.pattern,e.options)},Symbol:function(e){return new Cu(e.value)},Timestamp:function(e){return ku.fromBits(e.low,e.high)}};!function(e){function t(e,t){var n=Object.assign({},{relaxed:!0,legacy:!1},t);return"boolean"==typeof n.relaxed&&(n.strict=!n.relaxed),"boolean"==typeof n.strict&&(n.relaxed=!n.strict),JSON.parse(e,(function(e,t){if(-1!==e.indexOf("\0"))throw new Mc("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(e)));return Wu(t,n)}))}function n(e,t,n,r){null!=n&&"object"==typeof n&&(r=n,n=0),null==t||"object"!=typeof t||Array.isArray(t)||(r=t,t=void 0,n=0);var o=Bu(e,Object.assign({relaxed:!0,legacy:!1},r,{seenObjects:[{propertyName:"(root)",obj:null}]}));return JSON.stringify(o,t,n)}e.parse=t,e.stringify=n,e.serialize=function(e,t){return t=t||{},JSON.parse(n(e,t))},e.deserialize=function(e,n){return n=n||{},t(JSON.stringify(e),n)}}($u||($u={}));var Gu=Fc();Gu.Map?Gu.Map:function(){function e(e){void 0===e&&(e=[]),this._keys=[],this._values={};for(var t=0;t<e.length;t++)if(null!=e[t]){var n=e[t],r=n[0],o=n[1];this._keys.push(r),this._values[r]={v:o,i:this._keys.length-1}}}e.prototype.clear=function(){this._keys=[],this._values={}},e.prototype.delete=function(e){var t=this._values[e];return null!=t&&(delete this._values[e],this._keys.splice(t.i,1),!0)},e.prototype.entries=function(){var e=this,t=0;return{next:function(){var n=e._keys[t++];return{value:void 0!==n?[n,e._values[n].v]:void 0,done:void 0===n}}}},e.prototype.forEach=function(e,t){t=t||this;for(var n=0;n<this._keys.length;n++){var r=this._keys[n];e.call(t,this._values[r].v,r,t)}},e.prototype.get=function(e){return this._values[e]?this._values[e].v:void 0},e.prototype.has=function(e){return null!=this._values[e]},e.prototype.keys=function(){var e=this,t=0;return{next:function(){var n=e._keys[t++];return{value:void 0!==n?n:void 0,done:void 0===n}}}},e.prototype.set=function(e,t){return this._values[e]?(this._values[e].v=t,this):(this._keys.push(e),this._values[e]={v:t,i:this._keys.length-1},this)},e.prototype.values=function(){var e=this,t=0;return{next:function(){var n=e._keys[t++];return{value:void 0!==n?e._values[n].v:void 0,done:void 0===n}}}},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!1,configurable:!0})}(),fu.fromNumber(zc),fu.fromNumber(Qc);var Ku=new Uint8Array(8);new DataView(Ku.buffer,Ku.byteOffset,Ku.byteLength);e.alloc(17825792);var Vu=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Ju=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Yu=function(){function e(e,t){this._stages=[],e&&t&&(this._db=e,this._request=new bf.reqClass(this._db.config),this._collectionName=t)}return e.prototype.end=function(){return Vu(this,void 0,void 0,(function(){var e;return Ju(this,(function(t){switch(t.label){case 0:if(!this._collectionName||!this._db)throw new Error("Aggregation pipeline cannot send request");return[4,this._request.send("database.aggregate",{collectionName:this._collectionName,stages:this._stages})];case 1:return(e=t.sent())&&e.data&&e.data.list?[2,{requestId:e.requestId,data:JSON.parse(e.data.list).map($u.parse)}]:[2,e]}}))}))},e.prototype.unwrap=function(){return this._stages},e.prototype.done=function(){return this._stages.map((function(e){var t,n=e.stageKey,r=e.stageValue;return(t={})[n]=JSON.parse(r),t}))},e.prototype._pipe=function(e,t){return this._stages.push({stageKey:"$"+e,stageValue:JSON.stringify(t)}),this},e.prototype.addFields=function(e){return this._pipe("addFields",e)},e.prototype.bucket=function(e){return this._pipe("bucket",e)},e.prototype.bucketAuto=function(e){return this._pipe("bucketAuto",e)},e.prototype.count=function(e){return this._pipe("count",e)},e.prototype.geoNear=function(e){return this._pipe("geoNear",e)},e.prototype.group=function(e){return this._pipe("group",e)},e.prototype.limit=function(e){return this._pipe("limit",e)},e.prototype.match=function(e){return this._pipe("match",Lc.encode(e))},e.prototype.project=function(e){return this._pipe("project",e)},e.prototype.lookup=function(e){return this._pipe("lookup",e)},e.prototype.replaceRoot=function(e){return this._pipe("replaceRoot",e)},e.prototype.sample=function(e){return this._pipe("sample",e)},e.prototype.skip=function(e){return this._pipe("skip",e)},e.prototype.sort=function(e){return this._pipe("sort",e)},e.prototype.sortByCount=function(e){return this._pipe("sortByCount",e)},e.prototype.unwind=function(e){return this._pipe("unwind",e)},e}(),Zu=Yu,Xu=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zu=function(e){function t(t,n){return e.call(this,t,n)||this}return Xu(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return this._coll},enumerable:!0,configurable:!0}),t.prototype.doc=function(e){if("string"!=typeof e&&"number"!=typeof e)throw new Error("docId必须为字符串或数字");return new xc(this._db,this._coll,e)},t.prototype.add=function(e,t){return new xc(this._db,this._coll,void 0).create(e,t)},t.prototype.aggregate=function(){return new Zu(this._db,this._coll)},t}(Dc),Qu={eq:function(e){return new cc(sc.EQ,[e])},neq:function(e){return new cc(sc.NEQ,[e])},lt:function(e){return new cc(sc.LT,[e])},lte:function(e){return new cc(sc.LTE,[e])},gt:function(e){return new cc(sc.GT,[e])},gte:function(e){return new cc(sc.GTE,[e])},in:function(e){return new cc(sc.IN,e)},nin:function(e){return new cc(sc.NIN,e)},all:function(e){return new cc(sc.ALL,e)},elemMatch:function(e){return new cc(sc.ELEM_MATCH,[e])},exists:function(e){return new cc(sc.EXISTS,[e])},size:function(e){return new cc(sc.SIZE,[e])},mod:function(e){return new cc(sc.MOD,[e])},geoNear:function(e){return new cc(sc.GEO_NEAR,[e])},geoWithin:function(e){return new cc(sc.GEO_WITHIN,[e])},geoIntersects:function(e){return new cc(sc.GEO_INTERSECTS,[e])},and:function(){var e=Ma(arguments[0])?arguments[0]:Array.from(arguments);return new oc(tc.AND,e)},nor:function(){var e=Ma(arguments[0])?arguments[0]:Array.from(arguments);return new oc(tc.NOR,e)},or:function(){var e=Ma(arguments[0])?arguments[0]:Array.from(arguments);return new oc(tc.OR,e)},not:function(){var e=Ma(arguments[0])?arguments[0]:Array.from(arguments);return new oc(tc.NOT,e)},set:function(e){return new nc(xa.SET,[e])},remove:function(){return new nc(xa.REMOVE,[])},inc:function(e){return new nc(xa.INC,[e])},mul:function(e){return new nc(xa.MUL,[e])},push:function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(ja(t[0])&&t[0].hasOwnProperty("each")){var r=t[0];e={$each:r.each,$position:r.position,$sort:r.sort,$slice:r.slice}}else e=Ma(t[0])?t[0]:Array.from(t);return new nc(xa.PUSH,e)},pull:function(e){return new nc(xa.PULL,e)},pullAll:function(e){return new nc(xa.PULL_ALL,e)},pop:function(){return new nc(xa.POP,[])},shift:function(){return new nc(xa.SHIFT,[])},unshift:function(){var e=Ma(arguments[0])?arguments[0]:Array.from(arguments);return new nc(xa.UNSHIFT,e)},addToSet:function(e){return new nc(xa.ADD_TO_SET,e)},rename:function(e){return new nc(xa.RENAME,[e])},bit:function(e){return new nc(xa.BIT,[e])},max:function(e){return new nc(xa.MAX,[e])},min:function(e){return new nc(xa.MIN,[e])},expr:function(e){return{$expr:e}},jsonSchema:function(e){return{$jsonSchema:e}},text:function(e){return"string"===Da(e)?{$search:e.search}:{$search:e.search,$language:e.language,$caseSensitive:e.caseSensitive,$diacriticSensitive:e.diacriticSensitive}},aggregate:{pipeline:function(){return new Zu},abs:function(e){return new ef("abs",e)},add:function(e){return new ef("add",e)},ceil:function(e){return new ef("ceil",e)},divide:function(e){return new ef("divide",e)},exp:function(e){return new ef("exp",e)},floor:function(e){return new ef("floor",e)},ln:function(e){return new ef("ln",e)},log:function(e){return new ef("log",e)},log10:function(e){return new ef("log10",e)},mod:function(e){return new ef("mod",e)},multiply:function(e){return new ef("multiply",e)},pow:function(e){return new ef("pow",e)},sqrt:function(e){return new ef("sqrt",e)},subtract:function(e){return new ef("subtract",e)},trunc:function(e){return new ef("trunc",e)},arrayElemAt:function(e){return new ef("arrayElemAt",e)},arrayToObject:function(e){return new ef("arrayToObject",e)},concatArrays:function(e){return new ef("concatArrays",e)},filter:function(e){return new ef("filter",e)},in:function(e){return new ef("in",e)},indexOfArray:function(e){return new ef("indexOfArray",e)},isArray:function(e){return new ef("isArray",e)},map:function(e){return new ef("map",e)},range:function(e){return new ef("range",e)},reduce:function(e){return new ef("reduce",e)},reverseArray:function(e){return new ef("reverseArray",e)},size:function(e){return new ef("size",e)},slice:function(e){return new ef("slice",e)},zip:function(e){return new ef("zip",e)},and:function(e){return new ef("and",e)},not:function(e){return new ef("not",e)},or:function(e){return new ef("or",e)},cmp:function(e){return new ef("cmp",e)},eq:function(e){return new ef("eq",e)},gt:function(e){return new ef("gt",e)},gte:function(e){return new ef("gte",e)},lt:function(e){return new ef("lt",e)},lte:function(e){return new ef("lte",e)},neq:function(e){return new ef("ne",e)},cond:function(e){return new ef("cond",e)},ifNull:function(e){return new ef("ifNull",e)},switch:function(e){return new ef("switch",e)},dateFromParts:function(e){return new ef("dateFromParts",e)},dateFromString:function(e){return new ef("dateFromString",e)},dayOfMonth:function(e){return new ef("dayOfMonth",e)},dayOfWeek:function(e){return new ef("dayOfWeek",e)},dayOfYear:function(e){return new ef("dayOfYear",e)},isoDayOfWeek:function(e){return new ef("isoDayOfWeek",e)},isoWeek:function(e){return new ef("isoWeek",e)},isoWeekYear:function(e){return new ef("isoWeekYear",e)},millisecond:function(e){return new ef("millisecond",e)},minute:function(e){return new ef("minute",e)},month:function(e){return new ef("month",e)},second:function(e){return new ef("second",e)},hour:function(e){return new ef("hour",e)},week:function(e){return new ef("week",e)},year:function(e){return new ef("year",e)},literal:function(e){return new ef("literal",e)},mergeObjects:function(e){return new ef("mergeObjects",e)},objectToArray:function(e){return new ef("objectToArray",e)},allElementsTrue:function(e){return new ef("allElementsTrue",e)},anyElementTrue:function(e){return new ef("anyElementTrue",e)},setDifference:function(e){return new ef("setDifference",e)},setEquals:function(e){return new ef("setEquals",e)},setIntersection:function(e){return new ef("setIntersection",e)},setIsSubset:function(e){return new ef("setIsSubset",e)},setUnion:function(e){return new ef("setUnion",e)},concat:function(e){return new ef("concat",e)},dateToString:function(e){return new ef("dateToString",e)},indexOfBytes:function(e){return new ef("indexOfBytes",e)},indexOfCP:function(e){return new ef("indexOfCP",e)},split:function(e){return new ef("split",e)},strLenBytes:function(e){return new ef("strLenBytes",e)},strLenCP:function(e){return new ef("strLenCP",e)},strcasecmp:function(e){return new ef("strcasecmp",e)},substr:function(e){return new ef("substr",e)},substrBytes:function(e){return new ef("substrBytes",e)},substrCP:function(e){return new ef("substrCP",e)},toLower:function(e){return new ef("toLower",e)},toUpper:function(e){return new ef("toUpper",e)},meta:function(e){return new ef("meta",e)},addToSet:function(e){return new ef("addToSet",e)},avg:function(e){return new ef("avg",e)},first:function(e){return new ef("first",e)},last:function(e){return new ef("last",e)},max:function(e){return new ef("max",e)},min:function(e){return new ef("min",e)},push:function(e){return new ef("push",e)},stdDevPop:function(e){return new ef("stdDevPop",e)},stdDevSamp:function(e){return new ef("stdDevSamp",e)},sum:function(e){return new ef("sum",e)},let:function(e){return new ef("let",e)}},project:{slice:function(e){return new tf("slice",e)},elemMatch:function(e){return new tf("elemMatch",e)}}},ef=function(e,t){this["$"+e]=t},tf=function(e,t){this["$"+e]=t},nf=function(){function e(e){var t=e.regexp,n=e.options;if(!t)throw new TypeError("regexp must be a string");this.$regex=t,this.$options=n}return e.prototype.parse=function(){return{$regex:this.$regex,$options:this.$options}},Object.defineProperty(e.prototype,"_internalType",{get:function(){return Ta},enumerable:!0,configurable:!0}),e}();function rf(e){return new nf(e)}var of={code:"INSERT_DOC_FAIL",message:"insert document failed"},sf={code:"DATABASE_TRANSACTION_CONFLICT",message:"database transaction conflict"},af=function(){return af=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},af.apply(this,arguments)},cf=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},uf=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},ff="database.updateDocInTransaction",lf=function(){function e(e,t,n){this._coll=t,this.id=n,this._transaction=e,this._request=this._transaction.getRequestMethod(),this._transactionId=this._transaction.getTransactionId()}return e.prototype.create=function(e){return cf(this,void 0,void 0,(function(){var t,n,r,o;return uf(this,(function(i){switch(i.label){case 0:return t={collectionName:this._coll,transactionId:this._transactionId,data:$u.stringify(vc(e),{relaxed:!1})},this.id&&(t._id=this.id),[4,this._request.send("database.insertDocInTransaction",t)];case 1:if((n=i.sent()).code)throw n;if(r=$u.parse(n.inserted),1==(o=$u.parse(n.ok))&&1==r)return[2,af(af({},n),{ok:o,inserted:r})];throw new Error(of.message)}}))}))},e.prototype.get=function(){return cf(this,void 0,void 0,(function(){var e,t;return uf(this,(function(n){switch(n.label){case 0:return e={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}}},[4,this._request.send("database.getInTransaction",e)];case 1:if((t=n.sent()).code)throw t;return[2,{data:"null"!==t.data?Ca.formatField($u.parse(t.data)):$u.parse(t.data),requestId:t.requestId}]}}))}))},e.prototype.set=function(e){return cf(this,void 0,void 0,(function(){var t,n;return uf(this,(function(r){switch(r.label){case 0:return t={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}},data:$u.stringify(vc(e),{relaxed:!1}),upsert:!0},[4,this._request.send(ff,t)];case 1:if((n=r.sent()).code)throw n;return[2,af(af({},n),{updated:$u.parse(n.updated),upserted:n.upserted?JSON.parse(n.upserted):null})]}}))}))},e.prototype.update=function(e){return cf(this,void 0,void 0,(function(){var t,n;return uf(this,(function(r){switch(r.label){case 0:return t={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}},data:$u.stringify(Nc.encode(e),{relaxed:!1})},[4,this._request.send(ff,t)];case 1:if((n=r.sent()).code)throw n;return[2,af(af({},n),{updated:$u.parse(n.updated)})]}}))}))},e.prototype.delete=function(){return cf(this,void 0,void 0,(function(){var e,t;return uf(this,(function(n){switch(n.label){case 0:return e={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}}},[4,this._request.send("database.deleteDocInTransaction",e)];case 1:if((t=n.sent()).code)throw t;return[2,af(af({},t),{deleted:$u.parse(t.deleted)})]}}))}))},e}(),hf=function(e,t){this._coll=t,this._transaction=e},pf=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),df=function(e){function t(t,n){return e.call(this,t,n)||this}return pf(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return this._coll},enumerable:!0,configurable:!0}),t.prototype.doc=function(e){if("string"!=typeof e&&"number"!=typeof e)throw new Error("docId必须为字符串或数字");return new lf(this._transaction,this._coll,e)},t.prototype.add=function(e){var t;return void 0!==e._id&&(t=e._id),new lf(this._transaction,this._coll,t).create(e)},t}(hf),yf=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},gf=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},vf=function(){function e(e){this._db=e,this._request=new bf.reqClass(this._db.config),this.aborted=!1,this.commited=!1,this.inited=!1}return e.prototype.init=function(){return yf(this,void 0,void 0,(function(){var e;return gf(this,(function(t){switch(t.label){case 0:return[4,this._request.send("database.startTransaction")];case 1:if((e=t.sent()).code)throw e;return this.inited=!0,this._id=e.transactionId,[2]}}))}))},e.prototype.collection=function(e){if(!e)throw new Error("Collection name is required");return new df(this,e)},e.prototype.getTransactionId=function(){return this._id},e.prototype.getRequestMethod=function(){return this._request},e.prototype.commit=function(){return yf(this,void 0,void 0,(function(){var e,t;return gf(this,(function(n){switch(n.label){case 0:return e={transactionId:this._id},[4,this._request.send("database.commitTransaction",e)];case 1:if((t=n.sent()).code)throw t;return this.commited=!0,[2,t]}}))}))},e.prototype.rollback=function(e){return yf(this,void 0,void 0,(function(){var t,n;return gf(this,(function(r){switch(r.label){case 0:return t={transactionId:this._id},[4,this._request.send("database.abortTransaction",t)];case 1:if((n=r.sent()).code)throw n;return this.aborted=!0,this.abortReason=e,[2,n]}}))}))},e}();function mf(){return yf(this,void 0,void 0,(function(){var e;return gf(this,(function(t){switch(t.label){case 0:return[4,(e=new vf(this)).init()];case 1:return t.sent(),[2,e]}}))}))}function _f(e,t){return void 0===t&&(t=3),yf(this,void 0,void 0,(function(){var n,r,o,i,s=this;return gf(this,(function(a){switch(a.label){case 0:return a.trys.push([0,4,,10]),[4,(n=new vf(this)).init()];case 1:return a.sent(),[4,e(n)];case 2:if(r=a.sent(),!0===n.aborted)throw n.abortReason;return[4,n.commit()];case 3:return a.sent(),[2,r];case 4:if(o=a.sent(),!1===n.inited)throw o;return i=function(e){return yf(s,void 0,void 0,(function(){return gf(this,(function(t){switch(t.label){case 0:if(n.aborted||n.commited)return[3,5];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,n.rollback()];case 2:case 3:return t.sent(),[3,4];case 4:throw e;case 5:if(!0===n.aborted)throw n.abortReason;throw e}}))}))},t<=0?[4,i(o)]:[3,6];case 5:a.sent(),a.label=6;case 6:return o&&o.code===sf.code?[4,_f.bind(this)(e,--t)]:[3,8];case 7:return[2,a.sent()];case 8:return[4,i(o)];case 9:return a.sent(),[3,10];case 10:return[2]}}))}))}var bf=function(){function e(e){this.config=e,this.Geo=Qa,this.serverDate=Pa,this.command=Qu,this.RegExp=rf,this.startTransaction=mf,this.runTransaction=_f,this.logicCommand=oc,this.updateCommand=nc,this.queryCommand=cc}return e.prototype.collection=function(e){if(!e)throw new Error("Collection name is required");return new zu(this,e)},e.prototype.createCollection=function(t){var n={collectionName:t};return new e.reqClass(this.config).send("database.addCollection",n)},e}(),wf=function(){return wf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},wf.apply(this,arguments)};var Ef={name:"database",entity:{database:function(e){var t=this.platform,n=t.adapter,r=t.runtime;return bf.reqClass=this.request.constructor,bf.getAccessToken=this.authInstance?this.authInstance.getAccessToken.bind(this.authInstance):function(){return""},bf.runtime=r,this.wsClientClass&&(bf.wsClass=n.wsClass,bf.wsClientClass=this.wsClientClass),bf.ws||(bf.ws=null),new bf(wf(wf({},this.config),e))}}};try{cloudbase.registerComponent(Ef)}catch(e){}var Sf,If="1.7.2";Jt.registerVersion(If);try{!function(e){try{e.registerComponent(Mr)}catch(e){console.warn(e)}}(Jt),function(e){try{e.registerComponent(Xr)}catch(e){console.warn(e)}}(Jt),function(e){try{e.registerComponent(po)}catch(e){console.warn(e)}}(Jt),function(e){try{e.registerComponent(Ef)}catch(e){console.warn(e)}}(Jt),function(e){try{e.registerComponent(js),e.registerHook(Ds)}catch(e){console.warn(e)}}(Jt),function(e){try{e.registerComponent(Ys)}catch(e){console.warn(e)}}(Jt)}catch(e){}try{window.cloudbase=Jt}catch(e){}!function(e){e.development="dev-1gpp53ju3ceb46c7",e.production="release-7gvojkxi667a3f26"}(Sf||(Sf={}));var Of={ENV:Sf[process.env.NODE_ENV],REGION:"ap-shanghai"},Af={region:Of.REGION,env:Of.ENV},Nf=Jt.init(Af);function Tf(e){return t(this,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Nf.callFunction(e)];case 1:return t=n.sent(),[2,new Promise((function(e,n){var r;(null===(r=t.result)||void 0===r?void 0:r.success)?e(t.result.data):n(t.result)}))]}}))}))}export{Tf as callFunction};
|
|
1
|
+
import{Buffer as e}from"buffer";import t,{TextEncoder as n}from"util";import i,{Readable as o}from"stream";import r from"path";import a from"http";import s from"https";import c from"url";import u from"fs";import p from"assert";import l from"tty";import d from"os";import f from"zlib";import h from"events";function m(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))}function v(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],i=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}"function"==typeof SuppressedError&&SuppressedError;var g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function y(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function b(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){if(this instanceof e){var n=[null];return n.push.apply(n,arguments),new(Function.bind.apply(t,n))}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})})),n}var x={},w={},_={};Object.defineProperty(_,"__esModule",{value:!0}),_.COMMUNITY_SITE_URL=_.IS_DEBUG_MODE=_.getProtocol=_.setProtocol=_.getSdkName=_.setSdkName=void 0;var E="@cloudbase/js-sdk";_.setSdkName=function(e){E=e},_.getSdkName=function(){return E};var S="undefined"!=typeof location&&"http:"===location.protocol?"http:":"https:";_.setProtocol=function(e){S=e},_.getProtocol=function(){return S},_.IS_DEBUG_MODE="development"===process.env.NODE_ENV,_.COMMUNITY_SITE_URL="https://support.qq.com/products/148793";var O={};Object.defineProperty(O,"__esModule",{value:!0}),O.ERRORS=void 0,O.ERRORS={INVALID_PARAMS:"INVALID_PARAMS",INVALID_SYNTAX:"INVALID_SYNTAX",INVALID_OPERATION:"INVALID_OPERATION",OPERATION_FAIL:"OPERATION_FAIL",NETWORK_ERROR:"NETWORK_ERROR",UNKOWN_ERROR:"UNKOWN_ERROR"},function(e){var t=g&&g.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=g&&g.__exportStar||function(e,n){for(var i in e)"default"===i||n.hasOwnProperty(i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(_,e),n(O,e)}(w);var I,A={},T={};!function(e){e.local="local",e.none="none",e.session="session"}(I||(I={}));var N=function(){},R=function(){};function k(e,t,n){void 0===n&&(n={});var i=/\?/.test(t),o="";for(var r in n)""===o?!i&&(t+="?"):o+="&",o+=r+"="+encodeURIComponent(n[r]);return/^http(s)?\:\/\//.test(t+=o)?t:""+e+t}var j,C=b(Object.freeze({__proto__:null,AbstractSDKRequest:N,AbstractStorage:R,get StorageType(){return I},formatUrl:k})),P={},L={exports:{}},U={exports:{}};function D(){return j||(j=1,U.exports=(e=e||function(e,t){var n=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),i={},o=i.lib={},r=o.Base={extend:function(e){var t=n(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},a=o.WordArray=r.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,n=e.words,i=this.sigBytes,o=e.sigBytes;if(this.clamp(),i%4)for(var r=0;r<o;r++){var a=n[r>>>2]>>>24-r%4*8&255;t[i+r>>>2]|=a<<24-(i+r)%4*8}else for(r=0;r<o;r+=4)t[i+r>>>2]=n[r>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=r.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n,i=[],o=function(t){var n=987654321,i=4294967295;return function(){var o=((n=36969*(65535&n)+(n>>16)&i)<<16)+(t=18e3*(65535&t)+(t>>16)&i)&i;return o/=4294967296,(o+=.5)*(e.random()>.5?1:-1)}},r=0;r<t;r+=4){var s=o(4294967296*(n||e.random()));n=987654071*s(),i.push(4294967296*s()|0)}return new a.init(i,t)}}),s=i.enc={},c=s.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],o=0;o<n;o++){var r=t[o>>>2]>>>24-o%4*8&255;i.push((r>>>4).toString(16)),i.push((15&r).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i+=2)n[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new a.init(n,t/2)}},u=s.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],o=0;o<n;o++){var r=t[o>>>2]>>>24-o%4*8&255;i.push(String.fromCharCode(r))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i++)n[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new a.init(n,t)}},p=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},l=o.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,i=n.words,o=n.sigBytes,r=this.blockSize,s=o/(4*r),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*r,u=e.min(4*c,o);if(c){for(var p=0;p<c;p+=r)this._doProcessBlock(i,p);var l=i.splice(0,c);n.sigBytes-=u}return new a.init(l,u)},clone:function(){var e=r.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});o.Hasher=l.extend({cfg:r.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new d.HMAC.init(e,n).finalize(t)}}});var d=i.algo={};return i}(Math),e)),U.exports;var e}var q,M={exports:{}};function F(){return q?M.exports:(q=1,M.exports=(e=D(),function(t){var n=e,i=n.lib,o=i.WordArray,r=i.Hasher,a=n.algo,s=[],c=[];!function(){function e(e){for(var n=t.sqrt(e),i=2;i<=n;i++)if(!(e%i))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var i=2,o=0;o<64;)e(i)&&(o<8&&(s[o]=n(t.pow(i,.5))),c[o]=n(t.pow(i,1/3)),o++),i++}();var u=[],p=a.SHA256=r.extend({_doReset:function(){this._hash=new o.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,i=n[0],o=n[1],r=n[2],a=n[3],s=n[4],p=n[5],l=n[6],d=n[7],f=0;f<64;f++){if(f<16)u[f]=0|e[t+f];else{var h=u[f-15],m=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,v=u[f-2],g=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[f]=m+u[f-7]+g+u[f-16]}var y=i&o^i&r^o&r,b=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),x=d+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&p^~s&l)+c[f]+u[f];d=l,l=p,p=s,s=a+x|0,a=r,r=o,o=i,i=x+(b+y)|0}n[0]=n[0]+i|0,n[1]=n[1]+o|0,n[2]=n[2]+r|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+p|0,n[6]=n[6]+l|0,n[7]=n[7]+d|0},_doFinalize:function(){var e=this._data,n=e.words,i=8*this._nDataBytes,o=8*e.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=t.floor(i/4294967296),n[15+(o+64>>>9<<4)]=i,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=r._createHelper(p),n.HmacSHA256=r._createHmacHelper(p)}(Math),e.SHA256));var e}var B,W,z,H,$,G={exports:{}};L.exports=function(e){return e.HmacSHA256}(D(),F(),B||(B=1,G.exports=(W=D(),H=(z=W).lib.Base,$=z.enc.Utf8,void(z.algo.HMAC=H.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=$.parse(t));var n=e.blockSize,i=4*n;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),r=this._iKey=t.clone(),a=o.words,s=r.words,c=0;c<n;c++)a[c]^=1549556828,s[c]^=909522486;o.sigBytes=r.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})))));var K=L.exports,V={exports:{}};V.exports=function(e){return function(){var t=e,n=t.lib.WordArray;function i(e,t,i){for(var o=[],r=0,a=0;a<t;a++)if(a%4){var s=i[e.charCodeAt(a-1)]<<a%4*2,c=i[e.charCodeAt(a)]>>>6-a%4*2;o[r>>>2]|=(s|c)<<24-r%4*8,r++}return n.create(o,r)}t.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,i=this._map;e.clamp();for(var o=[],r=0;r<n;r+=3)for(var a=(t[r>>>2]>>>24-r%4*8&255)<<16|(t[r+1>>>2]>>>24-(r+1)%4*8&255)<<8|t[r+2>>>2]>>>24-(r+2)%4*8&255,s=0;s<4&&r+.75*s<n;s++)o.push(i.charAt(a>>>6*(3-s)&63));var c=i.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e){var t=e.length,n=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var r=0;r<n.length;r++)o[n.charCodeAt(r)]=r}var a=n.charAt(64);if(a){var s=e.indexOf(a);-1!==s&&(t=s)}return i(e,t,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64}(D());var J=V.exports,Y={exports:{}};Y.exports=function(e){return e.enc.Utf8}(D());var X=Y.exports,Z=g&&g.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(P,"__esModule",{value:!0}),P.transformPhone=P.sleep=P.printGroupLog=P.throwError=P.printInfo=P.printError=P.printWarn=P.execCallback=P.createPromiseCallback=P.removeParam=P.getHash=P.getQuery=P.toQueryString=P.createSign=P.formatUrl=P.genSeqId=P.isFormData=P.isInstanceOf=P.isNull=P.isPalinObject=P.isUndefined=P.isString=P.isArray=void 0;var Q=Z(K),ee=Z(J),te=Z(X),ne=w;function ie(e){var t=ee.default.stringify(e);return t=(t=(t=t.replace(/=+$/,"")).replace(/\+/g,"-")).replace(/\//g,"_")}P.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},P.isString=function(e){return"string"==typeof e},P.isUndefined=function(e){return void 0===e},P.isPalinObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},P.isNull=function(e){return"[object Null]"===Object.prototype.toString.call(e)},P.isInstanceOf=function(e,t){return e instanceof t},P.isFormData=function(e){return"[object FormData]"===Object.prototype.toString.call(e)},P.genSeqId=function(){return Math.random().toString(16).slice(2)},P.formatUrl=function(e,t,n){void 0===n&&(n={});var i=/\?/.test(t),o="";for(var r in n)""===o?!i&&(t+="?"):o+="&",o+=r+"="+encodeURIComponent(n[r]);return/^http(s)?\:\/\//.test(t+=o)?t:""+e+t},P.createSign=function(e,t){var n=ie(te.default.parse(JSON.stringify({alg:"HS256",typ:"JWT"})))+"."+ie(te.default.parse(JSON.stringify(e)));return n+"."+ie(Q.default(n,t))},P.toQueryString=function(e){void 0===e&&(e={});var t=[];for(var n in e)t.push(n+"="+encodeURIComponent(e[n]));return t.join("&")},P.getQuery=function(e,t){if("undefined"==typeof window)return!1;var n=t||window.location.search,i=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),o=n.substr(n.indexOf("?")+1).match(i);return null!=o?o[2]:""},P.getHash=function(e){if("undefined"==typeof window)return"";var t=window.location.hash.match(new RegExp("[#?&/]"+e+"=([^&#]*)"));return t?t[1]:""},P.removeParam=function(e,t){var n=t.split("?")[0],i=[],o=-1!==t.indexOf("?")?t.split("?")[1]:"";if(""!==o){for(var r=(i=o.split("&")).length-1;r>=0;r-=1)i[r].split("=")[0]===e&&i.splice(r,1);n=n+"?"+i.join("&")}return n},P.createPromiseCallback=function(){var e;if(!Promise){(e=function(){}).promise={};var t=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}var n=new Promise((function(t,n){e=function(e,i){return e?n(e):t(i)}}));return e.promise=n,e},P.execCallback=function(e,t,n){if(void 0===n&&(n=null),e&&"function"==typeof e)return e(t,n);if(t)throw t;return n},P.printWarn=function(e,t){console.warn("["+ne.getSdkName()+"]["+e+"]:"+t)},P.printError=function(e,t){console.error({code:e,msg:"["+ne.getSdkName()+"]["+e+"]:"+t})},P.printInfo=function(e,t){console.log("["+ne.getSdkName()+"]["+e+"]:"+t)},P.throwError=function(e,t){throw new Error(JSON.stringify({code:e,msg:"["+ne.getSdkName()+"]["+e+"]:"+t}))},P.printGroupLog=function(e){var t=e.title,n=e.subtitle,i=void 0===n?"":n,o=e.content,r=void 0===o?[]:o,a=e.printTrace,s=void 0!==a&&a,c=e.collapsed;void 0!==c&&c?console.groupCollapsed(t,i):console.group(t,i);for(var u=0,p=r;u<p.length;u++){var l=p[u],d=l.type,f=l.body;switch(d){case"info":console.log(f);break;case"warn":console.warn(f);break;case"error":console.error(f)}}s&&console.trace("stack trace:"),console.groupEnd()},P.sleep=function(e){return void 0===e&&(e=0),new Promise((function(t){return setTimeout(t,e)}))},P.transformPhone=function(e){return"+86"+e};var oe,re=g&&g.__extends||(oe=function(e,t){return oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},oe(e,t)},function(e,t){function n(){this.constructor=e}oe(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ae=g&&g.__assign||function(){return ae=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ae.apply(this,arguments)},se=g&&g.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},ce=g&&g.__generator||function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}};Object.defineProperty(T,"__esModule",{value:!0}),T.WebRequest=T.genAdapter=void 0;var ue=P,pe=_,le=function(e){function t(t){var n=e.call(this)||this,i=t.timeout,o=t.timeoutMsg,r=t.restrictedMethods;return n._timeout=i||0,n._timeoutMsg=o||"请求超时",n._restrictedMethods=r||["get","post","upload","download"],n}return re(t,e),t.prototype.get=function(e){return this._request(ae(ae({},e),{method:"get"}),this._restrictedMethods.includes("get"))},t.prototype.post=function(e){return this._request(ae(ae({},e),{method:"post"}),this._restrictedMethods.includes("post"))},t.prototype.put=function(e){return this._request(ae(ae({},e),{method:"put"}))},t.prototype.upload=function(e){var t=e.data,n=e.file,i=e.name,o=new FormData;for(var r in t)o.append(r,t[r]);return o.append("key",i),o.append("file",n),this._request(ae(ae({},e),{data:o,method:"post"}),this._restrictedMethods.includes("upload"))},t.prototype.download=function(e){return se(this,void 0,void 0,(function(){var t,n,i,o;return ce(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.get(ae(ae({},e),{headers:{},responseType:"blob"}))];case 1:return t=r.sent().data,n=window.URL.createObjectURL(new Blob([t])),i=decodeURIComponent(new URL(e.url).pathname.split("/").pop()||""),(o=document.createElement("a")).href=n,o.setAttribute("download",i),o.style.display="none",document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(n),document.body.removeChild(o),[3,3];case 2:return r.sent(),[3,3];case 3:return[2,new Promise((function(t){t({statusCode:200,tempFilePath:e.url})}))]}}))}))},t.prototype._request=function(e,t){var n=this;void 0===t&&(t=!1);var i=String(e.method).toLowerCase()||"get";return new Promise((function(o){var r,a,s=e.url,c=e.headers,u=void 0===c?{}:c,p=e.data,l=e.responseType,d=e.withCredentials,f=e.body,h=e.onUploadProgress,m=ue.formatUrl(pe.getProtocol(),s,"get"===i?p:{}),v=new XMLHttpRequest;for(var g in v.open(i,m),l&&(v.responseType=l),u)v.setRequestHeader(g,u[g]);h&&v.upload.addEventListener("progress",h),v.onreadystatechange=function(){var e={};if(4===v.readyState){var t=v.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};t.forEach((function(e){var t=e.split(": "),i=t.shift().toLowerCase(),o=t.join(": ");n[i]=o})),e.header=n,e.statusCode=v.status;try{e.data="blob"===l?v.response:JSON.parse(v.responseText)}catch(t){e.data="blob"===l?v.response:v.responseText}clearTimeout(r),o(e)}},t&&n._timeout&&(r=setTimeout((function(){console.warn(n._timeoutMsg),v.abort()}),n._timeout)),a=ue.isFormData(p)?p:"application/x-www-form-urlencoded"===u["content-type"]?ue.toQueryString(p):f||(p?JSON.stringify(p):void 0),d&&(v.withCredentials=!0),v.send(a)}))},t}(C.AbstractSDKRequest);T.WebRequest=le,T.genAdapter=function(){return{root:window,reqClass:le,wsClass:WebSocket,localStorage:localStorage,sessionStorage:sessionStorage}},function(e){var t=g&&g.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=g&&g.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=g&&g.__importStar||function(e){if(e&&e.__esModule)return e;var i={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&t(i,e,o);return n(i,e),i};Object.defineProperty(e,"__esModule",{value:!0}),e.useDefaultAdapter=e.useAdapters=e.RUNTIME=void 0;var o,r=i(T),a=P;!function(e){e.WEB="web",e.WX_MP="wx_mp"}(o=e.RUNTIME||(e.RUNTIME={})),e.useAdapters=function(e){for(var t=0,n=a.isArray(e)?e:[e];t<n.length;t++){var i=n[t],o=i.isMatch,r=i.genAdapter,s=i.runtime;if(o())return{adapter:r(),runtime:s}}},e.useDefaultAdapter=function(){return{adapter:r.genAdapter(),runtime:o.WEB}}}(A);var de={},fe=g&&g.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),he=g&&g.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},me=g&&g.__generator||function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}};Object.defineProperty(de,"__esModule",{value:!0}),de.CloudbaseCache=void 0;var ve=P,ge=w,ye=function(e){function t(t){var n=e.call(this)||this;return n._root=t,t.tcbCacheObject||(t.tcbCacheObject={}),n}return fe(t,e),t.prototype.setItem=function(e,t){this._root.tcbCacheObject[e]=t},t.prototype.getItem=function(e){return this._root.tcbCacheObject[e]},t.prototype.removeItem=function(e){delete this._root.tcbCacheObject[e]},t.prototype.clear=function(){delete this._root.tcbCacheObject},t}(C.AbstractStorage);function be(e,t){switch(e){case"local":default:return t.localStorage?t.localStorage:(ve.printWarn(ge.ERRORS.INVALID_PARAMS,"localStorage is not supported on current platform"),new ye(t.root));case"none":return new ye(t.root);case"session":return t.sessionStorage?t.sessionStorage:(ve.printWarn(ge.ERRORS.INVALID_PARAMS,"sessionStorage is not supported on current platform"),new ye(t.root))}}var xe=function(){function e(e){this.keys={};var t=e.persistence,n=e.platformInfo,i=void 0===n?{}:n,o=e.keys,r=void 0===o?{}:o,a=e.alwaysLocalKeys,s=void 0===a?[]:a;this._platformInfo=i,this._alwaysLocalKeys=s,this._storage||(this._persistence=i.adapter.primaryStorage||t,this._storage=be(this._persistence,i.adapter),this.keys=r)}return Object.defineProperty(e.prototype,"mode",{get:function(){return this._storage.mode||"sync"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"persistence",{get:function(){return this._persistence},enumerable:!1,configurable:!0}),e.prototype.updatePersistence=function(e){if("async"!==this.mode){if(e!==this._persistence){var t="local"===this._persistence;this._persistence=e;var n=be(e,this._platformInfo.adapter);for(var i in this.keys){var o=this.keys[i];if(!t||!this._alwaysLocalKeys.includes(i)){var r=this._storage.getItem(o);ve.isUndefined(r)||ve.isNull(r)||(n.setItem(o,r),this._storage.removeItem(o))}}this._storage=n}}else ve.printWarn(ge.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use updatePersistenceAsync insteed")},e.prototype.updatePersistenceAsync=function(e){return he(this,void 0,void 0,(function(){var t,n,i,o,r,a,s,c;return me(this,(function(u){switch(u.label){case 0:if(e===this._persistence)return[2];for(o in t="local"===this._persistence,this._persistence=e,n=be(e,this._platformInfo.adapter),i=[],this.keys)i.push(o);r=0,u.label=1;case 1:return r<i.length?(a=i[r],s=this.keys[a],t&&this._alwaysLocalKeys.includes(a)?[3,4]:[4,this._storage.getItem(s)]):[3,5];case 2:return c=u.sent(),ve.isUndefined(c)||ve.isNull(c)?[3,4]:(n.setItem(s,c),[4,this._storage.removeItem(s)]);case 3:u.sent(),u.label=4;case 4:return r++,[3,1];case 5:return this._storage=n,[2]}}))}))},e.prototype.setStore=function(e,t,n){if("async"!==this.mode){if(this._storage)try{var i={version:n||"localCachev1",content:t};this._storage.setItem(e,JSON.stringify(i))}catch(e){throw new Error(JSON.stringify({code:ge.ERRORS.OPERATION_FAIL,msg:"["+ge.getSdkName()+"]["+ge.ERRORS.OPERATION_FAIL+"]setStore failed",info:e}))}}else ve.printWarn(ge.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},e.prototype.setStoreAsync=function(e,t,n){return he(this,void 0,void 0,(function(){var i;return me(this,(function(o){switch(o.label){case 0:if(!this._storage)return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),i={version:n||"localCachev1",content:t},[4,this._storage.setItem(e,JSON.stringify(i))];case 2:return o.sent(),[3,4];case 3:return o.sent(),[2];case 4:return[2]}}))}))},e.prototype.getStore=function(e,t){var n;if("async"!==this.mode){try{if("undefined"!=typeof process&&(null===(n=process.env)||void 0===n?void 0:n.tcb_token))return process.env.tcb_token;if(!this._storage)return""}catch(e){return""}t=t||"localCachev1";var i=this._storage.getItem(e);return i&&i.indexOf(t)>=0?JSON.parse(i).content:""}ve.printWarn(ge.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},e.prototype.getStoreAsync=function(e,t){var n;return he(this,void 0,void 0,(function(){var i;return me(this,(function(o){switch(o.label){case 0:try{if("undefined"!=typeof process&&(null===(n=process.env)||void 0===n?void 0:n.tcb_token))return[2,process.env.tcb_token];if(!this._storage)return[2,""]}catch(e){return[2,""]}return t=t||"localCachev1",[4,this._storage.getItem(e)];case 1:return(i=o.sent())&&i.indexOf(t)>=0?[2,JSON.parse(i).content]:[2,""]}}))}))},e.prototype.removeStore=function(e){"async"!==this.mode?this._storage.removeItem(e):ve.printWarn(ge.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},e.prototype.removeStoreAsync=function(e){return he(this,void 0,void 0,(function(){return me(this,(function(t){switch(t.label){case 0:return[4,this._storage.removeItem(e)];case 1:return t.sent(),[2]}}))}))},e}();de.CloudbaseCache=xe;var we={},_e=g&&g.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ee=g&&g.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),o=0;for(t=0;t<n;t++)for(var r=arguments[t],a=0,s=r.length;a<s;a++,o++)i[o]=r[a];return i};Object.defineProperty(we,"__esModule",{value:!0}),we.removeEventListener=we.activateEvent=we.addEventListener=we.CloudbaseEventEmitter=we.IErrorEvent=we.CloudbaseEvent=void 0;var Se=P;var Oe=function(e,t){this.data=t||null,this.name=e};we.CloudbaseEvent=Oe;var Ie=function(e){function t(t,n){var i=e.call(this,"error",{error:t,data:n})||this;return i.error=t,i}return _e(t,e),t}(Oe);we.IErrorEvent=Ie;var Ae=function(){function e(){this._listeners={}}return e.prototype.on=function(e,t){return function(e,t,n){n[e]=n[e]||[],n[e].push(t)}(e,t,this._listeners),this},e.prototype.off=function(e,t){return function(e,t,n){if(null==n?void 0:n[e]){var i=n[e].indexOf(t);-1!==i&&n[e].splice(i,1)}}(e,t,this._listeners),this},e.prototype.fire=function(e,t){if(Se.isInstanceOf(e,Ie))return console.error(e.error),this;var n=Se.isString(e)?new Oe(e,t||{}):e,i=n.name;if(this._listens(i)){n.target=this;for(var o=0,r=this._listeners[i]?Ee(this._listeners[i]):[];o<r.length;o++){r[o].call(this,n)}}return this},e.prototype._listens=function(e){return this._listeners[e]&&this._listeners[e].length>0},e}();we.CloudbaseEventEmitter=Ae;var Te=new Ae;we.addEventListener=function(e,t){Te.on(e,t)},we.activateEvent=function(e,t){void 0===t&&(t={}),Te.fire(e,t)},we.removeEventListener=function(e,t){Te.off(e,t)};var Ne={},Re={},ke=g&&g.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},je=g&&g.__generator||function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}};Object.defineProperty(Re,"__esModule",{value:!0}),Re.catchErrorsDecorator=void 0;var Ce=P,Pe=w,Le=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(Le=-1!==navigator.userAgent.indexOf("Firefox"));var Ue=Le?/(\.js\/)?__decorate(\$\d+)?<@.*\d$/:/(\/\w+\.js\.)?__decorate(\$\d+)?\s*\(.*\)$/,De=/https?\:\/\/.+\:\d*\/.*\.js\:\d+\:\d+/;function qe(e){var t=e.err,n=e.className,i=e.methodName,o=e.sourceLink;if(!o)return null;var r,a=t.stack.split("\n"),s=Le?/^catchErrorsDecorator\/<\/descriptor.value@.*\d$/:new RegExp(n+"\\.descriptor.value\\s*\\[as\\s"+i+"\\]\\s*\\(.*\\)$"),c=Le?/^catchErrorsDecorator\/<\/descriptor.value/:new RegExp(n+"\\.descriptor.value\\s*\\[as\\s"+i+"\\]"),u=a.findIndex((function(e){return s.test(e)}));if(-1!==u){var p=a.filter((function(e,t){return t>u}));p.unshift(a[u].replace(c,n+"."+i).replace(De,o)),(r=new Error).stack=(Le?"@debugger":"Error")+"\n"+p.join("\n")}return r}Re.catchErrorsDecorator=function(e){var t=e.mode,n=void 0===t?"async":t,i=e.customInfo,o=void 0===i?{}:i,r=e.title,a=e.messages,s=void 0===a?[]:a;return function(e,t,i){if(Pe.IS_DEBUG_MODE){var a=o.className||e.constructor.name,c=o.methodName||t,u=i.value,p=function(e){var t="",n=e.stack.split("\n"),i=n.findIndex((function(e){return Ue.test(e)}));if(-1!==i){var o=De.exec(n[i+1]||"");t=o?o[0]:""}return t}(new Error);i.value="sync"===n?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=qe({err:new Error,className:a,methodName:c,sourceLink:p});try{return u.apply(this,e)}catch(e){var i=e,o=e.message,l={title:r||a+"."+c+" failed",content:[{type:"error",body:e}]};if(o&&/^\{.*\}$/.test(o)){var d=JSON.parse(o);l.subtitle=o,d.code&&(n?(n.code=d.code,n.msg=d.msg):(e.code=d.code,e.message=d.msg),i=n||e,l.content=s.map((function(e){return{type:"info",body:e}})))}throw Ce.printGroupLog(l),i}}:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ke(this,void 0,void 0,(function(){var t,n,i,o,l,d;return je(this,(function(f){switch(f.label){case 0:t=qe({err:new Error,className:a,methodName:c,sourceLink:p}),f.label=1;case 1:return f.trys.push([1,3,,4]),[4,u.apply(this,e)];case 2:return[2,f.sent()];case 3:throw n=f.sent(),i=n,o=n.message,l={title:r||a+"."+c+" failed",content:[{type:"error",body:n}]},o&&/^\{.*\}$/.test(o)&&(d=JSON.parse(o),l.subtitle=d,d.code&&(t?(t.code=d.code,t.message=d.msg):(n.code=d.code,n.message=d.msg),i=t||n,l.content=s.map((function(e){return{type:"info",body:e}})))),Ce.printGroupLog(l),i;case 4:return[2]}}))}))}}}},function(e){var t=g&&g.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=g&&g.__exportStar||function(e,n){for(var i in e)"default"===i||n.hasOwnProperty(i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Re,e)}(Ne);var Me=g&&g.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),Fe=g&&g.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Be=g&&g.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&Me(t,e,n);return Fe(t,e),t};Object.defineProperty(x,"__esModule",{value:!0});var We=x.helpers=x.utils=x.events=x.cache=x.adapters=x.constants=void 0,ze=Be(w),He=x.constants=ze,$e=Be(A),Ge=x.adapters=$e,Ke=Be(de),Ve=x.cache=Ke,Je=Be(we),Ye=x.events=Je,Xe=Be(P),Ze=x.utils=Xe,Qe=Be(Ne);We=x.helpers=Qe;var et=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),tt=function(){return tt=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},tt.apply(this,arguments)},nt=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},it=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}};var ot=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this,i=t.timeout,o=t.timeoutMsg,r=t.restrictedMethods;return n._timeout=i||0,n._timeoutMsg=o||"请求超时",n._restrictedMethods=r||["get","post","upload","download"],n}return et(t,e),t.prototype.post=function(e){var t=this;return new Promise((function(n,i){var o=e.url,r=e.data,a=e.headers,s=wx.request({url:k("https:",o),data:r,timeout:t._timeout,method:"POST",header:a,success:function(e){n(e)},fail:function(e){i(e)},complete:function(e){if(e&&e.errMsg&&(t._timeout&&-1!==t._restrictedMethods.indexOf("post")&&"request:fail timeout"===e.errMsg)){console.warn(t._timeoutMsg);try{s.abort()}catch(e){}}}})}))},t.prototype.upload=function(e){var t=this,n=this;return new Promise((function(i){return nt(t,void 0,void 0,(function(){var t,o,r,a,s,c;return it(this,(function(u){return t=e.url,o=e.file,r=e.data,a=e.headers,s=e.onUploadProgress,c=wx.uploadFile({url:t,filePath:o,name:"file",formData:tt({},r),header:a,timeout:this._timeout,success:function(e){var t={statusCode:e.statusCode,data:e.data||{}};200===e.statusCode&&r.success_action_status&&(t.statusCode=parseInt(r.success_action_status,10)),i(t)},fail:function(e){i(e)},complete:function(e){if(e&&e.errMsg&&(n._timeout&&-1!==n._restrictedMethods.indexOf("upload")&&"request:fail timeout"===e.errMsg)){console.warn(n._timeoutMsg);try{c.abort()}catch(e){}}}}),s&&c.onProgressUpdate((function(e){s(e)})),[2]}))}))}))},t.prototype.download=function(e){var t=this,n=this;return new Promise((function(i,o){var r=e.url,a=e.headers,s=wx.downloadFile({url:k("https:",r),header:a,timeout:t._timeout,success:function(e){200===e.statusCode&&e.tempFilePath?i({statusCode:200,tempFilePath:e.tempFilePath}):i(e)},fail:function(e){o(e)},complete:function(e){if(e&&e.errMsg&&(n._timeout&&-1!==n._restrictedMethods.indexOf("download")&&"request:fail timeout"===e.errMsg)){console.warn(n._timeoutMsg);try{s.abort()}catch(e){}}}})}))},t}(N),rt={setItem:function(e,t){wx.setStorageSync(e,t)},getItem:function(e){return wx.getStorageSync(e)},removeItem:function(e){wx.removeStorageSync(e)},clear:function(){wx.clearStorageSync()}},at=function(e,t){void 0===t&&(t={});var n=wx.connectSocket(tt({url:e},t));return{set onopen(e){n.onOpen(e)},set onmessage(e){n.onMessage(e)},set onclose(e){n.onClose(e)},set onerror(e){n.onError(e)},send:function(e){return n.send({data:e})},close:function(e,t){return n.close({code:e,reason:t})},get readyState(){return n.readyState},CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3}};var st={genAdapter:function(){return{root:{},reqClass:ot,wsClass:at,localStorage:rt,primaryStorage:I.local,getAppSign:function(){var e=wx.getAccountInfoSync();return"undefined"!=typeof App||"undefined"!=typeof getApp||wx.onAppHide||wx.offAppHide||wx.onAppShow||wx.offAppShow?e&&e.miniProgram?e.miniProgram.appId:"":e&&e.plugin?e.plugin.appId:""}}},isMatch:function(){if("undefined"==typeof wx)return!1;if("undefined"==typeof Page)return!1;if(!wx.getSystemInfoSync)return!1;if(!wx.getStorageSync)return!1;if(!wx.setStorageSync)return!1;if(!wx.connectSocket)return!1;if(!wx.request)return!1;try{if(!wx.getSystemInfoSync())return!1;if("qq"===wx.getSystemInfoSync().AppPlatform)return!1}catch(e){return!1}return!0},runtime:"wx_mp"},ct=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),o=0;for(t=0;t<n;t++)for(var r=arguments[t],a=0,s=r.length;a<s;a++,o++)i[o]=r[a];return i},ut=He.ERRORS,pt={};function lt(e,t){var n=t.name,i=t.namespace,o=t.entity,r=t.injectEvents,a=t.IIFE,s=void 0!==a&&a;if(pt[n]||i&&e[i])throw new Error(JSON.stringify({code:ut.INVALID_OPERATION,msg:"Duplicate component "+n}));if(s){if(!o||"function"!=typeof o)throw new Error(JSON.stringify({code:ut.INVALID_PARAMS,msg:"IIFE component's entity must be a function"}));o.call(e)}if(pt[n]=t,i?e.prototype[i]=o:dt(e.prototype,o),r){var c=r.bus,u=r.events;if(!c||!u||0===u.length)return;var p=e.prototype.fire||function(){};e.prototype.events||(e.prototype.events={}),(e.prototype.events||{})[n]?e.prototype.events[n].events=ct(e.prototype.events[n].events,u):e.prototype.events[n]={bus:c,events:u},e.prototype.fire=function(e,t){for(var n in p(e,t),this.events){var i=this.events[n],o=i.bus;if(i.events.includes(e)){o.fire(e,t);break}}}}}function dt(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var n in t)t.hasOwnProperty(n)&&(e[n]=dt(e[n],t[n]));return e}var ft={},ht=function(){return ht=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ht.apply(this,arguments)},mt=Ve.CloudbaseCache,vt={},gt={};function yt(e){var t=e.env,n=e.persistence,i=e.platformInfo,o={accessTokenKey:"access_token_"+t,accessTokenExpireKey:"access_token_expire_"+t,refreshTokenKey:"refresh_token_"+t,anonymousUuidKey:"anonymous_uuid_"+t,loginTypeKey:"login_type_"+t,userInfoKey:"user_info_"+t};vt[t]?vt[t].updatePersistence(n):vt[t]=new mt(ht(ht({},e),{keys:o,platformInfo:i,alwaysLocalKeys:["anonymousUuidKey"]})),gt[t]=gt[t]||new mt(ht(ht({},e),{keys:o,platformInfo:i,persistence:"local"}))}function bt(e){return vt[e]}function xt(e){return gt[e]}var wt=He.setSdkName,_t=He.setProtocol,Et="",St="@cloudbase/js-sdk";var Ot,It="undefined"!=typeof location&&"http:"===location.protocol?"http:":"https:",At="undefined"!=typeof process&&"e2e"===process.env.NODE_ENV&&"pre"===process.env.END_POINT?"//tcb-pre.tencentcloudapi.com/web":"//tcb-api.tencentcloudapi.com/web";function Tt(e,t){At=e,t&&(It=t,_t(t))}function Nt(){return{BASE_URL:At,PROTOCOL:It}}!function(e){e.ANONYMOUS="ANONYMOUS",e.WECHAT="WECHAT",e.CUSTOM="CUSTOM",e.NULL="NULL"}(Ot||(Ot={}));var Rt="loginStateExpire",kt="refreshAccessToken",jt=function(){return jt=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},jt.apply(this,arguments)},Ct=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},Pt=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},Lt=He.ERRORS,Ut=Ze.genSeqId,Dt=Ze.isFormData,qt=Ze.formatUrl,Mt=Ze.createSign,Ft=Ge.RUNTIME,Bt=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"];function Wt(e,t,n){var i=e[t];e[t]=function(t){var o={},r={};n.forEach((function(n){var i=n.call(e,t),a=i.data,s=i.headers;Object.assign(o,a),Object.assign(r,s)}));var a=t.data;return a&&function(){if(Dt(a))for(var e in o)a.append(e,o[e]);else t.data=jt(jt({},a),o)}(),t.headers=jt(jt({},t.headers||{}),r),i.call(e,t)}}function zt(){var e=Ut();return{data:{seqId:e},headers:{"X-SDK-Version":"@cloudbase/js-sdk/"+Et,"x-seqid":e}}}var Ht=function(){function e(e){this._throwWhenRequestFail=!1,this.config=e,this._reqClass=new ft.adapter.reqClass({timeout:this.config.timeout,timeoutMsg:"[@cloudbase/js-sdk] 请求在"+this.config.timeout/1e3+"s内未完成,已中断",restrictedMethods:["post"]}),this._throwWhenRequestFail=e.throw||!1,this._cache=bt(this.config.env),this._localCache=xt(this.config.env),Wt(this._reqClass,"post",[zt]),Wt(this._reqClass,"upload",[zt]),Wt(this._reqClass,"download",[zt])}return e.prototype.post=function(e){return Ct(this,void 0,void 0,(function(){return Pt(this,(function(t){switch(t.label){case 0:return[4,this._reqClass.post(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.upload=function(e){return Ct(this,void 0,void 0,(function(){return Pt(this,(function(t){switch(t.label){case 0:return[4,this._reqClass.upload(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.download=function(e){return Ct(this,void 0,void 0,(function(){return Pt(this,(function(t){switch(t.label){case 0:return[4,this._reqClass.download(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.refreshAccessToken=function(){return Ct(this,void 0,void 0,(function(){var e,t,n;return Pt(this,(function(i){switch(i.label){case 0:this._refreshAccessTokenPromise||(this._refreshAccessTokenPromise=this._refreshAccessToken()),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._refreshAccessTokenPromise];case 2:return e=i.sent(),[3,4];case 3:return n=i.sent(),t=n,[3,4];case 4:if(this._refreshAccessTokenPromise=null,this._shouldRefreshAccessTokenHook=null,t)throw t;return[2,e]}}))}))},e.prototype.getAccessToken=function(){return Ct(this,void 0,void 0,(function(){var e,t,n,i,o,r,a,s,c;return Pt(this,(function(u){switch(u.label){case 0:return e=this._cache.keys,t=e.accessTokenKey,n=e.accessTokenExpireKey,i=e.refreshTokenKey,[4,this._cache.getStoreAsync(i)];case 1:if(!u.sent())throw new Error(JSON.stringify({code:Lt.OPERATION_FAIL,msg:"refresh token is not exist, your local data might be messed up, please retry after clear localStorage or sessionStorage"}));return[4,this._cache.getStoreAsync(t)];case 2:return o=u.sent(),a=Number,[4,this._cache.getStoreAsync(n)];case 3:return r=a.apply(void 0,[u.sent()]),s=!0,(c=this._shouldRefreshAccessTokenHook)?[4,this._shouldRefreshAccessTokenHook(o,r)]:[3,5];case 4:c=!u.sent(),u.label=5;case 5:return c&&(s=!1),o&&r&&!(r<Date.now())||!s?[3,7]:[4,this.refreshAccessToken()];case 6:return[2,u.sent()];case 7:return[2,{accessToken:o,accessTokenExpire:r}]}}))}))},e.prototype.request=function(e,t,n){return Ct(this,void 0,void 0,(function(){var i,o,r,a,s,c,u,p,l,d,f,h,m,v,g,y,b,x,w,_,E,S,O,I,A,T;return Pt(this,(function(N){switch(N.label){case 0:return i="x-tcb-trace_"+this.config.env,o="application/x-www-form-urlencoded",r=jt({action:e,dataVersion:"2020-01-10",env:this.config.env},t),-1!==Bt.indexOf(e)?[3,3]:(a=this._cache.keys.refreshTokenKey,[4,this._cache.getStoreAsync(a)]);case 1:return N.sent()?(s=r,[4,this.getAccessToken()]):[3,3];case 2:s.access_token=N.sent().accessToken,N.label=3;case 3:if("storage.uploadFile"===e){for(u in c=new FormData)c.hasOwnProperty(u)&&void 0!==c[u]&&c.append(u,r[u]);o="multipart/form-data"}else for(u in o="application/json;charset=UTF-8",c={},r)void 0!==r[u]&&(c[u]=r[u]);return p={headers:{"content-type":o}},(null==n?void 0:n.onUploadProgress)&&(p.onUploadProgress=n.onUploadProgress),this.config.region&&(p.headers["X-TCB-Region"]=this.config.region),(l=this._localCache.getStore(i))&&(p.headers["X-TCB-Trace"]=l),ft.runtime!==Ft.WEB&&(d=this.config,f=d.appSign,h=d.appSecret,m=Date.now(),v=h.appAccessKey,g=h.appAccessKeyId,y=Mt({data:{},timestamp:m,appAccessKeyId:g,appSign:f},v),p.headers["X-TCB-App-Source"]="timestamp="+m+";appAccessKeyId="+g+";appSign="+f+";sign="+y),b=t.parse,x=t.inQuery,w=t.search,_={env:this.config.env},b&&(_.parse=!0),x&&(_=jt(jt({},x),_)),E=Nt(),S=E.BASE_URL,O=E.PROTOCOL,I=qt(O,S,_),w&&(I+=w),[4,this.post(jt({url:I,data:c},p))];case 4:if(A=N.sent(),(T=A.header&&A.header["x-tcb-trace"])&&this._localCache.setStore(i,T),200!==Number(A.status)&&200!==Number(A.statusCode)||!A.data)throw new Error("network request error");return[2,A]}}))}))},e.prototype.send=function(e,t){return void 0===t&&(t={}),Ct(this,void 0,void 0,(function(){var n;return Pt(this,(function(i){switch(i.label){case 0:return[4,this.request(e,t,{onUploadProgress:t.onUploadProgress})];case 1:return"ACCESS_TOKEN_EXPIRED"!==(n=i.sent()).data.code||-1!==Bt.indexOf(e)?[3,4]:[4,this.refreshAccessToken()];case 2:return i.sent(),[4,this.request(e,t,{onUploadProgress:t.onUploadProgress})];case 3:n=i.sent(),i.label=4;case 4:if(n.data.code&&this._throwWhenRequestFail)throw new Error(JSON.stringify({code:Lt.OPERATION_FAIL,msg:"["+n.data.code+"] "+n.data.message}));return[2,n.data]}}))}))},e.prototype._refreshAccessToken=function(e){return void 0===e&&(e=1),Ct(this,void 0,void 0,(function(){var t,n,i,o,r,a,s,c,u,p,l,d,f;return Pt(this,(function(h){switch(h.label){case 0:return t=this._cache.keys,n=t.accessTokenKey,i=t.accessTokenExpireKey,o=t.refreshTokenKey,r=t.loginTypeKey,a=t.anonymousUuidKey,[4,this._cache.removeStoreAsync(n)];case 1:return h.sent(),[4,this._cache.removeStoreAsync(i)];case 2:return h.sent(),[4,this._cache.getStoreAsync(o)];case 3:if(!(s=h.sent()))throw new Error(JSON.stringify({code:Lt.INVALID_OPERATION,msg:"not login"}));return c={refresh_token:s},[4,this.request("auth.fetchAccessTokenWithRefreshToken",c)];case 4:return(u=h.sent()).data.code?"SIGN_PARAM_INVALID"!==(p=u.data.code)&&"REFRESH_TOKEN_EXPIRED"!==p&&"INVALID_REFRESH_TOKEN"!==p?[3,11]:[4,this._cache.getStoreAsync(r)]:[3,12];case 5:return h.sent()===Ot.ANONYMOUS&&"INVALID_REFRESH_TOKEN"===p?[4,this._cache.getStoreAsync(a)]:[3,9];case 6:return l=h.sent(),[4,this._cache.getStoreAsync(o)];case 7:return d=h.sent(),[4,this.send("auth.signInAnonymously",{anonymous_uuid:l,refresh_token:d})];case 8:if(f=h.sent(),this._setRefreshToken(f.refresh_token),e>=1)return[2,this._refreshAccessToken(--e)];throw new Error(JSON.stringify({code:Lt.OPERATION_FAIL,message:"重试获取 refresh token 失败"}));case 9:return un.fire(Rt),[4,this._cache.removeStoreAsync(o)];case 10:h.sent(),h.label=11;case 11:throw new Error(JSON.stringify({code:Lt.NETWORK_ERROR,msg:"refresh access_token failed:"+u.data.code}));case 12:return u.data.access_token?(un.fire(kt),[4,this._cache.setStoreAsync(n,u.data.access_token)]):[3,15];case 13:return h.sent(),[4,this._cache.setStoreAsync(i,u.data.access_token_expire+Date.now())];case 14:return h.sent(),[2,{accessToken:u.data.access_token,accessTokenExpire:u.data.access_token_expire}];case 15:return u.data.refresh_token?[4,this._cache.removeStoreAsync(o)]:[3,19];case 16:return h.sent(),[4,this._cache.setStoreAsync(o,u.data.refresh_token)];case 17:return h.sent(),[4,this._refreshAccessToken()];case 18:h.sent(),h.label=19;case 19:return[2]}}))}))},e.prototype._setRefreshToken=function(e){return Ct(this,void 0,void 0,(function(){var t,n,i,o;return Pt(this,(function(r){switch(r.label){case 0:return t=this._cache.keys,n=t.accessTokenKey,i=t.accessTokenExpireKey,o=t.refreshTokenKey,[4,this._cache.removeStoreAsync(n)];case 1:return r.sent(),[4,this._cache.removeStoreAsync(i)];case 2:return r.sent(),[4,this._cache.setStoreAsync(o,e)];case 3:return r.sent(),[2]}}))}))},e}(),$t={};var Gt=function(){return Gt=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Gt.apply(this,arguments)},Kt=function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},Vt=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Jt=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},Yt=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},Xt=Ge.useAdapters,Zt=Ge.useDefaultAdapter,Qt=Ge.RUNTIME,en=He.ERRORS,tn=He.COMMUNITY_SITE_URL,nn=Ze.printWarn,on=We.catchErrorsDecorator,rn={timeout:15e3,persistence:"local"},an=6e5,sn={},cn=function(){function e(e){this._config=e||this._config,this.authInstance=null}return Object.defineProperty(e.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"platform",{get:function(){return ft},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cache",{get:function(){return bt(this._config.env)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localCache",{get:function(){return xt(this._config.env)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){return e=this._config.env,$t[e];var e},enumerable:!1,configurable:!0}),e.prototype.init=function(t){if(!t.env)throw new Error(JSON.stringify({code:en.INVALID_PARAMS,msg:"env must not be specified"}));if(ft.adapter||this._useDefaultAdapter(),this.requestClient=new ft.adapter.reqClass({timeout:t.timeout||5e3,timeoutMsg:"["+St+"][REQUEST TIMEOUT] request had been abort since didn't finished within"+t.timeout/1e3+"s"}),ft.runtime!==Qt.WEB){if(!t.appSecret)throw new Error(JSON.stringify({code:en.INVALID_PARAMS,msg:"invalid appSecret"}));var n=ft.adapter.getAppSign?ft.adapter.getAppSign():"";if(t.appSign&&n&&t.appSign!==n)throw new Error(JSON.stringify({code:en.INVALID_PARAMS,msg:"invalid appSign"}));if(n&&(t.appSign=n),!t.appSign)throw new Error(JSON.stringify({code:en.INVALID_PARAMS,msg:"invalid appSign"}))}this._config=Gt(Gt({},rn),t),this._config.timeout=this._formatTimeout(this._config.timeout);var i=this._config,o=i.env,r=i.persistence,a=i.debug,s=i.timeout,c=i.appSecret,u=i.appSign;yt({env:o,persistence:r,debug:a,platformInfo:this.platform}),function(e){$t[e.env]=new Ht(jt(jt({},e),{throw:!0}))}({env:o,region:t.region||"",timeout:s,appSecret:c,appSign:u}),t.region&&function(e,t,n){Tt(t?"//"+e+"."+t+".tcb-api.tencentcloudapi.com/web":"//"+e+".ap-shanghai.tcb-api.tencentcloudapi.com/web",n)}(o,t.region||"");var p=new e(this._config);return p.requestClient=this.requestClient,p},e.prototype.updateConfig=function(e){var t=e.persistence,n=e.debug;this._config.persistence=t,this._config.debug=n,yt({env:this._config.env,persistence:t,debug:n,platformInfo:this.platform})},e.prototype.registerExtension=function(e){sn[e.name]=e},e.prototype.invokeExtension=function(e,t){return Jt(this,void 0,void 0,(function(){var n;return Yt(this,(function(i){switch(i.label){case 0:if(!(n=sn[e]))throw new Error(JSON.stringify({code:en.INVALID_PARAMS,msg:"extension:"+e+" must be registered before invoke"}));return[4,n.invoke(t,this)];case 1:return[2,i.sent()]}}))}))},e.prototype.useAdapters=function(e){var t=Xt(e)||{},n=t.adapter,i=t.runtime;n&&(ft.adapter=n),i&&(ft.runtime=i)},e.prototype.registerHook=function(t){!function(e,t){var n=t.entity,i=t.target;if(!e.prototype.hasOwnProperty(i))throw new Error(JSON.stringify({code:ut.INVALID_OPERATION,msg:"target:"+i+" is not exist"}));var o=e.prototype[i];if("function"!=typeof o)throw new Error(JSON.stringify({code:ut.INVALID_OPERATION,msg:"target:"+i+" is not a function which is the only type supports hook"}));e.prototype[i]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.call.apply(n,ct([this],e)),o.call.apply(o,ct([this],e))}}(e,t)},e.prototype.registerComponent=function(t){lt(e,t)},e.prototype.registerVersion=function(e){!function(e){Et=e}(e)},e.prototype.registerSdkName=function(e){!function(e){St=e,wt(e)}(e)},e.prototype.registerEndPoint=function(e,t){Tt(e,t)},e.prototype._useDefaultAdapter=function(){var e=Zt(),t=e.adapter,n=e.runtime;ft.adapter=t,ft.runtime=n},e.prototype._formatTimeout=function(e){switch(!0){case e>an:return nn(en.INVALID_PARAMS,"timeout is greater than maximum value[10min]"),an;case e<100:return nn(en.INVALID_PARAMS,"timeout is less than maximum value[100ms]"),100;default:return e}},Kt([on({mode:"sync",title:"Cloudbase 初始化失败",messages:["请确认以下各项:"," 1 - 调用 cloudbase.init() 的语法或参数是否正确"," 2 - 如果是非浏览器环境,是否配置了安全应用来源(https://docs.cloudbase.net/api-reference/webv2/adapter.html#jie-ru-liu-cheng)","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+tn]}),Vt("design:type",Function),Vt("design:paramtypes",[Object]),Vt("design:returntype",e)],e.prototype,"init",null),Kt([on({title:"调用扩展能力失败",messages:["请确认以下各项:"," 1 - 调用 invokeExtension() 的语法或参数是否正确"," 2 - 被调用的扩展能力是否已经安装并通过 registerExtension() 注册","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+tn]}),Vt("design:type",Function),Vt("design:paramtypes",[String,Object]),Vt("design:returntype",Promise)],e.prototype,"invokeExtension",null),e}(),un=new cn;un.useAdapters(st);var pn,ln=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},dn=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},fn=function(){function e(e){this._config=e,this._cache=e.cache,this._request=e.request}return e.prototype.checkLocalLoginState=function(){return ln(this,void 0,void 0,(function(){var e,t,n,i,o,r;return dn(this,(function(a){switch(a.label){case 0:return e=this._cache.keys,t=e.accessTokenKey,n=e.accessTokenExpireKey,[4,this._cache.getStoreAsync(t)];case 1:return i=a.sent(),[4,this._cache.getStoreAsync(n)];case 2:return o=a.sent(),i?o&&o>Date.now()?[4,(r=new Ji({envId:this._config.env,cache:this._cache,request:this._request})).checkLocalStateAsync()]:[3,4]:[3,7];case 3:return a.sent(),[2,r];case 4:return[4,this._cache.removeStoreAsync(t)];case 5:return a.sent(),[4,this._cache.removeStoreAsync(n)];case 6:a.sent(),a.label=7;case 7:return[2]}}))}))},e.prototype.setRefreshToken=function(e){return ln(this,void 0,void 0,(function(){var t,n,i,o;return dn(this,(function(r){switch(r.label){case 0:return t=this._cache.keys,n=t.accessTokenKey,i=t.accessTokenExpireKey,o=t.refreshTokenKey,[4,this._cache.removeStoreAsync(n)];case 1:return r.sent(),[4,this._cache.removeStoreAsync(i)];case 2:return r.sent(),[4,this._cache.setStoreAsync(o,e)];case 3:return r.sent(),[2]}}))}))},e.prototype.setAccessToken=function(e,t){return ln(this,void 0,void 0,(function(){var n,i,o;return dn(this,(function(r){switch(r.label){case 0:return n=this._cache.keys,i=n.accessTokenKey,o=n.accessTokenExpireKey,[4,this._cache.setStoreAsync(i,e)];case 1:return r.sent(),[4,this._cache.setStoreAsync(o,t)];case 2:return r.sent(),[2]}}))}))},e.prototype.refreshUserInfo=function(){return ln(this,void 0,void 0,(function(){var e;return dn(this,(function(t){switch(t.label){case 0:return"auth.getUserInfo",[4,this._request.send("auth.getUserInfo",{})];case 1:return e=t.sent().data,[4,this.setLocalUserInfo(e)];case 2:return t.sent(),[2,e]}}))}))},e.prototype.setLocalUserInfo=function(e){return ln(this,void 0,void 0,(function(){var t;return dn(this,(function(n){switch(n.label){case 0:return t=this._cache.keys.userInfoKey,[4,this._cache.setStoreAsync(t,e)];case 1:return n.sent(),[2]}}))}))},e}();!function(e){e.ANONYMOUS="ANONYMOUS",e.WECHAT="WECHAT",e.WECHAT_PUBLIC="WECHAT-PUBLIC",e.WECHAT_OPEN="WECHAT-OPEN",e.CUSTOM="CUSTOM",e.EMAIL="EMAIL",e.USERNAME="USERNAME",e.NULL="NULL",e.PHONE="PHONE"}(pn||(pn={}));var hn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),mn=function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},vn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},gn=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},yn=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},bn=He.getSdkName,xn=He.ERRORS,wn=He.COMMUNITY_SITE_URL,_n=Ge.RUNTIME,En=Ze.getQuery,Sn=Ze.getHash,On=Ze.removeParam,In=Ze.printWarn,An=We.catchErrorsDecorator,Tn=function(e){function t(t,n,i,o){var r=e.call(this,t)||this;return r._runtime=t.runtime,r._appid=n,r._scope=i,r._state=o||"weixin",r}return hn(t,e),t.prototype.signIn=function(){return gn(this,void 0,void 0,(function(){return yn(this,(function(e){return[2,In(xn.OPERATION_FAIL,"API signIn has been deprecated, please use signInWithRedirect insteed")]}))}))},t.prototype.signInWithRedirect=function(){return gn(this,void 0,void 0,(function(){return yn(this,(function(e){return[2,this._redirect()]}))}))},t.prototype.getRedirectResult=function(e){return gn(this,void 0,void 0,(function(){var t;return yn(this,(function(n){return(t=Nn())?[2,this._signInWithCode(t,e)]:[2,null]}))}))},t.prototype.getLinkRedirectResult=function(e){return void 0===e&&(e={}),gn(this,void 0,void 0,(function(){var t,n,i,o,r,a;return yn(this,(function(s){return t=e.withUnionId,n=void 0!==t&&t,(i=Nn())?(o=this._appid,c=this._scope,r="snsapi_login"===c?"WECHAT-OPEN":"WECHAT-PUBLIC",a=this._runtime===_n.WX_MP?"1":"0",[2,this._request.send("auth.linkWithWeixinCode",{payload:{appid:o,loginType:r,code:i,hybridMiniapp:a,withUnionId:n}})]):[2,null];var c}))}))},t.prototype._redirect=function(){var e=On("code",location.href);e=On("state",e),e=encodeURIComponent(e);var t="//open.weixin.qq.com/connect/oauth2/authorize";"snsapi_login"===this._scope&&(t="//open.weixin.qq.com/connect/qrconnect");try{location.href=t+"?appid="+this._appid+"&redirect_uri="+e+"&response_type=code&scope="+this._scope+"&state="+this._state+"#wechat_redirect"}catch(e){throw new Error("["+bn()+"]["+xn.UNKOWN_ERROR+"]"+e)}},t.prototype._signInWithCode=function(e,t){return gn(this,void 0,void 0,(function(){var n,i,o,r,a,s,c,u;return yn(this,(function(p){switch(p.label){case 0:return n=this._cache.keys,i=n.accessTokenKey,o=n.accessTokenExpireKey,r=n.refreshTokenKey,l=this._scope,a="snsapi_login"===l?"WECHAT-OPEN":"WECHAT-PUBLIC",[4,this._getRefreshTokenByWXCode(this._appid,a,e,t)];case 1:return s=p.sent(),c=s.refreshToken,[4,this._cache.setStoreAsync(r,c)];case 2:return p.sent(),s.accessToken?[4,this._cache.setStoreAsync(i,s.accessToken)]:[3,4];case 3:p.sent(),p.label=4;case 4:return s.accessTokenExpire?[4,this._cache.setStoreAsync(o,String(s.accessTokenExpire+Date.now()))]:[3,6];case 5:p.sent(),p.label=6;case 6:return Ki.fire(Xi.LOGIN_STATE_CHANGED),Ki.fire(Xi.LOGIN_TYPE_CHANGED,{env:this._config.env,loginType:pn.WECHAT,persistence:this._config.persistence}),[4,this.refreshUserInfo()];case 7:return p.sent(),[4,(u=new Ji({envId:this._config.env,cache:this._cache,request:this._request})).checkLocalStateAsync()];case 8:return p.sent(),[2,u]}var l}))}))},t.prototype._getRefreshTokenByWXCode=function(e,t,n,i){return void 0===i&&(i={}),gn(this,void 0,void 0,(function(){var o,r,a,s,c,u;return yn(this,(function(p){return o=i.withUnionId,r=void 0!==o&&o,a=i.createUser,s=void 0===a||a,c="snsapi_base"!==this._scope&&(i.syncUserInfo||!1),"auth.signIn",u=this._runtime===_n.WX_MP?"1":"0",[2,this._request.send("auth.signIn",{appid:e,loginType:t,hybridMiniapp:u,syncUserInfo:c,loginCredential:n,withUnionId:r,createUser:s}).then((function(e){if(e.code)throw new Error("["+bn()+"]["+xn.OPERATION_FAIL+"] failed login via wechat: "+e.code);if(e.refresh_token)return{refreshToken:e.refresh_token,accessToken:e.access_token,accessTokenExpire:e.access_token_expire};throw new Error("["+bn()+"]["+xn.OPERATION_FAIL+"] action:getJwt not return refreshToken")}))]}))}))},mn([An({title:"跳转微信公众号授权失败",messages:["请确认以下各项:"," 1 - 调用 auth().weixinAuthProvider().signInWithRedirect() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+wn]}),vn("design:type",Function),vn("design:paramtypes",[]),vn("design:returntype",Promise)],t.prototype,"signInWithRedirect",null),mn([An({title:"微信公众号登录失败",messages:["请确认以下各项:"," 1 - 调用 auth().weixinAuthProvider().getRedirectResult() 的语法或参数是否正确"," 2 - 当前环境是否开通了微信公众号登录授权"," 3 - 微信公众号的 AppId 与 AppSecret 配置是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+wn]}),vn("design:type",Function),vn("design:paramtypes",[Object]),vn("design:returntype",Promise)],t.prototype,"getRedirectResult",null),mn([An({title:"获取微信重定向绑定结果",messages:["请确认以下各项:"," 1 - 调用 auth().weixinAuthProvider().getLinkRedirectResult() 的语法或参数是否正确"," 2 - 当前环境是否开通了微信公众号登录授权"," 3 - 微信公众号的 AppId 与 AppSecret 配置是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+wn]}),vn("design:type",Function),vn("design:paramtypes",[Object]),vn("design:returntype",Promise)],t.prototype,"getLinkRedirectResult",null),t}(fn);function Nn(){return En("code")||Sn("code")}var Rn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),kn=function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},jn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Cn=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},Pn=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},Ln=He.ERRORS,Un=He.COMMUNITY_SITE_URL,Dn=Ze.throwError,qn=Ze.isString,Mn=Ye.addEventListener,Fn=We.catchErrorsDecorator,Bn=function(e){function t(t){var n=e.call(this,t)||this;return n._onConverted=n._onConverted.bind(n),Mn(Xi.ANONYMOUS_CONVERTED,n._onConverted),n}return Rn(t,e),t.prototype.signIn=function(){return Cn(this,void 0,void 0,(function(){var e,t,n,i,o,r,a;return Pn(this,(function(s){switch(s.label){case 0:return[4,this._cache.updatePersistenceAsync("local")];case 1:return s.sent(),e=this._cache.keys,t=e.anonymousUuidKey,n=e.refreshTokenKey,[4,this._cache.getStoreAsync(t)];case 2:return i=s.sent(),[4,this._cache.getStoreAsync(n)];case 3:return o=s.sent(),[4,this._request.send("auth.signInAnonymously",{anonymous_uuid:i,refresh_token:o})];case 4:return(r=s.sent()).uuid&&r.refresh_token?[4,this._setAnonymousUUID(r.uuid)]:[3,10];case 5:return s.sent(),[4,this.setRefreshToken(r.refresh_token)];case 6:return s.sent(),[4,this._request.refreshAccessToken()];case 7:return s.sent(),Ki.fire(Xi.LOGIN_TYPE_CHANGED,{env:this._config.env,loginType:pn.ANONYMOUS,persistence:"local"}),Ki.fire(Xi.LOGIN_STATE_CHANGED),[4,(a=new Ji({envId:this._config.env,cache:this._cache,request:this._request})).checkLocalStateAsync()];case 8:return s.sent(),[4,a.user.refresh()];case 9:return s.sent(),[2,a];case 10:throw new Error(JSON.stringify({code:Ln.OPERATION_FAIL,msg:JSON.stringify(r)||"anonymous signIn failed"}))}}))}))},t.prototype.linkAndRetrieveDataWithTicket=function(e){return Cn(this,void 0,void 0,(function(){var t,n,i,o,r,a,s;return Pn(this,(function(c){switch(c.label){case 0:return qn(e)||Dn(Ln.INVALID_PARAMS,"ticket must be a string"),t=this._cache.keys,n=t.anonymousUuidKey,i=t.refreshTokenKey,[4,this._cache.getStoreAsync(n)];case 1:return o=c.sent(),[4,this._cache.getStoreAsync(i)];case 2:return r=c.sent(),[4,this._request.send("auth.linkAndRetrieveDataWithTicket",{anonymous_uuid:o,refresh_token:r,ticket:e})];case 3:return(a=c.sent()).refresh_token?[4,this._clearAnonymousUUID()]:[3,8];case 4:return c.sent(),[4,this.setRefreshToken(a.refresh_token)];case 5:return c.sent(),[4,this._request.refreshAccessToken()];case 6:return c.sent(),Ki.fire(Xi.ANONYMOUS_CONVERTED,{env:this._config.env}),Ki.fire(Xi.LOGIN_TYPE_CHANGED,{loginType:pn.CUSTOM,persistence:"local"}),[4,(s=new Ji({envId:this._config.env,cache:this._cache,request:this._request})).checkLocalStateAsync()];case 7:return c.sent(),[2,s];case 8:Dn(Ln.OPERATION_FAIL,JSON.stringify(a)||"linkAndRetrieveDataWithTicket failed"),c.label=9;case 9:return[2]}}))}))},t.prototype._setAnonymousUUID=function(e){return Cn(this,void 0,void 0,(function(){var t,n,i;return Pn(this,(function(o){switch(o.label){case 0:return t=this._cache.keys,n=t.anonymousUuidKey,i=t.loginTypeKey,[4,this._cache.removeStoreAsync(n)];case 1:return o.sent(),[4,this._cache.setStoreAsync(n,e)];case 2:return o.sent(),[4,this._cache.setStoreAsync(i,pn.ANONYMOUS)];case 3:return o.sent(),[2]}}))}))},t.prototype._clearAnonymousUUID=function(){return Cn(this,void 0,void 0,(function(){return Pn(this,(function(e){switch(e.label){case 0:return[4,this._cache.removeStoreAsync(this._cache.keys.anonymousUuidKey)];case 1:return e.sent(),[2]}}))}))},t.prototype._onConverted=function(e){return Cn(this,void 0,void 0,(function(){return Pn(this,(function(t){switch(t.label){case 0:return e.data.env!==this._config.env?[2]:[4,this._cache.updatePersistenceAsync(this._config.persistence)];case 1:return t.sent(),[2]}}))}))},kn([Fn({title:"匿名登录失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了匿名登录"," 2 - 调用 auth().anonymouseProvider().signIn() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+Un]}),jn("design:type",Function),jn("design:paramtypes",[]),jn("design:returntype",Promise)],t.prototype,"signIn",null),t}(fn),Wn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),zn=function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},Hn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},$n=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},Gn=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},Kn=He.ERRORS,Vn=He.COMMUNITY_SITE_URL,Jn=Ze.isString,Yn=We.catchErrorsDecorator,Xn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Wn(t,e),t.prototype.signIn=function(e){return $n(this,void 0,void 0,(function(){var t,n,i,o,r,a,s;return Gn(this,(function(c){switch(c.label){case 0:if(!Jn(e))throw new Error(JSON.stringify({code:Kn.INVALID_PARAMS,msg:"ticket must be a string"}));return t=this._cache.keys.refreshTokenKey,o=(i=this._request).send,r=["auth.signInWithTicket"],a={ticket:e},[4,this._cache.getStoreAsync(t)];case 1:return[4,o.apply(i,r.concat([(a.refresh_token=c.sent()||"",a)]))];case 2:return(n=c.sent()).refresh_token?[4,this.setRefreshToken(n.refresh_token)]:[3,7];case 3:return c.sent(),[4,this._request.refreshAccessToken()];case 4:return c.sent(),Ki.fire(Xi.LOGIN_TYPE_CHANGED,{env:this._config.env,loginType:pn.CUSTOM,persistence:this._config.persistence}),Ki.fire(Xi.LOGIN_STATE_CHANGED),[4,this.refreshUserInfo()];case 5:return c.sent(),[4,(s=new Ji({envId:this._config.env,cache:this._cache,request:this._request})).checkLocalStateAsync()];case 6:return c.sent(),[2,s];case 7:throw new Error(JSON.stringify({code:Kn.OPERATION_FAIL,msg:"custom signIn failed"}))}}))}))},zn([Yn({title:"自定义登录失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了自定义登录"," 2 - 调用 auth().customAuthProvider().signIn() 的语法或参数是否正确"," 3 - ticket 是否归属于当前环境"," 4 - 创建 ticket 的自定义登录私钥是否过期","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+Vn]}),Hn("design:type",Function),Hn("design:paramtypes",[String]),Hn("design:returntype",Promise)],t.prototype,"signIn",null),t}(fn),Zn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Qn=function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},ei=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},ti=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},ni=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},ii=Ze.throwError,oi=Ze.isString,ri=He.ERRORS,ai=He.COMMUNITY_SITE_URL,si=We.catchErrorsDecorator,ci=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Zn(t,e),t.prototype.signIn=function(e,t){return ti(this,void 0,void 0,(function(){var n,i,o,r,a;return ni(this,(function(s){switch(s.label){case 0:return oi(e)||ii(ri.INVALID_PARAMS,"email must be a string"),n=this._cache.keys.refreshTokenKey,[4,this._request.send("auth.signIn",{loginType:"EMAIL",email:e,password:t,refresh_token:this._cache.getStore(n)||""})];case 1:return i=s.sent(),o=i.refresh_token,r=i.access_token,a=i.access_token_expire,o?[4,this.setRefreshToken(o)]:[3,8];case 2:return s.sent(),r&&a?[4,this.setAccessToken(r,a)]:[3,4];case 3:return s.sent(),[3,6];case 4:return[4,this._request.refreshAccessToken()];case 5:s.sent(),s.label=6;case 6:return[4,this.refreshUserInfo()];case 7:return s.sent(),Ki.fire(Xi.LOGIN_STATE_CHANGED),Ki.fire(Xi.LOGIN_TYPE_CHANGED,{env:this._config.env,loginType:pn.EMAIL,persistence:this._config.persistence}),[2,new Ji({envId:this._config.env,cache:this._cache,request:this._request})];case 8:i.code?ii(ri.OPERATION_FAIL,"Email login fail["+i.code+"] "+i.message):ii(ri.OPERATION_FAIL,"Email login fail"),s.label=9;case 9:return[2]}}))}))},t.prototype.signUp=function(e,t){return ti(this,void 0,void 0,(function(){return ni(this,(function(n){return[2,this._request.send("auth.signUpWithEmailAndPassword",{email:e,password:t})]}))}))},t.prototype.resetPassword=function(e){return ti(this,void 0,void 0,(function(){return ni(this,(function(t){return[2,this._request.send("auth.sendPasswordResetEmail",{email:e})]}))}))},t.prototype.resetPasswordWithToken=function(e,t){return ti(this,void 0,void 0,(function(){return ni(this,(function(n){return[2,this._request.send("auth.resetPasswordWithToken",{token:e,newPassword:t})]}))}))},t.prototype.activate=function(e){return ti(this,void 0,void 0,(function(){return ni(this,(function(t){return[2,this._request.send("auth.activateEndUserMail",{token:e})]}))}))},Qn([si({title:"邮箱密码登录失败",messages:["请确认以下各项:"," 1 - 调用 auth().emailAuthProvider() 的语法或参数是否正确"," 2 - 当前环境是否开通了邮箱登录"," 3 - 邮箱地址与密码是否匹配","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+ai]}),ei("design:type",Function),ei("design:paramtypes",[String,String]),ei("design:returntype",Promise)],t.prototype,"signIn",null),Qn([si({title:"邮箱注册失败",messages:["请确认以下各项:"," 1 - 调用 auth().signUpWithEmailAndPassword() 的语法或参数是否正确"," 2 - 当前环境是否开通了邮箱登录"," 3 - 此邮箱地址是否已经被其他用户占用","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+ai]}),ei("design:type",Function),ei("design:paramtypes",[String,String]),ei("design:returntype",Promise)],t.prototype,"signUp",null),Qn([si({title:"重置密码失败",messages:["请确认以下各项:"," 1 - 调用 auth().sendPasswordResetEmail() 的语法或参数是否正确"," 2 - 当前环境是否开通了邮箱登录"," 3 - 此邮箱地址是否已经与当前用户绑定"," 4 - 此邮箱地址是否已经被其他用户占用","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+ai]}),ei("design:type",Function),ei("design:paramtypes",[String]),ei("design:returntype",Promise)],t.prototype,"resetPassword",null),Qn([si({title:"重置密码失败",messages:["请确认以下各项:"," 1 - 调用语法或参数是否正确"," 2 - 当前环境是否开通了邮箱登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+ai]}),ei("design:type",Function),ei("design:paramtypes",[String,String]),ei("design:returntype",Promise)],t.prototype,"resetPasswordWithToken",null),Qn([si({title:"邮箱激活失败",messages:["请确认以下各项:"," 1 - 调用语法或参数是否正确"," 2 - 当前环境是否开通了邮箱登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+ai]}),ei("design:type",Function),ei("design:paramtypes",[String]),ei("design:returntype",Promise)],t.prototype,"activate",null),t}(fn),ui=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),pi=function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},li=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},di=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},fi=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},hi=Ze.printWarn,mi=He.ERRORS,vi=He.COMMUNITY_SITE_URL,gi=We.catchErrorsDecorator,yi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ui(t,e),t.prototype.signIn=function(e,t){return di(this,void 0,void 0,(function(){var n,i,o,r,a,s,c,u,p;return fi(this,(function(l){switch(l.label){case 0:if("string"!=typeof e)throw new Error(JSON.stringify({code:mi.INVALID_PARAMS,msg:"username must be a string"}));return"string"!=typeof t&&(t="",hi(mi.INVALID_PARAMS,"password is empty")),n=this._cache.keys.refreshTokenKey,r=(o=this._request).send,a=["auth.signIn"],s={loginType:pn.USERNAME,username:e,password:t},[4,this._cache.getStoreAsync(n)];case 1:return[4,r.apply(o,a.concat([(s.refresh_token=l.sent()||"",s)]))];case 2:return i=l.sent(),c=i.refresh_token,u=i.access_token_expire,p=i.access_token,c?[4,this.setRefreshToken(c)]:[3,9];case 3:return l.sent(),p&&u?[4,this.setAccessToken(p,u)]:[3,5];case 4:return l.sent(),[3,7];case 5:return[4,this._request.refreshAccessToken()];case 6:l.sent(),l.label=7;case 7:return[4,this.refreshUserInfo()];case 8:return l.sent(),Ki.fire(Xi.LOGIN_STATE_CHANGED),Ki.fire(Xi.LOGIN_TYPE_CHANGED,{env:this._config.env,loginType:pn.USERNAME,persistence:this._config.persistence}),[2,new Ji({envId:this._config.env,cache:this._cache,request:this._request})];case 9:throw i.code?new Error(JSON.stringify({code:mi.OPERATION_FAIL,msg:"login by username failed:["+i.code+"] "+i.message})):new Error(JSON.stringify({code:mi.OPERATION_FAIL,msg:"login by username failed"}));case 10:return[2]}}))}))},pi([gi({title:"用户名密码登录失败",messages:["请确认以下各项:"," 1 - 调用 auth().signInWithUsernameAndPassword() 的语法或参数是否正确"," 2 - 当前环境是否开通了用户名密码登录"," 3 - 用户名密码是否匹配","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+vi]}),li("design:type",Function),li("design:paramtypes",[String,String]),li("design:returntype",Promise)],t.prototype,"signIn",null),t}(fn),bi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),xi=function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},wi=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},_i=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},Ei=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},Si=Ze.throwError,Oi=Ze.isString,Ii=Ze.transformPhone,Ai=He.ERRORS,Ti=He.COMMUNITY_SITE_URL,Ni=We.catchErrorsDecorator,Ri="SIGNIN",ki="SIGNUP",ji="FORCERESETPWD",Ci=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return bi(t,e),t.prototype.signIn=function(e){return _i(this,void 0,void 0,(function(){var t,n,i,o,r,a,s,c,u;return Ei(this,(function(p){switch(p.label){case 0:return t=e.phoneNumber,n=e.phoneCode,i=e.password,o=e.signMethod,Oi(t)||Si(Ai.INVALID_PARAMS,"phoneNumber must be a string"),Oi(n)||Oi(i)||Si(Ai.INVALID_PARAMS,"phoneCode or password must be a string"),o||(o=Ri),r=this._cache.keys.refreshTokenKey,[4,this._request.send("auth.signIn",{loginType:pn.PHONE,phoneNumber:Ii(t),phoneCode:n,password:i,refresh_token:this._cache.getStore(r)||"",signMethod:o})];case 1:return a=p.sent(),s=a.refresh_token,c=a.access_token,u=a.access_token_expire,s?[4,this.setRefreshToken(s)]:[3,8];case 2:return p.sent(),c&&u?[4,this.setAccessToken(c,u)]:[3,4];case 3:return p.sent(),[3,6];case 4:return[4,this._request.refreshAccessToken()];case 5:p.sent(),p.label=6;case 6:return[4,this.refreshUserInfo()];case 7:return p.sent(),Ki.fire(Xi.LOGIN_STATE_CHANGED),Ki.fire(Xi.LOGIN_TYPE_CHANGED,{env:this._config.env,loginType:pn.PHONE,persistence:this._config.persistence}),[2,new Ji({envId:this._config.env,cache:this._cache,request:this._request})];case 8:a.code?Si(Ai.OPERATION_FAIL,"Phone login fail["+a.code+"] "+a.message):Si(Ai.OPERATION_FAIL,"Phone login fail"),p.label=9;case 9:return[2]}}))}))},t.prototype.signUp=function(e,t,n){return _i(this,void 0,void 0,(function(){return Ei(this,(function(i){return[2,this.signIn({phoneNumber:e,phoneCode:t,password:n,signMethod:ki})]}))}))},t.prototype.forceResetPwd=function(e,t,n){return _i(this,void 0,void 0,(function(){return Ei(this,(function(i){return[2,this.signIn({phoneNumber:e,phoneCode:t,password:n,signMethod:ji})]}))}))},xi([Ni({title:"手机号登录失败",messages:["请确认以下各项:"," 1 - 调用 auth().SmsAuthProvider() 的语法或参数是否正确"," 2 - 当前环境是否开通了短信验证码登录"," 3 - 短信验证码/密码是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+Ti]}),wi("design:type",Function),wi("design:paramtypes",[Object]),wi("design:returntype",Promise)],t.prototype,"signIn",null),xi([Ni({title:"手机短信注册失败",messages:["请确认以下各项:"," 1 - 调用 auth().signUpWithPhoneCode() 的语法或参数是否正确"," 2 - 当前环境是否开通了短信验证码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+Ti]}),wi("design:type",Function),wi("design:paramtypes",[String,String,String]),wi("design:returntype",Promise)],t.prototype,"signUp",null),xi([Ni({title:"手机密码重置失败",messages:["请确认以下各项:"," 1 - 调用 auth().forceResetPwd() 的语法或参数是否正确"," 2 - 当前环境是否开通了短信验证码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+Ti]}),wi("design:type",Function),wi("design:paramtypes",[String,String,String]),wi("design:returntype",Promise)],t.prototype,"forceResetPwd",null),t}(fn),Pi=function(){return Pi=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Pi.apply(this,arguments)},Li=function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},Ui=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Di=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},qi=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},Mi=Ye.CloudbaseEventEmitter,Fi=Ge.RUNTIME,Bi=Ze.printWarn,Wi=Ze.throwError,zi=Ze.transformPhone,Hi=He.ERRORS,$i=He.COMMUNITY_SITE_URL,Gi=We.catchErrorsDecorator,Ki=new Mi,Vi=function(){function e(e){var t=e.cache,n=e.request;this._cache=t,this._request=n,this._setUserInfo()}return e.prototype.checkLocalInfo=function(){return Di(this,void 0,void 0,(function(){return qi(this,(function(e){return this.uid=this._getLocalUserInfo("uid"),this.loginType=this._getLocalUserInfo("loginType"),this.openid=this._getLocalUserInfo("wxOpenId"),this.wxOpenId=this._getLocalUserInfo("wxOpenId"),this.wxPublicId=this._getLocalUserInfo("wxPublicId"),this.unionId=this._getLocalUserInfo("wxUnionId"),this.qqMiniOpenId=this._getLocalUserInfo("qqMiniOpenId"),this.customUserId=this._getLocalUserInfo("customUserId"),this.nickName=this._getLocalUserInfo("nickName"),this.gender=this._getLocalUserInfo("gender"),this.avatarUrl=this._getLocalUserInfo("avatarUrl"),this.email=this._getLocalUserInfo("email"),this.hasPassword=Boolean(this._getLocalUserInfo("hasPassword")),this.phone=this._getLocalUserInfo("phone"),this.username=this._getLocalUserInfo("username"),this.location={country:this._getLocalUserInfo("country"),province:this._getLocalUserInfo("province"),city:this._getLocalUserInfo("city")},[2]}))}))},e.prototype.checkLocalInfoAsync=function(){return Di(this,void 0,void 0,(function(){var e,t,n,i,o,r,a,s,c,u,p,l,d,f,h,m,v,g;return qi(this,(function(y){switch(y.label){case 0:return e=this,[4,this._getLocalUserInfoAsync("uid")];case 1:return e.uid=y.sent(),t=this,[4,this._getLocalUserInfoAsync("loginType")];case 2:return t.loginType=y.sent(),n=this,[4,this._getLocalUserInfoAsync("wxOpenId")];case 3:return n.openid=y.sent(),i=this,[4,this._getLocalUserInfoAsync("wxOpenId")];case 4:return i.wxOpenId=y.sent(),o=this,[4,this._getLocalUserInfoAsync("wxPublicId")];case 5:return o.wxPublicId=y.sent(),r=this,[4,this._getLocalUserInfoAsync("wxUnionId")];case 6:return r.unionId=y.sent(),a=this,[4,this._getLocalUserInfoAsync("qqMiniOpenId")];case 7:return a.qqMiniOpenId=y.sent(),s=this,[4,this._getLocalUserInfoAsync("customUserId")];case 8:return s.customUserId=y.sent(),c=this,[4,this._getLocalUserInfoAsync("nickName")];case 9:return c.nickName=y.sent(),u=this,[4,this._getLocalUserInfoAsync("gender")];case 10:return u.gender=y.sent(),p=this,[4,this._getLocalUserInfoAsync("avatarUrl")];case 11:return p.avatarUrl=y.sent(),l=this,[4,this._getLocalUserInfoAsync("email")];case 12:return l.email=y.sent(),d=this,f=Boolean,[4,this._getLocalUserInfoAsync("hasPassword")];case 13:return d.hasPassword=f.apply(void 0,[y.sent()]),h=this,[4,this._getLocalUserInfoAsync("phone")];case 14:return h.phone=y.sent(),m=this,[4,this._getLocalUserInfoAsync("username")];case 15:return m.username=y.sent(),v=this,g={},[4,this._getLocalUserInfoAsync("country")];case 16:return g.country=y.sent(),[4,this._getLocalUserInfoAsync("province")];case 17:return g.province=y.sent(),[4,this._getLocalUserInfoAsync("city")];case 18:return v.location=(g.city=y.sent(),g),[2]}}))}))},e.prototype.linkWithTicket=function(e){if("string"!=typeof e)throw new Error("ticket must be string");return this._request.send("auth.linkWithTicket",{ticket:e})},e.prototype.linkWithRedirect=function(e){e.signInWithRedirect()},e.prototype.getLinkedUidList=function(){return Di(this,void 0,void 0,(function(){var e,t,n,i,o,r;return qi(this,(function(a){switch(a.label){case 0:return[4,this._request.send("auth.getLinkedUidList",{})];case 1:for(e=a.sent().data,t=!1,n=e.users,i=0,o=n;i<o.length;i++)if((r=o[i]).wxOpenId&&r.wxPublicId){t=!0;break}return[2,{users:n,hasPrimaryUid:t}]}}))}))},e.prototype.setPrimaryUid=function(e){return this._request.send("auth.setPrimaryUid",{uid:e})},e.prototype.unlink=function(e){return this._request.send("auth.unlink",{platform:e})},e.prototype.update=function(e){return Di(this,void 0,void 0,(function(){var t,n,i,o,r,a,s;return qi(this,(function(c){switch(c.label){case 0:return t=e.nickName,n=e.gender,i=e.avatarUrl,o=e.province,r=e.country,a=e.city,[4,this._request.send("auth.updateUserInfo",{nickName:t,gender:n,avatarUrl:i,province:o,country:r,city:a})];case 1:return s=c.sent().data,this._setLocalUserInfo(s),[2]}}))}))},e.prototype.updatePassword=function(e,t){return this._request.send("auth.updatePassword",{oldPassword:t,newPassword:e})},e.prototype.updateEmail=function(e,t){return this._request.send("auth.updateEmail",{newEmail:e,password:t})},e.prototype.updateUsername=function(e){return"string"!=typeof e&&Wi(Hi.INVALID_PARAMS,"username must be a string"),this._request.send("auth.updateUsername",{username:e})},e.prototype.refresh=function(){return Di(this,void 0,void 0,(function(){var e;return qi(this,(function(t){switch(t.label){case 0:return"auth.getUserInfo",[4,this._request.send("auth.getUserInfo",{})];case 1:return e=t.sent().data,this._setLocalUserInfo(e),[2,e]}}))}))},e.prototype.linkWithPhoneNumber=function(e,t){return Di(this,void 0,void 0,(function(){return qi(this,(function(n){return[2,this._request.send("auth.linkOrUpdatePhoneNumber",{phoneNumber:zi(e),phoneCode:t})]}))}))},e.prototype.updatePhoneNumber=function(e,t){return Di(this,void 0,void 0,(function(){return qi(this,(function(n){return[2,this._request.send("auth.linkOrUpdatePhoneNumber",{phoneNumber:zi(e),phoneCode:t})]}))}))},e.prototype._getLocalUserInfo=function(e){var t=this._cache.keys.userInfoKey;return this._cache.getStore(t)[e]},e.prototype._getLocalUserInfoAsync=function(e){return Di(this,void 0,void 0,(function(){var t;return qi(this,(function(n){switch(n.label){case 0:return t=this._cache.keys.userInfoKey,[4,this._cache.getStoreAsync(t)];case 1:return[2,n.sent()[e]]}}))}))},e.prototype._setUserInfo=function(){var e=this,t=this._cache.keys.userInfoKey,n=this._cache.getStore(t);["uid","loginType","openid","wxOpenId","wxPublicId","unionId","qqMiniOpenId","email","hasPassword","customUserId","nickName","gender","avatarUrl","phone","username"].forEach((function(t){e[t]=n[t]})),this.location={country:n.country,province:n.province,city:n.city}},e.prototype._setLocalUserInfo=function(e){var t=this._cache.keys.userInfoKey;this._cache.setStore(t,e),this._setUserInfo()},Li([Gi({title:"绑定自定义登录失败",messages:["请确认以下各项:"," 1 - 调用 User.linkWithTicket() 的语法或参数是否正确"," 2 - 此账户是否已经绑定自定义登录"," 3 - ticket 参数是否归属当前环境"," 4 - 创建 ticket 的自定义登录私钥是否过期","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+$i]}),Ui("design:type",Function),Ui("design:paramtypes",[String]),Ui("design:returntype",Promise)],e.prototype,"linkWithTicket",null),Li([Gi({title:"绑定第三方登录方式失败",messages:["请确认以下各项:"," 1 - 调用 User.linkWithRedirect() 的语法或参数是否正确"," 2 - 此账户是否已经绑定此第三方"," 3 - 此第三方是否已经授权","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+$i]}),Ui("design:type",Function),Ui("design:paramtypes",[Object]),Ui("design:returntype",void 0)],e.prototype,"linkWithRedirect",null),Li([Gi({title:"获取账户列表失败",messages:["请确认以下各项:"," 1 - 调用 User.getLinkedUidList() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+$i]}),Ui("design:type",Function),Ui("design:paramtypes",[]),Ui("design:returntype",Promise)],e.prototype,"getLinkedUidList",null),Li([Gi({title:"设置微信主账号失败",messages:["请确认以下各项:"," 1 - 调用 User.setPrimaryUid() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+$i]}),Ui("design:type",Function),Ui("design:paramtypes",[String]),Ui("design:returntype",void 0)],e.prototype,"setPrimaryUid",null),Li([Gi({title:"接触绑定失败",messages:["请确认以下各项:"," 1 - 调用 User.unlink() 的语法或参数是否正确"," 2 - 当前账户是否已经与此登录方式解绑","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+$i]}),Ui("design:type",Function),Ui("design:paramtypes",[String]),Ui("design:returntype",void 0)],e.prototype,"unlink",null),Li([Gi({title:"更新用户信息失败",messages:["请确认以下各项:"," 1 - 调用 User.update() 的语法或参数是否正确"," 2 - 用户信息中是否包含非法值","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+$i]}),Ui("design:type",Function),Ui("design:paramtypes",[Object]),Ui("design:returntype",Promise)],e.prototype,"update",null),Li([Gi({title:"更新密码失败",messages:["请确认以下各项:"," 1 - 调用 User.updatePassword() 的语法或参数是否正确"," 3 - 新密码中是否包含非法字符","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+$i]}),Ui("design:type",Function),Ui("design:paramtypes",[String,String]),Ui("design:returntype",void 0)],e.prototype,"updatePassword",null),Li([Gi({title:"更新邮箱地址失败",messages:["请确认以下各项:"," 1 - 调用 User.updateEmail() 的语法或参数是否正确"," 2 - 当前环境是否开通了邮箱密码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+$i]}),Ui("design:type",Function),Ui("design:paramtypes",[String,String]),Ui("design:returntype",void 0)],e.prototype,"updateEmail",null),Li([Gi({title:"更新用户名失败",messages:["请确认以下各项:"," 1 - 调用 User.updateUsername() 的语法或参数是否正确"," 2 - 当前环境是否开通了用户名密码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+$i]}),Ui("design:type",Function),Ui("design:paramtypes",[String]),Ui("design:returntype",void 0)],e.prototype,"updateUsername",null),Li([Gi({title:"刷新本地用户信息失败",messages:["请确认以下各项:"," 1 - 调用 User.refresh() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+$i]}),Ui("design:type",Function),Ui("design:paramtypes",[]),Ui("design:returntype",Promise)],e.prototype,"refresh",null),Li([Gi({title:"绑定手机号失败",messages:["请确认以下各项:"," 1 - 调用 auth().linkWithPhoneNumber() 的语法或参数是否正确"," 2 - 当前环境是否开通了短信验证码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+$i]}),Ui("design:type",Function),Ui("design:paramtypes",[String,String]),Ui("design:returntype",Promise)],e.prototype,"linkWithPhoneNumber",null),Li([Gi({title:"更新手机号失败",messages:["请确认以下各项:"," 1 - 调用语法或参数是否正确"," 2 - 当前环境是否开通了短信验证码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+$i]}),Ui("design:type",Function),Ui("design:paramtypes",[String,String]),Ui("design:returntype",Promise)],e.prototype,"updatePhoneNumber",null),e}(),Ji=function(){function e(e){var t=e.envId,n=e.cache,i=e.request;t||Wi(Hi.INVALID_PARAMS,"envId is not defined"),this._cache=n,this.user=new Vi({cache:n,request:i})}return e.prototype.checkLocalState=function(){return Di(this,void 0,void 0,(function(){var e,t,n,i,o,r,a;return qi(this,(function(s){return e=this._cache.keys,t=e.refreshTokenKey,n=e.accessTokenKey,i=e.accessTokenExpireKey,o=this._cache.getStore(t),r=this._cache.getStore(n),a=this._cache.getStore(i),this.credential={refreshToken:o,accessToken:r,accessTokenExpire:a},this._loginType=this._cache.getStore(this._cache.keys.loginTypeKey),this.user.checkLocalInfo(),[2]}))}))},e.prototype.checkLocalStateAsync=function(){return Di(this,void 0,void 0,(function(){var e,t,n,i,o,r,a,s;return qi(this,(function(c){switch(c.label){case 0:return e=this._cache.keys,t=e.refreshTokenKey,n=e.accessTokenKey,i=e.accessTokenExpireKey,[4,this._cache.getStoreAsync(t)];case 1:return o=c.sent(),[4,this._cache.getStoreAsync(n)];case 2:return r=c.sent(),[4,this._cache.getStoreAsync(i)];case 3:return a=c.sent(),this.credential={refreshToken:o,accessToken:r,accessTokenExpire:a},s=this,[4,this._cache.getStoreAsync(this._cache.keys.loginTypeKey)];case 4:return s._loginType=c.sent(),[4,this.user.checkLocalInfoAsync()];case 5:return c.sent(),[2]}}))}))},Object.defineProperty(e.prototype,"isAnonymousAuth",{get:function(){return this.loginType===pn.ANONYMOUS},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isCustomAuth",{get:function(){return this.loginType===pn.CUSTOM},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isWeixinAuth",{get:function(){return this.loginType===pn.WECHAT||this.loginType===pn.WECHAT_OPEN||this.loginType===pn.WECHAT_PUBLIC},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isUsernameAuth",{get:function(){return this.loginType===pn.USERNAME},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loginType",{get:function(){return this._loginType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isPhoneAuth",{get:function(){return this.loginType===pn.PHONE},enumerable:!1,configurable:!0}),e}(),Yi=function(){function e(e){this._config=e,this._cache=e.cache,this._request=e.request,this._runtime=e.runtime||Fi.WEB,Ki.on(Xi.LOGIN_TYPE_CHANGED,this._onLoginTypeChanged.bind(this))}return Object.defineProperty(e.prototype,"currentUser",{get:function(){if("async"!==this._cache.mode){var e=this.hasLoginState();return e&&e.user||null}Bi(Hi.INVALID_OPERATION,"current platform's storage is asynchronous, please use getCurrenUser insteed")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loginType",{get:function(){return this._cache.getStore(this._cache.keys.loginTypeKey)},enumerable:!1,configurable:!0}),e.prototype.getCurrenUser=function(){return Di(this,void 0,void 0,(function(){var e;return qi(this,(function(t){switch(t.label){case 0:return[4,this.getLoginState()];case 1:return(e=t.sent())?[4,e.user.checkLocalInfoAsync()]:[3,3];case 2:return t.sent(),[2,e.user||null];case 3:return[2,null]}}))}))},e.prototype.getLoginType=function(){return Di(this,void 0,void 0,(function(){return qi(this,(function(e){switch(e.label){case 0:return[4,this._cache.getStoreAsync(this._cache.keys.loginTypeKey)];case 1:return[2,e.sent()]}}))}))},e.prototype.getAccessToken=function(){return Di(this,void 0,void 0,(function(){var e;return qi(this,(function(t){switch(t.label){case 0:return e={},[4,this._request.getAccessToken()];case 1:return[2,(e.accessToken=t.sent().accessToken,e.env=this._config.env,e)]}}))}))},e.prototype.weixinAuthProvider=function(e){var t=e.appid,n=e.scope,i=e.state;return this._weixinAuthProvider||(this._weixinAuthProvider=new Tn(Pi(Pi({},this._config),{cache:this._cache,request:this._request,runtime:this._runtime}),t,n,i)),this._weixinAuthProvider},e.prototype.anonymousAuthProvider=function(){return this._anonymousAuthProvider||(this._anonymousAuthProvider=new Bn(Pi(Pi({},this._config),{cache:this._cache,request:this._request}))),this._anonymousAuthProvider},e.prototype.customAuthProvider=function(){return this._customAuthProvider||(this._customAuthProvider=new Xn(Pi(Pi({},this._config),{cache:this._cache,request:this._request}))),this._customAuthProvider},e.prototype.emailAuthProvider=function(){return this._emailAuthProvider||(this._emailAuthProvider=new ci(Pi(Pi({},this._config),{cache:this._cache,request:this._request}))),this._emailAuthProvider},e.prototype.usernameAuthProvider=function(){return this._usernameAuthProvider||(this._usernameAuthProvider=new yi(Pi(Pi({},this._config),{cache:this._cache,request:this._request}))),this._usernameAuthProvider},e.prototype.phoneAuthProvider=function(){return this._phoneAuthProvider||(this._phoneAuthProvider=new Ci(Pi(Pi({},this._config),{cache:this._cache,request:this._request}))),this._phoneAuthProvider},e.prototype.signInWithUsernameAndPassword=function(e,t){return Di(this,void 0,void 0,(function(){return qi(this,(function(n){return[2,this.usernameAuthProvider().signIn(e,t)]}))}))},e.prototype.isUsernameRegistered=function(e){return Di(this,void 0,void 0,(function(){var t;return qi(this,(function(n){switch(n.label){case 0:return"string"!=typeof e&&Wi(Hi.INVALID_PARAMS,"username must be a string"),[4,this._request.send("auth.isUsernameRegistered",{username:e})];case 1:return[2,null==(t=n.sent().data)?void 0:t.isRegistered]}}))}))},e.prototype.signInWithEmailAndPassword=function(e,t){return Di(this,void 0,void 0,(function(){return qi(this,(function(n){return[2,this.emailAuthProvider().signIn(e,t)]}))}))},e.prototype.signUpWithEmailAndPassword=function(e,t){return Di(this,void 0,void 0,(function(){return qi(this,(function(n){return[2,this.emailAuthProvider().signUp(e,t)]}))}))},e.prototype.sendPasswordResetEmail=function(e){return Di(this,void 0,void 0,(function(){return qi(this,(function(t){return[2,this.emailAuthProvider().resetPassword(e)]}))}))},e.prototype.signOut=function(){return Di(this,void 0,void 0,(function(){var e,t,n,i,o,r,a;return qi(this,(function(s){switch(s.label){case 0:return e=this._cache.keys,t=e.refreshTokenKey,n=e.accessTokenKey,i=e.accessTokenExpireKey,o="auth.logout",[4,this._cache.getStoreAsync(t)];case 1:return(r=s.sent())?[4,this._request.send(o,{refresh_token:r})]:[2];case 2:return a=s.sent(),this._cache.removeStoreAsync(t),this._cache.removeStoreAsync(n),this._cache.removeStoreAsync(i),Ki.fire(Xi.LOGIN_STATE_CHANGED),Ki.fire(Xi.LOGIN_TYPE_CHANGED,{env:this._config.env,loginType:pn.NULL,persistence:this._config.persistence}),[2,a]}}))}))},e.prototype.onLoginStateChanged=function(e){return Di(this,void 0,void 0,(function(){var t,n=this;return qi(this,(function(i){switch(i.label){case 0:return Ki.on(Xi.LOGIN_STATE_CHANGED,(function(){return Di(n,void 0,void 0,(function(){var t;return qi(this,(function(n){switch(n.label){case 0:return[4,this.getLoginState()];case 1:return t=n.sent(),e.call(this,t),[2]}}))}))})),[4,this.getLoginState()];case 1:return t=i.sent(),e.call(this,t),[2]}}))}))},e.prototype.onLoginStateExpired=function(e){Ki.on(Xi.LOGIN_STATE_EXPIRED,e.bind(this))},e.prototype.onAccessTokenRefreshed=function(e){Ki.on(Xi.ACCESS_TOKEN_REFRESHD,e.bind(this))},e.prototype.onAnonymousConverted=function(e){Ki.on(Xi.ANONYMOUS_CONVERTED,e.bind(this))},e.prototype.onLoginTypeChanged=function(e){var t=this;Ki.on(Xi.LOGIN_TYPE_CHANGED,(function(){return Di(t,void 0,void 0,(function(){var t;return qi(this,(function(n){switch(n.label){case 0:return[4,this.getLoginState()];case 1:return t=n.sent(),e.call(this,t),[2]}}))}))}))},e.prototype.hasLoginState=function(){if("async"!==this._cache.mode){var e=this._cache.keys.refreshTokenKey;if(this._cache.getStore(e)){var t=new Ji({envId:this._config.env,cache:this._cache,request:this._request});return t.checkLocalState(),t}return null}Bi(Hi.INVALID_OPERATION,"current platform's storage is asynchronous, please use getLoginState insteed")},e.prototype.getLoginState=function(){return Di(this,void 0,void 0,(function(){var e,t;return qi(this,(function(n){switch(n.label){case 0:return e=this._cache.keys.refreshTokenKey,[4,this._cache.getStoreAsync(e)];case 1:return n.sent()?[4,(t=new Ji({envId:this._config.env,cache:this._cache,request:this._request})).checkLocalStateAsync()]:[3,3];case 2:return n.sent(),[2,t];case 3:return[2,null]}}))}))},e.prototype.shouldRefreshAccessToken=function(e){this._request._shouldRefreshAccessTokenHook=e.bind(this)},e.prototype.getUserInfo=function(){return Di(this,void 0,void 0,(function(){var e;return qi(this,(function(t){switch(t.label){case 0:return"auth.getUserInfo",[4,this._request.send("auth.getUserInfo",{})];case 1:return(e=t.sent()).code?[2,e]:[2,Pi(Pi({},e.data),{requestId:e.seqId})]}}))}))},e.prototype.getAuthHeader=function(){var e=this._cache.keys,t=e.refreshTokenKey,n=e.accessTokenKey,i=this._cache.getStore(t);return{"x-cloudbase-credentials":this._cache.getStore(n)+"/@@/"+i}},e.prototype.getAuthHeaderAsync=function(){return Di(this,void 0,void 0,(function(){var e,t,n,i;return qi(this,(function(o){switch(o.label){case 0:return[4,this._request.refreshAccessToken()];case 1:return o.sent(),e=this._cache.keys,t=e.refreshTokenKey,n=e.accessTokenKey,[4,this._cache.getStoreAsync(t)];case 2:return i=o.sent(),[4,this._cache.getStoreAsync(n)];case 3:return[2,{"x-cloudbase-credentials":o.sent()+"/@@/"+i}]}}))}))},e.prototype.sendPhoneCode=function(e){return Di(this,void 0,void 0,(function(){return qi(this,(function(t){switch(t.label){case 0:return[4,this._request.send("auth.sendPhoneCode",{phoneNumber:zi(e)})];case 1:return[2,"Ok"===t.sent().data.SendStatus]}}))}))},e.prototype.signUpWithPhoneCode=function(e,t,n){return Di(this,void 0,void 0,(function(){return qi(this,(function(i){return[2,this.phoneAuthProvider().signUp(e,t,n)]}))}))},e.prototype.signInWithPhoneCodeOrPassword=function(e){return Di(this,void 0,void 0,(function(){return qi(this,(function(t){return[2,this.phoneAuthProvider().signIn(e)]}))}))},e.prototype.forceResetPwdByPhoneCode=function(e){return Di(this,void 0,void 0,(function(){return qi(this,(function(t){return[2,this.phoneAuthProvider().signIn(Pi(Pi({},e),{signMethod:ji}))]}))}))},e.prototype._onLoginTypeChanged=function(e){return Di(this,void 0,void 0,(function(){var t,n,i;return qi(this,(function(o){switch(o.label){case 0:return t=e.data,n=t.loginType,i=t.persistence,t.env!==this._config.env?[2]:[4,this._cache.updatePersistenceAsync(i)];case 1:return o.sent(),[4,this._cache.setStoreAsync(this._cache.keys.loginTypeKey,n)];case 2:return o.sent(),[2]}}))}))},Li([Gi({title:"获取用户信息失败",messages:["请确认以下各项:"," 1 - 调用 auth().getCurrenUser() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+$i]}),Ui("design:type",Function),Ui("design:paramtypes",[]),Ui("design:returntype",Promise)],e.prototype,"getCurrenUser",null),Li([Gi({title:"获取用户是否被占用失败",messages:["请确认以下各项:"," 1 - 调用 auth().isUsernameRegistered() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+$i]}),Ui("design:type",Function),Ui("design:paramtypes",[String]),Ui("design:returntype",Promise)],e.prototype,"isUsernameRegistered",null),Li([Gi({title:"用户登出失败",messages:["请确认以下各项:"," 1 - 调用 auth().signOut() 的语法或参数是否正确"," 2 - 当前用户是否为匿名登录(匿名登录不支持signOut)","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+$i]}),Ui("design:type",Function),Ui("design:paramtypes",[]),Ui("design:returntype",Promise)],e.prototype,"signOut",null),Li([Gi({title:"获取本地登录态失败",messages:["请确认以下各项:"," 1 - 调用 auth().getLoginState() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+$i]}),Ui("design:type",Function),Ui("design:paramtypes",[]),Ui("design:returntype",Promise)],e.prototype,"getLoginState",null),Li([Gi({title:"获取用户信息失败",messages:["请确认以下各项:"," 1 - 是否已登录"," 2 - 调用 auth().getUserInfo() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+$i]}),Ui("design:type",Function),Ui("design:paramtypes",[]),Ui("design:returntype",Promise)],e.prototype,"getUserInfo",null),Li([Gi({title:"发送短信验证码失败",messages:["请确认以下各项:"," 1 - 调用语法或参数是否正确"," 2 - 当前环境是否开通了短信验证码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+$i]}),Ui("design:type",Function),Ui("design:paramtypes",[String]),Ui("design:returntype",Promise)],e.prototype,"sendPhoneCode",null),e}(),Xi={LOGIN_STATE_CHANGED:"loginStateChanged",LOGIN_STATE_EXPIRED:"loginStateExpire",LOGIN_TYPE_CHANGED:"loginTypeChanged",ANONYMOUS_CONVERTED:"anonymousConverted",ACCESS_TOKEN_REFRESHD:"refreshAccessToken"},Zi={name:"auth",namespace:"auth",injectEvents:{bus:Ki,events:[Xi.LOGIN_TYPE_CHANGED,Xi.LOGIN_STATE_EXPIRED,Xi.LOGIN_STATE_CHANGED,Xi.ACCESS_TOKEN_REFRESHD,Xi.ANONYMOUS_CONVERTED]},entity:function(e){if(void 0===e&&(e={region:"",persistence:"local"}),this.authInstance)return Bi(Hi.INVALID_OPERATION,"every cloudbase instance should has only one auth object"),this.authInstance;var t=this.platform,n=t.adapter,i=t.runtime,o=e.persistence||n.primaryStorage;o&&o!==this.config.persistence&&this.updateConfig({persistence:o});var r=this.config,a=r.env,s=r.persistence,c=r.debug;return this.authInstance=new Yi({env:a,region:e.region,persistence:s,debug:c,cache:this.cache,request:this.request,runtime:i}),this.authInstance}};try{cloudbase.registerComponent(Zi)}catch(e){}var Qi=function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},eo=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},to=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},no=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},io=He.getSdkName,oo=He.ERRORS,ro=He.COMMUNITY_SITE_URL,ao=Ze.execCallback,so=We.catchErrorsDecorator,co="functions",uo=function(){function e(){}return e.prototype.callFunction=function(e,t){return to(this,void 0,void 0,(function(){var n,i,o,r,a,s,c,u,p,l,d,f;return no(this,(function(h){switch(h.label){case 0:if(n=e.name,i=e.data,o=e.query,r=e.parse,a=e.search,!n)throw new Error(JSON.stringify({code:oo.INVALID_PARAMS,msg:"["+co+".callFunction] invalid function name"}));try{s=i?JSON.stringify(i):""}catch(e){throw new Error(JSON.stringify({code:oo.INVALID_PARAMS,msg:"["+co+".callFunction] invalid data"}))}c="functions.invokeFunction",u={inQuery:o,parse:r,search:a,function_name:n,request_data:s},p=this.request,h.label=1;case 1:return h.trys.push([1,3,,4]),[4,p.send(c,u)];case 2:if((l=h.sent()).code)return[2,ao(t,null,l)];if(d=l.data.response_data,r)return[2,ao(t,null,{result:d,requestId:l.requestId})];try{return d=JSON.parse(l.data.response_data),[2,ao(t,null,{result:d,requestId:l.requestId})]}catch(e){ao(t,new Error("["+io()+"]["+oo.INVALID_PARAMS+"]["+co+".callFunction] response data must be json"))}return[3,4];case 3:return f=h.sent(),ao(t,f),[3,4];case 4:return[2]}}))}))},Qi([so({customInfo:{className:"Cloudbase",methodName:"callFunction"},title:"函数调用失败",messages:["请确认以下各项:"," 1 - 调用 callFunction() 的语法或参数是否正确"," 2 - 当前环境下是否存在此函数"," 3 - 函数安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+ro]}),eo("design:type",Function),eo("design:paramtypes",[Object,Function]),eo("design:returntype",Promise)],e.prototype,"callFunction",null),e}(),po=new uo,lo={name:co,entity:{callFunction:po.callFunction}};try{cloudbase.registerComponent(lo)}catch(e){}var fo=function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},ho=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},mo=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},vo=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},go=He.getSdkName,yo=He.ERRORS,bo=He.COMMUNITY_SITE_URL,xo=Ze.isArray,wo=Ze.isString,_o=Ze.isPalinObject,Eo=Ze.execCallback,So=We.catchErrorsDecorator,Oo="storage",Io=function(){function e(){}return e.prototype.uploadFile=function(e,t){return mo(this,void 0,void 0,(function(){var n,i,o,r,a,s,c,u,p,l,d,f,h,m,v;return vo(this,(function(g){switch(g.label){case 0:if(n=e.cloudPath,i=e.filePath,o=e.onUploadProgress,!wo(n)||!i)throw new Error(JSON.stringify({code:yo.INVALID_PARAMS,msg:"["+Oo+".uploadFile] invalid params"}));return"storage.getUploadMetadata",[4,(r=this.request).send("storage.getUploadMetadata",{path:n})];case 1:return a=g.sent(),s=a.data,c=s.url,u=s.authorization,p=s.token,l=s.fileId,d=s.cosFileId,f=s.download_url,h=a.requestId,m={key:n,signature:u,"x-cos-meta-fileid":d,success_action_status:"201","x-cos-security-token":p},[4,r.upload({url:c,data:m,file:i,name:n,onUploadProgress:o})];case 2:return 201===(v=g.sent()).statusCode?[2,Eo(t,null,{fileID:l,download_url:f,requestId:h})]:[2,Eo(t,new Error("["+go()+"]["+yo.OPERATION_FAIL+"]["+Oo+"]:"+v.data))]}}))}))},e.prototype.getUploadMetadata=function(e,t){return mo(this,void 0,void 0,(function(){var n,i,o,r,a;return vo(this,(function(s){switch(s.label){case 0:if(n=e.cloudPath,!wo(n))throw new Error(JSON.stringify({code:yo.INVALID_PARAMS,msg:"["+Oo+".getUploadMetadata] invalid cloudPath"}));i=this.request,o="storage.getUploadMetadata",s.label=1;case 1:return s.trys.push([1,3,,4]),[4,i.send(o,{path:n})];case 2:return r=s.sent(),[2,Eo(t,null,r)];case 3:return a=s.sent(),[2,Eo(t,a)];case 4:return[2]}}))}))},e.prototype.deleteFile=function(e,t){return mo(this,void 0,void 0,(function(){var n,i,o,r,a,s;return vo(this,(function(c){switch(c.label){case 0:if(!(n=e.fileList)||!xo(n)||0===n.length)throw new Error(JSON.stringify({code:yo.INVALID_PARAMS,msg:"["+Oo+".deleteFile] fileList must not be empty"}));for(i=0,o=n;i<o.length;i++)if(!(r=o[i])||!wo(r))throw new Error(JSON.stringify({code:yo.INVALID_PARAMS,msg:"["+Oo+".deleteFile] fileID must be string"}));return"storage.batchDeleteFile",[4,this.request.send("storage.batchDeleteFile",{fileid_list:n})];case 1:return(a=c.sent()).code?[2,Eo(t,null,a)]:(s={fileList:a.data.delete_list,requestId:a.requestId},[2,Eo(t,null,s)])}}))}))},e.prototype.getTempFileURL=function(e,t){return mo(this,void 0,void 0,(function(){var n,i,o,r,a,s;return vo(this,(function(c){switch(c.label){case 0:if(!(n=e.fileList)||!xo(n)||0===n.length)throw new Error(JSON.stringify({code:yo.INVALID_PARAMS,msg:"["+Oo+".getTempFileURL] fileList must not be empty"}));for(i=[],o=0,r=n;o<r.length;o++)if(a=r[o],_o(a)){if(!a.hasOwnProperty("fileID")||!a.hasOwnProperty("maxAge"))throw new Error(JSON.stringify({code:yo.INVALID_PARAMS,msg:"["+Oo+".getTempFileURL] file info must include fileID and maxAge"}));i.push({fileid:a.fileID,max_age:a.maxAge})}else{if(!wo(a))throw new Error(JSON.stringify({code:yo.INVALID_PARAMS,msg:"["+Oo+".getTempFileURL] invalid fileList"}));i.push({fileid:a})}return"storage.batchGetDownloadUrl",[4,this.request.send("storage.batchGetDownloadUrl",{file_list:i})];case 1:return(s=c.sent()).code?[2,Eo(t,null,s)]:[2,Eo(t,null,{fileList:s.data.download_list,requestId:s.requestId})]}}))}))},e.prototype.downloadFile=function(e,t){return mo(this,void 0,void 0,(function(){var n,i,o,r,a,s;return vo(this,(function(c){switch(c.label){case 0:if(n=e.fileID,!wo(n))throw new Error(JSON.stringify({code:yo.INVALID_PARAMS,msg:"["+Oo+".getTempFileURL] fileID must be string"}));return[4,this.getTempFileURL.call(this,{fileList:[{fileID:n,maxAge:600}]})];case 1:return i=c.sent(),"SUCCESS"!==(o=i.fileList[0]).code?[2,Eo(t,o)]:(r=this.request,a=encodeURI(o.download_url),[4,r.download({url:a})]);case 2:return s=c.sent(),[2,Eo(t,null,s)]}}))}))},fo([So({customInfo:{className:"Cloudbase",methodName:"uploadFile"},title:"上传文件失败",messages:["请确认以下各项:"," 1 - 调用 uploadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+bo]}),ho("design:type",Function),ho("design:paramtypes",[Object,Function]),ho("design:returntype",Promise)],e.prototype,"uploadFile",null),fo([So({customInfo:{className:"Cloudbase",methodName:"getUploadMetadata"},title:"获取上传元信息失败",messages:["请确认以下各项:"," 1 - 调用 getUploadMetadata() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+bo]}),ho("design:type",Function),ho("design:paramtypes",[Object,Function]),ho("design:returntype",Promise)],e.prototype,"getUploadMetadata",null),fo([So({customInfo:{className:"Cloudbase",methodName:"deleteFile"},title:"删除文件失败",messages:["请确认以下各项:"," 1 - 调用 deleteFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+bo]}),ho("design:type",Function),ho("design:paramtypes",[Object,Function]),ho("design:returntype",Promise)],e.prototype,"deleteFile",null),fo([So({customInfo:{className:"Cloudbase",methodName:"getTempFileURL"},title:"获取文件下载链接",messages:["请确认以下各项:"," 1 - 调用 getTempFileURL() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+bo]}),ho("design:type",Function),ho("design:paramtypes",[Object,Function]),ho("design:returntype",Promise)],e.prototype,"getTempFileURL",null),fo([So({customInfo:{className:"Cloudbase",methodName:"downloadFile"},title:"下载文件失败",messages:["请确认以下各项:"," 1 - 调用 downloadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+bo]}),ho("design:type",Function),ho("design:paramtypes",[Object,Function]),ho("design:returntype",Promise)],e.prototype,"downloadFile",null),e}(),Ao=new Io,To={name:Oo,entity:{uploadFile:Ao.uploadFile,deleteFile:Ao.deleteFile,getTempFileURL:Ao.getTempFileURL,downloadFile:Ao.downloadFile,getUploadMetadata:Ao.getUploadMetadata}};try{cloudbase.registerComponent(To)}catch(e){}var No="__lodash_hash_undefined__",Ro=1/0,ko=9007199254740991,jo="[object Function]",Co="[object GeneratorFunction]",Po="[object Symbol]",Lo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Uo=/^\w*$/,Do=/^\./,qo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Mo=/\\(\\)?/g,Fo=/^\[object .+?Constructor\]$/,Bo=/^(?:0|[1-9]\d*)$/,Wo="object"==typeof g&&g&&g.Object===Object&&g,zo="object"==typeof self&&self&&self.Object===Object&&self,Ho=Wo||zo||Function("return this")();var $o,Go=Array.prototype,Ko=Function.prototype,Vo=Object.prototype,Jo=Ho["__core-js_shared__"],Yo=($o=/[^.]+$/.exec(Jo&&Jo.keys&&Jo.keys.IE_PROTO||""))?"Symbol(src)_1."+$o:"",Xo=Ko.toString,Zo=Vo.hasOwnProperty,Qo=Vo.toString,er=RegExp("^"+Xo.call(Zo).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tr=Ho.Symbol,nr=Go.splice,ir=mr(Ho,"Map"),or=mr(Object,"create"),rr=tr?tr.prototype:void 0,ar=rr?rr.toString:void 0;function sr(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function cr(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function ur(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function pr(e,t,n){var i=e[t];Zo.call(e,t)&&xr(i,n)&&(void 0!==n||t in e)||(e[t]=n)}function lr(e,t){for(var n=e.length;n--;)if(xr(e[n][0],t))return n;return-1}function dr(e){if(!_r(e)||(t=e,Yo&&Yo in t))return!1;var t,n=function(e){var t=_r(e)?Qo.call(e):"";return t==jo||t==Co}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?er:Fo;return n.test(function(e){if(null!=e){try{return Xo.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function fr(e,t,n,i){if(!_r(e))return e;t=function(e,t){if(wr(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||Er(e))return!0;return Uo.test(e)||!Lo.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:function(e){return wr(e)?e:gr(e)}(t);for(var o=-1,r=t.length,a=r-1,s=e;null!=s&&++o<r;){var c=yr(t[o]),u=n;if(o!=a){var p=s[c];void 0===(u=i?i(p,c,s):void 0)&&(u=_r(p)?p:vr(t[o+1])?[]:{})}pr(s,c,u),s=s[c]}return e}function hr(e,t){var n,i,o=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function mr(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return dr(n)?n:void 0}function vr(e,t){return!!(t=null==t?ko:t)&&("number"==typeof e||Bo.test(e))&&e>-1&&e%1==0&&e<t}sr.prototype.clear=function(){this.__data__=or?or(null):{}},sr.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},sr.prototype.get=function(e){var t=this.__data__;if(or){var n=t[e];return n===No?void 0:n}return Zo.call(t,e)?t[e]:void 0},sr.prototype.has=function(e){var t=this.__data__;return or?void 0!==t[e]:Zo.call(t,e)},sr.prototype.set=function(e,t){return this.__data__[e]=or&&void 0===t?No:t,this},cr.prototype.clear=function(){this.__data__=[]},cr.prototype.delete=function(e){var t=this.__data__,n=lr(t,e);return!(n<0)&&(n==t.length-1?t.pop():nr.call(t,n,1),!0)},cr.prototype.get=function(e){var t=this.__data__,n=lr(t,e);return n<0?void 0:t[n][1]},cr.prototype.has=function(e){return lr(this.__data__,e)>-1},cr.prototype.set=function(e,t){var n=this.__data__,i=lr(n,e);return i<0?n.push([e,t]):n[i][1]=t,this},ur.prototype.clear=function(){this.__data__={hash:new sr,map:new(ir||cr),string:new sr}},ur.prototype.delete=function(e){return hr(this,e).delete(e)},ur.prototype.get=function(e){return hr(this,e).get(e)},ur.prototype.has=function(e){return hr(this,e).has(e)},ur.prototype.set=function(e,t){return hr(this,e).set(e,t),this};var gr=br((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(Er(e))return ar?ar.call(e):"";var t=e+"";return"0"==t&&1/e==-Ro?"-0":t}(t);var n=[];return Do.test(e)&&n.push(""),e.replace(qo,(function(e,t,i,o){n.push(i?o.replace(Mo,"$1"):t||e)})),n}));function yr(e){if("string"==typeof e||Er(e))return e;var t=e+"";return"0"==t&&1/e==-Ro?"-0":t}function br(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var i=arguments,o=t?t.apply(this,i):i[0],r=n.cache;if(r.has(o))return r.get(o);var a=e.apply(this,i);return n.cache=r.set(o,a),a};return n.cache=new(br.Cache||ur),n}function xr(e,t){return e===t||e!=e&&t!=t}br.Cache=ur;var wr=Array.isArray;function _r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Er(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&Qo.call(e)==Po}var Sr=function(e,t,n){return null==e?e:fr(e,t,n)},Or=y(Sr),Ir="__lodash_hash_undefined__",Ar=1/0,Tr="[object Function]",Nr="[object GeneratorFunction]",Rr="[object Symbol]",kr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jr=/^\w*$/,Cr=/^\./,Pr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Lr=/\\(\\)?/g,Ur=/^\[object .+?Constructor\]$/,Dr="object"==typeof g&&g&&g.Object===Object&&g,qr="object"==typeof self&&self&&self.Object===Object&&self,Mr=Dr||qr||Function("return this")();var Fr=Array.prototype,Br=Function.prototype,Wr=Object.prototype,zr=Mr["__core-js_shared__"],Hr=function(){var e=/[^.]+$/.exec(zr&&zr.keys&&zr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),$r=Br.toString,Gr=Wr.hasOwnProperty,Kr=Wr.toString,Vr=RegExp("^"+$r.call(Gr).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Jr=Mr.Symbol,Yr=Fr.splice,Xr=ua(Mr,"Map"),Zr=ua(Object,"create"),Qr=Jr?Jr.prototype:void 0,ea=Qr?Qr.toString:void 0;function ta(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function na(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function ia(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function oa(e,t){for(var n,i,o=e.length;o--;)if((n=e[o][0])===(i=t)||n!=n&&i!=i)return o;return-1}function ra(e){if(!ma(e)||(t=e,Hr&&Hr in t))return!1;var t,n=function(e){var t=ma(e)?Kr.call(e):"";return t==Tr||t==Nr}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?Vr:Ur;return n.test(function(e){if(null!=e){try{return $r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function aa(e,t){e=function(e,t){return 1==t.length?e:function(e,t){for(var n=0,i=(t=pa(t,e)?[t]:sa(t)).length;null!=e&&n<i;)e=e[da(t[n++])];return n&&n==i?e:void 0}(e,function(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var r=Array(o);++i<o;)r[i]=e[i+t];return r}(t,0,-1))}(e,t=pa(t,e)?[t]:sa(t));var n,i,o=da((i=(n=t)?n.length:0)?n[i-1]:void 0);return!(null!=e&&Gr.call(e,o))||delete e[o]}function sa(e){return ha(e)?e:la(e)}function ca(e,t){var n,i,o=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function ua(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ra(n)?n:void 0}function pa(e,t){if(ha(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!va(e))||(jr.test(e)||!kr.test(e)||null!=t&&e in Object(t))}ta.prototype.clear=function(){this.__data__=Zr?Zr(null):{}},ta.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},ta.prototype.get=function(e){var t=this.__data__;if(Zr){var n=t[e];return n===Ir?void 0:n}return Gr.call(t,e)?t[e]:void 0},ta.prototype.has=function(e){var t=this.__data__;return Zr?void 0!==t[e]:Gr.call(t,e)},ta.prototype.set=function(e,t){return this.__data__[e]=Zr&&void 0===t?Ir:t,this},na.prototype.clear=function(){this.__data__=[]},na.prototype.delete=function(e){var t=this.__data__,n=oa(t,e);return!(n<0)&&(n==t.length-1?t.pop():Yr.call(t,n,1),!0)},na.prototype.get=function(e){var t=this.__data__,n=oa(t,e);return n<0?void 0:t[n][1]},na.prototype.has=function(e){return oa(this.__data__,e)>-1},na.prototype.set=function(e,t){var n=this.__data__,i=oa(n,e);return i<0?n.push([e,t]):n[i][1]=t,this},ia.prototype.clear=function(){this.__data__={hash:new ta,map:new(Xr||na),string:new ta}},ia.prototype.delete=function(e){return ca(this,e).delete(e)},ia.prototype.get=function(e){return ca(this,e).get(e)},ia.prototype.has=function(e){return ca(this,e).has(e)},ia.prototype.set=function(e,t){return ca(this,e).set(e,t),this};var la=fa((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(va(e))return ea?ea.call(e):"";var t=e+"";return"0"==t&&1/e==-Ar?"-0":t}(t);var n=[];return Cr.test(e)&&n.push(""),e.replace(Pr,(function(e,t,i,o){n.push(i?o.replace(Lr,"$1"):t||e)})),n}));function da(e){if("string"==typeof e||va(e))return e;var t=e+"";return"0"==t&&1/e==-Ar?"-0":t}function fa(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var i=arguments,o=t?t.apply(this,i):i[0],r=n.cache;if(r.has(o))return r.get(o);var a=e.apply(this,i);return n.cache=r.set(o,a),a};return n.cache=new(fa.Cache||ia),n}fa.Cache=ia;var ha=Array.isArray;function ma(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function va(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&Kr.call(e)==Rr}var ga=function(e,t){return null==e||aa(e,t)},ya=y(ga),ba={exports:{}};!function(e,t){var n="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",r="[object Boolean]",a="[object Date]",s="[object Function]",c="[object GeneratorFunction]",u="[object Map]",p="[object Number]",l="[object Object]",d="[object Promise]",f="[object RegExp]",h="[object Set]",m="[object String]",v="[object Symbol]",y="[object WeakMap]",b="[object ArrayBuffer]",x="[object DataView]",w="[object Float32Array]",_="[object Float64Array]",E="[object Int8Array]",S="[object Int16Array]",O="[object Int32Array]",I="[object Uint8Array]",A="[object Uint8ClampedArray]",T="[object Uint16Array]",N="[object Uint32Array]",R=/\w*$/,k=/^\[object .+?Constructor\]$/,j=/^(?:0|[1-9]\d*)$/,C={};C[o]=C["[object Array]"]=C[b]=C[x]=C[r]=C[a]=C[w]=C[_]=C[E]=C[S]=C[O]=C[u]=C[p]=C[l]=C[f]=C[h]=C[m]=C[v]=C[I]=C[A]=C[T]=C[N]=!0,C["[object Error]"]=C[s]=C[y]=!1;var P="object"==typeof g&&g&&g.Object===Object&&g,L="object"==typeof self&&self&&self.Object===Object&&self,U=P||L||Function("return this")(),D=t&&!t.nodeType&&t,q=D&&e&&!e.nodeType&&e,M=q&&q.exports===D;function F(e,t){return e.set(t[0],t[1]),e}function B(e,t){return e.add(t),e}function W(e,t,n,i){var o=-1,r=e?e.length:0;for(i&&r&&(n=e[++o]);++o<r;)n=t(n,e[o],o,e);return n}function z(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function H(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}function $(e,t){return function(n){return e(t(n))}}function G(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var K=Array.prototype,V=Function.prototype,J=Object.prototype,Y=U["__core-js_shared__"],X=function(){var e=/[^.]+$/.exec(Y&&Y.keys&&Y.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Z=V.toString,Q=J.hasOwnProperty,ee=J.toString,te=RegExp("^"+Z.call(Q).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=M?U.Buffer:void 0,ie=U.Symbol,oe=U.Uint8Array,re=$(Object.getPrototypeOf,Object),ae=Object.create,se=J.propertyIsEnumerable,ce=K.splice,ue=Object.getOwnPropertySymbols,pe=ne?ne.isBuffer:void 0,le=$(Object.keys,Object),de=De(U,"DataView"),fe=De(U,"Map"),he=De(U,"Promise"),me=De(U,"Set"),ve=De(U,"WeakMap"),ge=De(Object,"create"),ye=We(de),be=We(fe),xe=We(he),we=We(me),_e=We(ve),Ee=ie?ie.prototype:void 0,Se=Ee?Ee.valueOf:void 0;function Oe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Ie(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Ae(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Te(e){this.__data__=new Ie(e)}function Ne(e,t){var n=He(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&$e(e)}(e)&&Q.call(e,"callee")&&(!se.call(e,"callee")||ee.call(e)==o)}(e)?function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}(e.length,String):[],i=n.length,r=!!i;for(var a in e)!t&&!Q.call(e,a)||r&&("length"==a||Fe(a,i))||n.push(a);return n}function Re(e,t,n){var i=e[t];Q.call(e,t)&&ze(i,n)&&(void 0!==n||t in e)||(e[t]=n)}function ke(e,t){for(var n=e.length;n--;)if(ze(e[n][0],t))return n;return-1}function je(e,t,n,i,d,g,y){var k;if(i&&(k=g?i(e,d,g,y):i(e)),void 0!==k)return k;if(!Ve(e))return e;var j=He(e);if(j){if(k=function(e){var t=e.length,n=e.constructor(t);t&&"string"==typeof e[0]&&Q.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!t)return function(e,t){var n=-1,i=e.length;t||(t=Array(i));for(;++n<i;)t[n]=e[n];return t}(e,k)}else{var P=Me(e),L=P==s||P==c;if(Ge(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(P==l||P==o||L&&!g){if(z(e))return g?e:{};if(k=function(e){return"function"!=typeof e.constructor||Be(e)?{}:(t=re(e),Ve(t)?ae(t):{});var t}(L?{}:e),!t)return function(e,t){return Le(e,qe(e),t)}(e,function(e,t){return e&&Le(t,Je(t),e)}(k,e))}else{if(!C[P])return g?e:{};k=function(e,t,n,i){var o=e.constructor;switch(t){case b:return Pe(e);case r:case a:return new o(+e);case x:return function(e,t){var n=t?Pe(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,i);case w:case _:case E:case S:case O:case I:case A:case T:case N:return function(e,t){var n=t?Pe(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,i);case u:return function(e,t,n){var i=t?n(H(e),!0):H(e);return W(i,F,new e.constructor)}(e,i,n);case p:case m:return new o(e);case f:return function(e){var t=new e.constructor(e.source,R.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return function(e,t,n){var i=t?n(G(e),!0):G(e);return W(i,B,new e.constructor)}(e,i,n);case v:return s=e,Se?Object(Se.call(s)):{}}var s}(e,P,je,t)}}y||(y=new Te);var U=y.get(e);if(U)return U;if(y.set(e,k),!j)var D=n?function(e){return function(e,t,n){var i=t(e);return He(e)?i:function(e,t){for(var n=-1,i=t.length,o=e.length;++n<i;)e[o+n]=t[n];return e}(i,n(e))}(e,Je,qe)}(e):Je(e);return function(e,t){for(var n=-1,i=e?e.length:0;++n<i&&!1!==t(e[n],n,e););}(D||e,(function(o,r){D&&(o=e[r=o]),Re(k,r,je(o,t,n,i,r,e,y))})),k}function Ce(e){return!(!Ve(e)||(t=e,X&&X in t))&&(Ke(e)||z(e)?te:k).test(We(e));var t}function Pe(e){var t=new e.constructor(e.byteLength);return new oe(t).set(new oe(e)),t}function Le(e,t,n,i){n||(n={});for(var o=-1,r=t.length;++o<r;){var a=t[o],s=i?i(n[a],e[a],a,n,e):void 0;Re(n,a,void 0===s?e[a]:s)}return n}function Ue(e,t){var n,i,o=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function De(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Ce(n)?n:void 0}Oe.prototype.clear=function(){this.__data__=ge?ge(null):{}},Oe.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Oe.prototype.get=function(e){var t=this.__data__;if(ge){var i=t[e];return i===n?void 0:i}return Q.call(t,e)?t[e]:void 0},Oe.prototype.has=function(e){var t=this.__data__;return ge?void 0!==t[e]:Q.call(t,e)},Oe.prototype.set=function(e,t){return this.__data__[e]=ge&&void 0===t?n:t,this},Ie.prototype.clear=function(){this.__data__=[]},Ie.prototype.delete=function(e){var t=this.__data__,n=ke(t,e);return!(n<0)&&(n==t.length-1?t.pop():ce.call(t,n,1),!0)},Ie.prototype.get=function(e){var t=this.__data__,n=ke(t,e);return n<0?void 0:t[n][1]},Ie.prototype.has=function(e){return ke(this.__data__,e)>-1},Ie.prototype.set=function(e,t){var n=this.__data__,i=ke(n,e);return i<0?n.push([e,t]):n[i][1]=t,this},Ae.prototype.clear=function(){this.__data__={hash:new Oe,map:new(fe||Ie),string:new Oe}},Ae.prototype.delete=function(e){return Ue(this,e).delete(e)},Ae.prototype.get=function(e){return Ue(this,e).get(e)},Ae.prototype.has=function(e){return Ue(this,e).has(e)},Ae.prototype.set=function(e,t){return Ue(this,e).set(e,t),this},Te.prototype.clear=function(){this.__data__=new Ie},Te.prototype.delete=function(e){return this.__data__.delete(e)},Te.prototype.get=function(e){return this.__data__.get(e)},Te.prototype.has=function(e){return this.__data__.has(e)},Te.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ie){var i=n.__data__;if(!fe||i.length<199)return i.push([e,t]),this;n=this.__data__=new Ae(i)}return n.set(e,t),this};var qe=ue?$(ue,Object):function(){return[]},Me=function(e){return ee.call(e)};function Fe(e,t){return!!(t=null==t?i:t)&&("number"==typeof e||j.test(e))&&e>-1&&e%1==0&&e<t}function Be(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||J)}function We(e){if(null!=e){try{return Z.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function ze(e,t){return e===t||e!=e&&t!=t}(de&&Me(new de(new ArrayBuffer(1)))!=x||fe&&Me(new fe)!=u||he&&Me(he.resolve())!=d||me&&Me(new me)!=h||ve&&Me(new ve)!=y)&&(Me=function(e){var t=ee.call(e),n=t==l?e.constructor:void 0,i=n?We(n):void 0;if(i)switch(i){case ye:return x;case be:return u;case xe:return d;case we:return h;case _e:return y}return t});var He=Array.isArray;function $e(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}(e.length)&&!Ke(e)}var Ge=pe||function(){return!1};function Ke(e){var t=Ve(e)?ee.call(e):"";return t==s||t==c}function Ve(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Je(e){return $e(e)?Ne(e):function(e){if(!Be(e))return le(e);var t=[];for(var n in Object(e))Q.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return je(e,!0,!0)}}(ba,ba.exports);var xa=y(ba.exports);function wa(e){return void 0===e&&(e=""),(e?e+"_":"")+ +new Date+"_"+Math.random()}var _a,Ea=function(e){this.close=e.close,this.onChange=e.onChange,this.onError=e.onError,e.debug&&Object.defineProperty(this,"virtualClient",{get:function(){return e.virtualClient}})},Sa=function(e){var t,n,i=e.id,o=e.docChanges,r=e.docs,a=e.msgType,s=e.type;Object.defineProperties(this,{id:{get:function(){return i},enumerable:!0},docChanges:{get:function(){return t||(t=JSON.parse(JSON.stringify(o))),t},enumerable:!0},docs:{get:function(){return n||(n=JSON.parse(JSON.stringify(r))),n},enumerable:!0},msgType:{get:function(){return a},enumerable:!0},type:{get:function(){return s},enumerable:!0}})},Oa=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ia=function(e){function t(t){var n=e.call(this,"Watch Error "+JSON.stringify(t.msgData)+" (requestid: "+t.requestId+")")||this;return n.isRealtimeErrorMessageError=!0,n.payload=t,n}return Oa(t,e),t}(Error),Aa=function(e){return null==e?void 0:e.isRealtimeErrorMessageError},Ta=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="timeout",t.payload=null,t.generic=!0,t}return Oa(t,e),t}(Error),Na=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="cancelled",t.payload=null,t.generic=!0,t}return Oa(t,e),t}(Error),Ra=function(e){function t(t){var n=e.call(this,t.errMsg)||this;return n.errCode="UNKNOWN_ERROR",Object.defineProperties(n,{message:{get:function(){return"errCode: "+this.errCode+" "+(ka[this.errCode]||"")+" | errMsg: "+this.errMsg},set:function(e){this.errMsg=e}}}),n.errCode=t.errCode||"UNKNOWN_ERROR",n.errMsg=t.errMsg,n}return Oa(t,e),Object.defineProperty(t.prototype,"message",{get:function(){return"errCode: "+this.errCode+" | errMsg: "+this.errMsg},set:function(e){this.errMsg=e},enumerable:!1,configurable:!0}),t}(Error),ka={UNKNOWN_ERROR:"UNKNOWN_ERROR",SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_CLOSE_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_CLOSE_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_SERVER_ERROR_MSG:"SDK_DATABASE_REALTIME_LISTENER_SERVER_ERROR_MSG",SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA:"SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA",SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR:"SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR",SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED:"SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED",SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL:"SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL",SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR:"SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR"},ja=function(e){return void 0===e&&(e=0),new Promise((function(t){return setTimeout(t,e)}))},Ca=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},Pa=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},La=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),o=0;for(t=0;t<n;t++)for(var r=arguments[t],a=0,s=r.length;a<s;a++,o++)i[o]=r[a];return i};!function(e){e.LOGGINGIN="LOGGINGIN",e.INITING="INITING",e.REBUILDING="REBUILDING",e.ACTIVE="ACTIVE",e.ERRORED="ERRORED",e.CLOSING="CLOSING",e.CLOSED="CLOSED",e.PAUSED="PAUSED",e.RESUMING="RESUMING"}(_a||(_a={}));var Ua=function(){function e(e){var t=this;this.watchStatus=_a.INITING,this._login=function(e,n){return Ca(t,void 0,void 0,(function(){var t;return Pa(this,(function(i){switch(i.label){case 0:return this.watchStatus=_a.LOGGINGIN,[4,this.login(e,n)];case 1:return t=i.sent(),this.envId||(this.envId=t.envId),[2,t]}}))}))},this.initWatch=function(e){return Ca(t,void 0,void 0,(function(){var t,n=this;return Pa(this,(function(i){switch(i.label){case 0:if(this._initWatchPromise)return[2,this._initWatchPromise];this._initWatchPromise=new Promise((function(t,i){return Ca(n,void 0,void 0,(function(){var n,o,r,a,s,c,u,p,l,d;return Pa(this,(function(f){switch(f.label){case 0:return f.trys.push([0,3,,4]),this.watchStatus===_a.PAUSED?(console.log("[realtime] initWatch cancelled on pause"),[2,t()]):[4,this._login(this.envId,e)];case 1:return n=f.sent().envId,this.watchStatus===_a.PAUSED?(console.log("[realtime] initWatch cancelled on pause"),[2,t()]):(this.watchStatus=_a.INITING,o={watchId:this.watchId,requestId:wa(),msgType:"INIT_WATCH",msgData:{envId:n,collName:this.collectionName,query:this.query,limit:this.limit,orderBy:this.orderBy}},[4,this.send({msg:o,waitResponse:!0,skipOnMessage:!0,timeout:1e4})]);case 2:if(r=f.sent(),a=r.msgData,s=a.events,c=a.currEvent,this.sessionInfo={queryID:r.msgData.queryID,currentEventId:c-1,currentDocs:[]},s.length>0){for(u=0,p=s;u<p.length;u++)p[u].ID=c;this.handleServerEvents(r)}else this.sessionInfo.currentEventId=c,l=new Sa({id:c,docChanges:[],docs:[],type:"init"}),this.listener.onChange(l),this.scheduleSendACK();return this.onWatchStart(this,this.sessionInfo.queryID),this.watchStatus=_a.ACTIVE,this._availableRetries.INIT_WATCH=2,t(),[3,4];case 3:return d=f.sent(),this.handleWatchEstablishmentError(d,{operationName:"INIT_WATCH",resolve:t,reject:i}),[3,4];case 4:return[2]}}))}))})),t=!1,i.label=1;case 1:return i.trys.push([1,,3,4]),[4,this._initWatchPromise];case 2:return i.sent(),t=!0,[3,4];case 3:return this._initWatchPromise=void 0,[7];case 4:return console.log("[realtime] initWatch "+(t?"success":"fail")),[2]}}))}))},this.rebuildWatch=function(e){return Ca(t,void 0,void 0,(function(){var t,n=this;return Pa(this,(function(i){switch(i.label){case 0:if(this._rebuildWatchPromise)return[2,this._rebuildWatchPromise];this._rebuildWatchPromise=new Promise((function(t,i){return Ca(n,void 0,void 0,(function(){var n,o,r,a;return Pa(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),this.watchStatus===_a.PAUSED?(console.log("[realtime] rebuildWatch cancelled on pause"),[2,t()]):[4,this._login(this.envId,e)];case 1:if(n=s.sent().envId,!this.sessionInfo)throw new Error("can not rebuildWatch without a successful initWatch (lack of sessionInfo)");return this.watchStatus===_a.PAUSED?(console.log("[realtime] rebuildWatch cancelled on pause"),[2,t()]):(this.watchStatus=_a.REBUILDING,o={watchId:this.watchId,requestId:wa(),msgType:"REBUILD_WATCH",msgData:{envId:n,collName:this.collectionName,queryID:this.sessionInfo.queryID,eventID:this.sessionInfo.currentEventId}},[4,this.send({msg:o,waitResponse:!0,skipOnMessage:!1,timeout:1e4})]);case 2:return r=s.sent(),this.handleServerEvents(r),this.watchStatus=_a.ACTIVE,this._availableRetries.REBUILD_WATCH=2,t(),[3,4];case 3:return a=s.sent(),this.handleWatchEstablishmentError(a,{operationName:"REBUILD_WATCH",resolve:t,reject:i}),[3,4];case 4:return[2]}}))}))})),t=!1,i.label=1;case 1:return i.trys.push([1,,3,4]),[4,this._rebuildWatchPromise];case 2:return i.sent(),t=!0,[3,4];case 3:return this._rebuildWatchPromise=void 0,[7];case 4:return console.log("[realtime] rebuildWatch "+(t?"success":"fail")),[2]}}))}))},this.handleWatchEstablishmentError=function(e,n){return Ca(t,void 0,void 0,(function(){var t,i,o,r=this;return Pa(this,(function(a){return t="INIT_WATCH"===n.operationName,i=function(){r.closeWithError(new Ra({errCode:t?ka.SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL:ka.SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL,errMsg:e})),n.reject(e)},o=function(e){r.useRetryTicket(n.operationName)?t?(r._initWatchPromise=void 0,n.resolve(r.initWatch(e))):(r._rebuildWatchPromise=void 0,n.resolve(r.rebuildWatch(e))):i()},this.handleCommonError(e,{onSignError:function(){return o(!0)},onTimeoutError:function(){return o(!1)},onNotRetryableError:i,onCancelledError:n.reject,onUnknownError:function(){return Ca(r,void 0,void 0,(function(){var e,t=this;return Pa(this,(function(i){switch(i.label){case 0:return i.trys.push([0,8,,9]),e=function(){return Ca(t,void 0,void 0,(function(){return Pa(this,(function(e){switch(e.label){case 0:return this.pause(),[4,this.onceWSConnected()];case 1:return e.sent(),o(!0),[2]}}))}))},this.isWSConnected()?[3,2]:[4,e()];case 1:return i.sent(),[3,7];case 2:return[4,ja(100)];case 3:return i.sent(),this.watchStatus!==_a.PAUSED?[3,4]:(n.reject(new Na(n.operationName+" cancelled due to pause after unknownError")),[3,7]);case 4:return this.isWSConnected()?[3,6]:[4,e()];case 5:return i.sent(),[3,7];case 6:o(!1),i.label=7;case 7:return[3,9];case 8:return i.sent(),o(!0),[3,9];case 9:return[2]}}))}))}}),[2]}))}))},this.closeWatch=function(){return Ca(t,void 0,void 0,(function(){var e,t,n;return Pa(this,(function(i){switch(i.label){case 0:if(e=this.sessionInfo?this.sessionInfo.queryID:"",this.watchStatus!==_a.ACTIVE)return this.watchStatus=_a.CLOSED,this.onWatchClose(this,e),[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this.watchStatus=_a.CLOSING,t={watchId:this.watchId,requestId:wa(),msgType:"CLOSE_WATCH",msgData:null},[4,this.send({msg:t})];case 2:return i.sent(),this.sessionInfo=void 0,this.watchStatus=_a.CLOSED,[3,5];case 3:return n=i.sent(),this.closeWithError(new Ra({errCode:ka.SDK_DATABASE_REALTIME_LISTENER_CLOSE_WATCH_FAIL,errMsg:n})),[3,5];case 4:return this.onWatchClose(this,e),[7];case 5:return[2]}}))}))},this.scheduleSendACK=function(){t.clearACKSchedule(),t._ackTimeoutId=setTimeout((function(){t._waitExpectedTimeoutId?t.scheduleSendACK():t.sendACK()}),1e4)},this.clearACKSchedule=function(){t._ackTimeoutId&&clearTimeout(t._ackTimeoutId)},this.sendACK=function(){return Ca(t,void 0,void 0,(function(){var e,t,n;return Pa(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.watchStatus!==_a.ACTIVE?(this.scheduleSendACK(),[2]):this.sessionInfo?(e={watchId:this.watchId,requestId:wa(),msgType:"CHECK_LAST",msgData:{queryID:this.sessionInfo.queryID,eventID:this.sessionInfo.currentEventId}},[4,this.send({msg:e})]):(console.warn("[realtime listener] can not send ack without a successful initWatch (lack of sessionInfo)"),[2]);case 1:return i.sent(),this.scheduleSendACK(),[3,3];case 2:if(t=i.sent(),Aa(t))switch((n=t.payload).msgData.code){case"CHECK_LOGIN_FAILED":case"SIGN_EXPIRED_ERROR":case"SIGN_INVALID_ERROR":case"SIGN_PARAM_INVALID":return this.rebuildWatch(),[2];case"QUERYID_INVALID_ERROR":case"SYS_ERR":case"INVALIID_ENV":case"COLLECTION_PERMISSION_DENIED":return this.closeWithError(new Ra({errCode:ka.SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL,errMsg:n.msgData.code})),[2]}return this._availableRetries.CHECK_LAST&&this._availableRetries.CHECK_LAST>0?(this._availableRetries.CHECK_LAST--,this.scheduleSendACK()):this.closeWithError(new Ra({errCode:ka.SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL,errMsg:t})),[3,3];case 3:return[2]}}))}))},this.handleCommonError=function(e,t){if(Aa(e)){switch(e.payload.msgData.code){case"CHECK_LOGIN_FAILED":case"SIGN_EXPIRED_ERROR":case"SIGN_INVALID_ERROR":case"SIGN_PARAM_INVALID":return void t.onSignError(e);default:return void t.onNotRetryableError(e)}}else{if(function(e){return"timeout"===e.type}(e))return void t.onTimeoutError(e);if(function(e){return"cancelled"===e.type}(e))return void t.onCancelledError(e)}t.onUnknownError(e)},this.watchId="watchid_"+ +new Date+"_"+Math.random(),this.envId=e.envId,this.collectionName=e.collectionName,this.query=e.query,this.limit=e.limit,this.orderBy=e.orderBy,this.send=e.send,this.login=e.login,this.isWSConnected=e.isWSConnected,this.onceWSConnected=e.onceWSConnected,this.getWaitExpectedTimeoutLength=e.getWaitExpectedTimeoutLength,this.onWatchStart=e.onWatchStart,this.onWatchClose=e.onWatchClose,this.debug=e.debug,this._availableRetries={INIT_WATCH:2,REBUILD_WATCH:2,CHECK_LAST:2},this.listener=new Ea({close:this.closeWatch,onChange:e.onChange,onError:e.onError,debug:this.debug,virtualClient:this}),this.initWatch()}return e.prototype.onMessage=function(e){var t=this;switch(this.watchStatus){case _a.PAUSED:if("ERROR"!==e.msgType)return;break;case _a.LOGGINGIN:case _a.INITING:case _a.REBUILDING:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received while "+this.watchStatus);case _a.CLOSED:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received when the watch has closed");case _a.ERRORED:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received when the watch has ended with error")}if(this.sessionInfo)switch(this.scheduleSendACK(),e.msgType){case"NEXT_EVENT":console.warn("nextevent "+e.msgData.currEvent+" ignored",e),this.handleServerEvents(e);break;case"CHECK_EVENT":this.sessionInfo.currentEventId<e.msgData.currEvent&&(this.sessionInfo.expectEventId=e.msgData.currEvent,this.clearWaitExpectedEvent(),this._waitExpectedTimeoutId=setTimeout((function(){t.rebuildWatch()}),this.getWaitExpectedTimeoutLength()),console.log("[realtime] waitExpectedTimeoutLength "+this.getWaitExpectedTimeoutLength()));break;case"ERROR":this.closeWithError(new Ra({errCode:ka.SDK_DATABASE_REALTIME_LISTENER_SERVER_ERROR_MSG,errMsg:e.msgData.code+" - "+e.msgData.message}));break;default:console.warn("[realtime listener] virtual client receive unexpected msg "+e.msgType+": ",e)}else console.warn("[realtime listener] internal non-fatal error: sessionInfo not found while message is received.")},e.prototype.closeWithError=function(e){this.watchStatus=_a.ERRORED,this.clearACKSchedule(),this.listener.onError(e),this.onWatchClose(this,this.sessionInfo&&this.sessionInfo.queryID||""),console.log("[realtime] client closed ("+this.collectionName+" "+this.query+") (watchId "+this.watchId+")")},e.prototype.pause=function(){this.watchStatus=_a.PAUSED,console.log("[realtime] client paused ("+this.collectionName+" "+this.query+") (watchId "+this.watchId+")")},e.prototype.resume=function(){return Ca(this,void 0,void 0,(function(){var e;return Pa(this,(function(t){switch(t.label){case 0:this.watchStatus=_a.RESUMING,console.log("[realtime] client resuming with "+(this.sessionInfo?"REBUILD_WATCH":"INIT_WATCH")+" ("+this.collectionName+" "+this.query+") ("+this.watchId+")"),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.sessionInfo?this.rebuildWatch():this.initWatch()];case 2:return t.sent(),console.log("[realtime] client successfully resumed ("+this.collectionName+" "+this.query+") ("+this.watchId+")"),[3,4];case 3:return e=t.sent(),console.error("[realtime] client resume failed ("+this.collectionName+" "+this.query+") ("+this.watchId+")",e),[3,4];case 4:return[2]}}))}))},e.prototype.useRetryTicket=function(e){return!!(this._availableRetries[e]&&this._availableRetries[e]>0)&&(this._availableRetries[e]--,console.log("[realtime] "+e+" use a retry ticket, now only "+this._availableRetries[e]+" retry left"),!0)},e.prototype.handleServerEvents=function(e){return Ca(this,void 0,void 0,(function(){var t;return Pa(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.scheduleSendACK(),[4,this._handleServerEvents(e)];case 1:return n.sent(),this._postHandleServerEventsValidityCheck(e),[3,3];case 2:throw t=n.sent(),console.error("[realtime listener] internal non-fatal error: handle server events failed with error: ",t),t;case 3:return[2]}}))}))},e.prototype._handleServerEvents=function(e){return Ca(this,void 0,void 0,(function(){var t,n,i,o,r,a,s,c,u,p,l,d;return Pa(this,(function(f){switch(f.label){case 0:if(t=e.requestId,n=e.msgData.events,i=e.msgType,!n.length||!this.sessionInfo)return[2];o=this.sessionInfo;try{r=n.map(Da)}catch(e){return this.closeWithError(new Ra({errCode:ka.SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA,errMsg:e})),[2]}a=La(o.currentDocs),s=!1,c=function(n,c){var p,l,d,f,h,m,v,g,y,b,x;return Pa(this,(function(w){switch(w.label){case 0:return p=r[n],o.currentEventId>=p.id?(!r[n-1]||p.id>r[n-1].id?console.warn("[realtime] duplicate event received, cur "+o.currentEventId+" but got "+p.id):console.error("[realtime listener] server non-fatal error: events out of order (the latter event's id is smaller than that of the former) (requestId "+t+")"),[2,"continue"]):[3,1];case 1:if(o.currentEventId!==p.id-1)return[3,2];switch(p.dataType){case"update":if(!p.doc)switch(p.queueType){case"update":case"dequeue":if(l=a.find((function(e){return e._id===p.docId})),l){if(m=xa(l),p.updatedFields)for(h in p.updatedFields)Or(m,h,p.updatedFields[h]);if(p.removedFields)for(d=0,f=p.removedFields;d<f.length;d++)h=f[d],ya(m,h);p.doc=m}else console.error("[realtime listener] internal non-fatal server error: unexpected update dataType event where no doc is associated.");break;case"enqueue":throw v=new Ra({errCode:ka.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="update" and queueType="enqueue" (requestId '+e.requestId+")"}),u.closeWithError(v),v}break;case"replace":if(!p.doc)throw v=new Ra({errCode:ka.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="replace" (requestId '+e.requestId+")"}),u.closeWithError(v),v;break;case"remove":(m=a.find((function(e){return e._id===p.docId})))?p.doc=m:console.error("[realtime listener] internal non-fatal server error: unexpected remove event where no doc is associated.");break;case"limit":if(!p.doc)switch(p.queueType){case"dequeue":(m=a.find((function(e){return e._id===p.docId})))?p.doc=m:console.error("[realtime listener] internal non-fatal server error: unexpected limit dataType event where no doc is associated.");break;case"enqueue":throw v=new Ra({errCode:ka.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="limit" and queueType="enqueue" (requestId '+e.requestId+")"}),u.closeWithError(v),v}}switch(p.queueType){case"init":s?a.push(p.doc):(s=!0,a=[p.doc]);break;case"enqueue":a.push(p.doc);break;case"dequeue":g=a.findIndex((function(e){return e._id===p.docId})),g>-1?a.splice(g,1):console.error("[realtime listener] internal non-fatal server error: unexpected dequeue event where no doc is associated.");break;case"update":g=a.findIndex((function(e){return e._id===p.docId})),g>-1?a[g]=p.doc:console.error("[realtime listener] internal non-fatal server error: unexpected queueType update event where no doc is associated.")}return(n===c-1||r[n+1]&&r[n+1].id!==p.id)&&(y=La(a),b=r.slice(0,n+1).filter((function(e){return e.id===p.id})),u.sessionInfo.currentEventId=p.id,u.sessionInfo.currentDocs=a,x=new Sa({id:p.id,docChanges:b,docs:y,msgType:i}),u.listener.onChange(x)),[3,4];case 2:return console.warn("[realtime listener] event received is out of order, cur "+u.sessionInfo.currentEventId+" but got "+p.id),[4,u.rebuildWatch()];case 3:return w.sent(),[2,{value:void 0}];case 4:return[2]}}))},u=this,p=0,l=r.length,f.label=1;case 1:return p<l?[5,c(p,l)]:[3,4];case 2:if("object"==typeof(d=f.sent()))return[2,d.value];f.label=3;case 3:return p++,[3,1];case 4:return[2]}}))}))},e.prototype._postHandleServerEventsValidityCheck=function(e){this.sessionInfo?(this.sessionInfo.expectEventId&&this.sessionInfo.currentEventId>=this.sessionInfo.expectEventId&&this.clearWaitExpectedEvent(),this.sessionInfo.currentEventId<e.msgData.currEvent&&console.warn("[realtime listener] internal non-fatal error: client eventId does not match with server event id after server event handling")):console.error("[realtime listener] internal non-fatal error: sessionInfo lost after server event handling, this should never occur")},e.prototype.clearWaitExpectedEvent=function(){this._waitExpectedTimeoutId&&(clearTimeout(this._waitExpectedTimeoutId),this._waitExpectedTimeoutId=void 0)},e}();function Da(e){var t={id:e.ID,dataType:e.DataType,queueType:e.QueueType,docId:e.DocID,doc:e.Doc&&"{}"!==e.Doc?JSON.parse(e.Doc):void 0};return"update"===e.DataType&&(e.UpdatedFields&&(t.updatedFields=JSON.parse(e.UpdatedFields)),(e.removedFields||e.RemovedFields)&&(t.removedFields=JSON.parse(e.removedFields))),t}var qa,Ma={1e3:{code:1e3,name:"Normal Closure",description:"Normal closure; the connection successfully completed whatever purpose for which it was created."},1001:{code:1001,name:"Going Away",description:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection."},1002:{code:1002,name:"Protocol Error",description:"The endpoint is terminating the connection due to a protocol error."},1003:{code:1003,name:"Unsupported Data",description:"The connection is being terminated because the endpoint received data of a type it cannot accept (for example, a text-only endpoint received binary data)."},1005:{code:1005,name:"No Status Received",description:"Indicates that no status code was provided even though one was expected."},1006:{code:1006,name:"Abnormal Closure",description:"Used to indicate that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},1007:{code:1007,name:"Invalid frame payload data",description:"The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},1008:{code:1008,name:"Policy Violation",description:"The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},1009:{code:1009,name:"Message too big",description:"The endpoint is terminating the connection because a data frame was received that is too large."},1010:{code:1010,name:"Missing Extension",description:"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},1011:{code:1011,name:"Internal Error",description:"The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."},1012:{code:1012,name:"Service Restart",description:"The server is terminating the connection because it is restarting."},1013:{code:1013,name:"Try Again Later",description:"The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients."},1014:{code:1014,name:"Bad Gateway",description:"The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code."},1015:{code:1015,name:"TLS Handshake",description:"Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."},3e3:{code:3e3,name:"Reconnect WebSocket",description:"The client is terminating the connection because it wants to reconnect"},3001:{code:3001,name:"No Realtime Listeners",description:"The client is terminating the connection because no more realtime listeners exist"},3002:{code:3002,name:"Heartbeat Ping Error",description:"The client is terminating the connection due to its failure in sending heartbeat messages"},3003:{code:3003,name:"Heartbeat Pong Timeout Error",description:"The client is terminating the connection because no heartbeat response is received from the server"},3050:{code:3050,name:"Server Close",description:"The client is terminating the connection because no heartbeat response is received from the server"}};!function(e){e[e.NormalClosure=1e3]="NormalClosure",e[e.GoingAway=1001]="GoingAway",e[e.ProtocolError=1002]="ProtocolError",e[e.UnsupportedData=1003]="UnsupportedData",e[e.NoStatusReceived=1005]="NoStatusReceived",e[e.AbnormalClosure=1006]="AbnormalClosure",e[e.InvalidFramePayloadData=1007]="InvalidFramePayloadData",e[e.PolicyViolation=1008]="PolicyViolation",e[e.MessageTooBig=1009]="MessageTooBig",e[e.MissingExtension=1010]="MissingExtension",e[e.InternalError=1011]="InternalError",e[e.ServiceRestart=1012]="ServiceRestart",e[e.TryAgainLater=1013]="TryAgainLater",e[e.BadGateway=1014]="BadGateway",e[e.TLSHandshake=1015]="TLSHandshake",e[e.ReconnectWebSocket=3e3]="ReconnectWebSocket",e[e.NoRealtimeListeners=3001]="NoRealtimeListeners",e[e.HeartbeatPingError=3002]="HeartbeatPingError",e[e.HeartbeatPongTimeoutError=3003]="HeartbeatPongTimeoutError",e[e.NoAuthentication=3050]="NoAuthentication"}(qa||(qa={}));var Fa=function(e,t){var n=Ma[e],i=n?n.name+", code "+e+", reason "+(t||n.description):"code "+e;return new Ra({errCode:ka.SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED,errMsg:i})},Ba=null,Wa="web";function za(){return Ba}function Ha(){return Wa}function $a(e){Wa=e}var Ga=function(){return Ga=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ga.apply(this,arguments)},Ka=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},Va=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},Ja=1,Ya=function(){function e(e){var t=this;this._virtualWSClient=new Set,this._queryIdClientMap=new Map,this._watchIdClientMap=new Map,this._pingFailed=0,this._pongMissed=0,this._logins=new Map,this._wsReadySubsribers=[],this._wsResponseWait=new Map,this._rttObserved=[],this.send=function(e){return Ka(t,void 0,void 0,(function(){var t=this;return Va(this,(function(n){return[2,new Promise((function(n,i){return Ka(t,void 0,void 0,(function(){var t,o,r,a,s,c,u,p=this;return Va(this,(function(l){switch(l.label){case 0:o=!1,r=!1,a=function(e){o=!0,t&&clearTimeout(t),n(e)},s=function(e){r=!0,t&&clearTimeout(t),i(e)},e.timeout&&(t=setTimeout((function(){return Ka(p,void 0,void 0,(function(){return Va(this,(function(e){switch(e.label){case 0:return o&&r?[3,2]:[4,ja(0)];case 1:e.sent(),o&&r||s(new Ta("wsclient.send timedout")),e.label=2;case 2:return[2]}}))}))}),e.timeout)),l.label=1;case 1:return l.trys.push([1,8,,9]),this._wsInitPromise?[4,this._wsInitPromise]:[3,3];case 2:l.sent(),l.label=3;case 3:if(!this._ws)return s(new Error("invalid state: ws connection not exists, can not send message")),[2];if(this._ws.readyState!==Ja)return s(new Error("ws readyState invalid: "+this._ws.readyState+", can not send message")),[2];e.waitResponse&&this._wsResponseWait.set(e.msg.requestId,{resolve:a,reject:s,skipOnMessage:e.skipOnMessage}),l.label=4;case 4:return l.trys.push([4,6,,7]),[4,this._ws.send(JSON.stringify(e.msg))];case 5:return l.sent(),e.waitResponse||a(),[3,7];case 6:return(c=l.sent())&&(s(c),e.waitResponse&&this._wsResponseWait.delete(e.msg.requestId)),[3,7];case 7:return[3,9];case 8:return u=l.sent(),s(u),[3,9];case 9:return[2]}}))}))}))]}))}))},this.closeAllClients=function(e){t._virtualWSClient.forEach((function(t){t.closeWithError(e)}))},this.pauseClients=function(e){(e||t._virtualWSClient).forEach((function(e){e.pause()}))},this.resumeClients=function(e){(e||t._virtualWSClient).forEach((function(e){e.resume()}))},this.initWebSocketConnection=function(e,n){return void 0===n&&(n=t._maxReconnect),Ka(t,void 0,void 0,(function(){var t=this;return Va(this,(function(i){switch(i.label){case 0:if(e&&this._reconnectState)return[2];if(e&&(this._reconnectState=!0),this._wsInitPromise)return[2,this._wsInitPromise];e&&this.pauseClients(),this.close(qa.ReconnectWebSocket),this._wsInitPromise=new Promise((function(i,o){return Ka(t,void 0,void 0,(function(){var t,r,a=this;return Va(this,(function(s){switch(s.label){case 0:return s.trys.push([0,6,,11]),[4,this.getWsSign()];case 1:return t=s.sent(),[4,new Promise((function(e){var n=t.wsUrl||"wss://tcb-ws.tencentcloudapi.com",i=za();a._ws=i?new i(n):new WebSocket(n),e()}))];case 2:return s.sent(),this._ws.connect?[4,this._ws.connect()]:[3,4];case 3:s.sent(),s.label=4;case 4:return[4,this.initWebSocketEvent()];case 5:return s.sent(),i(),e&&(this.resumeClients(),this._reconnectState=!1),[3,11];case 6:return r=s.sent(),console.error("[realtime] initWebSocketConnection connect fail",r),n>0?(!0,this._wsInitPromise=void 0,[4,ja(this._reconnectInterval)]):[3,9];case 7:s.sent(),e&&(this._reconnectState=!1),s.label=8;case 8:return i(this.initWebSocketConnection(e,n-1)),[3,10];case 9:o(r),e&&this.closeAllClients(new Ra({errCode:ka.SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL,errMsg:r})),s.label=10;case 10:return[3,11];case 11:return[2]}}))}))})),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this._wsInitPromise];case 2:return i.sent(),this._wsReadySubsribers.forEach((function(e){return(0,e.resolve)()})),[3,5];case 3:return i.sent(),this._wsReadySubsribers.forEach((function(e){return(0,e.reject)()})),[3,5];case 4:return this._wsInitPromise=void 0,this._wsReadySubsribers=[],[7];case 5:return[2]}}))}))},this.initWebSocketEvent=function(){return new Promise((function(e,n){if(!t._ws)throw new Error("can not initWebSocketEvent, ws not exists");var i=!1;t._ws.onopen=function(t){console.warn("[realtime] ws event: open",t),i=!0,e()},t._ws.onerror=function(e){t._logins=new Map,i?(console.error("[realtime] ws event: error",e),t.clearHeartbeat(),t._virtualWSClient.forEach((function(t){return t.closeWithError(new Ra({errCode:ka.SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR,errMsg:e}))}))):(console.error("[realtime] ws open failed with ws event: error",e),n(e))},t._ws.onclose=function(e){switch(console.warn("[realtime] ws event: close",e),t._logins=new Map,t.clearHeartbeat(),e.code){case qa.ReconnectWebSocket:case qa.NoRealtimeListeners:break;case qa.HeartbeatPingError:case qa.HeartbeatPongTimeoutError:case qa.NormalClosure:case qa.AbnormalClosure:t._maxReconnect>0?t.initWebSocketConnection(!0,t._maxReconnect):t.closeAllClients(Fa(e.code));break;case qa.NoAuthentication:t.closeAllClients(Fa(e.code,e.reason));break;default:t._maxReconnect>0?t.initWebSocketConnection(!0,t._maxReconnect):t.closeAllClients(Fa(e.code))}},t._ws.onmessage=function(e){var n,i=e.data;t.heartbeat();try{n=JSON.parse(i)}catch(e){throw new Error("[realtime] onMessage parse res.data error: "+e)}if("ERROR"===n.msgType){var o=null;t._virtualWSClient.forEach((function(e){e.watchId===n.watchId&&(o=e)})),o&&o.listener.onError(n)}var r=t._wsResponseWait.get(n.requestId);if(r){try{"ERROR"===n.msgType?r.reject(new Ia(n)):r.resolve(n)}catch(e){console.error("ws onMessage responseWaitSpec.resolve(msg) errored:",e)}finally{t._wsResponseWait.delete(n.requestId)}if(r.skipOnMessage)return}if("PONG"!==n.msgType){var a=n.watchId&&t._watchIdClientMap.get(n.watchId);if(a)a.onMessage(n);else switch(console.error("[realtime] no realtime listener found responsible for watchId "+n.watchId+": ",n),n.msgType){case"INIT_EVENT":case"NEXT_EVENT":case"CHECK_EVENT":(a=t._queryIdClientMap.get(n.msgData.queryID))&&a.onMessage(n);break;default:for(var s=0,c=Array.from(t._watchIdClientMap.entries());s<c.length;s++){c[s][1].onMessage(n);break}}}else if(t._lastPingSendTS){var u=Date.now()-t._lastPingSendTS;if(u>1e4)return void console.warn("[realtime] untrusted rtt observed: "+u);t._rttObserved.length>=3&&t._rttObserved.splice(0,t._rttObserved.length-3+1),t._rttObserved.push(u)}},t.heartbeat()}))},this.isWSConnected=function(){return Boolean(t._ws&&t._ws.readyState===Ja)},this.onceWSConnected=function(){return Ka(t,void 0,void 0,(function(){var e=this;return Va(this,(function(t){return this.isWSConnected()?[2]:this._wsInitPromise?[2,this._wsInitPromise]:[2,new Promise((function(t,n){e._wsReadySubsribers.push({resolve:t,reject:n})}))]}))}))},this.webLogin=function(e,n){return Ka(t,void 0,void 0,(function(){var t,i,o,r,a,s,c,u,p=this;return Va(this,(function(l){switch(l.label){case 0:if(!n)if(e){if(t=this._logins.get(e)){if(t.loggedIn&&t.loginResult)return[2,t.loginResult];if(t.loggingInPromise)return[2,t.loggingInPromise]}}else if(null==(i=this._logins.get(""))?void 0:i.loggingInPromise)return[2,i.loggingInPromise];o=new Promise((function(e,t){return Ka(p,void 0,void 0,(function(){var n,i,o,r,a;return Va(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),[4,this.getWsSign()];case 1:return n=s.sent(),i={envId:n.envId||"",accessToken:"",referrer:"web",sdkVersion:"",dataVersion:""},o={watchId:void 0,requestId:wa(),msgType:"LOGIN",msgData:i,exMsgData:{runtime:Ha(),signStr:n.signStr,secretVersion:n.secretVersion}},[4,this.send({msg:o,waitResponse:!0,skipOnMessage:!0,timeout:5e3})];case 2:return(r=s.sent()).msgData.code?t(new Error(r.msgData.code+" "+r.msgData.message)):e({envId:n.envId}),[3,4];case 3:return a=s.sent(),t(a),[3,4];case 4:return[2]}}))}))})),r=e&&this._logins.get(e),a=Date.now(),r?(r.loggedIn=!1,r.loggingInPromise=o,r.loginStartTS=a):(r={loggedIn:!1,loggingInPromise:o,loginStartTS:a},this._logins.set(e||"",r)),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,o];case 2:if(s=l.sent(),(c=e&&this._logins.get(e))&&c===r&&c.loginStartTS===a)return r.loggedIn=!0,r.loggingInPromise=void 0,r.loginStartTS=void 0,r.loginResult=s,[2,s];if(c){if(c.loggedIn&&c.loginResult)return[2,c.loginResult];if(c.loggingInPromise)return[2,c.loggingInPromise];throw new Error("ws unexpected login info")}throw new Error("ws login info reset");case 3:throw u=l.sent(),r.loggedIn=!1,r.loggingInPromise=void 0,r.loginStartTS=void 0,r.loginResult=void 0,u;case 4:return[2]}}))}))},this.getWsSign=function(){return Ka(t,void 0,void 0,(function(){var e,t,n,i,o,r,a;return Va(this,(function(s){switch(s.label){case 0:return this._wsSign&&this._wsSign.expiredTs>Date.now()?[2,this._wsSign]:(e=Date.now()+6e4,[4,this._context.appConfig.request.send("auth.wsWebSign",{runtime:Ha()})]);case 1:if((t=s.sent()).code)throw new Error("[tcb-js-sdk] 获取实时数据推送登录票据失败: "+t.code);if(t.data)return n=t.data,i=n.signStr,o=n.wsUrl,r=n.secretVersion,a=n.envId,[2,{signStr:i,wsUrl:o,secretVersion:r,envId:a,expiredTs:e}];throw new Error("[tcb-js-sdk] 获取实时数据推送登录票据失败")}}))}))},this.getWaitExpectedTimeoutLength=function(){return t._rttObserved.length?t._rttObserved.reduce((function(e,t){return e+t}))/t._rttObserved.length*1.5:5e3},this.ping=function(){return Ka(t,void 0,void 0,(function(){var e;return Va(this,(function(t){switch(t.label){case 0:return e={watchId:void 0,requestId:wa(),msgType:"PING",msgData:null},[4,this.send({msg:e})];case 1:return t.sent(),[2]}}))}))},this.onWatchStart=function(e,n){t._queryIdClientMap.set(n,e)},this.onWatchClose=function(e,n){n&&t._queryIdClientMap.delete(n),t._watchIdClientMap.delete(e.watchId),t._virtualWSClient.delete(e),t._virtualWSClient.size||t.close(qa.NoRealtimeListeners)},this._maxReconnect=e.maxReconnect||5,this._reconnectInterval=e.reconnectInterval||1e4,this._context=e.context}return e.prototype.clearHeartbeat=function(){this._pingTimeoutId&&clearTimeout(this._pingTimeoutId),this._pongTimeoutId&&clearTimeout(this._pongTimeoutId)},e.prototype.close=function(e){this.clearHeartbeat(),this._ws&&(this._ws.close(e,Ma[e].name),this._ws=void 0)},e.prototype.watch=function(e){this._ws||this._wsInitPromise||this.initWebSocketConnection(!1);var t=new Ua(Ga(Ga({},e),{send:this.send,login:this.webLogin,isWSConnected:this.isWSConnected,onceWSConnected:this.onceWSConnected,getWaitExpectedTimeoutLength:this.getWaitExpectedTimeoutLength,onWatchStart:this.onWatchStart,onWatchClose:this.onWatchClose,debug:!0}));return this._virtualWSClient.add(t),this._watchIdClientMap.set(t.watchId,t),t.listener},e.prototype.heartbeat=function(e){var t=this;this.clearHeartbeat(),this._pingTimeoutId=setTimeout((function(){return Ka(t,void 0,void 0,(function(){var e=this;return Va(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),this._ws&&this._ws.readyState===Ja?(this._lastPingSendTS=Date.now(),[4,this.ping()]):[2];case 1:return t.sent(),this._pingFailed=0,this._pongTimeoutId=setTimeout((function(){console.error("pong timed out"),e._pongMissed<2?(e._pongMissed++,e.heartbeat(!0)):e.initWebSocketConnection(!0)}),this._context.appConfig.realtimePongWaitTimeout),[3,3];case 2:return t.sent(),this._pingFailed<2?(this._pingFailed++,this.heartbeat()):this.close(qa.HeartbeatPingError),[3,3];case 3:return[2]}}))}))}),e?0:this._context.appConfig.realtimePingInterval)},e}(),Xa={target:"database",entity:function(){var e,t=this.platform,n=t.adapter,i=t.runtime;e=n.wsClass,Ba=e,$a(i)}},Za={name:"realtime",IIFE:!0,entity:function(){this.prototype.wsClientClass=Ya}};try{cloudbase.registerComponent(Za),cloudbase.registerHook(Xa)}catch(e){}var Qa=function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},es=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},ts=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},ns=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},is=He.ERRORS,os=He.COMMUNITY_SITE_URL,rs=We.catchErrorsDecorator,as="analytics",ss=["mall"];var cs,us,ps=function(){function e(){}return e.prototype.analytics=function(e){return ts(this,void 0,void 0,(function(){var t,n,i;return ns(this,(function(o){if(!function(e){if("Object"!==Object.prototype.toString.call(e).slice(8,-1))return!1;var t=e.report_data,n=e.report_type;return!1!==ss.includes(n)&&"Object"===Object.prototype.toString.call(t).slice(8,-1)&&!(void 0!==t.action_time&&!Number.isInteger(t.action_time))&&"string"==typeof t.action_type}(e))throw new Error(JSON.stringify({code:is.INVALID_PARAMS,msg:"["+as+".analytics] invalid report data"}));return"analytics.report",t=void 0===e.report_data.action_time?Math.floor(Date.now()/1e3):e.report_data.action_time,n={analytics_scene:e.report_type,analytics_data:Object.assign({},e.report_data,{action_time:t})},i={requestData:n},this.request.send("analytics.report",i),[2]}))}))},Qa([rs({customInfo:{className:"Cloudbase",methodName:"analytics"},title:"上报调用失败",messages:["请确认以下各项:"," 1 - 调用 analytics() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+os]}),es("design:type",Function),es("design:paramtypes",[Object]),es("design:returntype",Promise)],e.prototype,"analytics",null),e}(),ls=new ps,ds={name:as,entity:{analytics:ls.analytics}};try{cloudbase.registerComponent(ds)}catch(e){}!function(e){e.DocIDError="文档ID不合法",e.CollNameError="集合名称不合法",e.OpStrError="操作符不合法",e.DirectionError="排序字符不合法",e.IntergerError="must be integer",e.QueryParamTypeError="查询参数必须为对象",e.QueryParamValueError="查询参数对象值不能均为undefined"}(us||(us={}));var fs,hs,ms="Number",vs="Object",gs="Array",ys="GeoPoint",bs="GeoLineString",xs="GeoPolygon",ws="GeoMultiPoint",_s="GeoMultiLineString",Es="GeoMultiPolygon",Ss="Date",Os="ServerDate",Is="BsonDate",As=["desc","asc"],Ts=["<","<=","==",">=",">"];!function(e){e.lt="<",e.gt=">",e.lte="<=",e.gte=">=",e.eq="=="}(fs||(fs={})),(cs={})[fs.eq]="$eq",cs[fs.lt]="$lt",cs[fs.lte]="$lte",cs[fs.gt]="$gt",cs[fs.gte]="$gte",function(e){e.WHERE="WHERE",e.DOC="DOC"}(hs||(hs={}));var Ns=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Rs=[],ks={},js=function(e){function t(t,n){if(n!==ks)throw new TypeError("InternalSymbol cannot be constructed with new operator");return e.call(this,t)||this}return Ns(t,e),t.for=function(e){for(var n=0,i=Rs.length;n<i;n++)if(Rs[n].target===e)return Rs[n].instance;var o=new t(e,ks);return Rs.push({target:e,instance:o}),o},t}((function(e){Object.defineProperties(this,{target:{enumerable:!1,writable:!1,configurable:!1,value:e}})})),Cs=js,Ps=Cs.for("UNSET_FIELD_NAME"),Ls=Cs.for("UPDATE_COMMAND"),Us=Cs.for("QUERY_COMMAND"),Ds=Cs.for("LOGIC_COMMAND"),qs=Cs.for("GEO_POINT"),Ms=Cs.for("SYMBOL_GEO_LINE_STRING"),Fs=Cs.for("SYMBOL_GEO_POLYGON"),Bs=Cs.for("SYMBOL_GEO_MULTI_POINT"),Ws=Cs.for("SYMBOL_GEO_MULTI_LINE_STRING"),zs=Cs.for("SYMBOL_GEO_MULTI_POLYGON"),Hs=Cs.for("SERVER_DATE"),$s=Cs.for("REGEXP"),Gs=function(){function e(e){var t=(void 0===e?{}:e).offset,n=void 0===t?0:t;this.offset=n}return Object.defineProperty(e.prototype,"_internalType",{get:function(){return Hs},enumerable:!0,configurable:!0}),e.prototype.parse=function(){return{$date:{offset:this.offset}}},e}();function Ks(e){return new Gs(e)}var Vs,Js=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Ys=function(){function e(){}return e.formatResDocumentData=function(t){return t.map((function(t){return e.formatField(t)}))},e.formatField=function(t){var n=Object.keys(t),i={};return Array.isArray(t)&&(i=[]),n.forEach((function(n){var o,r=t[n];switch(e.whichType(r)){case ys:o=new rc(r.coordinates[0],r.coordinates[1]);break;case bs:o=new sc(r.coordinates.map((function(e){return new rc(e[0],e[1])})));break;case xs:o=new uc(r.coordinates.map((function(e){return new sc(e.map((function(e){var t=Js(e,2),n=t[0],i=t[1];return new rc(n,i)})))})));break;case ws:o=new lc(r.coordinates.map((function(e){return new rc(e[0],e[1])})));break;case _s:o=new fc(r.coordinates.map((function(e){return new sc(e.map((function(e){var t=Js(e,2),n=t[0],i=t[1];return new rc(n,i)})))})));break;case Es:o=new mc(r.coordinates.map((function(e){return new uc(e.map((function(e){return new sc(e.map((function(e){var t=Js(e,2),n=t[0],i=t[1];return new rc(n,i)})))})))})));break;case Ss:o=new Date(1e3*r.$timestamp);break;case vs:case gs:o=e.formatField(r);break;case Os:o=new Date(r.$date);break;default:o=r}Array.isArray(i)?i.push(o):i[n]=o})),i},e.whichType=function(e){var t=Object.prototype.toString.call(e).slice(8,-1);if(t===Ss)return Is;if(t===vs){if(e instanceof rc)return ys;if(e instanceof Date)return Ss;if(e instanceof Gs)return Os;e.$timestamp?t=Ss:e.$date?t=Os:rc.validate(e)?t=ys:sc.validate(e)?t=bs:uc.validate(e)?t=xs:lc.validate(e)?t=ws:fc.validate(e)?t=_s:mc.validate(e)&&(t=Es)}return t},e.generateDocId=function(){for(var e="ABCDEFabcdef0123456789",t="",n=0;n<24;n++)t+=e.charAt(Math.floor(22*Math.random()));return t},e}(),Xs=function(){function e(){}return e.isGeopoint=function(e,t){if(Ys.whichType(t)!==ms)throw new Error("Geo Point must be number type");var n=Math.abs(t);if("latitude"===e&&n>90)throw new Error("latitude should be a number ranges from -90 to 90");if("longitude"===e&&n>180)throw new Error("longitude should be a number ranges from -180 to 180");return!0},e.isInteger=function(e,t){if(!Number.isInteger(t))throw new Error(e+us.IntergerError);return!0},e.isFieldOrder=function(e){if(-1===As.indexOf(e))throw new Error(us.DirectionError);return!0},e.isFieldPath=function(e){if(!/^[a-zA-Z0-9-_\.]/.test(e))throw new Error;return!0},e.isOperator=function(e){if(-1===Ts.indexOf(e))throw new Error(us.OpStrError);return!0},e.isCollName=function(e){if(!/^[a-zA-Z0-9]([a-zA-Z0-9-_]){1,32}$/.test(e))throw new Error(us.CollNameError);return!0},e.isDocID=function(e){if(!/^([a-fA-F0-9]){24}$/.test(e))throw new Error(us.DocIDError);return!0},e}(),Zs=function(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()},Qs=function(e){return"object"===Zs(e)},ec=function(e){return"number"===Zs(e)},tc=function(e){return Array.isArray(e)},nc=function(e){return"date"===Zs(e)},ic=function(e){return"regexp"===Zs(e)},oc=function(e){return e&&e._internalType instanceof js},rc=function(){function e(e,t){Xs.isGeopoint("longitude",e),Xs.isGeopoint("latitude",t),this.longitude=e,this.latitude=t}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"Point",coordinates:[this.longitude,this.latitude]},t},e.prototype.toJSON=function(){return{type:"Point",coordinates:[this.longitude,this.latitude]}},e.prototype.toReadableString=function(){return"["+this.longitude+","+this.latitude+"]"},e.validate=function(e){return"Point"===e.type&&tc(e.coordinates)&&Xs.isGeopoint("longitude",e.coordinates[0])&&Xs.isGeopoint("latitude",e.coordinates[1])},Object.defineProperty(e.prototype,"_internalType",{get:function(){return qs},enumerable:!0,configurable:!0}),e}(),ac=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},sc=function(){function e(e){if(!tc(e))throw new TypeError('"points" must be of type Point[]. Received type '+typeof e);if(e.length<2)throw new Error('"points" must contain 2 points at least');e.forEach((function(e){if(!(e instanceof rc))throw new TypeError('"points" must be of type Point[]. Received type '+typeof e+"[]")})),this.points=e}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"LineString",coordinates:this.points.map((function(e){return e.toJSON().coordinates}))},t},e.prototype.toJSON=function(){return{type:"LineString",coordinates:this.points.map((function(e){return e.toJSON().coordinates}))}},e.validate=function(e){var t,n;if("LineString"!==e.type||!tc(e.coordinates))return!1;try{for(var i=ac(e.coordinates),o=i.next();!o.done;o=i.next()){var r=o.value;if(!ec(r[0])||!ec(r[1]))return!1}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return!0},e.isClosed=function(e){var t=e.points[0],n=e.points[e.points.length-1];if(t.latitude===n.latitude&&t.longitude===n.longitude)return!0},Object.defineProperty(e.prototype,"_internalType",{get:function(){return Ms},enumerable:!0,configurable:!0}),e}(),cc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},uc=function(){function e(e){if(!tc(e))throw new TypeError('"lines" must be of type LineString[]. Received type '+typeof e);if(0===e.length)throw new Error("Polygon must contain 1 linestring at least");e.forEach((function(e){if(!(e instanceof sc))throw new TypeError('"lines" must be of type LineString[]. Received type '+typeof e+"[]");if(!sc.isClosed(e))throw new Error("LineString "+e.points.map((function(e){return e.toReadableString()}))+" is not a closed cycle")})),this.lines=e}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"Polygon",coordinates:this.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))},t},e.prototype.toJSON=function(){return{type:"Polygon",coordinates:this.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))}},e.validate=function(e){var t,n,i,o;if("Polygon"!==e.type||!tc(e.coordinates))return!1;try{for(var r=cc(e.coordinates),a=r.next();!a.done;a=r.next()){var s=a.value;if(!this.isCloseLineString(s))return!1;try{for(var c=(i=void 0,cc(s)),u=c.next();!u.done;u=c.next()){var p=u.value;if(!ec(p[0])||!ec(p[1]))return!1}}catch(e){i={error:e}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!0},e.isCloseLineString=function(e){var t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]},Object.defineProperty(e.prototype,"_internalType",{get:function(){return zs},enumerable:!0,configurable:!0}),e}(),pc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},lc=function(){function e(e){if(!tc(e))throw new TypeError('"points" must be of type Point[]. Received type '+typeof e);if(0===e.length)throw new Error('"points" must contain 1 point at least');e.forEach((function(e){if(!(e instanceof rc))throw new TypeError('"points" must be of type Point[]. Received type '+typeof e+"[]")})),this.points=e}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"MultiPoint",coordinates:this.points.map((function(e){return e.toJSON().coordinates}))},t},e.prototype.toJSON=function(){return{type:"MultiPoint",coordinates:this.points.map((function(e){return e.toJSON().coordinates}))}},e.validate=function(e){var t,n;if("MultiPoint"!==e.type||!tc(e.coordinates))return!1;try{for(var i=pc(e.coordinates),o=i.next();!o.done;o=i.next()){var r=o.value;if(!ec(r[0])||!ec(r[1]))return!1}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return!0},Object.defineProperty(e.prototype,"_internalType",{get:function(){return Bs},enumerable:!0,configurable:!0}),e}(),dc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},fc=function(){function e(e){if(!tc(e))throw new TypeError('"lines" must be of type LineString[]. Received type '+typeof e);if(0===e.length)throw new Error("Polygon must contain 1 linestring at least");e.forEach((function(e){if(!(e instanceof sc))throw new TypeError('"lines" must be of type LineString[]. Received type '+typeof e+"[]")})),this.lines=e}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"MultiLineString",coordinates:this.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))},t},e.prototype.toJSON=function(){return{type:"MultiLineString",coordinates:this.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))}},e.validate=function(e){var t,n,i,o;if("MultiLineString"!==e.type||!tc(e.coordinates))return!1;try{for(var r=dc(e.coordinates),a=r.next();!a.done;a=r.next()){var s=a.value;try{for(var c=(i=void 0,dc(s)),u=c.next();!u.done;u=c.next()){var p=u.value;if(!ec(p[0])||!ec(p[1]))return!1}}catch(e){i={error:e}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!0},Object.defineProperty(e.prototype,"_internalType",{get:function(){return Ws},enumerable:!0,configurable:!0}),e}(),hc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},mc=function(){function e(e){var t,n;if(!tc(e))throw new TypeError('"polygons" must be of type Polygon[]. Received type '+typeof e);if(0===e.length)throw new Error("MultiPolygon must contain 1 polygon at least");try{for(var i=hc(e),o=i.next();!o.done;o=i.next()){var r=o.value;if(!(r instanceof uc))throw new TypeError('"polygon" must be of type Polygon[]. Received type '+typeof r+"[]")}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}this.polygons=e}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"MultiPolygon",coordinates:this.polygons.map((function(e){return e.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))}))},t},e.prototype.toJSON=function(){return{type:"MultiPolygon",coordinates:this.polygons.map((function(e){return e.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))}))}},e.validate=function(e){var t,n,i,o,r,a;if("MultiPolygon"!==e.type||!tc(e.coordinates))return!1;try{for(var s=hc(e.coordinates),c=s.next();!c.done;c=s.next()){var u=c.value;try{for(var p=(i=void 0,hc(u)),l=p.next();!l.done;l=p.next()){var d=l.value;try{for(var f=(r=void 0,hc(d)),h=f.next();!h.done;h=f.next()){var m=h.value;if(!ec(m[0])||!ec(m[1]))return!1}}catch(e){r={error:e}}finally{try{h&&!h.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}}}catch(e){i={error:e}}finally{try{l&&!l.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return!0},Object.defineProperty(e.prototype,"_internalType",{get:function(){return Fs},enumerable:!0,configurable:!0}),e}(),vc=Object.freeze({__proto__:null,LineString:sc,MultiLineString:fc,MultiPoint:lc,MultiPolygon:mc,Point:rc,Polygon:uc}),gc=function(){var e;if(!Promise){(e=function(){}).promise={};var t=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}var n=new Promise((function(t,n){e=function(e,i){return e?n(e):t(i)}}));return e.promise=n,e};!function(e){e.SET="set",e.REMOVE="remove",e.INC="inc",e.MUL="mul",e.PUSH="push",e.PULL="pull",e.PULL_ALL="pullAll",e.POP="pop",e.SHIFT="shift",e.UNSHIFT="unshift",e.ADD_TO_SET="addToSet",e.BIT="bit",e.RENAME="rename",e.MAX="max",e.MIN="min"}(Vs||(Vs={}));var yc,bc=function(){function e(e,t,n){this._internalType=Ls,Object.defineProperties(this,{_internalType:{enumerable:!1,configurable:!1}}),this.operator=e,this.operands=t,this.fieldName=n||Ps}return e.prototype._setFieldName=function(t){return new e(this.operator,this.operands,t)},e}();function xc(e){return e&&e instanceof bc&&e._internalType===Ls}!function(e){e.AND="and",e.OR="or",e.NOT="not",e.NOR="nor"}(yc||(yc={}));var wc=function(){function e(e,t,n){if(this._internalType=Ds,Object.defineProperties(this,{_internalType:{enumerable:!1,configurable:!1}}),this.operator=e,this.operands=t,this.fieldName=n||Ps,this.fieldName!==Ps)if(Array.isArray(t)){t=t.slice(),this.operands=t;for(var i=0,o=t.length;i<o;i++){(_c(r=t[i])||Ic(r))&&(t[i]=r._setFieldName(this.fieldName))}}else{var r;(_c(r=t)||Ic(r))&&(t=r._setFieldName(this.fieldName))}}return e.prototype._setFieldName=function(t){var n=this.operands.map((function(n){return n instanceof e?n._setFieldName(t):n}));return new e(this.operator,n,t)},e.prototype.and=function(){var t=Array.isArray(arguments[0])?arguments[0]:Array.from(arguments);return t.unshift(this),new e(yc.AND,t,this.fieldName)},e.prototype.or=function(){var t=Array.isArray(arguments[0])?arguments[0]:Array.from(arguments);return t.unshift(this),new e(yc.OR,t,this.fieldName)},e}();function _c(e){return e&&e instanceof wc&&e._internalType===Ds}var Ec,Sc=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();!function(e){e.EQ="eq",e.NEQ="neq",e.GT="gt",e.GTE="gte",e.LT="lt",e.LTE="lte",e.IN="in",e.NIN="nin",e.ALL="all",e.ELEM_MATCH="elemMatch",e.EXISTS="exists",e.SIZE="size",e.MOD="mod",e.GEO_NEAR="geoNear",e.GEO_WITHIN="geoWithin",e.GEO_INTERSECTS="geoIntersects"}(Ec||(Ec={}));var Oc=function(e){function t(t,n,i){var o=e.call(this,t,n,i)||this;return o.operator=t,o._internalType=Us,o}return Sc(t,e),t.prototype.toJSON=function(){var e,t;switch(this.operator){case Ec.IN:case Ec.NIN:return(e={})["$"+this.operator]=this.operands,e;default:return(t={})["$"+this.operator]=this.operands[0],t}},t.prototype._setFieldName=function(e){return new t(this.operator,this.operands,e)},t.prototype.eq=function(e){var n=new t(Ec.EQ,[e],this.fieldName);return this.and(n)},t.prototype.neq=function(e){var n=new t(Ec.NEQ,[e],this.fieldName);return this.and(n)},t.prototype.gt=function(e){var n=new t(Ec.GT,[e],this.fieldName);return this.and(n)},t.prototype.gte=function(e){var n=new t(Ec.GTE,[e],this.fieldName);return this.and(n)},t.prototype.lt=function(e){var n=new t(Ec.LT,[e],this.fieldName);return this.and(n)},t.prototype.lte=function(e){var n=new t(Ec.LTE,[e],this.fieldName);return this.and(n)},t.prototype.in=function(e){var n=new t(Ec.IN,e,this.fieldName);return this.and(n)},t.prototype.nin=function(e){var n=new t(Ec.NIN,e,this.fieldName);return this.and(n)},t.prototype.geoNear=function(e){if(!(e.geometry instanceof rc))throw new TypeError('"geometry" must be of type Point. Received type '+typeof e.geometry);if(void 0!==e.maxDistance&&!ec(e.maxDistance))throw new TypeError('"maxDistance" must be of type Number. Received type '+typeof e.maxDistance);if(void 0!==e.minDistance&&!ec(e.minDistance))throw new TypeError('"minDistance" must be of type Number. Received type '+typeof e.minDistance);var n=new t(Ec.GEO_NEAR,[e],this.fieldName);return this.and(n)},t.prototype.geoWithin=function(e){if(!(e.geometry instanceof mc||e.geometry instanceof uc))throw new TypeError('"geometry" must be of type Polygon or MultiPolygon. Received type '+typeof e.geometry);var n=new t(Ec.GEO_WITHIN,[e],this.fieldName);return this.and(n)},t.prototype.geoIntersects=function(e){if(!(e.geometry instanceof rc||e.geometry instanceof sc||e.geometry instanceof uc||e.geometry instanceof lc||e.geometry instanceof fc||e.geometry instanceof mc))throw new TypeError('"geometry" must be of type Point, LineString, Polygon, MultiPoint, MultiLineString or MultiPolygon. Received type '+typeof e.geometry);var n=new t(Ec.GEO_INTERSECTS,[e],this.fieldName);return this.and(n)},t}(wc);function Ic(e){return e&&e instanceof Oc&&e._internalType===Us}function Ac(e){return Ic(e)}var Tc={};for(var Nc in Ec)Tc[Nc]="$"+Nc;for(var Nc in yc)Tc[Nc]="$"+Nc;for(var Nc in Vs)Tc[Nc]="$"+Nc;function Rc(e){return Tc[e]||"$"+e}Tc[Ec.NEQ]="$ne",Tc[Vs.REMOVE]="$unset",Tc[Vs.SHIFT]="$pop",Tc[Vs.UNSHIFT]="$push";var kc=function(){return kc=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},kc.apply(this,arguments)},jc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Cc=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(jc(arguments[t]));return e};function Pc(e){return Lc(e,[e])}function Lc(e,t){if(!oc(e)){if(nc(e))return{$date:+e};if(ic(e))return{$regex:e.source,$options:e.flags};if(tc(e))return e.map((function(e){if(t.indexOf(e)>-1)throw new Error("Cannot convert circular structure to JSON");return Lc(e,Cc(t,[e]))}));if(Qs(e)){var n=kc({},e);for(var i in n){if(t.indexOf(n[i])>-1)throw new Error("Cannot convert circular structure to JSON");n[i]=Lc(n[i],Cc(t,[n[i]]))}return n}return e}switch(e._internalType){case qs:return e.toJSON();case Hs:case $s:return e.parse();default:return e.toJSON?e.toJSON():e}}var Uc=function(){return Uc=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Uc.apply(this,arguments)},Dc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},qc=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Dc(arguments[t]));return e};function Mc(e,t,n,i){var o=Uc({},e);for(var r in e)if(!/^\$/.test(r)){var a=e[r];if(a&&Qs(a)&&!t(a)){if(i.indexOf(a)>-1)throw new Error("Cannot convert circular structure to JSON");var s=Mc(a,t,qc(n,[r]),qc(i,[a]));o[r]=s;var c=!1;for(var u in s)/^\$/.test(u)?c=!0:(o[r+"."+u]=s[u],delete o[r][u]);c||delete o[r]}}return o}function Fc(e){return Mc(e,Wc,[],[e])}function Bc(e,t,n){for(var i in t[n]||delete e[n],t)e[i]?tc(e[i])?e[i].push(t[i]):Qs(e[i])?Qs(t[i])?Object.assign(e[i],t[i]):(console.warn("unmergable condition, query is object but condition is "+Zs(t)+", can only overwrite",t,n),e[i]=t[i]):(console.warn("to-merge query is of type "+Zs(e)+", can only overwrite",e,t,n),e[i]=t[i]):e[i]=t[i]}function Wc(e){return oc(e)||nc(e)||ic(e)}function zc(e){return Pc(e)}var Hc=function(){function e(){}return e.encode=function(t){return(new e).encodeUpdate(t)},e.prototype.encodeUpdate=function(e){return xc(e)?this.encodeUpdateCommand(e):"object"===Zs(e)?this.encodeUpdateObject(e):e},e.prototype.encodeUpdateCommand=function(e){if(e.fieldName===Ps)throw new Error("Cannot encode a comparison command with unset field name");switch(e.operator){case Vs.PUSH:case Vs.PULL:case Vs.PULL_ALL:case Vs.POP:case Vs.SHIFT:case Vs.UNSHIFT:case Vs.ADD_TO_SET:return this.encodeArrayUpdateCommand(e);default:return this.encodeFieldUpdateCommand(e)}},e.prototype.encodeFieldUpdateCommand=function(e){var t,n,i,o,r=Rc(e.operator);return e.operator===Vs.REMOVE?((t={})[r]=((n={})[e.fieldName]="",n),t):((i={})[r]=((o={})[e.fieldName]=e.operands[0],o),i)},e.prototype.encodeArrayUpdateCommand=function(e){var t,n,i,o,r,a,s,c,u,p,l=Rc(e.operator);switch(e.operator){case Vs.PUSH:var d=void 0;return d=tc(e.operands)?{$each:e.operands.map(zc)}:e.operands,(t={})[l]=((n={})[e.fieldName]=d,n),t;case Vs.UNSHIFT:d={$each:e.operands.map(zc),$position:0};return(i={})[l]=((o={})[e.fieldName]=d,o),i;case Vs.POP:return(r={})[l]=((a={})[e.fieldName]=1,a),r;case Vs.SHIFT:return(s={})[l]=((c={})[e.fieldName]=-1,c),s;default:return(u={})[l]=((p={})[e.fieldName]=zc(e.operands),p),u}},e.prototype.encodeUpdateObject=function(e){var t=Fc(e);for(var n in t)if(!/^\$/.test(n)){var i=t[n];if(xc(i)){t[n]=i._setFieldName(n),Bc(t,this.encodeUpdateCommand(t[n]),n)}else{t[n]=i=zc(i);var o=new bc(Vs.SET,[i],n);Bc(t,this.encodeUpdateCommand(o),n)}}return t},e}(),$c={};function Gc(e){if(!Up.wsClientClass)throw new Error("to use realtime you must import realtime module first");var t=e.config.env;return $c[t]||($c[t]=new Up.wsClientClass({context:{appConfig:{docSizeLimit:1e3,realtimePingInterval:1e4,realtimePongWaitTimeout:5e3,request:new Up.reqClass(e.config)}}})),$c[t]}var Kc=function(){return Kc=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Kc.apply(this,arguments)},Vc=function(){function e(e,t,n,i){var o=this;void 0===i&&(i={}),this.watch=function(e){return Gc(o._db).watch(Kc(Kc({},e),{envId:o._db.config.env,collectionName:o._coll,query:JSON.stringify({_id:o.id})}))},this._db=e,this._coll=t,this.id=n,this.request=new Up.reqClass(this._db.config),this.projection=i}return e.prototype.create=function(e,t){t=t||gc();var n={collectionName:this._coll,data:Pc(e)};return this.id&&(n._id=this.id),this.request.send("database.addDocument",n).then((function(e){e.code?t(0,e):t(0,{id:e.data._id,requestId:e.requestId})})).catch((function(e){t(e)})),t.promise},e.prototype.set=function(e,t){if(t=t||gc(),!this.id)return Promise.resolve({code:"INVALID_PARAM",message:"docId不能为空"});if(!e||"object"!=typeof e)return Promise.resolve({code:"INVALID_PARAM",message:"参数必需是非空对象"});if(e.hasOwnProperty("_id"))return Promise.resolve({code:"INVALID_PARAM",message:"不能更新_id的值"});var n=!1,i=function(e){if("object"==typeof e)for(var t in e)e[t]instanceof bc?n=!0:"object"==typeof e[t]&&i(e[t])};if(i(e),n)return Promise.resolve({code:"DATABASE_REQUEST_FAILED",message:"update operator complicit"});var o={collectionName:this._coll,queryType:hs.DOC,data:Pc(e),multi:!1,merge:!1,upsert:!0};return this.id&&(o.query={_id:this.id}),this.request.send("database.updateDocument",o).then((function(e){e.code?t(0,e):t(0,{updated:e.data.updated,upsertedId:e.data.upserted_id,requestId:e.requestId})})).catch((function(e){t(e)})),t.promise},e.prototype.update=function(e,t){if(t=t||gc(),!e||"object"!=typeof e)return Promise.resolve({code:"INVALID_PARAM",message:"参数必需是非空对象"});if(e.hasOwnProperty("_id"))return Promise.resolve({code:"INVALID_PARAM",message:"不能更新_id的值"});var n={_id:this.id},i={collectionName:this._coll,data:Hc.encode(e),query:n,queryType:hs.DOC,multi:!1,merge:!0,upsert:!1};return this.request.send("database.updateDocument",i).then((function(e){e.code?t(0,e):t(0,{updated:e.data.updated,upsertedId:e.data.upserted_id,requestId:e.requestId})})).catch((function(e){t(e)})),t.promise},e.prototype.remove=function(e){e=e||gc();var t={_id:this.id},n={collectionName:this._coll,query:t,queryType:hs.DOC,multi:!1};return this.request.send("database.deleteDocument",n).then((function(t){t.code?e(0,t):e(0,{deleted:t.data.deleted,requestId:t.requestId})})).catch((function(t){e(t)})),e.promise},e.prototype.get=function(e){e=e||gc();var t={_id:this.id},n={collectionName:this._coll,query:t,queryType:hs.DOC,multi:!1,projection:this.projection};return this.request.send("database.queryDocument",n).then((function(t){if(t.code)e(0,t);else{var n=Ys.formatResDocumentData(t.data.list);e(0,{data:n,requestId:t.requestId,total:t.TotalCount,limit:t.Limit,offset:t.Offset})}})).catch((function(t){e(t)})),e.promise},e.prototype.field=function(t){for(var n in t)t[n]?t[n]=1:t[n]=0;return new e(this._db,this._coll,this.id,t)},e}(),Jc=function(){function e(){}return e.encode=function(e){return(new Yc).encodeQuery(e)},e}(),Yc=function(){function e(){}return e.prototype.encodeQuery=function(e,t){var n;return Wc(e)?_c(e)?this.encodeLogicCommand(e):Ic(e)?this.encodeQueryCommand(e):((n={})[t]=this.encodeQueryObject(e),n):Qs(e)?this.encodeQueryObject(e):e},e.prototype.encodeRegExp=function(e){return{$regex:e.source,$options:e.flags}},e.prototype.encodeLogicCommand=function(e){var t,n,i,o,r,a,s,c=this;switch(e.operator){case yc.NOR:case yc.AND:case yc.OR:var u=Rc(e.operator),p=e.operands.map((function(t){return c.encodeQuery(t,e.fieldName)}));return(t={})[u]=p,t;case yc.NOT:u=Rc(e.operator);var l=e.operands[0];if(ic(l))return(n={})[e.fieldName]=((i={})[u]=this.encodeRegExp(l),i),n;p=this.encodeQuery(l)[e.fieldName];return(o={})[e.fieldName]=((r={})[u]=p,r),o;default:u=Rc(e.operator);if(1===e.operands.length){var d=this.encodeQuery(e.operands[0]);return(a={})[u]=d,a}p=e.operands.map(this.encodeQuery.bind(this));return(s={})[u]=p,s}},e.prototype.encodeQueryCommand=function(e){return Ac(e),this.encodeComparisonCommand(e)},e.prototype.encodeComparisonCommand=function(e){var t,n,i,o,r,a,s,c,u;if(e.fieldName===Ps)throw new Error("Cannot encode a comparison command with unset field name");var p=Rc(e.operator);switch(e.operator){case Ec.EQ:case Ec.NEQ:case Ec.LT:case Ec.LTE:case Ec.GT:case Ec.GTE:case Ec.ELEM_MATCH:case Ec.EXISTS:case Ec.SIZE:case Ec.MOD:return(t={})[e.fieldName]=((n={})[p]=zc(e.operands[0]),n),t;case Ec.IN:case Ec.NIN:case Ec.ALL:return(i={})[e.fieldName]=((o={})[p]=zc(e.operands),o),i;case Ec.GEO_NEAR:var l=e.operands[0];return(r={})[e.fieldName]={$nearSphere:{$geometry:l.geometry.toJSON(),$maxDistance:l.maxDistance,$minDistance:l.minDistance}},r;case Ec.GEO_WITHIN:l=e.operands[0];return(a={})[e.fieldName]={$geoWithin:{$geometry:l.geometry.toJSON()}},a;case Ec.GEO_INTERSECTS:l=e.operands[0];return(s={})[e.fieldName]={$geoIntersects:{$geometry:l.geometry.toJSON()}},s;default:return(c={})[e.fieldName]=((u={})[p]=zc(e.operands[0]),u),c}},e.prototype.encodeQueryObject=function(e){var t=Fc(e);for(var n in t){var i=t[n];if(_c(i)){t[n]=i._setFieldName(n);var o=this.encodeLogicCommand(t[n]);this.mergeConditionAfterEncode(t,o,n)}else if(Ac(i)){t[n]=i._setFieldName(n);o=this.encodeComparisonCommand(t[n]);this.mergeConditionAfterEncode(t,o,n)}else Wc(i)&&(t[n]=zc(i))}return t},e.prototype.mergeConditionAfterEncode=function(e,t,n){for(var i in t[n]||delete e[n],t)e[i]?tc(e[i])?e[i]=e[i].concat(t[i]):Qs(e[i])?Qs(t[i])?Object.assign(e,t):(console.warn("unmergable condition, query is object but condition is "+Zs(t)+", can only overwrite",t,n),e[i]=t[i]):(console.warn("to-merge query is of type "+Zs(e)+", can only overwrite",e,t,n),e[i]=t[i]):e[i]=t[i]},e}(),Xc=function(){return Xc=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Xc.apply(this,arguments)},Zc=function(){function e(e,t,n,i,o){var r=this;this.watch=function(e){return Gc(r._db).watch(Xc(Xc({},e),{envId:r._db.config.env,collectionName:r._coll,query:JSON.stringify(r._fieldFilters||{}),limit:r._queryOptions.limit,orderBy:r._fieldOrders?r._fieldOrders.reduce((function(e,t){return e[t.field]=t.direction,e}),{}):void 0}))},this._db=e,this._coll=t,this._fieldFilters=n,this._fieldOrders=i||[],this._queryOptions=o||{},this._request=new Up.reqClass(this._db.config)}return e.prototype.get=function(e){e=e||gc();var t=[];this._fieldOrders&&this._fieldOrders.forEach((function(e){t.push(e)}));var n={collectionName:this._coll,queryType:hs.WHERE};return this._fieldFilters&&(n.query=this._fieldFilters),t.length>0&&(n.order=t),this._queryOptions.offset&&(n.offset=this._queryOptions.offset),this._queryOptions.limit?n.limit=this._queryOptions.limit<1e3?this._queryOptions.limit:1e3:n.limit=100,this._queryOptions.projection&&(n.projection=this._queryOptions.projection),this._request.send("database.queryDocument",n).then((function(t){if(t.code)e(0,t);else{var n={data:Ys.formatResDocumentData(t.data.list),requestId:t.requestId};t.TotalCount&&(n.total=t.TotalCount),t.Limit&&(n.limit=t.Limit),t.Offset&&(n.offset=t.Offset),e(0,n)}})).catch((function(t){e(t)})),e.promise},e.prototype.count=function(e){e=e||gc();var t={collectionName:this._coll,queryType:hs.WHERE};return this._fieldFilters&&(t.query=this._fieldFilters),this._request.send("database.countDocument",t).then((function(t){t.code?e(0,t):e(0,{requestId:t.requestId,total:t.data.total})})).catch((function(t){e(t)})),e.promise},e.prototype.where=function(t){if("Object"!==Object.prototype.toString.call(t).slice(8,-1))throw Error(us.QueryParamTypeError);var n=Object.keys(t),i=n.some((function(e){return void 0!==t[e]}));if(n.length&&!i)throw Error(us.QueryParamValueError);return new e(this._db,this._coll,Jc.encode(t),this._fieldOrders,this._queryOptions)},e.prototype.orderBy=function(t,n){Xs.isFieldPath(t),Xs.isFieldOrder(n);var i={field:t,direction:n},o=this._fieldOrders.concat(i);return new e(this._db,this._coll,this._fieldFilters,o,this._queryOptions)},e.prototype.limit=function(t){Xs.isInteger("limit",t);var n=Xc({},this._queryOptions);return n.limit=t,new e(this._db,this._coll,this._fieldFilters,this._fieldOrders,n)},e.prototype.skip=function(t){Xs.isInteger("offset",t);var n=Xc({},this._queryOptions);return n.offset=t,new e(this._db,this._coll,this._fieldFilters,this._fieldOrders,n)},e.prototype.update=function(e,t){if(t=t||gc(),!e||"object"!=typeof e)return Promise.resolve({code:"INVALID_PARAM",message:"参数必需是非空对象"});if(e.hasOwnProperty("_id"))return Promise.resolve({code:"INVALID_PARAM",message:"不能更新_id的值"});var n={collectionName:this._coll,query:this._fieldFilters,queryType:hs.WHERE,multi:!0,merge:!0,upsert:!1,data:Hc.encode(e)};return this._request.send("database.updateDocument",n).then((function(e){e.code?t(0,e):t(0,{requestId:e.requestId,updated:e.data.updated,upsertId:e.data.upsert_id})})).catch((function(e){t(e)})),t.promise},e.prototype.field=function(t){for(var n in t)t[n]?"object"!=typeof t[n]&&(t[n]=1):t[n]=0;var i=Xc({},this._queryOptions);return i.projection=t,new e(this._db,this._coll,this._fieldFilters,this._fieldOrders,i)},e.prototype.remove=function(e){e=e||gc(),Object.keys(this._queryOptions).length>0&&console.warn("`offset`, `limit` and `projection` are not supported in remove() operation"),this._fieldOrders.length>0&&console.warn("`orderBy` is not supported in remove() operation");var t={collectionName:this._coll,query:Jc.encode(this._fieldFilters),queryType:hs.WHERE,multi:!0};return this._request.send("database.deleteDocument",t).then((function(t){t.code?e(0,t):e(0,{requestId:t.requestId,deleted:t.data.deleted})})).catch((function(t){e(t)})),e.promise},e}(),Qc=function(e,t){return Qc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},Qc(e,t)};function eu(e,t){function n(){this.constructor=e}Qc(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var tu=function(e){function t(n){var i=e.call(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}return eu(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),t}(Error),nu=function(e){function t(n){var i=e.call(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}return eu(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),t}(TypeError);function iu(e){return e&&e.Math==Math&&e}function ou(){return iu("object"==typeof globalThis&&globalThis)||iu("object"==typeof window&&window)||iu("object"==typeof self&&self)||iu("object"==typeof global&&global)||Function("return this")()}var ru=function(t){var n,i="object"==typeof(n=ou()).navigator&&"ReactNative"===n.navigator.product?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(i);for(var o=e.alloc(t),r=0;r<t;++r)o[r]=Math.floor(256*Math.random());return o},au=function(){var e=void 0;try{e=require("crypto").randomBytes}catch(e){}return e||ru}();function su(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)}function cu(e){return"object"==typeof e&&null!==e}function uu(e,t){var n=!1;return function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return n||(console.warn(t),n=!0),e.apply(this,i)}}function pu(t){if(ArrayBuffer.isView(t))return e.from(t.buffer,t.byteOffset,t.byteLength);if(n=t,["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(n)))return e.from(t);var n;throw new nu("Must use either Buffer or TypedArray")}var lu=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i,du=function(e){return"string"==typeof e&&lu.test(e)},fu=function(t){if(!du(t))throw new nu('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".');var n=t.replace(/-/g,"");return e.from(n,"hex")},hu=function(e,t){return void 0===t&&(t=!0),t?e.toString("hex",0,4)+"-"+e.toString("hex",4,6)+"-"+e.toString("hex",6,8)+"-"+e.toString("hex",8,10)+"-"+e.toString("hex",10,16):e.toString("hex")},mu=Math.pow(2,53),vu=-Math.pow(2,53),gu=function(){function t(n,i){if(!(this instanceof t))return new t(n,i);if(!(null==n||"string"==typeof n||ArrayBuffer.isView(n)||n instanceof ArrayBuffer||Array.isArray(n)))throw new nu("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=null!=i?i:t.BSON_BINARY_SUBTYPE_DEFAULT,null==n?(this.buffer=e.alloc(t.BUFFER_SIZE),this.position=0):("string"==typeof n?this.buffer=e.from(n,"binary"):Array.isArray(n)?this.buffer=e.from(n):this.buffer=pu(n),this.position=this.buffer.byteLength)}return t.prototype.put=function(n){if("string"==typeof n&&1!==n.length)throw new nu("only accepts single character String");if("number"!=typeof n&&1!==n.length)throw new nu("only accepts single character Uint8Array or Array");var i;if((i="string"==typeof n?n.charCodeAt(0):"number"==typeof n?n:n[0])<0||i>255)throw new nu("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=i;else{var o=e.alloc(t.BUFFER_SIZE+this.buffer.length);this.buffer.copy(o,0,0,this.buffer.length),this.buffer=o,this.buffer[this.position++]=i}},t.prototype.write=function(t,n){if(n="number"==typeof n?n:this.position,this.buffer.length<n+t.length){var i=e.alloc(this.buffer.length+t.length);this.buffer.copy(i,0,0,this.buffer.length),this.buffer=i}ArrayBuffer.isView(t)?(this.buffer.set(pu(t),n),this.position=n+t.byteLength>this.position?n+t.length:this.position):"string"==typeof t&&(this.buffer.write(t,n,t.length,"binary"),this.position=n+t.length>this.position?n+t.length:this.position)},t.prototype.read=function(e,t){return t=t&&t>0?t:this.position,this.buffer.slice(e,e+t)},t.prototype.value=function(e){return(e=!!e)&&this.buffer.length===this.position?this.buffer:e?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)},t.prototype.length=function(){return this.position},t.prototype.toJSON=function(){return this.buffer.toString("base64")},t.prototype.toString=function(e){return this.buffer.toString(e)},t.prototype.toExtendedJSON=function(e){e=e||{};var t=this.buffer.toString("base64"),n=Number(this.sub_type).toString(16);return e.legacy?{$binary:t,$type:1===n.length?"0"+n:n}:{$binary:{base64:t,subType:1===n.length?"0"+n:n}}},t.prototype.toUUID=function(){if(this.sub_type===t.SUBTYPE_UUID)return new yu(this.buffer.slice(0,this.position));throw new tu('Binary sub_type "'.concat(this.sub_type,'" is not supported for converting to UUID. Only "').concat(t.SUBTYPE_UUID,'" is currently supported.'))},t.fromExtendedJSON=function(n,i){var o,r;if(i=i||{},"$binary"in n?i.legacy&&"string"==typeof n.$binary&&"$type"in n?(r=n.$type?parseInt(n.$type,16):0,o=e.from(n.$binary,"base64")):"string"!=typeof n.$binary&&(r=n.$binary.subType?parseInt(n.$binary.subType,16):0,o=e.from(n.$binary.base64,"base64")):"$uuid"in n&&(r=4,o=fu(n.$uuid)),!o)throw new nu("Unexpected Binary Extended JSON format ".concat(JSON.stringify(n)));return 4===r?new yu(o):new t(o,r)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.value(!0);return'new Binary(Buffer.from("'.concat(e.toString("hex"),'", "hex"), ').concat(this.sub_type,")")},t.BSON_BINARY_SUBTYPE_DEFAULT=0,t.BUFFER_SIZE=256,t.SUBTYPE_DEFAULT=0,t.SUBTYPE_FUNCTION=1,t.SUBTYPE_BYTE_ARRAY=2,t.SUBTYPE_UUID_OLD=3,t.SUBTYPE_UUID=4,t.SUBTYPE_MD5=5,t.SUBTYPE_ENCRYPTED=6,t.SUBTYPE_COLUMN=7,t.SUBTYPE_USER_DEFINED=128,t}();Object.defineProperty(gu.prototype,"_bsontype",{value:"Binary"});var yu=function(t){function n(i){var o,r,a=this;if(null==i)o=n.generate();else if(i instanceof n)o=e.from(i.buffer),r=i.__id;else if(ArrayBuffer.isView(i)&&16===i.byteLength)o=pu(i);else{if("string"!=typeof i)throw new nu("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");o=fu(i)}return(a=t.call(this,o,4)||this).__id=r,a}return eu(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.buffer},set:function(e){this.buffer=e,n.cacheHexString&&(this.__id=hu(e))},enumerable:!1,configurable:!0}),n.prototype.toHexString=function(e){if(void 0===e&&(e=!0),n.cacheHexString&&this.__id)return this.__id;var t=hu(this.id,e);return n.cacheHexString&&(this.__id=t),t},n.prototype.toString=function(e){return e?this.id.toString(e):this.toHexString()},n.prototype.toJSON=function(){return this.toHexString()},n.prototype.equals=function(e){if(!e)return!1;if(e instanceof n)return e.id.equals(this.id);try{return new n(e).id.equals(this.id)}catch(e){return!1}},n.prototype.toBinary=function(){return new gu(this.id,gu.SUBTYPE_UUID)},n.generate=function(){var t=au(16);return t[6]=15&t[6]|64,t[8]=63&t[8]|128,e.from(t)},n.isValid=function(e){return!!e&&(e instanceof n||("string"==typeof e?du(e):!!su(e)&&(16===e.length&&(64==(240&e[6])&&128==(128&e[8])))))},n.createFromHexString=function(e){return new n(fu(e))},n.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},n.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},n}(gu),bu=function(){function e(t,n){if(!(this instanceof e))return new e(t,n);this.code=t,this.scope=n}return e.prototype.toJSON=function(){return{code:this.code,scope:this.scope}},e.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},e.fromExtendedJSON=function(t){return new e(t.$code,t.$scope)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var e=this.toJSON();return'new Code("'.concat(String(e.code),'"').concat(e.scope?", ".concat(JSON.stringify(e.scope)):"",")")},e}();Object.defineProperty(bu.prototype,"_bsontype",{value:"Code"});var xu=function(){function e(t,n,i,o){if(!(this instanceof e))return new e(t,n,i,o);var r=t.split(".");2===r.length&&(i=r.shift(),t=r.shift()),this.collection=t,this.oid=n,this.db=i,this.fields=o||{}}return Object.defineProperty(e.prototype,"namespace",{get:function(){return this.collection},set:function(e){this.collection=e},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){var e=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return null!=this.db&&(e.$db=this.db),e},e.prototype.toExtendedJSON=function(e){e=e||{};var t={$ref:this.collection,$id:this.oid};return e.legacy?t:(this.db&&(t.$db=this.db),t=Object.assign(t,this.fields))},e.fromExtendedJSON=function(t){var n=Object.assign({},t);return delete n.$ref,delete n.$id,delete n.$db,new e(t.$ref,t.$id,t.$db,n)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var e=void 0===this.oid||void 0===this.oid.toString?this.oid:this.oid.toString();return'new DBRef("'.concat(this.namespace,'", new ObjectId("').concat(String(e),'")').concat(this.db?', "'.concat(this.db,'"'):"",")")},e}();Object.defineProperty(xu.prototype,"_bsontype",{value:"DBRef"});var wu=void 0;try{wu=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(cs){}var _u=4294967296,Eu=0x10000000000000000,Su=Eu/2,Ou={},Iu={},Au=function(){function e(t,n,i){if(void 0===t&&(t=0),!(this instanceof e))return new e(t,n,i);"bigint"==typeof t?Object.assign(this,e.fromBigInt(t,!!n)):"string"==typeof t?Object.assign(this,e.fromString(t,!!n)):(this.low=0|t,this.high=0|n,this.unsigned=!!i),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return e.fromBits=function(t,n,i){return new e(t,n,i)},e.fromInt=function(t,n){var i,o,r;return n?(r=0<=(t>>>=0)&&t<256)&&(o=Iu[t])?o:(i=e.fromBits(t,(0|t)<0?-1:0,!0),r&&(Iu[t]=i),i):(r=-128<=(t|=0)&&t<128)&&(o=Ou[t])?o:(i=e.fromBits(t,t<0?-1:0,!1),r&&(Ou[t]=i),i)},e.fromNumber=function(t,n){if(isNaN(t))return n?e.UZERO:e.ZERO;if(n){if(t<0)return e.UZERO;if(t>=Eu)return e.MAX_UNSIGNED_VALUE}else{if(t<=-Su)return e.MIN_VALUE;if(t+1>=Su)return e.MAX_VALUE}return t<0?e.fromNumber(-t,n).neg():e.fromBits(t%_u|0,t/_u|0,n)},e.fromBigInt=function(t,n){return e.fromString(t.toString(),n)},e.fromString=function(t,n,i){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return e.ZERO;if("number"==typeof n?(i=n,n=!1):n=!!n,(i=i||10)<2||36<i)throw RangeError("radix");var o;if((o=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===o)return e.fromString(t.substring(1),n,i).neg();for(var r=e.fromNumber(Math.pow(i,8)),a=e.ZERO,s=0;s<t.length;s+=8){var c=Math.min(8,t.length-s),u=parseInt(t.substring(s,s+c),i);if(c<8){var p=e.fromNumber(Math.pow(i,c));a=a.mul(p).add(e.fromNumber(u))}else a=(a=a.mul(r)).add(e.fromNumber(u))}return a.unsigned=n,a},e.fromBytes=function(t,n,i){return i?e.fromBytesLE(t,n):e.fromBytesBE(t,n)},e.fromBytesLE=function(t,n){return new e(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,n)},e.fromBytesBE=function(t,n){return new e(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],n)},e.isLong=function(e){return cu(e)&&!0===e.__isLong__},e.fromValue=function(t,n){return"number"==typeof t?e.fromNumber(t,n):"string"==typeof t?e.fromString(t,n):e.fromBits(t.low,t.high,"boolean"==typeof n?n:t.unsigned)},e.prototype.add=function(t){e.isLong(t)||(t=e.fromValue(t));var n=this.high>>>16,i=65535&this.high,o=this.low>>>16,r=65535&this.low,a=t.high>>>16,s=65535&t.high,c=t.low>>>16,u=0,p=0,l=0,d=0;return l+=(d+=r+(65535&t.low))>>>16,d&=65535,p+=(l+=o+c)>>>16,l&=65535,u+=(p+=i+s)>>>16,p&=65535,u+=n+a,u&=65535,e.fromBits(l<<16|d,u<<16|p,this.unsigned)},e.prototype.and=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low&t.low,this.high&t.high,this.unsigned)},e.prototype.compare=function(t){if(e.isLong(t)||(t=e.fromValue(t)),this.eq(t))return 0;var n=this.isNegative(),i=t.isNegative();return n&&!i?-1:!n&&i?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.prototype.comp=function(e){return this.compare(e)},e.prototype.divide=function(t){if(e.isLong(t)||(t=e.fromValue(t)),t.isZero())throw Error("division by zero");if(wu){if(!this.unsigned&&-2147483648===this.high&&-1===t.low&&-1===t.high)return this;var n=(this.unsigned?wu.div_u:wu.div_s)(this.low,this.high,t.low,t.high);return e.fromBits(n,wu.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var i,o,r;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return e.UZERO;if(t.gt(this.shru(1)))return e.UONE;r=e.UZERO}else{if(this.eq(e.MIN_VALUE))return t.eq(e.ONE)||t.eq(e.NEG_ONE)?e.MIN_VALUE:t.eq(e.MIN_VALUE)?e.ONE:(i=this.shr(1).div(t).shl(1)).eq(e.ZERO)?t.isNegative()?e.ONE:e.NEG_ONE:(o=this.sub(t.mul(i)),r=i.add(o.div(t)));if(t.eq(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;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();r=e.ZERO}for(o=this;o.gte(t);){i=Math.max(1,Math.floor(o.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(i)/Math.LN2),s=a<=48?1:Math.pow(2,a-48),c=e.fromNumber(i),u=c.mul(t);u.isNegative()||u.gt(o);)i-=s,u=(c=e.fromNumber(i,this.unsigned)).mul(t);c.isZero()&&(c=e.ONE),r=r.add(c),o=o.sub(u)}return r},e.prototype.div=function(e){return this.divide(e)},e.prototype.equals=function(t){return e.isLong(t)||(t=e.fromValue(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},e.prototype.eq=function(e){return this.equals(e)},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(e.MIN_VALUE)?64:this.neg().getNumBitsAbs();var t,n=0!==this.high?this.high:this.low;for(t=31;t>0&&0==(n&1<<t);t--);return 0!==this.high?t+33:t+1},e.prototype.greaterThan=function(e){return this.comp(e)>0},e.prototype.gt=function(e){return this.greaterThan(e)},e.prototype.greaterThanOrEqual=function(e){return this.comp(e)>=0},e.prototype.gte=function(e){return this.greaterThanOrEqual(e)},e.prototype.ge=function(e){return this.greaterThanOrEqual(e)},e.prototype.isEven=function(){return 0==(1&this.low)},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isOdd=function(){return 1==(1&this.low)},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isZero=function(){return 0===this.high&&0===this.low},e.prototype.lessThan=function(e){return this.comp(e)<0},e.prototype.lt=function(e){return this.lessThan(e)},e.prototype.lessThanOrEqual=function(e){return this.comp(e)<=0},e.prototype.lte=function(e){return this.lessThanOrEqual(e)},e.prototype.modulo=function(t){if(e.isLong(t)||(t=e.fromValue(t)),wu){var n=(this.unsigned?wu.rem_u:wu.rem_s)(this.low,this.high,t.low,t.high);return e.fromBits(n,wu.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},e.prototype.mod=function(e){return this.modulo(e)},e.prototype.rem=function(e){return this.modulo(e)},e.prototype.multiply=function(t){if(this.isZero())return e.ZERO;if(e.isLong(t)||(t=e.fromValue(t)),wu){var n=wu.mul(this.low,this.high,t.low,t.high);return e.fromBits(n,wu.get_high(),this.unsigned)}if(t.isZero())return e.ZERO;if(this.eq(e.MIN_VALUE))return t.isOdd()?e.MIN_VALUE:e.ZERO;if(t.eq(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;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(e.TWO_PWR_24)&&t.lt(e.TWO_PWR_24))return e.fromNumber(this.toNumber()*t.toNumber(),this.unsigned);var i=this.high>>>16,o=65535&this.high,r=this.low>>>16,a=65535&this.low,s=t.high>>>16,c=65535&t.high,u=t.low>>>16,p=65535&t.low,l=0,d=0,f=0,h=0;return f+=(h+=a*p)>>>16,h&=65535,d+=(f+=r*p)>>>16,f&=65535,d+=(f+=a*u)>>>16,f&=65535,l+=(d+=o*p)>>>16,d&=65535,l+=(d+=r*u)>>>16,d&=65535,l+=(d+=a*c)>>>16,d&=65535,l+=i*p+o*u+r*c+a*s,l&=65535,e.fromBits(f<<16|h,l<<16|d,this.unsigned)},e.prototype.mul=function(e){return this.multiply(e)},e.prototype.negate=function(){return!this.unsigned&&this.eq(e.MIN_VALUE)?e.MIN_VALUE:this.not().add(e.ONE)},e.prototype.neg=function(){return this.negate()},e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.notEquals=function(e){return!this.equals(e)},e.prototype.neq=function(e){return this.notEquals(e)},e.prototype.ne=function(e){return this.notEquals(e)},e.prototype.or=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low|t.low,this.high|t.high,this.unsigned)},e.prototype.shiftLeft=function(t){return e.isLong(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?e.fromBits(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):e.fromBits(0,this.low<<t-32,this.unsigned)},e.prototype.shl=function(e){return this.shiftLeft(e)},e.prototype.shiftRight=function(t){return e.isLong(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?e.fromBits(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):e.fromBits(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=function(e){return this.shiftRight(e)},e.prototype.shiftRightUnsigned=function(t){if(e.isLong(t)&&(t=t.toInt()),0===(t&=63))return this;var n=this.high;if(t<32){var i=this.low;return e.fromBits(i>>>t|n<<32-t,n>>>t,this.unsigned)}return 32===t?e.fromBits(n,0,this.unsigned):e.fromBits(n>>>t-32,0,this.unsigned)},e.prototype.shr_u=function(e){return this.shiftRightUnsigned(e)},e.prototype.shru=function(e){return this.shiftRightUnsigned(e)},e.prototype.subtract=function(t){return e.isLong(t)||(t=e.fromValue(t)),this.add(t.neg())},e.prototype.sub=function(e){return this.subtract(e)},e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*_u+(this.low>>>0):this.high*_u+(this.low>>>0)},e.prototype.toBigInt=function(){return BigInt(this.toString())},e.prototype.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},e.prototype.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},e.prototype.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},e.prototype.toSigned=function(){return this.unsigned?e.fromBits(this.low,this.high,!1):this},e.prototype.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(e.MIN_VALUE)){var n=e.fromNumber(t),i=this.div(n),o=i.mul(n).sub(this);return i.toString(t)+o.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var r=e.fromNumber(Math.pow(t,6),this.unsigned),a=this,s="";;){var c=a.div(r),u=(a.sub(c.mul(r)).toInt()>>>0).toString(t);if((a=c).isZero())return u+s;for(;u.length<6;)u="0"+u;s=""+u+s}},e.prototype.toUnsigned=function(){return this.unsigned?this:e.fromBits(this.low,this.high,!0)},e.prototype.xor=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low^t.low,this.high^t.high,this.unsigned)},e.prototype.eqz=function(){return this.isZero()},e.prototype.le=function(e){return this.lessThanOrEqual(e)},e.prototype.toExtendedJSON=function(e){return e&&e.relaxed?this.toNumber():{$numberLong:this.toString()}},e.fromExtendedJSON=function(t,n){var i=e.fromString(t.$numberLong);return n&&n.relaxed?i.toNumber():i},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new Long("'.concat(this.toString(),'"').concat(this.unsigned?", true":"",")")},e.TWO_PWR_24=e.fromInt(16777216),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e}();Object.defineProperty(Au.prototype,"__isLong__",{value:!0}),Object.defineProperty(Au.prototype,"_bsontype",{value:"Long"});var Tu=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,Nu=/^(\+|-)?(Infinity|inf)$/i,Ru=/^(\+|-)?NaN$/i,ku=6111,ju=-6176,Cu=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Pu=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Lu=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Uu=/^([-+])?(\d+)?$/;function Du(e){return!isNaN(parseInt(e,10))}function qu(e){var t=Au.fromNumber(1e9),n=Au.fromNumber(0);if(!(e.parts[0]||e.parts[1]||e.parts[2]||e.parts[3]))return{quotient:e,rem:n};for(var i=0;i<=3;i++)n=(n=n.shiftLeft(32)).add(new Au(e.parts[i],0)),e.parts[i]=n.div(t).low,n=n.modulo(t);return{quotient:e,rem:n}}function Mu(e,t){throw new nu('"'.concat(e,'" is not a valid Decimal128 string - ').concat(t))}var Fu=function(){function t(e){if(!(this instanceof t))return new t(e);if("string"==typeof e)this.bytes=t.fromString(e).bytes;else{if(!su(e))throw new nu("Decimal128 must take a Buffer or string");if(16!==e.byteLength)throw new nu("Decimal128 must take a Buffer of 16 bytes");this.bytes=e}}return t.fromString=function(n){var i,o=!1,r=!1,a=!1,s=0,c=0,u=0,p=0,l=0,d=[0],f=0,h=0,m=0,v=0,g=0,y=0,b=new Au(0,0),x=new Au(0,0),w=0;if(n.length>=7e3)throw new nu(n+" not a valid Decimal128 string");var _=n.match(Tu),E=n.match(Nu),S=n.match(Ru);if(!_&&!E&&!S||0===n.length)throw new nu(n+" not a valid Decimal128 string");if(_){var O=_[2],I=_[4],A=_[5],T=_[6];I&&void 0===T&&Mu(n,"missing exponent power"),I&&void 0===O&&Mu(n,"missing exponent base"),void 0===I&&(A||T)&&Mu(n,"missing e before exponent")}if("+"!==n[w]&&"-"!==n[w]||(o="-"===n[w++]),!Du(n[w])&&"."!==n[w]){if("i"===n[w]||"I"===n[w])return new t(e.from(o?Pu:Lu));if("N"===n[w])return new t(e.from(Cu))}for(;Du(n[w])||"."===n[w];)"."!==n[w]?(f<34&&("0"!==n[w]||a)&&(a||(l=c),a=!0,d[h++]=parseInt(n[w],10),f+=1),a&&(u+=1),r&&(p+=1),c+=1,w+=1):(r&&Mu(n,"contains multiple periods"),r=!0,w+=1);if(r&&!c)throw new nu(n+" not a valid Decimal128 string");if("e"===n[w]||"E"===n[w]){var N=n.substr(++w).match(Uu);if(!N||!N[2])return new t(e.from(Cu));g=parseInt(N[0],10),w+=N[0].length}if(n[w])return new t(e.from(Cu));if(m=0,f){if(v=f-1,1!==(s=u))for(;0===d[l+s-1];)s-=1}else m=0,v=0,d[0]=0,u=1,f=1,s=0;for(g<=p&&p-g>16384?g=ju:g-=p;g>ku;){if((v+=1)-m>34){if(d.join("").match(/^0+$/)){g=ku;break}Mu(n,"overflow")}g-=1}for(;g<ju||f<u;){if(0===v&&s<f){g=ju,s=0;break}if(f<u?u-=1:v-=1,g<ku)g+=1;else{if(d.join("").match(/^0+$/)){g=ku;break}Mu(n,"overflow")}}if(v-m+1<s){var R=c;r&&(l+=1,R+=1),o&&(l+=1,R+=1);var k=parseInt(n[l+v+1],10),j=0;if(k>=5&&(j=1,5===k))for(j=d[v]%2==1?1:0,y=l+v+2;y<R;y++)if(parseInt(n[y],10)){j=1;break}if(j)for(var C=v;C>=0;C--)if(++d[C]>9&&(d[C]=0,0===C)){if(!(g<ku))return new t(e.from(o?Pu:Lu));g+=1,d[C]=1}}if(b=Au.fromNumber(0),x=Au.fromNumber(0),0===s)b=Au.fromNumber(0),x=Au.fromNumber(0);else if(v-m<17){C=m;for(x=Au.fromNumber(d[C++]),b=new Au(0,0);C<=v;C++)x=(x=x.multiply(Au.fromNumber(10))).add(Au.fromNumber(d[C]))}else{C=m;for(b=Au.fromNumber(d[C++]);C<=v-17;C++)b=(b=b.multiply(Au.fromNumber(10))).add(Au.fromNumber(d[C]));for(x=Au.fromNumber(d[C++]);C<=v;C++)x=(x=x.multiply(Au.fromNumber(10))).add(Au.fromNumber(d[C]))}var P,L,U,D,q=function(e,t){if(!e&&!t)return{high:Au.fromNumber(0),low:Au.fromNumber(0)};var n=e.shiftRightUnsigned(32),i=new Au(e.getLowBits(),0),o=t.shiftRightUnsigned(32),r=new Au(t.getLowBits(),0),a=n.multiply(o),s=n.multiply(r),c=i.multiply(o),u=i.multiply(r);return a=a.add(s.shiftRightUnsigned(32)),s=new Au(s.getLowBits(),0).add(c).add(u.shiftRightUnsigned(32)),{high:a=a.add(s.shiftRightUnsigned(32)),low:u=s.shiftLeft(32).add(new Au(u.getLowBits(),0))}}(b,Au.fromString("100000000000000000"));q.low=q.low.add(x),P=q.low,L=x,U=P.high>>>0,D=L.high>>>0,(U<D||U===D&&P.low>>>0<L.low>>>0)&&(q.high=q.high.add(Au.fromNumber(1))),i=g+6176;var M={low:Au.fromNumber(0),high:Au.fromNumber(0)};q.high.shiftRightUnsigned(49).and(Au.fromNumber(1)).equals(Au.fromNumber(1))?(M.high=M.high.or(Au.fromNumber(3).shiftLeft(61)),M.high=M.high.or(Au.fromNumber(i).and(Au.fromNumber(16383).shiftLeft(47))),M.high=M.high.or(q.high.and(Au.fromNumber(0x7fffffffffff)))):(M.high=M.high.or(Au.fromNumber(16383&i).shiftLeft(49)),M.high=M.high.or(q.high.and(Au.fromNumber(562949953421311)))),M.low=q.low,o&&(M.high=M.high.or(Au.fromString("9223372036854775808")));var F=e.alloc(16);return w=0,F[w++]=255&M.low.low,F[w++]=M.low.low>>8&255,F[w++]=M.low.low>>16&255,F[w++]=M.low.low>>24&255,F[w++]=255&M.low.high,F[w++]=M.low.high>>8&255,F[w++]=M.low.high>>16&255,F[w++]=M.low.high>>24&255,F[w++]=255&M.high.low,F[w++]=M.high.low>>8&255,F[w++]=M.high.low>>16&255,F[w++]=M.high.low>>24&255,F[w++]=255&M.high.high,F[w++]=M.high.high>>8&255,F[w++]=M.high.high>>16&255,F[w++]=M.high.high>>24&255,new t(F)},t.prototype.toString=function(){for(var e,t=0,n=new Array(36),i=0;i<n.length;i++)n[i]=0;var o,r,a,s=0,c=!1,u={parts:[0,0,0,0]},p=[];s=0;var l=this.bytes,d=l[s++]|l[s++]<<8|l[s++]<<16|l[s++]<<24,f=l[s++]|l[s++]<<8|l[s++]<<16|l[s++]<<24,h=l[s++]|l[s++]<<8|l[s++]<<16|l[s++]<<24,m=l[s++]|l[s++]<<8|l[s++]<<16|l[s++]<<24;s=0,{low:new Au(d,f),high:new Au(h,m)}.high.lessThan(Au.ZERO)&&p.push("-");var v=m>>26&31;if(v>>3==3){if(30===v)return p.join("")+"Infinity";if(31===v)return"NaN";e=m>>15&16383,o=8+(m>>14&1)}else o=m>>14&7,e=m>>17&16383;var g=e-6176;if(u.parts[0]=(16383&m)+((15&o)<<14),u.parts[1]=h,u.parts[2]=f,u.parts[3]=d,0===u.parts[0]&&0===u.parts[1]&&0===u.parts[2]&&0===u.parts[3])c=!0;else for(a=3;a>=0;a--){var y=0,b=qu(u);if(u=b.quotient,y=b.rem.low)for(r=8;r>=0;r--)n[9*a+r]=y%10,y=Math.floor(y/10)}if(c)t=1,n[s]=0;else for(t=36;!n[s];)t-=1,s+=1;var x=t-1+g;if(x>=34||x<=-7||g>0){if(t>34)return p.push("".concat(0)),g>0?p.push("E+".concat(g)):g<0&&p.push("E".concat(g)),p.join("");p.push("".concat(n[s++])),(t-=1)&&p.push(".");for(i=0;i<t;i++)p.push("".concat(n[s++]));p.push("E"),x>0?p.push("+".concat(x)):p.push("".concat(x))}else if(g>=0)for(i=0;i<t;i++)p.push("".concat(n[s++]));else{var w=t+g;if(w>0)for(i=0;i<w;i++)p.push("".concat(n[s++]));else p.push("0");for(p.push(".");w++<0;)p.push("0");for(i=0;i<t-Math.max(w-1,0);i++)p.push("".concat(n[s++]))}return p.join("")},t.prototype.toJSON=function(){return{$numberDecimal:this.toString()}},t.prototype.toExtendedJSON=function(){return{$numberDecimal:this.toString()}},t.fromExtendedJSON=function(e){return t.fromString(e.$numberDecimal)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Decimal128("'.concat(this.toString(),'")')},t}();Object.defineProperty(Fu.prototype,"_bsontype",{value:"Decimal128"});var Bu=function(){function e(t){if(!(this instanceof e))return new e(t);t instanceof Number&&(t=t.valueOf()),this.value=+t}return e.prototype.valueOf=function(){return this.value},e.prototype.toJSON=function(){return this.value},e.prototype.toString=function(e){return this.value.toString(e)},e.prototype.toExtendedJSON=function(e){return e&&(e.legacy||e.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-".concat(this.value.toFixed(1))}:{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}},e.fromExtendedJSON=function(t,n){var i=parseFloat(t.$numberDouble);return n&&n.relaxed?i:new e(i)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var e=this.toExtendedJSON();return"new Double(".concat(e.$numberDouble,")")},e}();Object.defineProperty(Bu.prototype,"_bsontype",{value:"Double"});var Wu=function(){function e(t){if(!(this instanceof e))return new e(t);t instanceof Number&&(t=t.valueOf()),this.value=0|+t}return e.prototype.valueOf=function(){return this.value},e.prototype.toString=function(e){return this.value.toString(e)},e.prototype.toJSON=function(){return this.value},e.prototype.toExtendedJSON=function(e){return e&&(e.relaxed||e.legacy)?this.value:{$numberInt:this.value.toString()}},e.fromExtendedJSON=function(t,n){return n&&n.relaxed?parseInt(t.$numberInt,10):new e(t.$numberInt)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new Int32(".concat(this.valueOf(),")")},e}();Object.defineProperty(Wu.prototype,"_bsontype",{value:"Int32"});var zu=function(){function e(){if(!(this instanceof e))return new e}return e.prototype.toExtendedJSON=function(){return{$maxKey:1}},e.fromExtendedJSON=function(){return new e},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new MaxKey()"},e}();Object.defineProperty(zu.prototype,"_bsontype",{value:"MaxKey"});var Hu=function(){function e(){if(!(this instanceof e))return new e}return e.prototype.toExtendedJSON=function(){return{$minKey:1}},e.fromExtendedJSON=function(){return new e},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new MinKey()"},e}();Object.defineProperty(Hu.prototype,"_bsontype",{value:"MinKey"});var $u=new RegExp("^[0-9a-fA-F]{24}$"),Gu=null,Ku=Symbol("id"),Vu=function(){function t(n){if(!(this instanceof t))return new t(n);var i;if("object"==typeof n&&n&&"id"in n){if("string"!=typeof n.id&&!ArrayBuffer.isView(n.id))throw new nu("Argument passed in must have an id that is of type string or Buffer");i="toHexString"in n&&"function"==typeof n.toHexString?e.from(n.toHexString(),"hex"):n.id}else i=n;if(null==i||"number"==typeof i)this[Ku]=t.generate("number"==typeof i?i:void 0);else if(ArrayBuffer.isView(i)&&12===i.byteLength)this[Ku]=i instanceof e?i:pu(i);else{if("string"!=typeof i)throw new nu("Argument passed in does not match the accepted types");if(12===i.length){var o=e.from(i);if(12!==o.byteLength)throw new nu("Argument passed in must be a string of 12 bytes");this[Ku]=o}else{if(24!==i.length||!$u.test(i))throw new nu("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");this[Ku]=e.from(i,"hex")}}t.cacheHexString&&(this.__id=this.id.toString("hex"))}return Object.defineProperty(t.prototype,"id",{get:function(){return this[Ku]},set:function(e){this[Ku]=e,t.cacheHexString&&(this.__id=e.toString("hex"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generationTime",{get:function(){return this.id.readInt32BE(0)},set:function(e){this.id.writeUInt32BE(e,0)},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(){if(t.cacheHexString&&this.__id)return this.__id;var e=this.id.toString("hex");return t.cacheHexString&&!this.__id&&(this.__id=e),e},t.getInc=function(){return t.index=(t.index+1)%16777215},t.generate=function(n){"number"!=typeof n&&(n=Math.floor(Date.now()/1e3));var i=t.getInc(),o=e.alloc(12);return o.writeUInt32BE(n,0),null===Gu&&(Gu=au(5)),o[4]=Gu[0],o[5]=Gu[1],o[6]=Gu[2],o[7]=Gu[3],o[8]=Gu[4],o[11]=255&i,o[10]=i>>8&255,o[9]=i>>16&255,o},t.prototype.toString=function(e){return e?this.id.toString(e):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(n){if(null==n)return!1;if(n instanceof t)return this[Ku][11]===n[Ku][11]&&this[Ku].equals(n[Ku]);if("string"==typeof n&&t.isValid(n)&&12===n.length&&su(this.id))return n===e.prototype.toString.call(this.id,"latin1");if("string"==typeof n&&t.isValid(n)&&24===n.length)return n.toLowerCase()===this.toHexString();if("string"==typeof n&&t.isValid(n)&&12===n.length)return e.from(n).equals(this.id);if("object"==typeof n&&"toHexString"in n&&"function"==typeof n.toHexString){var i=n.toHexString(),o=this.toHexString().toLowerCase();return"string"==typeof i&&i.toLowerCase()===o}return!1},t.prototype.getTimestamp=function(){var e=new Date,t=this.id.readUInt32BE(0);return e.setTime(1e3*Math.floor(t)),e},t.createPk=function(){return new t},t.createFromTime=function(n){var i=e.from([0,0,0,0,0,0,0,0,0,0,0,0]);return i.writeUInt32BE(n,0),new t(i)},t.createFromHexString=function(n){if(void 0===n||null!=n&&24!==n.length)throw new nu("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new t(e.from(n,"hex"))},t.isValid=function(e){if(null==e)return!1;try{return new t(e),!0}catch(e){return!1}},t.prototype.toExtendedJSON=function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}},t.fromExtendedJSON=function(e){return new t(e.$oid)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new ObjectId("'.concat(this.toHexString(),'")')},t.index=Math.floor(16777215*Math.random()),t}();Object.defineProperty(Vu.prototype,"generate",{value:uu((function(e){return Vu.generate(e)}),"Please use the static `ObjectId.generate(time)` instead")}),Object.defineProperty(Vu.prototype,"getInc",{value:uu((function(){return Vu.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(Vu.prototype,"get_inc",{value:uu((function(){return Vu.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(Vu,"get_inc",{value:uu((function(){return Vu.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(Vu.prototype,"_bsontype",{value:"ObjectID"});var Ju=function(){function e(t,n){if(!(this instanceof e))return new e(t,n);if(this.pattern=t,this.options=(null!=n?n:"").split("").sort().join(""),-1!==this.pattern.indexOf("\0"))throw new tu("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(-1!==this.options.indexOf("\0"))throw new tu("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var i=0;i<this.options.length;i++)if("i"!==this.options[i]&&"m"!==this.options[i]&&"x"!==this.options[i]&&"l"!==this.options[i]&&"s"!==this.options[i]&&"u"!==this.options[i])throw new tu("The regular expression option [".concat(this.options[i],"] is not supported"))}return e.parseOptions=function(e){return e?e.split("").sort().join(""):""},e.prototype.toExtendedJSON=function(e){return(e=e||{}).legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},e.fromExtendedJSON=function(t){if("$regex"in t){if("string"==typeof t.$regex)return new e(t.$regex,e.parseOptions(t.$options));if("BSONRegExp"===t.$regex._bsontype)return t}if("$regularExpression"in t)return new e(t.$regularExpression.pattern,e.parseOptions(t.$regularExpression.options));throw new nu("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(t)))},e}();Object.defineProperty(Ju.prototype,"_bsontype",{value:"BSONRegExp"});var Yu=function(){function e(t){if(!(this instanceof e))return new e(t);this.value=t}return e.prototype.valueOf=function(){return this.value},e.prototype.toString=function(){return this.value},e.prototype.inspect=function(){return'new BSONSymbol("'.concat(this.value,'")')},e.prototype.toJSON=function(){return this.value},e.prototype.toExtendedJSON=function(){return{$symbol:this.value}},e.fromExtendedJSON=function(t){return new e(t.$symbol)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e}();Object.defineProperty(Yu.prototype,"_bsontype",{value:"Symbol"});var Xu=function(e){function t(n,i){var o=this;return o instanceof t?(o=Au.isLong(n)?e.call(this,n.low,n.high,!0)||this:cu(n)&&void 0!==n.t&&void 0!==n.i?e.call(this,n.i,n.t,!0)||this:e.call(this,n,i,!0)||this,Object.defineProperty(o,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1}),o):new t(n,i)}return eu(t,e),t.prototype.toJSON=function(){return{$timestamp:this.toString()}},t.fromInt=function(e){return new t(Au.fromInt(e,!0))},t.fromNumber=function(e){return new t(Au.fromNumber(e,!0))},t.fromBits=function(e,n){return new t(e,n)},t.fromString=function(e,n){return new t(Au.fromString(e,!0,n))},t.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},t.fromExtendedJSON=function(e){return new t(e.$timestamp)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Timestamp({ t: ".concat(this.getHighBits(),", i: ").concat(this.getLowBits()," })")},t.MAX_VALUE=Au.MAX_UNSIGNED_VALUE,t}(Au);var Zu=2147483647,Qu=-2147483648,ep=0x8000000000000000,tp=-0x8000000000000000,np={$oid:Vu,$binary:gu,$uuid:gu,$symbol:Yu,$numberInt:Wu,$numberDecimal:Fu,$numberDouble:Bu,$numberLong:Au,$minKey:Hu,$maxKey:zu,$regex:Ju,$regularExpression:Ju,$timestamp:Xu};function ip(e,t){if(void 0===t&&(t={}),"number"==typeof e){if(t.relaxed||t.legacy)return e;if(Math.floor(e)===e){if(e>=Qu&&e<=Zu)return new Wu(e);if(e>=tp&&e<=ep)return Au.fromNumber(e)}return new Bu(e)}if(null==e||"object"!=typeof e)return e;if(e.$undefined)return null;for(var n=Object.keys(e).filter((function(t){return t.startsWith("$")&&null!=e[t]})),i=0;i<n.length;i++){var o=np[n[i]];if(o)return o.fromExtendedJSON(e,t)}if(null!=e.$date){var r=e.$date,a=new Date;return t.legacy?"number"==typeof r?a.setTime(r):"string"==typeof r&&a.setTime(Date.parse(r)):"string"==typeof r?a.setTime(Date.parse(r)):Au.isLong(r)?a.setTime(r.toNumber()):"number"==typeof r&&t.relaxed&&a.setTime(r),a}if(null!=e.$code){var s=Object.assign({},e);return e.$scope&&(s.$scope=ip(e.$scope)),bu.fromExtendedJSON(e)}if(function(e){return cu(e)&&null!=e.$id&&"string"==typeof e.$ref&&(null==e.$db||"string"==typeof e.$db)}(e)||e.$dbPointer){var c=e.$ref?e:e.$dbPointer;if(c instanceof xu)return c;var u=Object.keys(c).filter((function(e){return e.startsWith("$")})),p=!0;if(u.forEach((function(e){-1===["$ref","$id","$db"].indexOf(e)&&(p=!1)})),p)return xu.fromExtendedJSON(c)}return e}function op(e){var t=e.toISOString();return 0!==e.getUTCMilliseconds()?t:t.slice(0,-5)+"Z"}function rp(e,t){if(("object"==typeof e||"function"==typeof e)&&null!==e){var n=t.seenObjects.findIndex((function(t){return t.obj===e}));if(-1!==n){var i=t.seenObjects.map((function(e){return e.propertyName})),o=i.slice(0,n).map((function(e){return"".concat(e," -> ")})).join(""),r=i[n],a=" -> "+i.slice(n+1,i.length-1).map((function(e){return"".concat(e," -> ")})).join(""),s=i[i.length-1],c=" ".repeat(o.length+r.length/2),u="-".repeat(a.length+(r.length+s.length)/2-1);throw new nu("Converting circular structure to EJSON:\n"+" ".concat(o).concat(r).concat(a).concat(s,"\n")+" ".concat(c,"\\").concat(u,"/"))}t.seenObjects[t.seenObjects.length-1].obj=e}if(Array.isArray(e))return function(e,t){return e.map((function(e,n){t.seenObjects.push({propertyName:"index ".concat(n),obj:null});try{return rp(e,t)}finally{t.seenObjects.pop()}}))}(e,t);if(void 0===e)return null;if(e instanceof Date||cu(d=e)&&"[object Date]"===Object.prototype.toString.call(d)){var p=e.getTime(),l=p>-1&&p<2534023188e5;return t.legacy?t.relaxed&&l?{$date:e.getTime()}:{$date:op(e)}:t.relaxed&&l?{$date:op(e)}:{$date:{$numberLong:e.getTime().toString()}}}var d;if(!("number"!=typeof e||t.relaxed&&isFinite(e))){if(Math.floor(e)===e){var f=e>=tp&&e<=ep;if(e>=Qu&&e<=Zu)return{$numberInt:e.toString()};if(f)return{$numberLong:e.toString()}}return{$numberDouble:e.toString()}}if(e instanceof RegExp||function(e){return"[object RegExp]"===Object.prototype.toString.call(e)}(e)){var h=e.flags;if(void 0===h){var m=e.toString().match(/[gimuy]*$/);m&&(h=m[0])}return new Ju(e.source,h).toExtendedJSON(t)}return null!=e&&"object"==typeof e?function(e,t){if(null==e||"object"!=typeof e)throw new tu("not an object instance");var n=e._bsontype;if(void 0===n){var i={};for(var o in e){t.seenObjects.push({propertyName:o,obj:null});try{var r=rp(e[o],t);"__proto__"===o?Object.defineProperty(i,o,{value:r,writable:!0,enumerable:!0,configurable:!0}):i[o]=r}finally{t.seenObjects.pop()}}return i}if(function(e){return cu(e)&&Reflect.has(e,"_bsontype")&&"string"==typeof e._bsontype}(e)){var a=e;if("function"!=typeof a.toExtendedJSON){var s=sp[e._bsontype];if(!s)throw new nu("Unrecognized or invalid _bsontype: "+e._bsontype);a=s(a)}return"Code"===n&&a.scope?a=new bu(a.code,rp(a.scope,t)):"DBRef"===n&&a.oid&&(a=new xu(rp(a.collection,t),rp(a.oid,t),rp(a.db,t),rp(a.fields,t))),a.toExtendedJSON(t)}throw new tu("_bsontype must be a string, but was: "+typeof n)}(e,t):e}var ap,sp={Binary:function(e){return new gu(e.value(),e.sub_type)},Code:function(e){return new bu(e.code,e.scope)},DBRef:function(e){return new xu(e.collection||e.namespace,e.oid,e.db,e.fields)},Decimal128:function(e){return new Fu(e.bytes)},Double:function(e){return new Bu(e.value)},Int32:function(e){return new Wu(e.value)},Long:function(e){return Au.fromBits(null!=e.low?e.low:e.low_,null!=e.low?e.high:e.high_,null!=e.low?e.unsigned:e.unsigned_)},MaxKey:function(){return new zu},MinKey:function(){return new Hu},ObjectID:function(e){return new Vu(e)},ObjectId:function(e){return new Vu(e)},BSONRegExp:function(e){return new Ju(e.pattern,e.options)},Symbol:function(e){return new Yu(e.value)},Timestamp:function(e){return Xu.fromBits(e.low,e.high)}};!function(e){function t(e,t){var n=Object.assign({},{relaxed:!0,legacy:!1},t);return"boolean"==typeof n.relaxed&&(n.strict=!n.relaxed),"boolean"==typeof n.strict&&(n.relaxed=!n.strict),JSON.parse(e,(function(e,t){if(-1!==e.indexOf("\0"))throw new tu("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(e)));return ip(t,n)}))}function n(e,t,n,i){null!=n&&"object"==typeof n&&(i=n,n=0),null==t||"object"!=typeof t||Array.isArray(t)||(i=t,t=void 0,n=0);var o=rp(e,Object.assign({relaxed:!0,legacy:!1},i,{seenObjects:[{propertyName:"(root)",obj:null}]}));return JSON.stringify(o,t,n)}e.parse=t,e.stringify=n,e.serialize=function(e,t){return t=t||{},JSON.parse(n(e,t))},e.deserialize=function(e,n){return n=n||{},t(JSON.stringify(e),n)}}(ap||(ap={}));var cp=ou();cp.Map?cp.Map:function(){function e(e){void 0===e&&(e=[]),this._keys=[],this._values={};for(var t=0;t<e.length;t++)if(null!=e[t]){var n=e[t],i=n[0],o=n[1];this._keys.push(i),this._values[i]={v:o,i:this._keys.length-1}}}e.prototype.clear=function(){this._keys=[],this._values={}},e.prototype.delete=function(e){var t=this._values[e];return null!=t&&(delete this._values[e],this._keys.splice(t.i,1),!0)},e.prototype.entries=function(){var e=this,t=0;return{next:function(){var n=e._keys[t++];return{value:void 0!==n?[n,e._values[n].v]:void 0,done:void 0===n}}}},e.prototype.forEach=function(e,t){t=t||this;for(var n=0;n<this._keys.length;n++){var i=this._keys[n];e.call(t,this._values[i].v,i,t)}},e.prototype.get=function(e){return this._values[e]?this._values[e].v:void 0},e.prototype.has=function(e){return null!=this._values[e]},e.prototype.keys=function(){var e=this,t=0;return{next:function(){var n=e._keys[t++];return{value:void 0!==n?n:void 0,done:void 0===n}}}},e.prototype.set=function(e,t){return this._values[e]?(this._values[e].v=t,this):(this._keys.push(e),this._values[e]={v:t,i:this._keys.length-1},this)},e.prototype.values=function(){var e=this,t=0;return{next:function(){var n=e._keys[t++];return{value:void 0!==n?e._values[n].v:void 0,done:void 0===n}}}},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!1,configurable:!0})}(),Au.fromNumber(mu),Au.fromNumber(vu);var up=new Uint8Array(8);new DataView(up.buffer,up.byteOffset,up.byteLength);e.alloc(17825792);var pp=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},lp=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},dp=function(){function e(e,t){this._stages=[],e&&t&&(this._db=e,this._request=new Up.reqClass(this._db.config),this._collectionName=t)}return e.prototype.end=function(){return pp(this,void 0,void 0,(function(){var e;return lp(this,(function(t){switch(t.label){case 0:if(!this._collectionName||!this._db)throw new Error("Aggregation pipeline cannot send request");return[4,this._request.send("database.aggregate",{collectionName:this._collectionName,stages:this._stages})];case 1:return(e=t.sent())&&e.data&&e.data.list?[2,{requestId:e.requestId,data:JSON.parse(e.data.list).map(ap.parse)}]:[2,e]}}))}))},e.prototype.unwrap=function(){return this._stages},e.prototype.done=function(){return this._stages.map((function(e){var t,n=e.stageKey,i=e.stageValue;return(t={})[n]=JSON.parse(i),t}))},e.prototype._pipe=function(e,t){return this._stages.push({stageKey:"$"+e,stageValue:JSON.stringify(t)}),this},e.prototype.addFields=function(e){return this._pipe("addFields",e)},e.prototype.bucket=function(e){return this._pipe("bucket",e)},e.prototype.bucketAuto=function(e){return this._pipe("bucketAuto",e)},e.prototype.count=function(e){return this._pipe("count",e)},e.prototype.geoNear=function(e){return this._pipe("geoNear",e)},e.prototype.group=function(e){return this._pipe("group",e)},e.prototype.limit=function(e){return this._pipe("limit",e)},e.prototype.match=function(e){return this._pipe("match",Jc.encode(e))},e.prototype.project=function(e){return this._pipe("project",e)},e.prototype.lookup=function(e){return this._pipe("lookup",e)},e.prototype.replaceRoot=function(e){return this._pipe("replaceRoot",e)},e.prototype.sample=function(e){return this._pipe("sample",e)},e.prototype.skip=function(e){return this._pipe("skip",e)},e.prototype.sort=function(e){return this._pipe("sort",e)},e.prototype.sortByCount=function(e){return this._pipe("sortByCount",e)},e.prototype.unwind=function(e){return this._pipe("unwind",e)},e}(),fp=dp,hp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),mp=function(e){function t(t,n){return e.call(this,t,n)||this}return hp(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return this._coll},enumerable:!0,configurable:!0}),t.prototype.doc=function(e){if("string"!=typeof e&&"number"!=typeof e)throw new Error("docId必须为字符串或数字");return new Vc(this._db,this._coll,e)},t.prototype.add=function(e,t){return new Vc(this._db,this._coll,void 0).create(e,t)},t.prototype.aggregate=function(){return new fp(this._db,this._coll)},t}(Zc),vp={eq:function(e){return new Oc(Ec.EQ,[e])},neq:function(e){return new Oc(Ec.NEQ,[e])},lt:function(e){return new Oc(Ec.LT,[e])},lte:function(e){return new Oc(Ec.LTE,[e])},gt:function(e){return new Oc(Ec.GT,[e])},gte:function(e){return new Oc(Ec.GTE,[e])},in:function(e){return new Oc(Ec.IN,e)},nin:function(e){return new Oc(Ec.NIN,e)},all:function(e){return new Oc(Ec.ALL,e)},elemMatch:function(e){return new Oc(Ec.ELEM_MATCH,[e])},exists:function(e){return new Oc(Ec.EXISTS,[e])},size:function(e){return new Oc(Ec.SIZE,[e])},mod:function(e){return new Oc(Ec.MOD,[e])},geoNear:function(e){return new Oc(Ec.GEO_NEAR,[e])},geoWithin:function(e){return new Oc(Ec.GEO_WITHIN,[e])},geoIntersects:function(e){return new Oc(Ec.GEO_INTERSECTS,[e])},and:function(){var e=tc(arguments[0])?arguments[0]:Array.from(arguments);return new wc(yc.AND,e)},nor:function(){var e=tc(arguments[0])?arguments[0]:Array.from(arguments);return new wc(yc.NOR,e)},or:function(){var e=tc(arguments[0])?arguments[0]:Array.from(arguments);return new wc(yc.OR,e)},not:function(){var e=tc(arguments[0])?arguments[0]:Array.from(arguments);return new wc(yc.NOT,e)},set:function(e){return new bc(Vs.SET,[e])},remove:function(){return new bc(Vs.REMOVE,[])},inc:function(e){return new bc(Vs.INC,[e])},mul:function(e){return new bc(Vs.MUL,[e])},push:function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(Qs(t[0])&&t[0].hasOwnProperty("each")){var i=t[0];e={$each:i.each,$position:i.position,$sort:i.sort,$slice:i.slice}}else e=tc(t[0])?t[0]:Array.from(t);return new bc(Vs.PUSH,e)},pull:function(e){return new bc(Vs.PULL,e)},pullAll:function(e){return new bc(Vs.PULL_ALL,e)},pop:function(){return new bc(Vs.POP,[])},shift:function(){return new bc(Vs.SHIFT,[])},unshift:function(){var e=tc(arguments[0])?arguments[0]:Array.from(arguments);return new bc(Vs.UNSHIFT,e)},addToSet:function(e){return new bc(Vs.ADD_TO_SET,e)},rename:function(e){return new bc(Vs.RENAME,[e])},bit:function(e){return new bc(Vs.BIT,[e])},max:function(e){return new bc(Vs.MAX,[e])},min:function(e){return new bc(Vs.MIN,[e])},expr:function(e){return{$expr:e}},jsonSchema:function(e){return{$jsonSchema:e}},text:function(e){return"string"===Zs(e)?{$search:e.search}:{$search:e.search,$language:e.language,$caseSensitive:e.caseSensitive,$diacriticSensitive:e.diacriticSensitive}},aggregate:{pipeline:function(){return new fp},abs:function(e){return new gp("abs",e)},add:function(e){return new gp("add",e)},ceil:function(e){return new gp("ceil",e)},divide:function(e){return new gp("divide",e)},exp:function(e){return new gp("exp",e)},floor:function(e){return new gp("floor",e)},ln:function(e){return new gp("ln",e)},log:function(e){return new gp("log",e)},log10:function(e){return new gp("log10",e)},mod:function(e){return new gp("mod",e)},multiply:function(e){return new gp("multiply",e)},pow:function(e){return new gp("pow",e)},sqrt:function(e){return new gp("sqrt",e)},subtract:function(e){return new gp("subtract",e)},trunc:function(e){return new gp("trunc",e)},arrayElemAt:function(e){return new gp("arrayElemAt",e)},arrayToObject:function(e){return new gp("arrayToObject",e)},concatArrays:function(e){return new gp("concatArrays",e)},filter:function(e){return new gp("filter",e)},in:function(e){return new gp("in",e)},indexOfArray:function(e){return new gp("indexOfArray",e)},isArray:function(e){return new gp("isArray",e)},map:function(e){return new gp("map",e)},range:function(e){return new gp("range",e)},reduce:function(e){return new gp("reduce",e)},reverseArray:function(e){return new gp("reverseArray",e)},size:function(e){return new gp("size",e)},slice:function(e){return new gp("slice",e)},zip:function(e){return new gp("zip",e)},and:function(e){return new gp("and",e)},not:function(e){return new gp("not",e)},or:function(e){return new gp("or",e)},cmp:function(e){return new gp("cmp",e)},eq:function(e){return new gp("eq",e)},gt:function(e){return new gp("gt",e)},gte:function(e){return new gp("gte",e)},lt:function(e){return new gp("lt",e)},lte:function(e){return new gp("lte",e)},neq:function(e){return new gp("ne",e)},cond:function(e){return new gp("cond",e)},ifNull:function(e){return new gp("ifNull",e)},switch:function(e){return new gp("switch",e)},dateFromParts:function(e){return new gp("dateFromParts",e)},dateFromString:function(e){return new gp("dateFromString",e)},dayOfMonth:function(e){return new gp("dayOfMonth",e)},dayOfWeek:function(e){return new gp("dayOfWeek",e)},dayOfYear:function(e){return new gp("dayOfYear",e)},isoDayOfWeek:function(e){return new gp("isoDayOfWeek",e)},isoWeek:function(e){return new gp("isoWeek",e)},isoWeekYear:function(e){return new gp("isoWeekYear",e)},millisecond:function(e){return new gp("millisecond",e)},minute:function(e){return new gp("minute",e)},month:function(e){return new gp("month",e)},second:function(e){return new gp("second",e)},hour:function(e){return new gp("hour",e)},week:function(e){return new gp("week",e)},year:function(e){return new gp("year",e)},literal:function(e){return new gp("literal",e)},mergeObjects:function(e){return new gp("mergeObjects",e)},objectToArray:function(e){return new gp("objectToArray",e)},allElementsTrue:function(e){return new gp("allElementsTrue",e)},anyElementTrue:function(e){return new gp("anyElementTrue",e)},setDifference:function(e){return new gp("setDifference",e)},setEquals:function(e){return new gp("setEquals",e)},setIntersection:function(e){return new gp("setIntersection",e)},setIsSubset:function(e){return new gp("setIsSubset",e)},setUnion:function(e){return new gp("setUnion",e)},concat:function(e){return new gp("concat",e)},dateToString:function(e){return new gp("dateToString",e)},indexOfBytes:function(e){return new gp("indexOfBytes",e)},indexOfCP:function(e){return new gp("indexOfCP",e)},split:function(e){return new gp("split",e)},strLenBytes:function(e){return new gp("strLenBytes",e)},strLenCP:function(e){return new gp("strLenCP",e)},strcasecmp:function(e){return new gp("strcasecmp",e)},substr:function(e){return new gp("substr",e)},substrBytes:function(e){return new gp("substrBytes",e)},substrCP:function(e){return new gp("substrCP",e)},toLower:function(e){return new gp("toLower",e)},toUpper:function(e){return new gp("toUpper",e)},meta:function(e){return new gp("meta",e)},addToSet:function(e){return new gp("addToSet",e)},avg:function(e){return new gp("avg",e)},first:function(e){return new gp("first",e)},last:function(e){return new gp("last",e)},max:function(e){return new gp("max",e)},min:function(e){return new gp("min",e)},push:function(e){return new gp("push",e)},stdDevPop:function(e){return new gp("stdDevPop",e)},stdDevSamp:function(e){return new gp("stdDevSamp",e)},sum:function(e){return new gp("sum",e)},let:function(e){return new gp("let",e)}},project:{slice:function(e){return new yp("slice",e)},elemMatch:function(e){return new yp("elemMatch",e)}}},gp=function(e,t){this["$"+e]=t},yp=function(e,t){this["$"+e]=t},bp=function(){function e(e){var t=e.regexp,n=e.options;if(!t)throw new TypeError("regexp must be a string");this.$regex=t,this.$options=n}return e.prototype.parse=function(){return{$regex:this.$regex,$options:this.$options}},Object.defineProperty(e.prototype,"_internalType",{get:function(){return $s},enumerable:!0,configurable:!0}),e}();function xp(e){return new bp(e)}var wp={code:"INSERT_DOC_FAIL",message:"insert document failed"},_p={code:"DATABASE_TRANSACTION_CONFLICT",message:"database transaction conflict"},Ep=function(){return Ep=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ep.apply(this,arguments)},Sp=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},Op=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},Ip="database.updateDocInTransaction",Ap=function(){function e(e,t,n){this._coll=t,this.id=n,this._transaction=e,this._request=this._transaction.getRequestMethod(),this._transactionId=this._transaction.getTransactionId()}return e.prototype.create=function(e){return Sp(this,void 0,void 0,(function(){var t,n,i,o;return Op(this,(function(r){switch(r.label){case 0:return t={collectionName:this._coll,transactionId:this._transactionId,data:ap.stringify(Pc(e),{relaxed:!1})},this.id&&(t._id=this.id),[4,this._request.send("database.insertDocInTransaction",t)];case 1:if((n=r.sent()).code)throw n;if(i=ap.parse(n.inserted),1==(o=ap.parse(n.ok))&&1==i)return[2,Ep(Ep({},n),{ok:o,inserted:i})];throw new Error(wp.message)}}))}))},e.prototype.get=function(){return Sp(this,void 0,void 0,(function(){var e,t;return Op(this,(function(n){switch(n.label){case 0:return e={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}}},[4,this._request.send("database.getInTransaction",e)];case 1:if((t=n.sent()).code)throw t;return[2,{data:"null"!==t.data?Ys.formatField(ap.parse(t.data)):ap.parse(t.data),requestId:t.requestId}]}}))}))},e.prototype.set=function(e){return Sp(this,void 0,void 0,(function(){var t,n;return Op(this,(function(i){switch(i.label){case 0:return t={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}},data:ap.stringify(Pc(e),{relaxed:!1}),upsert:!0},[4,this._request.send(Ip,t)];case 1:if((n=i.sent()).code)throw n;return[2,Ep(Ep({},n),{updated:ap.parse(n.updated),upserted:n.upserted?JSON.parse(n.upserted):null})]}}))}))},e.prototype.update=function(e){return Sp(this,void 0,void 0,(function(){var t,n;return Op(this,(function(i){switch(i.label){case 0:return t={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}},data:ap.stringify(Hc.encode(e),{relaxed:!1})},[4,this._request.send(Ip,t)];case 1:if((n=i.sent()).code)throw n;return[2,Ep(Ep({},n),{updated:ap.parse(n.updated)})]}}))}))},e.prototype.delete=function(){return Sp(this,void 0,void 0,(function(){var e,t;return Op(this,(function(n){switch(n.label){case 0:return e={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}}},[4,this._request.send("database.deleteDocInTransaction",e)];case 1:if((t=n.sent()).code)throw t;return[2,Ep(Ep({},t),{deleted:ap.parse(t.deleted)})]}}))}))},e}(),Tp=function(e,t){this._coll=t,this._transaction=e},Np=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Rp=function(e){function t(t,n){return e.call(this,t,n)||this}return Np(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return this._coll},enumerable:!0,configurable:!0}),t.prototype.doc=function(e){if("string"!=typeof e&&"number"!=typeof e)throw new Error("docId必须为字符串或数字");return new Ap(this._transaction,this._coll,e)},t.prototype.add=function(e){var t;return void 0!==e._id&&(t=e._id),new Ap(this._transaction,this._coll,t).create(e)},t}(Tp),kp=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},jp=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},Cp=function(){function e(e){this._db=e,this._request=new Up.reqClass(this._db.config),this.aborted=!1,this.commited=!1,this.inited=!1}return e.prototype.init=function(){return kp(this,void 0,void 0,(function(){var e;return jp(this,(function(t){switch(t.label){case 0:return[4,this._request.send("database.startTransaction")];case 1:if((e=t.sent()).code)throw e;return this.inited=!0,this._id=e.transactionId,[2]}}))}))},e.prototype.collection=function(e){if(!e)throw new Error("Collection name is required");return new Rp(this,e)},e.prototype.getTransactionId=function(){return this._id},e.prototype.getRequestMethod=function(){return this._request},e.prototype.commit=function(){return kp(this,void 0,void 0,(function(){var e,t;return jp(this,(function(n){switch(n.label){case 0:return e={transactionId:this._id},[4,this._request.send("database.commitTransaction",e)];case 1:if((t=n.sent()).code)throw t;return this.commited=!0,[2,t]}}))}))},e.prototype.rollback=function(e){return kp(this,void 0,void 0,(function(){var t,n;return jp(this,(function(i){switch(i.label){case 0:return t={transactionId:this._id},[4,this._request.send("database.abortTransaction",t)];case 1:if((n=i.sent()).code)throw n;return this.aborted=!0,this.abortReason=e,[2,n]}}))}))},e}();function Pp(){return kp(this,void 0,void 0,(function(){var e;return jp(this,(function(t){switch(t.label){case 0:return[4,(e=new Cp(this)).init()];case 1:return t.sent(),[2,e]}}))}))}function Lp(e,t){return void 0===t&&(t=3),kp(this,void 0,void 0,(function(){var n,i,o,r,a=this;return jp(this,(function(s){switch(s.label){case 0:return s.trys.push([0,4,,10]),[4,(n=new Cp(this)).init()];case 1:return s.sent(),[4,e(n)];case 2:if(i=s.sent(),!0===n.aborted)throw n.abortReason;return[4,n.commit()];case 3:return s.sent(),[2,i];case 4:if(o=s.sent(),!1===n.inited)throw o;return r=function(e){return kp(a,void 0,void 0,(function(){return jp(this,(function(t){switch(t.label){case 0:if(n.aborted||n.commited)return[3,5];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,n.rollback()];case 2:case 3:return t.sent(),[3,4];case 4:throw e;case 5:if(!0===n.aborted)throw n.abortReason;throw e}}))}))},t<=0?[4,r(o)]:[3,6];case 5:s.sent(),s.label=6;case 6:return o&&o.code===_p.code?[4,Lp.bind(this)(e,--t)]:[3,8];case 7:return[2,s.sent()];case 8:return[4,r(o)];case 9:return s.sent(),[3,10];case 10:return[2]}}))}))}var Up=function(){function e(e){this.config=e,this.Geo=vc,this.serverDate=Ks,this.command=vp,this.RegExp=xp,this.startTransaction=Pp,this.runTransaction=Lp,this.logicCommand=wc,this.updateCommand=bc,this.queryCommand=Oc}return e.prototype.collection=function(e){if(!e)throw new Error("Collection name is required");return new mp(this,e)},e.prototype.createCollection=function(t){var n={collectionName:t};return new e.reqClass(this.config).send("database.addCollection",n)},e}(),Dp=function(){return Dp=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Dp.apply(this,arguments)};var qp={name:"database",entity:{database:function(e){var t=this.platform,n=t.adapter,i=t.runtime;return Up.reqClass=this.request.constructor,Up.getAccessToken=this.authInstance?this.authInstance.getAccessToken.bind(this.authInstance):function(){return""},Up.runtime=i,this.wsClientClass&&(Up.wsClass=n.wsClass,Up.wsClientClass=this.wsClientClass),Up.ws||(Up.ws=null),new Up(Dp(Dp({},this.config),e))}}};try{cloudbase.registerComponent(qp)}catch(e){}var Mp,Fp="1.7.2";un.registerVersion(Fp);try{!function(e){try{e.registerComponent(Zi)}catch(e){console.warn(e)}}(un),function(e){try{e.registerComponent(lo)}catch(e){console.warn(e)}}(un),function(e){try{e.registerComponent(To)}catch(e){console.warn(e)}}(un),function(e){try{e.registerComponent(qp)}catch(e){console.warn(e)}}(un),function(e){try{e.registerComponent(Za),e.registerHook(Xa)}catch(e){console.warn(e)}}(un),function(e){try{e.registerComponent(ds)}catch(e){console.warn(e)}}(un)}catch(e){}try{window.cloudbase=un}catch(e){}!function(e){e.development="dev-1gpp53ju3ceb46c7",e.production="release-7gvojkxi667a3f26"}(Mp||(Mp={}));var Bp={ENV:Mp[process.env.NODE_ENV],REGION:"ap-shanghai"},Wp={region:Bp.REGION,env:Bp.ENV},zp=un.init(Wp);function Hp(e){return m(this,void 0,void 0,(function(){var t;return v(this,(function(n){switch(n.label){case 0:return[4,zp.callFunction(e)];case 1:return t=n.sent(),[2,new Promise((function(e,n){var i;(null===(i=t.result)||void 0===i?void 0:i.success)?e(t.result.data):n(t.result)}))]}}))}))}function $p(e,t){return function(){return e.apply(t,arguments)}}const{toString:Gp}=Object.prototype,{getPrototypeOf:Kp}=Object,Vp=(e=>t=>{const n=Gp.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Jp=e=>(e=e.toLowerCase(),t=>Vp(t)===e),Yp=e=>t=>typeof t===e,{isArray:Xp}=Array,Zp=Yp("undefined");const Qp=Jp("ArrayBuffer");const el=Yp("string"),tl=Yp("function"),nl=Yp("number"),il=e=>null!==e&&"object"==typeof e,ol=e=>{if("object"!==Vp(e))return!1;const t=Kp(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},rl=Jp("Date"),al=Jp("File"),sl=Jp("Blob"),cl=Jp("FileList"),ul=Jp("URLSearchParams");function pl(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let i,o;if("object"!=typeof e&&(e=[e]),Xp(e))for(i=0,o=e.length;i<o;i++)t.call(null,e[i],i,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),r=o.length;let a;for(i=0;i<r;i++)a=o[i],t.call(null,e[a],a,e)}}function ll(e,t){t=t.toLowerCase();const n=Object.keys(e);let i,o=n.length;for(;o-- >0;)if(i=n[o],t===i.toLowerCase())return i;return null}const dl="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,fl=e=>!Zp(e)&&e!==dl;const hl=(ml="undefined"!=typeof Uint8Array&&Kp(Uint8Array),e=>ml&&e instanceof ml);var ml;const vl=Jp("HTMLFormElement"),gl=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),yl=Jp("RegExp"),bl=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};pl(n,((n,o)=>{let r;!1!==(r=t(n,o,e))&&(i[o]=r||n)})),Object.defineProperties(e,i)},xl="abcdefghijklmnopqrstuvwxyz",wl="0123456789",_l={DIGIT:wl,ALPHA:xl,ALPHA_DIGIT:xl+xl.toUpperCase()+wl};const El=Jp("AsyncFunction");var Sl={isArray:Xp,isArrayBuffer:Qp,isBuffer:function(e){return null!==e&&!Zp(e)&&null!==e.constructor&&!Zp(e.constructor)&&tl(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||tl(e.append)&&("formdata"===(t=Vp(e))||"object"===t&&tl(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Qp(e.buffer),t},isString:el,isNumber:nl,isBoolean:e=>!0===e||!1===e,isObject:il,isPlainObject:ol,isUndefined:Zp,isDate:rl,isFile:al,isBlob:sl,isRegExp:yl,isFunction:tl,isStream:e=>il(e)&&tl(e.pipe),isURLSearchParams:ul,isTypedArray:hl,isFileList:cl,forEach:pl,merge:function e(){const{caseless:t}=fl(this)&&this||{},n={},i=(i,o)=>{const r=t&&ll(n,o)||o;ol(n[r])&&ol(i)?n[r]=e(n[r],i):ol(i)?n[r]=e({},i):Xp(i)?n[r]=i.slice():n[r]=i};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&pl(arguments[e],i);return n},extend:(e,t,n,{allOwnKeys:i}={})=>(pl(t,((t,i)=>{n&&tl(t)?e[i]=$p(t,n):e[i]=t}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,i)=>{let o,r,a;const s={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),r=o.length;r-- >0;)a=o[r],i&&!i(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&Kp(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Vp,kindOfTest:Jp,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return-1!==i&&i===n},toArray:e=>{if(!e)return null;if(Xp(e))return e;let t=e.length;if(!nl(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=n.next())&&!i.done;){const n=i.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const i=[];for(;null!==(n=e.exec(t));)i.push(n);return i},isHTMLForm:vl,hasOwnProperty:gl,hasOwnProp:gl,reduceDescriptors:bl,freezeMethods:e=>{bl(e,((t,n)=>{if(tl(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const i=e[n];tl(i)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},i=e=>{e.forEach((e=>{n[e]=!0}))};return Xp(e)?i(e):i(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:ll,global:dl,isContextDefined:fl,ALPHABET:_l,generateString:(e=16,t=_l.ALPHA_DIGIT)=>{let n="";const{length:i}=t;for(;e--;)n+=t[Math.random()*i|0];return n},isSpecCompliantForm:function(e){return!!(e&&tl(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,i)=>{if(il(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[i]=e;const o=Xp(e)?[]:{};return pl(e,((e,t)=>{const r=n(e,i+1);!Zp(r)&&(o[t]=r)})),t[i]=void 0,o}}return e};return n(e,0)},isAsyncFn:El,isThenable:e=>e&&(il(e)||tl(e))&&tl(e.then)&&tl(e.catch)};function Ol(e,t,n,i,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),o&&(this.response=o)}Sl.inherits(Ol,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Sl.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Il=Ol.prototype,Al={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Al[e]={value:e}})),Object.defineProperties(Ol,Al),Object.defineProperty(Il,"isAxiosError",{value:!0}),Ol.from=(e,t,n,i,o,r)=>{const a=Object.create(Il);return Sl.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Ol.call(a,e.message,t,n,i,o),a.cause=e,a.name=e.name,r&&Object.assign(a,r),a};var Tl=i.Stream,Nl=Rl;function Rl(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}t.inherits(Rl,Tl),Rl.create=function(e,t){var n=new this;for(var i in t=t||{})n[i]=t[i];n.source=e;var o=e.emit;return e.emit=function(){return n._handleEmit(arguments),o.apply(e,arguments)},e.on("error",(function(){})),n.pauseStream&&e.pause(),n},Object.defineProperty(Rl.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),Rl.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},Rl.prototype.resume=function(){this._released||this.release(),this.source.resume()},Rl.prototype.pause=function(){this.source.pause()},Rl.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]},Rl.prototype.pipe=function(){var e=Tl.prototype.pipe.apply(this,arguments);return this.resume(),e},Rl.prototype._handleEmit=function(e){this._released?this.emit.apply(this,e):("data"===e[0]&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e))},Rl.prototype._checkIfMaxDataSizeExceeded=function(){if(!(this._maxDataSizeExceeded||this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}};var kl=t,jl=i.Stream,Cl=Nl,Pl=Ll;function Ll(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}kl.inherits(Ll,jl),Ll.create=function(e){var t=new this;for(var n in e=e||{})t[n]=e[n];return t},Ll.isStreamLike=function(e){return"function"!=typeof e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&!Buffer.isBuffer(e)},Ll.prototype.append=function(e){if(Ll.isStreamLike(e)){if(!(e instanceof Cl)){var t=Cl.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=t}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this},Ll.prototype.pipe=function(e,t){return jl.prototype.pipe.call(this,e,t),this.resume(),e},Ll.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop)this._pendingNext=!0;else{this._insideLoop=!0;try{do{this._pendingNext=!1,this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=!1}}},Ll.prototype._realGetNext=function(){var e=this._streams.shift();void 0!==e?"function"==typeof e?e(function(e){Ll.isStreamLike(e)&&(e.on("data",this._checkDataSize.bind(this)),this._handleErrors(e)),this._pipeNext(e)}.bind(this)):this._pipeNext(e):this.end()},Ll.prototype._pipeNext=function(e){if(this._currentStream=e,Ll.isStreamLike(e))return e.on("end",this._getNext.bind(this)),void e.pipe(this,{end:!1});var t=e;this.write(t),this._getNext()},Ll.prototype._handleErrors=function(e){var t=this;e.on("error",(function(e){t._emitError(e)}))},Ll.prototype.write=function(e){this.emit("data",e)},Ll.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.pause&&this._currentStream.pause(),this.emit("pause"))},Ll.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.resume&&this._currentStream.resume(),this.emit("resume")},Ll.prototype.end=function(){this._reset(),this.emit("end")},Ll.prototype.destroy=function(){this._reset(),this.emit("close")},Ll.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null},Ll.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}},Ll.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach((function(t){t.dataSize&&(e.dataSize+=t.dataSize)})),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)},Ll.prototype._emitError=function(e){this._reset(),this.emit("error",e)};var Ul={},Dl={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}};
|
|
2
|
+
/*!
|
|
3
|
+
* mime-types
|
|
4
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
5
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
6
|
+
* MIT Licensed
|
|
7
|
+
*/
|
|
8
|
+
!function(e){var t,n,i,o=Dl,a=r.extname,s=/^\s*([^;\s]*)(?:;|\s|$)/,c=/^text\//i;function u(e){if(!e||"string"!=typeof e)return!1;var t=s.exec(e),n=t&&o[t[1].toLowerCase()];return n&&n.charset?n.charset:!(!t||!c.test(t[1]))&&"UTF-8"}e.charset=u,e.charsets={lookup:u},e.contentType=function(t){if(!t||"string"!=typeof t)return!1;var n=-1===t.indexOf("/")?e.lookup(t):t;if(!n)return!1;if(-1===n.indexOf("charset")){var i=e.charset(n);i&&(n+="; charset="+i.toLowerCase())}return n},e.extension=function(t){if(!t||"string"!=typeof t)return!1;var n=s.exec(t),i=n&&e.extensions[n[1].toLowerCase()];if(!i||!i.length)return!1;return i[0]},e.extensions=Object.create(null),e.lookup=function(t){if(!t||"string"!=typeof t)return!1;var n=a("x."+t).toLowerCase().substr(1);if(!n)return!1;return e.types[n]||!1},e.types=Object.create(null),t=e.extensions,n=e.types,i=["nginx","apache",void 0,"iana"],Object.keys(o).forEach((function(e){var r=o[e],a=r.extensions;if(a&&a.length){t[e]=a;for(var s=0;s<a.length;s++){var c=a[s];if(n[c]){var u=i.indexOf(o[n[c]].source),p=i.indexOf(r.source);if("application/octet-stream"!==n[c]&&(u>p||u===p&&"application/"===n[c].substr(0,12)))continue}n[c]=e}}}))}(Ul);var ql=function(e){var t="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;t?t(e):setTimeout(e,0)},Ml=function(e){var t=!1;return ql((function(){t=!0})),function(n,i){t?e(n,i):ql((function(){e(n,i)}))}};var Fl=function(e){Object.keys(e.jobs).forEach(Bl.bind(e)),e.jobs={}};function Bl(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}var Wl=Ml,zl=Fl,Hl=function(e,t,n,i){var o=n.keyedList?n.keyedList[n.index]:n.index;n.jobs[o]=function(e,t,n,i){var o;o=2==e.length?e(n,Wl(i)):e(n,t,Wl(i));return o}(t,o,e[o],(function(e,t){o in n.jobs&&(delete n.jobs[o],e?zl(n):n.results[o]=t,i(e,n.results))}))};var $l=function(e,t){var n=!Array.isArray(e),i={index:0,keyedList:n||t?Object.keys(e):null,jobs:{},results:n?{}:[],size:n?Object.keys(e).length:e.length};t&&i.keyedList.sort(n?t:function(n,i){return t(e[n],e[i])});return i};var Gl=Fl,Kl=Ml,Vl=function(e){if(!Object.keys(this.jobs).length)return;this.index=this.size,Gl(this),Kl(e)(null,this.results)};var Jl=Hl,Yl=$l,Xl=Vl,Zl=function(e,t,n){var i=Yl(e);for(;i.index<(i.keyedList||e).length;)Jl(e,t,i,(function(e,t){e?n(e,t):0!==Object.keys(i.jobs).length||n(null,i.results)})),i.index++;return Xl.bind(i,n)};var Ql={exports:{}},ed=Hl,td=$l,nd=Vl;function id(e,t){return e<t?-1:e>t?1:0}Ql.exports=function(e,t,n,i){var o=td(e,n);return ed(e,t,o,(function n(r,a){r?i(r,a):(o.index++,o.index<(o.keyedList||e).length?ed(e,t,o,n):i(null,o.results))})),nd.bind(o,i)},Ql.exports.ascending=id,Ql.exports.descending=function(e,t){return-1*id(e,t)};var od=Ql.exports,rd=od;var ad={parallel:Zl,serial:function(e,t,n){return rd(e,t,null,n)},serialOrdered:od},sd=Pl,cd=t,ud=r,pd=a,ld=s,dd=c.parse,fd=u,hd=i.Stream,md=Ul,vd=ad,gd=function(e,t){return Object.keys(t).forEach((function(n){e[n]=e[n]||t[n]})),e},yd=bd;function bd(e){if(!(this instanceof bd))return new bd(e);for(var t in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],sd.call(this),e=e||{})this[t]=e[t]}cd.inherits(bd,sd),bd.LINE_BREAK="\r\n",bd.DEFAULT_CONTENT_TYPE="application/octet-stream",bd.prototype.append=function(e,t,n){"string"==typeof(n=n||{})&&(n={filename:n});var i=sd.prototype.append.bind(this);if("number"==typeof t&&(t=""+t),cd.isArray(t))this._error(new Error("Arrays are not supported."));else{var o=this._multiPartHeader(e,t,n),r=this._multiPartFooter();i(o),i(t),i(r),this._trackLength(o,t,n)}},bd.prototype._trackLength=function(e,t,n){var i=0;null!=n.knownLength?i+=+n.knownLength:Buffer.isBuffer(t)?i=t.length:"string"==typeof t&&(i=Buffer.byteLength(t)),this._valueLength+=i,this._overheadLength+=Buffer.byteLength(e)+bd.LINE_BREAK.length,t&&(t.path||t.readable&&t.hasOwnProperty("httpVersion")||t instanceof hd)&&(n.knownLength||this._valuesToMeasure.push(t))},bd.prototype._lengthRetriever=function(e,t){e.hasOwnProperty("fd")?null!=e.end&&e.end!=1/0&&null!=e.start?t(null,e.end+1-(e.start?e.start:0)):fd.stat(e.path,(function(n,i){var o;n?t(n):(o=i.size-(e.start?e.start:0),t(null,o))})):e.hasOwnProperty("httpVersion")?t(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",(function(n){e.pause(),t(null,+n.headers["content-length"])})),e.resume()):t("Unknown stream")},bd.prototype._multiPartHeader=function(e,t,n){if("string"==typeof n.header)return n.header;var i,o=this._getContentDisposition(t,n),r=this._getContentType(t,n),a="",s={"Content-Disposition":["form-data",'name="'+e+'"'].concat(o||[]),"Content-Type":[].concat(r||[])};for(var c in"object"==typeof n.header&&gd(s,n.header),s)s.hasOwnProperty(c)&&null!=(i=s[c])&&(Array.isArray(i)||(i=[i]),i.length&&(a+=c+": "+i.join("; ")+bd.LINE_BREAK));return"--"+this.getBoundary()+bd.LINE_BREAK+a+bd.LINE_BREAK},bd.prototype._getContentDisposition=function(e,t){var n,i;return"string"==typeof t.filepath?n=ud.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e.name||e.path?n=ud.basename(t.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(n=ud.basename(e.client._httpMessage.path||"")),n&&(i='filename="'+n+'"'),i},bd.prototype._getContentType=function(e,t){var n=t.contentType;return!n&&e.name&&(n=md.lookup(e.name)),!n&&e.path&&(n=md.lookup(e.path)),!n&&e.readable&&e.hasOwnProperty("httpVersion")&&(n=e.headers["content-type"]),n||!t.filepath&&!t.filename||(n=md.lookup(t.filepath||t.filename)),n||"object"!=typeof e||(n=bd.DEFAULT_CONTENT_TYPE),n},bd.prototype._multiPartFooter=function(){return function(e){var t=bd.LINE_BREAK;0===this._streams.length&&(t+=this._lastBoundary()),e(t)}.bind(this)},bd.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+bd.LINE_BREAK},bd.prototype.getHeaders=function(e){var t,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)e.hasOwnProperty(t)&&(n[t.toLowerCase()]=e[t]);return n},bd.prototype.setBoundary=function(e){this._boundary=e},bd.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},bd.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),n=0,i=this._streams.length;n<i;n++)"function"!=typeof this._streams[n]&&(e=Buffer.isBuffer(this._streams[n])?Buffer.concat([e,this._streams[n]]):Buffer.concat([e,Buffer.from(this._streams[n])]),"string"==typeof this._streams[n]&&this._streams[n].substring(2,t.length+2)===t||(e=Buffer.concat([e,Buffer.from(bd.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},bd.prototype._generateBoundary=function(){for(var e="--------------------------",t=0;t<24;t++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},bd.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},bd.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},bd.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;this._streams.length&&(t+=this._lastBoundary().length),this._valuesToMeasure.length?vd.parallel(this._valuesToMeasure,this._lengthRetriever,(function(n,i){n?e(n):(i.forEach((function(e){t+=e})),e(null,t))})):process.nextTick(e.bind(this,null,t))},bd.prototype.submit=function(e,t){var n,i,o={method:"post"};return"string"==typeof e?(e=dd(e),i=gd({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(i=gd(e,o)).port||(i.port="https:"==i.protocol?443:80),i.headers=this.getHeaders(e.headers),n="https:"==i.protocol?ld.request(i):pd.request(i),this.getLength(function(e,i){if(e&&"Unknown stream"!==e)this._error(e);else if(i&&n.setHeader("Content-Length",i),this.pipe(n),t){var o,r=function(e,i){return n.removeListener("error",r),n.removeListener("response",o),t.call(this,e,i)};o=r.bind(this,null),n.on("error",r),n.on("response",o)}}.bind(this)),n},bd.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},bd.prototype.toString=function(){return"[object FormData]"};var xd=y(yd);function wd(e){return Sl.isPlainObject(e)||Sl.isArray(e)}function _d(e){return Sl.endsWith(e,"[]")?e.slice(0,-2):e}function Ed(e,t,n){return e?e.concat(t).map((function(e,t){return e=_d(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Sd=Sl.toFlatObject(Sl,{},null,(function(e){return/^is[A-Z]/.test(e)}));function Od(e,t,n){if(!Sl.isObject(e))throw new TypeError("target must be an object");t=t||new(xd||FormData);const i=(n=Sl.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Sl.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,r=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Sl.isSpecCompliantForm(t);if(!Sl.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Sl.isDate(e))return e.toISOString();if(!s&&Sl.isBlob(e))throw new Ol("Blob is not supported. Use a Buffer instead.");return Sl.isArrayBuffer(e)||Sl.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let s=e;if(e&&!o&&"object"==typeof e)if(Sl.endsWith(n,"{}"))n=i?n:n.slice(0,-2),e=JSON.stringify(e);else if(Sl.isArray(e)&&function(e){return Sl.isArray(e)&&!e.some(wd)}(e)||(Sl.isFileList(e)||Sl.endsWith(n,"[]"))&&(s=Sl.toArray(e)))return n=_d(n),s.forEach((function(e,i){!Sl.isUndefined(e)&&null!==e&&t.append(!0===a?Ed([n],i,r):null===a?n:n+"[]",c(e))})),!1;return!!wd(e)||(t.append(Ed(o,n,r),c(e)),!1)}const p=[],l=Object.assign(Sd,{defaultVisitor:u,convertValue:c,isVisitable:wd});if(!Sl.isObject(e))throw new TypeError("data must be an object");return function e(n,i){if(!Sl.isUndefined(n)){if(-1!==p.indexOf(n))throw Error("Circular reference detected in "+i.join("."));p.push(n),Sl.forEach(n,(function(n,r){!0===(!(Sl.isUndefined(n)||null===n)&&o.call(t,n,Sl.isString(r)?r.trim():r,i,l))&&e(n,i?i.concat(r):[r])})),p.pop()}}(e),t}function Id(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Ad(e,t){this._pairs=[],e&&Od(e,this,t)}const Td=Ad.prototype;function Nd(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Rd(e,t,n){if(!t)return e;const i=n&&n.encode||Nd,o=n&&n.serialize;let r;if(r=o?o(t,n):Sl.isURLSearchParams(t)?t.toString():new Ad(t,n).toString(i),r){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}Td.append=function(e,t){this._pairs.push([e,t])},Td.toString=function(e){const t=e?function(t){return e.call(this,t,Id)}:Id;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var kd=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Sl.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},jd={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Cd={isNode:!0,classes:{URLSearchParams:c.URLSearchParams,FormData:xd,Blob:"undefined"!=typeof Blob&&Blob||null},protocols:["http","https","file","data"]};const Pd="undefined"!=typeof window&&"undefined"!=typeof document,Ld=(Ud="undefined"!=typeof navigator&&navigator.product,Pd&&["ReactNative","NativeScript","NS"].indexOf(Ud)<0);var Ud;const Dd="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var qd={...Object.freeze({__proto__:null,hasBrowserEnv:Pd,hasStandardBrowserEnv:Ld,hasStandardBrowserWebWorkerEnv:Dd}),...Cd};function Md(e){function t(e,n,i,o){let r=e[o++];if("__proto__"===r)return!0;const a=Number.isFinite(+r),s=o>=e.length;if(r=!r&&Sl.isArray(i)?i.length:r,s)return Sl.hasOwnProp(i,r)?i[r]=[i[r],n]:i[r]=n,!a;i[r]&&Sl.isObject(i[r])||(i[r]=[]);return t(e,n,i[r],o)&&Sl.isArray(i[r])&&(i[r]=function(e){const t={},n=Object.keys(e);let i;const o=n.length;let r;for(i=0;i<o;i++)r=n[i],t[r]=e[r];return t}(i[r])),!a}if(Sl.isFormData(e)&&Sl.isFunction(e.entries)){const n={};return Sl.forEachEntry(e,((e,i)=>{t(function(e){return Sl.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),i,n,0)})),n}return null}const Fd={transitional:jd,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",i=n.indexOf("application/json")>-1,o=Sl.isObject(e);o&&Sl.isHTMLForm(e)&&(e=new FormData(e));if(Sl.isFormData(e))return i?JSON.stringify(Md(e)):e;if(Sl.isArrayBuffer(e)||Sl.isBuffer(e)||Sl.isStream(e)||Sl.isFile(e)||Sl.isBlob(e))return e;if(Sl.isArrayBufferView(e))return e.buffer;if(Sl.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let r;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Od(e,new qd.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,i){return qd.isNode&&Sl.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((r=Sl.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Od(r?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||i?(t.setContentType("application/json",!1),function(e,t,n){if(Sl.isString(e))try{return(t||JSON.parse)(e),Sl.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Fd.transitional,n=t&&t.forcedJSONParsing,i="json"===this.responseType;if(e&&Sl.isString(e)&&(n&&!this.responseType||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Ol.from(e,Ol.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:qd.classes.FormData,Blob:qd.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Sl.forEach(["delete","get","head","post","put","patch"],(e=>{Fd.headers[e]={}}));var Bd=Fd;const Wd=Sl.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const zd=Symbol("internals");function Hd(e){return e&&String(e).trim().toLowerCase()}function $d(e){return!1===e||null==e?e:Sl.isArray(e)?e.map($d):String(e)}function Gd(e,t,n,i,o){return Sl.isFunction(i)?i.call(this,t,n):(o&&(t=n),Sl.isString(t)?Sl.isString(i)?-1!==t.indexOf(i):Sl.isRegExp(i)?i.test(t):void 0:void 0)}class Kd{constructor(e){e&&this.set(e)}set(e,t,n){const i=this;function o(e,t,n){const o=Hd(t);if(!o)throw new Error("header name must be a non-empty string");const r=Sl.findKey(i,o);(!r||void 0===i[r]||!0===n||void 0===n&&!1!==i[r])&&(i[r||t]=$d(e))}const r=(e,t)=>Sl.forEach(e,((e,n)=>o(e,n,t)));return Sl.isPlainObject(e)||e instanceof this.constructor?r(e,t):Sl.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?r((e=>{const t={};let n,i,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),i=e.substring(o+1).trim(),!n||t[n]&&Wd[n]||("set-cookie"===n?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)})),t})(e),t):null!=e&&o(t,e,n),this}get(e,t){if(e=Hd(e)){const n=Sl.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}(e);if(Sl.isFunction(t))return t.call(this,e,n);if(Sl.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Hd(e)){const n=Sl.findKey(this,e);return!(!n||void 0===this[n]||t&&!Gd(0,this[n],n,t))}return!1}delete(e,t){const n=this;let i=!1;function o(e){if(e=Hd(e)){const o=Sl.findKey(n,e);!o||t&&!Gd(0,n[o],o,t)||(delete n[o],i=!0)}}return Sl.isArray(e)?e.forEach(o):o(e),i}clear(e){const t=Object.keys(this);let n=t.length,i=!1;for(;n--;){const o=t[n];e&&!Gd(0,this[o],o,e,!0)||(delete this[o],i=!0)}return i}normalize(e){const t=this,n={};return Sl.forEach(this,((i,o)=>{const r=Sl.findKey(n,o);if(r)return t[r]=$d(i),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();a!==o&&delete t[o],t[a]=$d(i),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Sl.forEach(this,((n,i)=>{null!=n&&!1!==n&&(t[i]=e&&Sl.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[zd]=this[zd]={accessors:{}}).accessors,n=this.prototype;function i(e){const i=Hd(e);t[i]||(!function(e,t){const n=Sl.toCamelCase(" "+t);["get","set","has"].forEach((i=>{Object.defineProperty(e,i+n,{value:function(e,n,o){return this[i].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[i]=!0)}return Sl.isArray(e)?e.forEach(i):i(e),this}}Kd.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Sl.reduceDescriptors(Kd.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),Sl.freezeMethods(Kd);var Vd=Kd;function Jd(e,t){const n=this||Bd,i=t||n,o=Vd.from(i.headers);let r=i.data;return Sl.forEach(e,(function(e){r=e.call(n,r,o.normalize(),t?t.status:void 0)})),o.normalize(),r}function Yd(e){return!(!e||!e.__CANCEL__)}function Xd(e,t,n){Ol.call(this,null==e?"canceled":e,Ol.ERR_CANCELED,t,n),this.name="CanceledError"}function Zd(e,t,n){const i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(new Ol("Request failed with status code "+n.status,[Ol.ERR_BAD_REQUEST,Ol.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}function Qd(e,t){return e&&!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}Sl.inherits(Xd,Ol,{__CANCEL__:!0});var ef=c.parse,tf={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},nf=String.prototype.endsWith||function(e){return e.length<=this.length&&-1!==this.indexOf(e,this.length-e.length)};function of(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var rf,af,sf,cf,uf,pf=function(e){var t="string"==typeof e?ef(e):e||{},n=t.protocol,i=t.host,o=t.port;if("string"!=typeof i||!i||"string"!=typeof n)return"";if(n=n.split(":",1)[0],!function(e,t){var n=(of("npm_config_no_proxy")||of("no_proxy")).toLowerCase();if(!n)return!0;if("*"===n)return!1;return n.split(/[,\s]/).every((function(n){if(!n)return!0;var i=n.match(/^(.+):(\d+)$/),o=i?i[1]:n,r=i?parseInt(i[2]):0;return!(!r||r===t)||(/^[.*]/.test(o)?("*"===o.charAt(0)&&(o=o.slice(1)),!nf.call(e,o)):e!==o)}))}(i=i.replace(/:\d*$/,""),o=parseInt(o)||tf[n]||0))return"";var r=of("npm_config_"+n+"_proxy")||of(n+"_proxy")||of("npm_config_proxy")||of("all_proxy");return r&&-1===r.indexOf("://")&&(r=n+"://"+r),r},lf={exports:{}},df={exports:{}},ff={exports:{}};function hf(){if(af)return rf;af=1;var e=1e3,t=60*e,n=60*t,i=24*n,o=7*i,r=365.25*i;function a(e,t,n,i){var o=t>=1.5*n;return Math.round(e/n)+" "+i+(o?"s":"")}return rf=function(s,c){c=c||{};var u=typeof s;if("string"===u&&s.length>0)return function(a){if((a=String(a)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(a);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*r;case"weeks":case"week":case"w":return c*o;case"days":case"day":case"d":return c*i;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===u&&isFinite(s))return c.long?function(o){var r=Math.abs(o);if(r>=i)return a(o,r,i,"day");if(r>=n)return a(o,r,n,"hour");if(r>=t)return a(o,r,t,"minute");if(r>=e)return a(o,r,e,"second");return o+" ms"}(s):function(o){var r=Math.abs(o);if(r>=i)return Math.round(o/i)+"d";if(r>=n)return Math.round(o/n)+"h";if(r>=t)return Math.round(o/t)+"m";if(r>=e)return Math.round(o/e)+"s";return o+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))},rf}function mf(){if(cf)return sf;return cf=1,sf=function(e){function t(e){let i,o,r,a=null;function s(...e){if(!s.enabled)return;const n=s,o=Number(new Date),r=o-(i||o);n.diff=r,n.prev=i,n.curr=o,i=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((i,o)=>{if("%%"===i)return"%";a++;const r=t.formatters[o];if("function"==typeof r){const t=e[a];i=r.call(n,t),e.splice(a,1),a--}return i})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(o!==t.namespaces&&(o=t.namespaces,r=t.enabled(e)),r),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const i=t(this.namespace+(void 0===n?":":n)+e);return i.log=this.log,i}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const i=("string"==typeof e?e:"").split(/[\s,]+/),o=i.length;for(n=0;n<o;n++)i[n]&&("-"===(e=i[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,i;for(n=0,i=t.skips.length;n<i;n++)if(t.skips[n].test(e))return!1;for(n=0,i=t.names.length;n<i;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=hf(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},sf}var vf,gf,yf,bf,xf,wf,_f,Ef={exports:{}};function Sf(){return gf?vf:(gf=1,vf=(e,t=process.argv)=>{const n=e.startsWith("-")?"":1===e.length?"-":"--",i=t.indexOf(n+e),o=t.indexOf("--");return-1!==i&&(-1===o||i<o)})}function Of(){return xf||(xf=1,function(e,n){const i=l,o=t;n.init=function(e){e.inspectOpts={};const t=Object.keys(n.inspectOpts);for(let i=0;i<t.length;i++)e.inspectOpts[t[i]]=n.inspectOpts[t[i]]},n.log=function(...e){return process.stderr.write(o.format(...e)+"\n")},n.formatArgs=function(t){const{namespace:i,useColors:o}=this;if(o){const n=this.color,o="[3"+(n<8?n:"8;5;"+n),r=` ${o};1m${i} [0m`;t[0]=r+t[0].split("\n").join("\n"+r),t.push(o+"m+"+e.exports.humanize(this.diff)+"[0m")}else t[0]=function(){if(n.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+i+" "+t[0]},n.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},n.load=function(){return process.env.DEBUG},n.useColors=function(){return"colors"in n.inspectOpts?Boolean(n.inspectOpts.colors):i.isatty(process.stderr.fd)},n.destroy=o.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),n.colors=[6,2,3,4,5,1];try{const e=function(){if(bf)return yf;bf=1;const e=d,t=l,n=Sf(),{env:i}=process;let o;function r(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function a(t,r){if(0===o)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!r&&void 0===o)return 0;const a=o||0;if("dumb"===i.TERM)return a;if("win32"===process.platform){const t=e.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in i)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in i))||"codeship"===i.CI_NAME?1:a;if("TEAMCITY_VERSION"in i)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0;if("truecolor"===i.COLORTERM)return 3;if("TERM_PROGRAM"in i){const e=parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||"COLORTERM"in i?1:a}return n("no-color")||n("no-colors")||n("color=false")||n("color=never")?o=0:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(o=1),"FORCE_COLOR"in i&&(o="true"===i.FORCE_COLOR?1:"false"===i.FORCE_COLOR?0:0===i.FORCE_COLOR.length?1:Math.min(parseInt(i.FORCE_COLOR,10),3)),yf={supportsColor:function(e){return r(a(e,e&&e.isTTY))},stdout:r(a(!0,t.isatty(1))),stderr:r(a(!0,t.isatty(2)))},yf}();e&&(e.stderr||e).level>=2&&(n.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}n.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let i=process.env[t];return i=!!/^(yes|on|true|enabled)$/i.test(i)||!/^(no|off|false|disabled)$/i.test(i)&&("null"===i?null:Number(i)),e[n]=i,e}),{}),e.exports=mf()(n);const{formatters:r}=e.exports;r.o=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},r.O=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts)}}(Ef,Ef.exports)),Ef.exports}function If(){return wf||(wf=1,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?df.exports=(uf||(uf=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let i=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(i++,"%c"===e&&(o=i))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){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+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.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.log=console.debug||console.log||(()=>{}),e.exports=mf()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(ff,ff.exports)),ff.exports):df.exports=Of()),df.exports}var Af=c,Tf=Af.URL,Nf=a,Rf=s,kf=i.Writable,jf=p,Cf=function(){if(!_f){try{_f=If()("follow-redirects")}catch(e){}"function"!=typeof _f&&(_f=function(){})}_f.apply(null,arguments)},Pf=!1;try{jf(new Tf)}catch(e){Pf="ERR_INVALID_URL"===e.code}var Lf=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],Uf=["abort","aborted","connect","error","socket","timeout"],Df=Object.create(null);Uf.forEach((function(e){Df[e]=function(t,n,i){this._redirectable.emit(e,t,n,i)}}));var qf=Xf("ERR_INVALID_URL","Invalid URL",TypeError),Mf=Xf("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Ff=Xf("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Mf),Bf=Xf("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Wf=Xf("ERR_STREAM_WRITE_AFTER_END","write after end"),zf=kf.prototype.destroy||Gf;function Hf(e,t){kf.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var n=this;this._onNativeResponse=function(e){try{n._processResponse(e)}catch(e){n.emit("error",e instanceof Mf?e:new Mf({cause:e}))}},this._performRequest()}function $f(e){var t={maxRedirects:21,maxBodyLength:10485760},n={};return Object.keys(e).forEach((function(i){var o=i+":",r=n[o]=e[i],a=t[i]=Object.create(r);Object.defineProperties(a,{request:{value:function(e,i,r){var a;return a=e,Tf&&a instanceof Tf?e=Jf(e):Qf(e)?e=Jf(Kf(e)):(r=i,i=Vf(e),e={protocol:o}),eh(i)&&(r=i,i=null),(i=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},e,i)).nativeProtocols=n,Qf(i.host)||Qf(i.hostname)||(i.hostname="::1"),jf.equal(i.protocol,o,"protocol mismatch"),Cf("options",i),new Hf(i,r)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,t,n){var i=a.request(e,t,n);return i.end(),i},configurable:!0,enumerable:!0,writable:!0}})})),t}function Gf(){}function Kf(e){var t;if(Pf)t=new Tf(e);else if(!Qf((t=Vf(Af.parse(e))).protocol))throw new qf({input:e});return t}function Vf(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new qf({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new qf({input:e.href||e});return e}function Jf(e,t){var n=t||{};for(var i of Lf)n[i]=e[i];return n.hostname.startsWith("[")&&(n.hostname=n.hostname.slice(1,-1)),""!==n.port&&(n.port=Number(n.port)),n.path=n.search?n.pathname+n.search:n.pathname,n}function Yf(e,t){var n;for(var i in t)e.test(i)&&(n=t[i],delete t[i]);return null==n?void 0:String(n).trim()}function Xf(e,t,n){function i(n){Error.captureStackTrace(this,this.constructor),Object.assign(this,n||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return i.prototype=new(n||Error),Object.defineProperties(i.prototype,{constructor:{value:i,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),i}function Zf(e,t){for(var n of Uf)e.removeListener(n,Df[n]);e.on("error",Gf),e.destroy(t)}function Qf(e){return"string"==typeof e||e instanceof String}function eh(e){return"function"==typeof e}Hf.prototype=Object.create(kf.prototype),Hf.prototype.abort=function(){Zf(this._currentRequest),this._currentRequest.abort(),this.emit("abort")},Hf.prototype.destroy=function(e){return Zf(this._currentRequest,e),zf.call(this,e),this},Hf.prototype.write=function(e,t,n){if(this._ending)throw new Wf;if(!Qf(e)&&("object"!=typeof(i=e)||!("length"in i)))throw new TypeError("data should be a string, Buffer or Uint8Array");var i;eh(t)&&(n=t,t=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,n)):(this.emit("error",new Bf),this.abort()):n&&n()},Hf.prototype.end=function(e,t,n){if(eh(e)?(n=e,e=t=null):eh(t)&&(n=t,t=null),e){var i=this,o=this._currentRequest;this.write(e,t,(function(){i._ended=!0,o.end(null,null,n)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,n)},Hf.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)},Hf.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},Hf.prototype.setTimeout=function(e,t){var n=this;function i(t){t.setTimeout(e),t.removeListener("timeout",t.destroy),t.addListener("timeout",t.destroy)}function o(t){n._timeout&&clearTimeout(n._timeout),n._timeout=setTimeout((function(){n.emit("timeout"),r()}),e),i(t)}function r(){n._timeout&&(clearTimeout(n._timeout),n._timeout=null),n.removeListener("abort",r),n.removeListener("error",r),n.removeListener("response",r),n.removeListener("close",r),t&&n.removeListener("timeout",t),n.socket||n._currentRequest.removeListener("socket",o)}return t&&this.on("timeout",t),this.socket?o(this.socket):this._currentRequest.once("socket",o),this.on("socket",i),this.on("abort",r),this.on("error",r),this.on("response",r),this.on("close",r),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(e){Hf.prototype[e]=function(t,n){return this._currentRequest[e](t,n)}})),["aborted","connection","socket"].forEach((function(e){Object.defineProperty(Hf.prototype,e,{get:function(){return this._currentRequest[e]}})})),Hf.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}},Hf.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var n=e.slice(0,-1);this._options.agent=this._options.agents[n]}var i=this._currentRequest=t.request(this._options,this._onNativeResponse);for(var o of(i._redirectable=this,Uf))i.on(o,Df[o]);if(this._currentUrl=/^\//.test(this._options.path)?Af.format(this._options):this._options.path,this._isRedirect){var r=0,a=this,s=this._requestBodyBuffers;!function e(t){if(i===a._currentRequest)if(t)a.emit("error",t);else if(r<s.length){var n=s[r++];i.finished||i.write(n.data,n.encoding,e)}else a._ended&&i.end()}()}},Hf.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var n,i=e.headers.location;if(!i||!1===this._options.followRedirects||t<300||t>=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(Zf(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new Ff;var o=this._options.beforeRedirect;o&&(n=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var r=this._options.method;((301===t||302===t)&&"POST"===this._options.method||303===t&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],Yf(/^content-/i,this._options.headers));var a,s,c=Yf(/^host$/i,this._options.headers),u=Kf(this._currentUrl),p=c||u.host,l=/^\w+:/.test(i)?this._currentUrl:Af.format(Object.assign(u,{host:p})),d=(a=i,s=l,Pf?new Tf(a,s):Kf(Af.resolve(s,a)));if(Cf("redirecting to",d.href),this._isRedirect=!0,Jf(d,this._options),(d.protocol!==u.protocol&&"https:"!==d.protocol||d.host!==p&&!function(e,t){jf(Qf(e)&&Qf(t));var n=e.length-t.length-1;return n>0&&"."===e[n]&&e.endsWith(t)}(d.host,p))&&Yf(/^(?:authorization|cookie)$/i,this._options.headers),eh(o)){var f={headers:e.headers,statusCode:t},h={url:l,method:r,headers:n};o(this._options,f,h),this._sanitizeOptions(this._options)}this._performRequest()},lf.exports=$f({http:Nf,https:Rf}),lf.exports.wrap=$f;var th=y(lf.exports);const nh="1.6.7";function ih(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}const oh=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function rh(e,t){e=e||10;const n=new Array(e),i=new Array(e);let o,r=0,a=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),u=i[a];o||(o=c),n[r]=s,i[r]=c;let p=a,l=0;for(;p!==r;)l+=n[p++],p%=e;if(r=(r+1)%e,r===a&&(a=(a+1)%e),c-o<t)return;const d=u&&c-u;return d?Math.round(1e3*l/d):void 0}}const ah=Symbol("internals");class sh extends i.Transform{constructor(e){super({readableHighWaterMark:(e=Sl.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,((e,t)=>!Sl.isUndefined(t[e])))).chunkSize});const t=this,n=this[ah]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},i=rh(n.ticksRate*e.samplesCount,n.timeWindow);this.on("newListener",(e=>{"progress"===e&&(n.isCaptured||(n.isCaptured=!0))}));let o=0;n.updateProgress=function(e,t){let n=0;const i=1e3/t;let o=null;return function(t,r){const a=Date.now();if(t||a-n>i)return o&&(clearTimeout(o),o=null),n=a,e.apply(null,r);o||(o=setTimeout((()=>(o=null,n=Date.now(),e.apply(null,r))),i-(a-n)))}}((function(){const e=n.length,r=n.bytesSeen,a=r-o;if(!a||t.destroyed)return;const s=i(a);o=r,process.nextTick((()=>{t.emit("progress",{loaded:r,total:e,progress:e?r/e:void 0,bytes:a,rate:s||void 0,estimated:s&&e&&r<=e?(e-r)/s:void 0})}))}),n.ticksRate);const r=()=>{n.updateProgress(!0)};this.once("end",r),this.once("error",r)}_read(e){const t=this[ah];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,n){const i=this,o=this[ah],r=o.maxRate,a=this.readableHighWaterMark,s=o.timeWindow,c=r/(1e3/s),u=!1!==o.minChunkSize?Math.max(o.minChunkSize,.01*c):0;const p=(e,t)=>{const n=Buffer.byteLength(e);let p,l=null,d=a,f=0;if(r){const e=Date.now();(!o.ts||(f=e-o.ts)>=s)&&(o.ts=e,p=c-o.bytes,o.bytes=p<0?-p:0,f=0),p=c-o.bytes}if(r){if(p<=0)return setTimeout((()=>{t(null,e)}),s-f);p<d&&(d=p)}d&&n>d&&n-d>u&&(l=e.subarray(d),e=e.subarray(0,d)),function(e,t){const n=Buffer.byteLength(e);o.bytesSeen+=n,o.bytes+=n,o.isCaptured&&o.updateProgress(),i.push(e)?process.nextTick(t):o.onReadCallback=()=>{o.onReadCallback=null,process.nextTick(t)}}(e,l?()=>{process.nextTick(t,null,l)}:t)};p(e,(function e(t,i){if(t)return n(t);i?p(i,e):n(null)}))}setLength(e){return this[ah].length=+e,this}}var ch=sh;const{asyncIterator:uh}=Symbol;var ph=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[uh]?yield*e[uh]():yield e};const lh=Sl.ALPHABET.ALPHA_DIGIT+"-_",dh=new n,fh="\r\n",hh=dh.encode(fh);class mh{constructor(e,t){const{escapeName:n}=this.constructor,i=Sl.isString(t);let o=`Content-Disposition: form-data; name="${n(e)}"${!i&&t.name?`; filename="${n(t.name)}"`:""}${fh}`;i?t=dh.encode(String(t).replace(/\r?\n|\r\n?/g,fh)):o+=`Content-Type: ${t.type||"application/octet-stream"}${fh}`,this.headers=dh.encode(o+fh),this.contentLength=i?t.byteLength:t.size,this.size=this.headers.byteLength+this.contentLength+2,this.name=e,this.value=t}async*encode(){yield this.headers;const{value:e}=this;Sl.isTypedArray(e)?yield e:yield*ph(e),yield hh}static escapeName(e){return String(e).replace(/[\r\n"]/g,(e=>({"\r":"%0D","\n":"%0A",'"':"%22"}[e])))}}var vh=(e,t,n)=>{const{tag:i="form-data-boundary",size:r=25,boundary:a=i+"-"+Sl.generateString(r,lh)}=n||{};if(!Sl.isFormData(e))throw TypeError("FormData instance required");if(a.length<1||a.length>70)throw Error("boundary must be 10-70 characters long");const s=dh.encode("--"+a+fh),c=dh.encode("--"+a+"--"+fh+fh);let u=c.byteLength;const p=Array.from(e.entries()).map((([e,t])=>{const n=new mh(e,t);return u+=n.size,n}));u+=s.byteLength*p.length,u=Sl.toFiniteNumber(u);const l={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(u)&&(l["Content-Length"]=u),t&&t(l),o.from(async function*(){for(const e of p)yield s,yield*e.encode();yield c}())};class gh extends i.Transform{__transform(e,t,n){this.push(e),n()}_transform(e,t,n){if(0!==e.length&&(this._transform=this.__transform,120!==e[0])){const e=Buffer.alloc(2);e[0]=120,e[1]=156,this.push(e,t)}this.__transform(e,t,n)}}var yh=gh;var bh=(e,t)=>Sl.isAsyncFn(e)?function(...n){const i=n.pop();e.apply(this,n).then((e=>{try{t?i(null,...t(e)):i(null,e)}catch(e){i(e)}}),i)}:e;const xh={flush:f.constants.Z_SYNC_FLUSH,finishFlush:f.constants.Z_SYNC_FLUSH},wh={flush:f.constants.BROTLI_OPERATION_FLUSH,finishFlush:f.constants.BROTLI_OPERATION_FLUSH},_h=Sl.isFunction(f.createBrotliDecompress),{http:Eh,https:Sh}=th,Oh=/https:?/,Ih=qd.protocols.map((e=>e+":"));function Ah(e,t){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t)}function Th(e,t,n){let i=t;if(!i&&!1!==i){const e=pf(n);e&&(i=new URL(e))}if(i){if(i.username&&(i.auth=(i.username||"")+":"+(i.password||"")),i.auth){(i.auth.username||i.auth.password)&&(i.auth=(i.auth.username||"")+":"+(i.auth.password||""));const t=Buffer.from(i.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+t}e.headers.host=e.hostname+(e.port?":"+e.port:"");const t=i.hostname||i.host;e.hostname=t,e.host=t,e.port=i.port,e.path=n,i.protocol&&(e.protocol=i.protocol.includes(":")?i.protocol:`${i.protocol}:`)}e.beforeRedirects.proxy=function(e){Th(e,t,e.href)}}const Nh="undefined"!=typeof process&&"process"===Sl.kindOf(process),Rh=(e,t)=>(({address:e,family:t})=>{if(!Sl.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}})(Sl.isObject(e)?e:{address:e,family:t});var kh=Nh&&function(e){return n=async function(n,o,r){let{data:c,lookup:u,family:p}=e;const{responseType:l,responseEncoding:d}=e,m=e.method.toUpperCase();let v,g,y=!1;if(u){const e=bh(u,(e=>Sl.isArray(e)?e:[e]));u=(t,n,i)=>{e(t,n,((e,t,o)=>{if(e)return i(e);const r=Sl.isArray(t)?t.map((e=>Rh(e))):[Rh(t,o)];n.all?i(e,r):i(e,r[0].address,r[0].family)}))}}const b=new h,x=()=>{e.cancelToken&&e.cancelToken.unsubscribe(w),e.signal&&e.signal.removeEventListener("abort",w),b.removeAllListeners()};function w(t){b.emit("abort",!t||t.type?new Xd(null,e,g):t)}r(((e,t)=>{v=!0,t&&(y=!0,x())})),b.once("abort",o),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(w),e.signal&&(e.signal.aborted?w():e.signal.addEventListener("abort",w)));const _=Qd(e.baseURL,e.url),E=new URL(_,"http://localhost"),S=E.protocol||Ih[0];if("data:"===S){let t;if("GET"!==m)return Zd(n,o,{status:405,statusText:"method not allowed",headers:{},config:e});try{t=function(e,t,n){const i=n&&n.Blob||qd.classes.Blob,o=ih(e);if(void 0===t&&i&&(t=!0),"data"===o){e=o.length?e.slice(o.length+1):e;const n=oh.exec(e);if(!n)throw new Ol("Invalid URL",Ol.ERR_INVALID_URL);const r=n[1],a=n[2],s=n[3],c=Buffer.from(decodeURIComponent(s),a?"base64":"utf8");if(t){if(!i)throw new Ol("Blob is not supported",Ol.ERR_NOT_SUPPORT);return new i([c],{type:r})}return c}throw new Ol("Unsupported protocol "+o,Ol.ERR_NOT_SUPPORT)}(e.url,"blob"===l,{Blob:e.env&&e.env.Blob})}catch(t){throw Ol.from(t,Ol.ERR_BAD_REQUEST,e)}return"text"===l?(t=t.toString(d),d&&"utf8"!==d||(t=Sl.stripBOM(t))):"stream"===l&&(t=i.Readable.from(t)),Zd(n,o,{data:t,status:200,statusText:"OK",headers:new Vd,config:e})}if(-1===Ih.indexOf(S))return o(new Ol("Unsupported protocol "+S,Ol.ERR_BAD_REQUEST,e));const O=Vd.from(e.headers).normalize();O.set("User-Agent","axios/"+nh,!1);const I=e.onDownloadProgress,A=e.onUploadProgress,T=e.maxRate;let N,R;if(Sl.isSpecCompliantForm(c)){const e=O.getContentType(/boundary=([-_\w\d]{10,70})/i);c=vh(c,(e=>{O.set(e)}),{tag:`axios-${nh}-boundary`,boundary:e&&e[1]||void 0})}else if(Sl.isFormData(c)&&Sl.isFunction(c.getHeaders)){if(O.set(c.getHeaders()),!O.hasContentLength())try{const e=await t.promisify(c.getLength).call(c);Number.isFinite(e)&&e>=0&&O.setContentLength(e)}catch(e){}}else if(Sl.isBlob(c))c.size&&O.setContentType(c.type||"application/octet-stream"),O.setContentLength(c.size||0),c=i.Readable.from(ph(c));else if(c&&!Sl.isStream(c)){if(Buffer.isBuffer(c));else if(Sl.isArrayBuffer(c))c=Buffer.from(new Uint8Array(c));else{if(!Sl.isString(c))return o(new Ol("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",Ol.ERR_BAD_REQUEST,e));c=Buffer.from(c,"utf-8")}if(O.setContentLength(c.length,!1),e.maxBodyLength>-1&&c.length>e.maxBodyLength)return o(new Ol("Request body larger than maxBodyLength limit",Ol.ERR_BAD_REQUEST,e))}const k=Sl.toFiniteNumber(O.getContentLength());let j,C;Sl.isArray(T)?(N=T[0],R=T[1]):N=R=T,c&&(A||N)&&(Sl.isStream(c)||(c=i.Readable.from(c,{objectMode:!1})),c=i.pipeline([c,new ch({length:k,maxRate:Sl.toFiniteNumber(N)})],Sl.noop),A&&c.on("progress",(e=>{A(Object.assign(e,{upload:!0}))}))),e.auth&&(j=(e.auth.username||"")+":"+(e.auth.password||"")),!j&&E.username&&(j=E.username+":"+E.password),j&&O.delete("authorization");try{C=Rd(E.pathname+E.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(t){const n=new Error(t.message);return n.config=e,n.url=e.url,n.exists=!0,o(n)}O.set("Accept-Encoding","gzip, compress, deflate"+(_h?", br":""),!1);const P={path:C,method:m,headers:O.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:j,protocol:S,family:p,beforeRedirect:Ah,beforeRedirects:{}};let L;!Sl.isUndefined(u)&&(P.lookup=u),e.socketPath?P.socketPath=e.socketPath:(P.hostname=E.hostname,P.port=E.port,Th(P,e.proxy,S+"//"+E.hostname+(E.port?":"+E.port:"")+P.path));const U=Oh.test(P.protocol);if(P.agent=U?e.httpsAgent:e.httpAgent,e.transport?L=e.transport:0===e.maxRedirects?L=U?s:a:(e.maxRedirects&&(P.maxRedirects=e.maxRedirects),e.beforeRedirect&&(P.beforeRedirects.config=e.beforeRedirect),L=U?Sh:Eh),e.maxBodyLength>-1?P.maxBodyLength=e.maxBodyLength:P.maxBodyLength=1/0,e.insecureHTTPParser&&(P.insecureHTTPParser=e.insecureHTTPParser),g=L.request(P,(function(t){if(g.destroyed)return;const r=[t],a=+t.headers["content-length"];if(I){const e=new ch({length:Sl.toFiniteNumber(a),maxRate:Sl.toFiniteNumber(R)});I&&e.on("progress",(e=>{I(Object.assign(e,{download:!0}))})),r.push(e)}let s=t;const c=t.req||g;if(!1!==e.decompress&&t.headers["content-encoding"])switch("HEAD"!==m&&204!==t.statusCode||delete t.headers["content-encoding"],(t.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":r.push(f.createUnzip(xh)),delete t.headers["content-encoding"];break;case"deflate":r.push(new yh),r.push(f.createUnzip(xh)),delete t.headers["content-encoding"];break;case"br":_h&&(r.push(f.createBrotliDecompress(wh)),delete t.headers["content-encoding"])}s=r.length>1?i.pipeline(r,Sl.noop):r[0];const u=i.finished(s,(()=>{u(),x()})),p={status:t.statusCode,statusText:t.statusMessage,headers:new Vd(t.headers),config:e,request:c};if("stream"===l)p.data=s,Zd(n,o,p);else{const t=[];let i=0;s.on("data",(function(n){t.push(n),i+=n.length,e.maxContentLength>-1&&i>e.maxContentLength&&(y=!0,s.destroy(),o(new Ol("maxContentLength size of "+e.maxContentLength+" exceeded",Ol.ERR_BAD_RESPONSE,e,c)))})),s.on("aborted",(function(){if(y)return;const t=new Ol("maxContentLength size of "+e.maxContentLength+" exceeded",Ol.ERR_BAD_RESPONSE,e,c);s.destroy(t),o(t)})),s.on("error",(function(t){g.destroyed||o(Ol.from(t,null,e,c))})),s.on("end",(function(){try{let e=1===t.length?t[0]:Buffer.concat(t);"arraybuffer"!==l&&(e=e.toString(d),d&&"utf8"!==d||(e=Sl.stripBOM(e))),p.data=e}catch(t){return o(Ol.from(t,null,e,p.request,p))}Zd(n,o,p)}))}b.once("abort",(e=>{s.destroyed||(s.emit("error",e),s.destroy())}))})),b.once("abort",(e=>{o(e),g.destroy(e)})),g.on("error",(function(t){o(Ol.from(t,null,e,g))})),g.on("socket",(function(e){e.setKeepAlive(!0,6e4)})),e.timeout){const t=parseInt(e.timeout,10);if(Number.isNaN(t))return void o(new Ol("error trying to parse `config.timeout` to int",Ol.ERR_BAD_OPTION_VALUE,e,g));g.setTimeout(t,(function(){if(v)return;let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||jd;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),o(new Ol(t,n.clarifyTimeoutError?Ol.ETIMEDOUT:Ol.ECONNABORTED,e,g)),w()}))}if(Sl.isStream(c)){let t=!1,n=!1;c.on("end",(()=>{t=!0})),c.once("error",(e=>{n=!0,g.destroy(e)})),c.on("close",(()=>{t||n||w(new Xd("Request stream has been aborted",e,g))})),c.pipe(g)}else g.end(c)},new Promise(((e,t)=>{let i,o;const r=(e,t)=>{o||(o=!0,i&&i(e,t))},a=e=>{r(e,!0),t(e)};n((t=>{r(t),e(t)}),a,(e=>i=e)).catch(a)}));var n},jh=qd.hasStandardBrowserEnv?{write(e,t,n,i,o,r){const a=[e+"="+encodeURIComponent(t)];Sl.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),Sl.isString(i)&&a.push("path="+i),Sl.isString(o)&&a.push("domain="+o),!0===r&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}},Ch=qd.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function i(n){let i=n;return e&&(t.setAttribute("href",i),i=t.href),t.setAttribute("href",i),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=i(window.location.href),function(e){const t=Sl.isString(e)?i(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function Ph(e,t){let n=0;const i=rh(50,250);return o=>{const r=o.loaded,a=o.lengthComputable?o.total:void 0,s=r-n,c=i(s);n=r;const u={loaded:r,total:a,progress:a?r/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&r<=a?(a-r)/c:void 0,event:o};u[t?"download":"upload"]=!0,e(u)}}var Lh="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let i=e.data;const o=Vd.from(e.headers).normalize();let r,a,{responseType:s,withXSRFToken:c}=e;function u(){e.cancelToken&&e.cancelToken.unsubscribe(r),e.signal&&e.signal.removeEventListener("abort",r)}if(Sl.isFormData(i))if(qd.hasStandardBrowserEnv||qd.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if(!1!==(a=o.getContentType())){const[e,...t]=a?a.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}let p=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+n))}const l=Qd(e.baseURL,e.url);function d(){if(!p)return;const i=Vd.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders());Zd((function(e){t(e),u()}),(function(e){n(e),u()}),{data:s&&"text"!==s&&"json"!==s?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:i,config:e,request:p}),p=null}if(p.open(e.method.toUpperCase(),Rd(l,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,"onloadend"in p?p.onloadend=d:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(d)},p.onabort=function(){p&&(n(new Ol("Request aborted",Ol.ECONNABORTED,e,p)),p=null)},p.onerror=function(){n(new Ol("Network Error",Ol.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const i=e.transitional||jd;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new Ol(t,i.clarifyTimeoutError?Ol.ETIMEDOUT:Ol.ECONNABORTED,e,p)),p=null},qd.hasStandardBrowserEnv&&(c&&Sl.isFunction(c)&&(c=c(e)),c||!1!==c&&Ch(l))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&jh.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===i&&o.setContentType(null),"setRequestHeader"in p&&Sl.forEach(o.toJSON(),(function(e,t){p.setRequestHeader(t,e)})),Sl.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),s&&"json"!==s&&(p.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",Ph(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",Ph(e.onUploadProgress)),(e.cancelToken||e.signal)&&(r=t=>{p&&(n(!t||t.type?new Xd(null,e,p):t),p.abort(),p=null)},e.cancelToken&&e.cancelToken.subscribe(r),e.signal&&(e.signal.aborted?r():e.signal.addEventListener("abort",r)));const f=ih(l);f&&-1===qd.protocols.indexOf(f)?n(new Ol("Unsupported protocol "+f+":",Ol.ERR_BAD_REQUEST,e)):p.send(i||null)}))};const Uh={http:kh,xhr:Lh};Sl.forEach(Uh,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Dh=e=>`- ${e}`,qh=e=>Sl.isFunction(e)||null===e||!1===e;var Mh=e=>{e=Sl.isArray(e)?e:[e];const{length:t}=e;let n,i;const o={};for(let r=0;r<t;r++){let t;if(n=e[r],i=n,!qh(n)&&(i=Uh[(t=String(n)).toLowerCase()],void 0===i))throw new Ol(`Unknown adapter '${t}'`);if(i)break;o[t||"#"+r]=i}if(!i){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new Ol("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Dh).join("\n"):" "+Dh(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return i};function Fh(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Xd(null,e)}function Bh(e){Fh(e),e.headers=Vd.from(e.headers),e.data=Jd.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Mh(e.adapter||Bd.adapter)(e).then((function(t){return Fh(e),t.data=Jd.call(e,e.transformResponse,t),t.headers=Vd.from(t.headers),t}),(function(t){return Yd(t)||(Fh(e),t&&t.response&&(t.response.data=Jd.call(e,e.transformResponse,t.response),t.response.headers=Vd.from(t.response.headers))),Promise.reject(t)}))}const Wh=e=>e instanceof Vd?e.toJSON():e;function zh(e,t){t=t||{};const n={};function i(e,t,n){return Sl.isPlainObject(e)&&Sl.isPlainObject(t)?Sl.merge.call({caseless:n},e,t):Sl.isPlainObject(t)?Sl.merge({},t):Sl.isArray(t)?t.slice():t}function o(e,t,n){return Sl.isUndefined(t)?Sl.isUndefined(e)?void 0:i(void 0,e,n):i(e,t,n)}function r(e,t){if(!Sl.isUndefined(t))return i(void 0,t)}function a(e,t){return Sl.isUndefined(t)?Sl.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function s(n,o,r){return r in t?i(n,o):r in e?i(void 0,n):void 0}const c={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t)=>o(Wh(e),Wh(t),!0)};return Sl.forEach(Object.keys(Object.assign({},e,t)),(function(i){const r=c[i]||o,a=r(e[i],t[i],i);Sl.isUndefined(a)&&r!==s||(n[i]=a)})),n}const Hh={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Hh[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const $h={};Hh.transitional=function(e,t,n){function i(e,t){return"[Axios v1.6.7] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,r)=>{if(!1===e)throw new Ol(i(o," has been removed"+(t?" in "+t:"")),Ol.ERR_DEPRECATED);return t&&!$h[o]&&($h[o]=!0,console.warn(i(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,r)}};var Gh={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Ol("options must be an object",Ol.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let o=i.length;for(;o-- >0;){const r=i[o],a=t[r];if(a){const t=e[r],n=void 0===t||a(t,r,e);if(!0!==n)throw new Ol("option "+r+" must be "+n,Ol.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Ol("Unknown option "+r,Ol.ERR_BAD_OPTION)}},validators:Hh};const Kh=Gh.validators;class Vh{constructor(e){this.defaults=e,this.interceptors={request:new kd,response:new kd}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=zh(this.defaults,t);const{transitional:n,paramsSerializer:i,headers:o}=t;void 0!==n&&Gh.assertOptions(n,{silentJSONParsing:Kh.transitional(Kh.boolean),forcedJSONParsing:Kh.transitional(Kh.boolean),clarifyTimeoutError:Kh.transitional(Kh.boolean)},!1),null!=i&&(Sl.isFunction(i)?t.paramsSerializer={serialize:i}:Gh.assertOptions(i,{encode:Kh.function,serialize:Kh.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let r=o&&Sl.merge(o.common,o[t.method]);o&&Sl.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=Vd.concat(r,o);const a=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let p,l=0;if(!s){const e=[Bh.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,c),p=e.length,u=Promise.resolve(t);l<p;)u=u.then(e[l++],e[l++]);return u}p=a.length;let d=t;for(l=0;l<p;){const e=a[l++],t=a[l++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=Bh.call(this,d)}catch(e){return Promise.reject(e)}for(l=0,p=c.length;l<p;)u=u.then(c[l++],c[l++]);return u}getUri(e){return Rd(Qd((e=zh(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}Sl.forEach(["delete","get","head","options"],(function(e){Vh.prototype[e]=function(t,n){return this.request(zh(n||{},{method:e,url:t,data:(n||{}).data}))}})),Sl.forEach(["post","put","patch"],(function(e){function t(t){return function(n,i,o){return this.request(zh(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}Vh.prototype[e]=t(),Vh.prototype[e+"Form"]=t(!0)}));var Jh=Vh;class Yh{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const i=new Promise((e=>{n.subscribe(e),t=e})).then(e);return i.cancel=function(){n.unsubscribe(t)},i},e((function(e,i,o){n.reason||(n.reason=new Xd(e,i,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Yh((function(t){e=t})),cancel:e}}}var Xh=Yh;const Zh={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Zh).forEach((([e,t])=>{Zh[t]=e}));var Qh=Zh;const em=function e(t){const n=new Jh(t),i=$p(Jh.prototype.request,n);return Sl.extend(i,Jh.prototype,n,{allOwnKeys:!0}),Sl.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return e(zh(t,n))},i}(Bd);em.Axios=Jh,em.CanceledError=Xd,em.CancelToken=Xh,em.isCancel=Yd,em.VERSION=nh,em.toFormData=Od,em.AxiosError=Ol,em.Cancel=em.CanceledError,em.all=function(e){return Promise.all(e)},em.spread=function(e){return function(t){return e.apply(null,t)}},em.isAxiosError=function(e){return Sl.isObject(e)&&!0===e.isAxiosError},em.mergeConfig=zh,em.AxiosHeaders=Vd,em.formToJSON=e=>Md(Sl.isHTMLForm(e)?new FormData(e):e),em.getAdapter=Mh,em.HttpStatusCode=Qh,em.default=em;var tm=em;process.env.NODE_ENV;var nm=tm.create();function im(e){return function(e){!e.method&&e.data&&(e.method="post"),e.method||e.data||(e.method="get")}(e),function(e){e.requestInterceptors&&"function"==typeof e.requestInterceptors&&nm.interceptors.request.use(e.requestInterceptors),e.responseInterceptors&&"function"==typeof e.responseInterceptors&&nm.interceptors.request.use(e.responseInterceptors)}(e),new Promise((function(t,n){nm.request({method:e.method,url:e.url,headers:(null==e?void 0:e.headers)||{},data:e,params:e.params,timeout:8e3}).then((function(e){if(200===e.data.code){var i=e.data.data;t(i)}else{i=e.data.data;n(i)}})).catch((function(e){n(e)}))}))}export{Hp as callFunction,im as request};
|