Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@cloudbase/js-sdk

Package Overview
Dependencies
Maintainers
10
Versions
374
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cloudbase/js-sdk - npm Package Compare versions

Comparing version
1.1.3
to
1.1.4
+1
-1
miniprogram_dist/app.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("cloudbase",[],e):"object"==typeof exports?exports.cloudbase=e():t.cloudbase=e()}("undefined"!=typeof window?window:this,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=8)}([function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.utils=e.events=e.cache=e.adapters=e.constants=void 0;var s=i(r(5));e.constants=s;var a=i(r(12));e.adapters=a;var c=i(r(19));e.cache=c;var u=i(r(20));e.events=u;var f=i(r(2));e.utils=f},function(t,e,r){"use strict";(function(t){r.d(e,"h",(function(){return c})),r.d(e,"e",(function(){return u})),r.d(e,"g",(function(){return f})),r.d(e,"d",(function(){return l})),r.d(e,"a",(function(){return p})),r.d(e,"f",(function(){return v})),r.d(e,"c",(function(){return g})),r.d(e,"b",(function(){return h}));var n=r(0),o=n.constants.setSdkName,i=n.constants.setProtocol,s="",a="@cloudbase/js-sdk";function c(t){s=t}function u(){return s}function f(t){a=t,o(t)}function l(){return a}var h,p="2020-01-10",d="undefined"!=typeof location&&"http:"===location.protocol?"http:":"https:",y="//tcb-api.tencentcloudapi.com/web";function v(t,e){y=t,e&&(d=e,i(e))}function g(){return{BASE_URL:y,PROTOCOL:d}}!function(t){t.ANONYMOUS="ANONYMOUS",t.WECHAT="WECHAT",t.CUSTOM="CUSTOM",t.NULL="NULL"}(h||(h={}))}).call(this,r(7))},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.throwError=e.printInfo=e.printError=e.printWarn=e.execCallback=e.createPromiseCallback=e.removeParam=e.getHash=e.getQuery=e.toQueryString=e.createSign=e.formatUrl=e.genSeqId=e.isFormData=e.isInstanceOf=e.isNull=e.isPalinObject=e.isUndefined=e.isString=e.isArray=void 0;var o=n(r(14)),i=n(r(17)),s=n(r(18)),a=r(5);function c(t){var e=i.default.stringify(t);return e=(e=(e=e.replace(/=+$/,"")).replace(/\+/g,"-")).replace(/\//g,"_")}e.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},e.isString=function(t){return"string"==typeof t},e.isUndefined=function(t){return void 0===t},e.isPalinObject=function(t){return"[object Object]"===Object.prototype.toString.call(t)},e.isNull=function(t){return"[object Null]"===Object.prototype.toString.call(t)},e.isInstanceOf=function(t,e){return t instanceof e},e.isFormData=function(t){return"[object FormData]"===Object.prototype.toString.call(t)},e.genSeqId=function(){return Math.random().toString(16).slice(2)},e.formatUrl=function(t,e,r){void 0===r&&(r={});var n=/\?/.test(e),o="";for(var i in r)""===o?!n&&(e+="?"):o+="&",o+=i+"="+encodeURIComponent(r[i]);return/^http(s)?\:\/\//.test(e+=o)?e:""+t+e},e.createSign=function(t,e){var r=c(s.default.parse(JSON.stringify({alg:"HS256",typ:"JWT"})))+"."+c(s.default.parse(JSON.stringify(t)));return r+"."+c(o.default(r,e))},e.toQueryString=function(t){void 0===t&&(t={});var e=[];for(var r in t)e.push(r+"="+encodeURIComponent(t[r]));return e.join("&")},e.getQuery=function(t,e){if("undefined"==typeof window)return!1;var r=e||window.location.search,n=new RegExp("(^|&)"+t+"=([^&]*)(&|$)"),o=r.substr(r.indexOf("?")+1).match(n);return null!=o?o[2]:""},e.getHash=function(t){if("undefined"==typeof window)return"";var e=window.location.hash.match(new RegExp("[#?&/]"+t+"=([^&#]*)"));return e?e[1]:""},e.removeParam=function(t,e){var r=e.split("?")[0],n=[],o=-1!==e.indexOf("?")?e.split("?")[1]:"";if(""!==o){for(var i=(n=o.split("&")).length-1;i>=0;i-=1)n[i].split("=")[0]===t&&n.splice(i,1);r=r+"?"+n.join("&")}return r},e.createPromiseCallback=function(){var t;if(!Promise){(t=function(){}).promise={};var e=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(t.promise,"then",{get:e}),Object.defineProperty(t.promise,"catch",{get:e}),t}var r=new Promise((function(e,r){t=function(t,n){return t?r(t):e(n)}}));return t.promise=r,t},e.execCallback=function(t,e,r){if(void 0===r&&(r=null),t&&"function"==typeof t)return t(e,r);if(e)throw e;return r},e.printWarn=function(t,e){console.warn("["+a.getSdkName()+"]["+t+"]:"+e)},e.printError=function(t,e){console.error({code:t,msg:"["+a.getSdkName()+"]["+t+"]:"+e})},e.printInfo=function(t,e){console.log("["+a.getSdkName()+"]["+t+"]:"+e)},e.throwError=function(t,e){throw new Error(JSON.stringify({code:t,msg:"["+a.getSdkName()+"]["+t+"]:"+e}))}},function(t,e,r){"use strict";var n;r.r(e),r.d(e,"StorageType",(function(){return n})),r.d(e,"AbstractSDKRequest",(function(){return o})),r.d(e,"AbstractStorage",(function(){return i})),r.d(e,"formatUrl",(function(){return s})),function(t){t.local="local",t.none="none",t.session="session"}(n||(n={}));var o=function(){},i=function(){};function s(t,e,r){void 0===r&&(r={});var n=/\?/.test(e),o="";for(var i in r)""===o?!n&&(e+="?"):o+="&",o+=i+"="+encodeURIComponent(r[i]);return/^http(s)?\:\/\//.test(e+=o)?e:""+t+e}},function(t,e,r){var n;t.exports=(n=n||function(t,e){var r=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),n={},o=n.lib={},i=o.Base={extend:function(t){var e=r(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},s=o.WordArray=i.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||c).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,o=t.sigBytes;if(this.clamp(),n%4)for(var i=0;i<o;i++){var s=r[i>>>2]>>>24-i%4*8&255;e[n+i>>>2]|=s<<24-(n+i)%4*8}else for(i=0;i<o;i+=4)e[n+i>>>2]=r[i>>>2];return this.sigBytes+=o,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=i.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var r,n=[],o=function(e){e=e;var r=987654321,n=4294967295;return function(){var o=((r=36969*(65535&r)+(r>>16)&n)<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n;return o/=4294967296,(o+=.5)*(t.random()>.5?1:-1)}},i=0;i<e;i+=4){var a=o(4294967296*(r||t.random()));r=987654071*a(),n.push(4294967296*a()|0)}return new s.init(n,e)}}),a=n.enc={},c=a.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o++){var i=e[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n+=2)r[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new s.init(r,e/2)}},u=a.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o++){var i=e[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new s.init(r,e)}},f=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},l=o.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=f.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r=this._data,n=r.words,o=r.sigBytes,i=this.blockSize,a=o/(4*i),c=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*i,u=t.min(4*c,o);if(c){for(var f=0;f<c;f+=i)this._doProcessBlock(n,f);var l=n.splice(0,c);r.sigBytes-=u}return new s.init(l,u)},clone:function(){var t=i.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),h=(o.Hasher=l.extend({cfg:i.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new h.HMAC.init(t,r).finalize(e)}}}),n.algo={});return n}(Math),n)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),o(r(6),e),o(r(11),e)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getProtocol=e.setProtocol=e.getSdkName=e.setSdkName=void 0;var n="@cloudbase/js-sdk";e.setSdkName=function(t){n=t},e.getSdkName=function(){return n};var o="undefined"!=typeof location&&"http:"===location.protocol?"http:":"https:";e.setProtocol=function(t){o=t},e.getProtocol=function(){return o}},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var c,u=[],f=!1,l=-1;function h(){f&&c&&(f=!1,c.length?u=c.concat(u):l=-1,u.length&&p())}function p(){if(!f){var t=a(h);f=!0;for(var e=u.length;e;){for(c=u,u=[];++l<e;)c&&c[l].run();l=-1,e=u.length}c=null,f=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new d(t,e)),1!==u.length||f||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,r){r(9),t.exports=r(10)},function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function a(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),s=new S(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return A()}for(r.method=o,r.arg=i;;){var s=r.delegate;if(s){var a=m(s,r);if(a){if(a===u)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var f=c(t,e,r);if("normal"===f.type){if(n=r.done?"completed":"suspendedYield",f.arg===u)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n="completed",r.method="throw",r.arg=f.arg)}}}(t,r,s),i}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=a;var u={};function f(){}function l(){}function h(){}var p={};p[o]=function(){return this};var d=Object.getPrototypeOf,y=d&&d(d(O([])));y&&y!==e&&r.call(y,o)&&(p=y);var v=h.prototype=f.prototype=Object.create(p);function g(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function _(t,e){var n;this._invoke=function(o,i){function s(){return new e((function(n,s){!function n(o,i,s,a){var u=c(t[o],t,i);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(l).then((function(t){f.value=t,s(f)}),(function(t){return n("throw",t,s,a)}))}a(u.arg)}(o,i,n,s)}))}return n=n?n.then(s,s):s()}}function m(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method))return u;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var n=c(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,u;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:A}}function A(){return{value:void 0,done:!0}}return l.prototype=v.constructor=h,h.constructor=l,h[s]=l.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(v),t},t.awrap=function(t){return{__await:t}},g(_.prototype),_.prototype[i]=function(){return this},t.AsyncIterator=_,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var s=new _(a(e,r,n,o),i);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},g(v),v[s]="Generator",v[o]=function(){return this},v.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return s.type="throw",s.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(a&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;w(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return o(e,t),e},s=(this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}})(r(22)),a=i(r(21)).version;s.default.registerVersion(a);try{window.cloudbase=s.default}catch(t){}e.default=s.default,t.exports=s.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ERRORS=void 0,e.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(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.useDefaultAdapter=e.useAdapters=e.RUNTIME=void 0;var s,a=i(r(13)),c=r(2);!function(t){t.WEB="web",t.WX_MP="wx_mp"}(s=e.RUNTIME||(e.RUNTIME={})),e.useAdapters=function(t){for(var e=0,r=c.isArray(t)?t:[t];e<r.length;e++){var n=r[e],o=n.isMatch,i=n.genAdapter,s=n.runtime;if(o())return{adapter:i(),runtime:s}}},e.useDefaultAdapter=function(){return{adapter:a.genAdapter(),runtime:s.WEB}}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},s=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{c(n.next(t))}catch(t){i(t)}}function a(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var r,n,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(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.WebRequest=e.genAdapter=void 0;var c=r(3),u=r(2),f=r(6),l=function(t){function e(e){var r=t.call(this)||this,n=e.timeout,o=e.timeoutMsg,i=e.restrictedMethods;return r._timeout=n||0,r._timeoutMsg=o||"请求超时",r._restrictedMethods=i||["get","post","upload","download"],r}return o(e,t),e.prototype.get=function(t){return this._request(i(i({},t),{method:"get"}),this._restrictedMethods.includes("get"))},e.prototype.post=function(t){return this._request(i(i({},t),{method:"post"}),this._restrictedMethods.includes("post"))},e.prototype.put=function(t){return this._request(i(i({},t),{method:"put"}))},e.prototype.upload=function(t){var e=t.data,r=t.file,n=t.name,o=new FormData;for(var s in e)o.append(s,e[s]);return o.append("key",n),o.append("file",r),this._request(i(i({},t),{data:o,method:"post"}),this._restrictedMethods.includes("upload"))},e.prototype.download=function(t){return s(this,void 0,void 0,(function(){var e,r,n,o;return a(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.get(i(i({},t),{headers:{},responseType:"blob"}))];case 1:return e=s.sent().data,r=window.URL.createObjectURL(new Blob([e])),n=decodeURIComponent(new URL(t.url).pathname.split("/").pop()||""),(o=document.createElement("a")).href=r,o.setAttribute("download",n),o.style.display="none",document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(r),document.body.removeChild(o),[3,3];case 2:return s.sent(),[3,3];case 3:return[2,new Promise((function(e){e({statusCode:200,tempFilePath:t.url})}))]}}))}))},e.prototype._request=function(t,e){var r=this;void 0===e&&(e=!1);var n=String(t.method).toLowerCase()||"get";return new Promise((function(o){var i,s,a=t.url,c=t.headers,l=void 0===c?{}:c,h=t.data,p=t.responseType,d=t.withCredentials,y=t.body,v=t.onUploadProgress,g=u.formatUrl(f.getProtocol(),a,"get"===n?h:{}),_=new XMLHttpRequest;for(var m in _.open(n,g),p&&(_.responseType=p),l)_.setRequestHeader(m,l[m]);v&&_.addEventListener("progress",v),_.onreadystatechange=function(){var t={};if(4===_.readyState){var e=_.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};e.forEach((function(t){var e=t.split(": "),n=e.shift().toLowerCase(),o=e.join(": ");r[n]=o})),t.header=r,t.statusCode=_.status;try{t.data="blob"===p?_.response:JSON.parse(_.responseText)}catch(e){t.data="blob"===p?_.response:_.responseText}clearTimeout(i),o(t)}},e&&r._timeout&&(i=setTimeout((function(){console.warn(r._timeoutMsg),_.abort()}),r._timeout)),s=u.isFormData(h)?h:"application/x-www-form-urlencoded"===l["content-type"]?u.toQueryString(h):y||(h?JSON.stringify(h):void 0),d&&(_.withCredentials=!0),_.send(s)}))},e}(c.AbstractSDKRequest);e.WebRequest=l,e.genAdapter=function(){return{root:window,reqClass:l,wsClass:WebSocket,localStorage:localStorage,sessionStorage:sessionStorage}}},function(t,e,r){var n;t.exports=(n=r(4),r(15),r(16),n.HmacSHA256)},function(t,e,r){var n;t.exports=(n=r(4),function(t){var e=n,r=e.lib,o=r.WordArray,i=r.Hasher,s=e.algo,a=[],c=[];!function(){function e(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0}function r(t){return 4294967296*(t-(0|t))|0}for(var n=2,o=0;o<64;)e(n)&&(o<8&&(a[o]=r(t.pow(n,.5))),c[o]=r(t.pow(n,1/3)),o++),n++}();var u=[],f=s.SHA256=i.extend({_doReset:function(){this._hash=new o.init(a.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],s=r[3],a=r[4],f=r[5],l=r[6],h=r[7],p=0;p<64;p++){if(p<16)u[p]=0|t[e+p];else{var d=u[p-15],y=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,v=u[p-2],g=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[p]=y+u[p-7]+g+u[p-16]}var _=n&o^n&i^o&i,m=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>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=n,n=b+(m+_)|0}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+f|0,r[6]=r[6]+l|0,r[7]=r[7]+h|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;return r[o>>>5]|=128<<24-o%32,r[14+(o+64>>>9<<4)]=t.floor(n/4294967296),r[15+(o+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=i._createHelper(f),e.HmacSHA256=i._createHmacHelper(f)}(Math),n.SHA256)},function(t,e,r){var n,o,i,s;t.exports=(n=r(4),i=(o=n).lib.Base,s=o.enc.Utf8,void(o.algo.HMAC=i.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=s.parse(e));var r=t.blockSize,n=4*r;e.sigBytes>n&&(e=t.finalize(e)),e.clamp();for(var o=this._oKey=e.clone(),i=this._iKey=e.clone(),a=o.words,c=i.words,u=0;u<r;u++)a[u]^=1549556828,c[u]^=909522486;o.sigBytes=i.sigBytes=n,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher,r=e.finalize(t);return e.reset(),e.finalize(this._oKey.clone().concat(r))}})))},function(t,e,r){var n,o,i;t.exports=(i=r(4),o=(n=i).lib.WordArray,n.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var o=[],i=0;i<r;i+=3)for(var s=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a<r;a++)o.push(n.charAt(s>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(t){var e=t.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var i=0;i<r.length;i++)n[r.charCodeAt(i)]=i}var s=r.charAt(64);if(s){var a=t.indexOf(s);-1!==a&&(e=a)}return function(t,e,r){for(var n=[],i=0,s=0;s<e;s++)if(s%4){var a=r[t.charCodeAt(s-1)]<<s%4*2,c=r[t.charCodeAt(s)]>>>6-s%4*2;n[i>>>2]|=(a|c)<<24-i%4*8,i++}return o.create(n,i)}(t,e,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},i.enc.Base64)},function(t,e,r){var n;t.exports=(n=r(4),n.enc.Utf8)},function(t,e,r){"use strict";(function(t){var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{c(n.next(t))}catch(t){i(t)}}function a(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var r,n,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(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.CloudbaseCache=void 0;var a=r(3),c=r(2),u=r(5),f=function(t){function e(e){var r=t.call(this)||this;return r._root=e,e.tcbCacheObject||(e.tcbCacheObject={}),r}return o(e,t),e.prototype.setItem=function(t,e){this._root.tcbCacheObject[t]=e},e.prototype.getItem=function(t){return this._root.tcbCacheObject[t]},e.prototype.removeItem=function(t){delete this._root.tcbCacheObject[t]},e.prototype.clear=function(){delete this._root.tcbCacheObject},e}(a.AbstractStorage);function l(t,e){switch(t){case"local":return e.localStorage?e.localStorage:(c.printWarn(u.ERRORS.INVALID_PARAMS,"localStorage is not supported on current platform"),new f(e.root));case"none":return new f(e.root);default:return e.sessionStorage?e.sessionStorage:(c.printWarn(u.ERRORS.INVALID_PARAMS,"sessionStorage is not supported on current platform"),new f(e.root))}}var h=function(){function e(t){this.keys={};var e=t.persistence,r=t.platformInfo,n=void 0===r?{}:r,o=t.keys,i=void 0===o?{}:o,s=t.alwaysLocalKeys,a=void 0===s?[]:s;this._platformInfo=n,this._alwaysLocalKeys=a,this._storage||(this._persistence=n.adapter.primaryStorage||e,this._storage=l(this._persistence,n.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(t){if("async"!==this.mode){if(t!==this._persistence){var e="local"===this._persistence;this._persistence=t;var r=l(t,this._platformInfo.adapter);for(var n in this.keys){var o=this.keys[n];if(!e||!this._alwaysLocalKeys.includes(n)){var i=this._storage.getItem(o);c.isUndefined(i)||c.isNull(i)||(r.setItem(o,i),this._storage.removeItem(o))}}this._storage=r}}else c.printWarn(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use updatePersistenceAsync insteed")},e.prototype.updatePersistenceAsync=function(t){return i(this,void 0,void 0,(function(){var e,r,n,o,i,a,u,f;return s(this,(function(s){switch(s.label){case 0:if(t===this._persistence)return[2];for(o in e="local"===this._persistence,this._persistence=t,r=l(t,this._platformInfo.adapter),n=[],this.keys)n.push(o);i=0,s.label=1;case 1:return i<n.length?(a=n[i],u=this.keys[a],e&&this._alwaysLocalKeys.includes(a)?[3,4]:[4,this._storage.getItem(u)]):[3,5];case 2:return f=s.sent(),c.isUndefined(f)||c.isNull(f)?[3,4]:(r.setItem(u,f),[4,this._storage.removeItem(u)]);case 3:s.sent(),s.label=4;case 4:return i++,[3,1];case 5:return this._storage=r,[2]}}))}))},e.prototype.setStore=function(t,e,r){if("async"!==this.mode){if(this._storage)try{var n={version:r||"localCachev1",content:e};this._storage.setItem(t,JSON.stringify(n))}catch(t){return}}else c.printWarn(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},e.prototype.setStoreAsync=function(t,e,r){return i(this,void 0,void 0,(function(){var n;return s(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]),n={version:r||"localCachev1",content:e},[4,this._storage.setItem(t,JSON.stringify(n))];case 2:return o.sent(),[3,4];case 3:return o.sent(),[2];case 4:return[2]}}))}))},e.prototype.getStore=function(e,r){var n;if("async"!==this.mode){try{if(void 0!==t&&(null===(n=t.env)||void 0===n?void 0:n.tcb_token))return t.env.tcb_token;if(!this._storage)return""}catch(t){return""}r=r||"localCachev1";var o=this._storage.getItem(e);return o&&o.indexOf(r)>=0?JSON.parse(o).content:""}c.printWarn(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},e.prototype.getStoreAsync=function(e,r){var n;return i(this,void 0,void 0,(function(){var o;return s(this,(function(i){switch(i.label){case 0:try{if(void 0!==t&&(null===(n=t.env)||void 0===n?void 0:n.tcb_token))return[2,t.env.tcb_token];if(!this._storage)return[2,""]}catch(t){return[2,""]}return r=r||"localCachev1",[4,this._storage.getItem(e)];case 1:return(o=i.sent())&&o.indexOf(r)>=0?[2,JSON.parse(o).content]:[2,""]}}))}))},e.prototype.removeStore=function(t){"async"!==this.mode?this._storage.removeItem(t):c.printWarn(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},e.prototype.removeStoreAsync=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this._storage.removeItem(t)];case 1:return e.sent(),[2]}}))}))},e}();e.CloudbaseCache=h}).call(this,r(7))},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)n[o]=i[s];return n};Object.defineProperty(e,"__esModule",{value:!0}),e.removeEventListener=e.activateEvent=e.addEventListener=e.CloudbaseEventEmitter=e.IErrorEvent=e.CloudbaseEvent=void 0;var s=r(2);var a=function(t,e){this.data=e||null,this.name=t};e.CloudbaseEvent=a;var c=function(t){function e(e,r){var n=t.call(this,"error",{error:e,data:r})||this;return n.error=e,n}return o(e,t),e}(a);e.IErrorEvent=c;var u=function(){function t(){this._listeners={}}return t.prototype.on=function(t,e){return function(t,e,r){r[t]=r[t]||[],r[t].push(e)}(t,e,this._listeners),this},t.prototype.off=function(t,e){return function(t,e,r){if(null==r?void 0:r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}(t,e,this._listeners),this},t.prototype.fire=function(t,e){if(s.isInstanceOf(t,c))return console.error(t.error),this;var r=s.isString(t)?new a(t,e||{}):t,n=r.name;if(this._listens(n)){r.target=this;for(var o=0,u=this._listeners[n]?i(this._listeners[n]):[];o<u.length;o++){u[o].call(this,r)}}return this},t.prototype._listens=function(t){return this._listeners[t]&&this._listeners[t].length>0},t}();e.CloudbaseEventEmitter=u;var f=new u;e.addEventListener=function(t,e){f.on(t,e)},e.activateEvent=function(t,e){void 0===e&&(e={}),f.fire(t,e)},e.removeEventListener=function(t,e){f.off(t,e)}},function(t){t.exports=JSON.parse('{"version":"1.1.2"}')},function(t,e,r){"use strict";r.r(e),r.d(e,"cloudbase",(function(){return et}));var n,o=r(0),i=r(3),s=(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),a=function(){return(a=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},c=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{c(n.next(t))}catch(t){i(t)}}function a(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},u=function(t,e){var r,n,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(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};var f=function(t){function e(e){void 0===e&&(e={});var r=t.call(this)||this,n=e.timeout,o=e.timeoutMsg,i=e.restrictedMethods;return r._timeout=n||0,r._timeoutMsg=o||"请求超时",r._restrictedMethods=i||["get","post","upload","download"],r}return s(e,t),e.prototype.post=function(t){var e=this;return new Promise((function(r,n){var o=null,s=t.url,a=t.data,c=t.headers,u=wx.request({url:Object(i.formatUrl)("https:",s),data:a,method:"POST",header:c,success:function(t){e._clearTimeout(o),r(t)},fail:function(t){e._clearTimeout(o),n(t)}});o=e._setTimeout("post",u)}))},e.prototype.upload=function(t){var e=this,r=this;return new Promise((function(n){return c(e,void 0,void 0,(function(){var e,o,s,c,f,l;return u(this,(function(u){return e=null,o=t.url,s=t.file,c=t.data,f=t.headers,l=wx.uploadFile({url:Object(i.formatUrl)("https:",o),filePath:s,name:"file",formData:a(a({},c),{file:s}),header:f,success:function(t){r._clearTimeout(e);var o={statusCode:t.statusCode,data:t.data||{}};200===t.statusCode&&c.success_action_status&&(o.statusCode=parseInt(c.success_action_status,10)),n(o)},fail:function(t){r._clearTimeout(e),n(t)}}),e=r._setTimeout("upload",l),[2]}))}))}))},e.prototype.download=function(t){var e=this,r=this;return new Promise((function(n,o){var s=null,a=t.url,c=t.headers,u=wx.downloadFile({url:Object(i.formatUrl)("https:",a),header:c,success:function(t){r._clearTimeout(s),200===t.statusCode&&t.tempFilePath?n({statusCode:200,tempFilePath:t.tempFilePath}):n(t)},fail:function(t){r._clearTimeout(s),o(t)}});s=e._setTimeout("download",u)}))},e.prototype._clearTimeout=function(t){t&&(clearTimeout(t),t=null)},e.prototype._setTimeout=function(t,e){var r=this;return this._timeout&&-1!==this._restrictedMethods.indexOf(t)?setTimeout((function(){console.warn(r._timeoutMsg),e.abort()}),this._timeout):null},e}(i.AbstractSDKRequest),l={setItem:function(t,e){wx.setStorageSync(t,e)},getItem:function(t){return wx.getStorageSync(t)},removeItem:function(t){wx.removeStorageSync(t)},clear:function(){wx.clearStorageSync()}},h=function(t,e){void 0===e&&(e={});var r=wx.connectSocket(a({url:t},e));return{set onopen(t){r.onOpen(t)},set onmessage(t){r.onMessage(t)},set onclose(t){r.onClose(t)},set onerror(t){r.onError(t)},send:function(t){return r.send({data:t})},close:function(t,e){return r.close({code:t,reason:e})},get readyState(){return r.readyState},CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3}};var p={genAdapter:function(){return{root:{},reqClass:f,wsClass:h,localStorage:l,primaryStorage:i.StorageType.local,getAppSign:function(){var t=wx.getAccountInfoSync();return t&&t.miniProgram?t.miniProgram.appId:""}}},isMatch:function(){if("undefined"==typeof wx)return!1;if("undefined"==typeof App)return!1;if("undefined"==typeof Page)return!1;if("function"!=typeof getApp)return!1;if(!wx.onAppHide)return!1;if(!wx.offAppHide)return!1;if(!wx.onAppShow)return!1;if(!wx.offAppShow)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(t){return!1}return!0},runtime:"wx_mp"},d=r(1),y=function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)n[o]=i[s];return n},v=o.constants.ERRORS,g={};function _(t,e){var r=e.name,n=e.namespace,o=e.entity,i=e.injectEvents;if(g[r]||n&&t[n])throw new Error("["+Object(d.d)()+"]["+v.INVALID_OPERATION+"]There were multiple attempts to register component "+r+".");if(g[r]=e,n?t.prototype[n]=o:function t(e,r){if(!(r instanceof Object))return r;switch(r.constructor){case Date:return new Date(r.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return r}for(var n in r)r.hasOwnProperty(n)&&(e[n]=t(e[n],r[n]));return e}(t.prototype,o),i){var s=i.bus,a=i.events;if(!s||!a||0===a.length)return;var c=t.prototype.fire||function(){};t.prototype.events||(t.prototype.events={}),(t.prototype.events||{})[r]?t.prototype.events[r].events=y(t.prototype.events[r].events,a):t.prototype.events[r]={bus:s,events:a},t.prototype.fire=function(t,e){for(var r in c(t,e),this.events){var n=this.events[r],o=n.bus;if(n.events.includes(t)){o.fire(t,e);break}}}}}var m={},b=function(){return(b=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},w=o.cache.CloudbaseCache,S={},O={};function A(t){var e=t.env,r=t.persistence,n=t.platformInfo,o={accessTokenKey:"access_token_"+e,accessTokenExpireKey:"access_token_expire_"+e,refreshTokenKey:"refresh_token_"+e,anonymousUuidKey:"anonymous_uuid_"+e,loginTypeKey:"login_type_"+e,userInfoKey:"user_info_"+e};S[e]?S[e].updatePersistence(r):S[e]=new w(b(b({},t),{keys:o,platformInfo:n,alwaysLocalKeys:["anonymousUuidKey"]})),O[e]=O[e]||new w(b(b({},t),{keys:o,platformInfo:n,persistence:"local"}))}function x(t){return S[t]}function E(t){return O[t]}var k="loginStateExpire",P="refreshAccessToken",T=r(2),I=function(){return(I=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},R=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{c(n.next(t))}catch(t){i(t)}}function a(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},j=function(t,e){var r,n,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(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},N=o.constants.ERRORS,L=o.utils.genSeqId,C=o.utils.isFormData,M=o.utils.formatUrl,U=o.utils.createSign,D=o.adapters.RUNTIME,q=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"];function K(t,e,r){var n=t[e];t[e]=function(e){var o={},i={};r.forEach((function(r){var n=r.call(t,e),s=n.data,a=n.headers;Object.assign(o,s),Object.assign(i,a)}));var s=e.data;return s&&function(){if(C(s))for(var t in o)s.append(t,o[t]);else e.data=I(I({},s),o)}(),e.headers=I(I({},e.headers||{}),i),n.call(t,e)}}function B(){var t=L();return{data:{seqId:t},headers:{"X-SDK-Version":"@cloudbase/js-sdk/"+Object(d.e)(),"x-seqid":t}}}var W=function(){function t(t){this._throwWhenRequestFail=!1,this.config=t,this._reqClass=new m.adapter.reqClass({timeout:this.config.timeout,timeoutMsg:"[tcb-js-sdk] 请求在"+this.config.timeout/1e3+"s内未完成,已中断",restrictedMethods:["post"]}),this._throwWhenRequestFail=t.throw||!1,this._cache=x(this.config.env),this._localCache=E(this.config.env),K(this._reqClass,"post",[B]),K(this._reqClass,"upload",[B]),K(this._reqClass,"download",[B])}return t.prototype.post=function(t){return R(this,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this._reqClass.post(t)];case 1:return[2,e.sent()]}}))}))},t.prototype.upload=function(t){return R(this,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this._reqClass.upload(t)];case 1:return[2,e.sent()]}}))}))},t.prototype.download=function(t){return R(this,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this._reqClass.download(t)];case 1:return[2,e.sent()]}}))}))},t.prototype.refreshAccessToken=function(){return R(this,void 0,void 0,(function(){var t,e,r;return j(this,(function(n){switch(n.label){case 0:this._refreshAccessTokenPromise||(this._refreshAccessTokenPromise=this._refreshAccessToken()),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this._refreshAccessTokenPromise];case 2:return t=n.sent(),[3,4];case 3:return r=n.sent(),e=r,[3,4];case 4:if(this._refreshAccessTokenPromise=null,this._shouldRefreshAccessTokenHook=null,e)throw e;return[2,t]}}))}))},t.prototype.getAccessToken=function(){return R(this,void 0,void 0,(function(){var t,e,r,n,o,i,s,a,c;return j(this,(function(u){switch(u.label){case 0:return t=this._cache.keys,e=t.accessTokenKey,r=t.accessTokenExpireKey,n=t.refreshTokenKey,[4,this._cache.getStoreAsync(n)];case 1:return u.sent()||Object(T.throwError)(N.INVALID_PARAMS,"refresh token is not exist"),[4,this._cache.getStoreAsync(e)];case 2:return o=u.sent(),s=Number,[4,this._cache.getStoreAsync(r)];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}]}}))}))},t.prototype.request=function(t,e,r){return R(this,void 0,void 0,(function(){var n,o,i,s,a,c,u,f,l,h,p,y,v,g,_,b,w,S,O,A,x,E,k,P,T,R;return j(this,(function(j){switch(j.label){case 0:return n="x-tcb-trace_"+this.config.env,o="application/x-www-form-urlencoded",i=I({action:t,dataVersion:d.a,env:this.config.env},e),-1!==q.indexOf(t)?[3,3]:(s=this._cache.keys.refreshTokenKey,[4,this._cache.getStoreAsync(s)]);case 1:return j.sent()?(a=i,[4,this.getAccessToken()]):[3,3];case 2:a.access_token=j.sent().accessToken,j.label=3;case 3:if("storage.uploadFile"===t){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==r?void 0:r.onUploadProgress)&&(f.onUploadProgress=r.onUploadProgress),(l=this._localCache.getStore(n))&&(f.headers["X-TCB-Trace"]=l),m.runtime!==D.WEB&&(h=this.config,p=h.appSign,y=h.appSecret,v=Date.now(),g=y.appAccessKey,_=y.appAccessKeyId,b=U({data:c,timestamp:v,appAccessKeyId:_,appSign:p},g),f.headers["X-TCB-App-Source"]="timestamp="+v+";appAccessKeyId="+_+";appSign="+p+";sign="+b),w=e.parse,S=e.inQuery,O=e.search,A={env:this.config.env},w&&(A.parse=!0),S&&(A=I(I({},S),A)),x=Object(d.c)(),E=x.BASE_URL,k=x.PROTOCOL,P=M(k,E,A),O&&(P+=O),[4,this.post(I({url:P,data:c},f))];case 4:if(T=j.sent(),(R=T.header&&T.header["x-tcb-trace"])&&this._localCache.setStore(n,R),200!==Number(T.status)&&200!==Number(T.statusCode)||!T.data)throw new Error("network request error");return[2,T]}}))}))},t.prototype.send=function(t,e){return void 0===e&&(e={}),R(this,void 0,void 0,(function(){var r,n;return j(this,(function(o){switch(o.label){case 0:return[4,this.request(t,e,{onUploadProgress:e.onUploadProgress})];case 1:return"ACCESS_TOKEN_EXPIRED"!==(r=o.sent()).data.code||-1!==q.indexOf(t)?[3,4]:[4,this.refreshAccessToken()];case 2:return o.sent(),[4,this.request(t,e,{onUploadProgress:e.onUploadProgress})];case 3:return(n=o.sent()).data.code&&this._throwWhenRequestFail&&Object(T.throwError)(N.OPERATION_FAIL,"["+n.data.code+"] "+n.data.message),[2,n.data];case 4:return r.data.code&&this._throwWhenRequestFail&&Object(T.throwError)(N.OPERATION_FAIL,"["+r.data.code+"] "+r.data.message),[2,r.data]}}))}))},t.prototype._refreshAccessToken=function(){return R(this,void 0,void 0,(function(){var t,e,r,n,o,i,s,a,c,u,f,l,h;return j(this,(function(p){switch(p.label){case 0:return t=this._cache.keys,e=t.accessTokenKey,r=t.accessTokenExpireKey,n=t.refreshTokenKey,o=t.loginTypeKey,i=t.anonymousUuidKey,[4,this._cache.removeStoreAsync(e)];case 1:return p.sent(),[4,this._cache.removeStoreAsync(r)];case 2:return p.sent(),[4,this._cache.getStoreAsync(n)];case 3:if(!(s=p.sent()))throw new Error("["+Object(d.d)()+"]["+N.INVALID_OPERATION+"] not login");return a={refresh_token:s},[4,this.request("auth.fetchAccessTokenWithRefreshToken",a)];case 4:return(c=p.sent()).data.code?"SIGN_PARAM_INVALID"!==(u=c.data.code)&&"REFRESH_TOKEN_EXPIRED"!==u&&"INVALID_REFRESH_TOKEN"!==u?[3,11]:[4,this._cache.getStoreAsync(o)]:[3,12];case 5:return p.sent()===d.b.ANONYMOUS&&"INVALID_REFRESH_TOKEN"===u?[4,this._cache.getStoreAsync(i)]:[3,9];case 6:return f=p.sent(),[4,this._cache.getStoreAsync(n)];case 7:return l=p.sent(),[4,this.send("auth.signInAnonymously",{anonymous_uuid:f,refresh_token:l})];case 8:return h=p.sent(),this._setRefreshToken(h.refresh_token),[2,this._refreshAccessToken()];case 9:return et.fire(k),[4,this._cache.removeStoreAsync(n)];case 10:p.sent(),p.label=11;case 11:throw new Error("["+Object(d.d)()+"]["+N.NETWORK_ERROR+"] refresh access_token failed:"+c.data.code);case 12:return c.data.access_token?(et.fire(P),[4,this._cache.setStoreAsync(e,c.data.access_token)]):[3,15];case 13:return p.sent(),[4,this._cache.setStoreAsync(r,c.data.access_token_expire+Date.now())];case 14:return p.sent(),[2,{accessToken:c.data.access_token,accessTokenExpire:c.data.access_token_expire}];case 15:return c.data.refresh_token?[4,this._cache.removeStoreAsync(n)]:[3,19];case 16:return p.sent(),[4,this._cache.setStoreAsync(n,c.data.refresh_token)];case 17:return p.sent(),[4,this._refreshAccessToken()];case 18:p.sent(),p.label=19;case 19:return[2]}}))}))},t.prototype._setRefreshToken=function(t){return R(this,void 0,void 0,(function(){var e,r,n,o;return j(this,(function(i){switch(i.label){case 0:return e=this._cache.keys,r=e.accessTokenKey,n=e.accessTokenExpireKey,o=e.refreshTokenKey,[4,this._cache.removeStoreAsync(r)];case 1:return i.sent(),[4,this._cache.removeStoreAsync(n)];case 2:return i.sent(),[4,this._cache.setStoreAsync(o,t)];case 3:return i.sent(),[2]}}))}))},t}(),F={};var H=function(){return(H=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},V=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{c(n.next(t))}catch(t){i(t)}}function a(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},G=function(t,e){var r,n,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(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},z=o.adapters.useAdapters,J=o.adapters.useDefaultAdapter,X=o.adapters.RUNTIME,Y=o.constants.ERRORS,Q=o.utils.printWarn,$=o.utils.throwError,Z={timeout:15e3,persistence:"session"},tt={},et=new(function(){function t(t){this._config=t||this._config,this.authInstance=null}return Object.defineProperty(t.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"platform",{get:function(){return m},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cache",{get:function(){return x(this._config.env)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localCache",{get:function(){return E(this._config.env)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"request",{get:function(){return t=this._config.env,F[t];var t},enumerable:!1,configurable:!0}),t.prototype.init=function(e){if(e.env||$(Y.INVALID_PARAMS,"env must not be specified"),m.adapter||this._useDefaultAdapter(),this.requestClient=new m.adapter.reqClass({timeout:e.timeout||5e3,timeoutMsg:"["+Object(d.d)()+"][REQUEST TIMEOUT] request had been abort since didn't finished within"+e.timeout/1e3+"s"}),m.runtime!==X.WEB){e.appSecret||$(Y.INVALID_PARAMS,"invalid appSecret");var r=m.adapter.getAppSign?m.adapter.getAppSign():"";e.appSign&&r&&e.appSign!==r&&$(Y.INVALID_PARAMS,"invalid appSign"),r&&(e.appSign=r),e.appSign||$(Y.INVALID_PARAMS,"invalid appSign")}this._config=H(H({},Z),e),this._config.timeout=this._formatTimeout(this._config.timeout);var n=this._config,o=n.env,i=n.persistence,s=n.debug,a=n.timeout,c=n.appSecret,u=n.appSign;return A({env:o,persistence:i,debug:s,platformInfo:this.platform}),function(t){F[t.env]=new W(I(I({},t),{throw:!0}))}({env:o,timeout:a,appSecret:c,appSign:u}),new t(this._config)},t.prototype.updateConfig=function(t){var e=t.persistence,r=t.debug;this._config.persistence=e,this._config.debug=r,A({env:this._config.env,persistence:e,debug:r,platformInfo:this.platform})},t.prototype.registerExtension=function(t){tt[t.name]=t},t.prototype.invokeExtension=function(t,e){return V(this,void 0,void 0,(function(){var r;return G(this,(function(n){switch(n.label){case 0:return(r=tt[t])||$(Y.INVALID_PARAMS,"extension:"+t+" must be registered before invoke"),[4,r.invoke(e,this)];case 1:return[2,n.sent()]}}))}))},t.prototype.useAdapters=function(t){var e=z(t)||{},r=e.adapter,n=e.runtime;r&&(m.adapter=r),n&&(m.runtime=n)},t.prototype.registerComponent=function(e){_(t,e)},t.prototype.registerVersion=function(t){Object(d.h)(t)},t.prototype.registerSdkName=function(t){Object(d.g)(t)},t.prototype.registerEndPoint=function(t,e){Object(d.f)(t,e)},t.prototype._useDefaultAdapter=function(){var t=J(),e=t.adapter,r=t.runtime;m.adapter=e,m.runtime=r},t.prototype._formatTimeout=function(t){switch(!0){case t>6e5:return Q(Y.INVALID_PARAMS,"timeout is greater than maximum value[10min]"),6e5;case t<100:return Q(Y.INVALID_PARAMS,"timeout is less than maximum value[100ms]"),100;default:return t}},t}());et.useAdapters(p);e.default=et}])}));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("cloudbase",[],e):"object"==typeof exports?exports.cloudbase=e():t.cloudbase=e()}("undefined"!=typeof window?window:this,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=8)}([function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.utils=e.events=e.cache=e.adapters=e.constants=void 0;var s=i(r(5));e.constants=s;var a=i(r(12));e.adapters=a;var c=i(r(19));e.cache=c;var u=i(r(20));e.events=u;var f=i(r(2));e.utils=f},function(t,e,r){"use strict";(function(t){r.d(e,"h",(function(){return c})),r.d(e,"e",(function(){return u})),r.d(e,"g",(function(){return f})),r.d(e,"d",(function(){return l})),r.d(e,"a",(function(){return p})),r.d(e,"f",(function(){return v})),r.d(e,"c",(function(){return g})),r.d(e,"b",(function(){return h}));var n=r(0),o=n.constants.setSdkName,i=n.constants.setProtocol,s="",a="@cloudbase/js-sdk";function c(t){s=t}function u(){return s}function f(t){a=t,o(t)}function l(){return a}var h,p="2020-01-10",d="undefined"!=typeof location&&"http:"===location.protocol?"http:":"https:",y="//tcb-api.tencentcloudapi.com/web";function v(t,e){y=t,e&&(d=e,i(e))}function g(){return{BASE_URL:y,PROTOCOL:d}}!function(t){t.ANONYMOUS="ANONYMOUS",t.WECHAT="WECHAT",t.CUSTOM="CUSTOM",t.NULL="NULL"}(h||(h={}))}).call(this,r(7))},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.throwError=e.printInfo=e.printError=e.printWarn=e.execCallback=e.createPromiseCallback=e.removeParam=e.getHash=e.getQuery=e.toQueryString=e.createSign=e.formatUrl=e.genSeqId=e.isFormData=e.isInstanceOf=e.isNull=e.isPalinObject=e.isUndefined=e.isString=e.isArray=void 0;var o=n(r(14)),i=n(r(17)),s=n(r(18)),a=r(5);function c(t){var e=i.default.stringify(t);return e=(e=(e=e.replace(/=+$/,"")).replace(/\+/g,"-")).replace(/\//g,"_")}e.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},e.isString=function(t){return"string"==typeof t},e.isUndefined=function(t){return void 0===t},e.isPalinObject=function(t){return"[object Object]"===Object.prototype.toString.call(t)},e.isNull=function(t){return"[object Null]"===Object.prototype.toString.call(t)},e.isInstanceOf=function(t,e){return t instanceof e},e.isFormData=function(t){return"[object FormData]"===Object.prototype.toString.call(t)},e.genSeqId=function(){return Math.random().toString(16).slice(2)},e.formatUrl=function(t,e,r){void 0===r&&(r={});var n=/\?/.test(e),o="";for(var i in r)""===o?!n&&(e+="?"):o+="&",o+=i+"="+encodeURIComponent(r[i]);return/^http(s)?\:\/\//.test(e+=o)?e:""+t+e},e.createSign=function(t,e){var r=c(s.default.parse(JSON.stringify({alg:"HS256",typ:"JWT"})))+"."+c(s.default.parse(JSON.stringify(t)));return r+"."+c(o.default(r,e))},e.toQueryString=function(t){void 0===t&&(t={});var e=[];for(var r in t)e.push(r+"="+encodeURIComponent(t[r]));return e.join("&")},e.getQuery=function(t,e){if("undefined"==typeof window)return!1;var r=e||window.location.search,n=new RegExp("(^|&)"+t+"=([^&]*)(&|$)"),o=r.substr(r.indexOf("?")+1).match(n);return null!=o?o[2]:""},e.getHash=function(t){if("undefined"==typeof window)return"";var e=window.location.hash.match(new RegExp("[#?&/]"+t+"=([^&#]*)"));return e?e[1]:""},e.removeParam=function(t,e){var r=e.split("?")[0],n=[],o=-1!==e.indexOf("?")?e.split("?")[1]:"";if(""!==o){for(var i=(n=o.split("&")).length-1;i>=0;i-=1)n[i].split("=")[0]===t&&n.splice(i,1);r=r+"?"+n.join("&")}return r},e.createPromiseCallback=function(){var t;if(!Promise){(t=function(){}).promise={};var e=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(t.promise,"then",{get:e}),Object.defineProperty(t.promise,"catch",{get:e}),t}var r=new Promise((function(e,r){t=function(t,n){return t?r(t):e(n)}}));return t.promise=r,t},e.execCallback=function(t,e,r){if(void 0===r&&(r=null),t&&"function"==typeof t)return t(e,r);if(e)throw e;return r},e.printWarn=function(t,e){console.warn("["+a.getSdkName()+"]["+t+"]:"+e)},e.printError=function(t,e){console.error({code:t,msg:"["+a.getSdkName()+"]["+t+"]:"+e})},e.printInfo=function(t,e){console.log("["+a.getSdkName()+"]["+t+"]:"+e)},e.throwError=function(t,e){throw new Error(JSON.stringify({code:t,msg:"["+a.getSdkName()+"]["+t+"]:"+e}))}},function(t,e,r){"use strict";var n;r.r(e),r.d(e,"StorageType",(function(){return n})),r.d(e,"AbstractSDKRequest",(function(){return o})),r.d(e,"AbstractStorage",(function(){return i})),r.d(e,"formatUrl",(function(){return s})),function(t){t.local="local",t.none="none",t.session="session"}(n||(n={}));var o=function(){},i=function(){};function s(t,e,r){void 0===r&&(r={});var n=/\?/.test(e),o="";for(var i in r)""===o?!n&&(e+="?"):o+="&",o+=i+"="+encodeURIComponent(r[i]);return/^http(s)?\:\/\//.test(e+=o)?e:""+t+e}},function(t,e,r){var n;t.exports=(n=n||function(t,e){var r=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),n={},o=n.lib={},i=o.Base={extend:function(t){var e=r(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},s=o.WordArray=i.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||c).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,o=t.sigBytes;if(this.clamp(),n%4)for(var i=0;i<o;i++){var s=r[i>>>2]>>>24-i%4*8&255;e[n+i>>>2]|=s<<24-(n+i)%4*8}else for(i=0;i<o;i+=4)e[n+i>>>2]=r[i>>>2];return this.sigBytes+=o,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=i.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var r,n=[],o=function(e){e=e;var r=987654321,n=4294967295;return function(){var o=((r=36969*(65535&r)+(r>>16)&n)<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n;return o/=4294967296,(o+=.5)*(t.random()>.5?1:-1)}},i=0;i<e;i+=4){var a=o(4294967296*(r||t.random()));r=987654071*a(),n.push(4294967296*a()|0)}return new s.init(n,e)}}),a=n.enc={},c=a.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o++){var i=e[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n+=2)r[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new s.init(r,e/2)}},u=a.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o++){var i=e[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new s.init(r,e)}},f=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},l=o.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=f.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r=this._data,n=r.words,o=r.sigBytes,i=this.blockSize,a=o/(4*i),c=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*i,u=t.min(4*c,o);if(c){for(var f=0;f<c;f+=i)this._doProcessBlock(n,f);var l=n.splice(0,c);r.sigBytes-=u}return new s.init(l,u)},clone:function(){var t=i.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),h=(o.Hasher=l.extend({cfg:i.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new h.HMAC.init(t,r).finalize(e)}}}),n.algo={});return n}(Math),n)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),o(r(6),e),o(r(11),e)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getProtocol=e.setProtocol=e.getSdkName=e.setSdkName=void 0;var n="@cloudbase/js-sdk";e.setSdkName=function(t){n=t},e.getSdkName=function(){return n};var o="undefined"!=typeof location&&"http:"===location.protocol?"http:":"https:";e.setProtocol=function(t){o=t},e.getProtocol=function(){return o}},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var c,u=[],f=!1,l=-1;function h(){f&&c&&(f=!1,c.length?u=c.concat(u):l=-1,u.length&&p())}function p(){if(!f){var t=a(h);f=!0;for(var e=u.length;e;){for(c=u,u=[];++l<e;)c&&c[l].run();l=-1,e=u.length}c=null,f=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new d(t,e)),1!==u.length||f||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,r){r(9),t.exports=r(10)},function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function a(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),s=new S(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return A()}for(r.method=o,r.arg=i;;){var s=r.delegate;if(s){var a=m(s,r);if(a){if(a===u)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var f=c(t,e,r);if("normal"===f.type){if(n=r.done?"completed":"suspendedYield",f.arg===u)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n="completed",r.method="throw",r.arg=f.arg)}}}(t,r,s),i}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=a;var u={};function f(){}function l(){}function h(){}var p={};p[o]=function(){return this};var d=Object.getPrototypeOf,y=d&&d(d(O([])));y&&y!==e&&r.call(y,o)&&(p=y);var v=h.prototype=f.prototype=Object.create(p);function g(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function _(t,e){var n;this._invoke=function(o,i){function s(){return new e((function(n,s){!function n(o,i,s,a){var u=c(t[o],t,i);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(l).then((function(t){f.value=t,s(f)}),(function(t){return n("throw",t,s,a)}))}a(u.arg)}(o,i,n,s)}))}return n=n?n.then(s,s):s()}}function m(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method))return u;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var n=c(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,u;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:A}}function A(){return{value:void 0,done:!0}}return l.prototype=v.constructor=h,h.constructor=l,h[s]=l.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(v),t},t.awrap=function(t){return{__await:t}},g(_.prototype),_.prototype[i]=function(){return this},t.AsyncIterator=_,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var s=new _(a(e,r,n,o),i);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},g(v),v[s]="Generator",v[o]=function(){return this},v.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return s.type="throw",s.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(a&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;w(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return o(e,t),e},s=(this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}})(r(22)),a=i(r(21)).version;s.default.registerVersion(a);try{window.cloudbase=s.default}catch(t){}e.default=s.default,t.exports=s.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ERRORS=void 0,e.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(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.useDefaultAdapter=e.useAdapters=e.RUNTIME=void 0;var s,a=i(r(13)),c=r(2);!function(t){t.WEB="web",t.WX_MP="wx_mp"}(s=e.RUNTIME||(e.RUNTIME={})),e.useAdapters=function(t){for(var e=0,r=c.isArray(t)?t:[t];e<r.length;e++){var n=r[e],o=n.isMatch,i=n.genAdapter,s=n.runtime;if(o())return{adapter:i(),runtime:s}}},e.useDefaultAdapter=function(){return{adapter:a.genAdapter(),runtime:s.WEB}}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},s=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{c(n.next(t))}catch(t){i(t)}}function a(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var r,n,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(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.WebRequest=e.genAdapter=void 0;var c=r(3),u=r(2),f=r(6),l=function(t){function e(e){var r=t.call(this)||this,n=e.timeout,o=e.timeoutMsg,i=e.restrictedMethods;return r._timeout=n||0,r._timeoutMsg=o||"请求超时",r._restrictedMethods=i||["get","post","upload","download"],r}return o(e,t),e.prototype.get=function(t){return this._request(i(i({},t),{method:"get"}),this._restrictedMethods.includes("get"))},e.prototype.post=function(t){return this._request(i(i({},t),{method:"post"}),this._restrictedMethods.includes("post"))},e.prototype.put=function(t){return this._request(i(i({},t),{method:"put"}))},e.prototype.upload=function(t){var e=t.data,r=t.file,n=t.name,o=new FormData;for(var s in e)o.append(s,e[s]);return o.append("key",n),o.append("file",r),this._request(i(i({},t),{data:o,method:"post"}),this._restrictedMethods.includes("upload"))},e.prototype.download=function(t){return s(this,void 0,void 0,(function(){var e,r,n,o;return a(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.get(i(i({},t),{headers:{},responseType:"blob"}))];case 1:return e=s.sent().data,r=window.URL.createObjectURL(new Blob([e])),n=decodeURIComponent(new URL(t.url).pathname.split("/").pop()||""),(o=document.createElement("a")).href=r,o.setAttribute("download",n),o.style.display="none",document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(r),document.body.removeChild(o),[3,3];case 2:return s.sent(),[3,3];case 3:return[2,new Promise((function(e){e({statusCode:200,tempFilePath:t.url})}))]}}))}))},e.prototype._request=function(t,e){var r=this;void 0===e&&(e=!1);var n=String(t.method).toLowerCase()||"get";return new Promise((function(o){var i,s,a=t.url,c=t.headers,l=void 0===c?{}:c,h=t.data,p=t.responseType,d=t.withCredentials,y=t.body,v=t.onUploadProgress,g=u.formatUrl(f.getProtocol(),a,"get"===n?h:{}),_=new XMLHttpRequest;for(var m in _.open(n,g),p&&(_.responseType=p),l)_.setRequestHeader(m,l[m]);v&&_.addEventListener("progress",v),_.onreadystatechange=function(){var t={};if(4===_.readyState){var e=_.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};e.forEach((function(t){var e=t.split(": "),n=e.shift().toLowerCase(),o=e.join(": ");r[n]=o})),t.header=r,t.statusCode=_.status;try{t.data="blob"===p?_.response:JSON.parse(_.responseText)}catch(e){t.data="blob"===p?_.response:_.responseText}clearTimeout(i),o(t)}},e&&r._timeout&&(i=setTimeout((function(){console.warn(r._timeoutMsg),_.abort()}),r._timeout)),s=u.isFormData(h)?h:"application/x-www-form-urlencoded"===l["content-type"]?u.toQueryString(h):y||(h?JSON.stringify(h):void 0),d&&(_.withCredentials=!0),_.send(s)}))},e}(c.AbstractSDKRequest);e.WebRequest=l,e.genAdapter=function(){return{root:window,reqClass:l,wsClass:WebSocket,localStorage:localStorage,sessionStorage:sessionStorage}}},function(t,e,r){var n;t.exports=(n=r(4),r(15),r(16),n.HmacSHA256)},function(t,e,r){var n;t.exports=(n=r(4),function(t){var e=n,r=e.lib,o=r.WordArray,i=r.Hasher,s=e.algo,a=[],c=[];!function(){function e(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0}function r(t){return 4294967296*(t-(0|t))|0}for(var n=2,o=0;o<64;)e(n)&&(o<8&&(a[o]=r(t.pow(n,.5))),c[o]=r(t.pow(n,1/3)),o++),n++}();var u=[],f=s.SHA256=i.extend({_doReset:function(){this._hash=new o.init(a.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],s=r[3],a=r[4],f=r[5],l=r[6],h=r[7],p=0;p<64;p++){if(p<16)u[p]=0|t[e+p];else{var d=u[p-15],y=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,v=u[p-2],g=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[p]=y+u[p-7]+g+u[p-16]}var _=n&o^n&i^o&i,m=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>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=n,n=b+(m+_)|0}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+f|0,r[6]=r[6]+l|0,r[7]=r[7]+h|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;return r[o>>>5]|=128<<24-o%32,r[14+(o+64>>>9<<4)]=t.floor(n/4294967296),r[15+(o+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=i._createHelper(f),e.HmacSHA256=i._createHmacHelper(f)}(Math),n.SHA256)},function(t,e,r){var n,o,i,s;t.exports=(n=r(4),i=(o=n).lib.Base,s=o.enc.Utf8,void(o.algo.HMAC=i.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=s.parse(e));var r=t.blockSize,n=4*r;e.sigBytes>n&&(e=t.finalize(e)),e.clamp();for(var o=this._oKey=e.clone(),i=this._iKey=e.clone(),a=o.words,c=i.words,u=0;u<r;u++)a[u]^=1549556828,c[u]^=909522486;o.sigBytes=i.sigBytes=n,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher,r=e.finalize(t);return e.reset(),e.finalize(this._oKey.clone().concat(r))}})))},function(t,e,r){var n,o,i;t.exports=(i=r(4),o=(n=i).lib.WordArray,n.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var o=[],i=0;i<r;i+=3)for(var s=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a<r;a++)o.push(n.charAt(s>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(t){var e=t.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var i=0;i<r.length;i++)n[r.charCodeAt(i)]=i}var s=r.charAt(64);if(s){var a=t.indexOf(s);-1!==a&&(e=a)}return function(t,e,r){for(var n=[],i=0,s=0;s<e;s++)if(s%4){var a=r[t.charCodeAt(s-1)]<<s%4*2,c=r[t.charCodeAt(s)]>>>6-s%4*2;n[i>>>2]|=(a|c)<<24-i%4*8,i++}return o.create(n,i)}(t,e,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},i.enc.Base64)},function(t,e,r){var n;t.exports=(n=r(4),n.enc.Utf8)},function(t,e,r){"use strict";(function(t){var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{c(n.next(t))}catch(t){i(t)}}function a(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var r,n,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(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.CloudbaseCache=void 0;var a=r(3),c=r(2),u=r(5),f=function(t){function e(e){var r=t.call(this)||this;return r._root=e,e.tcbCacheObject||(e.tcbCacheObject={}),r}return o(e,t),e.prototype.setItem=function(t,e){this._root.tcbCacheObject[t]=e},e.prototype.getItem=function(t){return this._root.tcbCacheObject[t]},e.prototype.removeItem=function(t){delete this._root.tcbCacheObject[t]},e.prototype.clear=function(){delete this._root.tcbCacheObject},e}(a.AbstractStorage);function l(t,e){switch(t){case"local":return e.localStorage?e.localStorage:(c.printWarn(u.ERRORS.INVALID_PARAMS,"localStorage is not supported on current platform"),new f(e.root));case"none":return new f(e.root);default:return e.sessionStorage?e.sessionStorage:(c.printWarn(u.ERRORS.INVALID_PARAMS,"sessionStorage is not supported on current platform"),new f(e.root))}}var h=function(){function e(t){this.keys={};var e=t.persistence,r=t.platformInfo,n=void 0===r?{}:r,o=t.keys,i=void 0===o?{}:o,s=t.alwaysLocalKeys,a=void 0===s?[]:s;this._platformInfo=n,this._alwaysLocalKeys=a,this._storage||(this._persistence=n.adapter.primaryStorage||e,this._storage=l(this._persistence,n.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(t){if("async"!==this.mode){if(t!==this._persistence){var e="local"===this._persistence;this._persistence=t;var r=l(t,this._platformInfo.adapter);for(var n in this.keys){var o=this.keys[n];if(!e||!this._alwaysLocalKeys.includes(n)){var i=this._storage.getItem(o);c.isUndefined(i)||c.isNull(i)||(r.setItem(o,i),this._storage.removeItem(o))}}this._storage=r}}else c.printWarn(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use updatePersistenceAsync insteed")},e.prototype.updatePersistenceAsync=function(t){return i(this,void 0,void 0,(function(){var e,r,n,o,i,a,u,f;return s(this,(function(s){switch(s.label){case 0:if(t===this._persistence)return[2];for(o in e="local"===this._persistence,this._persistence=t,r=l(t,this._platformInfo.adapter),n=[],this.keys)n.push(o);i=0,s.label=1;case 1:return i<n.length?(a=n[i],u=this.keys[a],e&&this._alwaysLocalKeys.includes(a)?[3,4]:[4,this._storage.getItem(u)]):[3,5];case 2:return f=s.sent(),c.isUndefined(f)||c.isNull(f)?[3,4]:(r.setItem(u,f),[4,this._storage.removeItem(u)]);case 3:s.sent(),s.label=4;case 4:return i++,[3,1];case 5:return this._storage=r,[2]}}))}))},e.prototype.setStore=function(t,e,r){if("async"!==this.mode){if(this._storage)try{var n={version:r||"localCachev1",content:e};this._storage.setItem(t,JSON.stringify(n))}catch(t){return}}else c.printWarn(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},e.prototype.setStoreAsync=function(t,e,r){return i(this,void 0,void 0,(function(){var n;return s(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]),n={version:r||"localCachev1",content:e},[4,this._storage.setItem(t,JSON.stringify(n))];case 2:return o.sent(),[3,4];case 3:return o.sent(),[2];case 4:return[2]}}))}))},e.prototype.getStore=function(e,r){var n;if("async"!==this.mode){try{if(void 0!==t&&(null===(n=t.env)||void 0===n?void 0:n.tcb_token))return t.env.tcb_token;if(!this._storage)return""}catch(t){return""}r=r||"localCachev1";var o=this._storage.getItem(e);return o&&o.indexOf(r)>=0?JSON.parse(o).content:""}c.printWarn(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},e.prototype.getStoreAsync=function(e,r){var n;return i(this,void 0,void 0,(function(){var o;return s(this,(function(i){switch(i.label){case 0:try{if(void 0!==t&&(null===(n=t.env)||void 0===n?void 0:n.tcb_token))return[2,t.env.tcb_token];if(!this._storage)return[2,""]}catch(t){return[2,""]}return r=r||"localCachev1",[4,this._storage.getItem(e)];case 1:return(o=i.sent())&&o.indexOf(r)>=0?[2,JSON.parse(o).content]:[2,""]}}))}))},e.prototype.removeStore=function(t){"async"!==this.mode?this._storage.removeItem(t):c.printWarn(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},e.prototype.removeStoreAsync=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this._storage.removeItem(t)];case 1:return e.sent(),[2]}}))}))},e}();e.CloudbaseCache=h}).call(this,r(7))},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)n[o]=i[s];return n};Object.defineProperty(e,"__esModule",{value:!0}),e.removeEventListener=e.activateEvent=e.addEventListener=e.CloudbaseEventEmitter=e.IErrorEvent=e.CloudbaseEvent=void 0;var s=r(2);var a=function(t,e){this.data=e||null,this.name=t};e.CloudbaseEvent=a;var c=function(t){function e(e,r){var n=t.call(this,"error",{error:e,data:r})||this;return n.error=e,n}return o(e,t),e}(a);e.IErrorEvent=c;var u=function(){function t(){this._listeners={}}return t.prototype.on=function(t,e){return function(t,e,r){r[t]=r[t]||[],r[t].push(e)}(t,e,this._listeners),this},t.prototype.off=function(t,e){return function(t,e,r){if(null==r?void 0:r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}(t,e,this._listeners),this},t.prototype.fire=function(t,e){if(s.isInstanceOf(t,c))return console.error(t.error),this;var r=s.isString(t)?new a(t,e||{}):t,n=r.name;if(this._listens(n)){r.target=this;for(var o=0,u=this._listeners[n]?i(this._listeners[n]):[];o<u.length;o++){u[o].call(this,r)}}return this},t.prototype._listens=function(t){return this._listeners[t]&&this._listeners[t].length>0},t}();e.CloudbaseEventEmitter=u;var f=new u;e.addEventListener=function(t,e){f.on(t,e)},e.activateEvent=function(t,e){void 0===e&&(e={}),f.fire(t,e)},e.removeEventListener=function(t,e){f.off(t,e)}},function(t){t.exports=JSON.parse('{"version":"1.1.3"}')},function(t,e,r){"use strict";r.r(e),r.d(e,"cloudbase",(function(){return et}));var n,o=r(0),i=r(3),s=(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),a=function(){return(a=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},c=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{c(n.next(t))}catch(t){i(t)}}function a(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},u=function(t,e){var r,n,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(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};var f=function(t){function e(e){void 0===e&&(e={});var r=t.call(this)||this,n=e.timeout,o=e.timeoutMsg,i=e.restrictedMethods;return r._timeout=n||0,r._timeoutMsg=o||"请求超时",r._restrictedMethods=i||["get","post","upload","download"],r}return s(e,t),e.prototype.post=function(t){var e=this;return new Promise((function(r,n){var o=null,s=t.url,a=t.data,c=t.headers,u=wx.request({url:Object(i.formatUrl)("https:",s),data:a,method:"POST",header:c,success:function(t){e._clearTimeout(o),r(t)},fail:function(t){e._clearTimeout(o),n(t)}});o=e._setTimeout("post",u)}))},e.prototype.upload=function(t){var e=this,r=this;return new Promise((function(n){return c(e,void 0,void 0,(function(){var e,o,i,s,c,f,l;return u(this,(function(u){return e=null,o=t.url,i=t.file,s=t.data,c=t.headers,f=t.onUploadProgress,l=wx.uploadFile({url:o,filePath:i,name:"file",formData:a({},s),header:c,timeout:this._timeout,success:function(t){r._clearTimeout(e);var o={statusCode:t.statusCode,data:t.data||{}};200===t.statusCode&&s.success_action_status&&(o.statusCode=parseInt(s.success_action_status,10)),n(o)},fail:function(t){r._clearTimeout(e),n(t)}}),f&&l.onProgressUpdate((function(t){f(t)})),e=r._setTimeout("upload",l),[2]}))}))}))},e.prototype.download=function(t){var e=this,r=this;return new Promise((function(n,o){var s=null,a=t.url,c=t.headers,u=wx.downloadFile({url:Object(i.formatUrl)("https:",a),header:c,success:function(t){r._clearTimeout(s),200===t.statusCode&&t.tempFilePath?n({statusCode:200,tempFilePath:t.tempFilePath}):n(t)},fail:function(t){r._clearTimeout(s),o(t)}});s=e._setTimeout("download",u)}))},e.prototype._clearTimeout=function(t){t&&(clearTimeout(t),t=null)},e.prototype._setTimeout=function(t,e){var r=this;return this._timeout&&-1!==this._restrictedMethods.indexOf(t)?setTimeout((function(){console.warn(r._timeoutMsg),e.abort()}),this._timeout):null},e}(i.AbstractSDKRequest),l={setItem:function(t,e){wx.setStorageSync(t,e)},getItem:function(t){return wx.getStorageSync(t)},removeItem:function(t){wx.removeStorageSync(t)},clear:function(){wx.clearStorageSync()}},h=function(t,e){void 0===e&&(e={});var r=wx.connectSocket(a({url:t},e));return{set onopen(t){r.onOpen(t)},set onmessage(t){r.onMessage(t)},set onclose(t){r.onClose(t)},set onerror(t){r.onError(t)},send:function(t){return r.send({data:t})},close:function(t,e){return r.close({code:t,reason:e})},get readyState(){return r.readyState},CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3}};var p={genAdapter:function(){return{root:{},reqClass:f,wsClass:h,localStorage:l,primaryStorage:i.StorageType.local,getAppSign:function(){var t=wx.getAccountInfoSync();return t&&t.miniProgram?t.miniProgram.appId:""}}},isMatch:function(){if("undefined"==typeof wx)return!1;if("undefined"==typeof App)return!1;if("undefined"==typeof Page)return!1;if("function"!=typeof getApp)return!1;if(!wx.onAppHide)return!1;if(!wx.offAppHide)return!1;if(!wx.onAppShow)return!1;if(!wx.offAppShow)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(t){return!1}return!0},runtime:"wx_mp"},d=r(1),y=function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)n[o]=i[s];return n},v=o.constants.ERRORS,g={};function _(t,e){var r=e.name,n=e.namespace,o=e.entity,i=e.injectEvents;if(g[r]||n&&t[n])throw new Error("["+Object(d.d)()+"]["+v.INVALID_OPERATION+"]There were multiple attempts to register component "+r+".");if(g[r]=e,n?t.prototype[n]=o:function t(e,r){if(!(r instanceof Object))return r;switch(r.constructor){case Date:return new Date(r.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return r}for(var n in r)r.hasOwnProperty(n)&&(e[n]=t(e[n],r[n]));return e}(t.prototype,o),i){var s=i.bus,a=i.events;if(!s||!a||0===a.length)return;var c=t.prototype.fire||function(){};t.prototype.events||(t.prototype.events={}),(t.prototype.events||{})[r]?t.prototype.events[r].events=y(t.prototype.events[r].events,a):t.prototype.events[r]={bus:s,events:a},t.prototype.fire=function(t,e){for(var r in c(t,e),this.events){var n=this.events[r],o=n.bus;if(n.events.includes(t)){o.fire(t,e);break}}}}}var m={},b=function(){return(b=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},w=o.cache.CloudbaseCache,S={},O={};function A(t){var e=t.env,r=t.persistence,n=t.platformInfo,o={accessTokenKey:"access_token_"+e,accessTokenExpireKey:"access_token_expire_"+e,refreshTokenKey:"refresh_token_"+e,anonymousUuidKey:"anonymous_uuid_"+e,loginTypeKey:"login_type_"+e,userInfoKey:"user_info_"+e};S[e]?S[e].updatePersistence(r):S[e]=new w(b(b({},t),{keys:o,platformInfo:n,alwaysLocalKeys:["anonymousUuidKey"]})),O[e]=O[e]||new w(b(b({},t),{keys:o,platformInfo:n,persistence:"local"}))}function x(t){return S[t]}function E(t){return O[t]}var P="loginStateExpire",k="refreshAccessToken",T=r(2),I=function(){return(I=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},R=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{c(n.next(t))}catch(t){i(t)}}function a(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},j=function(t,e){var r,n,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(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},N=o.constants.ERRORS,L=o.utils.genSeqId,C=o.utils.isFormData,M=o.utils.formatUrl,U=o.utils.createSign,D=o.adapters.RUNTIME,q=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"];function K(t,e,r){var n=t[e];t[e]=function(e){var o={},i={};r.forEach((function(r){var n=r.call(t,e),s=n.data,a=n.headers;Object.assign(o,s),Object.assign(i,a)}));var s=e.data;return s&&function(){if(C(s))for(var t in o)s.append(t,o[t]);else e.data=I(I({},s),o)}(),e.headers=I(I({},e.headers||{}),i),n.call(t,e)}}function B(){var t=L();return{data:{seqId:t},headers:{"X-SDK-Version":"@cloudbase/js-sdk/"+Object(d.e)(),"x-seqid":t}}}var W=function(){function t(t){this._throwWhenRequestFail=!1,this.config=t,this._reqClass=new m.adapter.reqClass({timeout:this.config.timeout,timeoutMsg:"[tcb-js-sdk] 请求在"+this.config.timeout/1e3+"s内未完成,已中断",restrictedMethods:["post"]}),this._throwWhenRequestFail=t.throw||!1,this._cache=x(this.config.env),this._localCache=E(this.config.env),K(this._reqClass,"post",[B]),K(this._reqClass,"upload",[B]),K(this._reqClass,"download",[B])}return t.prototype.post=function(t){return R(this,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this._reqClass.post(t)];case 1:return[2,e.sent()]}}))}))},t.prototype.upload=function(t){return R(this,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this._reqClass.upload(t)];case 1:return[2,e.sent()]}}))}))},t.prototype.download=function(t){return R(this,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this._reqClass.download(t)];case 1:return[2,e.sent()]}}))}))},t.prototype.refreshAccessToken=function(){return R(this,void 0,void 0,(function(){var t,e,r;return j(this,(function(n){switch(n.label){case 0:this._refreshAccessTokenPromise||(this._refreshAccessTokenPromise=this._refreshAccessToken()),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this._refreshAccessTokenPromise];case 2:return t=n.sent(),[3,4];case 3:return r=n.sent(),e=r,[3,4];case 4:if(this._refreshAccessTokenPromise=null,this._shouldRefreshAccessTokenHook=null,e)throw e;return[2,t]}}))}))},t.prototype.getAccessToken=function(){return R(this,void 0,void 0,(function(){var t,e,r,n,o,i,s,a,c;return j(this,(function(u){switch(u.label){case 0:return t=this._cache.keys,e=t.accessTokenKey,r=t.accessTokenExpireKey,n=t.refreshTokenKey,[4,this._cache.getStoreAsync(n)];case 1:return u.sent()||Object(T.throwError)(N.INVALID_PARAMS,"refresh token is not exist"),[4,this._cache.getStoreAsync(e)];case 2:return o=u.sent(),s=Number,[4,this._cache.getStoreAsync(r)];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}]}}))}))},t.prototype.request=function(t,e,r){return R(this,void 0,void 0,(function(){var n,o,i,s,a,c,u,f,l,h,p,y,v,g,_,b,w,S,O,A,x,E,P,k,T,R;return j(this,(function(j){switch(j.label){case 0:return n="x-tcb-trace_"+this.config.env,o="application/x-www-form-urlencoded",i=I({action:t,dataVersion:d.a,env:this.config.env},e),-1!==q.indexOf(t)?[3,3]:(s=this._cache.keys.refreshTokenKey,[4,this._cache.getStoreAsync(s)]);case 1:return j.sent()?(a=i,[4,this.getAccessToken()]):[3,3];case 2:a.access_token=j.sent().accessToken,j.label=3;case 3:if("storage.uploadFile"===t){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==r?void 0:r.onUploadProgress)&&(f.onUploadProgress=r.onUploadProgress),(l=this._localCache.getStore(n))&&(f.headers["X-TCB-Trace"]=l),m.runtime!==D.WEB&&(h=this.config,p=h.appSign,y=h.appSecret,v=Date.now(),g=y.appAccessKey,_=y.appAccessKeyId,b=U({data:c,timestamp:v,appAccessKeyId:_,appSign:p},g),f.headers["X-TCB-App-Source"]="timestamp="+v+";appAccessKeyId="+_+";appSign="+p+";sign="+b),w=e.parse,S=e.inQuery,O=e.search,A={env:this.config.env},w&&(A.parse=!0),S&&(A=I(I({},S),A)),x=Object(d.c)(),E=x.BASE_URL,P=x.PROTOCOL,k=M(P,E,A),O&&(k+=O),[4,this.post(I({url:k,data:c},f))];case 4:if(T=j.sent(),(R=T.header&&T.header["x-tcb-trace"])&&this._localCache.setStore(n,R),200!==Number(T.status)&&200!==Number(T.statusCode)||!T.data)throw new Error("network request error");return[2,T]}}))}))},t.prototype.send=function(t,e){return void 0===e&&(e={}),R(this,void 0,void 0,(function(){var r,n;return j(this,(function(o){switch(o.label){case 0:return[4,this.request(t,e,{onUploadProgress:e.onUploadProgress})];case 1:return"ACCESS_TOKEN_EXPIRED"!==(r=o.sent()).data.code||-1!==q.indexOf(t)?[3,4]:[4,this.refreshAccessToken()];case 2:return o.sent(),[4,this.request(t,e,{onUploadProgress:e.onUploadProgress})];case 3:return(n=o.sent()).data.code&&this._throwWhenRequestFail&&Object(T.throwError)(N.OPERATION_FAIL,"["+n.data.code+"] "+n.data.message),[2,n.data];case 4:return r.data.code&&this._throwWhenRequestFail&&Object(T.throwError)(N.OPERATION_FAIL,"["+r.data.code+"] "+r.data.message),[2,r.data]}}))}))},t.prototype._refreshAccessToken=function(){return R(this,void 0,void 0,(function(){var t,e,r,n,o,i,s,a,c,u,f,l,h;return j(this,(function(p){switch(p.label){case 0:return t=this._cache.keys,e=t.accessTokenKey,r=t.accessTokenExpireKey,n=t.refreshTokenKey,o=t.loginTypeKey,i=t.anonymousUuidKey,[4,this._cache.removeStoreAsync(e)];case 1:return p.sent(),[4,this._cache.removeStoreAsync(r)];case 2:return p.sent(),[4,this._cache.getStoreAsync(n)];case 3:if(!(s=p.sent()))throw new Error("["+Object(d.d)()+"]["+N.INVALID_OPERATION+"] not login");return a={refresh_token:s},[4,this.request("auth.fetchAccessTokenWithRefreshToken",a)];case 4:return(c=p.sent()).data.code?"SIGN_PARAM_INVALID"!==(u=c.data.code)&&"REFRESH_TOKEN_EXPIRED"!==u&&"INVALID_REFRESH_TOKEN"!==u?[3,11]:[4,this._cache.getStoreAsync(o)]:[3,12];case 5:return p.sent()===d.b.ANONYMOUS&&"INVALID_REFRESH_TOKEN"===u?[4,this._cache.getStoreAsync(i)]:[3,9];case 6:return f=p.sent(),[4,this._cache.getStoreAsync(n)];case 7:return l=p.sent(),[4,this.send("auth.signInAnonymously",{anonymous_uuid:f,refresh_token:l})];case 8:return h=p.sent(),this._setRefreshToken(h.refresh_token),[2,this._refreshAccessToken()];case 9:return et.fire(P),[4,this._cache.removeStoreAsync(n)];case 10:p.sent(),p.label=11;case 11:throw new Error("["+Object(d.d)()+"]["+N.NETWORK_ERROR+"] refresh access_token failed:"+c.data.code);case 12:return c.data.access_token?(et.fire(k),[4,this._cache.setStoreAsync(e,c.data.access_token)]):[3,15];case 13:return p.sent(),[4,this._cache.setStoreAsync(r,c.data.access_token_expire+Date.now())];case 14:return p.sent(),[2,{accessToken:c.data.access_token,accessTokenExpire:c.data.access_token_expire}];case 15:return c.data.refresh_token?[4,this._cache.removeStoreAsync(n)]:[3,19];case 16:return p.sent(),[4,this._cache.setStoreAsync(n,c.data.refresh_token)];case 17:return p.sent(),[4,this._refreshAccessToken()];case 18:p.sent(),p.label=19;case 19:return[2]}}))}))},t.prototype._setRefreshToken=function(t){return R(this,void 0,void 0,(function(){var e,r,n,o;return j(this,(function(i){switch(i.label){case 0:return e=this._cache.keys,r=e.accessTokenKey,n=e.accessTokenExpireKey,o=e.refreshTokenKey,[4,this._cache.removeStoreAsync(r)];case 1:return i.sent(),[4,this._cache.removeStoreAsync(n)];case 2:return i.sent(),[4,this._cache.setStoreAsync(o,t)];case 3:return i.sent(),[2]}}))}))},t}(),F={};var H=function(){return(H=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},V=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{c(n.next(t))}catch(t){i(t)}}function a(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},G=function(t,e){var r,n,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(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},z=o.adapters.useAdapters,J=o.adapters.useDefaultAdapter,X=o.adapters.RUNTIME,Y=o.constants.ERRORS,Q=o.utils.printWarn,$=o.utils.throwError,Z={timeout:15e3,persistence:"session"},tt={},et=new(function(){function t(t){this._config=t||this._config,this.authInstance=null}return Object.defineProperty(t.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"platform",{get:function(){return m},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cache",{get:function(){return x(this._config.env)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localCache",{get:function(){return E(this._config.env)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"request",{get:function(){return t=this._config.env,F[t];var t},enumerable:!1,configurable:!0}),t.prototype.init=function(e){if(e.env||$(Y.INVALID_PARAMS,"env must not be specified"),m.adapter||this._useDefaultAdapter(),this.requestClient=new m.adapter.reqClass({timeout:e.timeout||5e3,timeoutMsg:"["+Object(d.d)()+"][REQUEST TIMEOUT] request had been abort since didn't finished within"+e.timeout/1e3+"s"}),m.runtime!==X.WEB){e.appSecret||$(Y.INVALID_PARAMS,"invalid appSecret");var r=m.adapter.getAppSign?m.adapter.getAppSign():"";e.appSign&&r&&e.appSign!==r&&$(Y.INVALID_PARAMS,"invalid appSign"),r&&(e.appSign=r),e.appSign||$(Y.INVALID_PARAMS,"invalid appSign")}this._config=H(H({},Z),e),this._config.timeout=this._formatTimeout(this._config.timeout);var n=this._config,o=n.env,i=n.persistence,s=n.debug,a=n.timeout,c=n.appSecret,u=n.appSign;return A({env:o,persistence:i,debug:s,platformInfo:this.platform}),function(t){F[t.env]=new W(I(I({},t),{throw:!0}))}({env:o,timeout:a,appSecret:c,appSign:u}),new t(this._config)},t.prototype.updateConfig=function(t){var e=t.persistence,r=t.debug;this._config.persistence=e,this._config.debug=r,A({env:this._config.env,persistence:e,debug:r,platformInfo:this.platform})},t.prototype.registerExtension=function(t){tt[t.name]=t},t.prototype.invokeExtension=function(t,e){return V(this,void 0,void 0,(function(){var r;return G(this,(function(n){switch(n.label){case 0:return(r=tt[t])||$(Y.INVALID_PARAMS,"extension:"+t+" must be registered before invoke"),[4,r.invoke(e,this)];case 1:return[2,n.sent()]}}))}))},t.prototype.useAdapters=function(t){var e=z(t)||{},r=e.adapter,n=e.runtime;r&&(m.adapter=r),n&&(m.runtime=n)},t.prototype.registerComponent=function(e){_(t,e)},t.prototype.registerVersion=function(t){Object(d.h)(t)},t.prototype.registerSdkName=function(t){Object(d.g)(t)},t.prototype.registerEndPoint=function(t,e){Object(d.f)(t,e)},t.prototype._useDefaultAdapter=function(){var t=J(),e=t.adapter,r=t.runtime;m.adapter=e,m.runtime=r},t.prototype._formatTimeout=function(t){switch(!0){case t>6e5:return Q(Y.INVALID_PARAMS,"timeout is greater than maximum value[10min]"),6e5;case t<100:return Q(Y.INVALID_PARAMS,"timeout is less than maximum value[100ms]"),100;default:return t}},t}());et.useAdapters(p);e.default=et}])}));
{
"name": "@cloudbase/js-sdk",
"version": "1.1.3",
"version": "1.1.4",
"description": "cloudbase javascript sdk",

@@ -44,4 +44,4 @@ "main": "dist/index.cjs.js",

"dependencies": {
"@cloudbase/app": "^1.1.1",
"@cloudbase/auth": "^1.1.3",
"@cloudbase/app": "^1.1.2",
"@cloudbase/auth": "^1.1.4",
"@cloudbase/database": "^0.9.18-beta",

@@ -84,3 +84,3 @@ "@cloudbase/functions": "^1.1.1",

],
"gitHead": "af77d2cd84d8573b4233708bff1853b28d189f53"
"gitHead": "4b9fc54aefed20dac25bebc9c387dbfb2d99db2f"
}

Sorry, the diff of this file is too big to display