@cloudbase/js-sdk 3.5.4 → 3.5.5-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/dist/index.esm.js +1 -1
- package/ai/dist/index.esm.js.map +1 -1
- package/ai/dist/index.js +1 -1
- package/ai/dist/index.js.map +1 -1
- package/app/dist/index.esm.js +1 -1
- package/app/dist/index.js +1 -1
- package/app/dist/index.node.esm.js +1 -1
- package/app/dist/index.node.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.node.cjs.js +1 -1
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.esm.js +1 -1
- package/dist/index.node.esm.js.map +1 -1
- package/miniprogram_dist/ai.js +1 -1
- package/miniprogram_dist/app.js +1 -1
- package/miniprogram_dist/index.js +1 -1
- package/package.json +1 -1
- package/types/package.json +1 -1
- package/utilities/package.json +2 -2
package/dist/index.node.cjs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see index.node.cjs.js.LICENSE.txt */
|
|
2
|
-
(()=>{var e,t,n={9954:(e,t,n)=>{e.exports={parallel:n(8197),serial:n(8967),serialOrdered:n(982)}},190:e=>{function t(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}e.exports=function(e){Object.keys(e.jobs).forEach(t.bind(e)),e.jobs={}}},1307:(e,t,n)=>{var r=n(8765);e.exports=function(e){var t=!1;return r((function(){t=!0})),function(n,o){t?e(n,o):r((function(){e(n,o)}))}}},8765:e=>{e.exports=function(e){var t="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;t?t(e):setTimeout(e,0)}},5798:(e,t,n)=>{var r=n(1307),o=n(190);e.exports=function(e,t,n,i){var a=n.keyedList?n.keyedList[n.index]:n.index;n.jobs[a]=function(e,t,n,o){return 2==e.length?e(n,r(o)):e(n,t,r(o))}(t,a,e[a],(function(e,t){a in n.jobs&&(delete n.jobs[a],e?o(n):n.results[a]=t,i(e,n.results))}))}},7379:e=>{e.exports=function(e,t){var n=!Array.isArray(e),r={index:0,keyedList:n||t?Object.keys(e):null,jobs:{},results:n?{}:[],size:n?Object.keys(e).length:e.length};return t&&r.keyedList.sort(n?t:function(n,r){return t(e[n],e[r])}),r}},3797:(e,t,n)=>{var r=n(190),o=n(1307);e.exports=function(e){Object.keys(this.jobs).length&&(this.index=this.size,r(this),o(e)(null,this.results))}},8197:(e,t,n)=>{var r=n(5798),o=n(7379),i=n(3797);e.exports=function(e,t,n){for(var a=o(e);a.index<(a.keyedList||e).length;)r(e,t,a,(function(e,t){e?n(e,t):0!==Object.keys(a.jobs).length||n(null,a.results)})),a.index++;return i.bind(a,n)}},8967:(e,t,n)=>{var r=n(982);e.exports=function(e,t,n){return r(e,t,null,n)}},982:(e,t,n)=>{var r=n(5798),o=n(7379),i=n(3797);function a(e,t){return e<t?-1:e>t?1:0}e.exports=function(e,t,n,a){var s=o(e,n);return r(e,t,s,(function n(o,i){o?a(o,i):(s.index++,s.index<(s.keyedList||e).length?r(e,t,s,n):a(null,s.results))})),i.bind(s,a)},e.exports.ascending=a,e.exports.descending=function(e,t){return-1*a(e,t)}},7756:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AI=void 0;var u=n(9737),l=a(n(5305)),p=n(1689),d=n(2877),h=l.MODELS,f=function(){function e(e,t,n,o){var i=this;this.req=e,this.baseUrl=t,this.modelRequest=function(e){var t=e.url,n=e.data,o=e.headers,a=e.stream,u=e.timeout;return s(i,void 0,void 0,(function(){var e,i,s,l,p,d,h;return c(this,(function(c){switch(c.label){case 0:return e={"Content-Type":"application/json"},a&&Object.assign(e,{Accept:"text/event-stream"}),[4,this.req.fetch({method:"post",headers:r(r((p={},p[null===(d=this.i18n)||void 0===d?void 0:d.LANG_HEADER_KEY]=null===(h=this.i18n)||void 0===h?void 0:h.lang,p),e),o),body:JSON.stringify(n),url:this.resolveUrl(t),stream:a,timeout:u})];case 1:return i=c.sent(),s=i.data,l=i.header,[2,this.handleResponseData(s,l)]}}))}))},this.botRequest=function(e){var t=e.method,n=e.url,o=e.data,a=void 0===o?{}:o,u=e.headers,l=e.stream,p=e.timeout;return s(i,void 0,void 0,(function(){var e,o,i,s,d,h,f,m,v;return c(this,(function(c){switch(c.label){case 0:return e=this.resolveUrl(n),"get"!==t?[3,2]:(o=this.handleResponseData,[4,this.req.fetch({url:"".concat(e,"?").concat((g=a,Object.entries(g).map((function(e){var t=e[0],n=e[1];return"".concat(t,"=").concat(n)})).join("&"))),method:t,headers:u,stream:l,timeout:p})]);case 1:return[2,o.apply(this,[c.sent().data])];case 2:return i={"Content-Type":"application/json"},l&&Object.assign(i,{Accept:"text/event-stream"}),[4,this.req.fetch({url:e,body:JSON.stringify(a),headers:r(r((f={},f[null===(m=this.i18n)||void 0===m?void 0:m.LANG_HEADER_KEY]=null===(v=this.i18n)||void 0===v?void 0:v.lang,f),i),u),stream:l,method:t,timeout:p})];case 3:return s=c.sent(),d=s.data,h=s.header,[2,this.handleResponseData(d,h)]}var g}))}))},this._getBaseUrl=o,this.bot=new u.Bot(this.botRequest,this.aiBotBaseUrl),this.i18n=n,d.langEvent.bus.on(d.langEvent.LANG_CHANGE_EVENT,(function(e){var t;i.i18n=(null===(t=e.data)||void 0===t?void 0:t.i18n)||i.i18n}))}return Object.defineProperty(e.prototype,"aiBaseUrl",{get:function(){return"".concat(this._getBaseUrl?this._getBaseUrl():this.baseUrl,"/ai")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"aiBotBaseUrl",{get:function(){return"".concat(this._getBaseUrl?this._getBaseUrl():this.baseUrl,"/aibot")},enumerable:!1,configurable:!0}),e.prototype.handleResponseData=function(e,t){var n,r;return s(this,void 0,void 0,(function(){var o,i;return c(this,(function(a){switch(a.label){case 0:return o="".concat(this.i18n.t("请检查调用方式,或前往云开发 AI+ 首页查看文档"),":https://tcb.cloud.tencent.com/dev#/ai"),"object"==typeof e&&e&&"then"in e?[4,e]:[3,2];case 1:if("object"==typeof(i=a.sent())&&i&&"code"in i&&"NORMAL"!==i.code)throw new Error("".concat(this.i18n.t("AI+ 请求出错,错误码"),":").concat(i.code,",").concat(this.i18n.t("错误信息"),":").concat(i.message,"\n").concat(o,"\n").concat(JSON.stringify(i,null,2)));return[2,e];case 2:return(null===(r=null===(n=null==t?void 0:t.get)||void 0===n?void 0:n.call(t,"content-type"))||void 0===r?void 0:r.includes("application/json"))?[4,(0,p.readableStream2JsonObject)(e)]:[3,4];case 3:if("object"==typeof(i=a.sent())&&i&&"code"in i&&"NORMAL"!==i.code)throw new Error("".concat(this.i18n.t("AI+ 请求出错,错误码"),":").concat(i.code,",").concat(this.i18n.t("错误信息"),":").concat(i.message,"\n").concat(o,"\n").concat(JSON.stringify(i,null,2)));a.label=4;case 4:return[2,e]}}))}))},e.prototype.createModel=function(e,t){var n,r=h[e];if(r)n=new r(this.modelRequest,this.aiBaseUrl);else{var o="string"==typeof(null==t?void 0:t.defaultModelSubUrl)?t.defaultModelSubUrl:"/chat/completions";n=new l.DefaultSimpleModel(this.modelRequest,this.aiBaseUrl,"".concat(e).concat(o))}return new l.ReactModel(n)},e.prototype.registerModel=function(e,t){null==h[e]?h[e]=t:console.warn("AI model ".concat(e," already exists!"))},e.prototype.createImageModel=function(e){return new l.DefaultImageModel(this.modelRequest,this.aiBaseUrl,e)},e.prototype.registerFunctionTool=function(e){l.toolMap.has(e.name)&&console.warn("AI function tool ".concat(e.name," already exists and will be overwritten!")),l.toolMap.set(e.name,e.fn)},e.prototype.resolveUrl=function(e){if(!this._getBaseUrl)return e;var t=this._getBaseUrl();return t!==this.baseUrl&&e.startsWith(this.baseUrl)?e.replace(this.baseUrl,t):e},e}();t.AI=f},9737:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},a=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.Bot=void 0;var s=n(1689),c=function(){function e(e,t){this.baseUrl=t;var n=arguments[2];this.req="string"==typeof n?function(t){var o=t.headers,i=void 0===o?{}:o,s=a(t,["headers"]);return e(r(r({},s),{headers:r(r({},i),{Authorization:"Bearer ".concat(n)})}))}:e}return e.prototype.list=function(e,t){return this.req({method:"get",url:this.join("bots"),data:e,timeout:null==t?void 0:t.timeout})},e.prototype.create=function(e,t){var n=e.botInfo;return this.req({method:"post",url:this.join("bots"),data:n,timeout:null==t?void 0:t.timeout})},e.prototype.get=function(e,t){var n=e.botId;return this.req({method:"get",url:this.join("bots/".concat(n)),timeout:null==t?void 0:t.timeout})},e.prototype.update=function(e,t){var n=e.botId,r=e.botInfo;return this.req({method:"PATCH",url:this.join("bots/".concat(n)),data:r,timeout:null==t?void 0:t.timeout})},e.prototype.delete=function(e,t){var n=e.botId;return this.req({method:"delete",url:this.join("bots/".concat(n)),timeout:null==t?void 0:t.timeout})},e.prototype.getChatRecords=function(e,t){return this.req({method:"get",url:this.join("bots/".concat(e.botId,"/records")),data:e,timeout:null==t?void 0:t.timeout})},e.prototype.sendFeedback=function(e,t){var n=e.userFeedback;return this.req({method:"post",url:this.join("bots/".concat(n.botId,"/feedback")),data:n,timeout:null==t?void 0:t.timeout})},e.prototype.getFeedback=function(e,t){return this.req({method:"get",url:this.join("bots/".concat(e.botId,"/feedback")),data:e,timeout:null==t?void 0:t.timeout})},e.prototype.uploadFiles=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.req({method:"post",url:this.join("bots/".concat(e.botId,"/files")),data:e,timeout:null==t?void 0:t.timeout})]}))}))},e.prototype.createConversation=function(e,t){var n=e.botId,r=a(e,["botId"]);return o(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.req({method:"post",url:this.join("bots/".concat(n,"/conversation")),data:r,timeout:null==t?void 0:t.timeout})]}))}))},e.prototype.getConversation=function(e,t){var n=e.pageSize,s=void 0===n?10:n,c=e.pageNumber,u=void 0===c?1:c,l=e.botId,p=a(e,["pageSize","pageNumber","botId"]);return o(this,void 0,void 0,(function(){var e,n;return i(this,(function(o){if(u<1)throw new Error("pageNumber must be greater than 0");return e=s*(u-1),n=s,[2,this.req({method:"get",url:this.join("bots/".concat(l,"/conversation")),data:r(r({},p),{offset:e,limit:n}),timeout:null==t?void 0:t.timeout})]}))}))},e.prototype.deleteConversation=function(e,t){var n=e.botId,r=e.conversationId,s=a(e,["botId","conversationId"]);return o(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.req({method:"delete",url:this.join("bots/".concat(n,"/conversation/").concat(r)),data:s,timeout:null==t?void 0:t.timeout})]}))}))},e.prototype.speechToText=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.req({method:"post",url:this.join("bots/".concat(e.botId,"/speech-to-text")),data:e,timeout:null==t?void 0:t.timeout})]}))}))},e.prototype.textToSpeech=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.req({method:"post",url:this.join("bots/".concat(e.botId,"/text-to-speech")),data:e,timeout:null==t?void 0:t.timeout})]}))}))},e.prototype.getTextToSpeechResult=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.req({method:"get",url:this.join("bots/".concat(e.botId,"/text-to-speech")),data:e,timeout:null==t?void 0:t.timeout})]}))}))},e.prototype.getRecommendQuestions=function(e,t){return o(this,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.req({method:"post",url:this.join("bots/".concat(e.botId,"/recommend-questions")),data:e,stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,new u(n)]}}))}))},e.prototype.generateBot=function(e,t){return o(this,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.req({method:"post",url:this.join("generate-bot"),data:e,stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,new u(n)]}}))}))},e.prototype.getPreview=function(e,t){return o(this,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.req({method:"post",url:this.join("preview"),data:e,stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,new u(n)]}}))}))},e.prototype.generateImage=function(e,t){return this.req({method:"post",url:this.join("generate-image"),data:e,timeout:null==t?void 0:t.timeout})},e.prototype.sendMessage=function(e,t){return o(this,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.req({method:"post",url:this.join("bots/".concat(e.botId,"/send-message")),data:e,stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,new u(n)]}}))}))},e.prototype.join=function(e){return"".concat(this.baseUrl,"/").concat(e)},e}();t.Bot=c;var u=function(){function e(e){var t=(0,s.toPolyfillReadable)(e);this._eventSourceStream=t.pipeThrough(new s.TextDecoderStream).pipeThrough((0,s.createEventSourceParserTransformStream)())}return Object.defineProperty(e.prototype,"teeedStream",{get:function(){var e=this._eventSourceStream.tee(),t=e[0],n=e[1];return this._eventSourceStream=n,t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"eventSourceStream",{get:function(){return(0,s.createAsyncIterable)(this.teeedStream)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataStream",{get:function(){return(0,s.createAsyncIterable)(this.eventSourceStream.pipeThrough(new s.TransformStream({transform:function(e,t){try{var n=JSON.parse(e.data);t.enqueue(n)}catch(n){"[DONE]"!==e.data?console.warn("Error when transforming event source data to json",n,e):t.terminate()}}})))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textStream",{get:function(){return(0,s.createAsyncIterable)(this.dataStream.pipeThrough(new s.TransformStream({transform:function(e,t){var n;t.enqueue(null!==(n=null==e?void 0:e.content)&&void 0!==n?n:"")}})))},enumerable:!1,configurable:!0}),e}()},9964:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createParser=void 0;var r=n(6298);Object.defineProperty(t,"createParser",{enumerable:!0,get:function(){return r.createParser}})},6298:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createParser=void 0,t.createParser=function(e){var t,r,o,i,a,s,c;return u(),{feed:function(e){r=r?r+e:e,t&&function(e){return n.every((function(t,n){return e.charCodeAt(n)===t}))}(r)&&(r=r.slice(n.length)),t=!1;for(var a=r.length,s=0,c=!1;s<a;){c&&("\n"===r[s]&&(s+=1),c=!1);for(var u=-1,p=i,d=void 0,h=o;u<0&&h<a;h++)":"===(d=r[h])&&p<0?p=h-s:"\r"===d?(c=!0,u=h-s):"\n"===d&&(u=h-s);if(u<0){o=a-s,i=p;break}o=0,i=-1,l(r,s,p,u),s+=u+1}s===a?r="":s>0&&(r=r.slice(s))},reset:u};function u(){t=!0,r="",o=0,i=-1,a=void 0,s=void 0,c=""}function l(t,n,r,o){if(0===o)return c.length>0&&(e({type:"event",id:a,event:s||void 0,data:c.slice(0,-1)}),c="",a=void 0),void(s=void 0);var i,u=r<0,l=t.slice(n,n+(u?o:r)),p=n+(i=u?o:" "===t[n+r+1]?r+2:r+1),d=o-i,h=t.slice(p,p+d).toString();if("data"===l)c+=h?"".concat(h,"\n"):"\n";else if("event"===l)s=h;else if("id"!==l||h.includes("\0")){if("retry"===l){var f=parseInt(h,10);Number.isNaN(f)||e({type:"reconnect-interval",value:f})}}else a=h}};var n=[239,187,191]},5337:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},c=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},u=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},l=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.registerAi=t.models=t.createAI=t.createAi=t.Bot=t.AI=void 0;var p=n(7756);Object.defineProperty(t,"AI",{enumerable:!0,get:function(){return p.AI}});var d=n(9737);Object.defineProperty(t,"Bot",{enumerable:!0,get:function(){return d.Bot}});var h=a(n(5305)),f=a(n(1689));t.utils=f,h.MODELS;var m=l(h,["MODELS"]);t.models=m;function v(e){var t=e.env,n=e.baseUrl,o=e.getBaseUrl,i=e.req,a=e.getAccessToken,s=e.handleReqInstance,d=e.i18n;return new p.AI(function(){if(null==s){if(null==a)throw new Error("`getAccessToken` is required when `handleReqInstance` is not provided!");return function(e){var t=e.getAccessToken,n=e.req;return{download:n.download,post:n.post,upload:n.upload,fetch:function(e){return c(void 0,void 0,void 0,(function(){var o,i,a,s,c;return u(this,(function(u){switch(u.label){case 0:if("function"!=typeof n.fetch)throw new Error("req.fetch is not a function");return o=e.token,i=e.headers,a=void 0===i?{}:i,s=l(e,["token","headers"]),null==o?[3,1]:(c=o,[3,3]);case 1:return[4,t()];case 2:c=u.sent().accessToken,u.label=3;case 3:return[2,n.fetch(r({headers:r({Authorization:"Bearer ".concat(c)},a)},s))]}}))}))}}}({req:i,getAccessToken:a})}return s({req:i})}(),function(){if(null!=o)return o();if(null!=n)return n;if(null==t)throw new Error("`env` is required when `baseUrl` is not provided!");return"https://".concat(t,".api.tcloudbasegateway.com/v1")}(),d,o)}t.createAI=v;var g=v;t.createAi=g;var b={name:"ai",entity:{ai:function(e){var t=this,n=this.request;if(null==n.fetch)throw new Error("cloudbase.request.fetch() unimplemented!");var r=function(){var e=t.getEndPointWithKey("GATEWAY"),n=e.BASE_URL,r=e.PROTOCOL;return"".concat(r).concat(n)};return(null==e?void 0:e.baseUrl)?v({req:n,baseUrl:e.baseUrl,handleReqInstance:function(e){return e.req},i18n:this.config.i18n}):v({req:n,baseUrl:r(),getBaseUrl:r,handleReqInstance:function(e){return e.req},i18n:this.config.i18n})}}};function y(e){try{e.registerComponent(b)}catch(e){console.warn(e)}}t.registerAi=y,s(n(4669),t);try{window.registerAi=y}catch(e){}},5476:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ArkSimpleModel=void 0;var a=n(1689);function s(e){var t=e.messages,n=e.model,o=e.temperature,i=e.tools,a=e.top_p;return r(r({},e),{messages:t,model:n,tools:i,top_p:a,temperature:o})}var c=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.subUrl="ark/api/v3/chat/completions",null!=n&&(this.subUrl=n)}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e,t){return o(this,void 0,Promise,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.req({url:this.url,data:r(r({},s(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=o.sent(),[2,r(r({},n),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return o(this,void 0,Promise,(function(){var n,o,c,u,l;return i(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:r(r({},s(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return o=i.sent(),c=(0,a.toPolyfillReadable)(o),u=(0,a.intoStandardStream)(c),l=u.pipeThrough(new a.TransformStream({transform:function(e,t){var o=e.choices.map((function(e){var t=e.delta;return null==n&&(n=(0,a.isToolCallAssistantMessage)(t)),n?r(r({},e),{finish_reason:"tool_calls",delta:t}):e})),i=r(r({},e),{choices:o});t.enqueue(r(r({},i),{rawResponse:e}))}})),[2,(0,a.createAsyncIterable)(l)]}}))}))},e}();t.ArkSimpleModel=c},7265:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.DSSimpleModel=void 0;var a=n(1689);function s(e){var t=e.messages,n=e.model,o=e.temperature,i=e.tools,a=e.top_p;return r(r({},e),{messages:t,model:n,tools:i,top_p:a,temperature:o})}var c=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.subUrl="dashscope/compatible-mode/v1/chat/completions",null!=n&&(this.subUrl=n)}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e,t){return o(this,void 0,Promise,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.req({url:this.url,data:r(r({},s(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=o.sent(),[2,r(r({},n),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return o(this,void 0,Promise,(function(){var n,o,c,u,l;return i(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:r(r({},s(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return o=i.sent(),c=(0,a.toPolyfillReadable)(o),u=(0,a.intoStandardStream)(c),l=u.pipeThrough(new a.TransformStream({transform:function(e,t){var o=e.choices.map((function(e){var t=Object.assign(e.delta,{role:"assistant"});return null==n&&(n=(0,a.isToolCallAssistantMessage)(t)),r(r({},e),n?{finish_reason:"tool_calls",delta:t}:{delta:t})})),i=r(r({},e),{choices:o});t.enqueue(r(r({},i),{rawResponse:e}))}})),[2,(0,a.createAsyncIterable)(l)]}}))}))},e}();t.DSSimpleModel=c},2102:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.DeepSeekSimpleModel=void 0;var a=n(1689),s=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.subUrl="deepseek/chat/completions",null!=n&&(this.subUrl=n)}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e,t){return o(this,void 0,Promise,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.req({url:this.url,data:r(r({},e),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=o.sent(),[2,r(r({},n),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return o(this,void 0,Promise,(function(){var n,o,s,c,u;return i(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:r(r({},e),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return o=i.sent(),s=(0,a.toPolyfillReadable)(o),c=(0,a.intoStandardStream)(s),u=c.pipeThrough(new a.TransformStream({transform:function(e,t){var o=e.choices.map((function(e){var t=e.delta;return null==n&&(n=(0,a.isToolCallAssistantMessage)(t)),n?r(r({},e),{finish_reason:"tool_calls",delta:t}):e})),i=r(r({},e),{choices:o});t.enqueue(r(r({},i),{rawResponse:e}))}})),[2,(0,a.createAsyncIterable)(u)]}}))}))},e}();t.DeepSeekSimpleModel=s},8017:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultSimpleModel=void 0;var a=n(1689),s=function(){function e(e,t,n){void 0===n&&(n=""),this.req=e,this.baseUrl=t,this.subUrl=n}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e){return o(this,void 0,Promise,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.req({url:this.url,data:r(r({},e),{stream:!1}),stream:!1})];case 1:return t=n.sent(),[2,r(r({},t),{rawResponse:t})]}}))}))},e.prototype.doStream=function(e){return o(this,void 0,Promise,(function(){var t,n,o,s,c;return i(this,(function(i){switch(i.label){case 0:return t=null,[4,this.req({url:this.url,data:r(r({},e),{stream:!0}),stream:!0})];case 1:return n=i.sent(),o=(0,a.toPolyfillReadable)(n),s=(0,a.intoStandardStream)(o),c=s.pipeThrough(new a.TransformStream({transform:function(e,n){var o=e.choices.map((function(e){var n=e.delta;return null==t&&(t=(0,a.isToolCallAssistantMessage)(n)),t?r(r({},e),{finish_reason:"tool_calls",delta:n}):e})),i=r(r({},e),{choices:o});n.enqueue(r(r({},i),{rawResponse:e}))}})),[2,(0,a.createAsyncIterable)(c)]}}))}))},e}();t.DefaultSimpleModel=s},7239:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.HunYuanSimpleModel=void 0;var a=n(1689),s=n(8586),c=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.subUrl="hunyuan",null!=n&&(this.subUrl=n)}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e,t){return o(this,void 0,Promise,(function(){var n,o;return i(this,(function(i){switch(i.label){case 0:return[4,this.req({url:this.url,headers:{"X-Tc-Action":"ChatCompletions"},data:r(r({},(0,s.processInput)(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=i.sent(),o=(0,s.titleCaseToSnakeCase)(n.Response),[2,r(r({},o),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return o(this,void 0,Promise,(function(){var n,o,c,u,l;return i(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,headers:{"X-Tc-Action":"ChatCompletions"},data:r(r({},e),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return o=i.sent(),c=(0,a.toPolyfillReadable)(o),u=(0,a.intoStandardStream)(c),l=u.pipeThrough(new a.TransformStream({transform:function(e,t){var o=(0,s.titleCaseToSnakeCase)(e),i=o.choices.map((function(e){var t=e.delta;return null==n&&(n=(0,a.isToolCallAssistantMessage)(t)),n?r(r({},e),{finish_reason:"tool_calls",delta:t}):e})),c=r(r({},o),{choices:i});t.enqueue(r(r({},c),{rawResponse:e}))}})),[2,(0,a.createAsyncIterable)(l)]}}))}))},e}();t.HunYuanSimpleModel=c},8586:function(e,t){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.titleCaseToSnakeCase=t.processInput=void 0,t.processInput=function(e){var t=e.messages,r=e.model,o=e.temperature,i=e.tool_choice,a=e.tools,s=e.top_p;return n(n({},e),{messages:(t.forEach((function(e){"tool_calls"in e&&e.tool_calls.filter((function(e){return"function"!==e.type})).forEach((function(t){return console.warn("`type` in tool_call is not 'function'",t,e)}))})),t),model:r,tools:function(){if(a)return a.forEach((function(e){"function"!==e.type&&console.warn("`type` in tool is not 'function'",e)})),a}(),top_p:s,tool_choice:i,temperature:o})},t.titleCaseToSnakeCase=function e(t){return"object"!=typeof t||null==t?t:Array.isArray(t)?t.map((function(t){return e(t)})):Object.entries(t).reduce((function(t,n){var r,o=n[0],i=n[1];return t["_"===(r=o.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))).charAt(0)?r.slice(1):r]="object"==typeof i?e(i):i,t}),{})}},9301:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.HunYuanBetaSimpleModel=void 0;var a=n(1689),s=n(8586),c=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.subUrl="hunyuan-beta/openapi/v1/chat/completions",null!=n&&(this.subUrl=n)}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e,t){return o(this,void 0,Promise,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.req({url:this.url,data:r(r({},(0,s.processInput)(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=o.sent(),[2,r(r({},n),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return o(this,void 0,Promise,(function(){var n,o,c,u,l;return i(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:r(r({},(0,s.processInput)(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return o=i.sent(),c=(0,a.toPolyfillReadable)(o),u=(0,a.intoStandardStream)(c),l=u.pipeThrough(new a.TransformStream({transform:function(e,t){var o=e.choices.map((function(e){var t=e.delta;return null==n&&(n=(0,a.isToolCallAssistantMessage)(t)),n?r(r({},e),{finish_reason:"tool_calls",delta:t}):e})),i=r(r({},e),{choices:o});t.enqueue(r(r({},i),{rawResponse:e}))}})),[2,(0,a.createAsyncIterable)(l)]}}))}))},e}();t.HunYuanBetaSimpleModel=c},5720:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.HunYuanExpSimpleModel=void 0;var a=n(1689),s=n(8586),c=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.subUrl="hunyuan-exp/chat/completions",null!=n&&(this.subUrl=n)}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e){return o(this,void 0,Promise,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.req({url:this.url,data:r(r({},(0,s.processInput)(e)),{stream:!1}),stream:!1})];case 1:return t=n.sent(),[2,r(r({},t),{rawResponse:t})]}}))}))},e.prototype.doStream=function(e){return o(this,void 0,Promise,(function(){var t,n,o,c,u;return i(this,(function(i){switch(i.label){case 0:return t=null,[4,this.req({url:this.url,data:r(r({},(0,s.processInput)(e)),{stream:!0}),stream:!0})];case 1:return n=i.sent(),o=(0,a.toPolyfillReadable)(n),c=(0,a.intoStandardStream)(o),u=c.pipeThrough(new a.TransformStream({transform:function(e,n){var o=e.choices.map((function(e){var n=e.delta;return null==t&&(t=(0,a.isToolCallAssistantMessage)(n)),t?r(r({},e),{finish_reason:"tool_calls",delta:n}):e})),i=r(r({},e),{choices:o});n.enqueue(r(r({},i),{rawResponse:e}))}})),[2,(0,a.createAsyncIterable)(u)]}}))}))},e}();t.HunYuanExpSimpleModel=c},1586:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.HunYuanOpenSimpleModel=void 0;var a=n(1689),s=n(8586),c=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.subUrl="hunyuan-open/v1/chat/completions",null!=n&&(this.subUrl=n)}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e,t){return o(this,void 0,Promise,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.req({url:this.url,data:r(r({},(0,s.processInput)(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=o.sent(),[2,r(r({},n),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return o(this,void 0,Promise,(function(){var n,o,c,u,l;return i(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:r(r({},(0,s.processInput)(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return o=i.sent(),c=(0,a.toPolyfillReadable)(o),u=(0,a.intoStandardStream)(c),l=u.pipeThrough(new a.TransformStream({transform:function(e,t){var o=e.choices.map((function(e){var t=e.delta;return null==n&&(n=(0,a.isToolCallAssistantMessage)(t)),n?r(r({},e),{finish_reason:"tool_calls",delta:t}):e})),i=r(r({},e),{choices:o});t.enqueue(r(r({},i),{rawResponse:e}))}})),[2,(0,a.createAsyncIterable)(l)]}}))}))},e}();t.HunYuanOpenSimpleModel=c},3925:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.MoonshotSimpleModel=void 0;var a=n(1689);function s(e){var t=e.messages,n=e.model,o=e.temperature,i=e.tools,a=e.top_p;return r(r({},e),{messages:t,model:n,tools:i,top_p:a,temperature:o})}var c=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.subUrl="moonshot/v1/chat/completions",null!=n&&(this.subUrl=n)}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e,t){return o(this,void 0,Promise,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.req({url:this.url,data:r(r({},s(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=o.sent(),[2,r(r({},n),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return o(this,void 0,Promise,(function(){var n,o,c,u,l;return i(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:r(r({},s(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return o=i.sent(),c=(0,a.toPolyfillReadable)(o),u=(0,a.intoStandardStream)(c),l=u.pipeThrough(new a.TransformStream({transform:function(e,t){var o=e.choices.map((function(e){var t=e.delta;return null==n&&(n=(0,a.isToolCallAssistantMessage)(t)),n?r(r({},e),{finish_reason:"tool_calls",delta:t}):e})),i=r(r({},e),{choices:o});t.enqueue(r(r({},i),{rawResponse:e}))}})),[2,(0,a.createAsyncIterable)(l)]}}))}))},e}();t.MoonshotSimpleModel=c},4532:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.YiSimpleModel=void 0;var a=n(1689);function s(e){var t=e.messages,n=e.model,o=e.temperature,i=e.tools,a=e.top_p;return r(r({},e),{messages:t,model:n,tools:i,top_p:a,temperature:o})}var c=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.subUrl="01-ai/v1/chat/completions",null!=n&&(this.subUrl=n)}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e,t){return o(this,void 0,Promise,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.req({url:this.url,data:r(r({},s(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=o.sent(),[2,r(r({},n),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return o(this,void 0,Promise,(function(){var n,o,c,u,l;return i(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:r(r({},s(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return o=i.sent(),c=(0,a.toPolyfillReadable)(o),u=(0,a.intoStandardStream)(c),l=u.pipeThrough(new a.TransformStream({transform:function(e,t){var o,i,s,c,u,l;if((null===(s=null===(i=null===(o=null==e?void 0:e.choices)||void 0===o?void 0:o[0])||void 0===i?void 0:i.delta)||void 0===s?void 0:s.content)||(null===(l=null===(u=null===(c=null==e?void 0:e.choices)||void 0===c?void 0:c[0])||void 0===u?void 0:u.delta)||void 0===l?void 0:l.tool_calls)){var p=e.choices.map((function(e){var t=Object.assign(e.delta,{role:"assistant"});return null==n&&(n=(0,a.isToolCallAssistantMessage)(t)),r(r({},e),n?{finish_reason:"tool_calls",delta:t}:{delta:t})})),d=r(r({},e),{choices:p});t.enqueue(r(r({},d),{rawResponse:e}))}}})),[2,(0,a.createAsyncIterable)(l)]}}))}))},e}();t.YiSimpleModel=c},7173:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ZhiPuSimpleModel=void 0;var a=n(1689);function s(e){var t=e.messages,n=e.model,o=e.temperature,i=e.tool_choice,a=e.tools,s=e.top_p;return r(r({},e),{messages:t,model:n,temperature:o,tool_choice:(i&&"auto"!==i&&console.warn("`tool_choice` is not 'auto'"),i),tools:a,top_p:s})}var c=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.subUrl="zhipu/api/paas/v4/chat/completions",null!=n&&(this.subUrl=n)}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e,t){return o(this,void 0,Promise,(function(){var n,o;return i(this,(function(i){switch(i.label){case 0:return n=s(e),[4,this.req({url:this.url,data:r(r({},n),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return o=i.sent(),[2,r(r({},o),{rawResponse:o})]}}))}))},e.prototype.doStream=function(e,t){return o(this,void 0,Promise,(function(){var n,o,c,u,l,p;return i(this,(function(i){switch(i.label){case 0:return n=s(e),o=null,[4,this.req({url:this.url,data:r(r({},n),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return c=i.sent(),u=(0,a.toPolyfillReadable)(c),l=(0,a.intoStandardStream)(u),p=l.pipeThrough(new a.TransformStream({transform:function(e,t){var n=e.choices.map((function(e){var t=e.delta;return null==o&&(o=(0,a.isToolCallAssistantMessage)(t)),o?r(r({},e),{finish_reason:"tool_calls",delta:t}):e})),i=r(r({},e),{choices:n});t.enqueue(r(r({},i),{rawResponse:e}))}})),[2,(0,a.createAsyncIterable)(p)]}}))}))},e}();t.ZhiPuSimpleModel=c},8328:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultImageModel=void 0;var o=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.provider=n,this.defaultGenerateImageSubUrl="images/generations",this.generateImageSubUrlConfig={"hunyuan-image":{"hunyuan-image-v3.0-v1.0.4":"images/ar/generations","hunyuan-image-v3.0-v1.0.1":"images/ar/generations"}},this.generateImage=this.generateImageImpl.bind(this)}return e.prototype.generateImageImpl=function(e){var t;return n(this,void 0,Promise,(function(){var n,o;return r(this,(function(r){switch(r.label){case 0:return n=this.defaultGenerateImageSubUrl,"object"==typeof e&&e&&"model"in e&&"string"==typeof e.model&&(o=null===(t=this.generateImageSubUrlConfig[this.provider])||void 0===t?void 0:t[e.model])&&(n=o),[4,this.req({url:this.getGenerateUrl(n),data:e,stream:!1})];case 1:return[2,r.sent()]}}))}))},e.prototype.getGenerateUrl=function(e){return"".concat(this.baseUrl,"/").concat(this.provider,"/").concat(e)},e}();t.DefaultImageModel=o},5305:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toolMap=t.ReactModel=t.DefaultImageModel=t.DefaultSimpleModel=t.HunYuanOpenSimpleModel=t.HunYuanExpSimpleModel=t.MoonshotSimpleModel=t.YiSimpleModel=t.DSSimpleModel=t.ArkSimpleModel=t.HunYuanSimpleModel=t.HunYuanBetaSimpleModel=t.ZhiPuSimpleModel=t.MODELS=void 0;var r=n(7173);Object.defineProperty(t,"ZhiPuSimpleModel",{enumerable:!0,get:function(){return r.ZhiPuSimpleModel}});var o=n(9301);Object.defineProperty(t,"HunYuanBetaSimpleModel",{enumerable:!0,get:function(){return o.HunYuanBetaSimpleModel}});var i=n(7239);Object.defineProperty(t,"HunYuanSimpleModel",{enumerable:!0,get:function(){return i.HunYuanSimpleModel}});var a=n(5476);Object.defineProperty(t,"ArkSimpleModel",{enumerable:!0,get:function(){return a.ArkSimpleModel}});var s=n(7265);Object.defineProperty(t,"DSSimpleModel",{enumerable:!0,get:function(){return s.DSSimpleModel}});var c=n(4532);Object.defineProperty(t,"YiSimpleModel",{enumerable:!0,get:function(){return c.YiSimpleModel}});var u=n(3925);Object.defineProperty(t,"MoonshotSimpleModel",{enumerable:!0,get:function(){return u.MoonshotSimpleModel}});var l=n(5720);Object.defineProperty(t,"HunYuanExpSimpleModel",{enumerable:!0,get:function(){return l.HunYuanExpSimpleModel}});var p=n(1586);Object.defineProperty(t,"HunYuanOpenSimpleModel",{enumerable:!0,get:function(){return p.HunYuanOpenSimpleModel}});var d=n(2102),h=n(8017);Object.defineProperty(t,"DefaultSimpleModel",{enumerable:!0,get:function(){return h.DefaultSimpleModel}});var f=n(8328);Object.defineProperty(t,"DefaultImageModel",{enumerable:!0,get:function(){return f.DefaultImageModel}}),t.MODELS={hunyuan:i.HunYuanSimpleModel,"hunyuan-beta":o.HunYuanBetaSimpleModel,ark:a.ArkSimpleModel,dashscope:s.DSSimpleModel,"01-ai":c.YiSimpleModel,moonshot:u.MoonshotSimpleModel,zhipu:r.ZhiPuSimpleModel,"hunyuan-exp":l.HunYuanExpSimpleModel,"hunyuan-open":p.HunYuanOpenSimpleModel,deepseek:d.DeepSeekSimpleModel};var m=n(1443);Object.defineProperty(t,"ReactModel",{enumerable:!0,get:function(){return m.ReactModel}}),Object.defineProperty(t,"toolMap",{enumerable:!0,get:function(){return m.toolMap}})},1443:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},a=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},s=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,o,(t=e[n](t)).done,t.value)}))}}},c=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.toolMap=t.ReactModel=void 0;var u=n(1689);function l(e){var t,n=e.onStepFinish,o=e.abortSignal,i=e.maxSteps,s=e.topP,c=e.toolChoice,l=a(e,["onStepFinish","abortSignal","maxSteps","topP","toolChoice"]);if(null!=i&&i<1)throw new Error("`maxSteps` muse be greater than 0.");return[{onStepFinish:n,abortSignal:o,maxSteps:i},r(r({},l),{tools:null===(t=l.tools)||void 0===t?void 0:t.map((function(e){return"fn"in e?(0,u.functionToolToModelTool)(e):e})),top_p:null!=s?s:l.top_p,tool_choice:null!=c?c:l.tool_choice})]}var p=function(){function e(e){this.model=e}return e.prototype.generateText=function(e,t){var n,r;return o(this,void 0,Promise,(function(){var o,a,s,u,p,g,b,y,_,x,w,E,I,S,O,T,A,P,C,R,N,k=this;return i(this,(function(i){switch(i.label){case 0:return o=[],a={completion_tokens:0,prompt_tokens:0,total_tokens:0},s=l(e),u=s[0],p=u.onStepFinish,g=u.maxSteps,b=void 0===g?10:g,y=s[1],[4,(_=function(){return k.model.doGenerate(y,t)})()];case 1:x=i.sent(),w=1,x.rawResponse&&o.push(x.rawResponse),E=null,i.label=2;case 2:if(!(w<b&&null!=(E=d(x))))return[3,9];I=m(x.usage),v(a,I),i.label=3;case 3:return i.trys.push([3,7,,8]),[4,f(E)];case 4:return S=i.sent(),O=x.choices[0],[4,null==p?void 0:p({finishReason:O.finish_reason,messages:y.messages.slice(),text:O.message.content,toolCall:E,toolResult:S,stepUsage:I,totalUsage:Object.assign({},a)})];case 5:return i.sent(),h(y.messages,O.message,S),[4,_()];case 6:return(x=i.sent()).rawResponse&&o.push(x.rawResponse),w+=1,[3,8];case 7:return T=i.sent(),[2,{text:"",messages:y.messages,usage:a,error:T,rawResponses:o}];case 8:return[3,2];case 9:return A=null===(n=null==x?void 0:x.choices)||void 0===n?void 0:n[0],P=null==A?void 0:A.message,C=null!==(r=null==P?void 0:P.content)&&void 0!==r?r:"",R=P?c(c([],y.messages,!0),[P],!1):y.messages,N=m(x.usage),v(a,N),[4,null==p?void 0:p({finishReason:A.finish_reason,messages:R.slice(),text:C,toolCall:d(x),toolResult:null,stepUsage:N,totalUsage:Object.assign({},a)})];case 10:return i.sent(),[2,{text:C,messages:R,usage:a,rawResponses:o}]}}))}))},e.prototype.streamText=function(e,t){var n;return o(this,void 0,Promise,(function(){var r,a,p,d,m,g,b,y,_,x,w,E,I,S,O,T,A,P,C,R,N,k,j,D,U,L,M,q,B,F,W,V,G,H,z,K,Y=this;return i(this,(function(J){switch(J.label){case 0:return r={completion_tokens:0,prompt_tokens:0,total_tokens:0},a=l(e),p=a[0],d=p.onStepFinish,m=p.maxSteps,g=void 0===m?10:m,b=a[1],[4,(y=function(){return Y.model.doStream(b,t)})()];case 1:_=J.sent(),x=1,w=null,E=function(){var e=_.tee(),t=e[0],n=e[1];return _=(0,u.createAsyncIterable)(t),function(e){var t,n,r,a,c,l,p,d,h,f;return o(this,void 0,Promise,(function(){var o,m,v,g,b,y,_,x,w,E,I,S,O;return i(this,(function(i){switch(i.label){case 0:o={completion_tokens:0,prompt_tokens:0,total_tokens:0},m=(0,u.createAsyncIterable)(e),g={role:"assistant",content:"",tool_calls:[v={id:"",function:{name:"",arguments:""},type:""}]},i.label=1;case 1:i.trys.push([1,6,7,12]),b=!0,y=s(m),i.label=2;case 2:return[4,y.next()];case 3:if(_=i.sent(),t=_.done)return[3,5];a=_.value,b=!1;try{if(!(w=null==(x=a)?void 0:x.choices[0]))return[2,null];if(E=w.finish_reason,I=w.delta,"tool_calls"!==E)return[2,null];if(!I)return[3,4];if(I.content&&(g.content+=I.content),!("tool_calls"in I))return[3,4];(null==(S=null===(c=null==I?void 0:I.tool_calls)||void 0===c?void 0:c[0])?void 0:S.id)&&(v.id=S.id),(null==S?void 0:S.type)&&(v.type=S.type),(null===(l=null==S?void 0:S.function)||void 0===l?void 0:l.name)&&(v.function.name=S.function.name),(null===(p=null==S?void 0:S.function)||void 0===p?void 0:p.arguments)&&(v.function.arguments+=S.function.arguments),(null===(d=null==x?void 0:x.usage)||void 0===d?void 0:d.completion_tokens)&&(o.completion_tokens=x.usage.completion_tokens),(null===(h=null==x?void 0:x.usage)||void 0===h?void 0:h.prompt_tokens)&&(o.prompt_tokens=x.usage.prompt_tokens),(null===(f=null==x?void 0:x.usage)||void 0===f?void 0:f.total_tokens)&&(o.total_tokens=x.usage.total_tokens)}finally{b=!0}i.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return O=i.sent(),n={error:O},[3,12];case 7:return i.trys.push([7,,10,11]),b||t||!(r=y.return)?[3,9]:[4,r.call(y)];case 8:i.sent(),i.label=9;case 9:return[3,11];case 10:if(n)throw n.error;return[7];case 11:return[7];case 12:return[2,{message:g,usage:o}]}}))}))}(n)},J.label=2;case 2:return(I=x<g)?[4,E()]:[3,4];case 3:I=null!=(w=J.sent()),J.label=4;case 4:if(!I)return[3,11];S=w.message,O=w.usage,v(r,O),T=null===(n=S.tool_calls)||void 0===n?void 0:n[0],J.label=5;case 5:return J.trys.push([5,9,,10]),[4,f(T)];case 6:return A=J.sent(),[4,null==d?void 0:d({finishReason:"tool_calls",messages:b.messages.slice(),text:S.content,toolCall:T,toolResult:A,stepUsage:O,totalUsage:Object.assign({},r)})];case 7:return J.sent(),h(b.messages,S,A),[4,y()];case 8:return _=J.sent(),[3,10];case 9:return P=J.sent(),C=_.tee(),R=C[0],N=C[1],[2,{messages:Promise.resolve(b.messages),dataStream:(0,u.createAsyncIterable)(R),textStream:(0,u.createAsyncIterable)(N.pipeThrough(new u.TransformStream({transform:function(e,t){var n,r,o,i=null===(o=null===(r=null===(n=null==e?void 0:e.choices)||void 0===n?void 0:n[0])||void 0===r?void 0:r.delta)||void 0===o?void 0:o.content;"string"==typeof i&&t.enqueue(i)}}))),usage:Promise.resolve(r),error:P}];case 10:return[3,2];case 11:return[4,E()];case 12:return(w=J.sent())?(k=w.message,j=w.usage,v(r,j),D=c(c([],b.messages,!0),[k],!1),d({messages:D.slice(),finishReason:"tool_call",stepUsage:j,text:k.content,toolCall:k.tool_calls[0],totalUsage:Object.assign({},r)}),U=_.tee(),L=U[0],M=U[1],[2,{messages:Promise.resolve(c(c([],b.messages,!0),[k],!1)),dataStream:(0,u.createAsyncIterable)(L),textStream:(0,u.createAsyncIterable)(M.pipeThrough(new u.TransformStream({transform:function(e,t){var n,r,o,i=null===(o=null===(r=null===(n=null==e?void 0:e.choices)||void 0===n?void 0:n[0])||void 0===r?void 0:r.delta)||void 0===o?void 0:o.content;"string"==typeof i&&t.enqueue(i)}}))),usage:Promise.resolve(r)}]):(q=(0,u.createPromise)(),B=(0,u.createPromise)(),F={role:"assistant",content:""},W="",V={completion_tokens:0,prompt_tokens:0,total_tokens:0},G=_.pipeThrough(new u.TransformStream({transform:function(e,t){var n,r,o,i,a,s,c,u,l=null===(o=null===(r=null===(n=null==e?void 0:e.choices)||void 0===n?void 0:n[0])||void 0===r?void 0:r.delta)||void 0===o?void 0:o.content;"string"==typeof l&&(F.content+=l);var p=null===(a=null===(i=null==e?void 0:e.choices)||void 0===i?void 0:i[0])||void 0===a?void 0:a.finish_reason;p&&(W=p),(null===(s=null==e?void 0:e.usage)||void 0===s?void 0:s.completion_tokens)&&(V.completion_tokens=e.usage.completion_tokens),(null===(c=null==e?void 0:e.usage)||void 0===c?void 0:c.prompt_tokens)&&(V.prompt_tokens=e.usage.prompt_tokens),(null===(u=null==e?void 0:e.usage)||void 0===u?void 0:u.total_tokens)&&(V.total_tokens=e.usage.total_tokens),t.enqueue(e)},flush:function(){q.res(c(c([],b.messages,!0),[F],!1)),v(r,V),B.res(Object.assign({},r)),null==d||d({messages:c(c([],b.messages,!0),[F],!1),finishReason:W,text:F.content,stepUsage:V,totalUsage:Object.assign({},r)})}})),H=G.tee(),z=H[0],K=H[1],[2,{messages:q.promise,dataStream:(0,u.createAsyncIterable)(z),textStream:(0,u.createAsyncIterable)(K.pipeThrough(new u.TransformStream({transform:function(e,t){var n,r,o,i=null===(o=null===(r=null===(n=null==e?void 0:e.choices)||void 0===n?void 0:n[0])||void 0===r?void 0:r.delta)||void 0===o?void 0:o.content;"string"==typeof i&&t.enqueue(i)}}))),usage:B.promise}])}}))}))},e}();function d(e){var t,n=null===(t=null==e?void 0:e.choices)||void 0===t?void 0:t[0];if(!n)return null;var r=n.finish_reason,o=n.message;return"tool_calls"!==r?null:o&&(0,u.isToolCallAssistantMessage)(o)?o.tool_calls[0]:null}function h(e,t,n){e.push(t,{role:"tool",tool_call_id:t.tool_calls[0].id,content:JSON.stringify(n)})}function f(e){return t.toolMap.get(e.function.name)(JSON.parse(e.function.arguments))}function m(e){var t,n,r;return{completion_tokens:null!==(t=null==e?void 0:e.completion_tokens)&&void 0!==t?t:0,prompt_tokens:null!==(n=null==e?void 0:e.prompt_tokens)&&void 0!==n?n:0,total_tokens:null!==(r=null==e?void 0:e.total_tokens)&&void 0!==r?r:0}}function v(e,t){e.completion_tokens+=t.completion_tokens,e.prompt_tokens+=t.prompt_tokens,e.total_tokens+=t.total_tokens}t.ReactModel=p,t.toolMap=new Map},4669:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleChatModel=void 0;t.SimpleChatModel=function(){}},1689:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},i=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,o,(t=e[n](t)).done,t.value)}))}}};Object.defineProperty(t,"__esModule",{value:!0}),t.functionToolToModelTool=t.isToolCallAssistantMessage=t.createPromise=t.readableStream2JsonObject=t.intoTextStream=t.intoStandardStream=t.createAsyncIterable=t.TextDecoderStream=t.toPolyfillReadable=t.createEventSourceParserTransformStream=t.TransformStream=t.ReadableStream=void 0;var a=n(8775),s=n(766),c=n(9964),u=n(6282);t.ReadableStream=a.ReadableStream,t.TransformStream=a.TransformStream,t.createEventSourceParserTransformStream=function(){var e;return new t.TransformStream({start:function(t){e=(0,c.createParser)((function(e){"event"===e.type&&t.enqueue(e)}))},transform:function(t){e.feed(t)}})},t.toPolyfillReadable=(0,s.createReadableStreamWrapper)(t.ReadableStream);var l=function(){function e(e,n){void 0===e&&(e="utf-8"),void 0===n&&(n={});var r=this;this.transform=new t.TransformStream({transform:function(e,t){var n=r.handle.decode(new Uint8Array(e),{stream:!0});n&&t.enqueue(n)},flush:function(e){var t=r.handle.decode();t&&e.enqueue(t),e.terminate()}}),this.handle=new u.TextDecoder(e,n)}return Object.defineProperty(e.prototype,"encoding",{get:function(){return this.handle.encoding},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fatal",{get:function(){return this.handle.fatal},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ignoreBOM",{get:function(){return this.handle.ignoreBOM},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"readable",{get:function(){return this.transform.readable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"writable",{get:function(){return this.transform.writable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return"TextDecoderStream"},enumerable:!1,configurable:!0}),e}();function p(e){var t=e;return t[Symbol.asyncIterator]=function(){var t=e.getReader();return{next:function(){return r(this,void 0,Promise,(function(){var e,n,r;return o(this,(function(o){switch(o.label){case 0:return[4,t.read()];case 1:return e=o.sent(),n=e.done,r=e.value,[2,n?{done:!0,value:void 0}:{done:!1,value:r}]}}))}))}}},t}function d(e){return p((0,t.toPolyfillReadable)(e).pipeThrough(new l))}t.TextDecoderStream=l,t.createAsyncIterable=p,t.intoStandardStream=function(e){return p(e.pipeThrough(new l).pipeThrough((0,t.createEventSourceParserTransformStream)()).pipeThrough(new t.TransformStream({transform:function(e,t){try{var n=JSON.parse(e.data);t.enqueue(n)}catch(n){"[DONE]"!==e.data?console.warn("Error when transforming event source data to json",n,e):t.terminate()}}})))},t.intoTextStream=d,t.readableStream2JsonObject=function(e){var t,n,a,s;return r(this,void 0,void 0,(function(){var r,c,u,l,p,h;return o(this,(function(o){switch(o.label){case 0:r=d(e),c="",o.label=1;case 1:o.trys.push([1,6,7,12]),u=!0,l=i(r),o.label=2;case 2:return[4,l.next()];case 3:if(p=o.sent(),t=p.done)return[3,5];s=p.value,u=!1;try{c+=s}finally{u=!0}o.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return h=o.sent(),n={error:h},[3,12];case 7:return o.trys.push([7,,10,11]),u||t||!(a=l.return)?[3,9]:[4,a.call(l)];case 8:o.sent(),o.label=9;case 9:return[3,11];case 10:if(n)throw n.error;return[7];case 11:return[7];case 12:return[2,JSON.parse(c)]}}))}))},t.createPromise=function(){var e,t;return{promise:new Promise((function(n,r){e=n,t=r})),res:e,rej:t}},t.isToolCallAssistantMessage=function(e){var t;return"assistant"===e.role&&"tool_calls"in e&&null!=(null===(t=e.tool_calls)||void 0===t?void 0:t[0])},t.functionToolToModelTool=function(e){return{type:"function",function:{description:e.description,name:e.name,parameters:e.parameters}}}},5378:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.generateApis=t.generateCallApis=t.callApi=void 0;var a=n(794);function s(e,t){var n,s,c,u;return o(this,void 0,Promise,(function(){var o,l,p,d,h,f,m,v,g,b,y,_,x,w,E,I,S,O,T,A,P,C,R;return i(this,(function(i){switch(i.label){case 0:l=(o=e||{}).name,p=o.body,d=o.path,h=void 0===d?"":d,f=o.method,m=void 0===f?"POST":f,v=o.headers,g=void 0===v?{}:v,b=(e||{}).token,y={};try{y=JSON.parse(p)}catch(e){y=p||{}}if(!l)throw new Error(JSON.stringify({code:a.ERRORS.INVALID_PARAMS,msg:"[apis] invalid api name"}));return _="",w=(x=this).gatewayOrigin,E=x.getAccessToken,I=x.env,w?_="".concat(w,"/v1"):this.getEndPointWithKey?(S=this.getEndPointWithKey("GATEWAY"),O=S.BASE_URL,T=S.PROTOCOL,_="".concat(T).concat(O)):_="https://".concat(I,".api.tcloudbasegateway.com/v1"),A="".concat(_,"/apis/").concat(l),P=h.startsWith("/")?h:"/".concat(h),E?[4,E()]:[3,2];case 1:C=i.sent().accessToken,g.Authorization="Bearer ".concat(C),i.label=2;case 2:if(R=["GET","HEAD"].includes(null===(n=null==m?void 0:m.toUpperCase)||void 0===n?void 0:n.call(m)))try{P="".concat(P).concat(P.includes("?")?"&":"?").concat(Object.keys(y).map((function(e){return"".concat(e,"=").concat(y[e])})).join("&"))}catch(e){}return[4,this.request.fetch(r(r(r({url:"".concat(A).concat(P),method:m||"POST",headers:r({"Content-Type":"application/json; charset=utf-8"},g)},R?{}:{body:JSON.stringify(y)}),{token:(null===(s=null==b?void 0:b.trim)||void 0===s?void 0:s.call(b))||(null===(u=null===(c=g.Authorization)||void 0===c?void 0:c.replace)||void 0===u?void 0:u.call(c,/^Bearer /,""))||null}),t))];case 3:return[4,i.sent().data];case 4:return[2,i.sent()]}}))}))}t.callApi=s;var c=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH","REQUEST"];function u(e){var t=this;return new Proxy({},{get:function(n,a){if("string"!=typeof a)throw new Error("[apis] method must be string");var u=a.toLocaleUpperCase();if(!c.includes(u))throw new Error("[apis] invalid method: ".concat(a));return function(n,a){return o(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,s.call(this,r({name:e,method:("REQUEST"===u?n.method:u)||"POST"},n),a)];case 1:return[2,t.sent()]}}))}))}}})}t.generateCallApis=u,t.generateApis=function(e){var t=this;return Object.keys(e||{}).forEach((function(n){void 0!==e[n]&&(t[n]=e[n])})),new Proxy({},{get:function(e,n){if("string"==typeof n)return u.call(t,n)}})}},1944:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.registerApis=t.generateApis=void 0;var i=n(5378);Object.defineProperty(t,"generateApis",{enumerable:!0,get:function(){return i.generateApis}});var a="apis",s={name:a,IIFE:!0,entity:function(){Object.defineProperty(this.prototype,a,{get:function(){return i.generateApis.call(this)},configurable:!0,enumerable:!0})}};function c(e){try{e.registerComponent(s)}catch(e){console.warn(e)}}t.registerApis=c;try{cloudbase.registerComponent(s)}catch(e){}o(n(2026),t);try{window.registerApis=c}catch(e){}},2026:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7922:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.OAUTH2_LOGINTYPE_PREFIX=t.LOGINTYPE=t.getBaseEndPoint=t.setRegionLevelEndpoint=t.setGatewayEndPointWithEnv=t.getEndPointInfo=t.setEndPointInfo=t.DEFAULT_PROTOCOL=t.DATA_VERSION=t.getSdkName=t.setSdkName=t.getSdkVersion=t.setSdkVersion=void 0;var o=n(2877),i=o.constants.setSdkName,a=o.constants.setProtocol,s="",c="@cloudbase/js-sdk";t.setSdkVersion=function(e){s=e},t.getSdkVersion=function(){return s},t.setSdkName=function(e){c=e,i(e)},t.getSdkName=function(){return c},t.DATA_VERSION="2020-01-10";var u,l=[],p=["env","endPointKey","region"];function d(e){return l.find((function(t){return p.filter((function(t){return null!=e[t]})).every((function(n){return t[n]===e[n]}))}))}function h(e){var n,o;e.protocol&&!/:$/.test(e.protocol)&&(e.protocol="".concat(e.protocol,":"));var i=d(e);i?(null!=e.baseUrl&&(i.baseUrl=e.baseUrl),null!=e.protocol&&(i.protocol=e.protocol)):l.push(r(r({},e),{protocol:null!==(n=e.protocol)&&void 0!==n?n:t.DEFAULT_PROTOCOL})),"CLOUD_API"===e.endPointKey&&a(null!==(o=e.protocol)&&void 0!==o?o:t.DEFAULT_PROTOCOL)}function f(e,t,n){return d({env:e,endPointKey:t,region:n})}t.DEFAULT_PROTOCOL="https:",t.setEndPointInfo=h,t.getEndPointInfo=f,t.setGatewayEndPointWithEnv=function(e,t,n){var r="//".concat(e,".api.tcloudbasegateway.com/v1");n&&(r="//".concat(e,".api.intl.tcloudbasegateway.com/v1")),h({endPointKey:"GATEWAY",env:e,baseUrl:r,protocol:t})},t.setRegionLevelEndpoint=function(e,t,n){h({env:e,region:t,baseUrl:"//".concat(e,".").concat(t||"ap-shanghai",".tcb-api.tencentcloudapi.com/web"),protocol:n,endPointKey:"CLOUD_API"})},t.getBaseEndPoint=function(e,t){void 0===t&&(t="CLOUD_API");var n=f(e,t||"CLOUD_API"),r=n.protocol,o=n.baseUrl;return"".concat(r).concat(o).match(/(http(s)?:)?\/\/([^/?#]*)/)[0]},(u=t.LOGINTYPE||(t.LOGINTYPE={})).NULL="NULL",u.ANONYMOUS="ANONYMOUS",u.WECHAT="WECHAT",u.WECHAT_PUBLIC="WECHAT-PUBLIC",u.WECHAT_OPEN="WECHAT-OPEN",u.CUSTOM="CUSTOM",u.EMAIL="EMAIL",u.USERNAME="USERNAME",u.PHONE="PHONE",t.OAUTH2_LOGINTYPE_PREFIX="OAUTH2"},6950:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.cloudbase=t.LANGS=t.getBaseEndPoint=void 0;var c=n(2877),u=n(4276),l=n(1985),p=n(6938),d=n(901),h=n(7922),f=n(3509),m=n(7922);Object.defineProperty(t,"getBaseEndPoint",{enumerable:!0,get:function(){return m.getBaseEndPoint}});var v=n(3509);Object.defineProperty(t,"LANGS",{enumerable:!0,get:function(){return v.LANGS}});var g=c.adapters.useAdapters,b=c.adapters.useDefaultAdapter,y=c.constants.ERRORS,_=c.constants.COMMUNITY_SITE_URL,x=c.utils.printWarn,w=c.helpers.catchErrorsDecorator,E={timeout:15e3,persistence:"local"},I=6e5,S={},O=function(){function e(e){this.cloudbaseConfig=e||this.cloudbaseConfig,this.authInstance=null,this.oauthInstance=null,this.version=(0,h.getSdkVersion)()}return Object.defineProperty(e.prototype,"config",{get:function(){return this.cloudbaseConfig},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"platform",{get:function(){return l.Platform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cache",{get:function(){return(0,p.getCacheByEnvId)(this.cloudbaseConfig.env)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localCache",{get:function(){return(0,p.getLocalCache)(this.cloudbaseConfig.env)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){return(0,d.getRequestByEnvId)(this.cloudbaseConfig.env)},enumerable:!1,configurable:!0}),e.prototype.init=function(t){var n,o,i;if(void 0===t&&(t={env:""}),t.endPointMode=t.endPointMode||"GATEWAY",l.Platform.adapter||this.useDefaultAdapter(),!(t=this.dealNodeAdapterConfig(t)).env)throw new Error(JSON.stringify({code:y.INVALID_PARAMS,msg:"env must not be specified"}));this.isInitialized(t);var a={timeout:t.timeout||15e3,timeoutMsg:"[".concat((0,h.getSdkName)(),"][REQUEST TIMEOUT] request had been abort since didn't finished within").concat(t.timeout/1e3,"s"),auth:t.auth};this.requestClient=new l.Platform.adapter.reqClass(a),this.cloudbaseConfig=r(r(r({},E),t),{i18n:(0,f.i18nProxy)(l.Platform,t)}),delete this.cloudbaseConfig.lang,this.cloudbaseConfig.timeout=this.formatTimeout(this.cloudbaseConfig.timeout);var s=this.cloudbaseConfig,c=s.env,u=s.persistence,m=s.debug,v=s.timeout,g=s.oauthClient,b=s.i18n;(0,p.initCache)({env:c,persistence:u,debug:m,platformInfo:this.platform}),(0,h.setRegionLevelEndpoint)(c,t.region||""),(0,h.setGatewayEndPointWithEnv)(c,h.DEFAULT_PROTOCOL,t.intl);var _=new e(this.cloudbaseConfig);return(0,d.initRequest)({env:c,region:t.region||"",timeout:v,oauthClient:g,_fromApp:_,i18n:b,endPointMode:t.endPointMode,auth:t.auth}),_.requestClient=this.requestClient,null===(n=null==this?void 0:this.fire)||void 0===n||n.call(this,"cloudbase_init",_),this.try2InitAuth(_),(null===(o=l.Platform.adapter)||void 0===o?void 0:o.nodeTool)&&(null===(i=l.Platform.adapter)||void 0===i||i.nodeTool(_,this.cloudbaseConfig)),_},e.prototype.updateConfig=function(e){var t=e.persistence,n=e.debug;this.cloudbaseConfig.persistence=t,this.cloudbaseConfig.debug=n,(0,p.initCache)({env:this.cloudbaseConfig.env,persistence:t,debug:n,platformInfo:this.platform})},e.prototype.updateLang=function(e){var t;e&&e!==(null===(t=this.cloudbaseConfig.i18n)||void 0===t?void 0:t.lang)&&(this.cloudbaseConfig.i18n.lang=e)},e.prototype.registerExtension=function(e){S[e.name]=e},e.prototype.invokeExtension=function(e,t){return a(this,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:if(!(n=S[e]))throw new Error(JSON.stringify({code:y.INVALID_PARAMS,msg:"extension:".concat(e," must be registered before invoke")}));return[4,n.invoke(t,this)];case 1:return[2,r.sent()]}}))}))},e.prototype.useAdapters=function(e,t){var n=g(e,t)||{},r=n.adapter,o=n.runtime;r&&(l.Platform.adapter=r),o&&(l.Platform.runtime=o)},e.prototype.registerHook=function(t){(0,u.registerHook)(e,t)},e.prototype.registerComponent=function(t){(0,u.registerComponent)(e,t)},e.prototype.registerVersion=function(e){(0,h.setSdkVersion)(e),this.version=e},e.prototype.registerSdkName=function(e){(0,h.setSdkName)(e)},e.prototype.isInitialized=function(e){return void 0===e&&(e=this.cloudbaseConfig),["your-env-id","your-envid","your_env_id","xxx-yyy","xxxx-yyy","envId","env-id","your-environment-id","REPLACE_ME"].some((function(t){return e.env.toLowerCase()===t.toLowerCase()}))&&x(y.INVALID_PARAMS,'[CloudBase] 检测到环境 ID "'.concat(e.env,'" 可能是占位符,请替换为真实的环境 ID。\n')+" 获取方式:登录腾讯云开发平台 → 环境管理 → 环境设置 → 环境 ID\n 建议通过环境变量配置:process.env.CLOUDBASE_ENV 或 import.meta.env.VITE_CLOUDBASE_ENV"),!!(null==e?void 0:e.env)},e.prototype.registerEndPoint=function(e,t){(0,h.setEndPointInfo)({baseUrl:e,protocol:t,env:this.config.env,endPointKey:"CLOUD_API"})},e.prototype.registerEndPointWithKey=function(e){(0,h.setEndPointInfo)({env:this.config.env,endPointKey:e.key,baseUrl:e.url,protocol:e.protocol})},e.prototype.registerHost=function(e,t){void 0===t&&(t="http");var n=e.replace(/^(https?:)?\/\//,""),r="//".concat(n);(0,h.setEndPointInfo)({baseUrl:"".concat(r,"/web"),protocol:t,env:this.config.env,endPointKey:"CLOUD_API"}),(0,h.setEndPointInfo)({baseUrl:"".concat(r,"/v1"),protocol:t,env:this.config.env,endPointKey:"GATEWAY"})},e.prototype.getEndPointWithKey=function(e){var t=(0,h.getEndPointInfo)(this.config.env,e);return{BASE_URL:t.baseUrl,PROTOCOL:t.protocol}},e.prototype.parseCaptcha=function(e){return c.utils.parseCaptcha(e)},e.prototype.useDefaultAdapter=function(){var e=b.bind(this)(),t=e.adapter,n=e.runtime;l.Platform.adapter=t,l.Platform.runtime=n},e.prototype.formatTimeout=function(e){switch(!0){case e>I:return x(y.INVALID_PARAMS,"timeout is greater than maximum value[10min]"),I;case e<100:return x(y.INVALID_PARAMS,"timeout is less than maximum value[100ms]"),100;default:return e}},e.prototype.try2InitAuth=function(e){try{e.auth()}catch(e){console.log("try2InitAuth error:",e)}},e.prototype.dealNodeAdapterConfig=function(e){var t,n;if("undefined"!=typeof process&&void 0!=={IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}&&(null===(t=l.Platform.adapter)||void 0===t?void 0:t.getSecretInfo)){var o=null===(n=l.Platform.adapter)||void 0===n?void 0:n.getSecretInfo(e);e.auth=r(r({},e.auth),{secretId:o.secretId,secretKey:o.secretKey,sessionToken:o.sessionToken,secretType:o.secretType}),e.env||(e.env=o.env),!e.accessKey&&o.accessKey&&(e.accessKey=o.accessKey)}return e},o([w({mode:"sync",title:"Cloudbase 初始化失败",messages:["请确认以下各项:"," 1 - 调用 cloudbase.init() 的语法或参数是否正确"," 2 - 如果是非浏览器环境,是否配置了安全应用来源(https://docs.cloudbase.net/api-reference/webv3/adapter#%E7%AC%AC-2-%E6%AD%A5%E9%85%8D%E7%BD%AE%E5%AE%89%E5%85%A8%E5%BA%94%E7%94%A8%E6%9D%A5%E6%BA%90)","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(_)]}),i("design:type",Function),i("design:paramtypes",[Object]),i("design:returntype",e)],e.prototype,"init",null),o([w({title:"调用扩展能力失败",messages:["请确认以下各项:"," 1 - 调用 invokeExtension() 的语法或参数是否正确"," 2 - 被调用的扩展能力是否已经安装并通过 registerExtension() 注册","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(_)]}),i("design:type",Function),i("design:paramtypes",[String,Object]),i("design:returntype",Promise)],e.prototype,"invokeExtension",null),e}();t.cloudbase=new O;var T=(0,l.getWxDefaultAdapter)();T&&t.cloudbase.useAdapters(T),t.default=t.cloudbase},1197:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SECRET_TYPE=t.checkCustomUserIdRegex=t.CLIENT_AUTH_PATH=t.ADMIN_PATH=t.ERROR=void 0,t.ERROR={INVALID_PARAM:{code:"INVALID_PARAM",message:"invalid param"},SYS_ERR:{code:"SYS_ERR",message:"system error"},STORAGE_REQUEST_FAIL:{code:"STORAGE_REQUEST_FAIL",message:"storage request fail"},STORAGE_FILE_NONEXIST:{code:"STORAGE_FILE_NONEXIST",message:"storage file not exist"},TCB_CLS_UNOPEN:{code:"TCB_CLS_UNOPEN",message:"需要先开通日志检索功能"},INVALID_CONTEXT:{code:"INVALID_CONTEXT",message:"无效的context对象,请使用 云函数入口的context参数"}},t.ADMIN_PATH="/admin",t.CLIENT_AUTH_PATH="/auth/v1/token/clientCredential",t.checkCustomUserIdRegex=/^[a-zA-Z0-9_\-#@~=*(){}[\]:.,<>+]{4,32}$/,(n=t.SECRET_TYPE||(t.SECRET_TYPE={})).SECRET="SECRET",n.SESSION_SECRET="SESSION_SECRET"},9094:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getSecretInfo=t.INIT_CONFIG=t.getServerInjectUrl=t.getTcbContextConfig=t.getCloudbaseContext=t.parseContext=void 0;var o=n(1197),i=n(4353);function a(e){if("object"!=typeof e)throw r(r({},o.ERROR.INVALID_CONTEXT),{message:"context 必须为对象类型"});var t={},n=e.memory_limit_in_mb,i=e.time_limit_in_ms,a=e.request_id,s=e.function_version,c=e.namespace,u=e.function_name,l=e.environ,p=e.environment;try{if(t.memoryLimitInMb=n,t.timeLimitIns=i,t.requestId=a,t.functionVersion=s,t.namespace=c,t.functionName=u,p)t.environment=JSON.parse(p);else{var d=null==l?void 0:l.split(";"),h={};for(var f in d)if(d[f].includes("=")){var m=d[f].indexOf("="),v=d[f].slice(0,m),g=d[f].slice(m+1);g.indexOf(",")>=0&&(g=g.split(",")),h[v]=g}t.environ=h}}catch(e){throw r({},o.ERROR.INVALID_CONTEXT)}return t}function s(){try{var e=(0,t.getCloudbaseContext)().TCB_CONTEXT_CNFG;return e?JSON.parse(e):{}}catch(e){return console.error("[TCB][ERROR] parse context error: ",e),{}}}t.parseContext=a,t.getCloudbaseContext=function(e){(0,i.checkIsInScf)()&&((0,i.getEnv)("TENCENTCLOUD_REGION")||console.error("[TCB][ERROR] missing `TENCENTCLOUD_REGION` environment"),(0,i.getEnv)("SCF_NAMESPACE")||console.error("[TCB][ERROR] missing `SCF_NAMESPACE` environment"));var t=(0,i.getEnv)(),n={TRIGGER_SRC:t.TRIGGER_SRC,_SCF_TCB_LOG:t._SCF_TCB_LOG,SCF_NAMESPACE:t.SCF_NAMESPACE,TENCENTCLOUD_RUNENV:t.TENCENTCLOUD_RUNENV,TENCENTCLOUD_SECRETID:t.TENCENTCLOUD_SECRETID,TENCENTCLOUD_SECRETKEY:t.TENCENTCLOUD_SECRETKEY,TENCENTCLOUD_SESSIONTOKEN:t.TENCENTCLOUD_SESSIONTOKEN,WX_CONTEXT_KEYS:t.WX_CONTEXT_KEYS,WX_TRIGGER_API_TOKEN_V0:t.WX_TRIGGER_API_TOKEN_V0,WX_CLIENTIP:t.WX_CLIENTIP,WX_CLIENTIPV6:t.WX_CLIENTIPV6,TCB_CONTEXT_KEYS:t.TCB_CONTEXT_KEYS,TCB_CONTEXT_CNFG:t.TCB_CONTEXT_CNFG,LOGINTYPE:t.LOGINTYPE},o={};if(e){var s=a(e),c=s.environment,u=s.environ;o=c||u||{}}for(var l=0,p=[o.TCB_CONTEXT_KEYS||t.TCB_CONTEXT_KEYS,o.WX_CONTEXT_KEYS||t.WX_CONTEXT_KEYS];l<p.length;l++){var d=p[l];if(d)try{for(var h=0,f=d.split(",");h<f.length;h++){var m=f[h];n[m]=o[m]||(0,i.getEnv)(m)}}catch(e){}}var v=r(r({},n),o);return Object.fromEntries(Object.entries(v).filter((function(e){return void 0!==e[1]})))},t.getTcbContextConfig=s,t.getServerInjectUrl=function(){return s().URL||""},t.INIT_CONFIG={},t.getSecretInfo=function(e){var n,a,s,c,u;t.INIT_CONFIG=JSON.parse(JSON.stringify(e||t.INIT_CONFIG));var l=(0,i.getEnv)(),p=l.TCB_ENV,d=l.SCF_NAMESPACE,h=l.TENCENTCLOUD_RUNENV,f=l.TENCENTCLOUD_SECRETID,m=l.TENCENTCLOUD_SECRETKEY,v=l.TENCENTCLOUD_SESSIONTOKEN,g=l.CLOUDBASE_APIKEY,b=r(r({},t.INIT_CONFIG),e),y="";"local"===(y="symbol"!=typeof(null==e?void 0:e.env)&&(null==e?void 0:e.env)?e.env:p||d||"")&&"WX_LOCAL_SCF"===h&&(y="");var _={env:y,secretId:"",secretKey:"",sessionToken:"",accessKey:"",secretType:"",credentials:void 0,context:void 0};if((null==b?void 0:b.context)&&(_.context=b.context),(null==b?void 0:b.credentials)&&(_.credentials=b.credentials),(null==e?void 0:e.accessKey)||(null==b?void 0:b.accessKey))return _.accessKey=(null==e?void 0:e.accessKey)||(null==b?void 0:b.accessKey),_;if((null==b?void 0:b.secretId)&&(null==b?void 0:b.secretKey))return r(r({},_),{secretId:b.secretId,secretKey:b.secretKey,sessionToken:v||"",secretType:b.sessionToken?o.SECRET_TYPE.SESSION_SECRET:o.SECRET_TYPE.SECRET});if((null===(n=null==e?void 0:e.auth)||void 0===n?void 0:n.secretId)&&(null===(a=null==e?void 0:e.auth)||void 0===a?void 0:a.secretKey))return r(r({},_),{secretId:e.auth.secretId,secretKey:e.auth.secretKey,sessionToken:v||"",secretType:e.auth.secretType||o.SECRET_TYPE.SECRET});if(g)return r(r({},_),{accessKey:g});if(f&&m)return r(r({},_),{secretId:f,secretKey:m,sessionToken:v||"",secretType:o.SECRET_TYPE.SESSION_SECRET});var x=(null==b?void 0:b.context)||(null==e?void 0:e.context);if(null==x?void 0:x.extendedContext){var w=x.extendedContext;return y||(y=w.envId||""),r(r({},_),{env:y,secretId:(null===(s=null==w?void 0:w.tmpSecret)||void 0===s?void 0:s.secretId)||"",secretKey:(null===(c=null==w?void 0:w.tmpSecret)||void 0===c?void 0:c.secretKey)||"",sessionToken:(null===(u=null==w?void 0:w.tmpSecret)||void 0===u?void 0:u.token)||""})}return r({},_)}},2293:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.getWxOptions=t.wxCallContainerApi=t.callWxPayApi=t.callCompatibleWxOpenApi=t.callWxOpenApi=t.sendWxFormDataRequest=t.sendWxRequest=t.buildAdminUrl=t.getWxCloudToken=t.getTcbContextConfig=t.getServerInjectUrl=t.getSecretInfo=t.parseContext=t.getCloudbaseContext=t.setThrowOnCode=t.processReturn=t.filterUndefined=t.filterValue=t.isPageModuleName=t.isValidEnvFormat=t.SYMBOL_DEFAULT_ENV=t.SYMBOL_CURRENT_ENV=t.TcbError=t.E=t.createWebStreamFromNodeReadableStream=t.parseQueryString=t.NodeRequest=void 0;var i=n(2764),a=n(9768),s=n(5434),c=n(9094),u=n(4353),l=null;function p(){if(!l)try{l=n(6850)}catch(e){console.error("缺少依赖 ws,请执行以下命令安装:\n\n npm install ws\n\n该依赖用于 Node 环境下的 WebSocket 连接。")}return l}var d=n(9768);Object.defineProperty(t,"NodeRequest",{enumerable:!0,get:function(){return d.NodeRequest}});var h=n(4353);Object.defineProperty(t,"parseQueryString",{enumerable:!0,get:function(){return h.parseQueryString}}),Object.defineProperty(t,"createWebStreamFromNodeReadableStream",{enumerable:!0,get:function(){return h.createWebStreamFromNodeReadableStream}}),Object.defineProperty(t,"E",{enumerable:!0,get:function(){return h.E}}),Object.defineProperty(t,"TcbError",{enumerable:!0,get:function(){return h.TcbError}}),Object.defineProperty(t,"SYMBOL_CURRENT_ENV",{enumerable:!0,get:function(){return h.SYMBOL_CURRENT_ENV}}),Object.defineProperty(t,"SYMBOL_DEFAULT_ENV",{enumerable:!0,get:function(){return h.SYMBOL_DEFAULT_ENV}}),Object.defineProperty(t,"isValidEnvFormat",{enumerable:!0,get:function(){return h.isValidEnvFormat}}),Object.defineProperty(t,"isPageModuleName",{enumerable:!0,get:function(){return h.isPageModuleName}}),Object.defineProperty(t,"filterValue",{enumerable:!0,get:function(){return h.filterValue}}),Object.defineProperty(t,"filterUndefined",{enumerable:!0,get:function(){return h.filterUndefined}}),Object.defineProperty(t,"processReturn",{enumerable:!0,get:function(){return h.processReturn}}),Object.defineProperty(t,"setThrowOnCode",{enumerable:!0,get:function(){return h.setThrowOnCode}});var f=n(9094);Object.defineProperty(t,"getCloudbaseContext",{enumerable:!0,get:function(){return f.getCloudbaseContext}}),Object.defineProperty(t,"parseContext",{enumerable:!0,get:function(){return f.parseContext}}),Object.defineProperty(t,"getSecretInfo",{enumerable:!0,get:function(){return f.getSecretInfo}}),Object.defineProperty(t,"getServerInjectUrl",{enumerable:!0,get:function(){return f.getServerInjectUrl}}),Object.defineProperty(t,"getTcbContextConfig",{enumerable:!0,get:function(){return f.getTcbContextConfig}});var m=n(6480);Object.defineProperty(t,"getWxCloudToken",{enumerable:!0,get:function(){return m.getWxCloudToken}}),Object.defineProperty(t,"buildAdminUrl",{enumerable:!0,get:function(){return m.buildAdminUrl}}),Object.defineProperty(t,"sendWxRequest",{enumerable:!0,get:function(){return m.sendWxRequest}}),Object.defineProperty(t,"sendWxFormDataRequest",{enumerable:!0,get:function(){return m.sendWxFormDataRequest}}),Object.defineProperty(t,"callWxOpenApi",{enumerable:!0,get:function(){return m.callWxOpenApi}}),Object.defineProperty(t,"callCompatibleWxOpenApi",{enumerable:!0,get:function(){return m.callCompatibleWxOpenApi}}),Object.defineProperty(t,"callWxPayApi",{enumerable:!0,get:function(){return m.callWxPayApi}}),Object.defineProperty(t,"wxCallContainerApi",{enumerable:!0,get:function(){return m.wxCallContainerApi}}),Object.defineProperty(t,"getWxOptions",{enumerable:!0,get:function(){return m.getWxOptions}});var v,g=(v=new Map,{mode:"sync",setItem:function(e,t){v.set(e,t)},getItem:function(e){return v.get(e)},removeItem:function(e){v.delete(e)},clear:function(){v.clear()}}),b={genAdapter:function(e){return{nodeTool:s.nodeTool,getSecretInfo:c.getSecretInfo,root:{globalThis:{}},reqClass:a.NodeRequest,wsClass:p(),sessionStorage:g,localStorage:g,primaryStorage:i.StorageType.session,captchaOptions:{openURIWithCallback:function(t){var n=e.EventBus,i={},a=t,s=t.match(/^(data:.*?)(\?[^#\s]*)?$/);if(s){a=s[1];var c=s[2];c&&(i=(0,u.parseQueryString)(c))}var l=i.token,p=o(i,["token"]);return/^data:/.test(a)&&!l?Promise.reject({error:"invalid_argument",error_description:"invalie captcha data: ".concat(t)}):l?new Promise((function(e){n.$emit("CAPTCHA_DATA_CHANGE",r(r({},p),{token:l,url:a})),n.$once("RESOLVE_CAPTCHA_DATA",(function(t){e(t)}))})):Promise.reject({error:"unimplemented",error_description:"need to impl captcha data"})}}}},isMatch:function(){return"undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node},runtime:"node-adapter"};t.default=b},1651:function(e,t){"use strict";var n,r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};function i(e){return/^[1-9][0-9]{4,64}$/gim.test(e)}function a(e,i){return void 0===i&&(i={}),r(this,void 0,Promise,(function(){var r,a,s,c;return o(this,(function(o){switch(o.label){case 0:r="".concat(t.kMetadataBaseUrl,"/").concat(n.latest,"/").concat(e),a=new AbortController,i.timeout&&(s=setTimeout((function(){return a.abort()}),i.timeout)),o.label=1;case 1:return o.trys.push([1,,5,6]),[4,fetch(r,{signal:a.signal})];case 2:return 200!==(c=o.sent()).status?[3,4]:[4,c.text()];case 3:return[2,o.sent()];case 4:throw new Error("[ERROR] GET ".concat(r," status: ").concat(c.status));case 5:return s&&clearTimeout(s),[7];case 6:return[2]}}))}))}Object.defineProperty(t,"__esModule",{value:!0}),t.lookupCredentials=t.lookupAppId=t.lookup=t.isAppId=t.kMetadataVersions=t.kSecurityCredentialsPath=t.kAppIdPath=t.kMetadataBaseUrl=void 0,t.kMetadataBaseUrl="http://metadata.tencentyun.com",t.kAppIdPath="meta-data/app-id",t.kSecurityCredentialsPath="meta-data/cam/security-credentials",function(e){e.v20170919="2017-09-19",e["v1.0"]="1.0",e.latest="latest"}(n=t.kMetadataVersions||(t.kMetadataVersions={})),t.isAppId=i,t.lookup=a;var s={appId:void 0};t.lookupAppId=function(){return r(this,void 0,Promise,(function(){var e;return o(this,(function(n){switch(n.label){case 0:if(void 0!==s.appId)return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,a(t.kAppIdPath,{timeout:30})];case 2:return i(e=n.sent())?s.appId=e:s.appId="",[3,4];case 3:return n.sent(),[3,4];case 4:return[2,s.appId||""]}}))}))},t.lookupCredentials=function(e){return r(this,void 0,Promise,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,a("".concat(t.kSecurityCredentialsPath,"/").concat(e),{timeout:200})];case 1:return[2,n.sent()]}}))}))}},9768:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeRequest=void 0;var u=a(n(7147)),l=a(n(1017)),p=n(2764),d=n(1197),h=n(9094),f=n(4353),m=n(7922),v=null;function g(){return s(this,void 0,void 0,(function(){var e;return c(this,(function(t){switch(t.label){case 0:if(v)return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Promise.resolve().then(n.t.bind(n,8899,23))];case 2:return e=t.sent(),v=e.sign,[3,4];case 3:return t.sent(),console.error("缺少依赖 @cloudbase/signature-nodejs,请执行以下命令安装:\n\n npm install @cloudbase/signature-nodejs\n\n该依赖用于 Node 环境下的请求签名。"),[3,4];case 4:return[2,v]}}))}))}var b=function(){function e(e){var t=this;this.getReqOptions=function(e,n){return s(t,void 0,void 0,(function(){var t,o,i,a,s,u,l,p,v,b,y,_,x,w,E,I,S,O,T,A,P,C,R,N,k,j,D,U,L,M,q,B,F,W,V;return c(this,(function(c){switch(c.label){case 0:return t=new URL(e),o=(0,h.getCloudbaseContext)().TCB_SOURCE,s=(a="".concat((null===(L=null===(U=h.INIT_CONFIG.context)||void 0===U?void 0:U.extendedContext)||void 0===L?void 0:L.source)||o||"",",")).concat,[4,(0,f.getCurrRunEnvTag)()];case 1:return i=s.apply(a,[c.sent()]),n.headers=r(r({},n.headers),{"User-Agent":"adapter-node/".concat((null===(M=n.headers)||void 0===M?void 0:M["X-SDK-Version"])||"@cloudbase/js-sdk/".concat((0,m.getSdkVersion)())),"X-TCB-Source":i,"X-Client-Timestamp":(new Date).valueOf(),"X-TCB-Region":h.INIT_CONFIG.region||(0,f.getEnv)("TENCENTCLOUD_REGION")||"",Host:t.host}),!1===n.withCredentials||(null===(B=null===(q=n.headers.Authorization)||void 0===q?void 0:q.replace("Bearer",""))||void 0===B?void 0:B.trim())||t.pathname.startsWith("/auth/")&&t.pathname!==d.CLIENT_AUTH_PATH?[2,n]:(u=t.pathname===d.ADMIN_PATH,["/v1/model/","/v1/rdb/","/v1/ai/"].some((function(e){return t.pathname.startsWith(e)}))?[4,this.getClientCredential({origin:t.origin})]:[3,3]);case 2:return l=c.sent(),n.headers.Authorization="Bearer ".concat(l),[2,n];case 3:return p=(null===(F=this.config)||void 0===F?void 0:F.auth)||{},v=p.secretId,b=p.secretKey,y=p.sessionToken,_=((null===(W=this.config)||void 0===W?void 0:W.auth)||{}).secretType,x=n.method,w=n.body,E=JSON.parse(JSON.stringify(n.headers)),I=this.isNpmFormData(w),(S=I?w.__plainObj?r({},w.__plainObj):{}:"object"==typeof w?w:(0,f.safeParseJson)(w)||{}).envName=(null==S?void 0:S.env)||this.config.env||(null===(V=(0,h.getSecretInfo)())||void 0===V?void 0:V.env)||"",S.access_token?[2,n]:("get"===x.toLowerCase()&&(S=void 0),v&&b&&"SESSION_SECRET"!==_||(O=(0,h.getSecretInfo)(),v=O.secretId,b=O.secretKey,y=O.sessionToken),v&&b?(delete E.Authorization,E["content-type"]?E["content-type"]=E["content-type"].toLowerCase():E["Content-Type"]&&(E["Content-Type"]=E["Content-Type"].toLowerCase()),u&&y&&(S.sessionToken=y),T={secretId:v,secretKey:b,method:x,url:e,params:S,headers:E,withSignedParams:u,timestamp:Math.floor((new Date).getTime()/1e3)-1,isCloudApi:!u},E["content-type"]||E["Content-Type"]?[4,g()]:[2,n]):[2,n]);case 4:return(A=c.sent())?(P=A(T),C=P.authorization,R=P.timestamp,"string"==typeof y&&""!==y?u?(E.Authorization="".concat(C),E["X-Timestamp"]=R,E["X-Signature-Expires"]=600):E.Authorization="".concat(C,", Timestamp=").concat(R,", Token=").concat(y):(E.Authorization="".concat(C,", Timestamp=").concat(R),u&&(E["X-Timestamp"]=R,E["X-Signature-Expires"]=600)),I?(N=w,k=new Set(Object.keys(N.__plainObj||{})),S.envName&&!k.has("envName")&&N.append("envName",S.envName),S.sessionToken&&!k.has("sessionToken")&&N.append("sessionToken",S.sessionToken),j=N.getBuffer(),D=N.getHeaders(),[2,r(r({},n),{headers:r(r(r({},E),D),{"content-length":String(j.length)}),body:j})]):[2,r(r({},n),{headers:E,body:"object"==typeof S?JSON.stringify(S):S})]):[2,n]}}))}))},this.get=function(e){return t.request(r(r({},e),{method:"get"}),t.restrictedMethods.includes("get"))},this.post=function(e){return t.request(r(r({},e),{method:"post"}),t.restrictedMethods.includes("post"))},this.put=function(e){return t.request(r(r({},e),{method:"put"}))},this.upload=function(e){var n,o=e,i=o.data,a=o.file,s=o.fileContent,c=o.name,u=o.method,l=o.headers,p=void 0===l?{}:l,d=null!=a?a:s;if(void 0===d||void 0===c)throw new Error("file and name is required");var h=(0,f.obj2StrRecord)(null!=i?i:{}),m=null==u?void 0:u.toLowerCase(),v=null!==(n=["post","put"].find((function(e){return e===m})))&&void 0!==n?n:"put",g=new FormData;return"post"===v?(Object.keys(h).forEach((function(e){g.append(e,h[e])})),g.append("key",c),g.append("file",d instanceof Blob?d:new Blob([d])),t.request(r(r({},e),{data:g,method:v}),t.restrictedMethods.includes("upload"))):t.request(r(r({},e),{method:"put",headers:p,body:d}),t.restrictedMethods.includes("upload"))},this.download=function(e){return s(t,void 0,Promise,(function(){var t,n,r,o,i;return c(this,(function(a){switch(a.label){case 0:return[4,fetch(e.url,{headers:{},signal:AbortSignal.timeout(this.timeout)})];case 1:if(!(t=a.sent()).ok)throw new Error("Download failed with status ".concat(t.status));return[4,t.arrayBuffer()];case 2:return n=a.sent(),r=Buffer.from(n),(o=e.tempFilePath)?(i=l.dirname(o),u.existsSync(i)||u.mkdirSync(i,{recursive:!0}),u.writeFileSync(o,r),[2,{statusCode:200,tempFilePath:o}]):[2,{statusCode:200,tempFilePath:e.url,fileContent:r}]}}))}))},this.fetch=function(e){return s(t,void 0,Promise,(function(){var t,n,o,i,a,s,u,l,p,d,h,m,v,g,b,y;return c(this,(function(c){switch(c.label){case 0:return t=e.enableAbort,n=void 0!==t&&t,o=e.stream,i=void 0!==o&&o,a=e.signal,s=e.customReqOpts,u=this.getRealUrl(e.url,e.headers||{},e.body),l=(null==s?void 0:s.timeout)||this.timeout,p=this.createAbortController(l,n,a),d=p[0],h=p[1],m=e.headers?(0,f.headersInit2Indexable)(e.headers):void 0,[4,this.getReqOptions(u,r(r({},e),{headers:m,body:e.body,signal:d.signal}))];case 1:v=c.sent(),this.applyDuplexIfNeeded(v),c.label=2;case 2:return c.trys.push([2,,8,9]),[4,fetch(u,v)];case 3:return g=c.sent(),b=void 0,204!=+g.status?[3,4]:(b="",[3,7]);case 4:return i?(b=g.body,[3,7]):[3,5];case 5:return y=f.safeParseJson,[4,g.text()];case 6:b=y.apply(void 0,[c.sent()]),c.label=7;case 7:return[2,{data:b,statusCode:g.status,header:g.headers,response:g}];case 8:return h(),[7];case 9:return[2]}}))}))},this.request=function(e,n){return void 0===n&&(n=!1),s(t,void 0,Promise,(function(){var t,r,o,i,a,s,u,l,d,h,m,v,g,b,y,_,x,w,E,I,S,O,T,A,P,C,R,N,k,j,D,U,L;return c(this,(function(c){switch(c.label){case 0:return t=e.url,r=e.headers,o=void 0===r?{}:r,i=e.data,a=e.responseType,s=e.withCredentials,u=e.body,l=e.method,d=e.customReqOpts,h=(0,f.obj2StrRecord)(o),m=String(l).toLowerCase()||"get",v=(null==d?void 0:d.timeout)||this.timeout,g=e.signal,b=this.createAbortController(v,n,g),y=b[0],_=b[1],x=(0,f.isFormData)(i)?i:"application/x-www-form-urlencoded"===h["content-type"]?(0,f.toQueryString)(null!=i?i:{}):u||(i?JSON.stringify(i):void 0),w=this.getRealUrl((0,p.formatUrl)("https",null!=t?t:"","get"===m?i:{}),e.headers||{},x),[4,this.getReqOptions(w,{method:m,headers:h,body:x,credentials:s?"include":"same-origin",signal:y.signal})];case 1:E=c.sent(),this.applyDuplexIfNeeded(E),c.label=2;case 2:return c.trys.push([2,,19,20]),[4,fetch(w,E)];case 3:I=c.sent(),S={header:{},statusCode:I.status},c.label=4;case 4:return c.trys.push([4,11,,18]),"blob"!==a?[3,6]:(O=S,[4,I.blob()]);case 5:return O.data=c.sent(),[3,10];case 6:return"buffer"!==a?[3,8]:(T=S,P=(A=Buffer).from,[4,I.arrayBuffer()]);case 7:return T.data=P.apply(A,[c.sent()]),[3,10];case 8:return C=S,R=f.safeParseJson,[4,I.text()];case 9:C.data=R.apply(void 0,[c.sent()]),c.label=10;case 10:return[3,18];case 11:return N=c.sent(),console.log("catch an error",N),"blob"!==a?[3,13]:(k=S,[4,I.blob()]);case 12:return k.data=c.sent(),[3,17];case 13:return"buffer"!==a?[3,15]:(j=S,U=(D=Buffer).from,[4,I.arrayBuffer()]);case 14:return j.data=U.apply(D,[c.sent()]),[3,17];case 15:return L=S,[4,I.text()];case 16:L.data=c.sent(),c.label=17;case 17:return[3,18];case 18:return I.headers.forEach((function(e,t){return S.header[t.toLowerCase()]=e})),[2,S];case 19:return _(),[7];case 20:return[2]}}))}))};var n=e.timeout,o=e.restrictedMethods;this.timeout=n||15e3,this.restrictedMethods=o||["get","post","upload","download"],this.config=e}return e.prototype.getClientCredential=function(e){var t;return s(this,void 0,Promise,(function(){var n;return c(this,(function(r){switch(r.label){case 0:return[4,this.fetch({url:"".concat(e.origin).concat(d.CLIENT_AUTH_PATH),method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials"})})];case 1:return n=r.sent(),[2,null===(t=n.data)||void 0===t?void 0:t.access_token]}}))}))},e.prototype.getRealUrl=function(e,t,n){var r,o,i,a;if(null===(o=null===(r=t.Authorization)||void 0===r?void 0:r.replace("Bearer",""))||void 0===o?void 0:o.trim())return e;if(("object"==typeof n?n:(0,f.safeParseJson)(n)||"").access_token)return e;var s=new URL(e);return"/web"===s.pathname&&(null===(i=this.config.auth)||void 0===i?void 0:i.secretId)&&(null===(a=this.config.auth)||void 0===a?void 0:a.secretKey)&&(s.pathname=d.ADMIN_PATH),s.toString()},e.prototype.createAbortController=function(e,t,n){var r,o=new AbortController;return n&&(n.aborted?o.abort():n.addEventListener("abort",(function(){return o.abort()}),{once:!0})),(t||e)&&(r=setTimeout((function(){var t="请求在".concat(e/1e3,"s内未完成,已中断");console.warn(t),o.abort(new Error(t))}),e)),[o,function(){return clearTimeout(r)}]},e.prototype.applyDuplexIfNeeded=function(e){var t;e.body&&"function"==typeof(null===(t=e.body)||void 0===t?void 0:t.pipe)&&(e.duplex="half")},e.prototype.isNpmFormData=function(e){return e&&"object"==typeof e&&"function"==typeof e.getHeaders&&"function"==typeof e.getBuffer},e}();t.NodeRequest=b},5434:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.nodeTool=void 0;var a=n(1197),s=n(9094),c=n(4353),u=n(6480),l=null;function p(){var e;return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:if(l)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Promise.resolve().then(n.t.bind(n,156,23))];case 2:return t=r.sent(),l=(null===(e=t.default)||void 0===e?void 0:e.sign)||t.sign,[3,4];case 3:return r.sent(),console.error("缺少依赖 jsonwebtoken,请执行以下命令安装:\n\n npm install jsonwebtoken\n\n该依赖用于 Node 环境下的自定义登录票据生成。"),[3,4];case 4:return[2,l]}}))}))}function d(){var e=(0,s.getCloudbaseContext)();return{openId:e.WX_OPENID||"",appId:e.WX_APPID||"",uid:e.TCB_UUID||"",customUserId:e.TCB_CUSTOM_USER_ID||"",isAnonymous:"true"===e.TCB_ISANONYMOUS_USER}}function h(e,t){var n,r;return null===(r=null===(n=null==e?void 0:e.request)||void 0===n?void 0:n.send)||void 0===r?void 0:r.call(n,"auth.getUserInfoForAdmin",t,{pathname:"web",endPointMode:"CLOUD_API"})}var f=null;t.nodeTool=function(e,t){var n=t;if(e.parseContext=function(e){var t=(0,s.parseContext)(e);return f=t,t},e.getCloudbaseContext=function(e){return(0,s.getCloudbaseContext)(e)},e.auth){var l={getUserInfo:function(){return d()},getEndUserInfo:function(n){return o(this,void 0,Promise,(function(){var o;return i(this,(function(i){return o=d(),void 0===n?[2,{userInfo:o}]:((0,c.validateUid)(n),[2,h(e,{uuid:n,envName:t.env}).then((function(e){return e.code?e:{userInfo:r(r({},o),e.data),requestId:e.requestId}}))])}))}))},createTicket:function(e,n){return void 0===n&&(n={}),o(this,void 0,Promise,(function(){var o,s,u,l,d,h,f,m,v;return i(this,(function(i){switch(i.label){case 0:if((0,c.validateUid)(e),o=(new Date).getTime(),s=(t.auth||{}).credentials,!(u=t.env))throw r(r({},a.ERROR.INVALID_PARAM),{message:"no env in config"});if(!(null==s?void 0:s.env_id))throw r(r({},a.ERROR.INVALID_PARAM),{message:"当前私钥未包含env_id 信息, 请前往腾讯云云开发控制台,获取自定义登录最新私钥"});if(s.env_id!==u)throw r(r({},a.ERROR.INVALID_PARAM),{message:"当前私钥所属环境与 init 指定环境不一致!"});return l=n.refresh,d=void 0===l?36e5:l,h=n.expire,f=void 0===h?o+6048e5:h,[4,p()];case 1:return m=i.sent(),v=m({alg:"RS256",env:u,iat:o,exp:o+6e5,uid:e,refresh:d,expire:f},s.private_key,{allowInsecureKeySizes:!0,algorithm:"RS256"}),[2,"".concat(s.private_key_id,"/@@/").concat(v)]}}))}))},queryUserInfo:function(n){return o(this,void 0,Promise,(function(){var o,a,s;return i(this,(function(i){return o=n.uid,a=n.platform,s=n.platformId,[2,h(e,{uuid:o,platform:a,platformId:s,envName:t.env}).then((function(e){return e.code?e:{userInfo:r({},e.data),requestId:e.requestId}}))]}))}))},getClientIP:function(){return(0,s.getCloudbaseContext)().TCB_SOURCE_IP||""},getAuthContext:function(e){var t=(0,s.getCloudbaseContext)(e),n=t.TCB_UUID,r=t.LOGINTYPE,o=t.QQ_OPENID,i=t.QQ_APPID,a={uid:n,loginType:r};return"QQ-MINI"===r&&(a.appId=i,a.openId=o),a},getClientCredential:function(r){return o(this,void 0,void 0,(function(){var o;return i(this,(function(i){switch(i.label){case 0:return n.accessKey||t.accessKey?[2,n.accessKey||t.accessKey]:(o=e.request.getBaseEndPoint("GATEWAY"),[4,e.request.post({url:"".concat(o).concat("/auth/v1/token/clientCredential"),data:{grant_type:"client_credentials"},headers:{"content-type":"application/json"}},r?{timeout:r.timeout}:void 0)]);case 1:return[2,i.sent().data]}}))}))}},m=e.auth;Object.keys(l).forEach((function(e){m[e]=l[e]})),e.auth=new Proxy(m,{apply:function(e,t,n){var r=Reflect.apply(e,t,n);return r&&"object"==typeof r&&Object.keys(l).forEach((function(e){e in r||(r[e]=l[e])})),r}})}function v(){var t=n.serviceUrl||(0,s.getServerInjectUrl)()||void 0;return(0,u.getWxOptions)(n,f,t||"",e.request)}e.sendTemplateNotification=function(t,n){var r;return null===(r=null==e?void 0:e.callFunction)||void 0===r?void 0:r.call(e,{name:"lowcode-datasource",data:{methodName:"callWedaApi",params:{action:"PushNotifyMsg",data:{NotifyId:t.notifyId,Data:JSON.stringify(t.data),NotifyUsers:void 0,Url:t.url}},mode:"c"}},void 0,n)},e.callWxOpenApi=function(e,t){return(0,u.callWxOpenApi)(v(),e,t)},e.callWxPayApi=function(e,t){return(0,u.callWxPayApi)(v(),e,t)},e.wxCallContainerApi=function(e,t){return(0,u.wxCallContainerApi)(v(),e,t)},e.callCompatibleWxOpenApi=function(e,t){return(0,u.callCompatibleWxOpenApi)(v(),e,t)},e.getFileAuthority=function(t,n){var u=t.fileList;return o(void 0,void 0,void 0,(function(){var t,o,l,p,d,h;return i(this,(function(i){switch(i.label){case 0:if(t=(0,s.getCloudbaseContext)().LOGINTYPE,!Array.isArray(u))throw(0,c.E)(r(r({},a.ERROR.INVALID_PARAM),{message:"[js-sdk] getCosFileAuthority fileList must be a array"}));if(u.some((function(e){return!(null==e?void 0:e.path)||!["READ","WRITE","READWRITE"].includes(e.type)})))throw(0,c.E)(r(r({},a.ERROR.INVALID_PARAM),{message:"[js-sdk] getCosFileAuthority fileList param error"}));return[4,e.auth.getEndUserInfo()];case 1:if(o=i.sent().userInfo,l=o.openId,p=o.uid,!l&&!p)throw(0,c.E)(r(r({},a.ERROR.INVALID_PARAM),{message:"[js-sdk] admin do not need getCosFileAuthority."}));return d={openId:l,uid:p,loginType:t,fileList:u},[4,e.request.send("storage.getFileAuthority",d,{pathname:"web",endPointMode:"GATEWAY"},n?{timeout:n.timeout}:void 0)];case 2:if((h=i.sent()).code)throw(0,c.E)(r(r({},h),{message:"[js-sdk] getCosFileAuthority failed: ".concat(h.code)}));return[2,h]}}))}))},e.callApis=function(t,n){return o(void 0,void 0,void 0,(function(){var r,o,a,s,c,u,l,p,d,h,f,m;return i(this,(function(i){if(e.apis)return r=t.name,o=t.path,a=void 0===o?"":o,s=t.method,c=void 0===s?"POST":s,u=t.header,l=void 0===u?{}:u,p=t.body,d=t.token,h=(c||"POST").toLowerCase(),[2,null===(m=null===(f=e.apis[r])||void 0===f?void 0:f[h])||void 0===m?void 0:m.call(f,{path:a,method:c,headers:l,body:p,token:d},n)];throw new Error("callApis is not supported in current configuration")}))}))}}},4353:function(e,t,n){"use strict";var r,o,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.SYMBOL_DEFAULT_ENV=t.SYMBOL_CURRENT_ENV=t.isValidEnvFormat=t.isPageModuleName=t.processReturn=t.setThrowOnCode=t.filterUndefined=t.filterValue=t.E=t.TcbError=t.createWebStreamFromNodeReadableStream=t.parseQueryString=t.headersInit2Indexable=t.obj2StrRecord=t.safeParseJson=t.validateUid=t.getCurrRunEnvTag=t.checkIsInTencentCloud=t.checkIsInSumeru=t.checkIsInCBR=t.checkIsInScf=t.getEnv=t.toQueryString=t.isFormData=void 0;var u=n(2877),l=n(8775),p=n(1197),d=n(1651);function h(e){return"undefined"==typeof process?void 0!==e?void 0:{}:void 0!==e?{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}[e]:{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}}function f(){return!!h("CBR_ENV_ID")}t.isFormData=(o=u.utils).isFormData,t.toQueryString=o.toQueryString,t.getEnv=h,t.checkIsInScf=function(){return"SCF"===h("TENCENTCLOUD_RUNENV")},t.checkIsInCBR=f;var m=new Set(["formal","pre","test"]);function v(){return m.has(h("SUMERU_ENV")||"")}function g(){return s(this,void 0,Promise,(function(){var e;return c(this,(function(t){switch(t.label){case 0:return"true"===h("TENCENTCLOUD")?[2,!0]:[4,(0,d.lookupAppId)()];case 1:return[2,"string"==typeof(e=t.sent())&&""!==e]}}))}))}t.checkIsInSumeru=v,t.checkIsInTencentCloud=g,t.getCurrRunEnvTag=function(){return s(void 0,void 0,Promise,(function(){return c(this,(function(e){switch(e.label){case 0:return(0,t.checkIsInScf)()?[2,"scf"]:f()?[2,"cbr"]:v()?[2,"sumeru"]:[4,g()];case 1:return e.sent()?[2,"tencentcloud"]:[2,"unknown"]}}))}))},t.validateUid=function(e){if("string"!=typeof e)throw a(a({},p.ERROR.INVALID_PARAM),{message:"uid must be a string"});if(!p.checkCustomUserIdRegex.test(e))throw a(a({},p.ERROR.INVALID_PARAM),{message:'Invalid uid: "'.concat(e,'"')})},t.safeParseJson=function(e){if(!e||!e.trim())return null;try{return JSON.parse(e)}catch(t){return console.warn("catch an error",{e:t,text:e}),e}},t.obj2StrRecord=function(e){return Object.entries(e).reduce((function(e,t){var n=t[0],r=t[1];return e[n]=String(r),e}),{})},t.headersInit2Indexable=function(e){if(function(e){try{return e instanceof Headers}catch(e){return!1}}(e)){var t={};return e.forEach((function(e,n){t[n]=e})),t}return e},t.parseQueryString=function(e){var t={},n=e.replace(/^[?#]/,"");return n?(n.split("&").forEach((function(e){var n=e.split("="),r=n[0],o=n[1];r=decodeURIComponent(r),o=decodeURIComponent(o||""),r&&(t[r]?Array.isArray(t[r])?t[r].push(o):t[r]=[t[r],o]:t[r]=o)})),t):t},t.createWebStreamFromNodeReadableStream=function(e){var t=e[Symbol.asyncIterator]();return new l.ReadableStream({pull:function(e){return s(this,void 0,void 0,(function(){var n;return c(this,(function(r){switch(r.label){case 0:return[4,t.next()];case 1:return(n=r.sent()).done?e.close():e.enqueue(n.value),[2]}}))}))}})};var b=function(e){function t(t){var n=e.call(this,t.message)||this;return n.code=t.code||"",n.message=t.message||"",n.requestId=t.requestId||"",n}return i(t,e),t}(Error);function y(e){return new b(e)}function _(e,t){for(var n in e)e[n]===t&&delete e[n]}t.TcbError=b,t.E=y,t.filterValue=_,t.filterUndefined=function(e){_(e,void 0)};var x=!0;t.setThrowOnCode=function(e){x=e},t.processReturn=function(e){if(!x)return e;throw y(a({},e))},t.isPageModuleName=function(e){return void 0===e&&(e=""),"string"==typeof e&&e.startsWith("$:")};var w=/^[a-z0-9_-]{1,40}$/;t.isValidEnvFormat=function(e){return void 0===e&&(e=""),"string"==typeof e&&w.test(e)},t.SYMBOL_CURRENT_ENV=Symbol.for("SYMBOL_CURRENT_ENV"),t.SYMBOL_DEFAULT_ENV=Symbol.for("SYMBOL_DEFAULT_ENV")},6480:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.wxCallContainerApi=t.callWxPayApi=t.callCompatibleWxOpenApi=t.callWxOpenApi=t.getWxOptions=t.sendWxFormDataRequest=t.sendWxRequest=t.buildAdminUrl=t.getWxCloudToken=void 0;var u=a(n(7147)),l=n(9094),p=n(4353),d=n(1197),h="/.tencentcloudbase/wx/cloudbase_access_token",f=6e5,m={token:"",timestamp:0};function v(){var e=(0,l.getCloudbaseContext)(),t=e.TRIGGER_SRC,n=e.WX_TRIGGER_API_TOKEN_V0,r=e.WX_API_TOKEN,o=e.WX_CLOUDBASE_ACCESSTOKEN,i=void 0===o?"":o,a={};return a.wxCloudApiToken="timer"===t?n||r||"":r||"",a.wxCloudApiToken||(a.wxCloudbaseAccesstoken=i||function(){if(m.token&&Date.now()-m.timestamp<f)return m.token;try{if(("WX_LOCAL_SCF"==={IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.TENCENTCLOUD_RUNENV||"SCF"==={IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.TENCENTCLOUD_RUNENV)&&u.existsSync(h))return m.token=u.readFileSync(h).toString(),m.timestamp=Date.now(),m.token}catch(e){console.warn("[TCB][ERROR]: loadWxCloudbaseAccesstoken error: ",e)}return""}()),a}t.getWxCloudToken=v;var g=0;function b(e,t,n){var r="symbol"==typeof e.env?{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.TCB_ENV||{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.SCF_NAMESPACE||"":e.env||"",o=e.region||{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.TENCENTCLOUD_REGION||"",i=function(){g+=1;var e="".concat(Date.now().toString(16),"_").concat(g.toString(16)),t=(0,l.getCloudbaseContext)().TCB_SEQID,n=void 0===t?"":t;return n?"".concat(n,"-").concat(e):e}(),a=o?"".concat(o,".tcb-api.tencentcloudapi.com"):"tcb-api.tencentcloudapi.com",s=function(e){return/^[a-z][a-z0-9-]*[a-z0-9]$/.test(e)}(r)?"".concat(r,".").concat(a):a,c="".concat("https","://").concat(s).concat("/admin"),u=n||c,p=t?"env=".concat(r,"&seqId=").concat(i,"&scfRequestId=").concat(t.requestId):"env=".concat(r,"&seqId=").concat(i);return u.includes("?")?"".concat(u).concat(p):"".concat(u,"?").concat(p)}function y(e){var t=(0,l.getCloudbaseContext)(),n=v(),r=n.wxCloudApiToken,o=n.wxCloudbaseAccesstoken;e.wxCloudApiToken=r,o&&(e.wxCloudbaseAccesstoken=o),e.tcb_sessionToken=t.TCB_SESSIONTOKEN||""}function _(e,t,n,r){return s(this,void 0,void 0,(function(){return c(this,(function(o){return y(n),[2,e.requestInstance.send(t,n,{pathname:"web",endPointMode:"GATEWAY"},r?{timeout:r.timeout}:void 0)]}))}))}function x(e,t,o,i){return s(this,void 0,Promise,(function(){var a,s,u,l,p,d,h,f;return c(this,(function(c){switch(c.label){case 0:y(o);try{a=n(1191)}catch(e){throw new Error("缺少依赖 form-data,请执行 npm install form-data")}for((s=new a).append("action",t),u=0,l=Object.keys(o);u<l.length;u++)p=l[u],void 0!==o[p]&&s.append(p,o[p]);return d=r({action:t},o),s.__plainObj=d,h=b(e.config,e.scfContext,e.serviceUrl),[4,e.requestInstance.post({url:h,body:s,headers:s.getHeaders(),responseType:"buffer"},i?{timeout:i.timeout}:void 0)];case 1:return(f=c.sent()).data?[2,f.data]:[2,f]}}))}))}function w(e,t){if(void 0===t&&(t={}),t.getCrossAccountInfo||e.getCrossAccountInfo)throw(0,p.E)(r(r({},d.ERROR.INVALID_PARAM),{message:"invalid config: getCrossAccountInfo"}))}function E(e,t,n,r){var o=n.apiName,i=n.apiOptions,a=n.cgiName,u=n.requestData;return s(this,void 0,void 0,(function(){return c(this,(function(n){return w(t.config,r),[2,x(t,e,{apiName:o,apiOptions:i,cgiName:a,requestData:u},r)]}))}))}t.buildAdminUrl=b,t.sendWxRequest=_,t.sendWxFormDataRequest=x,t.getWxOptions=function(e,t,n,r){return{requestInstance:r,config:e,scfContext:t,serviceUrl:n}},t.callWxOpenApi=function(e,t,n){var o=t.apiName,i=t.apiOptions,a=t.cgiName,u=t.requestData;return s(this,void 0,void 0,(function(){var t,s,l;return c(this,(function(c){switch(c.label){case 0:try{t=u?JSON.stringify(u):""}catch(e){throw(0,p.E)(r(r({},e),{code:d.ERROR.INVALID_PARAM.code,message:"对象出现了循环引用"}))}return w(e.config,n),[4,_(e,"wx.api",{apiName:o,apiOptions:i,cgiName:a,requestData:t},n)];case 1:if((s=c.sent()).code)return[2,s];try{l=JSON.parse(s.responseData)}catch(e){l=s.responseData}return[2,{result:l,requestId:s.requestId}]}}))}))},t.callCompatibleWxOpenApi=function(e,t,n){return E("wx.openApi",e,t,n)},t.callWxPayApi=function(e,t,n){return E("wx.wxPayApi",e,t,n)},t.wxCallContainerApi=function(e,t,n){return E("wx.wxCallContainerApi",e,t,n)}},1985:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},s=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.getWxDefaultAdapter=t.Platform=void 0;var c=a(n(7917)),u=n(2764);t.Platform={},t.getWxDefaultAdapter=function(){return void 0===c.WxRequest?null:(c.WxRequest.prototype.upload=function(e){var t=this,n=this;return new Promise((function(o){var i=e.url,a=e.file,s=e.data,c=e.headers,u=wx.getFileSystemManager(),l=wx.request({url:i,method:e.method,header:r({"content-type":" "},c),data:u.readFileSync(a),timeout:t._timeout,success:function(e){var t={statusCode:e.statusCode,data:e.data||{}};200===e.statusCode&&(null==s?void 0:s.success_action_status)&&(t.statusCode=parseInt(s.success_action_status,10)),o(t)},fail:function(e){o(e)},complete:function(e){if((null==e?void 0:e.errMsg)&&n._timeout&&-1!==n._restrictedMethods.indexOf("upload")&&"request:fail timeout"===e.errMsg){console.warn(n._timeoutMsg);try{l.abort()}catch(e){}}}})}))},c.default.genAdapter=function(e){return{root:{globalThis:{}},reqClass:c.WxRequest,wsClass:c.WxMpWebSocket,captchaOptions:{openURIWithCallback:function(t){var n=e.EventBus,o={},i=t;console.log("openURIWithCallback",t);var a=t.match(/^(data:.*?)(\?[^#\s]*)?$/);if(a){i=a[1],console.log("openURIWithCallback url",i);var u=a[2];u&&(o=(0,c.parseQueryString)(u))}console.log("openURIWithCallback queryObj",o);var l=o.token,p=s(o,["token"]);return/^data:/.test(i)&&!l?Promise.reject({error:"invalid_argument",error_description:"invalie captcha data: ".concat(t)}):l?new Promise((function(e){console.log("wait for captcha..."),n.$emit("CAPTCHA_DATA_CHANGE",r(r({},p),{token:l,url:i})),n.$once("RESOLVE_CAPTCHA_DATA",(function(t){e(t)}))})):Promise.reject({error:"unimplemented",error_description:"need to impl captcha data"})}},localStorage:c.wxMpStorage,primaryStorage:u.StorageType.local,getAppSign:function(){var e=wx.getAccountInfoSync();return"undefined"!=typeof App||"undefined"!=typeof getApp||wx.onAppHide||wx.offAppHide||wx.onAppShow||wx.offAppShow?e&&e.miniProgram?e.miniProgram.appId:"":e&&e.plugin?e.plugin.appId:""}}},c.default)}},6938:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalCache=t.getCacheByEnvId=t.initCache=void 0;var o=n(2877).cache.CloudbaseCache,i={},a={};t.initCache=function(e){var t=e.env,n=e.platformInfo,s={userInfoKey:"".concat("user_info","_").concat(t)};i[t]=i[t]||new o(r(r({},e),{keys:s,platformInfo:n})),a[t]=a[t]||new o(r(r({},e),{keys:s,platformInfo:n,persistence:"local"}))},t.getCacheByEnvId=function(e){return i[e]},t.getLocalCache=function(e){return a[e]}},4276:function(e,t,n){"use strict";var r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.registerHook=t.registerComponent=void 0;var o=n(2877).constants.ERRORS,i={};function a(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=a(e[o],t[o]))}return e}t.registerComponent=function(e,t){var n=t.name,s=t.namespace,c=t.entity,u=t.injectEvents,l=t.IIFE,p=void 0!==l&&l;if(i[n]||s&&e[s])throw new Error(JSON.stringify({code:o.INVALID_OPERATION,msg:"Duplicate component ".concat(n)}));if(p){if(!c||"function"!=typeof c)throw new Error(JSON.stringify({code:o.INVALID_PARAMS,msg:"IIFE component's entity must be a function"}));c.call(e)}if(i[n]=t,s?e.prototype[s]=c:a(e.prototype,c),u){var d=u.bus,h=u.events;if(!d||!h||0===h.length)return;var f=e.prototype.fire||function(){};e.prototype.events||(e.prototype.events={}),(e.prototype.events||{})[n]?e.prototype.events[n].events=r(r([],e.prototype.events[n].events,!0),h,!0):e.prototype.events[n]={bus:d,events:h},e.prototype.fire=function(e,t){f(e,t);for(var n=0,r=Object.keys(this.events);n<r.length;n++){var o=r[n],i=this.events[o],a=i.bus;if(i.events.includes(e)){a.fire(e,t);break}}}}},t.registerHook=function(e,t){var n=t.entity,i=t.target;if(Object.prototype.hasOwnProperty.call(e,i))throw new Error(JSON.stringify({code:o.INVALID_OPERATION,msg:"target:".concat(i," is not exist")}));var a=e.prototype[i];if("function"!=typeof a)throw new Error(JSON.stringify({code:o.INVALID_OPERATION,msg:"target:".concat(i," is not a function which is the only type supports hook")}));e.prototype[i]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.call.apply(n,r([this],e,!1)),a.call.apply(a,r([this],e,!1))}}},3509:(e,t,n)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.i18nProxy=t.t=t.langMap=t.LANG_HEADER_KEY=t.LANGS=void 0;var o,i=n(2877);!function(e){e.ZH="zh-CN",e.EN="en-US"}(o=t.LANGS||(t.LANGS={})),t.LANG_HEADER_KEY="Accept-Language",t.langMap=((r={})[o.EN]={"请检查调用方式,或前往云开发 AI+ 首页查看文档":"Please check the calling method or visit the AI+ homepage to view the documentation","AI+ 请求出错,错误码":"AI+ request error, error code",错误信息:"error message",未实现:"not implemented","小程序不支持 wasm 加载":"wasm loading is not supported in mini programs","小程序不支持动态 js 加载":"dynamic js loading is not supported in mini programs",请求超时:"request timeout","缺少 privatelink sdk 地址":"missing privatelink sdk address"},r),t.t=function(e,n){var r;return(null===(r=t.langMap[n])||void 0===r?void 0:r[e])||e},t.i18nProxy=function(e,n){var r,a,s=function(e){return"lang_".concat(e.clientId||e.env)}(n),c=(e.adapter||{}).localStorage,u=n.lang||(null===(r=null==c?void 0:c.getItem)||void 0===r?void 0:r.call(c,s))||o.ZH;return null===(a=null==c?void 0:c.setItem)||void 0===a||a.call(c,s,u),new Proxy({t:function(e){return(0,t.t)(e,u)},LANG_HEADER_KEY:t.LANG_HEADER_KEY,lang:u},{get:function(e,t){var n;return"lang"===t&&(null===(n=null==c?void 0:c.getItem)||void 0===n?void 0:n.call(c,s))||e[t]},set:function(e,n,r){var o;return"lang"===n&&r!==e[n]&&(e[n]=r,e.t=function(e){return(0,t.t)(e,r)},null===(o=null==c?void 0:c.setItem)||void 0===o||o.call(c,s,r),i.langEvent.bus.fire(i.langEvent.LANG_CHANGE_EVENT,{i18n:e})),e[n]=r,!0}})}},901:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},a=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.getRequestByEnvId=t.initRequest=t.CloudbaseRequest=void 0;var s=n(7922),c=n(2877),u=n(6938),l=n(1985),p=c.constants.ERRORS,d=c.utils.genSeqId,h=c.utils.isFormData,f=c.utils.formatUrl,m=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"];function v(e,t,n){var o=e[t];e[t]=function(t){var i={},a={};n.forEach((function(n){var r=n.call(e,t),o=r.data,s=r.headers;Object.assign(i,o),Object.assign(a,s)}));var s=t.data;return s&&(h(s)?Object.keys(i).forEach((function(e){s.append(e,i[e])})):t.data=r(r({},s),i)),t.headers=r(r({},t.headers||{}),a),o.call(e,t)}}function g(){var e=d();return{data:{seqId:e},headers:{"X-SDK-Version":"@cloudbase/js-sdk/".concat((0,s.getSdkVersion)()),"x-seqid":e}}}var b=function(){function e(e){var t=this;this.throwWhenRequestFail=!1,this.config=e;var n={timeout:this.config.timeout,timeoutMsg:"[@cloudbase/js-sdk] 请求在".concat(this.config.timeout/1e3,"s内未完成,已中断"),restrictedMethods:["post","put"],auth:e.auth};this.reqClass=new l.Platform.adapter.reqClass(n),this.throwWhenRequestFail=e.throw||!1,this.localCache=(0,u.getLocalCache)(this.config.env),"GATEWAY"!==this.config.endPointMode&&(v(this.reqClass,"post",[g]),v(this.reqClass,"upload",[g]),v(this.reqClass,"download",[g])),c.langEvent.bus.on(c.langEvent.LANG_CHANGE_EVENT,(function(e){var n;t.config.i18n=(null===(n=e.data)||void 0===n?void 0:n.i18n)||t.config.i18n}))}return e.prototype.getAccessToken=function(e){return void 0===e&&(e=null),o(this,void 0,void 0,(function(){var t,n,r;return i(this,(function(o){switch(o.label){case 0:if(null!=e)return[2,e];if(!(t=this.config._fromApp).oauthInstance)throw new Error("you can't request without auth");return n=t.oauthInstance,r=n.oauth2client,[4,this.getOauthAccessTokenV2(r)];case 1:return[2,o.sent().accessToken]}}))}))},e.prototype.getDefaultHeaders=function(){var e,t,n;return(e={})[null===(t=this.config.i18n)||void 0===t?void 0:t.LANG_HEADER_KEY]=null===(n=this.config.i18n)||void 0===n?void 0:n.lang,e["X-SDK-Version"]="@cloudbase/js-sdk/".concat((0,s.getSdkVersion)()),e},e.prototype.post=function(e,t){return o(this,void 0,Promise,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,this.reqClass.post(r(r({},e),{headers:r(r({},e.headers),this.getDefaultHeaders()),customReqOpts:t}))];case 1:return[2,n.sent()]}}))}))},e.prototype.upload=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.reqClass.upload(r(r({},e),{headers:r(r({},e.headers),this.getDefaultHeaders())}))];case 1:return[2,t.sent()]}}))}))},e.prototype.download=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.reqClass.download(r(r({},e),{headers:r(r({},e.headers),this.getDefaultHeaders())}))];case 1:return[2,t.sent()]}}))}))},e.prototype.getBaseEndPoint=function(e){return void 0===e&&(e="CLOUD_API"),(0,s.getBaseEndPoint)(this.config.env,e)},e.prototype.getOauthAccessTokenV2=function(e){return o(this,void 0,Promise,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,e.getAccessToken()];case 1:return t=r.sent(),[4,e.getCredentials()];case 2:return n=r.sent(),[2,{accessToken:t,accessTokenExpire:new Date(n.expires_at).getTime()}]}}))}))},e.prototype.request=function(e,t,n,a){var c,u;return o(this,void 0,Promise,(function(){var o,l,p,d,h,v,g,b,y,_,x,w,E,I,S,O,T,A,P,C,R,N,k;return i(this,(function(i){switch(i.label){case 0:if(i.trys.push([0,4,,5]),o="x-tcb-trace_".concat(this.config.env),l="application/x-www-form-urlencoded",p=r({action:e,dataVersion:s.DATA_VERSION,env:this.config.env},t),-1!==m.indexOf(e))return[3,2];if(!(d=this.config._fromApp).oauthInstance)throw new Error("you can't request without auth");return h=d.oauthInstance,v=h.oauth2client,g=p,[4,this.getOauthAccessTokenV2(v)];case 1:g.access_token=i.sent().accessToken,i.label=2;case 2:return"storage.uploadFile"===e?(b=new FormData,Object.keys(b).forEach((function(e){Object.prototype.hasOwnProperty.call(b,e)&&void 0!==b[e]&&b.append(e,p[e])})),l="multipart/form-data"):(l="application/json;charset=UTF-8",b={},Object.keys(p).forEach((function(e){void 0!==p[e]&&(b[e]=p[e])}))),y={headers:r(r({"content-type":l},this.getDefaultHeaders()),null==n?void 0:n.headers)},(null==n?void 0:n.onUploadProgress)&&(y.onUploadProgress=n.onUploadProgress),this.config.region&&(y.headers["X-TCB-Region"]=this.config.region),(_=this.localCache.getStore(o))&&(y.headers["X-TCB-Trace"]=_),x=void 0!==(null==n?void 0:n.parse)?n.parse:t.parse,w=void 0!==(null==n?void 0:n.inQuery)?n.inQuery:t.inQuery,E=void 0!==(null==n?void 0:n.search)?n.search:t.search,I=r(r({},(null==n?void 0:n.defaultQuery)||{}),{env:this.config.env}),x&&(I.parse=!0),w&&(I=r(r({},w),I)),S=(null==n?void 0:n.endPointMode)||this.config.endPointMode||"CLOUD_API",O=(0,s.getEndPointInfo)(this.config.env,S),T=O.baseUrl,A=O.protocol,"GATEWAY"===S&&/^((database)\.)|(auth\.wsWebSign)/.test(e)&&(P=(0,s.getEndPointInfo)(this.config.env,"CLOUD_API"),T="".concat(P.baseUrl.match(/\/\/([^/?#]*)/)[0],"/web")),C=void 0,C=n.pathname?f(A,"".concat(null===(c=(0,s.getBaseEndPoint)(this.config.env,S))||void 0===c?void 0:c.replace(/^https?:/,""),"/").concat(n.pathname),I):f(A,T,I),E&&(C+=E),[4,this.post(r({url:C,data:b},y),a)];case 3:if(R=i.sent(),(N=null===(u=R.header)||void 0===u?void 0:u["x-tcb-trace"])&&this.localCache.setStore(o,N),200!==Number(R.status)&&200!==Number(R.statusCode)||!R.data)throw new Error("network request error");return[2,R];case 4:k=i.sent();try{k.requestId=k.requestId||(null==n?void 0:n.headers["x-request-id"])||(null==n?void 0:n.headers["X-Request-Id"])||""}catch(e){}throw k;case 5:return[2]}}))}))},e.prototype.fetch=function(e){var t,n,c,u,l,p,d,h;return o(this,void 0,Promise,(function(){var f,m,v,g,b,y,_,x,w=this;return i(this,(function(E){switch(E.label){case 0:f=e.token,m=e.headers,v=void 0===m?{}:m,g=e.withCredentials,b=void 0===g||g,y=a(e,["token","headers","withCredentials"]),_=function(){return o(w,void 0,void 0,(function(){var e,t,n,o;return i(this,(function(i){switch(i.label){case 0:if(e={},!b)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.getAccessToken(f)];case 2:return(t=i.sent())&&(e.Authorization="Bearer ".concat(t)),[3,4];case 3:if(n=i.sent(),"undefined"==typeof process||null==process.versions||null==process.versions.node)throw n;return[3,4];case 4:return o=r({headers:r(r(r({"X-SDK-Version":"@cloudbase/js-sdk/".concat((0,s.getSdkVersion)())},e),this.getDefaultHeaders()),v),withCredentials:b},y),[2,this.reqClass.fetch(o)]}}))}))},E.label=1;case 1:return E.trys.push([1,3,,6]),[4,_()];case 2:return[2,E.sent()];case 3:x=E.sent();try{x.requestId=x.requestId||v["x-request-id"]||v["X-Request-Id"]||""}catch(e){}if("ACCESS_TOKEN_EXPIRED"!==(null==x?void 0:x.code))return[3,5];if("function"!=typeof(null===(u=null===(c=null===(n=null===(t=this.config)||void 0===t?void 0:t._fromApp)||void 0===n?void 0:n.oauthInstance)||void 0===c?void 0:c.authApi)||void 0===u?void 0:u.refreshTokenForce))throw x;return[4,null===(h=null===(d=null===(p=null===(l=this.config)||void 0===l?void 0:l._fromApp)||void 0===p?void 0:p.oauthInstance)||void 0===d?void 0:d.authApi)||void 0===h?void 0:h.refreshTokenForce()];case 4:return E.sent(),[2,_()];case 5:throw x;case 6:return[2]}}))}))},e.prototype.send=function(e,t,n,a){return void 0===t&&(t={}),void 0===n&&(n={}),o(this,void 0,Promise,(function(){var o;return i(this,(function(i){switch(i.label){case 0:return[4,this.request(e,t,r(r({},n),{onUploadProgress:t.onUploadProgress}),a)];case 1:if((o=i.sent()).data.code&&this.throwWhenRequestFail)throw new Error(JSON.stringify({code:p.OPERATION_FAIL,msg:"[".concat(o.data.code,"] ").concat(o.data.message)}));return[2,o.data]}}))}))},e.prototype.gateWay=function(e,t){var n;return o(this,void 0,void 0,(function(){var o,a,u,l,d,h,f,m,v,g,b,y,_,x,w,E,I,S,O;return i(this,(function(i){switch(i.label){case 0:if(o=e.url,a=e.name,u=e.data,l=e.path,d=void 0===l?"":l,h=e.method,f=e.header,m=void 0===f?{}:f,!(a&&d||o))throw new Error(JSON.stringify({code:p.INVALID_PARAMS,msg:"[gateWay] invalid function name or path or url"}));try{v=u?JSON.stringify(u):""}catch(e){throw new Error(JSON.stringify({code:p.INVALID_PARAMS,msg:"[gateWay] invalid data"}))}if(g=c.utils.generateRequestId(),b=(0,s.getEndPointInfo)(this.config.env,"GATEWAY"),y=b.baseUrl,_=b.protocol,x="".concat(_).concat(y).concat(o||"/".concat(d,"/").concat(a)),w=["GET","HEAD"].includes(null===(n=null==h?void 0:h.toUpperCase)||void 0===n?void 0:n.call(h)))try{E={};try{E=JSON.parse(u)}catch(e){E=u||{}}x="".concat(x).concat(x.includes("?")?"&":"?").concat(Object.keys(E).map((function(e){return"".concat(e,"=").concat(E[e])})).join("&"))}catch(e){}return[4,this.fetch(r(r({method:h||"POST",headers:r({"Content-Type":"application/json; charset=utf-8","X-Request-Id":g},m)},w?{}:{body:v}),{url:x,customReqOpts:t}))];case 1:return I=i.sent(),S=[r({requestId:g},I)],O={},[4,I.data];case 2:return[2,r.apply(void 0,S.concat([(O.data=i.sent(),O)]))]}}))}))},e}();t.CloudbaseRequest=b;var y={};t.initRequest=function(e){y[e.env]=new b(r(r({},e),{throw:!0}))},t.getRequestByEnvId=function(e){return y[e]}},3548:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useAuthAdapter=void 0;var a=n(1019),s=function(){function e(e){var t,n;try{this.localStorage=(null==e?void 0:e.localStorage)||((null===(n=null===(t=null==e?void 0:e.adapter)||void 0===t?void 0:t.root)||void 0===n?void 0:n.globalThis)||globalThis).localStorage}catch(t){this.localStorage=(null==e?void 0:e.localStorage)||{}}}return e.prototype.getItem=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.localStorage.getItem(e)]}))}))},e.prototype.removeItem=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return this.localStorage.removeItem(e),[2]}))}))},e.prototype.setItem=function(e,t){return o(this,void 0,Promise,(function(){return i(this,(function(n){return this.localStorage.setItem(e,t),[2]}))}))},e.prototype.getItemSync=function(e){return this.localStorage.getItem(e)},e.prototype.setItemSync=function(e,t){this.localStorage.setItem(e,t)},e.prototype.removeItemSync=function(e){this.localStorage.removeItem(e)},e}(),c=/^[^:]+:\/\/[^/]+(\/[^?#]+)/,u=function(e,t){var n,r,o,i,a=null===(n=null==t?void 0:t.headers)||void 0===n?void 0:n["x-request-id"];return e||(e={}),((null==e?void 0:e.code)||(null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.error_code))&&(e={error:e.code||e.data.error,error_description:e.data.error_description||e.message||e.code||e.data.error_code,request_id:e.requestId,error_code:null===(o=e.data)||void 0===o?void 0:o.error_code}),(null==e?void 0:e.request_id)||(e.request_id=e.request_id||a),(null==e?void 0:e.error)?(e.error_uri=(i=null==t?void 0:t.url,c.test(i)?RegExp.$1:i),e):(null==e?void 0:e.data)||{}};t.useAuthAdapter=function(e){return e.adapter&&"default"!==e.adapter.type?function(e,t){var n=r({},e);try{if(!(null==e?void 0:e.storage)&&(null==t?void 0:t.localStorage)&&(n.storage=new s({localStorage:t.localStorage,adapter:t})),!e.captchaOptions&&(null==t?void 0:t.captchaOptions)&&(n.captchaOptions=t.captchaOptions),!e.baseRequest&&!e.request&&(null==t?void 0:t.reqClass)){var a={timeout:1e4,restrictedMethods:["get","post","upload","download","request"],auth:e.auth},c=new t.reqClass(a);n.baseRequest=function(e,t){var n,a,s,l,p;return o(this,void 0,void 0,(function(){var o,d,h,f;return i(this,(function(i){switch(i.label){case 0:if(o={},d=(null===(n=t.method)||void 0===n?void 0:n.toLocaleLowerCase())||"post","function"!=typeof(h=null===(s=null===(a=null==c?void 0:c[d])||void 0===a?void 0:a.bind)||void 0===s?void 0:s.call(a,c)))throw new Error("invalid 【".concat(d,"】 request method"));i.label=1;case 1:return i.trys.push([1,3,,4]),(null===(l=t.headers)||void 0===l?void 0:l["content-type"])&&!(null===(p=t.headers)||void 0===p?void 0:p["content-type"].includes("application/json"))||["string","undefined"].includes(typeof t.body)||(t.data=t.data||t.body,t.body=JSON.stringify(t.body)),[4,h(r({url:e},t))];case 2:return o=i.sent(),o=u(o,r(r({},t),{url:e})),[3,4];case 3:throw f=i.sent(),o=r(r({},null==f?void 0:f.data),f);case 4:if(null==o?void 0:o.error)throw o;return[2,o]}}))}))}}}catch(e){console.error("user adapter generate fail:",e)}return n}(e,e.adapter):function(e,t){var n=r({},e),c={};if((null==t?void 0:t.captchaOptions)&&(n.captchaOptions=t.captchaOptions),!a.adapterForWxMp.isMatch()||e.storage&&e.baseRequest)return n;try{var l=a.adapterForWxMp.genAdapter({}),p=l.localStorage,d=l.reqClass;if(p&&(c.storage=new s({localStorage:p,adapter:t})),d){var h=new d({timeout:1e4,restrictedMethods:["get","post","upload","download","request"]});c.request=function(e){return function(t,n){return o(this,void 0,void 0,(function(){return i(this,(function(o){return[2,new Promise((function(o,i){var a=Object.assign({},n);a.body&&"string"!=typeof a.body&&(a.body=JSON.stringify(a.body));var s=wx.request({url:t,data:a.body,timeout:e._timeout,method:a.method||"GET",header:a.headers,success:function(e){(e=u(e,r(r({},n),{url:t}))).error&&i(e),o(e)},fail:function(e){i({error:"unreachable",error_description:e.message})},complete:function(t){if(t&&t.errMsg&&e._timeout&&-1!==e._restrictedMethods.indexOf("request")&&"request:fail timeout"===t.errMsg){console.warn(e._timeoutMsg);try{s.abort()}catch(e){}}}})}))]}))}))}}(h)}return n.captchaOptions&&(c.baseRequest=c.request,c.request=void 0),r(r({},n),c)}catch(e){console.error("adapter generate fail:",e)}return n}(e,e.adapter)}},9895:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},u=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},l=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.registerAuth=t.AuthError=t.AuthErrorCode=t.AuthErrorCategory=t.AnonymousAuthProvider=t.CustomAuthProvider=t.WeixinAuthProvider=t.Auth=t.generateAuthInstance=t.LoginState=t.User=void 0;var p=n(6722),d=n(3548),h=n(1019),f=n(5266),m=n(916);Object.defineProperty(t,"WeixinAuthProvider",{enumerable:!0,get:function(){return m.WeixinAuthProvider}}),Object.defineProperty(t,"CustomAuthProvider",{enumerable:!0,get:function(){return m.CustomAuthProvider}}),Object.defineProperty(t,"AnonymousAuthProvider",{enumerable:!0,get:function(){return m.AnonymousAuthProvider}});var v=n(2877),g=function(){return"undefined"!=typeof window&&"undefined"!=typeof document},b=t.User=function(){function e(e){var t=e.cache,n=e.oauthInstance;this.cache=t,this.oauthInstance=n,this.setUserInfo()}var t,n,r;return e.prototype.checkLocalInfo=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){return this.uid=this.getLocalUserInfo("uid"),this.gender=this.getLocalUserInfo("gender"),this.picture=this.getLocalUserInfo("picture"),this.email=this.getLocalUserInfo("email"),this.emailVerified=this.getLocalUserInfo("email_verified"),this.phoneNumber=this.getLocalUserInfo("phone_number"),this.username=this.getLocalUserInfo("username"),this.name=this.getLocalUserInfo("name"),this.birthdate=this.getLocalUserInfo("birthdate"),this.zoneinfo=this.getLocalUserInfo("zoneinfo"),this.locale=this.getLocalUserInfo("locale"),this.sub=this.getLocalUserInfo("sub"),this.createdFrom=this.getLocalUserInfo("created_from"),this.providers=this.getLocalUserInfo("providers"),[2]}))}))},e.prototype.checkLocalInfoAsync=function(){return c(this,void 0,void 0,(function(){var e,t,n,r;return u(this,(function(o){switch(o.label){case 0:return e=this,[4,this.getLocalUserInfoAsync("uid")];case 1:return e.uid=o.sent(),t=this,[4,this.getLocalUserInfoAsync("gender")];case 2:return t.gender=o.sent(),this.picture=this.getLocalUserInfo("picture"),n=this,[4,this.getLocalUserInfoAsync("email")];case 3:return n.email=o.sent(),this.emailVerified=this.getLocalUserInfo("email_verified"),this.phoneNumber=this.getLocalUserInfo("phone_number"),r=this,[4,this.getLocalUserInfoAsync("username")];case 4:return r.username=o.sent(),this.name=this.getLocalUserInfo("name"),this.birthdate=this.getLocalUserInfo("birthdate"),this.zoneinfo=this.getLocalUserInfo("zoneinfo"),this.locale=this.getLocalUserInfo("locale"),this.sub=this.getLocalUserInfo("sub"),this.createdFrom=this.getLocalUserInfo("created_from"),this.providers=this.getLocalUserInfo("providers"),[2]}}))}))},e.prototype.update=function(e){return c(this,void 0,Promise,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return[4,this.oauthInstance.authApi.setUserProfile(i({},e))];case 1:return t=n.sent(),this.setLocalUserInfo(t),[2]}}))}))},e.prototype.updateUserBasicInfo=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.updateUserBasicInfo(i({},e))];case 1:return t.sent(),[4,this.refresh()];case 2:return t.sent(),[2]}}))}))},e.prototype.updatePassword=function(e,t){return this.oauthInstance.authApi.updatePasswordByOld({old_password:t,new_password:e})},e.prototype.updateUsername=function(e){return"string"!=typeof e&&(0,h.throwError)(h.ERRORS.INVALID_PARAMS,"username must be a string"),this.update({username:e})},e.prototype.refresh=function(e){return c(this,void 0,Promise,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return[4,this.oauthInstance.authApi.getUserInfo(e)];case 1:if("INVALID_ACCESS_TOKEN"===(t=n.sent()).code)throw this.setLocalUserInfo({}),t;return this.setLocalUserInfo(t),[2,t]}}))}))},e.prototype.getLocalUserInfo=function(e){var t=this.cache.keys.userInfoKey,n=this.cache.getStore(t);return e?n[e]:n||{}},e.prototype.setLocalUserInfo=function(e){var t=this.cache.keys.userInfoKey;this.cache.setStore(t,e),this.setUserInfo()},e.prototype.getLocalUserInfoAsync=function(e){return c(this,void 0,Promise,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return t=this.cache.keys.userInfoKey,[4,this.cache.getStoreAsync(t)];case 1:return[2,n.sent()[e]]}}))}))},e.prototype.setUserInfo=function(){var e=this,t=this.cache.keys.userInfoKey,n=this.cache.getStore(t);["uid","email","name","gender","picture","email_verified","phone_number","birthdate","zoneinfo","locale","sub","created_from","providers","username","created_at","open_id"].forEach((function(t){e[t]=n[t]}))},a([(0,h.catchErrorsDecorator)({title:"更新用户信息失败",messages:["请确认以下各项:"," 1 - 调用 User.update() 的语法或参数是否正确"," 2 - 用户信息中是否包含非法值","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",["function"==typeof(t=void 0!==p.authModels&&p.authModels.UserProfile)?t:Object]),s("design:returntype","function"==typeof(n="undefined"!=typeof Promise&&Promise)?n:Object)],e.prototype,"update",null),a([(0,h.catchErrorsDecorator)({title:"更新密码失败",messages:["请确认以下各项:"," 1 - 调用 User.updatePassword() 的语法或参数是否正确"," 3 - 新密码中是否包含非法字符","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[String,String]),s("design:returntype",void 0)],e.prototype,"updatePassword",null),a([(0,h.catchErrorsDecorator)({title:"更新用户名失败",messages:["请确认以下各项:"," 1 - 调用 User.updateUsername() 的语法或参数是否正确"," 2 - 当前环境是否开通了用户名密码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[String]),s("design:returntype",void 0)],e.prototype,"updateUsername",null),a([(0,h.catchErrorsDecorator)({title:"刷新本地用户信息失败",messages:["请确认以下各项:"," 1 - 调用 User.refresh() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[Object]),s("design:returntype","function"==typeof(r="undefined"!=typeof Promise&&Promise)?r:Object)],e.prototype,"refresh",null),e}();(0,m.applyUserV1Compat)(b);var y=function(){function e(e){var t=e.envId,n=e.cache,r=e.oauthInstance;t||(0,h.throwError)(h.ERRORS.INVALID_PARAMS,"envId is not defined"),this.cache=n,this.oauthInstance=r,this.user=new b({cache:this.cache,oauthInstance:r})}return e.prototype.checkLocalState=function(){var e;this.oauthLoginState=null===(e=this.oauthInstance)||void 0===e?void 0:e.authApi.hasLoginStateSync(),this.user.checkLocalInfo()},e.prototype.checkLocalStateAsync=function(){var e;return c(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,null===(e=this.oauthInstance)||void 0===e?void 0:e.authApi.getLoginState()];case 1:return t.sent(),[4,this.user.checkLocalInfoAsync()];case 2:return t.sent(),[2]}}))}))},e}();t.LoginState=y;var _=function(e){function t(t){var n=e.call(this)||this;return n.listeners=new Map,n.hasListenerSetUp=!1,n.config=t,n.oauthInstance=t.oauthInstance,n.cache=t.cache,n.init(),n.setAccessKey(),n}var n,r,d,m,b,_,x,w,E,I,S,O,T,A,P,C,R,N,k,j;return o(t,e),t.prototype.signInAnonymously=function(e){return c(this,void 0,Promise,(function(){var t,n,r,o,a;return u(this,(function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),[4,this.oauthInstance.authApi.signInAnonymously(e)];case 1:return s.sent(),[4,this.createLoginState()];case 2:return t=s.sent(),[4,this.getSession()];case 3:return n=s.sent().data,r=(void 0===n?{}:n).session,[2,i(i({},t),{data:{user:r.user,session:r},error:null})];case 4:return o=s.sent(),(a=new p.AuthError(o,{method:"signInAnonymously"})).category===p.AuthErrorCategory.PROVIDER_NOT_ENABLED?(console.error(a.helpMessage),console.error("[CloudBase Auth] 提示:匿名登录需要在控制台开启「匿名登录」。\n 如果您需要使用用户名密码登录,请改用 auth.signInWithPassword({ username, password })。\n 不要在匿名登录失败后自动回退到密码登录,这两种方式的使用场景不同。")):(console.warn("[CloudBase Auth] signInAnonymously 失败 [".concat(a.category,"]: ").concat(a.message)),a.loginMethodHint&&console.warn(a.loginMethodHint)),[2,{data:{user:null,session:null},error:a}];case 5:return[2]}}))}))},t.prototype.signUp=function(e){return c(this,void 0,Promise,(function(){var t,n,r=this;return u(this,(function(o){switch(o.label){case 0:return e.phone_number||e.verification_code||e.verification_token||e.provider_token?(e.phone_number&&(e.phone_number=this.formatPhone(e.phone_number)),[4,this.oauthInstance.authApi.signUp(e)]):[3,2];case 1:return o.sent(),[2,this.createLoginState()];case 2:return o.trys.push([2,4,,5]),this.validateAtLeastOne(e,[["email"],["phone"]],"You must provide either an email or phone number"),[4,this.getVerification(e.email?{email:e.email}:{phone_number:this.formatPhone(e.phone)})];case 3:return t=o.sent(),[2,{data:{verifyOtp:function(n){var o=n.token,a=n.messageId,s=void 0===a?t.verification_id:a;return c(r,void 0,Promise,(function(){var n,r,a,c,l;return u(this,(function(u){switch(u.label){case 0:return u.trys.push([0,8,,9]),[4,this.verify({verification_id:s||t.verification_id,verification_code:String(o)})];case 1:return n=u.sent(),t.is_user?[4,this.signIn({username:e.email||this.formatPhone(e.phone),verification_token:n.verification_token})]:[3,3];case 2:return u.sent(),[3,6];case 3:return delete(r=JSON.parse(JSON.stringify(e))).email,delete r.phone,[4,this.oauthInstance.authApi.signUp(i(i(i({},r),e.email?{email:e.email}:{phone_number:this.formatPhone(e.phone)}),{verification_token:n.verification_token,verification_code:o}))];case 4:return u.sent(),[4,this.createLoginState()];case 5:u.sent(),u.label=6;case 6:return[4,this.getSession()];case 7:return a=u.sent().data,[2,{data:{user:(c=(void 0===a?{}:a).session).user,session:c},error:null}];case 8:return l=u.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(l,{method:"signUp"})}];case 9:return[2]}}))}))}},error:null}];case 4:return n=o.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(n,{method:"signUp"})}];case 5:return[2]}}))}))},t.prototype.signOut=function(e){var t,n;return c(this,void 0,Promise,(function(){var r,o,a;return u(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),r=this.cache.keys.userInfoKey,[4,this.oauthInstance.authApi.signOut(e)];case 1:return o=s.sent(),[4,this.cache.removeStoreAsync(r)];case 2:return s.sent(),this.setAccessKey(),null===(t=this.config.eventBus)||void 0===t||t.fire(p.EVENTS.LOGIN_STATE_CHANGED,{eventType:p.LOGIN_STATE_CHANGED_TYPE.SIGN_OUT}),null===(n=this.config.eventBus)||void 0===n||n.fire(p.EVENTS.AUTH_STATE_CHANGED,{event:p.AUTH_STATE_CHANGED_TYPE.SIGNED_OUT}),[2,i(i({},o),{data:{},error:null})];case 3:return a=s.sent(),[2,{data:{},error:new p.AuthError(a,{method:"signOut"})}];case 4:return[2]}}))}))},t.prototype.onAuthStateChange=function(e){var t=this;this.hasListenerSetUp||(this.setupListeners(),this.hasListenerSetUp=!0);var n=Math.random().toString(36);return this.listeners.has(n)||this.listeners.set(n,new Set),this.listeners.get(n).add(e),{data:{subscription:{id:n,callback:e,unsubscribe:function(){var r=t.listeners.get(n);r&&(r.delete(e),0===r.size&&t.listeners.delete(n))}}}}},t.prototype.signInWithPassword=function(e){return c(this,void 0,Promise,(function(){var t,n,r,o;return u(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),this.validateAtLeastOne(e,[["username"],["email"],["phone"]],"You must provide either username, email, or phone"),this.validateParams(e,{password:{required:!0,message:"Password is required"}}),[4,this.signIn(i({username:e.username||e.email||this.formatPhone(e.phone),password:e.password},e.is_encrypt?{isEncrypt:!0,version:"v2"}:{}))];case 1:return a.sent(),[4,this.getSession()];case 2:return t=a.sent().data,[2,{data:{user:(n=(void 0===t?{}:t).session).user,session:n},error:null}];case 3:return r=a.sent(),(o=new p.AuthError(r,{method:"signInWithPassword"})).category===p.AuthErrorCategory.PROVIDER_NOT_ENABLED?console.error(o.helpMessage):o.category===p.AuthErrorCategory.INVALID_CREDENTIALS||o.category===p.AuthErrorCategory.USER_NOT_FOUND?console.warn(o.helpMessage):console.warn("[CloudBase Auth] signInWithPassword 失败 [".concat(o.category,"]: ").concat(o.message)),o.loginMethodHint&&console.info(o.loginMethodHint),[2,{data:{user:null,session:null},error:o}];case 4:return[2]}}))}))},t.prototype.signInWithIdToken=function(e){return c(this,void 0,Promise,(function(){var t,n,r;return u(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),this.validateParams(e,{token:{required:!0,message:"Token is required"}}),[4,this.signInWithProvider({provider_token:e.token})];case 1:return o.sent(),[4,this.getSession()];case 2:return t=o.sent().data,[2,{data:{user:(n=(void 0===t?{}:t).session).user,session:n},error:null}];case 3:return r=o.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(r,{method:"signInWithIdToken"})}];case 4:return[2]}}))}))},t.prototype.signInWithOtp=function(e){var t,n,r,o;return c(this,void 0,Promise,(function(){var a,s,l=this;return u(this,(function(d){switch(d.label){case 0:if(!(null===(t=e.options)||void 0===t?void 0:t.emailRedirectTo)&&(void 0===(null===(n=e.options)||void 0===n?void 0:n.shouldCreateUser)||(null===(r=e.options)||void 0===r?void 0:r.shouldCreateUser)))return[2,this.signUp({email:e.email,phone:e.phone})];d.label=1;case 1:return d.trys.push([1,3,,4]),this.validateAtLeastOne(e,[["email"],["phone"]],"You must provide either an email or phone number"),[4,this.getVerification(i(i({email_redirect_to:null===(o=e.options)||void 0===o?void 0:o.emailRedirectTo},e.email?{email:e.email}:{phone_number:this.formatPhone(e.phone)}),{target:"USER"}))];case 2:return a=d.sent(),[2,{data:{user:null,session:null,verifyOtp:function(t){var n=t.token,r=t.messageId,o=void 0===r?a.verification_id:r;return c(l,void 0,Promise,(function(){return u(this,(function(t){return[2,this.verifyOtp({email:e.email,phone:e.phone,token:String(n),messageId:o})]}))}))}},error:null}];case 3:return s=d.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(s,{method:"signInWithOtp"})}];case 4:return[2]}}))}))},t.prototype.verifyOAuth=function(e){return c(this,void 0,Promise,(function(){var t,n,r,o,a,s,c,l,d;return u(this,(function(u){switch(u.label){case 0:t={},u.label=1;case 1:return u.trys.push([1,7,,8]),n=(null==e?void 0:e.code)||v.utils.getQuery("code"),r=(null==e?void 0:e.state)||v.utils.getQuery("state"),n?r?(o=(0,f.getBrowserSession)(r),t.type=null==o?void 0:o.type,(a=(null==e?void 0:e.provider)||(null==o?void 0:o.provider)||v.utils.getQuery("provider"))?[4,this.grantProviderToken({provider_id:a,provider_redirect_uri:location.origin+location.pathname,provider_code:n})]:[2,{data:i(i({},t),{user:null,session:null,redirectUrl:null}),error:new p.AuthError({message:"Provider is required"})}]):[2,{data:{user:null,session:null,redirectUrl:null},error:new p.AuthError({message:"State is required"})}]:[2,{data:{user:null,session:null,redirectUrl:null},error:new p.AuthError({message:"Code is required"})}];case 2:return s=u.sent().provider_token,c=void 0,o.type!==p.OAUTH_TYPE.BIND_IDENTITY?[3,4]:[4,this.oauthInstance.authApi.toBindIdentity({provider_token:s,provider:a,fireEvent:!0})];case 3:return c=u.sent(),[3,6];case 4:return[4,this.signInWithIdToken({token:s})];case 5:(c=u.sent()).data=i(i({},t),c.data),u.label=6;case 6:return(l=new URLSearchParams(null===location||void 0===location?void 0:location.search)).delete("code"),l.delete("state"),c.data.redirectUrl=(0,f.addUrlSearch)(void 0===(null==o?void 0:o.search)?"?".concat(l.toString()):null==o?void 0:o.search,(null==o?void 0:o.hash)||location.hash),(0,f.removeBrowserSession)(r),[2,c];case 7:return d=u.sent(),[2,{data:i(i({},t),{user:null,session:null,redirectUrl:null}),error:new p.AuthError(d,{method:"verifyOAuth"})}];case 8:return[2]}}))}))},t.prototype.signInWithOAuth=function(e){var t,n,r,o,i;return c(this,void 0,Promise,(function(){var a,s,c,l,d,h,m,v,b;return u(this,(function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),this.validateParams(e,{provider:{required:!0,message:"Provider is required"}}),a=(null===(t=e.options)||void 0===t?void 0:t.redirectTo)||location.href,s=new URL(a),c=s.origin+s.pathname,l=(null===(n=e.options)||void 0===n?void 0:n.state)||"prd-".concat(e.provider,"-").concat(Math.random().toString(36).slice(2)),[4,this.genProviderRedirectUri({provider_id:e.provider,provider_redirect_uri:c,state:l})];case 1:return d=u.sent().uri,h=decodeURIComponent(d),m=h,(null===(r=e.options)||void 0===r?void 0:r.queryParams)&&(v=new URL(h),Object.entries(e.options.queryParams).forEach((function(e){var t=e[0],n=e[1];v.searchParams.set(t,n)})),m=v.toString()),(0,f.saveToBrowserSession)(l,{provider:e.provider,search:s.search,hash:s.hash,type:(null===(o=e.options)||void 0===o?void 0:o.type)||p.OAUTH_TYPE.SIGN_IN}),g()&&!(null===(i=e.options)||void 0===i?void 0:i.skipBrowserRedirect)&&window.location.assign(m),[2,{data:{url:m,provider:e.provider},error:null}];case 2:return b=u.sent(),[2,{data:{url:null,provider:null},error:new p.AuthError(b,{method:"signInWithOAuth"})}];case 3:return[2]}}))}))},t.prototype.getClaims=function(){return c(this,void 0,Promise,(function(){var e,t;return u(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getAccessToken()];case 1:return e=n.sent().accessToken,[2,{data:(0,p.weAppJwtDecodeAll)(e),error:null}];case 2:return t=n.sent(),[2,{data:{claims:null,header:null,signature:null},error:new p.AuthError(t,{method:"getClaims"})}];case 3:return[2]}}))}))},t.prototype.resetPasswordForEmail=function(e,t){return c(this,void 0,Promise,(function(){var n,r,o,a,s,l,d=this;return u(this,(function(h){switch(h.label){case 0:return h.trys.push([0,2,,3]),this.validateParams({emailOrPhone:e},{emailOrPhone:{required:!0,message:"Email or phone is required"}}),n=(t||{}).redirectTo,r=e.includes("@"),o=void 0,r?o={email:e}:(a=this.formatPhone(e),o={phone_number:a}),[4,this.getVerification(i(i({},o),{target:"USER"}))];case 1:return s=h.sent(),[2,{data:{updateUser:function(t){return c(d,void 0,Promise,(function(){var o,i,a,c;return u(this,(function(u){switch(u.label){case 0:this.validateParams(t,{nonce:{required:!0,message:"Nonce is required"},password:{required:!0,message:"Password is required"}}),u.label=1;case 1:return u.trys.push([1,5,,6]),[4,this.verify({verification_id:s.verification_id,verification_code:t.nonce})];case 2:return o=u.sent(),[4,this.oauthInstance.authApi.resetPassword({email:r?e:void 0,phone_number:r?void 0:e,new_password:t.password,verification_token:o.verification_token})];case 3:return u.sent(),null===(c=this.config.eventBus)||void 0===c||c.fire(p.EVENTS.AUTH_STATE_CHANGED,{event:p.AUTH_STATE_CHANGED_TYPE.PASSWORD_RECOVERY}),[4,this.signInWithPassword({email:r?e:void 0,phone:r?void 0:e,password:t.password})];case 4:return i=u.sent(),n&&g()&&window.location.assign(n),[2,i];case 5:return a=u.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(a,{method:"resetPasswordForEmail"})}];case 6:return[2]}}))}))}},error:null}];case 2:return l=h.sent(),[2,{data:{updateUser:null},error:new p.AuthError(l,{method:"resetPasswordForEmail"})}];case 3:return[2]}}))}))},t.prototype.resetPasswordForOld=function(e){return c(this,void 0,void 0,(function(){var t,n,r;return u(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this.oauthInstance.authApi.updatePasswordByOld({old_password:e.old_password,new_password:e.new_password})];case 1:return o.sent(),[4,this.getSession()];case 2:return t=o.sent().data,[2,{data:{user:(n=(void 0===t?{}:t).session).user,session:n},error:null}];case 3:return r=o.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(r,{method:"resetPasswordForOld"})}];case 4:return[2]}}))}))},t.prototype.verifyOtp=function(e){return c(this,void 0,Promise,(function(){var t,n,r,o,i;return u(this,(function(a){switch(a.label){case 0:return a.trys.push([0,6,,7]),t=e.type,n=String(e.token),this.validateParams(e,{token:{required:!0,message:"Token is required"},messageId:{required:!0,message:"messageId is required"}}),["phone_change","email_change"].includes(t)?[4,this.verify({verification_id:e.messageId,verification_code:n})]:[3,2];case 1:return a.sent(),[3,4];case 2:return[4,this.signInWithUsername({verificationInfo:{verification_id:e.messageId,is_user:!0},verificationCode:n,username:e.email||this.formatPhone(e.phone)||"",loginType:e.email?"email":"phone"})];case 3:a.sent(),a.label=4;case 4:return[4,this.getSession()];case 5:return r=a.sent().data,[2,{data:{user:(o=(void 0===r?{}:r).session).user,session:o},error:null}];case 6:return i=a.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(i,{method:"verifyOtp"})}];case 7:return[2]}}))}))},t.prototype.getSession=function(){return c(this,void 0,Promise,(function(){var e,t,n,r;return u(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this.oauthInstance.oauth2client.getCredentials()];case 1:return(e=o.sent())&&"accessKey"!==e.scope?[4,this.getUser(!1)]:[2,{data:{session:null,user:null},error:null}];case 2:return t=o.sent().data,n=(void 0===t?{}:t).user,[2,{data:{session:i(i({},e),{user:n}),user:n},error:null}];case 3:return r=o.sent(),[2,{data:{session:null,user:null},error:new p.AuthError(r,{method:"getSession"})}];case 4:return[2]}}))}))},t.prototype.refreshSession=function(e){return c(this,void 0,Promise,(function(){var t,n,r,o,a;return u(this,(function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),[4,this.oauthInstance.oauth2client.localCredentials.getCredentials()];case 1:return(t=s.sent()).refresh_token=e||t.refresh_token,[4,this.oauthInstance.oauth2client.refreshToken(t)];case 2:return n=s.sent(),[4,this.getUser(!1)];case 3:return r=s.sent().data,[2,{data:{user:o=(void 0===r?{}:r).user,session:i(i({},n),{user:o})},error:null}];case 4:return a=s.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(a,{method:"refreshSession"})}];case 5:return[2]}}))}))},t.prototype.getUser=function(e){return void 0===e&&(e=!0),c(this,void 0,Promise,(function(){var t,n,r;return u(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this.oauthInstance.oauth2client.getCredentials()];case 1:return(t=o.sent())&&"accessKey"!==t.scope?(n=this.convertToUser,[4,this.getCurrentUser(e)]):[2,{data:{user:null},error:null}];case 2:return[2,{data:{user:n.apply(this,[o.sent()])},error:null}];case 3:return r=o.sent(),[2,{data:{user:null},error:new p.AuthError(r,{method:"getUser"})}];case 4:return[2]}}))}))},t.prototype.refreshUser=function(){return c(this,void 0,Promise,(function(){var e,t,n;return u(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,this.currentUser.refresh()];case 1:return r.sent(),[4,this.getSession()];case 2:return e=r.sent().data,[2,{data:{user:(t=(void 0===e?{}:e).session).user,session:t},error:null}];case 3:return n=r.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(n,{method:"refreshUser"})}];case 4:return[2]}}))}))},t.prototype.updateUser=function(e){var t;return c(this,void 0,Promise,(function(){var n,r,o,a,s,d,h,f,m,v,g,b,y=this;return u(this,(function(_){switch(_.label){case 0:if(_.trys.push([0,8,,9]),!Object.keys(e).some((function(t){return void 0!==e[t]&&null!==e[t]&&""!==e[t]})))throw new p.AuthError({message:"At least one field must be provided for update"});return n=e.email,r=e.phone,o=l(e,["email","phone"]),s=void 0!==r,d={},(a=void 0!==n)||s?(h=void 0,a?(h={email:e.email},f="email_change"):(m=this.formatPhone(e.phone),h={phone_number:m},f="phone_change"),[4,this.getVerification(i({},h))]):[3,4];case 1:return v=_.sent(),Object.keys(o).length>0?[4,this.updateUserBasicInfo(o)]:[3,3];case 2:_.sent(),_.label=3;case 3:return d={messageId:v.verification_id,verifyOtp:function(t){return c(y,void 0,Promise,(function(){var n,r,o,i;return u(this,(function(s){switch(s.label){case 0:return s.trys.push([0,11,,12]),t.email&&e.email===t.email?[4,this.verifyOtp({type:"email_change",email:e.email,token:t.token,messageId:v.verification_id})]:[3,3];case 1:return(n=s.sent()).error?[2,n]:[4,this.updateUserBasicInfo({email:e.email})];case 2:return s.sent(),[3,9];case 3:return t.phone&&e.phone===t.phone?[4,this.verifyOtp({type:"phone_change",phone:e.phone,token:t.token,messageId:v.verification_id})]:[3,6];case 4:return(n=s.sent()).error?[2,n]:[4,this.updateUserBasicInfo({phone:this.formatPhone(e.phone)})];case 5:return s.sent(),[3,9];case 6:return[4,this.verifyOtp({type:f,email:a?e.email:void 0,phone:a?void 0:e.phone,token:t.token,messageId:v.verification_id})];case 7:return(n=s.sent()).error?[2,n]:[4,this.updateUserBasicInfo(e)];case 8:s.sent(),s.label=9;case 9:return[4,this.getUser(!1)];case 10:return r=s.sent().data.user,null===(i=this.config.eventBus)||void 0===i||i.fire(p.EVENTS.AUTH_STATE_CHANGED,{event:p.AUTH_STATE_CHANGED_TYPE.USER_UPDATED}),[2,{data:{user:r},error:null}];case 11:return o=s.sent(),[2,{data:{user:null},error:new p.AuthError(o,{method:"updateUser"})}];case 12:return[2]}}))}))}},[3,6];case 4:return[4,this.updateUserBasicInfo(e)];case 5:_.sent(),_.label=6;case 6:return[4,this.getUser(!1)];case 7:return g=_.sent().data.user,Object.keys(o).length>0&&(null===(t=this.config.eventBus)||void 0===t||t.fire(p.EVENTS.AUTH_STATE_CHANGED,{event:p.AUTH_STATE_CHANGED_TYPE.USER_UPDATED})),[2,{data:i({user:g},d),error:null}];case 8:return b=_.sent(),[2,{data:{user:null},error:new p.AuthError(b,{method:"updateUser"})}];case 9:return[2]}}))}))},t.prototype.getUserIdentities=function(){var e;return c(this,void 0,Promise,(function(){var t,n;return u(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.oauthInstance.authApi.getProviders()];case 1:return t=r.sent(),[2,{data:{identities:null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.filter((function(e){return!!e.bind}))},error:null}];case 2:return n=r.sent(),[2,{data:{identities:null},error:new p.AuthError(n,{method:"getUserIdentities"})}];case 3:return[2]}}))}))},t.prototype.linkIdentity=function(e){return c(this,void 0,Promise,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.validateParams(e,{provider:{required:!0,message:"Provider is required"}}),[4,this.signInWithOAuth({provider:e.provider,options:{type:p.OAUTH_TYPE.BIND_IDENTITY}})];case 1:return n.sent(),[2,{data:{provider:e.provider},error:null}];case 2:return t=n.sent(),[2,{data:{provider:null},error:new p.AuthError(t,{method:"linkIdentity"})}];case 3:return[2]}}))}))},t.prototype.unlinkIdentity=function(e){return c(this,void 0,Promise,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.validateParams(e,{provider:{required:!0,message:"Provider is required"}}),[4,this.oauthInstance.authApi.unbindProvider({provider_id:e.provider})];case 1:return n.sent(),[2,{data:{},error:null}];case 2:return t=n.sent(),[2,{data:{},error:new p.AuthError(t,{method:"unlinkIdentity"})}];case 3:return[2]}}))}))},t.prototype.reauthenticate=function(){return c(this,void 0,Promise,(function(){var e,t,n,r,o=this;return u(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.getUser(!1)];case 1:return e=a.sent().data.user,this.validateAtLeastOne(e,[["email","phone"]],"You must provide either an email or phone number"),t=e.email?{email:e.email}:{phone_number:this.formatPhone(e.phone)},[4,this.getVerification(t)];case 2:return n=a.sent(),[2,{data:{updateUser:function(e){return c(o,void 0,Promise,(function(){var r,o,a,s,c;return u(this,(function(u){switch(u.label){case 0:this.validateParams(e,{nonce:{required:!0,message:"Nonce is required"}}),u.label=1;case 1:return u.trys.push([1,9,,10]),e.password?[4,this.verify({verification_id:n.verification_id,verification_code:e.nonce})]:[3,5];case 2:return r=u.sent(),[4,this.oauthInstance.authApi.sudo({verification_token:r.verification_token})];case 3:return o=u.sent(),[4,this.oauthInstance.authApi.setPassword({new_password:e.password,sudo_token:o.sudo_token})];case 4:return u.sent(),[3,7];case 5:return[4,this.signInWithUsername(i(i({verificationInfo:n,verificationCode:e.nonce},t),{loginType:t.email?"email":"phone"}))];case 6:u.sent(),u.label=7;case 7:return[4,this.getSession()];case 8:return a=u.sent().data,[2,{data:{user:(s=(void 0===a?{}:a).session).user,session:s},error:null}];case 9:return c=u.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(c,{method:"reauthenticate"})}];case 10:return[2]}}))}))}},error:null}];case 3:return r=a.sent(),[2,{data:{updateUser:null},error:new p.AuthError(r,{method:"reauthenticate"})}];case 4:return[2]}}))}))},t.prototype.resend=function(e){return c(this,void 0,Promise,(function(){var t,n,r;return u(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.validateAtLeastOne(e,[["email"],["phone"]],"You must provide either an email or phone number"),t="signup"===e.type?"ANY":"USER",n={target:t},"email"in e&&(n.email=e.email),"phone"in e&&(n.phone_number=this.formatPhone(e.phone)),[4,this.oauthInstance.authApi.getVerification(n)];case 1:return[2,{data:{messageId:o.sent().verification_id},error:null}];case 2:return r=o.sent(),[2,{data:{messageId:null},error:new p.AuthError(r,{method:"resend"})}];case 3:return[2]}}))}))},t.prototype.setSession=function(e){var t;return c(this,void 0,Promise,(function(){var n,r,o;return u(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),this.validateParams(e,{access_token:{required:!0,message:"Access token is required"},refresh_token:{required:!0,message:"Refresh token is required"}}),[4,this.oauthInstance.oauth2client.refreshToken(e,{throwError:!0})];case 1:return i.sent(),[4,this.getSession()];case 2:return n=i.sent().data,r=(void 0===n?{}:n).session,null===(t=this.config.eventBus)||void 0===t||t.fire(p.EVENTS.AUTH_STATE_CHANGED,{event:p.AUTH_STATE_CHANGED_TYPE.SIGNED_IN}),[2,{data:{user:r.user,session:r},error:null}];case 3:return o=i.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(o,{method:"setSession"})}];case 4:return[2]}}))}))},t.prototype.exchangeCodeForSession=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){return[2]}))}))},t.prototype.deleteUser=function(e){return c(this,void 0,Promise,(function(){var t,n;return u(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),this.validateParams(e,{password:{required:!0,message:"Password is required"}}),[4,this.oauthInstance.authApi.sudo(e)];case 1:return t=r.sent().sudo_token,[4,this.oauthInstance.authApi.deleteMe({sudo_token:t})];case 2:return r.sent(),[2,{data:{},error:null}];case 3:return n=r.sent(),[2,{data:{},error:new p.AuthError(n,{method:"deleteUser"})}];case 4:return[2]}}))}))},t.prototype.toDefaultLoginPage=function(e){return void 0===e&&(e={}),c(this,void 0,Promise,(function(){var t,n,r,o,i;return u(this,(function(a){try{return t=e.config_version||"env",n=Object.keys(e.query||{}).map((function(t){return"".concat(t,"=").concat(e.query[t])})).join("&"),h.adapterForWxMp.isMatch()?wx.navigateTo({url:"/packages/$wd_system/pages/login/index".concat(n?"?".concat(n):"")}):(r=e.redirect_uri||window.location.href,o=new URL(r),i="".concat(o.origin,"/__auth/?app_id=").concat(e.app_id||"","&env_id=").concat(this.config.env,"&client_id=").concat(this.config.clientId||this.config.env,"&config_version=").concat(t,"&redirect_uri=").concat(encodeURIComponent(r)).concat(n?"&".concat(n):""),window.location.href=i),[2,{data:{},error:null}]}catch(e){return[2,{data:{},error:new p.AuthError(e,{method:"toDefaultLoginPage"})}]}return[2]}))}))},t.prototype.signInWithCustomTicket=function(e){return c(this,void 0,Promise,(function(){var t,n,r,o;return u(this,(function(a){switch(a.label){case 0:e&&this.setCustomSignFunc(e),a.label=1;case 1:return a.trys.push([1,5,,6]),[4,this.oauthInstance.authApi.signInWithCustomTicket()];case 2:return a.sent(),[4,this.createLoginState()];case 3:return t=a.sent(),[4,this.getSession()];case 4:return n=a.sent().data,r=(void 0===n?{}:n).session,[2,i(i({},t),{data:{user:r.user,session:r},error:null})];case 5:return o=a.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(o,{method:"signInWithCustomTicket"})}];case 6:return[2]}}))}))},t.prototype.signInWithOpenId=function(e){var t=(void 0===e?{}:e).useWxCloud,n=void 0===t||t;return c(this,void 0,Promise,(function(){var e,t,r,o,a,s,l=this;return u(this,(function(d){switch(d.label){case 0:if(!h.adapterForWxMp.isMatch())throw Error("wx api undefined");e=wx.getAccountInfoSync().miniProgram,t=function(t){return c(l,void 0,void 0,(function(){var r,o;return u(this,(function(i){switch(i.label){case 0:r=void 0,o=void 0,i.label=1;case 1:return i.trys.push([1,4,,5]),[4,this.oauthInstance.authApi.grantProviderToken({provider_id:null==e?void 0:e.appId,provider_code:t,provider_params:{provider_code_type:"open_id",appid:null==e?void 0:e.appId}},n)];case 2:if((null==(r=i.sent())?void 0:r.error_code)||!r.provider_token)throw r;return[4,this.oauthInstance.authApi.signInWithProvider({provider_token:r.provider_token},n)];case 3:if(null==(o=i.sent())?void 0:o.error_code)throw o;return[3,5];case 4:throw i.sent();case 5:return[4,this.oauthInstance.oauth2client.setCredentials(o)];case 6:return i.sent(),[2]}}))}))},d.label=1;case 1:return d.trys.push([1,5,,6]),[4,new Promise((function(e,n){wx.login({success:function(r){return c(l,void 0,void 0,(function(){var o;return u(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,t(r.code)];case 1:return i.sent(),e(!0),[3,3];case 2:return o=i.sent(),n(o),[3,3];case 3:return[2]}}))}))},fail:function(e){var t=new Error(null==e?void 0:e.errMsg);t.code=null==e?void 0:e.errno,n(t)}})}))];case 2:return d.sent(),[4,this.createLoginState()];case 3:return r=d.sent(),[4,this.getSession()];case 4:return o=d.sent().data,a=(void 0===o?{}:o).session,[2,i(i({},r),{data:{user:a.user,session:a},error:null})];case 5:return s=d.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(s,{method:"signInWithOpenId"})}];case 6:return[2]}}))}))},t.prototype.signInWithPhoneAuth=function(e){var t=e.phoneCode,n=void 0===t?"":t,r=e.useWxCloud,o=void 0!==r&&r;return c(this,void 0,Promise,(function(){var e,t,r,a,s,c,l,d,f;return u(this,(function(u){switch(u.label){case 0:return h.adapterForWxMp.isMatch()?(e=wx.getAccountInfoSync().miniProgram,t={provider_params:{provider_code_type:"phone",code:n,appid:e.appId},provider_id:e.appId},[4,wx.login()]):[2,{data:{user:null,session:null},error:new p.AuthError({message:"wx api undefined"})}];case 1:r=u.sent().code,t.provider_code=r,u.label=2;case 2:return u.trys.push([2,5,,6]),[4,this.oauthInstance.authApi.grantProviderToken(t,o)];case 3:if((a=u.sent()).error_code)throw a;return[4,this.oauthInstance.authApi.signInWithProvider({provider_token:a.provider_token},o)];case 4:if(null==(s=u.sent())?void 0:s.error_code)throw s;return[3,6];case 5:return c=u.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(c,{method:"signInWithPhoneAuth"})}];case 6:return[4,this.createLoginState()];case 7:return l=u.sent(),[4,this.getSession()];case 8:return d=u.sent().data,f=(void 0===d?{}:d).session,[2,i(i({},l),{data:{user:f.user,session:f},error:null})]}}))}))},t.prototype.bindPhoneNumber=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.editContact(e)]}))}))},t.prototype.unbindProvider=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.unbindProvider(e)]}))}))},t.prototype.bindEmail=function(e){return this.oauthInstance.authApi.editContact(e)},t.prototype.verify=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.verify(e)]}))}))},t.prototype.getVerification=function(e,t){return c(this,void 0,Promise,(function(){return u(this,(function(n){return e.phone_number&&(e.phone_number=this.formatPhone(e.phone_number)),[2,this.oauthInstance.authApi.getVerification(e,t)]}))}))},Object.defineProperty(t.prototype,"currentUser",{get:function(){if("async"!==this.cache.mode){var e=this.hasLoginState();return e&&e.user||null}(0,h.printWarn)(h.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getCurrentUser instead")},enumerable:!1,configurable:!0}),t.prototype.getCurrentUser=function(e){return void 0===e&&(e=!0),c(this,void 0,Promise,(function(){var t,n,r;return u(this,(function(o){switch(o.label){case 0:return o.trys.push([0,4,,5]),e?[4,this.getLoginState()]:[3,3];case 1:return(t=o.sent())?[4,t.user.refresh()]:[3,3];case 2:o.sent(),o.label=3;case 3:return[3,5];case 4:return o.sent(),[3,5];case 5:return[4,this.getLoginState()];case 6:return(n=o.sent())?(r=n.user.getLocalUserInfo(),[4,n.user.checkLocalInfoAsync()]):[3,8];case 7:return o.sent(),[2,i(i({},n.user),r)];case 8:return[2,null]}}))}))},t.prototype.signInAnonymouslyInWx=function(e){var t=(void 0===e?{}:e).useWxCloud;return c(this,void 0,Promise,(function(){var e,n,r=this;return u(this,(function(o){switch(o.label){case 0:if(!h.adapterForWxMp.isMatch())throw Error("wx api undefined");return e=wx.getAccountInfoSync().miniProgram,n=function(n){return c(r,void 0,void 0,(function(){var r,o;return u(this,(function(i){switch(i.label){case 0:r=void 0,o=void 0,i.label=1;case 1:return i.trys.push([1,4,,5]),[4,this.oauthInstance.authApi.grantProviderToken({provider_id:null==e?void 0:e.appId,provider_code:n,provider_params:{provider_code_type:"open_id",appid:null==e?void 0:e.appId}},t)];case 2:if((null==(r=i.sent())?void 0:r.error_code)||!r.provider_token)throw r;return[4,this.oauthInstance.authApi.signInAnonymously({provider_token:r.provider_token},t)];case 3:if(null==(o=i.sent())?void 0:o.error_code)throw o;return[3,5];case 4:throw i.sent();case 5:return[2]}}))}))},[4,new Promise((function(e,t){wx.login({success:function(o){return c(r,void 0,void 0,(function(){var r;return u(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,n(o.code)];case 1:return i.sent(),e(!0),[3,3];case 2:return r=i.sent(),t(r),[3,3];case 3:return[2]}}))}))},fail:function(e){var n=new Error(null==e?void 0:e.errMsg);n.code=null==e?void 0:e.errno,t(n)}})}))];case 1:return o.sent(),[2,this.createLoginState(void 0,{asyncRefreshUser:!0})]}}))}))},t.prototype.bindOpenId=function(){return c(this,void 0,Promise,(function(){var e,t,n=this;return u(this,(function(r){switch(r.label){case 0:if(!h.adapterForWxMp.isMatch())throw Error("wx api undefined");return e=wx.getAccountInfoSync().miniProgram,t=function(t){return c(n,void 0,void 0,(function(){var n;return u(this,(function(r){switch(r.label){case 0:n=void 0,r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this.oauthInstance.authApi.grantProviderToken({provider_id:null==e?void 0:e.appId,provider_code:t,provider_params:{provider_code_type:"open_id",appid:null==e?void 0:e.appId}})];case 2:if((null==(n=r.sent())?void 0:n.error_code)||!n.provider_token)throw n;return[4,this.oauthInstance.authApi.bindWithProvider({provider_token:n.provider_token})];case 3:return r.sent(),[3,5];case 4:throw r.sent();case 5:return[2]}}))}))},[4,new Promise((function(e,r){wx.login({success:function(o){return c(n,void 0,void 0,(function(){var n;return u(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,t(o.code)];case 1:return i.sent(),e(!0),[3,3];case 2:return n=i.sent(),r(n),[3,3];case 3:return[2]}}))}))},fail:function(e){var t=new Error(null==e?void 0:e.errMsg);t.code=null==e?void 0:e.errno,r(t)}})}))];case 1:return r.sent(),[2]}}))}))},t.prototype.signInWithUnionId=function(){return c(this,void 0,Promise,(function(){var e=this;return u(this,(function(t){switch(t.label){case 0:if(!h.adapterForWxMp.isMatch())throw Error("wx api undefined");t.label=1;case 1:return t.trys.push([1,3,,4]),[4,new Promise((function(t,n){var r=wx.getAccountInfoSync().miniProgram;wx.login({success:function(o){return c(e,void 0,void 0,(function(){var e,i,a,s,c;return u(this,(function(u){switch(u.label){case 0:e=null==r?void 0:r.appId,u.label=1;case 1:return u.trys.push([1,4,,5]),[4,this.oauthInstance.authApi.grantProviderToken({provider_code:o.code,provider_id:e,provider_params:{provider_code_type:"union_id",appid:null==r?void 0:r.appId}})];case 2:return i=u.sent(),(a=i.provider_token)?[4,this.oauthInstance.authApi.signInWithProvider({provider_id:e,provider_token:a})]:(n(i),[2]);case 3:return(null==(s=u.sent())?void 0:s.error_code)?(n(s),[2]):(t(!0),[3,5]);case 4:return c=u.sent(),n(c),[3,5];case 5:return[2]}}))}))},fail:function(e){var t=new Error(null==e?void 0:e.errMsg);t.code=null==e?void 0:e.errno,n(t)}})}))];case 2:return t.sent(),[3,4];case 3:throw t.sent();case 4:return[2,this.createLoginState()]}}))}))},t.prototype.signInWithSms=function(e){var t=e.verificationInfo,n=void 0===t?{verification_id:"",is_user:!1}:t,r=e.verificationCode,o=void 0===r?"":r,i=e.phoneNum,a=void 0===i?"":i,s=e.bindInfo,l=void 0===s?void 0:s;return c(this,void 0,Promise,(function(){return u(this,(function(e){try{return[2,this.signInWithUsername({verificationInfo:n,verificationCode:o,bindInfo:l,username:a,loginType:"sms"})]}catch(e){throw e}return[2]}))}))},t.prototype.signInWithEmail=function(e){var t=e.verificationInfo,n=void 0===t?{verification_id:"",is_user:!1}:t,r=e.verificationCode,o=void 0===r?"":r,i=e.bindInfo,a=void 0===i?void 0:i,s=e.email,l=void 0===s?"":s;return c(this,void 0,Promise,(function(){return u(this,(function(e){try{return[2,this.signInWithUsername({verificationInfo:n,verificationCode:o,bindInfo:a,username:l,loginType:"email"})]}catch(e){throw e}return[2]}))}))},t.prototype.setCustomSignFunc=function(e){this.oauthInstance.authApi.setCustomSignFunc(e)},t.prototype.signIn=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.signIn(e)];case 1:return t.sent(),[2,this.createLoginState(e)]}}))}))},t.prototype.setPassword=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.setPassword(e)]}))}))},t.prototype.isUsernameRegistered=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){switch(t.label){case 0:return"string"!=typeof e&&(0,h.throwError)(h.ERRORS.INVALID_PARAMS,"username must be a string"),[4,this.oauthInstance.authApi.checkIfUserExist({username:e})];case 1:return[2,t.sent().exist]}}))}))},t.prototype.hasLoginState=function(){var e;if("async"!==this.cache.mode)return(null===(e=this.oauthInstance)||void 0===e?void 0:e.authApi.hasLoginStateSync())?new y({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance}):null;(0,h.printWarn)(h.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getLoginState instead")},t.prototype.getLoginState=function(){return c(this,void 0,void 0,(function(){var e;return u(this,(function(t){switch(t.label){case 0:e=null,t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.oauthInstance.authApi.getLoginState()];case 2:return e=t.sent(),[3,4];case 3:return t.sent(),[2,null];case 4:return e?[2,new y({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance})]:[2,null]}}))}))},t.prototype.getUserInfo=function(){return c(this,void 0,Promise,(function(){return u(this,(function(e){return[2,this.getCurrentUser()]}))}))},t.prototype.getWedaUserInfo=function(){return c(this,void 0,Promise,(function(){return u(this,(function(e){return[2,this.oauthInstance.authApi.getWedaUserInfo()]}))}))},t.prototype.updateUserBasicInfo=function(e){return c(this,void 0,void 0,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return[4,this.getLoginState()];case 1:return(t=n.sent())?[4,t.user.updateUserBasicInfo(e)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))},t.prototype.getAuthHeader=function(){return console.error("Auth.getAuthHeader API 已废弃"),{}},t.prototype.bindWithProvider=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.bindWithProvider(e)]}))}))},t.prototype.queryUser=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.queryUserProfile(e)]}))}))},t.prototype.getAccessToken=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return[4,this.oauthInstance.oauth2client.getAccessToken()];case 1:return[2,{accessToken:e.sent(),env:this.config.env}]}}))}))},t.prototype.grantProviderToken=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.grantProviderToken(e)]}))}))},t.prototype.patchProviderToken=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.patchProviderToken(e)]}))}))},t.prototype.signInWithProvider=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.signInWithProvider(e)];case 1:return t.sent(),[2,this.createLoginState(e)]}}))}))},t.prototype.signInWithWechat=function(e){return void 0===e&&(e={}),c(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.signInWithWechat(e)];case 1:return t.sent(),[2,this.createLoginState(e)]}}))}))},t.prototype.grantToken=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.grantToken(e)];case 1:return t.sent(),[2,this.createLoginState()]}}))}))},t.prototype.genProviderRedirectUri=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.genProviderRedirectUri(e)]}))}))},t.prototype.resetPassword=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.resetPassword(e)]}))}))},t.prototype.deviceAuthorize=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.deviceAuthorize(e)]}))}))},t.prototype.sudo=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.sudo(e)]}))}))},t.prototype.deleteMe=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.deleteMe(e)]}))}))},t.prototype.getProviders=function(){return c(this,void 0,Promise,(function(){return u(this,(function(e){return[2,this.oauthInstance.authApi.getProviders()]}))}))},t.prototype.loginScope=function(){return c(this,void 0,Promise,(function(){return u(this,(function(e){return[2,this.oauthInstance.authApi.loginScope()]}))}))},t.prototype.loginGroups=function(){return c(this,void 0,Promise,(function(){return u(this,(function(e){return[2,this.oauthInstance.authApi.loginGroups()]}))}))},t.prototype.onLoginStateChanged=function(e){var t;return c(this,void 0,void 0,(function(){var n,r=this;return u(this,(function(o){switch(o.label){case 0:return null===(t=this.config.eventBus)||void 0===t||t.on(p.EVENTS.LOGIN_STATE_CHANGED,(function(t){return c(r,void 0,void 0,(function(){var n,r,o;return u(this,(function(a){switch(a.label){case 0:return(null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.eventType)===p.LOGIN_STATE_CHANGED_TYPE.CREDENTIALS_ERROR?[3,2]:[4,this.getLoginState()];case 1:return r=a.sent(),[3,3];case 2:r={},a.label=3;case 3:return n=r,e.call(this,i(i({},t),n)),[2]}}))}))})),[4,this.getLoginState()];case 1:return n=o.sent(),e.call(this,n),[2]}}))}))},t.prototype.refreshTokenForce=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.refreshTokenForce(e)]}))}))},t.prototype.getCredentials=function(){return c(this,void 0,Promise,(function(){return u(this,(function(e){return[2,this.oauthInstance.authApi.getCredentials()]}))}))},t.prototype.setCredentials=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,this.oauthInstance.oauth2client.setCredentials(e)];case 1:return t.sent(),[2]}}))}))},t.prototype.getProviderSubType=function(){return c(this,void 0,Promise,(function(){return u(this,(function(e){return[2,this.oauthInstance.authApi.getProviderSubType()]}))}))},t.prototype.createCaptchaData=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.createCaptchaData(e)]}))}))},t.prototype.verifyCaptchaData=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.verifyCaptchaData(e)]}))}))},t.prototype.getMiniProgramQrCode=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.getMiniProgramCode(e)]}))}))},t.prototype.getMiniProgramQrCodeStatus=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.getMiniProgramQrCodeStatus(e)]}))}))},t.prototype.modifyPassword=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.modifyPassword(e)]}))}))},t.prototype.modifyPasswordWithoutLogin=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.modifyPasswordWithoutLogin(e)]}))}))},t.prototype.getUserBehaviorLog=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.getUserBehaviorLog(e)]}))}))},t.prototype.signInWithUsername=function(e){var t=e.verificationInfo,n=void 0===t?{verification_id:"",is_user:!1}:t,r=e.verificationCode,o=void 0===r?"":r,a=e.username,s=void 0===a?"":a,l=e.bindInfo,p=void 0===l?void 0:l,d=e.loginType,h=void 0===d?"":d;return c(this,void 0,Promise,(function(){var e,t,r,a,c,l,d;return u(this,(function(u){switch(u.label){case 0:return u.trys.push([0,8,,9]),[4,this.oauthInstance.authApi.verify({verification_id:n.verification_id,verification_code:o})];case 1:if(null==(e=u.sent())?void 0:e.error_code)throw e;return t=e.verification_token,r=this.formatPhone(s),a={phone_number:r},"email"===h&&(a={email:r=s}),n.is_user?[4,this.oauthInstance.authApi.signIn({username:r,verification_token:t})]:[3,5];case 2:if(null==(c=u.sent())?void 0:c.error_code)throw c;return p?[4,this.oauthInstance.authApi.bindWithProvider({provider_token:null==p?void 0:p.providerToken})]:[3,4];case 3:if(null==(l=u.sent())?void 0:l.error_code)throw l;u.label=4;case 4:return[3,7];case 5:return[4,this.oauthInstance.authApi.signUp(i(i({},a),{verification_token:t,provider_token:null==p?void 0:p.providerId}))];case 6:if(null==(d=u.sent())?void 0:d.error_code)throw d;u.label=7;case 7:return[2,this.createLoginState()];case 8:throw u.sent();case 9:return[2]}}))}))},t.prototype.createLoginState=function(e,t){var n,r;return c(this,void 0,Promise,(function(){var o;return u(this,(function(i){switch(i.label){case 0:return[4,(o=new y({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance})).checkLocalStateAsync()];case 1:return i.sent(),(null==t?void 0:t.userInfo)?(o.user.setLocalUserInfo(t.userInfo),[3,5]):[3,2];case 2:return(null==t?void 0:t.asyncRefreshUser)?(o.user.refresh(e),[3,5]):[3,3];case 3:return[4,o.user.refresh(e)];case 4:i.sent(),i.label=5;case 5:return null===(n=this.config.eventBus)||void 0===n||n.fire(p.EVENTS.LOGIN_STATE_CHANGED,{eventType:p.LOGIN_STATE_CHANGED_TYPE.SIGN_IN}),null===(r=this.config.eventBus)||void 0===r||r.fire(p.EVENTS.AUTH_STATE_CHANGED,{event:p.AUTH_STATE_CHANGED_TYPE.SIGNED_IN}),[2,o]}}))}))},t.prototype.setAccessKey=function(){var e,t;return c(this,void 0,void 0,(function(){var n,r;return u(this,(function(o){if(n="",r="",this.config.accessKey?(n=this.config.accessKey,r="accessKey"):(null===(e=this.config.auth)||void 0===e?void 0:e.secretId)&&(null===(t=this.config.auth)||void 0===t?void 0:t.secretKey)&&(n="",r=p.DEFAULT_NODE_ACCESS_SCOPE),!r)return[2];try{this.oauthInstance.oauth2client.setAccessKeyCredentials({access_token:n,token_type:"Bearer",scope:r,expires_at:new Date(+new Date+ +new Date),expires_in:+new Date+ +new Date})}catch(e){console.warn("accessKey error: ",e)}return[2]}))}))},t.prototype.formatPhone=function(e){return!/\s+/.test(e)&&/^\+\d{1,3}\d+/.test(e)?e.replace(/^(\+\d{1,2})(\d+)$/,"$1 $2"):/^\+\d{1,3}\s+/.test(e)?e:"+86 ".concat(e)},t.prototype.notifyListeners=function(e,t,n){this.listeners.forEach((function(r){r.forEach((function(r){try{r(e,t,n)}catch(e){console.error("Error in auth state change callback:",e)}}))}))},t.prototype.setupListeners=function(){var e,t=this;null===(e=this.config.eventBus)||void 0===e||e.on(p.EVENTS.AUTH_STATE_CHANGED,(function(e){return c(t,void 0,void 0,(function(){var t,n,r,o,i;return u(this,(function(a){switch(a.label){case 0:return t=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.event,n=null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.info,[4,this.getSession()];case 1:return r=a.sent().data.session,this.notifyListeners(t,r,n),[2]}}))}))}))},t.prototype.convertToUser=function(e){var t,n,r,o,i,a;if(!e)return null;var s=(null==e?void 0:e.email)||"",c=(null==e?void 0:e.phone_number)||"",u=(null==e?void 0:e.sub)||(null==e?void 0:e.uid)||"";return{id:u,aud:"authenticated",role:null===(n=null===(t=e.groups)||void 0===t?void 0:t.map)||void 0===n?void 0:n.call(t,(function(e){return"string"==typeof e?e:e.id})),email:s||"",email_confirmed_at:(null==e||e.email_verified,e.created_at),phone:c,phone_confirmed_at:c?e.created_at:void 0,confirmed_at:e.created_at,last_sign_in_at:e.last_sign_in_at,app_metadata:{provider:(null===(r=e.loginType)||void 0===r?void 0:r.toLowerCase())||"cloudbase",providers:[(null===(o=e.loginType)||void 0===o?void 0:o.toLowerCase())||"cloudbase"]},user_metadata:{name:null==e?void 0:e.name,picture:null==e?void 0:e.picture,username:null==e?void 0:e.username,gender:null==e?void 0:e.gender,locale:null==e?void 0:e.locale,uid:e.uid,nickName:e.nickName||(null==e?void 0:e.name),avatarUrl:e.avatarUrl||e.picture,location:e.location,hasPassword:null!==(i=e.hasPassword)&&void 0!==i?i:"SET"===e.password,open_id:null==e?void 0:e.open_id},identities:(null===(a=null==e?void 0:e.providers)||void 0===a?void 0:a.map((function(t){return{id:t.id||"",identity_id:t.id||"",user_id:u,identity_data:{provider_id:t.id,provider_user_id:t.provider_user_id,name:t.name},provider:t.id||"cloudbase",created_at:e.created_at,updated_at:e.updated_at,last_sign_in_at:e.last_sign_in_at}})))||[],created_at:e.created_at,updated_at:e.updated_at,is_anonymous:"anonymous"===e.name}},t.prototype.validateParams=function(e,t){for(var n=0,r=Object.entries(t);n<r.length;n++){var o=r[n],i=o[0],a=o[1];if(a.required&&(void 0===(null==e?void 0:e[i])||null===(null==e?void 0:e[i])||""===(null==e?void 0:e[i])))throw new p.AuthError({message:a.message})}},t.prototype.validateAtLeastOne=function(e,t,n){if(!t.some((function(t){return t.some((function(t){return void 0!==(null==e?void 0:e[t])&&null!==(null==e?void 0:e[t])&&""!==(null==e?void 0:e[t])}))})))throw new p.AuthError({message:n})},t.prototype.init=function(){var e;return c(this,void 0,Promise,(function(){return u(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.oauthInstance.oauth2client.localCredentials.getCredentials()];case 1:return t.sent()&&(null===(e=this.config.eventBus)||void 0===e||e.fire(p.EVENTS.AUTH_STATE_CHANGED,{event:p.AUTH_STATE_CHANGED_TYPE.INITIAL_SESSION})),[3,3];case 2:return t.sent(),[3,3];case 3:return[2,{error:null}]}}))}))},a([(0,h.catchErrorsDecorator)({title:"绑定手机号失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindPhoneNumber() 的语法或参数是否正确"," 2 - 当前环境是否开通了短信验证码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",["function"==typeof(n=void 0!==p.authModels&&p.authModels.BindPhoneRequest)?n:Object]),s("design:returntype",Promise)],t.prototype,"bindPhoneNumber",null),a([(0,h.catchErrorsDecorator)({title:"解除三方绑定失败",messages:["请确认以下各项:"," 1 - 调用 auth().unbindProvider() 的语法或参数是否正确"," 2 - 当前账户是否已经与此登录方式解绑","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",["function"==typeof(r=void 0!==p.authModels&&p.authModels.UnbindProviderRequest)?r:Object]),s("design:returntype","function"==typeof(d="undefined"!=typeof Promise&&Promise)?d:Object)],t.prototype,"unbindProvider",null),a([(0,h.catchErrorsDecorator)({title:"绑定邮箱地址失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindEmail() 的语法或参数是否正确"," 2 - 当前环境是否开通了邮箱密码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",["function"==typeof(m=void 0!==p.authModels&&p.authModels.BindEmailRequest)?m:Object]),s("design:returntype",void 0)],t.prototype,"bindEmail",null),a([(0,h.catchErrorsDecorator)({title:"验证码验证失败",messages:["请确认以下各项:"," 1 - 调用 auth().verify() 的语法或参数是否正确"," 2 - 当前环境是否开通了手机验证码/邮箱登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",["function"==typeof(b=void 0!==p.authModels&&p.authModels.VerifyRequest)?b:Object]),s("design:returntype","function"==typeof(_="undefined"!=typeof Promise&&Promise)?_:Object)],t.prototype,"verify",null),a([(0,h.catchErrorsDecorator)({title:"获取验证码失败",messages:["请确认以下各项:"," 1 - 调用 auth().getVerification() 的语法或参数是否正确"," 2 - 当前环境是否开通了手机验证码/邮箱登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",["function"==typeof(x=void 0!==p.authModels&&p.authModels.GetVerificationRequest)?x:Object,Object]),s("design:returntype","function"==typeof(w="undefined"!=typeof Promise&&Promise)?w:Object)],t.prototype,"getVerification",null),a([(0,h.catchErrorsDecorator)({title:"获取用户信息失败",messages:["请确认以下各项:"," 1 - 调用 auth().getCurrentUser() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[Object]),s("design:returntype","function"==typeof(E="undefined"!=typeof Promise&&Promise)?E:Object)],t.prototype,"getCurrentUser",null),a([(0,h.catchErrorsDecorator)({title:"小程序匿名登录失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了匿名登录"," 2 - 调用 auth().signInAnonymouslyInWx() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[Object]),s("design:returntype","function"==typeof(I="undefined"!=typeof Promise&&Promise)?I:Object)],t.prototype,"signInAnonymouslyInWx",null),a([(0,h.catchErrorsDecorator)({title:"小程序绑定OpenID失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序openId静默登录"," 2 - 调用 auth().bindOpenId() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[]),s("design:returntype","function"==typeof(S="undefined"!=typeof Promise&&Promise)?S:Object)],t.prototype,"bindOpenId",null),a([(0,h.catchErrorsDecorator)({title:"小程序unionId静默登录失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序unionId静默登录"," 2 - 调用 auth().signInWithUnionId() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[]),s("design:returntype","function"==typeof(O="undefined"!=typeof Promise&&Promise)?O:Object)],t.prototype,"signInWithUnionId",null),a([(0,h.catchErrorsDecorator)({title:"短信验证码登陆",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序短信验证码登陆"," 2 - 调用 auth().signInWithSms() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[Object]),s("design:returntype","function"==typeof(T="undefined"!=typeof Promise&&Promise)?T:Object)],t.prototype,"signInWithSms",null),a([(0,h.catchErrorsDecorator)({title:"邮箱验证码登陆",messages:["请确认以下各项:"," 1 - 当前环境是否开启了邮箱登陆"," 2 - 调用 auth().signInWithEmail() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[Object]),s("design:returntype","function"==typeof(A="undefined"!=typeof Promise&&Promise)?A:Object)],t.prototype,"signInWithEmail",null),a([(0,h.catchErrorsDecorator)({title:"获取用户是否被占用失败",messages:["请确认以下各项:"," 1 - 调用 auth().isUsernameRegistered() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[String]),s("design:returntype","function"==typeof(P="undefined"!=typeof Promise&&Promise)?P:Object)],t.prototype,"isUsernameRegistered",null),a([(0,h.catchErrorsDecorator)({title:"获取本地登录态失败",messages:["请确认以下各项:"," 1 - 调用 auth().getLoginState() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[]),s("design:returntype",Promise)],t.prototype,"getLoginState",null),a([(0,h.catchErrorsDecorator)({title:"获取用户信息失败",messages:["请确认以下各项:"," 1 - 是否已登录"," 2 - 调用 auth().getUserInfo() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[]),s("design:returntype","function"==typeof(C="undefined"!=typeof Promise&&Promise)?C:Object)],t.prototype,"getUserInfo",null),a([(0,h.catchErrorsDecorator)({title:"获取微搭插件用户信息失败",messages:["请确认以下各项:"," 1 - 是否已登录"," 2 - 调用 auth().getWedaUserInfo() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[]),s("design:returntype","function"==typeof(R="undefined"!=typeof Promise&&Promise)?R:Object)],t.prototype,"getWedaUserInfo",null),a([(0,h.catchErrorsDecorator)({title:"绑定第三方登录方式失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindWithProvider() 的语法或参数是否正确"," 2 - 此账户是否已经绑定此第三方","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",["function"==typeof(N=void 0!==p.authModels&&p.authModels.BindWithProviderRequest)?N:Object]),s("design:returntype","function"==typeof(k="undefined"!=typeof Promise&&Promise)?k:Object)],t.prototype,"bindWithProvider",null),a([(0,h.catchErrorsDecorator)({title:"获取身份源类型",messages:["请确认以下各项:"," 1 - 调用 auth().getProviderSubType() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[]),s("design:returntype","function"==typeof(j="undefined"!=typeof Promise&&Promise)?j:Object)],t.prototype,"getProviderSubType",null),t}(m.AuthV1Compat);function x(e,t){var n,r,o,a,s=this,l=e.region,f=void 0===l?"ap-shanghai":l,m=e.i18n,v=e.accessKey,g=e.useWxCloud,b=(null==t?void 0:t.platform)||h.useDefaultAdapter.bind(t)(),y=b.runtime,x=b.adapter,w=t||{},E=w.env,I=w.clientId,S=w.debug,O=w.cache,T=w.app,A=w.getApiOrigin,P=(t||{}).apiOrigin;P||(P="https://".concat(E,".").concat(f,".tcb-api.tencentcloudapi.com"));var C,R={env:E,clientId:I,i18n:m,accessKey:v,useWxCloud:g,eventBus:new h.CloudbaseEventEmitter},N=new p.CloudbaseOAuth((0,d.useAuthAdapter)(i(i({},R),{apiOrigin:P,getApiOrigin:A,apiPath:(null==e?void 0:e.apiPath)||p.AUTH_API_PREFIX,storage:null==e?void 0:e.storage,baseRequest:null==e?void 0:e.baseRequest,request:null==e?void 0:e.request,anonymousSignInFunc:null==e?void 0:e.anonymousSignInFunc,captchaOptions:null==e?void 0:e.captchaOptions,wxCloud:null==e?void 0:e.wxCloud,adapter:x,onCredentialsError:(C=R.eventBus,function(e){C.fire(p.EVENTS.LOGIN_STATE_CHANGED,i(i({},e),{eventType:p.LOGIN_STATE_CHANGED_TYPE.CREDENTIALS_ERROR}))}),headers:i({"X-SDK-Version":"@cloudbase/js-sdk/".concat(e.sdkVersion)},e.headers||{}),detectSessionInUrl:e.detectSessionInUrl,debug:S,auth:null===(r=null===(n=t.app)||void 0===n?void 0:n.config)||void 0===r?void 0:r.auth}))),k=new _(i(i({},R),{region:f,persistence:e.persistence,debug:S,cache:O||new h.CloudbaseCache({persistence:e.persistence,keys:{userInfoKey:"user_info_".concat(E)},platformInfo:b}),runtime:y||"web",_fromApp:T,oauthInstance:N,auth:null===(a=null===(o=t.app)||void 0===o?void 0:o.config)||void 0===a?void 0:a.auth}));return N.initializeSession((function(e,t){return c(s,void 0,void 0,(function(){return u(this,(function(n){return e?(e.type===p.OAUTH_TYPE.SIGN_IN?t?R.eventBus.fire(p.EVENTS.AUTH_STATE_CHANGED,{event:p.AUTH_STATE_CHANGED_TYPE.SIGNED_IN,info:i(i({},e),{error:t})}):e.user&&k.createLoginState({},{userInfo:e.user}):e.type===p.OAUTH_TYPE.BIND_IDENTITY&&R.eventBus.fire(p.EVENTS.AUTH_STATE_CHANGED,{event:p.AUTH_STATE_CHANGED_TYPE.BIND_IDENTITY,info:i(i({},e),{error:t})}),[2]):[2]}))}))})),{authInstance:k,oauthInstance:N}}t.Auth=_,t.generateAuthInstance=x;var w="auth";function E(e,t){for(var n=[],r=0;r<=e.length;r++)n[r]=[r];for(var o=0;o<=t.length;o++)n[0][o]=o;for(r=1;r<=e.length;r++)for(o=1;o<=t.length;o++){var i=e[r-1].toLowerCase()===t[o-1].toLowerCase()?0:1;n[r][o]=Math.min(n[r-1][o]+1,n[r][o-1]+1,n[r-1][o-1]+i)}return n[e.length][t.length]}var I={name:"auth",namespace:w,entity:function(e){var t=function(e){var t,n=this;if(this.authInstance&&!e)return this.authInstance;e=e||{region:"",persistence:"local",apiPath:p.AUTH_API_PREFIX};var r=this.platform.adapter,o=e.persistence||r.primaryStorage;o&&o!==this.config.persistence&&this.updateConfig({persistence:o});var a=x(i(i({wxCloud:this.config.wxCloud,storage:this.config.storage},e),{persistence:this.config.persistence,i18n:this.config.i18n,accessKey:this.config.accessKey,useWxCloud:this.config.useWxCloud,sdkVersion:this.version,detectSessionInUrl:null===(t=this.config.auth)||void 0===t?void 0:t.detectSessionInUrl}),{env:this.config.env,clientId:this.config.clientId,getApiOrigin:function(){return n.request.getBaseEndPoint(n.config.endPointMode||"CLOUD_API")},platform:this.platform,cache:this.cache,app:this,debug:this.config.debug}),s=a.authInstance,c=a.oauthInstance;return this.oauthInstance=c,this.authInstance=s,this.authInstance},n=t.call(this,e);Object.assign(t,n),Object.setPrototypeOf(t,Object.getPrototypeOf(n));var r="undefined"!=typeof Proxy?new Proxy(t,{get:function(e,t,n){var r=Reflect.get(e,t,n);if(void 0!==r||"string"!=typeof t)return r;var o=function(e,t){for(var n=null,r=1/0,o=0,i=t;o<i.length;o++){var a=i[o];if(!a.startsWith("_")&&"constructor"!==a){var s=E(e,a);s<r&&(r=s,n=a)}}return n}(t,Object.getOwnPropertyNames(Object.getPrototypeOf(e)).concat(Object.keys(e)).filter((function(t){return"function"==typeof e[t]})));return o&&console.warn("[CloudBase Auth] auth.".concat(t," is not a function. Did you mean: auth.").concat(o,"() ?")),r}}):t;return this[w]=r,r}};try{cloudbase.registerComponent(I)}catch(e){}var S=n(6722);Object.defineProperty(t,"AuthErrorCategory",{enumerable:!0,get:function(){return S.AuthErrorCategory}}),Object.defineProperty(t,"AuthErrorCode",{enumerable:!0,get:function(){return S.AuthErrorCode}}),Object.defineProperty(t,"AuthError",{enumerable:!0,get:function(){return S.AuthError}}),t.registerAuth=function(e){try{e.registerComponent(I)}catch(e){console.warn(e)}}},1019:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useDefaultAdapter=t.adapterForWxMp=t.CloudbaseCache=t.CloudbaseEventEmitter=t.catchErrorsDecorator=t.COMMUNITY_SITE_URL=t.ERRORS=t.throwError=t.printWarn=void 0;var o=n(3616);Object.defineProperty(t,"printWarn",{enumerable:!0,get:function(){return o.printWarn}}),Object.defineProperty(t,"throwError",{enumerable:!0,get:function(){return o.throwError}});var i=n(794);Object.defineProperty(t,"ERRORS",{enumerable:!0,get:function(){return i.ERRORS}}),Object.defineProperty(t,"COMMUNITY_SITE_URL",{enumerable:!0,get:function(){return i.COMMUNITY_SITE_URL}});var a=n(141);Object.defineProperty(t,"catchErrorsDecorator",{enumerable:!0,get:function(){return a.catchErrorsDecorator}});var s=n(9689);Object.defineProperty(t,"CloudbaseEventEmitter",{enumerable:!0,get:function(){return s.CloudbaseEventEmitter}});var c=n(6197);Object.defineProperty(t,"CloudbaseCache",{enumerable:!0,get:function(){return c.CloudbaseCache}});var u=n(7917);Object.defineProperty(t,"adapterForWxMp",{enumerable:!0,get:function(){return r(u).default}});var l=n(8182);Object.defineProperty(t,"useDefaultAdapter",{enumerable:!0,get:function(){return l.useDefaultAdapter}})},5266:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeUrlParams=t.addUrlSearch=t.removeBrowserSession=t.getBrowserSession=t.saveToBrowserSession=void 0,t.saveToBrowserSession=function(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){console.error("Failed to save to browser session:",e)}},t.getBrowserSession=function(e){try{return JSON.parse(sessionStorage.getItem(e))}catch(e){return console.error("Failed to get browser session:",e),null}},t.removeBrowserSession=function(e){try{return sessionStorage.removeItem(e),!0}catch(e){return console.error("Failed to remove browser session:",e),null}},t.addUrlSearch=function(e,t){if(void 0!==e){var n=new URL(window.location.href);return n.search=e,n.hash=t||n.hash,window.history.replaceState({},"",n.href),n.href}},t.removeUrlParams=function(e){if("undefined"!=typeof window)try{var t=new URL(window.location.href);e.forEach((function(e){t.searchParams.delete(e)})),window.history.replaceState({},"",t.href)}catch(e){console.error("Failed to remove URL params:",e)}}},916:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.applyUserV1Compat=t.AuthV1Compat=t.AnonymousAuthProvider=t.CustomAuthProvider=t.WeixinAuthProvider=void 0;var a=n(6722),s=n(1019),c=function(){function e(e){}return e.prototype.signInWithRedirect=function(){throw new Error("[v1 兼容] WeixinAuthProvider.signInWithRedirect() 在当前版本中无法实现。 建议使用 auth.signInWithOAuth({ provider: 'providerId' }) 替代。")},e.prototype.getRedirectResult=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(e){throw new Error("[v1 兼容] WeixinAuthProvider.getRedirectResult() 在当前版本中无法实现。 建议使用 auth.verifyOAuth({ code, state, provider }) 替代。")}))}))},e.prototype.getLinkRedirectResult=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(e){throw new Error("[v1 兼容] WeixinAuthProvider.getLinkRedirectResult() 在当前版本中无法实现。 建议使用 auth.linkIdentity({ provider: 'providerId' }) 替代。")}))}))},e}();t.WeixinAuthProvider=c;var u=function(){function e(e){this.authInstance=e.authInstance}return e.prototype.signIn=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.authInstance.signInWithCustomTicket((function(){return Promise.resolve(e)}))];case 1:return t.sent(),[2]}}))}))},e}();t.CustomAuthProvider=u;var l=function(){function e(e){this.authInstance=e.authInstance}return e.prototype.signIn=function(){return o(this,void 0,Promise,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.authInstance.signInAnonymously({})];case 1:return e.sent(),[2]}}))}))},e}();t.AnonymousAuthProvider=l;var p=function(){function e(){}return e.prototype.weixinAuthProvider=function(e){return new c({authInstance:this,appid:e.appid,scope:e.scope})},e.prototype.customAuthProvider=function(){return new u({authInstance:this})},e.prototype.anonymousAuthProvider=function(){return new l({authInstance:this})},e.prototype.signUpWithEmailAndPassword=function(e,t){return o(this,void 0,Promise,(function(){return i(this,(function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"email must be a string"),"string"!=typeof t&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"password must be a string"),[4,this.signUp({email:e,password:t})];case 1:return[2,n.sent()]}}))}))},e.prototype.signInWithEmailAndPassword=function(e,t){return o(this,void 0,Promise,(function(){return i(this,(function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"email must be a string"),"string"!=typeof t&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"password must be a string"),[4,this.signIn({username:e,password:t})];case 1:return n.sent(),[2,this.createLoginState()]}}))}))},e.prototype.sendPasswordResetEmail=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){switch(t.label){case 0:return"string"!=typeof e&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"email must be a string"),[4,this.getVerification({email:e})];case 1:return t.sent(),[2]}}))}))},e.prototype.signInWithUsernameAndPassword=function(e,t){return o(this,void 0,Promise,(function(){return i(this,(function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"username must be a string"),"string"!=typeof t&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"password must be a string"),[4,this.signIn({username:e,password:t})];case 1:return n.sent(),[2,this.createLoginState()]}}))}))},e.prototype.sendPhoneCode=function(e){return o(this,void 0,Promise,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"phoneNumber must be a string"),t=this.formatPhone(e),[4,this.getVerification({phone_number:t})];case 1:return n.sent(),[2,!0]}}))}))},e.prototype.signUpWithPhoneCode=function(e,t,n){return o(this,void 0,Promise,(function(){var o;return i(this,(function(i){switch(i.label){case 0:return"string"!=typeof e&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"phoneNumber must be a string"),"string"!=typeof t&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"phoneCode must be a string"),o=this.formatPhone(e),[4,this.signUp(r({phone_number:o,verification_code:t},n?{password:n}:{}))];case 1:return i.sent(),[2,this.createLoginState()]}}))}))},e.prototype.signInWithPhoneCodeOrPassword=function(e){return o(this,void 0,Promise,(function(){var t,n,r,o;return i(this,(function(i){switch(i.label){case 0:return t=e.phoneNumber,n=e.phoneCode,r=e.password,"string"!=typeof t&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"phoneNumber must be a string"),o=this.formatPhone(t),r?[4,this.signIn({username:o,password:r})]:[3,2];case 1:return i.sent(),[3,5];case 2:return n?[4,this.signIn({username:o,verification_token:n})]:[3,4];case 3:return i.sent(),[3,5];case 4:(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"phoneCode or password must be provided"),i.label=5;case 5:return[2,this.createLoginState()]}}))}))},e.prototype.forceResetPwdByPhoneCode=function(e){return o(this,void 0,Promise,(function(){var t,n,r,o;return i(this,(function(i){switch(i.label){case 0:return t=e.phoneNumber,n=e.phoneCode,r=e.password,"string"!=typeof t&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"phoneNumber must be a string"),"string"!=typeof n&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"phoneCode must be a string"),"string"!=typeof r&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"password must be a string"),o=this.formatPhone(t),[4,this.resetPassword({phone_number:o,new_password:r,verification_token:n})];case 1:return i.sent(),[4,this.signIn({username:o,password:r})];case 2:return i.sent(),[2,this.createLoginState()]}}))}))},e.prototype.shouldRefreshAccessToken=function(e){throw new Error("[v1 兼容] shouldRefreshAccessToken() 在当前版本中无法实现。 建议使用 auth.onAuthStateChange(callback) 来监听 TOKEN_REFRESHED 事件替代。")},e.prototype.onLoginStateExpired=function(e){var t=this;this.onLoginStateChanged((function(n){(null==n?void 0:n.eventType)===a.LOGIN_STATE_CHANGED_TYPE.CREDENTIALS_ERROR&&e.call(t)}))},e.prototype.onAccessTokenRefreshed=function(e){var t=this;this.onAuthStateChange((function(n){n===a.AUTH_STATE_CHANGED_TYPE.TOKEN_REFRESHED&&e.call(t)}))},e.prototype.onAnonymousConverted=function(e){var t=this;this.onAuthStateChange((function(n){n===a.AUTH_STATE_CHANGED_TYPE.SIGNED_IN&&e.call(t)}))},e.prototype.onLoginTypeChanged=function(e){var t=this;this.onAuthStateChange((function(n){n!==a.AUTH_STATE_CHANGED_TYPE.SIGNED_IN&&n!==a.AUTH_STATE_CHANGED_TYPE.SIGNED_OUT||e.call(t)}))},e}();t.AuthV1Compat=p,t.applyUserV1Compat=function(e){e.prototype.linkWithTicket=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(e){throw new Error("[v1 兼容] User.linkWithTicket() 在当前版本中无法实现。 建议使用 auth.signInWithCustomTicket(() => Promise.resolve(ticket)) 替代。")}))}))},e.prototype.linkWithRedirect=function(e){throw new Error("[v1 兼容] User.linkWithRedirect() 在当前版本中无法实现。 建议使用 auth.linkIdentity({ provider: 'providerId' }) 替代。")},e.prototype.updateEmail=function(e,t){return o(this,void 0,Promise,(function(){return i(this,(function(t){switch(t.label){case 0:return"string"!=typeof e&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"newEmail must be a string"),[4,this.updateUserBasicInfo({email:e})];case 1:return t.sent(),[2]}}))}))},e.prototype.linkWithPhoneNumber=function(e,t){return o(this,void 0,Promise,(function(){return i(this,(function(e){throw new Error("[v1 兼容] User.linkWithPhoneNumber() 在当前版本中无法实现。 建议使用 auth.bindPhoneNumber({ phone_number, verification_token, sudo_token }) 替代。")}))}))},e.prototype.updatePhoneNumber=function(e,t){return o(this,void 0,Promise,(function(){return i(this,(function(e){throw new Error("[v1 兼容] User.updatePhoneNumber() 在当前版本中无法实现。 建议使用 auth.updateUser({ phone: newPhoneNumber }) 替代。")}))}))},e.prototype.unlink=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(e){throw new Error("[v1 兼容] User.unlink() 在当前版本中无法实现。 建议使用 auth.unlinkIdentity({ provider: loginType }) 替代。")}))}))}}},3198:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.registerDatabase=void 0;var c=n(543),u=n(2701),l={filterRes:function(e){return delete e.header,delete e.statusCode,e},flattenResData:function(e){if("object"==typeof e.data&&null!==e.data){var t=i(i({},e),e.data);return delete t.data,t}return e},safeParseEJSON:function(e){if("string"!=typeof e)return e;try{return u.EJSON.parse(e)}catch(t){return e}},buildQueryParams:function(e){return Object.entries(e).filter((function(e){e[0];var t=e[1];return null!=t&&""!==t})).map((function(e){var t=e[0],n=e[1],r="object"==typeof n?JSON.stringify(n):String(n);return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(r))})).join("&")},getUrlPrefix:function(e){var t=(null==e?void 0:e.instance)||"(default)",n=(null==e?void 0:e.database)||"(default)";return"/database/instances/".concat(t,"/databases/").concat(n)},"database.queryDocument":function(e){var t,n,r,o,c,p,d,h;return a(this,void 0,Promise,(function(){var a,f,m,v;return s(this,(function(s){switch(s.label){case 0:return a=!!(null===(n=null===(t=e.query)||void 0===t?void 0:t._id)||void 0===n?void 0:n.$eq),f=l.buildQueryParams(i({projection:e.projection,transactionId:e.transactionId},a?{}:{offset:null!==(r=e.offset)&&void 0!==r?r:0,limit:null!==(o=e.limit)&&void 0!==o?o:100,order:e.order,query:e.query?u.EJSON.stringify(e.query,{relaxed:!1}):void 0})),m="".concat(l.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents?").concat(f),a&&(m="".concat(l.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents/").concat((null===(c=e.query._id)||void 0===c?void 0:c.$eq)||e.query._id,"?").concat(f)),[4,this.gateWay({url:m,method:"GET"})];case 1:return(v=s.sent()).data=l.safeParseEJSON(JSON.stringify(v.data)),!a||v.code||(null===(p=v.data)||void 0===p?void 0:p.code)?(v.code||(null===(d=v.data)||void 0===d?void 0:d.code)?v=i(i({},v),{code:v.code||(null===(h=v.data)||void 0===h?void 0:h.code),data:i(i({},v.data),{list:[]})}):Array.isArray(v.data)?v=i(i({},v),{data:{list:v.data}}):v.data&&!Array.isArray(v.data.list)&&(v=i(i({},v),{data:i(i({},v.data),{list:[]})})),[2,l.filterRes(v)]):[2,i(i({},v),{data:{list:[v.data]}})]}}))}))},"database.addDocument":function(e){var t,n,r;return a(this,void 0,Promise,(function(){var o;return s(this,(function(a){switch(a.label){case 0:return[4,this.gateWay({url:"".concat(l.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents"),method:"POST",data:i({data:Array.isArray(e.data)?e.data:[e.data]},e.transactionId&&{transactionId:e.transactionId})})];case 1:return o=a.sent(),Array.isArray(e.data)?o=i(i({},o),{data:i({ids:(null===(t=o.data)||void 0===t?void 0:t.insertedIds)||[]},o.data)}):(null===(r=null===(n=o.data)||void 0===n?void 0:n.insertedIds)||void 0===r?void 0:r[0])&&(o=i(i({},o),{data:i({_id:o.data.insertedIds[0]},o.data)})),[2,l.filterRes(o)]}}))}))},"database.updateDocument":function(e){return a(this,void 0,Promise,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(l.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents"),method:"PATCH",data:i({query:e.query,data:e.data,multi:!!e.multi,upsert:!!e.upsert,replaceMode:!!e.replaceMode},e.transactionId&&{transactionId:e.transactionId})})];case 1:return t=n.sent(),[2,l.filterRes(t)]}}))}))},"database.deleteDocument":function(e){return a(this,void 0,Promise,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(l.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents/remove"),method:"POST",data:i({query:e.query,multi:!!e.multi},e.transactionId&&{transactionId:e.transactionId})})];case 1:return t=n.sent(),[2,l.filterRes(t)]}}))}))},"database.countDocument":function(e){return a(this,void 0,Promise,(function(){var t,n;return s(this,(function(r){switch(r.label){case 0:return t=l.buildQueryParams({count:!0,query:e.query?u.EJSON.stringify(e.query,{relaxed:!1}):void 0}),[4,this.gateWay({url:"".concat(l.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents?").concat(t),method:"GET"})];case 1:return n=r.sent(),[2,l.filterRes(n)]}}))}))},"database.addCollection":function(e){return a(this,void 0,Promise,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(l.getUrlPrefix(e),"/collections"),method:"POST",data:{collectionName:e.collectionName}})];case 1:return t=n.sent(),[2,l.filterRes(t)]}}))}))},"database.aggregate":function(e){var t;return a(this,void 0,Promise,(function(){var n,r;return s(this,(function(o){switch(o.label){case 0:return n=e.stages.map((function(e){var t,n;try{var r="string"==typeof e.stageValue?JSON.parse(e.stageValue):e.stageValue;return(t={})[e.stageKey]=u.EJSON.serialize(r),t}catch(t){return(n={})[e.stageKey]=e.stageValue,n}})),[4,this.gateWay({url:"".concat(l.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents/aggregations"),method:"POST",data:{pipeline:n}})];case 1:return r=o.sent(),Array.isArray(null===(t=r.data)||void 0===t?void 0:t.list)&&(r.data.list=JSON.stringify(r.data.list.map((function(e){return JSON.stringify(e)})))),[2,l.filterRes(r)]}}))}))},"database.startTransaction":function(e){return a(this,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(l.getUrlPrefix(e),"/transactions"),method:"POST"})];case 1:return t=n.sent(),[2,l.filterRes(l.flattenResData(t))]}}))}))},"database.commitTransaction":function(e){return a(this,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(l.getUrlPrefix(e),"/transactions/").concat(e.transactionId,"/commit"),method:"POST"})];case 1:return t=n.sent(),[2,l.filterRes(t)]}}))}))},"database.abortTransaction":function(e){return a(this,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(l.getUrlPrefix(e),"/transactions/").concat(e.transactionId,"/rollback"),method:"POST"})];case 1:return t=n.sent(),[2,l.filterRes(t)]}}))}))},"database.getInTransaction":function(e){var t;return a(this,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return[4,l["database.queryDocument"].call(this,e)];case 1:return"object"==typeof(n=r.sent()).data&&null!==n.data?(null===(t=n.data)||void 0===t?void 0:t.code)?[2,l.flattenResData(n)]:[2,i(i({},n),{data:JSON.stringify(n.data)})]:[2,n]}}))}))},"database.updateDocInTransaction":function(e){return a(this,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return e.data=l.safeParseEJSON(e.data),[4,l["database.updateDocument"].call(this,e)];case 1:return t=n.sent(),[2,l.flattenResData(t)]}}))}))},"database.deleteDocInTransaction":function(e){return a(this,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,l["database.deleteDocument"].call(this,e)];case 1:return t=n.sent(),[2,l.flattenResData(t)]}}))}))},"database.insertDocInTransaction":function(e){var t;return a(this,void 0,Promise,(function(){var n,r;return s(this,(function(o){switch(o.label){case 0:return e.data=l.safeParseEJSON(e.data),[4,l["database.addDocument"].call(this,e)];case 1:return"object"==typeof(n=o.sent()).data&&null!==n.data?(r=!!(null===(t=n.data)||void 0===t?void 0:t._id),n=i(i(i({},n),{inserted:r?1:0,ok:r?1:0}),n.data)):n=i({inserted:0,ok:0},n),delete n.data,[2,n]}}))}))},"database.runCommands":function(e){return a(this,void 0,Promise,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(l.getUrlPrefix(e),"/commands"),method:"POST",data:i({commands:u.EJSON.serialize(e.commands)},e.transactionId&&{transactionId:e.transactionId})})];case 1:"object"==typeof(t=n.sent()).data&&null!==t.data&&(delete(t=i(i({},t),t.data)).data,delete t.request_id);try{t=u.EJSON.deserialize(t)}catch(e){}return[2,l.filterRes(t)]}}))}))}},p={name:"database",entity:{database:function(e){var t=this.platform,n=t.adapter,r=t.runtime,u=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype.send=function(t,n){return a(this,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:return r=null,"GATEWAY"===this.config.endPointMode&&l[t]?[4,l[t].call(this,n)]:[3,2];case 1:return r=o.sent(),[3,4];case 2:return[4,e.prototype.send.call(this,t,n)];case 3:r=o.sent(),o.label=4;case 4:return[2,r]}}))}))},t}(this.request.constructor);return c.Db.reqClass=u,c.Db.getAccessToken=this.authInstance?this.authInstance.getAccessToken.bind(this.authInstance):function(){return""},c.Db.runtime=r,this.wsClientClass&&(c.Db.wsClass=n.wsClass,c.Db.wsClientClass=this.wsClientClass),c.Db.ws||(c.Db.ws=null),new(function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype.runCommands=function(e){return a(this,void 0,Promise,(function(){return s(this,(function(t){return[2,c.Db.createRequest(this.config).send("database.runCommands",e)]}))}))},t}(c.Db))(i(i(i({},this.config),{_fromApp:this}),e))}}};try{cloudbase.registerComponent(p)}catch(e){}function d(e){try{e.registerComponent(p)}catch(e){console.warn(e)}}t.registerDatabase=d;try{window.registerDatabase=d}catch(e){}},4144:function(e,t,n){"use strict";var r=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(n(6950)),o=n(9895),i=n(1060),a=n(3456),s=n(7209),c=n(3645),u=n(5337),l=n(9253),p=n(9126),d=n(1944),h=n(3198);r.default.registerVersion("3.5.3");try{var f=n(7922).getSdkVersion,m=n(2293);r.default.useAdapters(m.default);var v=r.default;v.version=f(),v.SYMBOL_CURRENT_ENV=m.SYMBOL_CURRENT_ENV,v.SYMBOL_DEFAULT_ENV=m.SYMBOL_DEFAULT_ENV,v.parseContext=m.parseContext,v.getCloudbaseContext=m.getCloudbaseContext}catch(e){}try{(0,o.registerAuth)(r.default),(0,i.registerFunctions)(r.default),(0,a.registerStorage)(r.default),(0,h.registerDatabase)(r.default),(0,s.registerRealtime)(r.default),(0,c.registerModel)(r.default),(0,u.registerAi)(r.default),(0,l.registerCloudrun)(r.default),(0,p.registerMySQL)(r.default),(0,d.registerApis)(r.default)}catch(e){}try{window.cloudbase=r.default}catch(e){}t.default=r.default,e.exports=r.default},9253:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.registerCloudrun=t.requestContainer=void 0;var a=n(2877).constants.ERRORS,s="cloudrun",c=function(){function e(){}return e.prototype.callContainer=function(e,t){return o(this,void 0,void 0,(function(){var n,o,c;return i(this,(function(i){switch(i.label){case 0:if(n=e.name,o=e.data,!n)throw new Error(JSON.stringify({code:a.INVALID_PARAMS,msg:"[".concat(s,".callContainer] invalid name")}));try{c=o?JSON.stringify(o):""}catch(e){throw new Error(JSON.stringify({code:a.INVALID_PARAMS,msg:"[".concat(s,".callContainer] invalid data")}))}return[4,u.call(this,r(r({},e),{data:c}),t)];case 1:return[2,i.sent()]}}))}))},e}();function u(e,t){var n;return o(this,void 0,void 0,(function(){var o,a,s,c,u,l,p,d,h,f,m,v,g,b,y;return i(this,(function(i){switch(i.label){case 0:if(o=e.name,a=e.data,s=e.path,c=void 0===s?"":s,u=e.method,l=e.header,p=void 0===l?{}:l,d=this.getEndPointWithKey("GATEWAY"),h=d.BASE_URL,f=d.PROTOCOL,m="".concat(f).concat(h,"/cloudrun/").concat(o),v=c.startsWith("/")?c:"/".concat(c),g=["GET","HEAD"].includes(null===(n=null==u?void 0:u.toUpperCase)||void 0===n?void 0:n.call(u)))try{b={};try{b=JSON.parse(a)}catch(e){b=a||{}}v="".concat(v).concat(v.includes("?")?"&":"?").concat(Object.keys(b).map((function(e){return"".concat(e,"=").concat(b[e])})).join("&"))}catch(e){}return[4,this.request.fetch(r(r({method:u||"POST",headers:Object.assign({},{"Content-Type":"application/json; charset=utf-8"},p)},g?{}:{body:a}),{url:"".concat(m).concat(v),customReqOpts:t}))];case 1:return y=i.sent(),"node-sdk"===(null==t?void 0:t.from)?[2,y]:[4,y.data];case 2:return[2,i.sent()]}}))}))}t.requestContainer=u;var l=new c,p={name:s,entity:{callContainer:l.callContainer}};try{cloudbase.registerComponent(p)}catch(e){}function d(e){try{e.registerComponent(p)}catch(e){console.warn(e)}}t.registerCloudrun=d;try{window.registerCloudrun=d}catch(e){}},1060:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.registerFunctions=void 0;var c=n(3388),u=n(2877),l=n(9253),p=u.constants.getSdkName,d=u.constants.ERRORS,h=u.constants.COMMUNITY_SITE_URL,f=u.utils.execCallback,m=u.helpers.catchErrorsDecorator,v="functions",g=new(function(){function e(){}var t,n,g;return e.prototype.callFunction=function(e,t,n){var o,i,c;return a(this,void 0,void 0,(function(){var a,h,m,g,b,y,_,x,w,E,I,S,O,T,A,P,C,R,N,k,j,D,U;return s(this,(function(s){switch(s.label){case 0:if(a=e.name,h=e.data,m=e.query,g=e.parse,b=e.search,y=e.type,_=e.path,x=void 0===_?"":_,w=e.method,E=e.header,I=void 0===E?{}:E,!a)throw new Error(JSON.stringify({code:d.INVALID_PARAMS,msg:"[".concat(v,".callFunction] invalid function name")}));try{S=h?JSON.stringify(h):""}catch(e){throw new Error(JSON.stringify({code:d.INVALID_PARAMS,msg:"[".concat(v,".callFunction] invalid data")}))}return"cloudrun"!==y?[3,2]:(O=u.utils.generateRequestId(),[4,l.requestContainer.call(this,{name:a,data:S,path:x,method:w,header:r(r({},I),{"X-Request-Id":O})})]);case 1:return[2,{result:D=s.sent(),requestId:O}];case 2:A=(T=this).request,P=T.config,C="functions.invokeFunction",R={inQuery:m,parse:g,search:b,function_name:a,request_data:S},N={},k=!("GATEWAY"!==P.endPointMode||(L=a,"lcap-common-service"===L||"lcap-datasource-test"===L||L.startsWith("lcap-data")||L.startsWith("lowcode-datasource")||"cloudbase_module"===L)||function(e){return"lowcode-wx-datasource"===e}(a)),s.label=3;case 3:return s.trys.push([3,8,,9]),k?[4,A.gateWay(r(r({},e),{path:"functions"}),n)]:[3,5];case 4:return j=s.sent(),N=r({requestId:j.requestId},(null===(o=j.data)||void 0===o?void 0:o.code)?j.data:{data:{response_data:j.data}}),[3,7];case 5:return[4,A.send(C,R,{endPointMode:"CLOUD_API",defaultQuery:(null===(i=null==h?void 0:h.params)||void 0===i?void 0:i.action)?{action:null===(c=null==h?void 0:h.params)||void 0===c?void 0:c.action}:{}},n)];case 6:N=s.sent(),s.label=7;case 7:if(N.code)return[2,f(t,null,N)];if(D=N.data.response_data,g||k)return[2,f(t,null,{result:D,requestId:N.requestId})];try{return D=JSON.parse(N.data.response_data),[2,f(t,null,{result:D,requestId:N.requestId})]}catch(e){f(t,new Error("[".concat(p(),"][").concat(d.INVALID_PARAMS,"][").concat(v,".callFunction] response data must be json")))}return[3,9];case 8:return U=s.sent(),f(t,U),[3,9];case 9:return[2]}var L}))}))},o([m({customInfo:{className:"Cloudbase",methodName:"callFunction"},title:"函数调用失败",messages:["请确认以下各项:"," 1 - 调用 callFunction() 的语法或参数是否正确"," 2 - 当前环境下是否存在此函数"," 3 - 函数安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h)]}),i("design:type",Function),i("design:paramtypes",["function"==typeof(t=void 0!==c.ICallFunctionOptions&&c.ICallFunctionOptions)?t:Object,"function"==typeof(n="undefined"!=typeof Function&&Function)?n:Object,"function"==typeof(g=void 0!==c.ICustomReqOpts&&c.ICustomReqOpts)?g:Object]),i("design:returntype",Promise)],e.prototype,"callFunction",null),e}()),b={name:v,entity:{callFunction:g.callFunction}};try{cloudbase.registerComponent(b)}catch(e){}t.registerFunctions=function(e){try{e.registerComponent(b)}catch(e){console.warn(e)}}},3645:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.registerModel=t.lazyGetEntity=void 0;var c=n(8630),u=n(2877).events.CloudbaseEventEmitter,l="models",p=new WeakMap;function d(e){return new Proxy({},{get:function(t,n){var o=e.getEndPointWithKey("GATEWAY"),i=o.BASE_URL,u=o.PROTOCOL,l=r(r({},e),{BASE_URL:i,PROTOCOL:u}),d=p.get(l);return d||(d=function(e){var t=this,n=e.callFunction.bind(e),o=e.request.fetch.bind(e.request),i=e.getEndPointWithKey("GATEWAY"),u=i.BASE_URL,l=i.PROTOCOL,p="".concat(l).concat(u,"/model"),d="".concat(l).concat(u,"/sql"),h=(0,c.generateHTTPClient)(n,(function(e){return a(t,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,o(r(r({},e),{headers:r({"Content-Type":"application/json"},e.headers)}))];case 1:return[4,t.sent().data];case 2:return[2,t.sent()]}}))}))}),p,{sqlBaseUrl:d});return h}(e),p.set(l,d)),d[n]}})}t.lazyGetEntity=d;var h="cloudbase_init",f=new u;f.on(h,(function(e){var t=e.data;Object.assign(t,{models:d(t)})}));var m={name:l,namespace:l,entity:new Proxy({},{get:function(e,t){console.warn("【deprecated】Accessing Cloudbase.prototype.models.".concat(t,"."))}}),injectEvents:{bus:f,events:[h]}};try{cloudbase.registerComponent(m)}catch(e){}function v(e){try{e.registerComponent(m)}catch(e){console.warn(e)}}t.registerModel=v;try{window.registerModel=v}catch(e){}i(n(8630),t)},9126:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.registerMySQL=void 0;var c=n(8630);function u(e,t,n){var o=this,i=e.request.fetch.bind(e.request),u=t||{},l=u.instance,p=void 0===l?n?void 0:"default":l,d=u.database,h=void 0===d?n?void 0:e.config.env:d,f=e.getEndPointWithKey("GATEWAY"),m=f.BASE_URL,v=f.PROTOCOL,g="".concat(v).concat(m),b=function(t,n){return a(o,void 0,void 0,(function(){var o,a,c,u,l,d,f,m,v;return s(this,(function(s){switch(s.label){case 0:return o={},n.headers instanceof Headers?n.headers.forEach((function(e,t){o[t]=e})):o=n.headers||{},[["X-Db-Instance",p],["Accept-Profile",h],["Content-Profile",h]].forEach((function(e){var t=e[0],n=e[1];o[t]||o[t.toLocaleLowerCase()]||!n||(o[t]=n)})),a=t.toString(),c=e.getEndPointWithKey("GATEWAY"),u=c.BASE_URL,l=c.PROTOCOL,(d="".concat(l).concat(u))!==g&&a.startsWith(g)&&(a=a.replace(g,d)),[4,i(r(r({url:a},n),{headers:r({"Content-Type":"application/json"},o),shouldThrowOnError:!1}))];case 1:f=s.sent(),m={},s.label=2;case 2:return s.trys.push([2,4,,5]),[4,f.data];case 3:return m=s.sent(),[3,5];case 4:if(!(v=s.sent()).message.includes("Unexpected end of JSON input"))throw v;return[3,5];case 5:return[2,{ok:(null==f?void 0:f.statusCode)>=200&&(null==f?void 0:f.statusCode)<300,status:(null==f?void 0:f.statusCode)||200,statusText:(null==f?void 0:f.statusMessage)||"OK",json:function(){return Promise.resolve(m||{})},text:function(){return Promise.resolve("string"==typeof m?m:JSON.stringify(m||{}))},headers:null==f?void 0:f.header}]}}))}))},y="".concat(v).concat(m,"/rdb/rest");return n?(0,c.generatePGClient)(e,{pgBaseUrl:y,fetch:b}):(0,c.generateMySQLClient)(e,{mysqlBaseUrl:y,fetch:b})}var l={name:"mysql",entity:{mysql:function(e){return u(this,e,!1)(e)}}},p={name:"rdb",entity:{rdb:function(e){return u(this,e,!0)(e)}}};try{cloudbase.registerComponent(l),cloudbase.registerComponent(p)}catch(e){}function d(e){try{e.registerComponent(l),e.registerComponent(p)}catch(e){console.warn(e)}}t.registerMySQL=d;try{window.registerMySQL=d}catch(e){}i(n(8630),t)},5413:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},a=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Auth=void 0;var c=n(4949),u=n(5257),l=n(2962),p=n(2631),d=s(n(9639)),h=n(8308);function f(e,t){var r;return o(this,void 0,void 0,(function(){var a,s=this;return i(this,(function(c){a=function(){return o(s,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return e.trys.push([0,1,,6]),[2,n(5814)];case 1:e.sent(),e.label=2;case 2:return e.trys.push([2,4,,5]),[4,Promise.resolve().then(n.t.bind(n,5814,23))];case 3:return[2,e.sent()];case 4:return e.sent(),[2];case 5:return[3,6];case 6:return[2]}}))}))};try{if(((null===(r=null==t?void 0:t.root)||void 0===r?void 0:r.globalThis)||globalThis).IS_MP_BUILD)return[2];if(e)return[2,a()]}catch(t){if(e)return[2,a()]}return[2]}))}))}var m=function(){function e(e){var t=e.request,n=e.credentialsClient;if(!n){var o={apiOrigin:e.apiOrigin,apiPath:e.apiPath,clientId:e.clientId,storage:e.storage,env:e.env,baseRequest:e.baseRequest,anonymousSignInFunc:e.anonymousSignInFunc,wxCloud:e.wxCloud,onCredentialsError:e.onCredentialsError,headers:e.headers||{},i18n:e.i18n,debug:e.debug};n=new u.OAuth2Client(o)}if(!t){var i=n.request.bind(n),a=new l.Captcha(r({env:e.env,clientId:e.clientId,request:i,storage:e.storage,adapter:e.adapter,oauthInstance:this},e.captchaOptions));t=a.request.bind(a)}this.config={env:e.env,apiOrigin:e.apiOrigin,apiPath:e.apiPath,clientId:e.clientId,request:t,credentialsClient:n,storage:e.storage||u.defaultStorage,adapter:e.adapter}}return e.parseParamsToSearch=function(e){return Object.keys(e).forEach((function(t){e[t]||delete e[t]})),new d.default(e).toString()},e.prototype.getParamsByVersion=function(e,t){var n,r=(0,p.deepClone)(e),o=(null===(n={v2:c.ApiUrlsV2}[null==r?void 0:r.version])||void 0===n?void 0:n[t])||c.ApiUrls[t];return r&&delete r.version,{params:r,url:o}},e.prototype.signIn=function(e){return o(this,void 0,Promise,(function(){var t,n,o,a;return i(this,(function(i){switch(i.label){case 0:return t=e.version||"v1",(n=this.getParamsByVersion(e,"AUTH_SIGN_IN_URL")).params.query&&delete n.params.query,[4,this.getEncryptParams(n.params)];case 1:return o=i.sent(),[4,this.config.request(n.url,{method:"POST",body:o})];case 2:return a=i.sent(),[4,this.config.credentialsClient.setCredentials(r(r({},a),{version:t}))];case 3:return i.sent(),[2,Promise.resolve(a)]}}))}))},e.prototype.signInAnonymously=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=!1),o(this,void 0,Promise,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.config.request(c.ApiUrls.AUTH_SIGN_IN_ANONYMOUSLY_URL,{method:"POST",body:e,useWxCloud:t})];case 1:return n=r.sent(),[4,this.config.credentialsClient.setCredentials(n)];case 2:return r.sent(),[2,Promise.resolve(n)]}}))}))},e.prototype.signUp=function(e){return o(this,void 0,Promise,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.config.request(c.ApiUrls.AUTH_SIGN_UP_URL,{method:"POST",body:e})];case 1:return t=n.sent(),[4,this.config.credentialsClient.setCredentials(t)];case 2:return n.sent(),[2,Promise.resolve(t)]}}))}))},e.prototype.signOut=function(e){return o(this,void 0,Promise,(function(){var t,n,r,o;return i(this,(function(i){switch(i.label){case 0:if(t={},!e)return[3,6];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.config.request(c.ApiUrls.AUTH_SIGNOUT_URL,{method:"POST",withCredentials:!0,body:e})];case 2:return t=i.sent(),[3,4];case 3:return(n=i.sent()).error!==c.ErrorType.UNAUTHENTICATED&&console.log("sign_out_error",n),[3,4];case 4:return[4,this.config.credentialsClient.setCredentials()];case 5:return i.sent(),[2,t];case 6:return[4,this.config.credentialsClient.getAccessToken()];case 7:return r=i.sent(),[4,this.config.request(c.ApiUrls.AUTH_REVOKE_URL,{method:"POST",body:{token:r}})];case 8:return o=i.sent(),[4,this.config.credentialsClient.setCredentials()];case 9:return i.sent(),[2,Promise.resolve(o)]}}))}))},e.prototype.revokeAllDevices=function(){return o(this,void 0,Promise,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.config.request(c.ApiUrls.AUTH_REVOKE_ALL_URL,{method:"DELETE",withCredentials:!0})];case 1:return e.sent(),[2]}}))}))},e.prototype.revokeDevice=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.config.request(c.ApiUrls.AUTHORIZED_DEVICES_DELETE_URL+e.device_id,{method:"DELETE",withCredentials:!0})];case 1:return t.sent(),[2]}}))}))},e.prototype.getVerification=function(e,t){return o(this,void 0,Promise,(function(){var n,r;return i(this,(function(o){switch(o.label){case 0:return n=!1,"CUR_USER"!==e.target?[3,1]:(n=!0,[3,3]);case 1:return[4,this.hasLoginState()];case 2:o.sent()&&(n=!0),o.label=3;case 3:return(r=(0,p.deepClone)(e)).phone_number&&!/^\+\d{1,3}\s+\d+/.test(r.phone_number)&&(r.phone_number="+86 ".concat(r.phone_number)),[2,this.config.request(c.ApiUrls.VERIFICATION_URL,{method:"POST",body:r,withCaptcha:(null==t?void 0:t.withCaptcha)||!1,withCredentials:n})]}}))}))},e.prototype.verify=function(e){return o(this,void 0,Promise,(function(){var t,n;return i(this,(function(o){switch(o.label){case 0:return t=this.getParamsByVersion(e,"VERIFY_URL"),[4,this.config.request(t.url,{method:"POST",body:t.params})];case 1:return n=o.sent(),"v2"!==(null==e?void 0:e.version)?[3,3]:[4,this.config.credentialsClient.setCredentials(r(r({},n),{version:"v2"}))];case 2:o.sent(),o.label=3;case 3:return[2,n]}}))}))},e.prototype.genProviderRedirectUri=function(t){return o(this,void 0,Promise,(function(){var n,r,o,s,u;return i(this,(function(i){return n=t.provider_redirect_uri,r=t.other_params,o=void 0===r?{}:r,s=a(t,["provider_redirect_uri","other_params"]),n&&!s.redirect_uri&&(s.redirect_uri=n),u="".concat(c.ApiUrls.PROVIDER_URI_URL,"?").concat(e.parseParamsToSearch(s)),Object.keys(o).forEach((function(e){var t=o[e];("sign_out_uri"!==e||(null==t?void 0:t.length)>0)&&(u+="&other_params[".concat(e,"]=").concat(encodeURIComponent(t)))})),[2,this.config.request(u,{method:"GET"})]}))}))},e.prototype.grantProviderToken=function(e,t){return void 0===t&&(t=!1),o(this,void 0,Promise,(function(){return i(this,(function(n){return[2,this.config.request(c.ApiUrls.PROVIDER_TOKEN_URL,{method:"POST",body:e,useWxCloud:t})]}))}))},e.prototype.patchProviderToken=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.PROVIDER_TOKEN_URL,{method:"PATCH",body:e})]}))}))},e.prototype.signInWithProvider=function(e,t){return void 0===t&&(t=!1),o(this,void 0,Promise,(function(){var n,o;return i(this,(function(i){switch(i.label){case 0:return n=this.getParamsByVersion(e,"AUTH_SIGN_IN_WITH_PROVIDER_URL"),[4,this.config.request(n.url,{method:"POST",body:n.params,useWxCloud:t})];case 1:return o=i.sent(),[4,this.config.credentialsClient.setCredentials(r(r({},o),{version:(null==e?void 0:e.version)||"v1"}))];case 2:return i.sent(),[2,Promise.resolve(o)]}}))}))},e.prototype.toBindIdentity=function(e){var t,n;return o(this,void 0,void 0,(function(){var r,o,a,s;return i(this,(function(i){switch(i.label){case 0:return(o=e.credentials)?[3,2]:[4,this.config.credentialsClient.localCredentials.getCredentials()];case 1:o=i.sent(),i.label=2;case 2:r=o,i.label=3;case 3:return i.trys.push([3,5,,6]),[4,this.bindWithProvider({provider_token:e.provider_token},r)];case 4:return i.sent(),a={data:{type:c.OAUTH_TYPE.BIND_IDENTITY,provider:e.provider},error:null},[3,6];case 5:return s=i.sent(),a={data:{type:c.OAUTH_TYPE.BIND_IDENTITY},error:new h.AuthError(s)},[3,6];case 6:return e.fireEvent&&(null===(n=null===(t=this.config.eventBus)||void 0===t?void 0:t.fire)||void 0===n||n.call(t,c.EVENTS.AUTH_STATE_CHANGED,{event:c.AUTH_STATE_CHANGED_TYPE.BIND_IDENTITY,info:a})),[2,a]}}))}))},e.prototype.getInitialSession=function(){return o(this,void 0,Promise,(function(){var e,t,n,o,a,s,u,l,p,d,f,m,v,g,b;return i(this,(function(i){switch(i.label){case 0:e={},i.label=1;case 1:if(i.trys.push([1,12,,13]),"undefined"==typeof window||"undefined"==typeof document)return[2,{data:null,error:null}];if(t=new URLSearchParams(null===location||void 0===location?void 0:location.search),n=t.get("code"),o=t.get("state"),!n||!o)return[2,{data:null,error:null}];a=null;try{a=JSON.parse(sessionStorage.getItem(o)||"null")}catch(e){}return e={type:null==a?void 0:a.type},s=t.get("error"),u=t.get("error_description"),s||u?[2,{data:e,error:new h.AuthError({message:u||s||"Unknown error from OAuth provider"})}]:(l=(null==a?void 0:a.provider)||t.get("provider"))?(p=location.origin+location.pathname,[4,this.grantProviderToken({provider_id:l,provider_redirect_uri:p,provider_code:n})]):[2,{data:e,error:new h.AuthError({message:"Provider is required for OAuth verification"})}];case 2:return d=i.sent().provider_token,f=void 0,m=null,v=void 0,a.type!==c.OAUTH_TYPE.BIND_IDENTITY?[3,5]:[4,this.config.credentialsClient.localCredentials.getCredentials()];case 3:return f=i.sent(),[4,this.toBindIdentity({provider:l,provider_token:d,credentials:f})];case 4:return v=i.sent(),[3,11];case 5:return a.type!==c.OAUTH_TYPE.SIGN_IN?[3,11]:(v=this.getParamsByVersion({provider:l},"AUTH_SIGN_IN_WITH_PROVIDER_URL"),[4,this.config.request(v.url,{method:"POST",body:{provider_token:d}})]);case 6:f=i.sent(),i.label=7;case 7:return i.trys.push([7,9,,10]),[4,this.getUserInfo({credentials:f})];case 8:return m=i.sent(),[3,10];case 9:return g=i.sent(),console.error("get user info error",g),[3,10];case 10:v={data:r(r({},e),{session:f,user:m}),error:null},i.label=11;case 11:t.delete("code"),t.delete("state"),t.delete("provider"),this.restoreUrlState(void 0===(null==a?void 0:a.search)?"?".concat(t.toString()):a.search,(null==a?void 0:a.hash)||location.hash);try{sessionStorage.removeItem(o)}catch(e){}return[2,v];case 12:return b=i.sent(),[2,{data:e,error:new h.AuthError(b)}];case 13:return[2]}}))}))},e.prototype.signInCustom=function(e){return o(this,void 0,Promise,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.config.request(c.ApiUrls.AUTH_SIGN_IN_CUSTOM,{method:"POST",body:e})];case 1:return t=n.sent(),[4,this.config.credentialsClient.setCredentials(t)];case 2:return n.sent(),[2,Promise.resolve(t)]}}))}))},e.prototype.signInWithWechat=function(e){return void 0===e&&(e={}),o(this,void 0,Promise,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.config.request(c.ApiUrls.AUTH_SIGN_IN_WITH_WECHAT_URL,{method:"POST",body:e})];case 1:return t=n.sent(),[4,this.config.credentialsClient.setCredentials(t)];case 2:return n.sent(),[2,Promise.resolve(t)]}}))}))},e.prototype.bindWithProvider=function(e,t){return o(this,void 0,Promise,(function(){return i(this,(function(n){return[2,this.config.request(c.ApiUrls.PROVIDER_BIND_URL,{method:"POST",body:e,withCredentials:!0,getCredentials:t?function(){return t}:void 0})]}))}))},e.prototype.getUserProfile=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.getUserInfo(e)]}))}))},e.prototype.getUserInfo=function(e){var t,n,r;return void 0===e&&(e={}),o(this,void 0,Promise,(function(){var o,a,s,c,u;return i(this,(function(i){switch(i.label){case 0:return o=this.getParamsByVersion(e,"USER_ME_URL"),(null===(t=o.params)||void 0===t?void 0:t.query)&&(a=new d.default(o.params.query),o.url+="?".concat(a.toString())),[4,this.config.request(o.url,{method:"GET",withCredentials:!0,getCredentials:e.credentials?function(){return e.credentials}:void 0})];case 1:if((s=i.sent()).sub&&(s.uid=s.sub),null===(n=s.providers)||void 0===n?void 0:n.length)try{"undefined"!=typeof wx&&wx.getAccountInfoSync&&(c=null===(r=wx.getAccountInfoSync().miniProgram)||void 0===r?void 0:r.appId,(null==(u=s.providers.find((function(e){return e.id===c})))?void 0:u.provider_user_id)&&(s.open_id=u.provider_user_id))}catch(e){}return[2,s]}}))}))},e.prototype.getWedaUserInfo=function(){return o(this,void 0,Promise,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.config.request(c.ApiUrls.WEDA_USER_URL,{method:"GET",withCredentials:!0})];case 1:return[2,e.sent()]}}))}))},e.prototype.deleteMe=function(t){return o(this,void 0,Promise,(function(){var n,r;return i(this,(function(o){return n=this.getParamsByVersion(t,"USER_ME_URL"),r="".concat(n.url,"?").concat(e.parseParamsToSearch(n.params)),[2,this.config.request(r,{method:"DELETE",withCredentials:!0})]}))}))},e.prototype.hasLoginState=function(){return o(this,void 0,Promise,(function(){return i(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.config.credentialsClient.getAccessToken()];case 1:return e.sent(),[2,!0];case 2:return e.sent(),[2,!1];case 3:return[2]}}))}))},e.prototype.hasLoginStateSync=function(){return this.config.credentialsClient.getCredentialsSync()},e.prototype.getLoginState=function(){return o(this,void 0,Promise,(function(){return i(this,(function(e){return[2,this.config.credentialsClient.getCredentialsAsync()]}))}))},e.prototype.transByProvider=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.USER_TRANS_BY_PROVIDER_URL,{method:"PATCH",body:e,withCredentials:!0})]}))}))},e.prototype.grantToken=function(e){return o(this,void 0,Promise,(function(){var t;return i(this,(function(n){return t=this.getParamsByVersion(e,"AUTH_TOKEN_URL"),[2,this.config.request(t.url,{method:"POST",body:t.params})]}))}))},e.prototype.getProviders=function(){return o(this,void 0,Promise,(function(){return i(this,(function(e){return[2,this.config.request(c.ApiUrls.PROVIDER_LIST,{method:"GET",withCredentials:!0})]}))}))},e.prototype.unbindProvider=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request("".concat(c.ApiUrls.PROVIDER_UNBIND_URL,"/").concat(e.provider_id),{method:"DELETE",withCredentials:!0})]}))}))},e.prototype.checkPassword=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request("".concat(c.ApiUrls.CHECK_PWD_URL),{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.editContact=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request("".concat(c.ApiUrls.BIND_CONTACT_URL),{method:"PATCH",withCredentials:!0,body:e})]}))}))},e.prototype.setPassword=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request("".concat(c.ApiUrls.AUTH_SET_PASSWORD),{method:"PATCH",withCredentials:!0,body:e})]}))}))},e.prototype.updatePasswordByOld=function(e){return o(this,void 0,Promise,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.sudo({password:e.old_password})];case 1:return t=n.sent(),[2,this.setPassword({sudo_token:t.sudo_token,new_password:e.new_password})]}}))}))},e.prototype.sudo=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request("".concat(c.ApiUrls.SUDO_URL),{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.sendVerificationCodeToCurrentUser=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return e.target="CUR_USER",[2,this.config.request(c.ApiUrls.VERIFICATION_URL,{method:"POST",body:e,withCredentials:!0,withCaptcha:!0})]}))}))},e.prototype.changeBoundProvider=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request("".concat(c.ApiUrls.PROVIDER_LIST,"/").concat(e.provider_id,"/trans"),{method:"POST",body:{provider_trans_token:e.trans_token},withCredentials:!0})]}))}))},e.prototype.setUserProfile=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.USER_PRIFILE_URL,{method:"PATCH",body:e,withCredentials:!0})]}))}))},e.prototype.updateUserBasicInfo=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.USER_BASIC_EDIT_URL,{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.queryUserProfile=function(e){return o(this,void 0,Promise,(function(){var t;return i(this,(function(n){return t=new d.default(e),[2,this.config.request("".concat(c.ApiUrls.USER_QUERY_URL,"?").concat(t.toString()),{method:"GET",withCredentials:!0})]}))}))},e.prototype.setCustomSignFunc=function(e){this.getCustomSignTicketFn=e},e.prototype.signInWithCustomTicket=function(){return o(this,void 0,Promise,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return(e=this.getCustomSignTicketFn)?[4,e()]:[2,Promise.reject({error:"failed_precondition",error_description:"please use setCustomSignFunc to set custom sign function"})];case 1:return t=n.sent(),[2,this.signInCustom({provider_id:"custom",ticket:t})]}}))}))},e.prototype.resetPassword=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.AUTH_RESET_PASSWORD,{method:"POST",body:e})]}))}))},e.prototype.authorize=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.AUTHORIZE_URL,{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.authorizeDevice=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.AUTHORIZE_DEVICE_URL,{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.deviceAuthorize=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.AUTH_GET_DEVICE_CODE,{method:"POST",body:e})]}))}))},e.prototype.authorizeInfo=function(t){return o(this,void 0,Promise,(function(){var n,r,o;return i(this,(function(i){switch(i.label){case 0:return n="".concat(c.ApiUrls.AUTHORIZE_INFO_URL,"?").concat(e.parseParamsToSearch(t)),r=!0,o=!1,[4,this.hasLoginState()];case 1:return i.sent()&&(o=!0,r=!1),[2,this.config.request(n,{method:"GET",withBasicAuth:r,withCredentials:o})]}}))}))},e.prototype.checkUsername=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.CHECK_USERNAME,{method:"GET",body:e,withCredentials:!0})]}))}))},e.prototype.checkIfUserExist=function(e){return o(this,void 0,Promise,(function(){var t;return i(this,(function(n){return t=new d.default(e),[2,this.config.request("".concat(c.ApiUrls.CHECK_IF_USER_EXIST,"?").concat(t.toString()),{method:"GET"})]}))}))},e.prototype.loginScope=function(){return o(this,void 0,Promise,(function(){return i(this,(function(e){return[2,this.config.credentialsClient.getScope()]}))}))},e.prototype.loginGroups=function(){return o(this,void 0,Promise,(function(){return i(this,(function(e){return[2,this.config.credentialsClient.getGroups()]}))}))},e.prototype.refreshTokenForce=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.config.credentialsClient.getCredentials()];case 1:return t=n.sent(),[4,this.config.credentialsClient.refreshToken(r(r({},t),{version:(null==e?void 0:e.version)||"v1"}))];case 2:return[2,n.sent()]}}))}))},e.prototype.getCredentials=function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.config.credentialsClient.getCredentials()]}))}))},e.prototype.getPublicKey=function(){return o(this,void 0,Promise,(function(){return i(this,(function(e){return[2,this.config.request(c.ApiUrlsV2.AUTH_PUBLIC_KEY,{method:"POST",body:{}})]}))}))},e.prototype.getEncryptParams=function(e){return o(this,void 0,Promise,(function(){var t,n,r,o,a,s;return i(this,(function(i){switch(i.label){case 0:return t=e.isEncrypt,delete e.isEncrypt,n=(0,p.deepClone)(e),[4,f(t,this.config.adapter)];case 1:if(!(r=i.sent()))return[2,e];o="",a="",i.label=2;case 2:return i.trys.push([2,4,,5]),[4,this.getPublicKey()];case 3:if(s=i.sent(),o=s.public_key,a=s.public_key_thumbprint,!o||!a)throw s;return[3,5];case 4:throw i.sent();case 5:return[2,{params:r.getEncryptInfo({publicKey:o,payload:n}),public_key_thumbprint:a}]}}))}))},e.prototype.getProviderSubType=function(){return o(this,void 0,Promise,(function(){return i(this,(function(e){return[2,this.config.request(c.ApiUrls.GET_PROVIDER_TYPE,{method:"POST",body:{provider_id:"weda"}})]}))}))},e.prototype.verifyCaptchaData=function(e){var t=e.token,n=e.key;return o(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.config.request(c.ApiUrls.VERIFY_CAPTCHA_DATA_URL,{method:"POST",body:{token:t,key:n},withCredentials:!1})]}))}))},e.prototype.createCaptchaData=function(e){var t=e.state,n=e.redirect_uri,r=void 0===n?void 0:n;return o(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.config.request(c.ApiUrls.CAPTCHA_DATA_URL,{method:"POST",body:{state:t,redirect_uri:r},withCredentials:!1})]}))}))},e.prototype.getMiniProgramCode=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.GET_MINIPROGRAM_QRCODE,{method:"POST",body:e})]}))}))},e.prototype.getMiniProgramQrCodeStatus=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.GET_MINIPROGRAM_QRCODE_STATUS,{method:"POST",body:e})]}))}))},e.prototype.getUserBehaviorLog=function(e){return o(this,void 0,Promise,(function(){var t,n;return i(this,(function(r){return t={LOGIN:"query[action]=USER_LOGIN",MODIFY:"ne_query[action]=USER_LOGIN"},n="".concat(c.ApiUrls.GET_USER_BEHAVIOR_LOG,"?").concat(t[e.type],"&limit=").concat(e.limit).concat(e.page_token?"&page_token=".concat(e.page_token):""),[2,this.config.request(n,{method:"GET",withCredentials:!0})]}))}))},e.prototype.modifyPassword=function(e){return o(this,void 0,Promise,(function(){var t,n,r,o,a,s;return i(this,(function(i){switch(i.label){case 0:return t="",n="",[4,f(!0,this.config.adapter)];case 1:if(!(r=i.sent()))throw new Error("do not support encrypt, a encrypt util required.");i.label=2;case 2:return i.trys.push([2,4,,5]),[4,this.getPublicKey()];case 3:if(o=i.sent(),t=o.public_key,n=o.public_key_thumbprint,!t||!n)throw o;return[3,5];case 4:throw i.sent();case 5:return a=e.password?r.getEncryptInfo({publicKey:t,payload:e.password}):"",s=r.getEncryptInfo({publicKey:t,payload:e.new_password}),[2,this.config.request(c.ApiUrls.USER_BASIC_EDIT_URL,{method:"POST",withCredentials:!0,body:{user_id:e.user_id,encrypt_password:a,encrypt_new_password:s,public_key_thumbprint:n}})]}}))}))},e.prototype.modifyPasswordWithoutLogin=function(e){return o(this,void 0,Promise,(function(){var t,n,r,o,a,s;return i(this,(function(i){switch(i.label){case 0:return t="",n="",[4,f(!0,this.config.adapter)];case 1:if(!(r=i.sent()))throw new Error("do not support encrypt, a encrypt util required.");i.label=2;case 2:return i.trys.push([2,4,,5]),[4,this.getPublicKey()];case 3:if(o=i.sent(),t=o.public_key,n=o.public_key_thumbprint,!t||!n)throw o;return[3,5];case 4:throw i.sent();case 5:return a=e.password?r.getEncryptInfo({publicKey:t,payload:e.password}):"",s=r.getEncryptInfo({publicKey:t,payload:e.new_password}),[2,this.config.request(c.ApiUrlsV2.AUTH_RESET_PASSWORD,{method:"POST",body:{username:e.username,password:a,new_password:s,public_key_thumbprint:n}})]}}))}))},e.prototype.restoreUrlState=function(e,t){if(void 0!==e)try{var n=new URL(window.location.href);n.search=e,n.hash=t||"",window.history.replaceState(null,"",n.toString()),window.location.replace(n.toString())}catch(e){}},e}();t.Auth=m},8308:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AuthError=t.AuthErrorCategory=void 0;var i,a=n(4949);!function(e){e.PROVIDER_NOT_ENABLED="PROVIDER_NOT_ENABLED",e.INVALID_CREDENTIALS="INVALID_CREDENTIALS",e.USER_NOT_FOUND="USER_NOT_FOUND",e.USER_STATUS_ABNORMAL="USER_STATUS_ABNORMAL",e.SERVICE_ERROR="SERVICE_ERROR",e.INVALID_PARAMS="INVALID_PARAMS",e.AUTH_METHOD_MISMATCH="AUTH_METHOD_MISMATCH",e.RATE_LIMITED="RATE_LIMITED",e.CAPTCHA_REQUIRED="CAPTCHA_REQUIRED",e.CAPTCHA_INVALID="CAPTCHA_INVALID",e.MFA_REQUIRED="MFA_REQUIRED",e.PRECONDITION_FAILED="PRECONDITION_FAILED",e.VERIFICATION_FAILED="VERIFICATION_FAILED",e.UNKNOWN="UNKNOWN"}(i=t.AuthErrorCategory||(t.AuthErrorCategory={}));var s="https://tcb.cloud.tencent.com/dev?envId=#/identity/login-manage",c="https://docs.cloudbase.net/api-reference/webv3-next/initialization",u=function(e){function t(t,n){var r,o=this,u=t.error_description||t.message;return(o=e.call(this,u)||this).__isAuthError=!0,o.name="AuthError",o.status=t.error,o.code=String(t.error||t.error_code||"unknown").toLowerCase(),o.errorCode="number"==typeof t.error_code?t.error_code:"string"==typeof t.error_code&&parseInt(t.error_code,10)||void 0,o.requestId=t.requestId,o.category=function(e,t,n){if(!e&&!t&&!n)return i.UNKNOWN;try{var r=(e||"").toLowerCase(),o="string"==typeof n?parseInt(n,10):n;return o===a.AuthErrorCode.CAPTCHA_REQUIRED||t===a.ErrorType.CAPTCHA_REQUIRED?i.CAPTCHA_REQUIRED:o===a.AuthErrorCode.CAPTCHA_INVALID||t===a.ErrorType.CAPTCHA_INVALID?i.CAPTCHA_INVALID:o===a.AuthErrorCode.MFA_PHONE_REQUIRED||t===a.ErrorType.MFA_PHONE_REQUIRED?i.MFA_REQUIRED:o===a.AuthErrorCode.LOGIN_TYPE_DISABLED||t===a.ErrorType.LOGIN_TYPE_DISABLED?i.PROVIDER_NOT_ENABLED:o===a.AuthErrorCode.RESOURCE_EXHAUSTED||t===a.ErrorType.RESOURCE_EXHAUSTED?i.RATE_LIMITED:o===a.AuthErrorCode.INTERNAL||o===a.AuthErrorCode.UNAVAILABLE||o===a.AuthErrorCode.UNIMPLEMENTED||o===a.AuthErrorCode.ABORTED?i.SERVICE_ERROR:o===a.AuthErrorCode.NOT_FOUND?i.USER_NOT_FOUND:o===a.AuthErrorCode.UNAUTHENTICATED?i.INVALID_CREDENTIALS:o===a.AuthErrorCode.INVALID_ARGUMENT&&(r.includes("验证码")||r.includes("verification")||r.includes("verification_code")||r.includes("verification_id")||r.includes("does not match")||r.includes("token expired")||r.includes("token error")||r.includes("过期"))?i.VERIFICATION_FAILED:t===a.ErrorType.PROVIDER_NOT_ENABLED||t===a.ErrorType.LOGIN_METHOD_DISABLED||r.includes("身份源")||r.includes("开启")||r.includes("identity provider")||r.includes("provider not enabled")||r.includes("login method")||r.includes("登录方式")||r.includes("not enabled")||r.includes("未开启")||r.includes("未启用")||r.includes("请联系开发者")||r.includes("anonymous login is not enabled")||r.includes("匿名登录未开启")?i.PROVIDER_NOT_ENABLED:t===a.ErrorType.FAILED_PRECONDITION||o===a.AuthErrorCode.FAILED_PRECONDITION&&!r.includes("请联系开发者")?r.includes("不存在")||r.includes("not found")||r.includes("未注册")?i.USER_NOT_FOUND:i.PRECONDITION_FAILED:t===a.ErrorType.INVALID_PASSWORD||t===a.ErrorType.INVALID_GRANT||t===a.ErrorType.INVALID_VERIFICATION_CODE||t===a.ErrorType.INVALID_USERNAME_OR_PASSWORD||t===a.ErrorType.INVALID_CREDENTIALS||t===a.ErrorType.WRONG_PASSWORD||t===a.ErrorType.UNAUTHENTICATED||t===a.ErrorType.INVALID_TWO_FACTOR||t===a.ErrorType.INVALID_TWO_FACTOR_RECOVERY||t===a.ErrorType.PASSWORD_NOT_SET||r.includes("密码不正确")||r.includes("password")||r.includes("invalid_password")||r.includes("凭据")||r.includes("credentials")||r.includes("验证码")||r.includes("verification")||r.includes("invalid_verification_code")||r.includes("invalid_username_or_password")||r.includes("username or password")||r.includes("用户名或密码")||r.includes("wrong password")||r.includes("incorrect password")?i.INVALID_CREDENTIALS:t===a.ErrorType.NOT_FOUND||t===a.ErrorType.USER_NOT_FOUND||r.includes("用户不存在")||r.includes("not found")||r.includes("user not found")||r.includes("no such user")||r.includes("user does not exist")?i.USER_NOT_FOUND:t===a.ErrorType.USER_BLOCKED||t===a.ErrorType.USER_PENDING||t===a.ErrorType.UNDER_REVIEW||t===a.ErrorType.INVALID_STATUS||r.includes("被封禁")||r.includes("blocked")||r.includes("pending")||r.includes("审核")||r.includes("review")||r.includes("locked")||r.includes("已锁定")?i.USER_STATUS_ABNORMAL:t===a.ErrorType.SERVER_ERROR||t===a.ErrorType.UNAVAILABLE||t===a.ErrorType.TEMPORARILY_UNAVAILABLE||t===a.ErrorType.INTERNAL||t===a.ErrorType.UNREACHABLE||t===a.ErrorType.DEADLINE_EXCEEDED||t===a.ErrorType.DATA_LOSS||t===a.ErrorType.ABORTED||r.includes("network")||r.includes("timeout")||r.includes("timed out")||r.includes("超时")||r.includes("smtp is not set")||r.includes("sms sender does not config")?i.SERVICE_ERROR:t===a.ErrorType.INVALID_ARGUMENT||t===a.ErrorType.INVALID_REQUEST||t===a.ErrorType.INVALID_SCOPE||t===a.ErrorType.INVALID_REQUEST_URI||t===a.ErrorType.INVALID_REQUEST_OBJECT||o===a.AuthErrorCode.INVALID_ARGUMENT?i.INVALID_PARAMS:t===a.ErrorType.PERMISSION_DENIED||t===a.ErrorType.ACCESS_DENIED||t===a.ErrorType.UNAUTHORIZED_CLIENT?i.PROVIDER_NOT_ENABLED:i.UNKNOWN}catch(e){return t}}(u,o.status,o.errorCode),o.helpMessage=function(e,t){var n=(null==t?void 0:t.method)||"signIn",r={signInWithPassword:"「用户名密码登录」",signInAnonymously:"「匿名登录」",signInWithOtp:"「短信验证码登录」或「邮箱验证码登录」",signUp:"「短信验证码登录」或「邮箱验证码登录」",signInWithOAuth:"对应的第三方身份源",signInWithIdToken:"对应的第三方身份源",signInWithOpenId:"「微信小程序 OpenID 登录」",signInWithPhoneAuth:"「微信小程序手机号授权登录」",signInWithCustomTicket:"「自定义登录」",getVerification:"「短信验证码登录」或「邮箱验证码登录」",verify:"「短信验证码登录」或「邮箱验证码登录」",verifyOtp:"「短信验证码登录」或「邮箱验证码登录」",resetPasswordForEmail:"「邮箱验证码登录」",reauthenticate:"「短信验证码登录」或「邮箱验证码登录」"}[n]||"对应的登录方式";switch(e){case i.PROVIDER_NOT_ENABLED:return"[CloudBase Auth] 登录方式未开启\n\n"+" 当前调用的 ".concat(n,"() 所需的登录方式尚未在云开发控制台启用。\n")+" 需要开启的登录方式:".concat(r,"\n")+"\n 请按以下步骤开启:\n"+" 1. 打开云开发控制台:".concat(s,"\n")+" 2. 选择对应的云开发环境\n 3. 进入「登录授权」页面,在「登录方式」或「身份源列表」中开启所需的登录方式\n\n 各登录方法与所需登录方式的对应关系:\n - signInWithPassword → 「用户名密码登录」\n - signInAnonymously → 「匿名登录」\n - signInWithOtp/signUp → 「短信验证码登录」或「邮箱验证码登录」\n - signInWithOAuth/signInWithIdToken → 对应的第三方身份源\n\n 如使用 CLI/MCP 工具,可通过 auth 工具查询和配置身份源状态。\n"+" 更多帮助请参考文档:".concat(c);case i.INVALID_CREDENTIALS:return"[CloudBase Auth] 凭据验证失败\n\n"+" 调用 ".concat(n,"() 时凭据校验未通过。\n")+"\n 请按优先级逐项排查:\n 1. 确认用户名/邮箱/手机号是否拼写正确、格式完整\n 2. 确认密码是否正确(注意大小写、特殊字符、前后空格)\n 3. 确认用户账号确实存在(可通过 auth.isUsernameRegistered() 检查)\n 4. 确认凭据参数来源可靠(环境变量、配置文件中的值是否已正确设置)\n 5. 如使用加密登录(is_encrypt: true),请确认公钥版本正确\n\n 如忘记密码,可通过 auth.resetPasswordForEmail() 重置密码。\n\n 提示:如果是 AI agent / 自动化测试场景,请确认 ENV_ID、USERNAME、PASSWORD\n 等环境变量已正确传入,且对应用户已在目标环境中注册。";case i.USER_NOT_FOUND:return"[CloudBase Auth] 用户不存在\n\n 请检查以下项目:\n 1. 确认用户名/邮箱/手机号是否正确\n 2. 确认是在正确的云开发环境(envId)下操作\n 3. 如果是新用户,请先通过 auth.signUp() 注册\n"+" 4. 也可在云开发控制台手动创建用户:".concat(s,"\n")+"\n 提示:不同环境(开发/测试/生产)的用户库是隔离的,请确认 envId 正确。";case i.USER_STATUS_ABNORMAL:return"[CloudBase Auth] 用户状态异常\n\n 当前用户账号可能处于以下状态之一:\n - 账号已被封禁\n - 账号正在审核中\n - 账号已被锁定(多次密码错误)\n\n"+" 请联系管理员在云开发控制台检查用户状态:".concat(s);case i.SERVICE_ERROR:return"[CloudBase Auth] 服务异常\n\n 请检查以下项目:\n 1. 网络连接是否正常\n 2. 云开发环境是否正常运行\n 3. 稍后重试,如持续失败请联系技术支持\n\n 提示:如果是超时错误,请检查网络环境和请求频率。\n 常见服务端错误:smtp 未配置、短信服务未配置、wedaapis 未设置等。";case i.INVALID_PARAMS:return"[CloudBase Auth] 参数错误\n\n 请检查传入的参数是否符合要求:\n - 不能同时输入手机号和邮箱\n - 手机号格式需正确(如 +86 开头)\n - 必须提供手机号或邮箱\n\n"+" 参考 API 文档确认各参数的格式和约束:".concat(c);case i.AUTH_METHOD_MISMATCH:return"[CloudBase Auth] 登录方式不匹配\n\n"+" 调用 ".concat(n,"() 时遇到错误,可能原因:\n")+" - 匿名登录失败后尝试了用户名密码登录,但凭据不正确或用户不存在\n - 应使用匿名登录但传入了密码参数\n - 应使用密码登录但未传入正确的凭据\n\n 建议:\n 1. 明确当前场景需要的登录方式:\n - 无需用户注册 → auth.signInAnonymously()\n - 有用户名和密码 → auth.signInWithPassword({ username, password })\n - 第三方平台 → auth.signInWithOAuth({ provider })\n 2. 不要在同一流程中混合使用不同的登录方式\n 3. 每种登录方式需要在控制台开启对应的身份源\n"+" 4. 控制台地址:".concat(s);case i.RATE_LIMITED:return"[CloudBase Auth] 发送频率受限\n\n 验证码发送过于频繁,已触发频率限制。\n\n 限制规则:\n - 手机号:每分钟最多 1 条,每天有上限\n - 邮箱:每分钟有上限,每天有上限(默认 50 条)\n\n 建议:\n 1. 检查 error.retryAfter 获取建议等待时间\n 2. 在 UI 中显示倒计时,防止用户重复点击\n 3. 如业务需要更高频率,请联系技术支持调整限额";case i.CAPTCHA_REQUIRED:return"[CloudBase Auth] 需要滑块验证码\n\n 当前操作触发了风控策略,需要完成滑块验证。\n\n 处理方式:\n 1. 调用滑块验证码 SDK 展示验证组件\n 2. 用户完成验证后,将 captcha_token 附带到请求中重新发送\n 3. 可通过 getVerification 的 options.withCaptcha 参数自动携带验证码";case i.CAPTCHA_INVALID:return"[CloudBase Auth] 滑块验证码校验失败\n\n 提交的验证码 token 校验未通过(可能已过期或 client_id 不匹配)。\n\n 处理方式:\n 1. 刷新滑块验证码,让用户重新验证\n 2. 确认 captcha 组件初始化的 client_id 与认证配置一致";case i.MFA_REQUIRED:return"[CloudBase Auth] 需要 MFA 验证\n\n 当前操作要求用户绑定手机号进行多因素认证 (MFA)。\n\n 处理方式:\n 1. 引导用户进入手机号绑定流程\n 2. 绑定完成后重新执行原操作\n 3. error 中可能包含 MFA 详情信息";case i.PRECONDITION_FAILED:return"[CloudBase Auth] 前置条件不满足\n\n 当前操作的前置条件不满足,常见原因:\n - 该手机号/邮箱已被其他账号绑定\n - 目标用户不存在或已存在(与 target 参数冲突)\n - 当前邮箱/手机号未注册用户\n\n 请根据 error.message 中的具体描述处理。";case i.VERIFICATION_FAILED:return'[CloudBase Auth] 验证码校验失败\n\n 验证码验证未通过,常见原因:\n - 验证码已过期(通常有效期为几分钟)\n - 验证码输入不正确\n - verification_id 无效或已被使用\n - 验证码不属于当前项目(project id does not match)\n\n 处理方式:\n 1. 提示用户"验证码已过期或不正确,请重新获取"\n 2. 调用 getVerification() 重新发送验证码\n 3. 确保 verification_id 与最新发送的验证码对应\n\n 注意:每次重新发送验证码后,之前的 verification_id 即失效。';default:return"[CloudBase Auth] 操作失败\n\n 如果问题持续存在,建议:\n"+" 1. 检查云开发控制台的认证配置:".concat(s,"\n")+" 2. 到官方问答社区提问:https://cnb.cool/tencent/cloud/cloudbase/community/-/issues\n"+" 3. 查阅文档:".concat(c)}}(o.category,n),o.loginMethodHint=(r=null==n?void 0:n.method)&&{signInWithPassword:"当前使用「用户名密码登录」,需确保:\n ✓ 控制台已开启「用户名密码登录」\n ✓ 用户已注册且凭据正确\n 如果不需要用户系统,建议改用 auth.signInAnonymously()",signInAnonymously:"当前使用「匿名登录」,需确保:\n ✓ 控制台已开启「匿名登录」\n 注意:匿名用户无需用户名密码,适用于快速体验或临时访问场景",signInWithOtp:"当前使用「OTP 验证码登录」,需确保:\n ✓ 控制台已开启「短信验证码登录」或「邮箱验证码登录」",signInWithOAuth:"当前使用「第三方 OAuth 登录」,需确保:\n ✓ 控制台已配置并开启对应的第三方身份源"}[r]||"",o.category===i.RATE_LIMITED&&(o.retryAfter=t.retry_after||t.retryAfter||void 0),o}return o(t,e),t}(Error);t.AuthError=u},4949:(e,t)=>{"use strict";var n,r,o,i,a;Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_NODE_ACCESS_SCOPE=t.OAUTH_TYPE=t.EVENTS=t.AUTH_STATE_CHANGED_TYPE=t.LOGIN_STATE_CHANGED_TYPE=t.AuthErrorCode=t.ErrorType=t.VerificationUsages=t.ApiUrlsV2=t.ApiUrls=t.AUTH_API_PREFIX=void 0,t.AUTH_API_PREFIX="/auth",(a=t.ApiUrls||(t.ApiUrls={})).AUTH_SIGN_UP_URL="/v1/signup",a.AUTH_TOKEN_URL="/v1/token",a.AUTH_REVOKE_URL="/v1/revoke",a.WEDA_USER_URL="/v1/plugin/weda/userinfo",a.AUTH_RESET_PASSWORD="/v1/reset",a.AUTH_GET_DEVICE_CODE="/v1/device/code",a.CHECK_USERNAME="/v1/checkUsername",a.CHECK_IF_USER_EXIST="/v1/checkIfUserExist",a.GET_PROVIDER_TYPE="/v1/mgr/provider/providerSubType",a.AUTH_SIGN_IN_URL="/v1/signin",a.AUTH_SIGN_IN_ANONYMOUSLY_URL="/v1/signin/anonymously",a.AUTH_SIGN_IN_WITH_PROVIDER_URL="/v1/signin/with/provider",a.AUTH_SIGN_IN_WITH_WECHAT_URL="/v1/signin/wechat/noauth",a.AUTH_SIGN_IN_CUSTOM="/v1/signin/custom",a.PROVIDER_TOKEN_URL="/v1/provider/token",a.PROVIDER_URI_URL="/v1/provider/uri",a.USER_ME_URL="/v1/user/me",a.AUTH_SIGNOUT_URL="/v1/user/signout",a.USER_QUERY_URL="/v1/user/query",a.USER_PRIFILE_URL="/v1/user/profile",a.USER_BASIC_EDIT_URL="/v1/user/basic/edit",a.USER_TRANS_BY_PROVIDER_URL="/v1/user/trans/by/provider",a.PROVIDER_LIST="/v1/user/provider",a.PROVIDER_BIND_URL="/v1/user/provider/bind",a.PROVIDER_UNBIND_URL="/v1/user/provider",a.CHECK_PWD_URL="/v1/user/sudo",a.SUDO_URL="/v1/user/sudo",a.BIND_CONTACT_URL="/v1/user/contact",a.AUTH_SET_PASSWORD="/v1/user/password",a.AUTHORIZE_DEVICE_URL="/v1/user/device/authorize",a.AUTHORIZE_URL="/v1/user/authorize",a.AUTHORIZE_INFO_URL="/v1/user/authorize/info",a.AUTHORIZED_DEVICES_DELETE_URL="/v1/user/authorized/devices/",a.AUTH_REVOKE_ALL_URL="/v1/user/revoke/all",a.GET_USER_BEHAVIOR_LOG="/v1/user/security/history",a.VERIFICATION_URL="/v1/verification",a.VERIFY_URL="/v1/verification/verify",a.CAPTCHA_DATA_URL="/v1/captcha/data",a.VERIFY_CAPTCHA_DATA_URL="/v1/captcha/data/verify",a.GET_CAPTCHA_URL="/v1/captcha/init",a.GET_MINIPROGRAM_QRCODE="/v1/qrcode/generate",a.GET_MINIPROGRAM_QRCODE_STATUS="/v1/qrcode/get/status",(i=t.ApiUrlsV2||(t.ApiUrlsV2={})).AUTH_SIGN_IN_URL="/v2/signin/username",i.AUTH_TOKEN_URL="/v2/token",i.USER_ME_URL="/v2/user/me",i.VERIFY_URL="/v2/signin/verificationcode",i.AUTH_SIGN_IN_WITH_PROVIDER_URL="/v2/signin/with/provider",i.AUTH_PUBLIC_KEY="/v2/signin/publichkey",i.AUTH_RESET_PASSWORD="/v2/signin/password/update",(o=t.VerificationUsages||(t.VerificationUsages={})).REGISTER="REGISTER",o.SIGN_IN="SIGN_IN",o.PASSWORD_RESET="PASSWORD_RESET",o.EMAIL_ADDRESS_CHANGE="EMAIL_ADDRESS_CHANGE",o.PHONE_NUMBER_CHANGE="PHONE_NUMBER_CHANGE",(r=t.ErrorType||(t.ErrorType={})).UNREACHABLE="unreachable",r.LOCAL="local",r.CANCELLED="cancelled",r.UNKNOWN="unknown",r.UNAUTHENTICATED="unauthenticated",r.RESOURCE_EXHAUSTED="resource_exhausted",r.FAILED_PRECONDITION="failed_precondition",r.INVALID_ARGUMENT="invalid_argument",r.DEADLINE_EXCEEDED="deadline_exceeded",r.NOT_FOUND="not_found",r.ALREADY_EXISTS="already_exists",r.PERMISSION_DENIED="permission_denied",r.ABORTED="aborted",r.OUT_OF_RANGE="out_of_range",r.UNIMPLEMENTED="unimplemented",r.INTERNAL="internal",r.UNAVAILABLE="unavailable",r.DATA_LOSS="data_loss",r.INVALID_PASSWORD="invalid_password",r.PASSWORD_NOT_SET="password_not_set",r.INVALID_STATUS="invalid_status",r.USER_PENDING="user_pending",r.USER_BLOCKED="user_blocked",r.INVALID_VERIFICATION_CODE="invalid_verification_code",r.TWO_FACTOR_REQUIRED="two_factor_required",r.INVALID_TWO_FACTOR="invalid_two_factor",r.INVALID_TWO_FACTOR_RECOVERY="invalid_two_factor_recovery",r.UNDER_REVIEW="under_review",r.INVALID_REQUEST="invalid_request",r.UNAUTHORIZED_CLIENT="unauthorized_client",r.ACCESS_DENIED="access_denied",r.UNSUPPORTED_RESPONSE_TYPE="unsupported_response_type",r.INVALID_SCOPE="invalid_scope",r.INVALID_GRANT="invalid_grant",r.SERVER_ERROR="server_error",r.TEMPORARILY_UNAVAILABLE="temporarily_unavailable",r.INTERACTION_REQUIRED="interaction_required",r.LOGIN_REQUIRED="login_required",r.ACCOUNT_SELECTION_REQUIRED="account_selection_required",r.CONSENT_REQUIRED="consent_required",r.INVALID_REQUEST_URI="invalid_request_uri",r.INVALID_REQUEST_OBJECT="invalid_request_object",r.REQUEST_NOT_SUPPORTED="request_not_supported",r.REQUEST_URI_NOT_SUPPORTED="request_uri_not_supported",r.REGISTRATION_NOT_SUPPORTED="registration_not_supported",r.CAPTCHA_REQUIRED="captcha_required",r.CAPTCHA_INVALID="captcha_invalid",r.PROVIDER_NOT_ENABLED="provider_not_enabled",r.LOGIN_METHOD_DISABLED="login_method_disabled",r.INVALID_USERNAME_OR_PASSWORD="invalid_username_or_password",r.INVALID_CREDENTIALS="invalid_credentials",r.WRONG_PASSWORD="wrong_password",r.USER_NOT_FOUND="user_not_found",r.MFA_PHONE_REQUIRED="mfa_phone_required",r.LOGIN_TYPE_DISABLED="login_type_disabled",r.PROVIDER_ERROR="provider_error",(n=t.AuthErrorCode||(t.AuthErrorCode={}))[n.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",n[n.NOT_FOUND=5]="NOT_FOUND",n[n.PERMISSION_DENIED=7]="PERMISSION_DENIED",n[n.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",n[n.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",n[n.ABORTED=10]="ABORTED",n[n.UNIMPLEMENTED=12]="UNIMPLEMENTED",n[n.INTERNAL=13]="INTERNAL",n[n.UNAVAILABLE=14]="UNAVAILABLE",n[n.UNAUTHENTICATED=16]="UNAUTHENTICATED",n[n.CAPTCHA_REQUIRED=4001]="CAPTCHA_REQUIRED",n[n.CAPTCHA_INVALID=4002]="CAPTCHA_INVALID",n[n.PROVIDER_ERROR=4019]="PROVIDER_ERROR",n[n.UNAUTHORIZED_CLIENT=4022]="UNAUTHORIZED_CLIENT",n[n.MFA_PHONE_REQUIRED=4042]="MFA_PHONE_REQUIRED",n[n.LOGIN_TYPE_DISABLED=4045]="LOGIN_TYPE_DISABLED",t.LOGIN_STATE_CHANGED_TYPE={SIGN_OUT:"sign_out",SIGN_IN:"sign_in",CREDENTIALS_ERROR:"credentials_error"},t.AUTH_STATE_CHANGED_TYPE={SIGNED_OUT:"SIGNED_OUT",SIGNED_IN:"SIGNED_IN",INITIAL_SESSION:"INITIAL_SESSION",PASSWORD_RECOVERY:"PASSWORD_RECOVERY",TOKEN_REFRESHED:"TOKEN_REFRESHED",USER_UPDATED:"USER_UPDATED",BIND_IDENTITY:"BIND_IDENTITY"},t.EVENTS={LOGIN_STATE_CHANGED:"loginStateChanged",AUTH_STATE_CHANGED:"authStateChanged"},t.OAUTH_TYPE={SIGN_IN:"sign_in",BIND_IDENTITY:"bind_identity"},t.DEFAULT_NODE_ACCESS_SCOPE="node-sdk-scope"},3538:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2084:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.openURIWithCallback=void 0;var a=n(9689),s=n(3616),c=function(e,t){var n;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];clearTimeout(n),n=setTimeout((function(){return e.apply(null,r)}),t)}},u=new a.CloudbaseEventEmitter,l="resolveCaptchaData",p="padding:10px 8px;background:#007bff;color:#fff;border:none;border-radius:4px;cursor:pointer;flex:1;white-space:nowrap;margin-left:10px",d="width:100%;padding:10px;background:#007bff;color:#fff;border:none;border-radius:4px;cursor:pointer",h="background:#6c757d;cursor:not-allowed";t.openURIWithCallback=function(e,t){return o(void 0,void 0,Promise,(function(){var n,a,f,m;return i(this,(function(v){return n=(0,s.parseCaptcha)(e),a=n.captchaData,f=n.state,m=n.token,function(e){var t=e.oauthInstance,n=e.captchaState,a="captcha-image",s=function(){return o(void 0,void 0,void 0,(function(){var e,o;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,t.createCaptchaData({state:n.state})];case 1:return e=i.sent(),n=r(r({},n),{captchaData:e.data,token:e.token}),document.getElementById(a).src=e.data,[3,3];case 2:return o=i.sent(),console.error("刷新图形验证码失败",o),[3,3];case 3:return[2]}}))}))},f=function(e,t,n){var r=document.createElement(e);return t&&(r.style.cssText=t),n&&(r.textContent=n),r},m=f("div","position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.5);z-index:999"),v=f("div","position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:320px;padding:20px;background:#fff;border-radius:8px;box-shadow:0 0 10px rgba(0,0,0,0.2);z-index:1000");v.appendChild(f("p","margin-bottom:15px","请输入你看到的字符:"));var g=f("div","display:flex;align-items:center;justify-content:space-between;margin-bottom:15px"),b=f("img","width:100%;height:auto;border:1px solid #eee");b.id=a,b.src=n.captchaData,g.appendChild(b);var y=f("button",p,"刷新");y.onclick=c((function(){return o(void 0,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:y.textContent="加载中...",y.disabled=!0,y.style.cssText="".concat(p,";").concat(h),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,s()];case 2:return e.sent(),[3,4];case 3:return y.textContent="刷新",y.disabled=!1,y.style.cssText=p,[7];case 4:return[2]}}))}))}),500),g.appendChild(y),v.appendChild(g);var _=f("input","width:100%;padding:14px 16px;margin-bottom:15px;box-sizing:border-box;border:2px solid #e8ecf4;border-radius:10px;font-size:15px");_.type="text",_.placeholder="输入字符",_.maxLength=4,v.appendChild(_);var x=f("div","color:#dc3545;font-size:12px;margin-bottom:10px;display:none;padding:8px;background:#f8d7da;border:1px solid #f5c6cb;border-radius:4px");v.appendChild(x);var w=function(e){x.textContent=e,x.style.display="block"},E=f("button",d,"确定");E.onclick=c((function(){return o(void 0,void 0,void 0,(function(){var e,r,o,a;return i(this,(function(i){switch(i.label){case 0:if(!(e=_.value.trim()))return w("请输入字符"),[2];x.style.display="none",E.textContent="验证中...",E.disabled=!0,E.style.cssText="".concat(d,";").concat(h),i.label=1;case 1:return i.trys.push([1,3,5,6]),[4,t.verifyCaptchaData({token:n.token,key:e})];case 2:return r=i.sent(),u.fire(l,r),console.log("图形验证码校验成功"),document.body.removeChild(m),document.body.removeChild(v),[3,6];case 3:return o=i.sent(),console.error("图形验证码校验失败",o),a=o.error_description||"图形验证码校验失败",w(a),_.value="",_.focus(),[4,s()];case 4:return i.sent(),[3,6];case 5:return E.textContent="确定",E.disabled=!1,E.style.cssText=d,[7];case 6:return[2]}}))}))}),500),v.appendChild(E),document.body.appendChild(m),document.body.appendChild(v)}({oauthInstance:t,captchaState:{captchaData:a,state:f,token:m}}),[2,new Promise((function(e){console.log("等待图形验证码校验结果..."),u.on(l,(function(t){e(null==t?void 0:t.data)}))}))]}))}))}},2962:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Captcha=void 0;var i=n(4949),a=n(5257),s=n(7425),c=n(2084),u=function(){function e(e){e.openURIWithCallback||(e.openURIWithCallback=this.getDefaultOpenURIWithCallback()),e.storage||(e.storage=a.defaultStorage),this.config=e,this.tokenSectionName="captcha_".concat(e.clientId||e.env)}return e.prototype.isMatch=function(){var e,t,n;return(null===(n=null===(t=null===(e=this.config)||void 0===e?void 0:e.adapter)||void 0===t?void 0:t.isMatch)||void 0===n?void 0:n.call(t))||(0,s.isMp)()},e.prototype.request=function(e,t){return r(this,void 0,Promise,(function(){var n,r,a,s;return o(this,(function(o){switch(o.label){case 0:return t||(t={}),t.method||(t.method="GET"),n="".concat(t.method,":").concat(e),r=e,t.withCaptcha?[4,this.appendCaptchaTokenToURL(e,n,!1)]:[3,2];case 1:r=o.sent(),o.label=2;case 2:return o.trys.push([2,4,,7]),[4,this.config.request(r,t)];case 3:return a=o.sent(),[3,7];case 4:return(s=o.sent()).error!==i.ErrorType.CAPTCHA_REQUIRED&&s.error!==i.ErrorType.CAPTCHA_INVALID?[3,6]:[4,this.appendCaptchaTokenToURL(e,n,s.error===i.ErrorType.CAPTCHA_INVALID)];case 5:return e=o.sent(),[2,this.config.request(e,t)];case 6:return[2,Promise.reject(s)];case 7:return[2,a]}}))}))},e.prototype.getDefaultOpenURIWithCallback=function(){var e=this;return function(t){return(0,c.openURIWithCallback)(t,e.config.oauthInstance)}},e.prototype.getCaptchaToken=function(e,t){return r(this,void 0,Promise,(function(){var n,r,a,s;return o(this,(function(o){switch(o.label){case 0:return e?[3,2]:[4,this.findCaptchaToken()];case 1:if(n=o.sent())return[2,n];o.label=2;case 2:return[4,this.config.request(i.ApiUrls.CAPTCHA_DATA_URL,{method:"POST",body:{state:t,redirect_uri:""},withCredentials:!1})];case 3:return r=o.sent(),a="".concat(r.data,"?state=").concat(encodeURIComponent(t),"&token=").concat(encodeURIComponent(r.token)),[4,this.config.openURIWithCallback(a)];case 4:return s=o.sent(),this.saveCaptchaToken(s),[2,s.captcha_token]}}))}))},e.prototype.appendCaptchaTokenToURL=function(e,t,n){return r(this,void 0,Promise,(function(){var r;return o(this,(function(o){switch(o.label){case 0:return[4,this.getCaptchaToken(n,t)];case 1:return r=o.sent(),e.indexOf("?")>0?e+="&captcha_token=".concat(r):e+="?captcha_token=".concat(r),[2,e]}}))}))},e.prototype.saveCaptchaToken=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return e.expires_at=new Date(Date.now()+1e3*(e.expires_in-10)),t=JSON.stringify(e),[4,this.config.storage.setItem(this.tokenSectionName,t)];case 1:return n.sent(),[2]}}))}))},e.prototype.findCaptchaToken=function(){return r(this,void 0,Promise,(function(){var e,t;return o(this,(function(n){switch(n.label){case 0:return[4,this.config.storage.getItem(this.tokenSectionName)];case 1:if(null==(e=n.sent()))return[3,5];n.label=2;case 2:return n.trys.push([2,3,,5]),(null==(t=JSON.parse(e))?void 0:t.expires_at)&&(t.expires_at=new Date(t.expires_at)),t.expires_at<new Date?[2,null]:[2,t.captcha_token];case 3:return n.sent(),[4,this.config.storage.removeItem(this.tokenSectionName)];case 4:return n.sent(),[2,null];case 5:return[2,null]}}))}))},e}();t.Captcha=u},6722:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.CloudbaseOAuth=t.AuthErrorCode=t.AUTH_STATE_CHANGED_TYPE=t.EVENTS=t.LOGIN_STATE_CHANGED_TYPE=t.DEFAULT_NODE_ACCESS_SCOPE=t.OAUTH_TYPE=t.AUTH_API_PREFIX=t.weAppJwtDecodeAll=t.authModels=t.AuthErrorCategory=t.AuthError=t.Auth=void 0;var s=n(5257),c=n(5413),u=n(4949),l=n(5413);Object.defineProperty(t,"Auth",{enumerable:!0,get:function(){return l.Auth}});var p=n(8308);Object.defineProperty(t,"AuthError",{enumerable:!0,get:function(){return p.AuthError}}),Object.defineProperty(t,"AuthErrorCategory",{enumerable:!0,get:function(){return p.AuthErrorCategory}}),t.authModels=a(n(3538));var d=n(2344);Object.defineProperty(t,"weAppJwtDecodeAll",{enumerable:!0,get:function(){return d.weAppJwtDecodeAll}});var h=n(4949);Object.defineProperty(t,"AUTH_API_PREFIX",{enumerable:!0,get:function(){return h.AUTH_API_PREFIX}}),Object.defineProperty(t,"OAUTH_TYPE",{enumerable:!0,get:function(){return h.OAUTH_TYPE}}),Object.defineProperty(t,"DEFAULT_NODE_ACCESS_SCOPE",{enumerable:!0,get:function(){return h.DEFAULT_NODE_ACCESS_SCOPE}}),Object.defineProperty(t,"LOGIN_STATE_CHANGED_TYPE",{enumerable:!0,get:function(){return h.LOGIN_STATE_CHANGED_TYPE}}),Object.defineProperty(t,"EVENTS",{enumerable:!0,get:function(){return h.EVENTS}}),Object.defineProperty(t,"AUTH_STATE_CHANGED_TYPE",{enumerable:!0,get:function(){return h.AUTH_STATE_CHANGED_TYPE}}),Object.defineProperty(t,"AuthErrorCode",{enumerable:!0,get:function(){return h.AuthErrorCode}});var f=function(){function e(e){var t=e.apiOrigin,n=e.getApiOrigin,o=e.apiPath,i=void 0===o?u.AUTH_API_PREFIX:o,a=e.clientId,l=e.env,p=e.storage,d=e.request,h=e.baseRequest,f=e.anonymousSignInFunc,m=e.wxCloud,v=e.adapter,g=e.onCredentialsError,b=e.headers,y=e.i18n,_=e.useWxCloud,x=e.eventBus,w=e.detectSessionInUrl,E=e.debug;if(this.detectSessionInUrl=null!=w&&w,this.oauth2client=new s.OAuth2Client({apiOrigin:t,getApiOrigin:n,apiPath:i,clientId:a,env:l,storage:p,baseRequest:h||d,anonymousSignInFunc:f,wxCloud:m,onCredentialsError:g,headers:b||{},i18n:y,useWxCloud:_,eventBus:x,debug:E}),this.authApi=new c.Auth(r(r({credentialsClient:this.oauth2client},e),{request:d?this.oauth2client.request.bind(this.oauth2client):void 0,adapter:v})),w)this.oauth2client.setGetInitialSession(this.authApi.getInitialSession.bind(this.authApi));else try{var I=new URL(window.location.href),S=I.searchParams.get("code"),O=I.searchParams.get("state"),T=JSON.parse(sessionStorage.getItem(O)||"null");S&&O&&(null==T?void 0:T.hash)&&(I.hash=T.hash,window.history.replaceState(null,"",I.toString()),window.location.replace(I.toString()))}catch(e){}}return e.prototype.initializeSession=function(e){this.detectSessionInUrl?(this.oauth2client.setOnInitialSessionObtained(e),this.oauth2client.initialize()):this.oauth2client.initialize(Promise.resolve({error:null}))},e}();t.CloudbaseOAuth=f},6877:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Syntax=t.ErrorType=void 0;var r,o=n(4949);Object.defineProperty(t,"ErrorType",{enumerable:!0,get:function(){return o.ErrorType}}),(r=t.Syntax||(t.Syntax={})).CLIENT_ID="client_id",r.CLIENT_SECRET="client_secret",r.RESPONSE_TYPE="response_type",r.SCOPE="scope",r.STATE="state",r.REDIRECT_URI="redirect_uri",r.ERROR="error",r.ERROR_DESCRIPTION="error_description",r.ERROR_URI="error_uri",r.GRANT_TYPE="grant_type",r.CODE="code",r.ACCESS_TOKEN="access_token",r.TOKEN_TYPE="token_type",r.EXPIRES_IN="expires_in",r.USERNAME="username",r.PASSWORD="password",r.REFRESH_TOKEN="refresh_token"},5257:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},a=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.OAuth2Client=t.defaultStorage=t.generateRequestId=t.toResponseError=t.defaultRequest=void 0;var s=n(6877),c=n(4949),u=n(873),l=n(2631),p=n(8547),d=n(2344),h=n(7425),f=n(2877),m="x-request-id",v="x-device-id",g="device_id";function b(){return(0,u.uuidv4)()}t.defaultRequest=function(e,t){return o(this,void 0,Promise,(function(){var n,r,o,a,c;return i(this,(function(i){switch(i.label){case 0:n=null,r=null,i.label=1;case 1:return i.trys.push([1,4,,5]),(o=Object.assign({},t)).method||(o.method="GET"),o.body&&"string"!=typeof o.body&&(o.body=JSON.stringify(o.body)),[4,fetch(e,o)];case 2:return[4,i.sent().json()];case 3:return(null==(a=i.sent())?void 0:a.error)?(r=a).error_uri=new URL(e).pathname:n=a,[3,5];case 4:return c=i.sent(),r={error:s.ErrorType.UNREACHABLE,error_description:c.message,error_uri:new URL(e).pathname},[3,5];case 5:if(r)throw r;return[2,n]}}))}))},t.toResponseError=function(e,t){var n,r=t||{};if(e instanceof Error)n={error:r.error||s.ErrorType.LOCAL,error_description:r.error_description||e.message,error_uri:r.error_uri,details:r.details||e.stack};else{var o=e||{};n={error:r.error||o.error||s.ErrorType.LOCAL,error_description:r.error_description||o.error_description,error_uri:r.error_uri||o.error_uri,details:r.details||o.details}}return n},t.generateRequestId=b;var y=function(){function e(e){this._env=(null==e?void 0:e.env)||""}return e.prototype.getItem=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,window.localStorage.getItem("".concat(e).concat(this._env))]}))}))},e.prototype.removeItem=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return window.localStorage.removeItem("".concat(e).concat(this._env)),[2]}))}))},e.prototype.setItem=function(e,t){return o(this,void 0,Promise,(function(){return i(this,(function(n){return window.localStorage.setItem("".concat(e).concat(this._env),t),[2]}))}))},e.prototype.getItemSync=function(e){return window.localStorage.getItem("".concat(e).concat(this._env))},e.prototype.removeItemSync=function(e){window.localStorage.removeItem("".concat(e).concat(this._env))},e.prototype.setItemSync=function(e,t){window.localStorage.setItem("".concat(e).concat(this._env),t)},e}();function _(e){var t=!0;return(null==e?void 0:e.expires_at)&&(null==e?void 0:e.access_token)&&(t=e.expires_at<new Date),t}t.defaultStorage=new y;var x=function(){function e(e){this.credentials=null,this.accessKeyCredentials=null,this.singlePromise=null,this.tokenSectionName=e.tokenSectionName,this.storage=e.storage,this.clientId=e.clientId,this.singlePromise=new p.SinglePromise({clientId:this.clientId}),this.credentials=e.credentials||null}return e.prototype.getStorageCredentialsSync=function(){var e=null,t=this.storage.getItemSync(this.tokenSectionName);if(null!=t)try{(null==(e=JSON.parse(t))?void 0:e.expires_at)&&(e.expires_at=new Date(e.expires_at))}catch(t){this.storage.removeItem(this.tokenSectionName),e=null}return e},e.prototype.setCredentials=function(e){return o(this,void 0,Promise,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return(null==e?void 0:e.expires_in)?((null==e?void 0:e.expires_at)||(e.expires_at=new Date(Date.now()+1e3*(e.expires_in-30))),this.storage?(t=JSON.stringify(e),[4,this.storage.setItem(this.tokenSectionName,t)]):[3,2]):[3,3];case 1:n.sent(),n.label=2;case 2:return this.credentials=e,[3,6];case 3:return this.storage?[4,this.storage.removeItem(this.tokenSectionName)]:[3,5];case 4:n.sent(),n.label=5;case 5:this.credentials=null,n.label=6;case 6:return[2]}}))}))},e.prototype.setAccessKeyCredentials=function(e){this.accessKeyCredentials=e,e.scope===c.DEFAULT_NODE_ACCESS_SCOPE&&(this.credentials=e)},e.prototype.getCredentials=function(){return o(this,void 0,Promise,(function(){var e=this;return i(this,(function(t){return[2,this.singlePromise.run("getCredentials",(function(){return o(e,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return _(this.credentials)?[4,this.getStorageCredentials()]:[3,2];case 1:if(e=n.sent(),t=e.credentials,e.isAccessKeyCredentials)return[2,t];this.credentials=t,n.label=2;case 2:return[2,this.credentials]}}))}))}))]}))}))},e.prototype.getStorageCredentials=function(){return o(this,void 0,Promise,(function(){var e=this;return i(this,(function(t){return[2,this.singlePromise.run("_getStorageCredentials",(function(){return o(e,void 0,void 0,(function(){var e,t,n;return i(this,(function(r){switch(r.label){case 0:return e=null,t=!1,[4,this.storage.getItem(this.tokenSectionName)];case 1:if(!(n=r.sent()))return[3,6];r.label=2;case 2:return r.trys.push([2,3,,5]),(null==(e=JSON.parse(n))?void 0:e.expires_at)&&(e.expires_at=new Date(e.expires_at)),[3,5];case 3:return r.sent(),[4,this.storage.removeItem(this.tokenSectionName)];case 4:return r.sent(),e=null,[3,5];case 5:return[3,7];case 6:e=this.accessKeyCredentials||null,t=!0,r.label=7;case 7:return[2,{credentials:e,isAccessKeyCredentials:t}]}}))}))}))]}))}))},e}();t.OAuth2Client=function(){function e(n){var r,o=this;this.initializePromise=null,this.lockAcquired=!1,this.pendingInLock=[],this.singlePromise=null,n.clientSecret||(n.clientSecret=""),!n.clientId&&n.env&&(n.clientId=n.env),this.apiOrigin=n.apiOrigin,this.getApiOriginFunc=n.getApiOrigin,this.apiPath=n.apiPath||c.AUTH_API_PREFIX,this.clientId=n.clientId,this.i18n=n.i18n,this.eventBus=n.eventBus,this.singlePromise=new p.SinglePromise({clientId:this.clientId}),this.retry=this.formatRetry(n.retry,e.defaultRetry),n.baseRequest?this.baseRequest=n.baseRequest:this.baseRequest=t.defaultRequest,this.tokenInURL=n.tokenInURL,this.headers=n.headers,this.storage=n.storage||t.defaultStorage,this.localCredentials=new x({tokenSectionName:"credentials_".concat(n.clientId),storage:this.storage,clientId:n.clientId}),this.clientSecret=n.clientSecret,n.clientId&&(this.basicAuth="Basic ".concat((0,d.weBtoa)("".concat(n.clientId,":").concat(this.clientSecret)))),this.wxCloud=n.wxCloud;try{(0,h.isMp)()&&(this.useWxCloud=n.useWxCloud,void 0===this.wxCloud&&n.env&&(wx.cloud.init({env:n.env}),this.wxCloud=wx.cloud))}catch(e){}this.refreshTokenFunc=n.refreshTokenFunc||this.defaultRefreshTokenFunc,this.anonymousSignInFunc=n.anonymousSignInFunc,this.onCredentialsError=n.onCredentialsError,this.getInitialSession=n.getInitialSession,this.onInitialSessionObtained=n.onInitialSessionObtained,this.logDebugMessages=null!==(r=n.debug)&&void 0!==r&&r,f.langEvent.bus.on(f.langEvent.LANG_CHANGE_EVENT,(function(e){var t;o.i18n=(null===(t=e.data)||void 0===t?void 0:t.i18n)||o.i18n}))}return e.prototype.setGetInitialSession=function(e){this.getInitialSession=e},e.prototype.setOnInitialSessionObtained=function(e){this.onInitialSessionObtained=e},e.prototype.initialize=function(e){return o(this,void 0,Promise,(function(){var t=this;return i(this,(function(n){switch(n.label){case 0:return this.initializePromise?[4,this.initializePromise]:[3,2];case 1:case 3:case 5:return[2,n.sent()];case 2:return void 0===e?[3,4]:(this.initializePromise=e,[4,this.initializePromise]);case 4:return this.initializePromise=o(t,void 0,void 0,(function(){var e=this;return i(this,(function(t){switch(t.label){case 0:return[4,this._acquireLock(-1,(function(){return o(e,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this._initialize()];case 1:return[2,e.sent()]}}))}))}))];case 1:return[2,t.sent()]}}))})),[4,this.initializePromise]}}))}))},e.prototype.setCredentials=function(e){return o(this,void 0,Promise,(function(){var t=this;return i(this,(function(n){switch(n.label){case 0:return[4,this.initializePromise];case 1:return n.sent(),[2,this._acquireLock(-1,(function(){return o(t,void 0,void 0,(function(){return i(this,(function(t){return[2,this.localCredentials.setCredentials(e)]}))}))}))]}}))}))},e.prototype.setAccessKeyCredentials=function(e){return this.localCredentials.setAccessKeyCredentials(e)},e.prototype.getAccessToken=function(){return o(this,void 0,Promise,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return[4,this.initializePromise];case 1:return n.sent(),[4,this.getCredentials()];case 2:return(null==(e=n.sent())?void 0:e.scope)===c.DEFAULT_NODE_ACCESS_SCOPE||(null==e?void 0:e.access_token)?[2,Promise.resolve(e.access_token)]:(t={error:s.ErrorType.UNAUTHENTICATED},[2,Promise.reject(t)])}}))}))},e.prototype.request=function(t,n){var a,c;return o(this,void 0,Promise,(function(){var o,u,l,p,d,h,f,g,y,_;return i(this,(function(i){switch(i.label){case 0:return n||(n={}),o=this.formatRetry(n.retry,this.retry),n.headers=r(r({},n.headers),((_={})[null===(a=this.i18n)||void 0===a?void 0:a.LANG_HEADER_KEY]=null===(c=this.i18n)||void 0===c?void 0:c.lang,_)),this.headers&&(n.headers=r(r({},this.headers),n.headers)),n.headers[m]||(n.headers[m]=b()),n.headers[v]?[3,2]:[4,this.getDeviceId()];case 1:u=i.sent(),n.headers[v]=u,i.label=2;case 2:return(null==n?void 0:n.withBasicAuth)&&this.basicAuth&&(n.headers.Authorization=this.basicAuth),(null==n?void 0:n.withCredentials)?n.getCredentials?[4,n.getCredentials()]:[3,4]:[3,7];case 3:return p=i.sent(),[3,6];case 4:return[4,this.getCredentials()];case 5:p=i.sent(),i.label=6;case 6:return(l=p)&&(this.tokenInURL?(t.indexOf("?")<0&&(t+="?"),t+="access_token=".concat(l.access_token)):n.headers.Authorization="".concat(l.token_type," ").concat(l.access_token)),[3,8];case 7:this.clientId&&t.indexOf("client_id")<0&&(t+=t.indexOf("?")<0?"?":"&",t+="client_id=".concat(this.clientId)),i.label=8;case 8:t.startsWith("/")&&(d=this.getApiOriginFunc?this.getApiOriginFunc():this.apiOrigin,t="".concat(d).concat(this.apiPath).concat(t)),h=null,f=o+1,g=0,i.label=9;case 9:if(!(g<f))return[3,21];i.label=10;case 10:return i.trys.push([10,15,,18]),n.useWxCloud||this.useWxCloud?[4,this.wxCloudCallFunction(t,n)]:[3,12];case 11:return h=i.sent(),[3,14];case 12:return[4,this.baseRequest(t,n)];case 13:h=i.sent(),i.label=14;case 14:if(null==h?void 0:h.code)throw{error:h.code,error_description:h.message,error_uri:new URL(t).pathname};return[3,21];case 15:y=i.sent();try{y.requestId=y.requestId||n.headers[m]||""}catch(e){}return n.withCredentials&&y&&y.error===s.ErrorType.UNAUTHENTICATED?[4,this.setCredentials(null)]:[3,17];case 16:return i.sent(),[2,Promise.reject(y)];case 17:return g!==o&&y&&"unreachable"===y.error?[3,18]:[2,Promise.reject(y)];case 18:return[4,this.sleep(e.retryInterval)];case 19:i.sent(),i.label=20;case 20:return g++,[3,9];case 21:return[2,h]}}))}))},e.prototype.wxCloudCallFunction=function(e,t){var n;return o(this,void 0,Promise,(function(){var o,a,c,u,p;return i(this,(function(i){switch(i.label){case 0:o=null,a=null,i.label=1;case 1:i.trys.push([1,7,,8]),c="",i.label=2;case 2:return i.trys.push([2,4,,5]),[4,wx.getRendererUserAgent()];case 3:return c=i.sent(),[3,5];case 4:return i.sent(),[3,5];case 5:return[4,this.wxCloud.callFunction({name:"httpOverCallFunction",data:{url:e,method:t.method,headers:r({origin:"https://servicewechat.com","User-Agent":c},t.headers),body:t.body}})];case 6:return u=i.sent().result,(null===(n=null==u?void 0:u.body)||void 0===n?void 0:n.error_code)?(a=null==u?void 0:u.body).error_uri=(0,l.getPathName)(e):o=null==u?void 0:u.body,[3,8];case 7:return p=i.sent(),a={error:s.ErrorType.UNREACHABLE,error_description:p.message,error_uri:(0,l.getPathName)(e)},[3,8];case 8:if(a)throw a;return[2,o]}}))}))},e.prototype.getCredentials=function(){return o(this,void 0,Promise,(function(){var e=this;return i(this,(function(t){switch(t.label){case 0:return[4,this.initializePromise];case 1:return t.sent(),[2,this._acquireLock(-1,(function(){return o(e,void 0,void 0,(function(){return i(this,(function(e){return[2,this._getCredentials()]}))}))}))]}}))}))},e.prototype.getCredentialsSync=function(){return this.localCredentials.getStorageCredentialsSync()},e.prototype.getCredentialsAsync=function(){return this.getCredentials()},e.prototype.getScope=function(){var e;return o(this,void 0,Promise,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:return(t=r.sent())?[2,t.scope]:(n="credentials not found",null===(e=this.onCredentialsError)||void 0===e||e.call(this,{msg:n}),[2,this.unAuthenticatedError(n)])}}))}))},e.prototype.getGroups=function(){var e;return o(this,void 0,Promise,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:return(t=r.sent())?[2,t.groups]:(n="credentials not found",null===(e=this.onCredentialsError)||void 0===e||e.call(this,{msg:n}),[2,this.unAuthenticatedError(n)])}}))}))},e.prototype.refreshToken=function(e,t){return o(this,void 0,Promise,(function(){var n=this;return i(this,(function(r){switch(r.label){case 0:return[4,this.initializePromise];case 1:return r.sent(),[2,this._acquireLock(-1,(function(){return o(n,void 0,void 0,(function(){return i(this,(function(n){return[2,this._refreshToken(e,t)]}))}))}))]}}))}))},e.prototype._refreshToken=function(e,t){return o(this,void 0,Promise,(function(){var n=this;return i(this,(function(r){return[2,this.singlePromise.run("_refreshToken",(function(){return o(n,void 0,void 0,(function(){var n,r,o,a,u,l,p;return i(this,(function(i){switch(i.label){case 0:if((null==e?void 0:e.scope)===c.DEFAULT_NODE_ACCESS_SCOPE)return[2,e];if(!e||!e.refresh_token)return o="no refresh token found in credentials",null===(a=this.onCredentialsError)||void 0===a||a.call(this,{msg:o}),[2,this.unAuthenticatedError(o)];i.label=1;case 1:return i.trys.push([1,4,,7]),[4,this.refreshTokenFunc(e.refresh_token,e)];case 2:return n=i.sent(),[4,this.localCredentials.setCredentials(n)];case 3:return i.sent(),null===(u=this.eventBus)||void 0===u||u.fire(c.EVENTS.AUTH_STATE_CHANGED,{event:c.AUTH_STATE_CHANGED_TYPE.TOKEN_REFRESHED}),[2,n];case 4:if(r=i.sent(),null==t?void 0:t.throwError)throw r;return r.error!==s.ErrorType.INVALID_GRANT?[3,6]:[4,this.localCredentials.setCredentials(null)];case 5:return i.sent(),o=r.error_description,null===(l=this.onCredentialsError)||void 0===l||l.call(this,{msg:o}),[2,this.unAuthenticatedError(o)];case 6:return null===(p=this.onCredentialsError)||void 0===p||p.call(this,{msg:r.error_description}),[2,Promise.reject(r)];case 7:return[2]}}))}))}))]}))}))},e.prototype.anonymousLogin=function(e){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,this.singlePromise.run("_anonymousLogin",(function(){return o(t,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return this.anonymousSignInFunc?[4,this.anonymousSignInFunc(e)]:[3,4];case 1:return t=r.sent(),(n=t)?[3,3]:[4,this.localCredentials.getCredentials()];case 2:n=r.sent(),r.label=3;case 3:return e=n,[3,6];case 4:return[4,this.anonymousSignIn(e)];case 5:e=r.sent(),r.label=6;case 6:return[2,e]}}))}))}))]}))}))},e.prototype.checkRetry=function(t){var n=null;if(("number"!=typeof t||t<e.minRetry||t>e.maxRetry)&&(n={error:s.ErrorType.UNREACHABLE,error_description:"wrong options param: retry"}),n)throw n;return t},e.prototype.formatRetry=function(e,t){return void 0===e?t:this.checkRetry(e)},e.prototype.sleep=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,new Promise((function(t){setTimeout((function(){t()}),e)}))]}))}))},e.prototype.anonymousSignIn=function(e){return o(this,void 0,Promise,(function(){var t=this;return i(this,(function(n){return[2,this.singlePromise.run("_anonymous",(function(){return o(t,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:if(!e||"anonymous"!==e.scope)return[2,this.unAuthenticatedError("no anonymous in credentials")];r.label=1;case 1:return r.trys.push([1,4,,7]),[4,this.request(c.ApiUrls.AUTH_SIGN_IN_ANONYMOUSLY_URL,{method:"POST",withBasicAuth:!0,body:{}})];case 2:return t=r.sent(),[4,this.localCredentials.setCredentials(t)];case 3:return r.sent(),[2,t];case 4:return(n=r.sent()).error!==s.ErrorType.INVALID_GRANT?[3,6]:[4,this.localCredentials.setCredentials(null)];case 5:return r.sent(),[2,this.unAuthenticatedError(n.error_description)];case 6:return[2,Promise.reject(n)];case 7:return[2]}}))}))}))]}))}))},e.prototype.defaultRefreshTokenFunc=function(e,t){var n;return o(this,void 0,Promise,(function(){var o,a,s;return i(this,(function(i){switch(i.label){case 0:return void 0===e||""===e?(o="refresh token not found",null===(n=this.onCredentialsError)||void 0===n||n.call(this,{msg:o}),[2,this.unAuthenticatedError(o)]):(a=c.ApiUrls.AUTH_TOKEN_URL,"v2"===(null==t?void 0:t.version)&&(a=c.ApiUrlsV2.AUTH_TOKEN_URL),[4,this.request(a,{method:"POST",body:{client_id:this.clientId,client_secret:this.clientSecret,grant_type:"refresh_token",refresh_token:e}})]);case 1:return s=i.sent(),[2,r(r({},s),{version:(null==t?void 0:t.version)||"v1"})]}}))}))},e.prototype.getDeviceId=function(){return o(this,void 0,Promise,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return this.deviceID?[2,this.deviceID]:[4,this.storage.getItem(g)];case 1:return"string"==typeof(e=t.sent())&&e.length>=16&&e.length<=48?[3,3]:(e=(0,u.uuidv4)(),[4,this.storage.setItem(g,e)]);case 2:t.sent(),t.label=3;case 3:return this.deviceID=e,[2,e]}}))}))},e.prototype.unAuthenticatedError=function(e){var t={error:s.ErrorType.UNAUTHENTICATED,error_description:e};return Promise.reject(t)},e.prototype._debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logDebugMessages&&console.log.apply(console,a(["[OAuth2Client]"],e,!1))},e.prototype._initialize=function(){return o(this,void 0,Promise,(function(){var e,t,n,r,o,a;return i(this,(function(i){switch(i.label){case 0:if(i.trys.push([0,11,12,13]),!this.getInitialSession)return this._debug("#_initialize()","no getInitialSession callback set, skipping"),[2,{error:null}];this._debug("#_initialize()","calling getInitialSession callback"),i.label=1;case 1:return i.trys.push([1,9,,10]),[4,this.getInitialSession()];case 2:return a=i.sent(),e=a.data,t=a.error,(null==e?void 0:e.session)?(this._debug("#_initialize()","session obtained from getInitialSession",e.session),[4,this.localCredentials.setCredentials(null==e?void 0:e.session)]):[3,4];case 3:i.sent(),i.label=4;case 4:if(!this.onInitialSessionObtained)return[3,8];this._debug("#_initialize()","calling onInitialSessionObtained callback"),i.label=5;case 5:return i.trys.push([5,7,,8]),[4,this.onInitialSessionObtained(e,t)];case 6:return i.sent(),[3,8];case 7:return n=i.sent(),this._debug("#_initialize()","error in onInitialSessionObtained",n),[3,8];case 8:return t?(this._debug("#_initialize()","error from getInitialSession",t),[2,{error:t}]):[2,{error:null}];case 9:return r=i.sent(),this._debug("#_initialize()","exception during getInitialSession",r),[2,{error:r instanceof Error?r:new Error(String(r))}];case 10:return[3,13];case 11:return o=i.sent(),this._debug("#_initialize()","unexpected error",o),[2,{error:o instanceof Error?o:new Error(String(o))}];case 12:return this._debug("#_initialize()","end"),[7];case 13:return[2]}}))}))},e.prototype._acquireLock=function(e,t){return o(this,void 0,Promise,(function(){var n,r,s,c,u=this;return i(this,(function(l){switch(l.label){case 0:this._debug("#_acquireLock","begin",e),l.label=1;case 1:if(l.trys.push([1,,10,11]),this.lockAcquired)return n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),r=o(u,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,n];case 1:return e.sent(),[4,t()];case 2:return[2,e.sent()]}}))})),this.pendingInLock.push(o(u,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,r];case 1:case 2:return e.sent(),[3,3];case 3:return[2]}}))}))),[2,r];this._debug("#_acquireLock","acquiring lock for client",this.clientId),l.label=2;case 2:return l.trys.push([2,,8,9]),this.lockAcquired=!0,s=t(),this.pendingInLock.push(o(u,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,s];case 1:case 2:return e.sent(),[3,3];case 3:return[2]}}))}))),[4,s];case 3:l.sent(),l.label=4;case 4:return this.pendingInLock.length?(c=a([],this.pendingInLock,!0),[4,Promise.all(c)]):[3,6];case 5:return l.sent(),this.pendingInLock.splice(0,c.length),[3,4];case 6:return[4,s];case 7:return[2,l.sent()];case 8:return this._debug("#_acquireLock","releasing lock for client",this.clientId),this.lockAcquired=!1,[7];case 9:return[3,11];case 10:return this._debug("#_acquireLock","end"),[7];case 11:return[2]}}))}))},e.prototype._getCredentials=function(){var e,t,n;return o(this,void 0,Promise,(function(){var r,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:if((null==(r=i.sent())?void 0:r.scope)===c.DEFAULT_NODE_ACCESS_SCOPE)return[2,r];if(!r)return a="credentials not found",null===(e=this.onCredentialsError)||void 0===e||e.call(this,{msg:a}),[2,this.unAuthenticatedError(a)];if(!_(r))return[3,12];if(!r.refresh_token)return[3,9];i.label=2;case 2:return i.trys.push([2,4,,8]),[4,this._refreshToken(r)];case 3:return r=i.sent(),[3,8];case 4:return o=i.sent(),"anonymous"!==r.scope?[3,6]:[4,this.anonymousLogin(r)];case 5:return r=i.sent(),[3,7];case 6:return null===(t=this.onCredentialsError)||void 0===t||t.call(this,{msg:o.error_description}),[2,Promise.reject(o)];case 7:return[3,8];case 8:return[3,12];case 9:return"anonymous"!==r.scope?[3,11]:[4,this.anonymousLogin(r)];case 10:return r=i.sent(),[3,12];case 11:return a="no refresh token found in credentials",null===(n=this.onCredentialsError)||void 0===n||n.call(this,{msg:a}),[2,this.unAuthenticatedError(a)];case 12:return[2,r]}}))}))},e.defaultRetry=2,e.minRetry=0,e.maxRetry=5,e.retryInterval=1e3,e}()},2344:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.weAppJwtDecodeAll=t.weappJwtDecode=t.base64_url_decode=t.weAtob=t.weBtoa=void 0;var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;function o(e){var n=e.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw new Error("Illegal base64url string!")}try{return function(e){return decodeURIComponent((0,t.weAtob)(e).replace(/(.)/g,(function(e){var t=e.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0".concat(t)),"%".concat(t)})))}(n)}catch(e){return(0,t.weAtob)(n)}}t.weBtoa=function(e){for(var t,r,o,i,a="",s=0,c=(e=String(e)).length%3;s<e.length;){if((r=e.charCodeAt(s++))>255||(o=e.charCodeAt(s++))>255||(i=e.charCodeAt(s++))>255)throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");a+=n.charAt((t=r<<16|o<<8|i)>>18&63)+n.charAt(t>>12&63)+n.charAt(t>>6&63)+n.charAt(63&t)}return c?a.slice(0,c-3)+"===".substring(c):a},t.weAtob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!r.test(e))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");var t;e+="==".slice(2-(3&e.length));for(var o,i,a="",s=0;s<e.length;)t=n.indexOf(e.charAt(s++))<<18|n.indexOf(e.charAt(s++))<<12|(o=n.indexOf(e.charAt(s++)))<<6|(i=n.indexOf(e.charAt(s++))),a+=64===o?String.fromCharCode(t>>16&255):64===i?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return a},t.base64_url_decode=o,t.weappJwtDecode=function(e,t){if("string"!=typeof e)throw new Error("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(o(e.split(".")[n]))}catch(e){throw new Error("Invalid token specified: ".concat(e)?e.message:0)}},t.weAppJwtDecodeAll=function(e){if("string"!=typeof e)throw new Error("Invalid token specified");try{var t=e.split(".").map((function(e,t){return 2===t?e:JSON.parse(o(e))}));return{claims:t[1],header:t[0],signature:t[2]}}catch(e){throw new Error("Invalid token specified: ".concat(e)?e.message:0)}}},5814:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getEncryptInfo=void 0;var o=r(n(1012)),i=n(2631);t.getEncryptInfo=function(e){var t=void 0===e?{}:e,n=t.publicKey,r=void 0===n?"":n,a=t.payload,s=void 0===a?{}:a;if(!r)return"";try{var c=(0,i.deepClone)(s),u=new o.default;return u.setPublicKey(r),u.encryptLong("object"==typeof c?JSON.stringify(c):c)}catch(e){console.error("encrypt error:",e)}return""}},8547:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.SinglePromise=void 0;var o=new Map,i=function(){function e(e){this.clientId=(null==e?void 0:e.clientId)||"",o=o||new Map}return e.prototype.run=function(e,t){return n(this,void 0,Promise,(function(){var i,a=this;return r(this,(function(s){return e="".concat(this.clientId,"_").concat(e),(i=o.get(e))||(i=new Promise((function(i,s){n(a,void 0,void 0,(function(){var n,a,c;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,4,5]),[4,this.runIdlePromise()];case 1:return r.sent(),n=t(),a=i,[4,n];case 2:return a.apply(void 0,[r.sent()]),[3,5];case 3:return c=r.sent(),s(c),[3,5];case 4:return o.delete(e),[7];case 5:return[2]}}))}))})),o.set(e,i)),[2,i]}))}))},e.prototype.runIdlePromise=function(){return Promise.resolve()},e}();t.SinglePromise=i},2631:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPathName=t.deepClone=void 0,t.deepClone=function(e){var n=function(n){for(var r in e)e.hasOwnProperty(r)&&(n[r]=(0,t.deepClone)(e[r]));return n},r=null==e?"NullOrUndefined":Object.prototype.toString.call(e).slice(8,-1);if(["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"].includes(r))return e.slice();switch(r){case"Object":return n(Object.create(Object.getPrototypeOf(e)));case"Array":return n([]);case"Date":return new Date(e.valueOf());case"RegExp":return new RegExp(e.source,(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.sticky?"y":"")+(e.unicode?"u":""));default:return e}},t.getPathName=function(e){var t=e.match(/^(?:http(s)?:\/\/[^\/]+)?(\/[^\?#]*)/);return t&&t[2]||""}},7425:(e,t)=>{"use strict";function n(){if("undefined"==typeof globalThis)return!1;var e=globalThis.wx;if(void 0===e)return!1;if(void 0===globalThis.Page)return!1;if(!e.getDeviceInfo)return!1;if(!e.getStorageSync)return!1;if(!e.setStorageSync)return!1;if(!e.connectSocket)return!1;if(!e.request)return!1;try{if(!e.getDeviceInfo())return!1;if("qq"===e.getDeviceInfo().platform)return!1}catch(e){return!1}return!0}Object.defineProperty(t,"__esModule",{value:!0}),t.isInMpWebView=t.isMp=void 0,t.isMp=n;var r=!1;function o(){r=r||void 0!==typeof window&&"miniprogram"===window.__wxjs_environment}try{n()||(r=r||!!navigator.userAgent.match(/miniprogram/i)||"miniprogram"===window.__wxjs_environment,window&&window.WeixinJSBridge&&window.WeixinJSBridge.invoke?o():"undefined"!=typeof document&&document.addEventListener("WeixinJSBridgeReady",o,!1))}catch(e){}t.isInMpWebView=function(){return r}},9639:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){if(this.params={},"string"==typeof e)this.parse(e);else if(e&&"object"==typeof e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.append(t,e[t])}return e.prototype.parse=function(e){var t=this;e.split("&").forEach((function(e){var n=e.split("=").map(decodeURIComponent),r=n[0],o=n[1];t.append(r,o)}))},e.prototype.append=function(e,t){this.params[e]?this.params[e]=this.params[e].concat([t]):this.params[e]=[t]},e.prototype.get=function(e){return this.params[e]?this.params[e][0]:null},e.prototype.getAll=function(e){return this.params[e]||[]},e.prototype.delete=function(e){delete this.params[e]},e.prototype.has=function(e){return Object.prototype.hasOwnProperty.call(this.params,e)},e.prototype.set=function(e,t){this.params[e]=[t]},e.prototype.toString=function(){var e=[],t=function(t){Object.prototype.hasOwnProperty.call(n.params,t)&&n.params[t].forEach((function(n){e.push("".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(n)))}))},n=this;for(var r in this.params)t(r);return e.join("&")},e}();t.default=n},873:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uuidv4=void 0,t.uuidv4=function(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}},6511:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setRuntime=t.getRuntime=t.setWsClass=t.getWsClass=void 0;var n=null,r="web";t.getWsClass=function(){return n},t.setWsClass=function(e){n=e},t.getRuntime=function(){return r},t.setRuntime=function(e){r=e}},2917:function(e,t){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ERR_CODE=t.CloudSDKError=t.isCancelledError=t.CancelledError=t.isTimeoutError=t.TimeoutError=t.isRealtimeErrorMessageError=t.RealtimeErrorMessageError=void 0;var o=function(e){function t(t){var n=e.call(this,"Watch Error ".concat(JSON.stringify(t.msgData)," (requestid: ").concat(t.requestId,")"))||this;return n.isRealtimeErrorMessageError=!0,n.payload=t,n}return r(t,e),t}(Error);t.RealtimeErrorMessageError=o,t.isRealtimeErrorMessageError=function(e){return null==e?void 0:e.isRealtimeErrorMessageError};var i=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="timeout",t.payload=null,t.generic=!0,t}return r(t,e),t}(Error);t.TimeoutError=i,t.isTimeoutError=function(e){return"timeout"===e.type};var a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="cancelled",t.payload=null,t.generic=!0,t}return r(t,e),t}(Error);t.CancelledError=a,t.isCancelledError=function(e){return"cancelled"===e.type};var s=function(e){function n(n){var r=e.call(this,n.errMsg)||this;return r.errCode="UNKNOWN_ERROR",Object.defineProperties(r,{message:{get:function(){return"errCode: ".concat(this.errCode," ").concat(t.ERR_CODE[this.errCode]||""," | errMsg: ").concat(this.errMsg)},set:function(e){this.errMsg=e}}}),r.errCode=n.errCode||"UNKNOWN_ERROR",r.errMsg=n.errMsg,r}return r(n,e),Object.defineProperty(n.prototype,"message",{get:function(){return"errCode: ".concat(this.errCode," | errMsg: ").concat(this.errMsg)},set:function(e){this.errMsg=e},enumerable:!1,configurable:!0}),n}(Error);t.CloudSDKError=s,t.ERR_CODE={UNKNOWN_ERROR:"UNKNOWN_ERROR",SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_CLOSE_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_CLOSE_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_SERVER_ERROR_MSG:"SDK_DATABASE_REALTIME_LISTENER_SERVER_ERROR_MSG",SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA:"SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA",SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR:"SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR",SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED:"SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED",SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL:"SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL",SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR:"SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR"}},7209:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerRealtime=void 0;var r=n(2347),o=n(6511),i={target:"database",entity:function(){var e=this.platform,t=e.adapter,n=e.runtime;(0,o.setWsClass)(t.wsClass),(0,o.setRuntime)(n)}},a={name:"realtime",IIFE:!0,entity:function(){this.prototype.wsClientClass=r.RealtimeWebSocketClient}};try{cloudbase.registerComponent(a),cloudbase.registerHook(i)}catch(e){}t.registerRealtime=function(e){try{e.registerComponent(a),e.registerHook(i)}catch(e){console.warn(e)}}},1601:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RealtimeListener=void 0;t.RealtimeListener=function(e){this.close=e.close,this.onChange=e.onChange,this.onError=e.onError,e.debug&&Object.defineProperty(this,"virtualClient",{get:function(){return e.virtualClient}})}},3994:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInitEventMessage=t.genRequestId=void 0,t.genRequestId=function(e){return void 0===e&&(e=""),"".concat(e?"".concat(e,"_"):"").concat(+new Date,"_").concat(Math.random())},t.isInitEventMessage=function(e){return"INIT_EVENT"===e.msgType}},9770:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Snapshot=void 0;t.Snapshot=function(e){var t,n,r=e.id,o=e.docChanges,i=e.docs,a=e.msgType,s=e.type;Object.defineProperties(this,{id:{get:function(){return r},enumerable:!0},docChanges:{get:function(){return t||(t=JSON.parse(JSON.stringify(o))),t},enumerable:!0},docs:{get:function(){return n||(n=JSON.parse(JSON.stringify(i))),n},enumerable:!0},msgType:{get:function(){return a},enumerable:!0},type:{get:function(){return s},enumerable:!0}})}},7589:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sleep=void 0,t.sleep=function(e){return void 0===e&&(e=0),new Promise((function(t){return setTimeout(t,e)}))}},4151:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VirtualWebSocketClient=void 0;var s,c=a(n(6765)),u=a(n(7195)),l=a(n(9850)),p=n(3994),d=n(1601),h=n(9770),f=n(2917),m=n(7589);!function(e){e.LOGGINGIN="LOGGINGIN",e.INITING="INITING",e.REBUILDING="REBUILDING",e.ACTIVE="ACTIVE",e.ERRORED="ERRORED",e.CLOSING="CLOSING",e.CLOSED="CLOSED",e.PAUSED="PAUSED",e.RESUMING="RESUMING"}(s||(s={}));var v=function(){function e(e){var t=this;this.watchStatus=s.INITING,this.wsLogin=function(e,n){return r(t,void 0,Promise,(function(){var t;return o(this,(function(r){switch(r.label){case 0:return this.watchStatus=s.LOGGINGIN,[4,this.login(e,n)];case 1:return t=r.sent(),this.envId||(this.envId=t.envId),[2,t]}}))}))},this.initWatch=function(e){return r(t,void 0,Promise,(function(){var t,n=this;return o(this,(function(i){switch(i.label){case 0:if(null!==this.initWatchPromise&&void 0!==this.initWatchPromise)return[2,this.initWatchPromise];this.initWatchPromise=new Promise((function(t,i){r(n,void 0,void 0,(function(){var n,r,a,c,u,l,d,f,m,v;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),this.watchStatus===s.PAUSED?(console.log("[realtime] initWatch cancelled on pause"),[2,t()]):[4,this.wsLogin(this.envId,e)];case 1:return n=o.sent().envId,this.watchStatus===s.PAUSED?(console.log("[realtime] initWatch cancelled on pause"),[2,t()]):(this.watchStatus=s.INITING,r={watchId:this.watchId,requestId:(0,p.genRequestId)(),msgType:"INIT_WATCH",msgData:{envId:n,collName:this.collectionName,query:this.query,limit:this.limit,orderBy:this.orderBy}},[4,this.send({msg:r,waitResponse:!0,skipOnMessage:!0,timeout:1e4})]);case 2:if(a=o.sent(),c=a.msgData,u=c.events,l=c.currEvent,this.sessionInfo={queryID:a.msgData.queryID,currentEventId:l-1,currentDocs:[]},u.length>0){for(d=0,f=u;d<f.length;d++)f[d].ID=l;this.handleServerEvents(a)}else this.sessionInfo.currentEventId=l,m=new h.Snapshot({id:l,docChanges:[],docs:[],type:"init"}),this.listener.onChange(m),this.scheduleSendACK();return this.onWatchStart(this,this.sessionInfo.queryID),this.watchStatus=s.ACTIVE,this.availableRetries.INIT_WATCH=2,t(),[3,4];case 3:return v=o.sent(),this.handleWatchEstablishmentError(v,{operationName:"INIT_WATCH",resolve:t,reject:i}),[3,4];case 4:return[2]}}))}))})),t=!1,i.label=1;case 1:return i.trys.push([1,,3,4]),[4,this.initWatchPromise];case 2:return i.sent(),t=!0,[3,4];case 3:return this.initWatchPromise=void 0,[7];case 4:return console.log("[realtime] initWatch ".concat(t?"success":"fail")),[2]}}))}))},this.rebuildWatch=function(e){return r(t,void 0,Promise,(function(){var t,n=this;return o(this,(function(i){switch(i.label){case 0:if(null!==this.rebuildWatchPromise&&void 0!==this.rebuildWatchPromise)return[2,this.rebuildWatchPromise];this.rebuildWatchPromise=new Promise((function(t,i){r(n,void 0,void 0,(function(){var n,r,a,c;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),this.watchStatus===s.PAUSED?(console.log("[realtime] rebuildWatch cancelled on pause"),[2,t()]):[4,this.wsLogin(this.envId,e)];case 1:if(n=o.sent().envId,!this.sessionInfo)throw new Error("can not rebuildWatch without a successful initWatch (lack of sessionInfo)");return this.watchStatus===s.PAUSED?(console.log("[realtime] rebuildWatch cancelled on pause"),[2,t()]):(this.watchStatus=s.REBUILDING,r={watchId:this.watchId,requestId:(0,p.genRequestId)(),msgType:"REBUILD_WATCH",msgData:{envId:n,collName:this.collectionName,queryID:this.sessionInfo.queryID,eventID:this.sessionInfo.currentEventId}},[4,this.send({msg:r,waitResponse:!0,skipOnMessage:!1,timeout:1e4})]);case 2:return a=o.sent(),this.handleServerEvents(a),this.watchStatus=s.ACTIVE,this.availableRetries.REBUILD_WATCH=2,t(),[3,4];case 3:return c=o.sent(),this.handleWatchEstablishmentError(c,{operationName:"REBUILD_WATCH",resolve:t,reject:i}),[3,4];case 4:return[2]}}))}))})),t=!1,i.label=1;case 1:return i.trys.push([1,,3,4]),[4,this.rebuildWatchPromise];case 2:return i.sent(),t=!0,[3,4];case 3:return this.rebuildWatchPromise=void 0,[7];case 4:return console.log("[realtime] rebuildWatch ".concat(t?"success":"fail")),[2]}}))}))},this.handleWatchEstablishmentError=function(e,n){return r(t,void 0,void 0,(function(){var t,i,a,c=this;return o(this,(function(u){return t="INIT_WATCH"===n.operationName,i=function(){c.closeWithError(new f.CloudSDKError({errCode:t?f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL,errMsg:e})),n.reject(e)},a=function(e){c.useRetryTicket(n.operationName)?t?(c.initWatchPromise=void 0,n.resolve(c.initWatch(e))):(c.rebuildWatchPromise=void 0,n.resolve(c.rebuildWatch(e))):i()},this.handleCommonError(e,{onSignError:function(){return a(!0)},onTimeoutError:function(){return a(!1)},onNotRetryableError:i,onCancelledError:n.reject,onUnknownError:function(){r(c,void 0,void 0,(function(){var e,t=this;return o(this,(function(i){switch(i.label){case 0:return i.trys.push([0,8,,9]),e=function(){return r(t,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return this.pause(),[4,this.onceWSConnected()];case 1:return e.sent(),a(!0),[2]}}))}))},this.isWSConnected()?[3,2]:[4,e()];case 1:return i.sent(),[3,7];case 2:return[4,(0,m.sleep)(100)];case 3:return i.sent(),this.watchStatus!==s.PAUSED?[3,4]:(n.reject(new f.CancelledError("".concat(n.operationName," cancelled due to pause after unknownError"))),[3,7]);case 4:return this.isWSConnected()?[3,6]:[4,e()];case 5:return i.sent(),[3,7];case 6:a(!1),i.label=7;case 7:return[3,9];case 8:return i.sent(),a(!0),[3,9];case 9:return[2]}}))}))}}),[2]}))}))},this.closeWatch=function(){return r(t,void 0,void 0,(function(){var e,t,n;return o(this,(function(r){switch(r.label){case 0:if(e=this.sessionInfo?this.sessionInfo.queryID:"",this.watchStatus!==s.ACTIVE)return this.watchStatus=s.CLOSED,this.onWatchClose(this,e),[2];r.label=1;case 1:return r.trys.push([1,3,4,5]),this.watchStatus=s.CLOSING,t={watchId:this.watchId,requestId:(0,p.genRequestId)(),msgType:"CLOSE_WATCH",msgData:null},[4,this.send({msg:t})];case 2:return r.sent(),this.sessionInfo=void 0,this.watchStatus=s.CLOSED,[3,5];case 3:return n=r.sent(),this.closeWithError(new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_CLOSE_WATCH_FAIL,errMsg:n})),[3,5];case 4:return this.onWatchClose(this,e),[7];case 5:return[2]}}))}))},this.scheduleSendACK=function(){t.clearACKSchedule(),t.ackTimeoutId=setTimeout((function(){t.waitExpectedTimeoutId?t.scheduleSendACK():t.sendACK()}),1e4)},this.clearACKSchedule=function(){t.ackTimeoutId&&clearTimeout(t.ackTimeoutId)},this.sendACK=function(){return r(t,void 0,Promise,(function(){var e,t,n;return o(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this.watchStatus!==s.ACTIVE?(this.scheduleSendACK(),[2]):this.sessionInfo?(e={watchId:this.watchId,requestId:(0,p.genRequestId)(),msgType:"CHECK_LAST",msgData:{queryID:this.sessionInfo.queryID,eventID:this.sessionInfo.currentEventId}},[4,this.send({msg:e})]):(console.warn("[realtime listener] can not send ack without a successful initWatch (lack of sessionInfo)"),[2]);case 1:return r.sent(),this.scheduleSendACK(),[3,3];case 2:if(t=r.sent(),(0,f.isRealtimeErrorMessageError)(t))switch((n=t.payload).msgData.code){case"CHECK_LOGIN_FAILED":case"SIGN_EXPIRED_ERROR":case"SIGN_INVALID_ERROR":case"SIGN_PARAM_INVALID":return this.rebuildWatch(),[2];case"QUERYID_INVALID_ERROR":case"SYS_ERR":case"INVALIID_ENV":case"COLLECTION_PERMISSION_DENIED":return this.closeWithError(new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL,errMsg:n.msgData.code})),[2]}return this.availableRetries.CHECK_LAST&&this.availableRetries.CHECK_LAST>0?(this.availableRetries.CHECK_LAST-=1,this.scheduleSendACK()):this.closeWithError(new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL,errMsg:t})),[3,3];case 3:return[2]}}))}))},this.handleCommonError=function(e,t){if((0,f.isRealtimeErrorMessageError)(e))switch(e.payload.msgData.code){case"CHECK_LOGIN_FAILED":case"SIGN_EXPIRED_ERROR":case"SIGN_INVALID_ERROR":case"SIGN_PARAM_INVALID":return void t.onSignError(e);default:return void t.onNotRetryableError(e)}else{if((0,f.isTimeoutError)(e))return void t.onTimeoutError(e);if((0,f.isCancelledError)(e))return void t.onCancelledError(e)}t.onUnknownError(e)},this.watchId="watchid_".concat(+new Date,"_").concat(Math.random()),this.envId=e.envId,this.collectionName=e.collectionName,this.query=e.query,this.limit=e.limit,this.orderBy=e.orderBy,this.send=e.send,this.login=e.login,this.isWSConnected=e.isWSConnected,this.onceWSConnected=e.onceWSConnected,this.getWaitExpectedTimeoutLength=e.getWaitExpectedTimeoutLength,this.onWatchStart=e.onWatchStart,this.onWatchClose=e.onWatchClose,this.debug=e.debug,this.availableRetries={INIT_WATCH:2,REBUILD_WATCH:2,CHECK_LAST:2},this.listener=new d.RealtimeListener({close:function(){t.closeWatch()},onChange:e.onChange,onError:e.onError,debug:this.debug,virtualClient:this}),this.initWatch()}return e.prototype.onMessage=function(e){var t=this;switch(this.watchStatus){case s.PAUSED:if("ERROR"!==e.msgType)return;break;case s.LOGGINGIN:case s.INITING:case s.REBUILDING:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received while ".concat(this.watchStatus));case s.CLOSED:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received when the watch has closed");case s.ERRORED:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received when the watch has ended with error")}if(this.sessionInfo)switch(this.scheduleSendACK(),e.msgType){case"NEXT_EVENT":console.warn("nextevent ".concat(e.msgData.currEvent," ignored"),e),this.handleServerEvents(e);break;case"CHECK_EVENT":this.sessionInfo.currentEventId<e.msgData.currEvent&&(this.sessionInfo.expectEventId=e.msgData.currEvent,this.clearWaitExpectedEvent(),this.waitExpectedTimeoutId=setTimeout((function(){t.rebuildWatch()}),this.getWaitExpectedTimeoutLength()),console.log("[realtime] waitExpectedTimeoutLength ".concat(this.getWaitExpectedTimeoutLength())));break;case"ERROR":this.closeWithError(new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_SERVER_ERROR_MSG,errMsg:"".concat(e.msgData.code," - ").concat(e.msgData.message)}));break;default:console.warn("[realtime listener] virtual client receive unexpected msg ".concat(e.msgType,": "),e)}else console.warn("[realtime listener] internal non-fatal error: sessionInfo not found while message is received.")},e.prototype.closeWithError=function(e){var t;this.watchStatus=s.ERRORED,this.clearACKSchedule(),this.listener.onError(e),this.onWatchClose(this,(null===(t=this.sessionInfo)||void 0===t?void 0:t.queryID)||""),console.log("[realtime] client closed (".concat(this.collectionName," ").concat(this.query,") (watchId ").concat(this.watchId,")"))},e.prototype.pause=function(){this.watchStatus=s.PAUSED,console.log("[realtime] client paused (".concat(this.collectionName," ").concat(this.query,") (watchId ").concat(this.watchId,")"))},e.prototype.resume=function(){return r(this,void 0,Promise,(function(){var e;return o(this,(function(t){switch(t.label){case 0:this.watchStatus=s.RESUMING,console.log("[realtime] client resuming with ".concat(this.sessionInfo?"REBUILD_WATCH":"INIT_WATCH"," (").concat(this.collectionName," ").concat(this.query,") (").concat(this.watchId,")")),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.sessionInfo?this.rebuildWatch():this.initWatch()];case 2:return t.sent(),console.log("[realtime] client successfully resumed (".concat(this.collectionName," ").concat(this.query,") (").concat(this.watchId,")")),[3,4];case 3:return e=t.sent(),console.error("[realtime] client resume failed (".concat(this.collectionName," ").concat(this.query,") (").concat(this.watchId,")"),e),[3,4];case 4:return[2]}}))}))},e.prototype.useRetryTicket=function(e){return!!(this.availableRetries[e]&&this.availableRetries[e]>0)&&(this.availableRetries[e]-=1,console.log("[realtime] ".concat(e," use a retry ticket, now only ").concat(this.availableRetries[e]," retry left")),!0)},e.prototype.handleServerEvents=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.scheduleSendACK(),[4,this.handleServerEventsInternel(e)];case 1:return n.sent(),this.postHandleServerEventsValidityCheck(e),[3,3];case 2:throw t=n.sent(),console.error("[realtime listener] internal non-fatal error: handle server events failed with error: ",t),t;case 3:return[2]}}))}))},e.prototype.handleServerEventsInternel=function(e){return r(this,void 0,void 0,(function(){var t,n,r,a,s,p,d,m,v,b,y,_;return o(this,(function(x){switch(x.label){case 0:if(t=e.requestId,n=e.msgData.events,r=e.msgType,!n.length||!this.sessionInfo)return[2];a=this.sessionInfo;try{s=n.map(g)}catch(e){return this.closeWithError(new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA,errMsg:e})),[2]}p=i([],a.currentDocs,!0),d=!1,m=function(n,m){var g,b,y,_,x,w,E,I,S,O,T,A;return o(this,(function(o){switch(o.label){case 0:return g=s[n],a.currentEventId>=g.id?(!s[n-1]||g.id>s[n-1].id?console.warn("[realtime] duplicate event received, cur ".concat(a.currentEventId," but got ").concat(g.id)):console.error("[realtime listener] server non-fatal error: events out of order (the latter event's id is smaller than that of the former) (requestId ".concat(t,")")),[2,"continue"]):[3,1];case 1:if(a.currentEventId!==g.id-1)return[3,2];switch(g.dataType){case"update":if(!g.doc)switch(g.queueType){case"update":case"dequeue":if(b=p.find((function(e){return e._id===g.docId})),b){if(y=(0,l.default)(b),g.updatedFields&&Object.keys(g.updatedFields).forEach((function(e){(0,c.default)(y,e,g.updatedFields[e])})),g.removedFields)for(_=0,x=g.removedFields;_<x.length;_++)w=x[_],(0,u.default)(y,w);g.doc=y}else console.error("[realtime listener] internal non-fatal server error: unexpected update dataType event where no doc is associated.");break;case"enqueue":throw I=new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="update" and queueType="enqueue" (requestId '.concat(e.requestId,")")}),v.closeWithError(I),I}break;case"replace":if(!g.doc)throw I=new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="replace" (requestId '.concat(e.requestId,")")}),v.closeWithError(I),I;break;case"remove":(E=p.find((function(e){return e._id===g.docId})))?g.doc=E:console.error("[realtime listener] internal non-fatal server error: unexpected remove event where no doc is associated.");break;case"limit":if(!g.doc)switch(g.queueType){case"dequeue":(E=p.find((function(e){return e._id===g.docId})))?g.doc=E:console.error("[realtime listener] internal non-fatal server error: unexpected limit dataType event where no doc is associated.");break;case"enqueue":throw I=new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="limit" and queueType="enqueue" (requestId '.concat(e.requestId,")")}),v.closeWithError(I),I}}switch(g.queueType){case"init":d?p.push(g.doc):(d=!0,p=[g.doc]);break;case"enqueue":p.push(g.doc);break;case"dequeue":S=p.findIndex((function(e){return e._id===g.docId})),S>-1?p.splice(S,1):console.error("[realtime listener] internal non-fatal server error: unexpected dequeue event where no doc is associated.");break;case"update":S=p.findIndex((function(e){return e._id===g.docId})),S>-1?p[S]=g.doc:console.error("[realtime listener] internal non-fatal server error: unexpected queueType update event where no doc is associated.")}return(n===m-1||s[n+1]&&s[n+1].id!==g.id)&&(O=i([],p,!0),T=s.slice(0,n+1).filter((function(e){return e.id===g.id})),v.sessionInfo.currentEventId=g.id,v.sessionInfo.currentDocs=p,A=new h.Snapshot({id:g.id,docChanges:T,docs:O,msgType:r}),v.listener.onChange(A)),[3,4];case 2:return console.warn("[realtime listener] event received is out of order, cur ".concat(v.sessionInfo.currentEventId," but got ").concat(g.id)),[4,v.rebuildWatch()];case 3:return o.sent(),[2,{value:void 0}];case 4:return[2]}}))},v=this,b=0,y=s.length,x.label=1;case 1:return b<y?[5,m(b,y)]:[3,4];case 2:if("object"==typeof(_=x.sent()))return[2,_.value];x.label=3;case 3:return b++,[3,1];case 4:return[2]}}))}))},e.prototype.postHandleServerEventsValidityCheck=function(e){this.sessionInfo?(this.sessionInfo.expectEventId&&this.sessionInfo.currentEventId>=this.sessionInfo.expectEventId&&this.clearWaitExpectedEvent(),this.sessionInfo.currentEventId<e.msgData.currEvent&&console.warn("[realtime listener] internal non-fatal error: client eventId does not match with server event id after server event handling")):console.error("[realtime listener] internal non-fatal error: sessionInfo lost after server event handling, this should never occur")},e.prototype.clearWaitExpectedEvent=function(){this.waitExpectedTimeoutId&&(clearTimeout(this.waitExpectedTimeoutId),this.waitExpectedTimeoutId=void 0)},e}();function g(e){var t={id:e.ID,dataType:e.DataType,queueType:e.QueueType,docId:e.DocID,doc:e.Doc&&"{}"!==e.Doc?JSON.parse(e.Doc):void 0};return"update"===e.DataType&&(e.UpdatedFields&&(t.updatedFields=JSON.parse(e.UpdatedFields)),(e.removedFields||e.RemovedFields)&&(t.removedFields=JSON.parse(e.removedFields))),t}t.VirtualWebSocketClient=v},2347:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.RealtimeWebSocketClient=void 0;var a=n(4151),s=n(3994),c=n(636),u=n(2917),l=n(6511),p=n(7589),d=function(){function e(e){var t=this;this.virtualWSClient=new Set,this.queryIdClientMap=new Map,this.watchIdClientMap=new Map,this.pingFailed=0,this.pongMissed=0,this.logins=new Map,this.wsReadySubsribers=[],this.wsResponseWait=new Map,this.rttObserved=[],this.send=function(e){return o(t,void 0,Promise,(function(){var t=this;return i(this,(function(n){return[2,new Promise((function(n,r){o(t,void 0,void 0,(function(){var t,a,s,c,l,d,h,f,m=this;return i(this,(function(v){switch(v.label){case 0:a=!1,s=!1,c=function(e){a=!0,t&&clearTimeout(t),n(e)},l=function(e){s=!0,t&&clearTimeout(t),r(e)},e.timeout&&(t=setTimeout((function(){o(m,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return a&&s?[3,2]:[4,(0,p.sleep)(0)];case 1:e.sent(),a&&s||l(new u.TimeoutError("wsclient.send timedout")),e.label=2;case 2:return[2]}}))}))}),e.timeout)),v.label=1;case 1:return v.trys.push([1,8,,9]),void 0===this.wsInitPromise&&null===this.wsInitPromise?[3,3]:[4,this.wsInitPromise];case 2:v.sent(),v.label=3;case 3:if(!this.ws)return l(new Error("invalid state: ws connection not exists, can not send message")),[2];if(1!==this.ws.readyState)return l(new Error("ws readyState invalid: ".concat(this.ws.readyState,", can not send message"))),[2];e.waitResponse&&(d={resolve:c,reject:l,skipOnMessage:e.skipOnMessage},this.wsResponseWait.set(e.msg.requestId,d)),v.label=4;case 4:return v.trys.push([4,6,,7]),[4,this.ws.send(JSON.stringify(e.msg))];case 5:return v.sent(),e.waitResponse||c(void 0),[3,7];case 6:return(h=v.sent())&&(l(h),e.waitResponse&&this.wsResponseWait.delete(e.msg.requestId)),[3,7];case 7:return[3,9];case 8:return f=v.sent(),l(f),[3,9];case 9:return[2]}}))}))}))]}))}))},this.closeAllClients=function(e){t.virtualWSClient.forEach((function(t){t.closeWithError(e)}))},this.pauseClients=function(e){(e||t.virtualWSClient).forEach((function(e){e.pause()}))},this.resumeClients=function(e){(e||t.virtualWSClient).forEach((function(e){e.resume()}))},this.initWebSocketConnection=function(e,n){return void 0===n&&(n=t.maxReconnect),o(t,void 0,Promise,(function(){var t=this;return i(this,(function(r){switch(r.label){case 0:if(e&&this.reconnectState)return[2];if(e&&(this.reconnectState=!0),void 0!==this.wsInitPromise&&null!==this.wsInitPromise)return[2,this.wsInitPromise];e&&this.pauseClients(),this.close(c.CloseEventCode.ReconnectWebSocket),this.wsInitPromise=new Promise((function(r,a){o(t,void 0,void 0,(function(){var t,o,s=this;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,6,,11]),[4,this.getWsSign()];case 1:return t=i.sent(),[4,new Promise((function(e){var n=t.wsUrl||"wss://tcb-ws.tencentcloudapi.com",r=(0,l.getWsClass)();s.ws=r?new r(n):new WebSocket(n),e(void 0)}))];case 2:return i.sent(),this.ws.connect?[4,this.ws.connect()]:[3,4];case 3:i.sent(),i.label=4;case 4:return[4,this.initWebSocketEvent()];case 5:return i.sent(),r(),e&&(this.resumeClients(),this.reconnectState=!1),[3,11];case 6:return o=i.sent(),console.error("[realtime] initWebSocketConnection connect fail",o),n>0?(this.wsInitPromise=void 0,[4,(0,p.sleep)(this.reconnectInterval)]):[3,9];case 7:i.sent(),e&&(this.reconnectState=!1),i.label=8;case 8:return r(this.initWebSocketConnection(e,n-1)),[3,10];case 9:a(o),e&&this.closeAllClients(new u.CloudSDKError({errCode:u.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL,errMsg:o})),i.label=10;case 10:return[3,11];case 11:return[2]}}))}))})),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,this.wsInitPromise];case 2:return r.sent(),this.wsReadySubsribers.forEach((function(e){return(0,e.resolve)()})),[3,5];case 3:return r.sent(),this.wsReadySubsribers.forEach((function(e){return(0,e.reject)()})),[3,5];case 4:return this.wsInitPromise=void 0,this.wsReadySubsribers=[],[7];case 5:return[2]}}))}))},this.initWebSocketEvent=function(){return new Promise((function(e,n){if(!t.ws)throw new Error("can not initWebSocketEvent, ws not exists");var r=!1;t.ws.onopen=function(t){console.warn("[realtime] ws event: open",t),r=!0,e()},t.ws.onerror=function(e){t.logins=new Map,r?(console.error("[realtime] ws event: error",e),t.clearHeartbeat(),t.virtualWSClient.forEach((function(t){return t.closeWithError(new u.CloudSDKError({errCode:u.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR,errMsg:e}))}))):(console.error("[realtime] ws open failed with ws event: error",e),n(e))},t.ws.onclose=function(e){switch(console.warn("[realtime] ws event: close",e),t.logins=new Map,t.clearHeartbeat(),e.code){case c.CloseEventCode.ReconnectWebSocket:case c.CloseEventCode.NoRealtimeListeners:break;case c.CloseEventCode.HeartbeatPingError:case c.CloseEventCode.HeartbeatPongTimeoutError:case c.CloseEventCode.NormalClosure:case c.CloseEventCode.AbnormalClosure:t.maxReconnect>0?t.initWebSocketConnection(!0,t.maxReconnect):t.closeAllClients((0,c.getWSCloseError)(e.code));break;case c.CloseEventCode.NoAuthentication:t.closeAllClients((0,c.getWSCloseError)(e.code,e.reason));break;default:t.maxReconnect>0?t.initWebSocketConnection(!0,t.maxReconnect):t.closeAllClients((0,c.getWSCloseError)(e.code))}},t.ws.onmessage=function(e){var n,r,o=(null===(n=e.data)||void 0===n?void 0:n.data)||e.data;t.heartbeat();try{r="string"==typeof o?JSON.parse(o):o}catch(e){throw new Error("[realtime] onMessage parse res.data error: ".concat(e))}if("ERROR"===r.msgType){var i=null;t.virtualWSClient.forEach((function(e){e.watchId===r.watchId&&(i=e)})),i&&i.listener.onError(r)}var a=t.wsResponseWait.get(r.requestId);if(a){try{"ERROR"===r.msgType?a.reject(new u.RealtimeErrorMessageError(r)):a.resolve(r)}catch(e){console.error("ws onMessage responseWaitSpec.resolve(msg) errored:",e)}finally{t.wsResponseWait.delete(r.requestId)}if(a.skipOnMessage)return}if("PONG"!==r.msgType){var s=r.watchId&&t.watchIdClientMap.get(r.watchId);if(s)s.onMessage(r);else switch(console.error("[realtime] no realtime listener found responsible for watchId ".concat(r.watchId,": "),r),r.msgType){case"INIT_EVENT":case"NEXT_EVENT":case"CHECK_EVENT":(s=t.queryIdClientMap.get(r.msgData.queryID))&&s.onMessage(r);break;default:for(var c=0,l=Array.from(t.watchIdClientMap.entries());c<l.length;c++){l[c][1].onMessage(r);break}}}else if(t.lastPingSendTS){var p=Date.now()-t.lastPingSendTS;if(p>1e4)return void console.warn("[realtime] untrusted rtt observed: ".concat(p));t.rttObserved.length>=3&&t.rttObserved.splice(0,t.rttObserved.length-3+1),t.rttObserved.push(p)}},t.heartbeat()}))},this.isWSConnected=function(){return Boolean(t.ws&&1===t.ws.readyState)},this.onceWSConnected=function(){return o(t,void 0,Promise,(function(){var e=this;return i(this,(function(t){return this.isWSConnected()?[2]:null!==this.wsInitPromise&&void 0!==this.wsInitPromise?[2,this.wsInitPromise]:[2,new Promise((function(t,n){e.wsReadySubsribers.push({resolve:t,reject:n})}))]}))}))},this.webLogin=function(e,n){return o(t,void 0,Promise,(function(){var t,r,a,c,u,p,d,h,f=this;return i(this,(function(m){switch(m.label){case 0:if(!n)if(e){if(t=this.logins.get(e)){if(t.loggedIn&&t.loginResult)return[2,t.loginResult];if(null!==t.loggingInPromise&&void 0!==t.loggingInPromise)return[2,t.loggingInPromise]}}else if(null!==(null==(r=this.logins.get(""))?void 0:r.loggingInPromise)&&void 0!==(null==r?void 0:r.loggingInPromise))return[2,r.loggingInPromise];a=new Promise((function(e,t){o(f,void 0,void 0,(function(){var n,r,o,a,c;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.getWsSign()];case 1:return n=i.sent(),r={envId:n.envId||"",accessToken:"",referrer:"web",sdkVersion:"",dataVersion:""},o={watchId:void 0,requestId:(0,s.genRequestId)(),msgType:"LOGIN",msgData:r,exMsgData:{runtime:(0,l.getRuntime)(),signStr:n.signStr,secretVersion:n.secretVersion}},[4,this.send({msg:o,waitResponse:!0,skipOnMessage:!0,timeout:5e3})];case 2:return(a=i.sent()).msgData.code?t(new Error("".concat(a.msgData.code," ").concat(a.msgData.message))):e({envId:n.envId}),[3,4];case 3:return c=i.sent(),t(c),[3,4];case 4:return[2]}}))}))})),c=e&&this.logins.get(e),u=Date.now(),c?(c.loggedIn=!1,c.loggingInPromise=a,c.loginStartTS=u):(c={loggedIn:!1,loggingInPromise:a,loginStartTS:u},this.logins.set(e||"",c)),m.label=1;case 1:return m.trys.push([1,3,,4]),[4,a];case 2:if(p=m.sent(),(d=e&&this.logins.get(e))&&d===c&&d.loginStartTS===u)return c.loggedIn=!0,c.loggingInPromise=void 0,c.loginStartTS=void 0,c.loginResult=p,[2,p];if(d){if(d.loggedIn&&d.loginResult)return[2,d.loginResult];if(null!==d.loggingInPromise&&void 0!==d.loggingInPromise)return[2,d.loggingInPromise];throw new Error("ws unexpected login info")}throw new Error("ws login info reset");case 3:throw h=m.sent(),c.loggedIn=!1,c.loggingInPromise=void 0,c.loginStartTS=void 0,c.loginResult=void 0,h;case 4:return[2]}}))}))},this.getWsSign=function(){return o(t,void 0,Promise,(function(){var e,t,n,r,o,a,s;return i(this,(function(i){switch(i.label){case 0:return this.wsSign&&this.wsSign.expiredTs>Date.now()?[2,this.wsSign]:(e=Date.now()+6e4,[4,this.context.appConfig.request.send("auth.wsWebSign",{runtime:(0,l.getRuntime)()})]);case 1:if((t=i.sent()).code)throw new Error("[tcb-js-sdk] 获取实时数据推送登录票据失败: ".concat(t.code));if(t.data)return n=t.data,r=n.signStr,o=n.wsUrl,a=n.secretVersion,s=n.envId,[2,{signStr:r,wsUrl:o,secretVersion:a,envId:s,expiredTs:e}];throw new Error("[tcb-js-sdk] 获取实时数据推送登录票据失败")}}))}))},this.getWaitExpectedTimeoutLength=function(){return t.rttObserved.length?t.rttObserved.reduce((function(e,t){return e+t}))/t.rttObserved.length*1.5:5e3},this.ping=function(){return o(t,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return e={watchId:void 0,requestId:(0,s.genRequestId)(),msgType:"PING",msgData:null},[4,this.send({msg:e})];case 1:return t.sent(),[2]}}))}))},this.onWatchStart=function(e,n){t.queryIdClientMap.set(n,e)},this.onWatchClose=function(e,n){n&&t.queryIdClientMap.delete(n),t.watchIdClientMap.delete(e.watchId),t.virtualWSClient.delete(e),t.virtualWSClient.size||t.close(c.CloseEventCode.NoRealtimeListeners)},this.maxReconnect=e.maxReconnect||5,this.reconnectInterval=e.reconnectInterval||1e4,this.context=e.context}return e.prototype.clearHeartbeat=function(){this.pingTimeoutId&&clearTimeout(this.pingTimeoutId),this.pongTimeoutId&&clearTimeout(this.pongTimeoutId)},e.prototype.close=function(e){this.clearHeartbeat(),this.ws&&(this.ws.close(e,c.CLOSE_EVENT_CODE_INFO[e].name),this.ws=void 0)},e.prototype.watch=function(e){this.ws||void 0!==this.wsInitPromise&&null!==this.wsInitPromise||this.initWebSocketConnection(!1);var t=new a.VirtualWebSocketClient(r(r({},e),{send:this.send,login:this.webLogin,isWSConnected:this.isWSConnected,onceWSConnected:this.onceWSConnected,getWaitExpectedTimeoutLength:this.getWaitExpectedTimeoutLength,onWatchStart:this.onWatchStart,onWatchClose:this.onWatchClose,debug:!0}));return this.virtualWSClient.add(t),this.watchIdClientMap.set(t.watchId,t),t.listener},e.prototype.heartbeat=function(e){var t=this;this.clearHeartbeat(),this.pingTimeoutId=setTimeout((function(){o(t,void 0,void 0,(function(){var e=this;return i(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),this.ws&&1===this.ws.readyState?(this.lastPingSendTS=Date.now(),[4,this.ping()]):[2];case 1:return t.sent(),this.pingFailed=0,this.pongTimeoutId=setTimeout((function(){console.error("pong timed out"),e.pongMissed<2?(e.pongMissed+=1,e.heartbeat(!0)):e.initWebSocketConnection(!0)}),this.context.appConfig.realtimePongWaitTimeout),[3,3];case 2:return t.sent(),this.pingFailed<2?(this.pingFailed+=1,this.heartbeat()):this.close(c.CloseEventCode.HeartbeatPingError),[3,3];case 3:return[2]}}))}))}),e?0:this.context.appConfig.realtimePingInterval)},e}();t.RealtimeWebSocketClient=d},636:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWSCloseError=t.CloseEventCode=t.CLOSE_EVENT_CODE_INFO=void 0;var r,o=n(2917);t.CLOSE_EVENT_CODE_INFO={1e3:{code:1e3,name:"Normal Closure",description:"Normal closure; the connection successfully completed whatever purpose for which it was created."},1001:{code:1001,name:"Going Away",description:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection."},1002:{code:1002,name:"Protocol Error",description:"The endpoint is terminating the connection due to a protocol error."},1003:{code:1003,name:"Unsupported Data",description:"The connection is being terminated because the endpoint received data of a type it cannot accept (for example, a text-only endpoint received binary data)."},1005:{code:1005,name:"No Status Received",description:"Indicates that no status code was provided even though one was expected."},1006:{code:1006,name:"Abnormal Closure",description:"Used to indicate that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},1007:{code:1007,name:"Invalid frame payload data",description:"The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},1008:{code:1008,name:"Policy Violation",description:"The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},1009:{code:1009,name:"Message too big",description:"The endpoint is terminating the connection because a data frame was received that is too large."},1010:{code:1010,name:"Missing Extension",description:"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},1011:{code:1011,name:"Internal Error",description:"The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."},1012:{code:1012,name:"Service Restart",description:"The server is terminating the connection because it is restarting."},1013:{code:1013,name:"Try Again Later",description:"The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients."},1014:{code:1014,name:"Bad Gateway",description:"The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code."},1015:{code:1015,name:"TLS Handshake",description:"Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."},3e3:{code:3e3,name:"Reconnect WebSocket",description:"The client is terminating the connection because it wants to reconnect"},3001:{code:3001,name:"No Realtime Listeners",description:"The client is terminating the connection because no more realtime listeners exist"},3002:{code:3002,name:"Heartbeat Ping Error",description:"The client is terminating the connection due to its failure in sending heartbeat messages"},3003:{code:3003,name:"Heartbeat Pong Timeout Error",description:"The client is terminating the connection because no heartbeat response is received from the server"},3050:{code:3050,name:"Server Close",description:"The client is terminating the connection because no heartbeat response is received from the server"}},(r=t.CloseEventCode||(t.CloseEventCode={}))[r.NormalClosure=1e3]="NormalClosure",r[r.GoingAway=1001]="GoingAway",r[r.ProtocolError=1002]="ProtocolError",r[r.UnsupportedData=1003]="UnsupportedData",r[r.NoStatusReceived=1005]="NoStatusReceived",r[r.AbnormalClosure=1006]="AbnormalClosure",r[r.InvalidFramePayloadData=1007]="InvalidFramePayloadData",r[r.PolicyViolation=1008]="PolicyViolation",r[r.MessageTooBig=1009]="MessageTooBig",r[r.MissingExtension=1010]="MissingExtension",r[r.InternalError=1011]="InternalError",r[r.ServiceRestart=1012]="ServiceRestart",r[r.TryAgainLater=1013]="TryAgainLater",r[r.BadGateway=1014]="BadGateway",r[r.TLSHandshake=1015]="TLSHandshake",r[r.ReconnectWebSocket=3e3]="ReconnectWebSocket",r[r.NoRealtimeListeners=3001]="NoRealtimeListeners",r[r.HeartbeatPingError=3002]="HeartbeatPingError",r[r.HeartbeatPongTimeoutError=3003]="HeartbeatPongTimeoutError",r[r.NoAuthentication=3050]="NoAuthentication",t.getWSCloseError=function(e,n){var r=t.CLOSE_EVENT_CODE_INFO[e],i=r?"".concat(r.name,", code ").concat(e,", reason ").concat(n||r.description):"code ".concat(e);return new o.CloudSDKError({errCode:o.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED,errMsg:i})}},5891:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.CloudbaseStorage=t.COMPONENT_NAME=t.EUploadMethod=void 0;var c,u=n(2877),l=n(7090),p=n(3388);!function(e){e.put="put",e.post="post"}(c=t.EUploadMethod||(t.EUploadMethod={}));var d=u.constants.getSdkName,h=u.constants.ERRORS,f=u.constants.COMMUNITY_SITE_URL,m=u.utils.isArray,v=u.utils.isString,g=u.utils.isPalinObject,b=u.utils.execCallback,y=u.helpers.catchErrorsDecorator;t.COMPONENT_NAME="storage";var _=function(e,t,n){return a(void 0,void 0,void 0,(function(){var o,i,a;return s(this,(function(s){switch(s.label){case 0:return[4,e.gateWay({path:"storages",name:"get-objects-upload-info",data:[r({objectId:t.path},t.signedHeader?{signedHeader:t.signedHeader}:{})]},n)];case 1:return o=s.sent(),i=(null===(a=o.data)||void 0===a?void 0:a[0])||{},[2,r(r({},o),{data:r(r({},i.code?r({},i):{}),{authorization:i.authorization,token:i.token,url:i.uploadUrl,fileId:i.cloudObjectId,cosFileId:i.cloudObjectMeta,download_url:i.downloadUrl})})]}}))}))},x=function(e,t,n){return a(void 0,void 0,void 0,(function(){var o,i;return s(this,(function(a){switch(a.label){case 0:return[4,e.gateWay({path:"storages",name:"get-objects-download-info",data:t.convertedFileList.map((function(e){return{cloudObjectId:e.fileid}}))},n)];case 1:return o=a.sent(),[2,r(r({},o),{data:{download_list:null===(i=o.data)||void 0===i?void 0:i.map((function(e){return{code:e.code||"SUCCESS",message:e.message,fileid:e.cloudObjectId,download_url:e.downloadUrl,fileID:e.cloudObjectId,tempFileURL:e.downloadUrl}}))}})]}}))}))},w=function(e,t,n){return a(void 0,void 0,void 0,(function(){var o,i;return s(this,(function(a){switch(a.label){case 0:return[4,e.gateWay({path:"storages",name:"delete-objects",data:t.fileList.map((function(e){return{cloudObjectId:e}}))},n)];case 1:return o=a.sent(),[2,r(r({},o),{data:{delete_list:null===(i=o.data)||void 0===i?void 0:i.map((function(e){return{code:e.code||"SUCCESS",fileID:e.cloudObjectId,message:e.message}}))}})]}}))}))},E=function(e,t,n){return a(void 0,void 0,void 0,(function(){var o,i;return s(this,(function(a){switch(a.label){case 0:return[4,e.gateWay({path:"storages",name:"copy-objects",data:t.convertedFileList.map((function(e){return{srcPath:e.src_path,dstPath:e.dst_path,overwrite:e.overwrite,removeOriginal:e.remove_original}}))},n)];case 1:return o=a.sent(),[2,r(r({},o),{data:{copy_list:null===(i=o.data)||void 0===i?void 0:i.map((function(e){return{code:e.code||"SUCCESS",fileID:e.cloudObjectId,message:e.message}}))}})]}}))}))},I={txt:"text/plain",json:"application/json",html:"text/html",htm:"text/html",css:"text/css",js:"application/javascript",csv:"text/csv",xml:"application/xml",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",ico:"image/x-icon",pdf:"application/pdf",zip:"application/zip",gz:"application/gzip",mp4:"video/mp4",webm:"video/webm",mp3:"audio/mpeg",wav:"audio/wav"};function S(e,t){if("undefined"!=typeof Blob&&e instanceof Blob&&e.type)return e.type;var n=/\.([a-zA-Z0-9]+)$/.exec(t||""),r=n?n[1].toLowerCase():"";return I[r]||"application/octet-stream"}function O(e,t){var n=t.toLowerCase();return Object.keys(e).some((function(e){return e.toLowerCase()===n}))}function T(e){return Object.keys(e).reduce((function(t,n){var o;return r(r({},t),((o={})[n]=[e[n]],o))}),{})}t.CloudbaseStorage=function(){function e(e){this.context=e}var n,u,I,A,P,C,R,N,k,j,D,U,L,M,q,B;return Object.defineProperty(e.prototype,"config",{get:function(){var e;return null===(e=this.context)||void 0===e?void 0:e.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){var e;return null===(e=this.context)||void 0===e?void 0:e.request},enumerable:!1,configurable:!0}),e.prototype.isGateWay=function(){return"GATEWAY"===(this.config.endPointMode||"CLOUD_API")},e.prototype.uploadFile=function(e,n){return a(this,void 0,Promise,(function(){var o,i,a,u,p,f,m,g,y,_,x,w,E,I,A,P,C,R,N,k,j,D,U,L,M,q,B,F,W,V,G;return s(this,(function(s){switch(s.label){case 0:if(o=e.cloudPath,i=e.filePath,a=e.onUploadProgress,W=e.method,u=void 0===W?"put":W,V=e.headers,p=void 0===V?{}:V,f=e.fileContent,!v(o)||!i&&!f)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".uploadFile] invalid params")}));return m={put:c.put,post:c.post}[u.toLocaleLowerCase()]||c.put,g=this.isGateWay(),y=r({},p),_=Object.keys(p).reduce((function(e,t){return"content-length"!==t.toLowerCase()&&(e[t]=p[t]),e}),{}),m===c.put&&g&&(O(y,"content-length")||(x=function(e,t){var n=null!=e?e:t;if(null!==n){if("undefined"!=typeof Blob&&n instanceof Blob)return n.size;if("undefined"!=typeof ArrayBuffer){if(n instanceof ArrayBuffer)return n.byteLength;if("function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(n))return n.byteLength}if("string"==typeof n){if("undefined"!=typeof Blob)return new Blob([n]).size;var r=(0,l.getStringByteLength)(n);return"number"==typeof r?r:n.length}return"object"==typeof n&&"number"==typeof n.size?n.size:void 0}}(i,f),"number"==typeof x&&(y["content-length"]=String(x))),O(y,"content-type")||(y["content-type"]=S(i,o)),O(_,"content-type")||(_["content-type"]=S(i,o))),[4,this.getUploadMetadata({cloudPath:o,method:m,headers:m!==c.put||g?void 0:_,signedHeader:m===c.put&&g?T(y):void 0,customReqOpts:e.customReqOpts})];case 1:return w=s.sent(),E=w.data,I=w.requestId,(null==(A=E)?void 0:A.code)||!(null==A?void 0:A.url)?(P=(null==A?void 0:A.code)||h.OPERATION_FAIL,C=(null==A?void 0:A.message)||"get upload info failed",[2,b(n,new Error("[".concat(d(),"][").concat(P,"][").concat(t.COMPONENT_NAME,"]:").concat(C)))]):(R=E.url,N=E.authorization,k=E.token,j=E.fileId,D=E.cosFileId,U=E.download_url,M=r(r({},L={url:R,file:i,name:o,onUploadProgress:a,fileContent:f,fileId:j,requestId:I}),{method:c.put,headers:r(r({},_),{authorization:N,"x-cos-meta-fileid":D,"x-cos-security-token":k})}),q=r(r({},L),{method:c.post,data:{key:o,signature:N,"x-cos-meta-fileid":D,success_action_status:"201","x-cos-security-token":k}}),(G={})[c.put]={params:M,isSuccess:function(e){return e>=200&&e<300}},G[c.post]={params:q,isSuccess:function(e){return 201===e}},B=G,[4,this.request.upload(B[m].params)]);case 2:return F=s.sent(),B[m].isSuccess(F.statusCode)?[2,b(n,null,{fileID:j,download_url:U,requestId:I})]:[2,b(n,new Error("[".concat(d(),"][").concat(h.OPERATION_FAIL,"][").concat(t.COMPONENT_NAME,"]:").concat(F.data)))]}}))}))},e.prototype.getUploadMetadata=function(e,n){return a(this,void 0,Promise,(function(){var r,o,i,a,u,l,p,d,f,m;return s(this,(function(s){switch(s.label){case 0:if(r=e.cloudPath,o=e.method,i=e.headers,a=e.signedHeader,!v(r))throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".getUploadMetadata] invalid cloudPath")}));u=this.request,l="storage.getUploadMetadata",s.label=1;case 1:return s.trys.push([1,6,,7]),p=void 0,d={path:r},f=this.isGateWay(),o&&(d.method=o),o===c.put&&(f&&a?d.signedHeader=a:!f&&i&&(d.headers=i)),f?[4,_(u,d,e.customReqOpts)]:[3,3];case 2:return p=s.sent(),[3,5];case 3:return[4,u.send(l,d,e.customReqOpts)];case 4:p=s.sent(),s.label=5;case 5:return[2,b(n,null,p)];case 6:return m=s.sent(),[2,b(n,m)];case 7:return[2]}}))}))},e.prototype.deleteFile=function(e,n){return a(this,void 0,Promise,(function(){var r,o,i,a,c,u,l,p;return s(this,(function(s){switch(s.label){case 0:if(!(r=e.fileList)||!m(r)||0===r.length)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".deleteFile] fileList must not be empty")}));for(o=0,i=r;o<i.length;o++)if(!(a=i[o])||!v(a))throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".deleteFile] fileID must be string")}));return c="storage.batchDeleteFile",u=this.request,l={},this.isGateWay()?[4,w(u,{fileList:r},e.customReqOpts)]:[3,2];case 1:return l=s.sent(),[3,4];case 2:return[4,u.send(c,{fileid_list:r},e.customReqOpts)];case 3:l=s.sent(),s.label=4;case 4:return l.code?[2,b(n,null,l)]:(p={fileList:l.data.delete_list,requestId:l.requestId},[2,b(n,null,p)])}}))}))},e.prototype.getTempFileURL=function(e,n){return a(this,void 0,Promise,(function(){var r,o,i,a,c,u,l,p;return s(this,(function(s){switch(s.label){case 0:if(!(r=e.fileList)||!m(r)||0===r.length)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".getTempFileURL] fileList must not be empty")}));for(o=[],i=0,a=r;i<a.length;i++)if(c=a[i],g(c)){if(!Object.prototype.hasOwnProperty.call(c,"fileID"))throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".getTempFileURL] file info must include fileID")}));o.push({fileid:c.fileID,max_age:c.maxAge||7200})}else{if(!v(c))throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".getTempFileURL] invalid fileList")}));o.push({fileid:c})}return u="storage.batchGetDownloadUrl",l=this.request,p={},this.isGateWay()?[4,x(l,{convertedFileList:o},e.customReqOpts)]:[3,2];case 1:return p=s.sent(),[3,4];case 2:return[4,l.send(u,{file_list:o},e.customReqOpts)];case 3:p=s.sent(),s.label=4;case 4:return p.code?[2,b(n,null,p)]:[2,b(n,null,{fileList:p.data.download_list,requestId:p.requestId})]}}))}))},e.prototype.downloadFile=function(e,n){return a(this,void 0,Promise,(function(){var r,o,i,a,c,u;return s(this,(function(s){switch(s.label){case 0:if(r=e.fileID,!v(r))throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".getTempFileURL] fileID must be string")}));return[4,this.getTempFileURL.call(this,{fileList:[{fileID:r,maxAge:600}],customReqOpts:e.customReqOpts})];case 1:return o=s.sent(),"SUCCESS"!==(i=o.fileList[0]).code?[2,b(n,i)]:(a=this.request,c=encodeURI(i.download_url),[4,a.download({url:c,tempFilePath:e.tempFilePath})]);case 2:return u=s.sent(),[2,b(n,null,u)]}}))}))},e.prototype.copyFile=function(e,n){return a(this,void 0,Promise,(function(){var r,o,i,a,c,u,l,p,d;return s(this,(function(s){switch(s.label){case 0:if(!(r=e.fileList)||!m(r)||0===r.length)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".copyFile] fileList must not be empty")}));for(o=[],i=0,a=r;i<a.length;i++){if(c=a[i],u=c.srcPath,l=c.dstPath,!u||!l||"string"!=typeof u||"string"!=typeof l)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".copyFile] srcPath and dstPath may not be empty")}));if(u===l)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".copyFile] srcPath and dstPath can not be the same")}));o.push({src_path:u,dst_path:l,overwrite:c.overwrite,remove_original:c.removeOriginal})}return p=this.request,d={},this.isGateWay()?[4,E(p,{convertedFileList:o},e.customReqOpts)]:[3,2];case 1:return d=s.sent(),[3,4];case 2:return[4,p.send("storage.batchCopyFile",{file_list:o},e.customReqOpts)];case 3:d=s.sent(),s.label=4;case 4:return d.code?[2,b(n,null,d)]:[2,b(n,null,{fileList:d.data.copy_list,requestId:d.requestId})]}}))}))},e.prototype.getFileInfo=function(e){var t;return a(this,void 0,Promise,(function(){var n,r=this;return s(this,(function(o){switch(o.label){case 0:return[4,this.getTempFileURL(e)];case 1:return(null==(n=o.sent())?void 0:n.fileList)&&(null===(t=null==n?void 0:n.fileList)||void 0===t?void 0:t.length)>0?[4,Promise.all(n.fileList.map((function(e){return a(r,void 0,void 0,(function(){var t,n,r,o,i,a,c;return s(this,(function(s){switch(s.label){case 0:if("SUCCESS"!==e.code)return[2,{code:e.code,fileID:e.fileID,tempFileURL:e.tempFileURL,message:e.message}];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.request.fetch({url:e.tempFileURL,method:"HEAD"})];case 2:return t=s.sent(),n=t.header,"undefined"!=typeof Headers&&n instanceof Headers&&(r={},n.forEach((function(e,t){r[t]=e})),n=r),o=parseInt(n["content-length"])||0,i=n["content-type"]||"",[400,404].includes(Number(t.statusCode))?[2,{code:"FILE_NOT_FOUND",fileID:e.fileID,tempFileURL:e.tempFileURL,message:"file not found"}]:[2,{code:e.code,fileID:e.fileID,tempFileURL:e.tempFileURL,cloudId:e.fileID,fileName:e.fileID.split("/").pop(),contentType:i,mime:i.split(";")[0].trim(),size:o,etag:n.etag||"",lastModified:n["last-modified"]||"",cacheControl:n["cache-control"]||""}];case 3:return a=s.sent(),c="object"==typeof a&&null!==a&&"message"in a?String(a.message):void 0,[2,{code:"FETCH_FILE_INFO_ERROR",fileID:e.fileID,tempFileURL:e.tempFileURL,message:c}];case 4:return[2]}}))}))})))]:[3,3];case 2:return[2,{fileList:o.sent(),requestId:n.requestId}];case 3:return[2,{fileList:[],requestId:n.requestId}]}}))}))},o([y({customInfo:{className:"Cloudbase",methodName:"uploadFile"},title:"上传文件失败",messages:["请确认以下各项:"," 1 - 调用 uploadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(f)]}),i("design:type",Function),i("design:paramtypes",[Object,"function"==typeof(n="undefined"!=typeof Function&&Function)?n:Object]),i("design:returntype","function"==typeof(u="undefined"!=typeof Promise&&Promise)?u:Object)],e.prototype,"uploadFile",null),o([y({customInfo:{className:"Cloudbase",methodName:"getUploadMetadata"},title:"获取上传元信息失败",messages:["请确认以下各项:"," 1 - 调用 getUploadMetadata() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(f)]}),i("design:type",Function),i("design:paramtypes",[Object,"function"==typeof(I="undefined"!=typeof Function&&Function)?I:Object]),i("design:returntype","function"==typeof(A="undefined"!=typeof Promise&&Promise)?A:Object)],e.prototype,"getUploadMetadata",null),o([y({customInfo:{className:"Cloudbase",methodName:"deleteFile"},title:"删除文件失败",messages:["请确认以下各项:"," 1 - 调用 deleteFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(f)]}),i("design:type",Function),i("design:paramtypes",["function"==typeof(P=void 0!==p.ICloudbaseDeleteFileParams&&p.ICloudbaseDeleteFileParams)?P:Object,"function"==typeof(C="undefined"!=typeof Function&&Function)?C:Object]),i("design:returntype","function"==typeof(R="undefined"!=typeof Promise&&Promise)?R:Object)],e.prototype,"deleteFile",null),o([y({customInfo:{className:"Cloudbase",methodName:"getTempFileURL"},title:"获取文件下载链接",messages:["请确认以下各项:"," 1 - 调用 getTempFileURL() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(f)]}),i("design:type",Function),i("design:paramtypes",["function"==typeof(N=void 0!==p.ICloudbaseGetTempFileURLParams&&p.ICloudbaseGetTempFileURLParams)?N:Object,"function"==typeof(k="undefined"!=typeof Function&&Function)?k:Object]),i("design:returntype","function"==typeof(j="undefined"!=typeof Promise&&Promise)?j:Object)],e.prototype,"getTempFileURL",null),o([y({customInfo:{className:"Cloudbase",methodName:"downloadFile"},title:"下载文件失败",messages:["请确认以下各项:"," 1 - 调用 downloadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(f)]}),i("design:type",Function),i("design:paramtypes",["function"==typeof(D=void 0!==p.ICloudbaseDownloadFileParams&&p.ICloudbaseDownloadFileParams)?D:Object,"function"==typeof(U="undefined"!=typeof Function&&Function)?U:Object]),i("design:returntype","function"==typeof(L="undefined"!=typeof Promise&&Promise)?L:Object)],e.prototype,"downloadFile",null),o([y({customInfo:{className:"Cloudbase",methodName:"copyFile"},title:"批量复制文件",messages:["请确认以下各项:"," 1 - 调用 copyFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(f)]}),i("design:type",Function),i("design:paramtypes",["function"==typeof(M=void 0!==p.ICloudbaseCopyFileParams&&p.ICloudbaseCopyFileParams)?M:Object,"function"==typeof(q="undefined"!=typeof Function&&Function)?q:Object]),i("design:returntype","function"==typeof(B="undefined"!=typeof Promise&&Promise)?B:Object)],e.prototype,"copyFile",null),e}()},9656:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.DownloadBuilder=t.StreamDownloadBuilder=void 0;var a=n(7957),s=n(7090);function c(e){return(0,a.isStorageError)(e)?e:new a.StorageError((null==e?void 0:e.message)||String(e))}function u(e){var t={};return void 0!==(null==e?void 0:e.download)&&(t.download=!0===e.download?"":e.download),void 0!==(null==e?void 0:e.cacheNonce)&&(t.cacheNonce=String(e.cacheNonce)),{headers:{},query:t}}var l=function(){function e(e){this.ctx=e}return e.prototype.then=function(e,t){return this.execute().then(e,t)},e.prototype.execute=function(){var e,t;return o(this,void 0,Promise,(function(){var n,o,l,p,d;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),n=u(this.ctx.options),o=n.headers,l=n.query,[4,this.ctx.http.download({path:"/object/".concat(this.ctx.bucketId,"/").concat((0,s.encodeObjectName)(this.ctx.cleanName)),headers:r(r({},this.ctx.headers),o),query:l,signal:null===(e=this.ctx.parameters)||void 0===e?void 0:e.signal,cache:null===(t=this.ctx.parameters)||void 0===t?void 0:t.cache})];case 1:if(!(p=i.sent().response).body)throw new a.StorageApiError("Response body is empty",p.status,"STORAGE_PG_EMPTY_BODY");return[2,{data:p.body,error:null}];case 2:if(d=i.sent(),this.ctx.shouldThrowOnError)throw d;return[2,{data:null,error:c(d)}];case 3:return[2]}}))}))},e}();t.StreamDownloadBuilder=l;var p=function(){function e(e){this.ctx=e}return e.prototype.asStream=function(){return new l(this.ctx)},e.prototype.then=function(e,t){return this.execute().then(e,t)},e.prototype.execute=function(){var e,t;return o(this,void 0,Promise,(function(){var n,o,a,l,p,d;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),n=u(this.ctx.options),o=n.headers,a=n.query,[4,this.ctx.http.download({path:"/object/".concat(this.ctx.bucketId,"/").concat((0,s.encodeObjectName)(this.ctx.cleanName)),headers:r(r({},this.ctx.headers),o),query:a,signal:null===(e=this.ctx.parameters)||void 0===e?void 0:e.signal,cache:null===(t=this.ctx.parameters)||void 0===t?void 0:t.cache})];case 1:return l=i.sent().response,d={},[4,l.blob()];case 2:return[2,(d.data=i.sent(),d.error=null,d)];case 3:if(p=i.sent(),this.ctx.shouldThrowOnError)throw p;return[2,{data:null,error:c(p)}];case 4:return[2]}}))}))},e}();t.DownloadBuilder=p},7090:(e,t)=>{"use strict";function n(){return globalThis.Buffer}Object.defineProperty(t,"__esModule",{value:!0}),t.encodeObjectName=t.toBase64=t.getStringByteLength=void 0,t.getStringByteLength=function(e){var t;return null===(t=n())||void 0===t?void 0:t.byteLength(e)},t.toBase64=function(e){var t=n();return t?t.from(e).toString("base64"):btoa(e)},t.encodeObjectName=function(e){return e.split("/").map((function(e){return encodeURIComponent(e)})).join("/")}},5098:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Http=t.handleOperation=void 0;var a=n(7957),s="/v1/storages";t.handleOperation=function(e,t){return o(this,void 0,Promise,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e()];case 1:return[2,{data:r.sent(),error:null}];case 2:if(n=r.sent(),t)throw n;return(0,a.isStorageError)(n)?[2,{data:null,error:n}]:[2,{data:null,error:new a.StorageError((null==n?void 0:n.message)||String(n))}];case 3:return[2]}}))}))};var c=function(){function e(e){this.ctx=e}return Object.defineProperty(e.prototype,"request",{get:function(){return this.ctx.request},enumerable:!1,configurable:!0}),e.prototype.gatewayOrigin=function(){return this.request.getBaseEndPoint("GATEWAY")},e.prototype.buildUrl=function(e,t){var n="".concat(this.gatewayOrigin()).concat(s).concat(e),r=function(e){if(!e)return"";var t=[];return Object.keys(e).forEach((function(n){var r=e[n];null!=r&&t.push("".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(String(r))))})),t.join("&")}(t);return r&&(n+=(n.includes("?")?"&":"?")+r),n},e.prototype.toFullUrl=function(e){return e?/^https?:\/\//.test(e)||e.startsWith("//")?e:"".concat(this.gatewayOrigin()).concat(s).concat(e.startsWith("/")?"":"/").concat(e):e},e.prototype.send=function(e){return o(this,void 0,Promise,(function(){var t,n,o,a,s,c;return i(this,(function(i){switch(i.label){case 0:return t=this.buildUrl(e.path,e.query),n=e.method.toUpperCase(),o=["GET","HEAD"].includes(n),a=r({},e.headers||{}),o||(void 0!==e.rawBody?s=e.rawBody:void 0!==e.json&&(a["Content-Type"]=a["Content-Type"]||"application/json",s=JSON.stringify(e.json))),[4,this.request.fetch(r(r(r(r({url:t,method:n,headers:a},void 0!==s?{body:s}:{}),{withCredentials:!1!==e.withCredentials,shouldThrowOnError:!1}),e.signal?{signal:e.signal}:{}),e.cache?{cache:e.cache}:{}))];case 1:return c=i.sent(),[2,this.unwrap(c,t)]}}))}))},e.prototype.download=function(e){var t,n;return o(this,void 0,Promise,(function(){var o,s,c,u;return i(this,(function(i){switch(i.label){case 0:return o=this.buildUrl(e.path,e.query),[4,this.request.fetch(r(r({url:o,method:"GET",headers:r({},e.headers||{}),stream:!0,withCredentials:!1!==e.withCredentials,shouldThrowOnError:!1},e.signal?{signal:e.signal}:{}),e.cache?{cache:e.cache}:{}))];case 1:if(s=i.sent(),null===(t=e.signal)||void 0===t?void 0:t.aborted)throw new a.StorageApiError("The download was aborted",0,"STORAGE_PG_ABORTED");if(304===(c=Number(null!==(n=null==s?void 0:s.statusCode)&&void 0!==n?n:200)))throw new a.StorageApiError("Not Modified",c,"STORAGE_PG_NOT_MODIFIED");if(c>=400)throw new a.StorageApiError("Download failed with status ".concat(c),c,"STORAGE_PG_REQUEST_FAIL");if(!(u=null==s?void 0:s.response))throw new a.StorageApiError("Underlying adapter did not expose the raw Response",c,"STORAGE_PG_NO_RESPONSE");return[2,{response:u,status:c,header:null==s?void 0:s.header}]}}))}))},e.prototype.unwrap=function(e,t){var n,r;return o(this,void 0,Promise,(function(){var o,s,c,u;return i(this,(function(i){switch(i.label){case 0:o=Number(null!==(r=null!==(n=null==e?void 0:e.statusCode)&&void 0!==n?n:null==e?void 0:e.status)&&void 0!==r?r:200),s=null==e?void 0:e.data,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,s];case 2:return s=i.sent(),[3,4];case 3:return i.sent(),s=void 0,[3,4];case 4:if(o>=200&&o<300)return[2,s];throw c=(null==s?void 0:s.code)||(null==s?void 0:s.error)||"STORAGE_PG_REQUEST_FAIL",u=(null==s?void 0:s.message)||"Storage request failed with status ".concat(o,": ").concat(t),new a.StorageApiError(u,o,c)}}))}))},e}();t.Http=c},3456:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.registerStorage=t.StorageClient=t.StorageFileApi=t.ClassicStorageFileApi=t.CloudbaseStorage=t.COMPONENT_NAME=void 0;var i=n(1502),a=n(2014),s=n(5504),c=n(5891),u=n(3077),l=n(5891);Object.defineProperty(t,"COMPONENT_NAME",{enumerable:!0,get:function(){return l.COMPONENT_NAME}}),Object.defineProperty(t,"CloudbaseStorage",{enumerable:!0,get:function(){return l.CloudbaseStorage}});var p=n(3077);Object.defineProperty(t,"ClassicStorageFileApi",{enumerable:!0,get:function(){return p.ClassicStorageFileApi}});var d=n(1502);Object.defineProperty(t,"StorageFileApi",{enumerable:!0,get:function(){return d.StorageFileApi}});var h=new c.CloudbaseStorage,f={name:c.COMPONENT_NAME,entity:{uploadFile:h.uploadFile,deleteFile:h.deleteFile,getTempFileURL:h.getTempFileURL,downloadFile:h.downloadFile,getUploadMetadata:h.getUploadMetadata,copyFile:h.copyFile,getFileInfo:h.getFileInfo,isGateWay:h.isGateWay}},m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.from=function(e){return e?((0,s.assertValidBucketId)(e,"from"),new i.StorageFileApi(this.http,e,this.shouldThrowOnError)):new u.ClassicStorageFileApi(this.http.ctx,this.shouldThrowOnError)},t}(a.StorageBucketApi);t.StorageClient=m;var v={name:"".concat(c.COMPONENT_NAME,"/supabase"),IIFE:!0,entity:function(){var e=new WeakMap;Object.defineProperty(this.prototype,"storage",{get:function(){if(e.has(this))return e.get(this);var t=this,n=new Proxy({},{get:function(e,n){return"config"===n?t.config:"request"===n?t.request:void 0}}),r=new m(n);return e.set(this,r),r},configurable:!0,enumerable:!0})}};try{cloudbase.registerComponent(f),cloudbase.registerComponent(v)}catch(e){}function g(e){try{e.registerComponent(f),e.registerComponent(v)}catch(e){console.warn(e)}}t.registerStorage=g;try{window.registerStorage=g}catch(e){}},2014:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.StorageBucketApi=void 0;var i=n(5098),a=n(5504),s=function(){function e(e,t){void 0===t&&(t=!1),this.http=new i.Http(e),this.shouldThrowOnError=t}return e.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},e.prototype.listBuckets=function(e){return r(this,void 0,Promise,(function(){var t=this;return o(this,(function(n){return[2,(0,i.handleOperation)((function(){var n={};return void 0!==(null==e?void 0:e.limit)&&(n.limit=e.limit),void 0!==(null==e?void 0:e.offset)&&(n.offset=e.offset),(null==e?void 0:e.sortColumn)&&(n.sortColumn=e.sortColumn),(null==e?void 0:e.sortOrder)&&(n.sortOrder=e.sortOrder),(null==e?void 0:e.search)&&(n.search=e.search),t.http.send({method:"GET",path:"/bucket/",query:n})}),this.shouldThrowOnError)]}))}))},e.prototype.getBucket=function(e){return r(this,void 0,Promise,(function(){var t=this;return o(this,(function(n){return[2,(0,i.handleOperation)((function(){return(0,a.assertValidBucketId)(e,"getBucket"),t.http.send({method:"GET",path:"/bucket/".concat(e)})}),this.shouldThrowOnError)]}))}))},e.prototype.createBucket=function(e,t){return r(this,void 0,Promise,(function(){var n=this;return o(this,(function(r){return[2,(0,i.handleOperation)((function(){var r;return(0,a.assertValidBucketId)(e,"createBucket"),n.http.send({method:"POST",path:"/bucket/",json:{id:e,name:e,public:null!==(r=null==t?void 0:t.public)&&void 0!==r&&r,type:null==t?void 0:t.type,file_size_limit:null==t?void 0:t.fileSizeLimit,allowed_mime_types:null==t?void 0:t.allowedMimeTypes}})}),this.shouldThrowOnError)]}))}))},e.prototype.updateBucket=function(e,t){return r(this,void 0,Promise,(function(){var n=this;return o(this,(function(r){return[2,(0,i.handleOperation)((function(){return(0,a.assertValidBucketId)(e,"updateBucket"),n.http.send({method:"PUT",path:"/bucket/".concat(e),json:{public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes}})}),this.shouldThrowOnError)]}))}))},e.prototype.deleteBucket=function(e){return r(this,void 0,Promise,(function(){var t=this;return o(this,(function(n){return[2,(0,i.handleOperation)((function(){return(0,a.assertValidBucketId)(e,"deleteBucket"),t.http.send({method:"DELETE",path:"/bucket/".concat(e)})}),this.shouldThrowOnError)]}))}))},e}();t.StorageBucketApi=s},3077:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ClassicStorageFileApi=void 0;var a=n(2877),s=n(7957),c=n(5891),u=n(7090),l=a.constants.ERRORS,p=function(){function e(e,t){void 0===t&&(t=!1),this.shouldThrowOnError=!1,this.bucketId="",this.context=e,this.shouldThrowOnError=t,this.storage=new c.CloudbaseStorage(e)}return Object.defineProperty(e.prototype,"config",{get:function(){var e;return null===(e=this.context)||void 0===e?void 0:e.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){var e;return null===(e=this.context)||void 0===e?void 0:e.request},enumerable:!1,configurable:!0}),e.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},e.prototype.upload=function(e,t,n){return o(this,void 0,Promise,(function(){var o,a,u,p,d,h,f,m,v;return i(this,(function(i){switch(i.label){case 0:o=r({upsert:!0},n),a=o.cacheControl,u=o.contentType,p=o.metadata,i.label=1;case 1:return i.trys.push([1,3,,4]),d=this.getCloudPath(e),h={cloudPath:d,filePath:t},(a||u||p)&&(f={},a&&(f["cache-control"]=a),u&&(f["content-type"]=u),p&&(f["x-cos-metadata-metadata"]=this.toBase64(JSON.stringify(p))),h.headers=f),[4,this.storage.uploadFile(h)];case 2:if(!(m=i.sent()).fileID)throw new Error(JSON.stringify({code:l.OPERATION_FAIL,msg:"[".concat(c.COMPONENT_NAME,".update] no fileID returned")}));return[2,{data:{id:m.fileID,path:e,fullPath:e},error:null}];case 3:if(v=i.sent(),this.shouldThrowOnError)throw v;if((0,s.isStorageError)(v))return[2,{data:null,error:v}];throw v;case 4:return[2]}}))}))},e.prototype.uploadToSignedUrl=function(e,t,n,r){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.upload(e,n,r)]}))}))},e.prototype.createSignedUploadUrl=function(e){return o(this,void 0,Promise,(function(){var t,n,r;return i(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),t=this.getCloudPath(e),[4,this.storage.getUploadMetadata({cloudPath:t})];case 1:return[2,{data:{signedUrl:(n=o.sent().data).url,token:n.token,path:e,authorization:n.authorization,id:n.fileId,cosFileId:n.cosFileId,downloadUrl:n.download_url},error:null}];case 2:if(r=o.sent(),this.shouldThrowOnError)throw r;return[2,{data:null,error:r instanceof s.StorageError?r:new s.StorageError(r.message)}];case 3:return[2]}}))}))},e.prototype.update=function(e,t,n){return o(this,void 0,Promise,(function(){return i(this,(function(o){return[2,this.upload(e,t,r(r({},n),{upsert:!0}))]}))}))},e.prototype.move=function(e,t){return o(this,void 0,Promise,(function(){var n,r;return i(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.storage.copyFile({fileList:[{srcPath:this.getCloudPath(e),dstPath:this.getCloudPath(t),overwrite:!0,removeOriginal:!0}]})];case 1:if((n=o.sent()).fileList[0].code&&"SUCCESS"!==n.fileList[0].code)throw new s.StorageError(n.fileList[0].message||"Move failed");return[2,{data:{message:"File moved from ".concat(e," to ").concat(t)},error:null}];case 2:if(r=o.sent(),this.shouldThrowOnError)throw r;if((0,s.isStorageError)(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}}))}))},e.prototype.copy=function(e,t){return o(this,void 0,Promise,(function(){var n,r;return i(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.storage.copyFile({fileList:[{srcPath:this.getCloudPath(e),dstPath:this.getCloudPath(t),overwrite:!0,removeOriginal:!1}]})];case 1:if((n=o.sent()).fileList[0].code&&"SUCCESS"!==n.fileList[0].code)throw new s.StorageError(n.fileList[0].message||"Copy failed");return[2,{data:{path:this.getCloudPath(t)},error:null}];case 2:if(r=o.sent(),this.shouldThrowOnError)throw r;if((0,s.isStorageError)(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}}))}))},e.prototype.createSignedUrl=function(e,t,n){return o(this,void 0,Promise,(function(){var r,o,a,c,u,l,p;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r=this.normalizeCloudId(e),[4,this.storage.getTempFileURL({fileList:[{fileID:r,maxAge:t}]})];case 1:if("SUCCESS"!==(o=i.sent()).fileList[0].code)throw new s.StorageError("Failed to create signed URL: [".concat(o.fileList[0].code,"] ").concat(o.fileList[0].fileID));return a=o.fileList[0].download_url,c=[],void 0!==(null==n?void 0:n.download)&&("string"==typeof n.download?c.push("download=".concat(encodeURIComponent(n.download))):!0===n.download&&c.push("download=true")),(null==n?void 0:n.transform)&&(u=this.transformOptsToQueryString(n.transform))&&c.push(u),c.length>0&&(l=a.includes("?")?"&":"?",a="".concat(a).concat(l).concat(c.join("&"))),[2,{data:{signedUrl:a},error:null}];case 2:if(p=i.sent(),this.shouldThrowOnError)throw p;if((0,s.isStorageError)(p))return[2,{data:null,error:p}];throw p;case 3:return[2]}}))}))},e.prototype.createSignedUrls=function(e,t){return o(this,void 0,Promise,(function(){var n,r,o=this;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),n=e.map((function(e){return{fileID:o.normalizeCloudId(e),maxAge:t}})),[4,this.storage.getTempFileURL({fileList:n})];case 1:return[2,{data:i.sent().fileList.map((function(t,n){return{path:e[n],signedUrl:t.tempFileURL||"",error:"SUCCESS"===t.code?null:t.message}})),error:null}];case 2:if(r=i.sent(),this.shouldThrowOnError)throw r;if((0,s.isStorageError)(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}}))}))},e.prototype.download=function(e,t){return o(this,void 0,Promise,(function(){var n,r,a=this;return i(this,(function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),r={},[4,o(a,void 0,void 0,(function(){var n,r,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,this.createSignedUrl(e,600,{transform:t})];case 1:if((n=i.sent()).error)throw n.error;return r=encodeURI(null===(a=n.data)||void 0===a?void 0:a.signedUrl),[4,this.request.reqClass.get({url:r,headers:{},responseType:"blob"})];case 2:if(!(o=i.sent().data))throw new s.StorageError("Download failed: no file content");return[2,new Blob([o])]}}))}))];case 1:return[2,(r.data=c.sent(),r.error=null,r)];case 2:if(n=c.sent(),this.shouldThrowOnError)throw n;if((0,s.isStorageError)(n))return[2,{data:null,error:n}];throw n;case 3:return[2]}}))}))},e.prototype.info=function(e){return o(this,void 0,Promise,(function(){var t,n,r,o,a,c,u,l;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),t=e.startsWith("cloud://"),n=t?this.extractPathFromFileId(e):e,r=t?this.extractBucketFromFileId(e):this.bucketId,[4,this.storage.getFileInfo({fileList:[this.normalizeCloudId(e)]})];case 1:if(o=i.sent(),"SUCCESS"!==(a=o.fileList[0]).code)throw new s.StorageError(a.message);return c=(new Date).toISOString(),u=(a.lastModified?new Date(a.lastModified):new Date).toISOString(),[2,{data:{id:a.fileID,version:"1",name:n,bucketId:r,updatedAt:u,createdAt:u,lastAccessedAt:c,size:a.size,cacheControl:a.cacheControl,contentType:a.contentType,etag:a.etag,lastModified:u,metadata:{}},error:null}];case 2:if(l=i.sent(),this.shouldThrowOnError)throw l;return[2,{data:null,error:l instanceof s.StorageError?l:new s.StorageError(l.message)}];case 3:return[2]}}))}))},e.prototype.exists=function(e){return o(this,void 0,Promise,(function(){var t,n,r;return i(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.storage.getFileInfo({fileList:[this.normalizeCloudId(e)]})];case 1:if(t=o.sent(),"FILE_NOT_FOUND"===(n=t.fileList[0]).code)return[2,{data:!1,error:null}];if("SUCCESS"!==n.code)throw new s.StorageError(n.message);return[2,{data:!0,error:null}];case 2:if(r=o.sent(),this.shouldThrowOnError)throw r;if((0,s.isStorageError)(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}}))}))},e.prototype.getPublicUrl=function(e,t){return o(this,void 0,Promise,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.createSignedUrl(e,600,t)];case 1:return(n=r.sent()).data?[2,{data:{publicUrl:n.data.signedUrl}}]:[2,{data:null,error:n.error}]}}))}))},e.prototype.remove=function(e){return o(this,void 0,Promise,(function(){var t,n,r,o,a,c,u,l,p,d,h=this;return i(this,(function(i){switch(i.label){case 0:for(i.trys.push([0,3,,4]),t=10,n=[],r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return[4,Promise.all(n.map((function(e){return Promise.all(e.map((function(e){return h.info(e)})))})))];case 1:return o=i.sent(),a=new Map,o.forEach((function(n,r){n.forEach((function(n,o){n.data&&a.set(e[r*t+o],n.data)}))})),c=e.map((function(e){return h.normalizeCloudId(e)})),[4,this.storage.deleteFile({fileList:c})];case 2:if(u=i.sent(),(l=u.fileList.filter((function(e){return"SUCCESS"!==e.code}))).length>0)throw new s.StorageError("Delete failed for ".concat(l.length," file(s)"));return p=(new Date).toISOString(),[2,{data:e.map((function(e){var t=a.get(e);return{name:null==t?void 0:t.name,id:null==t?void 0:t.id,bucket_id:null==t?void 0:t.bucketId,owner:void 0,updated_at:(null==t?void 0:t.updatedAt)||p,created_at:null==t?void 0:t.createdAt,last_accessed_at:(null==t?void 0:t.lastAccessedAt)||p,metadata:(null==t?void 0:t.metadata)||{},buckets:{id:null==t?void 0:t.bucketId,name:null==t?void 0:t.bucketId,owner:void 0,public:!1,created_at:"",updated_at:p}}})),error:null}];case 3:if(d=i.sent(),this.shouldThrowOnError)throw d;if((0,s.isStorageError)(d))return[2,{data:null,error:d}];throw d;case 4:return[2]}}))}))},e.prototype.list=function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){throw new s.StorageError("Not implemented")}))}))},e.prototype.getCloudPath=function(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")},e.prototype.normalizeCloudId=function(e){var t;if(/^cloud:\/\//.test(e))return e;var n=this.getCloudPath(e);if(!this.bucketId)throw new s.StorageError("bucketId is not set");var r=(null===(t=this.config)||void 0===t?void 0:t.env)||"";return r?"cloud://".concat(r,".").concat(this.bucketId,"/").concat(n):void 0},e.prototype.toBase64=function(e){return(0,u.toBase64)(e)},e.prototype.transformOptsToQueryString=function(e){var t=["imageMogr2"];if(e.width||e.height){var n=e.width||"",r=e.height||"";"fill"===e.resize?t.push("thumbnail/".concat(n,"x").concat(r,"!")):"contain"===e.resize?t.push("thumbnail/".concat(n,"x").concat(r)):t.push("thumbnail/".concat(n,"x").concat(r,"^"))}if(e.format&&"origin"!==e.format&&t.push("format/".concat(e.format)),void 0!==e.quality){var o=Math.max(1,Math.min(100,e.quality));t.push("quality/".concat(o))}return t.join("/")},e.prototype.extractPathFromFileId=function(e){var t=e.replace(/^cloud:\/\//,"").split("/");return t.length<2?e:t.slice(1).join("/")},e.prototype.extractBucketFromFileId=function(e){var t=e.replace(/^cloud:\/\//,"").split("/");if(t.length<1)return"";var n=t[0],r=n.indexOf(".");return-1===r?n:n.substring(r+1)},e}();t.ClassicStorageFileApi=p},1502:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.StorageFileApi=void 0;var a=n(7957),s=n(7090),c=n(5098),u=n(9656),l="3600",p=function(){function e(e,t,n){void 0===n&&(n=!1),this.headers={},this.http=e,this.bucketId=t,this.shouldThrowOnError=n}return e.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},e.prototype.setHeader=function(e,t){var n;if("string"!=typeof e||""===e.trim())throw new a.StorageError("setHeader requires a non-empty header name");if(/[\r\n]/.test(e)||"string"==typeof t&&/[\r\n]/.test(t))throw new a.StorageError("setHeader does not allow CR/LF characters in header name or value");return this.headers=r(r({},this.headers),((n={})[e]=String(t),n)),this},e.prototype.upload=function(e,t,n){return o(this,void 0,Promise,(function(){return i(this,(function(r){return[2,this.uploadOrUpdate("POST",e,t,n)]}))}))},e.prototype.update=function(e,t,n){return o(this,void 0,Promise,(function(){return i(this,(function(r){return[2,this.uploadOrUpdate("PUT",e,t,n)]}))}))},e.prototype.download=function(e,t,n){return new u.DownloadBuilder({http:this.http,bucketId:this.bucketId,cleanName:this.cleanPath(e),options:t,parameters:n,headers:this.headers,shouldThrowOnError:this.shouldThrowOnError})},e.prototype.list=function(e,t,n){return o(this,void 0,Promise,(function(){var r=this;return i(this,(function(a){return[2,(0,c.handleOperation)((function(){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){return r={prefix:e||""},void 0!==(null==t?void 0:t.limit)&&(r.limit=t.limit),void 0!==(null==t?void 0:t.cursor)&&(r.cursor=t.cursor),void 0!==(null==t?void 0:t.withDelimiter)&&(r.with_delimiter=t.withDelimiter),void 0!==(null==t?void 0:t.sortBy)&&(r.sortBy=t.sortBy),[2,this.send({method:"POST",path:"/object/list/".concat(this.bucketId),json:r,signal:null==n?void 0:n.signal,cache:null==n?void 0:n.cache})]}))}))}),this.shouldThrowOnError)]}))}))},e.prototype.remove=function(e){return o(this,void 0,Promise,(function(){var t=this;return i(this,(function(n){return[2,(0,c.handleOperation)((function(){return o(t,void 0,void 0,(function(){var t,n,r,o,a,s=this;return i(this,(function(i){switch(i.label){case 0:t=e.map((function(e){return s.cleanPath(e)})),n=[],r=0,i.label=1;case 1:return r<t.length?(o=t.slice(r,r+100),[4,this.send({method:"DELETE",path:"/object/".concat(this.bucketId),json:{prefixes:o}})]):[3,4];case 2:a=i.sent(),Array.isArray(a)&&n.push.apply(n,a),i.label=3;case 3:return r+=100,[3,1];case 4:return[2,n]}}))}))}),this.shouldThrowOnError)]}))}))},e.prototype.copy=function(e,t,n){return o(this,void 0,Promise,(function(){var r=this;return i(this,(function(a){return[2,(0,c.handleOperation)((function(){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return r=this.buildCopyMoveHeaders(n),[4,this.send({method:"POST",path:"/object/copy",json:{bucketId:this.bucketId,sourceKey:this.cleanPath(e),destinationKey:this.cleanPath(t),destinationBucket:null==n?void 0:n.destinationBucket,copyMetadata:null==n?void 0:n.copyMetadata,metadata:null==n?void 0:n.metadata},headers:r})];case 1:return[2,{path:o.sent().Key}]}}))}))}),this.shouldThrowOnError)]}))}))},e.prototype.move=function(e,t,n){return o(this,void 0,Promise,(function(){var r=this;return i(this,(function(a){return[2,(0,c.handleOperation)((function(){return o(r,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return[4,this.send({method:"POST",path:"/object/move",json:{bucketId:this.bucketId,sourceKey:this.cleanPath(e),destinationKey:this.cleanPath(t),destinationBucket:null==n?void 0:n.destinationBucket}})];case 1:return[2,{message:r.sent().message||"Successfully moved"}]}}))}))}),this.shouldThrowOnError)]}))}))},e.prototype.info=function(e){return o(this,void 0,Promise,(function(){var t=this;return i(this,(function(n){return[2,(0,c.handleOperation)((function(){return o(t,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return t=this.cleanPath(e),[4,this.send({method:"GET",path:"/object/info/".concat(this.bucketId,"/").concat(this.encodePath(t))})];case 1:return[2,{id:(n=r.sent()).id,name:n.name,version:n.version,bucketId:n.bucket_id,size:n.size,contentType:n.content_type,cacheControl:n.cache_control,etag:n.etag,metadata:n.metadata,lastModified:n.last_modified,createdAt:n.created_at}]}}))}))}),this.shouldThrowOnError)]}))}))},e.prototype.exists=function(e){return o(this,void 0,Promise,(function(){var t,n,r;return i(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),t=this.cleanPath(e),[4,this.send({method:"GET",path:"/object/info/".concat(this.bucketId,"/").concat(this.encodePath(t))})];case 1:return o.sent(),[2,{data:!0,error:null}];case 2:if(n=o.sent(),void 0!==(r=null==n?void 0:n.status)&&[400,404].includes(Number(r)))return[2,{data:!1,error:null}];if(this.shouldThrowOnError)throw n;return[2,{data:null,error:n instanceof a.StorageError?n:new a.StorageError((null==n?void 0:n.message)||String(n))}];case 3:return[2]}}))}))},e.prototype.createSignedUrl=function(e,t,n){return o(this,void 0,Promise,(function(){var r=this;return i(this,(function(a){return[2,(0,c.handleOperation)((function(){return o(r,void 0,void 0,(function(){var r,o,a;return i(this,(function(i){switch(i.label){case 0:return r=this.cleanPath(e),[4,this.send({method:"POST",path:"/object/sign/".concat(this.bucketId,"/").concat(this.encodePath(r)),json:{expiresIn:t}})];case 1:return o=i.sent(),a=o.fullSignedURL||this.http.toFullUrl(o.signedURL||""),[2,{fullSignedURL:this.appendUrlOptions(a,n)}]}}))}))}),this.shouldThrowOnError)]}))}))},e.prototype.createSignedUrls=function(e,t,n){return o(this,void 0,Promise,(function(){var r=this;return i(this,(function(a){return[2,(0,c.handleOperation)((function(){return o(r,void 0,void 0,(function(){var r,o,a,s,c=this;return i(this,(function(i){switch(i.label){case 0:r=e.map((function(e){return c.cleanPath(e)})),o=[],a=0,i.label=1;case 1:return a<r.length?(s=r.slice(a,a+500),[4,this.send({method:"POST",path:"/object/sign/".concat(this.bucketId),json:{expiresIn:t,paths:s}})]):[3,4];case 2:i.sent().forEach((function(e){var t,r=e.fullSignedURL||(e.signedURL?c.http.toFullUrl(e.signedURL):null);o.push({path:e.path,fullSignedURL:r?c.appendUrlOptions(r,n):null,error:null!==(t=e.error)&&void 0!==t?t:null})})),i.label=3;case 3:return a+=500,[3,1];case 4:return[2,o]}}))}))}),this.shouldThrowOnError)]}))}))},e.prototype.createSignedUploadUrl=function(e,t){return o(this,void 0,Promise,(function(){var n=this;return i(this,(function(r){return[2,(0,c.handleOperation)((function(){return o(n,void 0,void 0,(function(){var n,r,o;return i(this,(function(i){switch(i.label){case 0:return n=this.cleanPath(e),r={},(null==t?void 0:t.upsert)&&(r["x-upsert"]="true"),[4,this.send({method:"POST",path:"/object/upload/sign/".concat(this.bucketId,"/").concat(this.encodePath(n)),headers:r})];case 1:return[2,{fullSignedURL:(o=i.sent()).fullURL||this.http.toFullUrl(o.url||""),path:n,token:o.token}]}}))}))}),this.shouldThrowOnError)]}))}))},e.prototype.uploadToSignedUrl=function(e,t,n,r){return o(this,void 0,Promise,(function(){var a=this;return i(this,(function(s){return[2,(0,c.handleOperation)((function(){return o(a,void 0,void 0,(function(){var o,a,s,c,u;return i(this,(function(i){switch(i.label){case 0:return o=this.cleanPath(e),a=this.buildUploadBody(n,r),s=a.body,c=a.headers,[4,this.send({method:"PUT",path:"/object/upload/sign/".concat(this.bucketId,"/").concat(this.encodePath(o)),query:{token:t},rawBody:s,headers:c,withCredentials:!1})];case 1:return u=i.sent(),[2,{path:o,fullPath:u.Key}]}}))}))}),this.shouldThrowOnError)]}))}))},e.prototype.getPublicUrl=function(e,t){var n=this.cleanPath(e),r=this.http.buildUrl("/object/public/".concat(this.bucketId,"/").concat(this.encodePath(n)));return{data:{publicUrl:this.appendUrlOptions(r,t)}}},e.prototype.send=function(e){return this.http.send(r(r({},e),{headers:r(r({},this.headers),e.headers||{})}))},e.prototype.uploadOrUpdate=function(e,t,n,r){return o(this,void 0,Promise,(function(){var a=this;return i(this,(function(s){return[2,(0,c.handleOperation)((function(){return o(a,void 0,void 0,(function(){var o,a,s,c,u;return i(this,(function(i){switch(i.label){case 0:return o=this.cleanPath(t),a=this.buildUploadBody(n,r),s=a.body,c=a.headers,"POST"===e&&(c["x-upsert"]=String(Boolean(null==r?void 0:r.upsert))),[4,this.send({method:e,path:"/object/".concat(this.bucketId,"/").concat(this.encodePath(o)),rawBody:s,headers:c})];case 1:return[2,{id:(u=i.sent()).Id,path:o,fullPath:u.Key}]}}))}))}),this.shouldThrowOnError)]}))}))},e.prototype.cleanPath=function(e){var t=e.replace(/^\/+|\/+$/g,"").replace(/\/+/g,"/");if(t.split("/").some((function(e){return".."===e})))throw new a.StorageError('invalid path: ".." segment is not allowed');return t},e.prototype.encodePath=function(e){return(0,s.encodeObjectName)(e)},e.prototype.buildUploadBody=function(e,t){var n,o,i,a,s,c=r({},(null==t?void 0:t.headers)||{}),u=e,p="undefined"!=typeof FormData&&e instanceof FormData;if("undefined"!=typeof Blob&&e instanceof Blob||p){var d=void 0,h={};if(p){var f=this.extractFromFormData(e);d=f.file,h=f.fields}else d=e;var m=null!==(o=null!==(n=null==t?void 0:t.cacheControl)&&void 0!==n?n:h.cacheControl)&&void 0!==o?o:l,v=null!==(i=null==t?void 0:t.contentType)&&void 0!==i?i:h.contentType,g=void 0!==(null==t?void 0:t.metadata)?JSON.stringify(t.metadata):h.metadata,b=new FormData;void 0!==m&&b.append("cacheControl",String(m)),void 0!==v&&b.append("contentType",v),void 0!==g&&b.append("metadata",g),b.append("",d),u=b}else u=e,m=null!==(a=null==t?void 0:t.cacheControl)&&void 0!==a?a:l,v=null!==(s=null==t?void 0:t.contentType)&&void 0!==s?s:"text/plain;charset=UTF-8",c["cache-control"]="max-age=".concat(m),v&&(c["content-type"]=v),(null==t?void 0:t.metadata)&&(c["x-metadata"]=this.toBase64(JSON.stringify(t.metadata)));return{body:u,headers:c}},e.prototype.extractFromFormData=function(e){var t,n={},r=0,o=[];if(e.forEach((function(e,i){if("undefined"!=typeof Blob&&e instanceof Blob)return t=e,void(r+=1);"cacheControl"!==i&&"contentType"!==i&&"metadata"!==i?o.push(i):n[i]=String(e)})),o.length>0&&console.warn("Ignored unsupported FormData field(s): [".concat(o.join(", "),"]. Only file, cacheControl, contentType and metadata are supported")),0===r||!t)throw new a.StorageError("FormData must contain a file");if(r>1)throw new a.StorageError("FormData must contain exactly one file");return{file:t,fields:n}},e.prototype.buildCopyMoveHeaders=function(e){var t={};return(null==e?void 0:e.upsert)&&(t["x-upsert"]="true"),!1===(null==e?void 0:e.copyMetadata)&&(null==e?void 0:e.metadata)&&(t["x-metadata"]=this.toBase64(JSON.stringify(e.metadata))),t},e.prototype.appendUrlOptions=function(e,t){var n=[];if(void 0!==(null==t?void 0:t.download)){var r=!0===t.download?"":String(t.download);n.push("download=".concat(encodeURIComponent(r)))}if(void 0!==(null==t?void 0:t.cacheNonce)&&n.push("cacheNonce=".concat(encodeURIComponent(String(t.cacheNonce)))),0===n.length)return e;var o=e.includes("?")?"&":"?";return"".concat(e).concat(o).concat(n.join("&"))},e.prototype.toBase64=function(e){return(0,s.toBase64)(e)},e}();t.StorageFileApi=p},7957:function(e,t){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.StorageUnknownError=t.StorageApiError=t.isStorageError=t.StorageError=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.__isStorageError=!0,n.name="StorageError",n}return r(t,e),t}(Error);t.StorageError=o,t.isStorageError=function(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e};var i=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.name="StorageApiError",o.status=n,o.statusCode=r,o}return r(t,e),t.prototype.toJSON=function(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}},t}(o);t.StorageApiError=i;var a=function(e){function t(t,n){var r=e.call(this,t)||this;return r.name="StorageUnknownError",r.originalError=n,r}return r(t,e),t}(o);t.StorageUnknownError=a},5504:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertValidBucketId=t.isValidBucketId=void 0;var r=n(7957),o=/[\x00-\x20\x7f/\\?#%]/;t.isValidBucketId=function(e){return"string"==typeof e&&e.length>0&&e.length<=256&&!o.test(e)},t.assertValidBucketId=function(e,t){if("string"!=typeof e||0===e.length)throw new r.StorageError("[storage.".concat(t,"] bucketId is required"));if(e.length>256)throw new r.StorageError("[storage.".concat(t,"] invalid bucketId: length must be 1-").concat(256));var n=o.exec(e);if(n){var i="[storage.".concat(t,'] invalid bucketId "').concat(e,'": ')+"contains forbidden character ".concat(JSON.stringify(n[0]),"; ")+'must not contain whitespace, control chars, "/", "\\", "?", "#" or "%"';throw new r.StorageError(i)}}},2563:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useDefaultAdapter=t.useAdapters=t.RUNTIME=void 0;var s,c=a(n(92)),u=n(962);!function(e){e.WEB="web",e.WX_MP="wx_mp"}(s=t.RUNTIME||(t.RUNTIME={})),t.useAdapters=function(e,t){for(var n=0,o=(0,u.isArray)(e)?e:[e];n<o.length;n++){var i=o[n],a=i.isMatch,s=i.genAdapter,c=i.runtime;if(a())return{adapter:r({isMatch:a},s(t)),runtime:c}}},t.useDefaultAdapter=function(){return{adapter:r({},c.genAdapter()),runtime:s.WEB}}},92:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.WebRequest=t.genAdapter=void 0;var c=n(2764),u=n(962),l=n(8464),p=function(e){function t(t){var n=e.call(this)||this,r=t.timeout,o=t.timeoutMsg,i=t.restrictedMethods;return n.timeout=r||0,n.timeoutMsg=o||"请求超时",n.restrictedMethods=i||["get","post","upload","download"],n}return o(t,e),t.prototype.get=function(e){return this.request(i(i({},e),{method:"get"}),this.restrictedMethods.includes("get"))},t.prototype.post=function(e){return this.request(i(i({},e),{method:"post"}),this.restrictedMethods.includes("post"))},t.prototype.put=function(e){return this.request(i(i({},e),{method:"put"}))},t.prototype.upload=function(e){var t=e.data,n=e.file,r=e.name,o=e.method,a=e.headers,s=void 0===a?{}:a,c={post:"post",put:"put"}[null==o?void 0:o.toLowerCase()]||"put",u=new FormData;return"post"===c?(Object.keys(t).forEach((function(e){u.append(e,t[e])})),u.append("key",r),u.append("file",n),this.request(i(i({},e),{data:u,method:c}),this.restrictedMethods.includes("upload"))):this.request(i(i({},e),{method:"put",headers:s,body:n}),this.restrictedMethods.includes("upload"))},t.prototype.download=function(e){return a(this,void 0,Promise,(function(){var t,n,r,o;return s(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.get(i(i({},e),{headers:{},responseType:"blob"}))];case 1:return t=a.sent().data,n=window.URL.createObjectURL(new Blob([t])),r=decodeURIComponent(new URL(e.url).pathname.split("/").pop()||""),(o=document.createElement("a")).href=n,o.setAttribute("download",r),o.style.display="none",document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(n),document.body.removeChild(o),[3,3];case 2:return a.sent(),[3,3];case 3:return[2,new Promise((function(t){t({statusCode:200,tempFilePath:e.url})}))]}}))}))},t.prototype.fetch=function(e){var t;return a(this,void 0,Promise,(function(){var n,r,o,c,u,l,p,d,h,f,m,v,g,b=this;return s(this,(function(y){switch(y.label){case 0:return n=new AbortController,r=e.url,o=e.enableAbort,c=void 0!==o&&o,u=e.stream,l=void 0!==u&&u,p=e.signal,d=e.timeout,h=e.shouldThrowOnError,f=void 0===h||h,m=null!=d?d:this.timeout,p&&(p.aborted&&n.abort(),p.addEventListener("abort",(function(){return n.abort()}))),v=null,c&&m&&(v=setTimeout((function(){console.warn(b.timeoutMsg),n.abort(new Error(b.timeoutMsg))}),m)),[4,fetch(r,i(i({},e),{signal:n.signal})).then((function(e){return a(b,void 0,void 0,(function(){var t,n,r;return s(this,(function(o){switch(o.label){case 0:return clearTimeout(v),f?e.ok?(t=e,[3,3]):[3,1]:[3,4];case 1:return r=(n=Promise).reject,[4,e.json()];case 2:t=r.apply(n,[o.sent()]),o.label=3;case 3:return[2,t];case 4:return[2,e]}}))}))})).catch((function(e){return clearTimeout(v),Promise.reject(e)}))];case 1:return g=y.sent(),[2,{data:l?g.body:(null===(t=g.headers.get("content-type"))||void 0===t?void 0:t.includes("application/json"))?g.json():g.text(),statusCode:g.status,header:g.headers,response:g}]}}))}))},t.prototype.request=function(e,t){var n=this;void 0===t&&(t=!1);var r=String(e.method).toLowerCase()||"get";return new Promise((function(o){var i=e.url,a=e.headers,s=void 0===a?{}:a,c=e.data,p=e.responseType,d=e.withCredentials,h=e.body,f=e.onUploadProgress,m=(0,u.formatUrl)((0,l.getProtocol)(),i,"get"===r?c:{}),v=new XMLHttpRequest;v.open(r,m),p&&(v.responseType=p);var g,b,y=e.signal;y&&(y.aborted?v.abort():y.addEventListener("abort",(function(){return v.abort()}),{once:!0})),Object.keys(s).forEach((function(e){v.setRequestHeader(e,s[e])})),f&&v.upload.addEventListener("progress",f),v.onreadystatechange=function(){var e={};if(4===v.readyState){var t=v.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};t.forEach((function(e){var t=e.split(": "),r=t.shift().toLowerCase(),o=t.join(": ");n[r]=o})),e.header=n,e.statusCode=v.status;try{e.data="blob"===p?v.response:JSON.parse(v.responseText)}catch(t){e.data="blob"===p?v.response:v.responseText}clearTimeout(g),o(e)}},t&&n.timeout&&(g=setTimeout((function(){console.warn(n.timeoutMsg),v.abort()}),n.timeout)),b=(0,u.isFormData)(c)?c:"application/x-www-form-urlencoded"===s["content-type"]?(0,u.toQueryString)(c):h||(c?JSON.stringify(c):void 0),d&&(v.withCredentials=!0),v.send(b)}))},t}(c.AbstractSDKRequest);t.WebRequest=p,t.genAdapter=function(){return{type:"default",root:window,reqClass:p,wsClass:WebSocket,localStorage}}},8464:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.COMMUNITY_SITE_URL=t.IS_DEBUG_MODE=t.getProtocol=t.setProtocol=t.getSdkName=t.setSdkName=void 0;var n="@cloudbase/js-sdk";t.setSdkName=function(e){n=e},t.getSdkName=function(){return n};var r="https:";t.setProtocol=function(e){r=e},t.getProtocol=function(){return r},t.IS_DEBUG_MODE=!1,t.COMMUNITY_SITE_URL="https://support.qq.com/products/148793"},3519:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERRORS=void 0,t.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"}},1778:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.OATUH_LOGINTYPE=void 0,o(n(8464),t),o(n(3519),t),t.OATUH_LOGINTYPE="constants"},9517:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.catchErrorsDecorator=void 0;var i=n(962),a=n(1778),s=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(s=-1!==navigator.userAgent.indexOf("Firefox"));var c=s?/(\.js\/)?__decorate(\$\d+)?<@.*\d$/:/(\/\w+\.js\.)?__decorate(\$\d+)?\s*\(.*\)$/,u=/https?:\/\/.+:\d*\/.*\.js:\d+:\d+/;function l(e){var t=e.err,n=e.className,r=e.methodName,o=e.sourceLink;if(!o)return null;var i,a=t.stack.split("\n"),c=s?/^catchErrorsDecorator\/<\/descriptor.value@.*\d$/:new RegExp("".concat(n,"\\.descriptor.value\\s*\\[as\\s").concat(r,"\\]\\s*\\(.*\\)$")),l=s?/^catchErrorsDecorator\/<\/descriptor.value/:new RegExp("".concat(n,"\\.descriptor.value\\s*\\[as\\s").concat(r,"\\]")),p=a.findIndex((function(e){return c.test(e)}));if(-1!==p){var d=a.filter((function(e,t){return t>p}));d.unshift(a[p].replace(l,"".concat(n,".").concat(r)).replace(u,o)),(i=new Error).stack="".concat(s?"@debugger":"Error","\n").concat(d.join("\n"))}return i}t.catchErrorsDecorator=function(e){var t=e.mode,n=void 0===t?"async":t,s=e.customInfo,p=void 0===s?{}:s,d=e.title,h=e.messages,f=void 0===h?[]:h;return function(e,t,s){if(a.IS_DEBUG_MODE){var h=p.className||e.constructor.name,m=p.methodName||t,v=s.value,g=function(){var e="",t=(new Error).stack.split("\n"),n=t.findIndex((function(e){return c.test(e)}));if(-1!==n){var r=u.exec(t[n+1]||"");e=r?r[0]:""}return e}();s.value="sync"===n?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=l({err:new Error,className:h,methodName:m,sourceLink:g});try{return v.apply(this,e)}catch(e){var r=e,o=e.message,a=e.error,s=e.error_description,c={title:d||"".concat(h,".").concat(m," failed"),content:[{type:"error",body:e}]};if(o&&/^\{.*\}$/.test(o)){var u=JSON.parse(o);c.subtitle=o,u.code&&(n?(n.code=u.code,n.msg=u.msg):(e.code=u.code,e.message=u.msg),r=n||e,c.content=f.map((function(e){return{type:"info",body:e}})))}throw a&&s&&(c.subtitle=s,n?(n.code=a,n.msg=s):(e.code=a,e.message=s),r=n||e,c.content=f.map((function(e){return{type:"info",body:e}}))),(0,i.printGroupLog)(c),r}}:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r(this,void 0,void 0,(function(){var t,n,r,a,s,c,u,p;return o(this,(function(o){switch(o.label){case 0:t=l({err:new Error,className:h,methodName:m,sourceLink:g}),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,v.apply(this,e)];case 2:return[2,o.sent()];case 3:throw n=o.sent(),r=n,a=n.message,s=n.error,c=n.error_description,u={title:d||"".concat(h,".").concat(m," failed"),content:[{type:"error",body:n}]},a&&/^\{.*\}$/.test(a)&&(p=JSON.parse(a),u.subtitle=p,p.code&&(t?(t.code=p.code,t.message=p.msg):(n.code=p.code,n.message=p.msg),r=t||n,u.content=f.map((function(e){return{type:"info",body:e}})))),s&&c&&(u.subtitle=c,t?(t.code=s,t.msg=c):(n.code=s,n.message=c),r=t||n,u.content=f.map((function(e){return{type:"info",body:e}}))),(0,i.printGroupLog)(u),r;case 4:return[2]}}))}))}}}}},3260:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(9517),t)},2877:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.langEvent=t.AbortController=t.jwt=t.helpers=t.utils=t.events=t.cache=t.adapters=t.constants=void 0;var s=i(n(1778));t.constants=s;var c=i(n(2563));t.adapters=c;var u=i(n(6865));t.cache=u;var l=i(n(6940));t.events=l;var p=i(n(3991));t.langEvent=p;var d=i(n(962));t.utils=d;var h=i(n(3260));t.helpers=h;var f=a(n(829));t.AbortController=f.default;var m={decode:a(n(3107)).default};t.jwt=m},829:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){var e=this;this.listeners=[],this.signal={aborted:!1,addEventListener:function(t,n){"abort"===t&&e.listeners.push(n)}}}return e.prototype.abort=function(){this.signal.aborted||(this.signal.aborted=!0,this.listeners.forEach((function(e){return e()})))},e}();t.default=n},6865:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.CloudbaseCache=void 0;var s=n(2764),c=n(962),u=n(1778),l=function(e){function t(t){var n=e.call(this)||this;return n.root=t,t.tcbCacheObject||(t.tcbCacheObject={}),n}return o(t,e),t.prototype.setItem=function(e,t){this.root.tcbCacheObject[e]=t},t.prototype.getItem=function(e){return this.root.tcbCacheObject[e]},t.prototype.removeItem=function(e){delete this.root.tcbCacheObject[e]},t.prototype.clear=function(){delete this.root.tcbCacheObject},t}(s.AbstractStorage),p=function(){function e(e){this.keys={};var t=e.persistence,n=e.platformInfo,r=void 0===n?{}:n,o=e.keys,i=void 0===o?{}:o;this.platformInfo=r,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||t,this.storage=function(e,t){switch(e){case"local":default:return t.localStorage?t.localStorage:((0,c.printWarn)(u.ERRORS.INVALID_PARAMS,"localStorage is not supported on current platform"),new l(t.root));case"none":return new l(t.root)}}(this.persistenceTag,this.platformInfo.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.persistenceTag},enumerable:!1,configurable:!0}),e.prototype.setStore=function(e,t,n){if("async"!==this.mode){if(this.storage)try{var r={version:n||"localCachev1",content:t};this.storage.setItem(e,JSON.stringify(r))}catch(e){throw new Error(JSON.stringify({code:u.ERRORS.OPERATION_FAIL,msg:"[".concat((0,u.getSdkName)(),"][").concat(u.ERRORS.OPERATION_FAIL,"]setStore failed"),info:e}))}}else(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},e.prototype.setStoreAsync=function(e,t,n){return i(this,void 0,void 0,(function(){var r;return a(this,(function(o){switch(o.label){case 0:if(!this.storage)return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),r={version:n||"localCachev1",content:t},[4,this.storage.setItem(e,JSON.stringify(r))];case 2:return o.sent(),[3,4];case 3:return o.sent(),[2];case 4:return[2]}}))}))},e.prototype.getStore=function(e,t){var n;if("async"!==this.mode){try{if("undefined"!=typeof process&&(null===(n={IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0})||void 0===n?void 0:n.tcb_token))return{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token;if(!this.storage)return""}catch(e){return""}t=t||"localCachev1";var r=this.storage.getItem(e);return r&&r.indexOf(t)>=0?JSON.parse(r).content:""}(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},e.prototype.getStoreAsync=function(e,t){var n;return i(this,void 0,void 0,(function(){var r;return a(this,(function(o){switch(o.label){case 0:try{if("undefined"!=typeof process&&(null===(n={IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0})||void 0===n?void 0:n.tcb_token))return[2,{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token];if(!this.storage)return[2,""]}catch(e){return[2,""]}return t=t||"localCachev1",[4,this.storage.getItem(e)];case 1:return(r=o.sent())&&r.indexOf(t)>=0?[2,JSON.parse(r).content]:[2,""]}}))}))},e.prototype.removeStore=function(e){"async"!==this.mode?this.storage.removeItem(e):(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},e.prototype.removeStoreAsync=function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.storage.removeItem(e)];case 1:return t.sent(),[2]}}))}))},e}();t.CloudbaseCache=p},6940:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.removeEventListener=t.activateEvent=t.addEventListener=t.CloudbaseEventEmitter=t.IErrorEvent=t.CloudbaseEvent=void 0;var a=n(962),s=function(e,t){this.data=t||null,this.name=e};t.CloudbaseEvent=s;var c=function(e){function t(t,n){var r=e.call(this,"error",{error:t,data:n})||this;return r.error=t,r}return o(t,e),t}(s);t.IErrorEvent=c;var u=function(){function e(){this.listeners={}}return e.prototype.on=function(e,t){return function(e,t,n){n[e]=n[e]||[],n[e].push(t)}(e,t,this.listeners),this},e.prototype.off=function(e,t){return function(e,t,n){if(null==n?void 0:n[e]){var r=n[e].indexOf(t);-1!==r&&n[e].splice(r,1)}}(e,t,this.listeners),this},e.prototype.fire=function(e,t){if((0,a.isInstanceOf)(e,c))return console.error(e.error),this;var n=(0,a.isString)(e)?new s(e,t||{}):e,r=n.name;if(this.listens(r)){n.target=this;for(var o=0,u=this.listeners[r]?i([],this.listeners[r],!0):[];o<u.length;o++)u[o].call(this,n)}return this},e.prototype.listens=function(e){return this.listeners[e]&&this.listeners[e].length>0},e}();t.CloudbaseEventEmitter=u;var l=new u;t.addEventListener=function(e,t){l.on(e,t)},t.activateEvent=function(e,t){void 0===t&&(t={}),l.fire(e,t)},t.removeEventListener=function(e,t){l.off(e,t)}},3991:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LANG_CHANGE_EVENT=t.bus=void 0;var r=n(6940);t.bus=new r.CloudbaseEventEmitter,t.LANG_CHANGE_EVENT="lang_change"},962:function(e,t,n){"use strict";var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.parseCaptcha=t.parseQueryString=t.transformPhone=t.sleep=t.printGroupLog=t.throwError=t.printInfo=t.printError=t.printWarn=t.execCallback=t.createPromiseCallback=t.removeParam=t.getHash=t.getQuery=t.toQueryString=t.formatUrl=t.generateRequestId=t.genSeqId=t.isFormData=t.isInstanceOf=t.isNull=t.isPalinObject=t.isUndefined=t.isString=t.isArray=void 0;var o=n(1778);t.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},t.isString=function(e){return"string"==typeof e},t.isUndefined=function(e){return void 0===e},t.isPalinObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},t.isNull=function(e){return"[object Null]"===Object.prototype.toString.call(e)},t.isInstanceOf=function(e,t){return e instanceof t},t.isFormData=function(e){return"[object FormData]"===Object.prototype.toString.call(e)},t.genSeqId=function(){return Math.random().toString(16).slice(2)},t.generateRequestId=function(){var e=(new Date).getTime(),t=(null===Date||void 0===Date?void 0:Date.now)&&1e3*Date.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(n){var r=16*Math.random();return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),("x"===n?r:7&r|8).toString(16)}))},t.formatUrl=function(e,t,n){void 0===n&&(n={});var r=/\?/.test(t),o="";return Object.keys(n).forEach((function(e){""===o?!r&&(t+="?"):o+="&",o+="".concat(e,"=").concat(encodeURIComponent(n[e]))})),/^http(s)?:\/\//.test(t+=o)?t:"".concat(e).concat(t)},t.toQueryString=function(e){void 0===e&&(e={});var t=[];return Object.keys(e).forEach((function(n){t.push("".concat(n,"=").concat(encodeURIComponent(e[n])))})),t.join("&")},t.getQuery=function(e,t){if("undefined"==typeof window)return!1;var n=t||decodeURIComponent(window.location.search),r=new RegExp("(^|&)".concat(e,"=([^&]*)(&|$)")),o=n.substr(n.indexOf("?")+1).match(r);return null!=o?o[2]:""},t.getHash=function(e){if("undefined"==typeof window)return"";var t=window.location.hash.match(new RegExp("[#?&/]".concat(e,"=([^&#]*)")));return t?t[1]:""},t.removeParam=function(e,t){var n=t.split("?")[0],r=[],o=-1!==t.indexOf("?")?t.split("?")[1]:"";if(""!==o){for(var i=(r=o.split("&")).length-1;i>=0;i-=1)r[i].split("=")[0]===e&&r.splice(i,1);n="".concat(n,"?").concat(r.join("&"))}return n},t.createPromiseCallback=function(){var e={};if(!Promise){(e=function(){}).promise={};var t=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}var n=new Promise((function(t,n){e=function(e,r){return e?n(e):t(r)}}));return e.promise=n,e},t.execCallback=function(e,t,n){if(void 0===n&&(n=null),e&&"function"==typeof e)return e(t,n);if(t)throw t;return n},t.printWarn=function(e,t){console.warn("[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t))},t.printError=function(e,t){console.error({code:e,msg:"[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t)})},t.printInfo=function(e,t){console.log("[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t))},t.throwError=function(e,t){throw new Error(JSON.stringify({code:e,msg:"[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t)}))},t.printGroupLog=function(e){var t,n=e.title,r=e.subtitle,o=void 0===r?"":r,i=e.content,a=void 0===i?[]:i,s=e.printTrace,c=void 0!==s&&s,u=e.collapsed;void 0!==u&&u?(console.groupCollapsed||console.error)(n,o):(console.group||console.error)(n,o);for(var l=0,p=a;l<p.length;l++){var d=p[l],h=d.type,f=d.body;switch(h){case"info":console.log(f);break;case"warn":console.warn(f);break;case"error":console.error(f)}}c&&(console.trace||console.log)("stack trace:"),null===(t=console.groupEnd)||void 0===t||t.call(console)},t.sleep=function(e){return void 0===e&&(e=0),new Promise((function(t){return setTimeout(t,e)}))},t.transformPhone=function(e){return"+86".concat(e)},t.parseQueryString=function(e){e=e.replace(/^\?/,"");var t={};return e.split("&").forEach((function(e){var n=e.split("="),r=n[0],o=n[1];r=decodeURIComponent(r),o=decodeURIComponent(o),r&&(t[r]?Array.isArray(t[r])?t[r].push(o):t[r]=[t[r],o]:t[r]=o)})),t},t.parseCaptcha=function(e){var n={},o=e.match(/^(data:.*?)(\?[^#\s]*)?$/);if(o){e=o[1];var i=o[2];i&&(n=(0,t.parseQueryString)(i))}var a=n.token,s=r(n,["token"]);return/^data:/.test(e)&&!a?{error:"invalid_argument",error_description:"invalid captcha data: ".concat(e)}:a?{state:s.state,token:a,captchaData:e}:{error:"unimplemented",error_description:"need to impl captcha data"}}},543:(e,t,n)=>{"use strict";n.r(t),n.d(t,{CollectionReference:()=>He,Db:()=>vt,DocumentReference:()=>Ue,Query:()=>Be});var r,o,i={};n.r(i),n.d(i,{LineString:()=>G,MultiLineString:()=>J,MultiPoint:()=>K,MultiPolygon:()=>$,Point:()=>oe,Polygon:()=>z}),function(e){e.DocIDError="文档ID不合法",e.CollNameError="集合名称不合法",e.OpStrError="操作符不合法",e.DirectionError="排序字符不合法",e.IntergerError="must be integer",e.QueryParamTypeError="查询参数必须为对象",e.QueryParamValueError="查询参数对象值不能均为undefined"}(o||(o={}));var a,s,c="Object",u="GeoPoint",l="GeoLineString",p="GeoPolygon",d="GeoMultiPoint",h="GeoMultiLineString",f="GeoMultiPolygon",m="Date",v="ServerDate",g=["desc","asc"],b=["<","<=","==",">=",">"];!function(e){e.lt="<",e.gt=">",e.lte="<=",e.gte=">=",e.eq="=="}(a||(a={})),(r={})[a.eq]="$eq",r[a.lt]="$lt",r[a.lte]="$lte",r[a.gt]="$gt",r[a.gte]="$gte",function(e){e.WHERE="WHERE",e.DOC="DOC"}(s||(s={}));var y,_=(y=function(e,t){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},y(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}y(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),x=[],w={},E=function(e){function t(t,n){if(n!==w)throw new TypeError("InternalSymbol cannot be constructed with new operator");return e.call(this,t)||this}return _(t,e),t.for=function(e){for(var n=0,r=x.length;n<r;n++)if(x[n].target===e)return x[n].instance;var o=new t(e,w);return x.push({target:e,instance:o}),o},t}((function(e){Object.defineProperties(this,{target:{enumerable:!1,writable:!1,configurable:!1,value:e}})}));const I=E;var S=I.for("UNSET_FIELD_NAME"),O=I.for("UPDATE_COMMAND"),T=I.for("QUERY_COMMAND"),A=I.for("LOGIC_COMMAND"),P=I.for("GEO_POINT"),C=I.for("SYMBOL_GEO_LINE_STRING"),R=I.for("SYMBOL_GEO_POLYGON"),N=I.for("SYMBOL_GEO_MULTI_POINT"),k=I.for("SYMBOL_GEO_MULTI_LINE_STRING"),j=I.for("SYMBOL_GEO_MULTI_POLYGON"),D=I.for("SERVER_DATE"),U=I.for("REGEXP"),L=function(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()},M=function(e){return"object"===L(e)},q=function(e){return"number"===L(e)},B=function(e){return Array.isArray(e)},F=function(e){return"date"===L(e)},W=function(e){return"regexp"===L(e)},V=function(e){return e&&e._internalType instanceof E},G=function(){function e(e){if(!B(e))throw new TypeError('"points" must be of type Point[]. Received type '.concat(typeof e));if(e.length<2)throw new Error('"points" must contain 2 points at least');e.forEach((function(e){if(!(e instanceof oe))throw new TypeError('"points" must be of type Point[]. Received type '.concat(typeof e,"[]"))})),this.points=e}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"LineString",coordinates:this.points.map((function(e){return e.toJSON().coordinates}))},t},e.prototype.toJSON=function(){return{type:"LineString",coordinates:this.points.map((function(e){return e.toJSON().coordinates}))}},e.validate=function(e){var t,n;if("LineString"!==e.type||!B(e.coordinates))return!1;try{for(var r=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(e.coordinates),o=r.next();!o.done;o=r.next()){var i=o.value;if(!q(i[0])||!q(i[1]))return!1}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!0},e.isClosed=function(e){var t=e.points[0],n=e.points[e.points.length-1];if(t.latitude===n.latitude&&t.longitude===n.longitude)return!0},Object.defineProperty(e.prototype,"_internalType",{get:function(){return C},enumerable:!1,configurable:!0}),e}(),H=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},z=function(){function e(e){if(!B(e))throw new TypeError('"lines" must be of type LineString[]. Received type '.concat(typeof e));if(0===e.length)throw new Error("Polygon must contain 1 linestring at least");e.forEach((function(e){if(!(e instanceof G))throw new TypeError('"lines" must be of type LineString[]. Received type '.concat(typeof e,"[]"));if(!G.isClosed(e))throw new Error("LineString ".concat(e.points.map((function(e){return e.toReadableString()}))," is not a closed cycle"))})),this.lines=e}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"Polygon",coordinates:this.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))},t},e.prototype.toJSON=function(){return{type:"Polygon",coordinates:this.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))}},e.validate=function(e){var t,n,r,o;if("Polygon"!==e.type||!B(e.coordinates))return!1;try{for(var i=H(e.coordinates),a=i.next();!a.done;a=i.next()){var s=a.value;if(!this.isCloseLineString(s))return!1;try{for(var c=(r=void 0,H(s)),u=c.next();!u.done;u=c.next()){var l=u.value;if(!q(l[0])||!q(l[1]))return!1}}catch(e){r={error:e}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return!0},e.isCloseLineString=function(e){var t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]},Object.defineProperty(e.prototype,"_internalType",{get:function(){return j},enumerable:!1,configurable:!0}),e}(),K=function(){function e(e){if(!B(e))throw new TypeError('"points" must be of type Point[]. Received type '.concat(typeof e));if(0===e.length)throw new Error('"points" must contain 1 point at least');e.forEach((function(e){if(!(e instanceof oe))throw new TypeError('"points" must be of type Point[]. Received type '.concat(typeof e,"[]"))})),this.points=e}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"MultiPoint",coordinates:this.points.map((function(e){return e.toJSON().coordinates}))},t},e.prototype.toJSON=function(){return{type:"MultiPoint",coordinates:this.points.map((function(e){return e.toJSON().coordinates}))}},e.validate=function(e){var t,n;if("MultiPoint"!==e.type||!B(e.coordinates))return!1;try{for(var r=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(e.coordinates),o=r.next();!o.done;o=r.next()){var i=o.value;if(!q(i[0])||!q(i[1]))return!1}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!0},Object.defineProperty(e.prototype,"_internalType",{get:function(){return N},enumerable:!1,configurable:!0}),e}(),Y=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},J=function(){function e(e){if(!B(e))throw new TypeError('"lines" must be of type LineString[]. Received type '.concat(typeof e));if(0===e.length)throw new Error("Polygon must contain 1 linestring at least");e.forEach((function(e){if(!(e instanceof G))throw new TypeError('"lines" must be of type LineString[]. Received type '.concat(typeof e,"[]"))})),this.lines=e}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"MultiLineString",coordinates:this.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))},t},e.prototype.toJSON=function(){return{type:"MultiLineString",coordinates:this.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))}},e.validate=function(e){var t,n,r,o;if("MultiLineString"!==e.type||!B(e.coordinates))return!1;try{for(var i=Y(e.coordinates),a=i.next();!a.done;a=i.next()){var s=a.value;try{for(var c=(r=void 0,Y(s)),u=c.next();!u.done;u=c.next()){var l=u.value;if(!q(l[0])||!q(l[1]))return!1}}catch(e){r={error:e}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return!0},Object.defineProperty(e.prototype,"_internalType",{get:function(){return k},enumerable:!1,configurable:!0}),e}(),Q=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},$=function(){function e(e){var t,n;if(!B(e))throw new TypeError('"polygons" must be of type Polygon[]. Received type '.concat(typeof e));if(0===e.length)throw new Error("MultiPolygon must contain 1 polygon at least");try{for(var r=Q(e),o=r.next();!o.done;o=r.next()){var i=o.value;if(!(i instanceof z))throw new TypeError('"polygon" must be of type Polygon[]. Received type '.concat(typeof i,"[]"))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}this.polygons=e}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"MultiPolygon",coordinates:this.polygons.map((function(e){return e.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))}))},t},e.prototype.toJSON=function(){return{type:"MultiPolygon",coordinates:this.polygons.map((function(e){return e.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))}))}},e.validate=function(e){var t,n,r,o,i,a;if("MultiPolygon"!==e.type||!B(e.coordinates))return!1;try{for(var s=Q(e.coordinates),c=s.next();!c.done;c=s.next()){var u=c.value;try{for(var l=(r=void 0,Q(u)),p=l.next();!p.done;p=l.next()){var d=p.value;try{for(var h=(i=void 0,Q(d)),f=h.next();!f.done;f=h.next()){var m=f.value;if(!q(m[0])||!q(m[1]))return!1}}catch(e){i={error:e}}finally{try{f&&!f.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{p&&!p.done&&(o=l.return)&&o.call(l)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return!0},Object.defineProperty(e.prototype,"_internalType",{get:function(){return R},enumerable:!1,configurable:!0}),e}(),X=function(){function e(e){var t=(void 0===e?{}:e).offset,n=void 0===t?0:t;this.offset=n}return Object.defineProperty(e.prototype,"_internalType",{get:function(){return D},enumerable:!1,configurable:!0}),e.prototype.parse=function(){return{$date:{offset:this.offset}}},e}();function Z(e){return new X(e)}var ee,te=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},ne=function(){function e(){}return e.formatResDocumentData=function(t){return t.map((function(t){return e.formatField(t)}))},e.formatField=function(t){var n=Object.keys(t),r={};return Array.isArray(t)&&(r=[]),n.forEach((function(n){var o,i=t[n];switch(e.whichType(i)){case u:o=new oe(i.coordinates[0],i.coordinates[1]);break;case l:o=new G(i.coordinates.map((function(e){return new oe(e[0],e[1])})));break;case p:o=new z(i.coordinates.map((function(e){return new G(e.map((function(e){var t=te(e,2),n=t[0],r=t[1];return new oe(n,r)})))})));break;case d:o=new K(i.coordinates.map((function(e){return new oe(e[0],e[1])})));break;case h:o=new J(i.coordinates.map((function(e){return new G(e.map((function(e){var t=te(e,2),n=t[0],r=t[1];return new oe(n,r)})))})));break;case f:o=new $(i.coordinates.map((function(e){return new z(e.map((function(e){return new G(e.map((function(e){var t=te(e,2),n=t[0],r=t[1];return new oe(n,r)})))})))})));break;case m:o=new Date(1e3*i.$timestamp);break;case c:case"Array":o=e.formatField(i);break;case v:o=new Date(i.$date);break;default:o=i}Array.isArray(r)?r.push(o):r[n]=o})),r},e.whichType=function(e){var t=Object.prototype.toString.call(e).slice(8,-1);if(t===m)return"BsonDate";if(t===c){if(e instanceof oe)return u;if(e instanceof Date)return m;if(e instanceof X)return v;e.$timestamp?t=m:e.$date?t=v:oe.validate(e)?t=u:G.validate(e)?t=l:z.validate(e)?t=p:K.validate(e)?t=d:J.validate(e)?t=h:$.validate(e)&&(t=f)}return t},e.generateDocId=function(){for(var e="",t=0;t<24;t++)e+="ABCDEFabcdef0123456789".charAt(Math.floor(22*Math.random()));return e},e}(),re=function(){function e(){}return e.isGeopoint=function(e,t){if("Number"!==ne.whichType(t))throw new Error("Geo Point must be number type");var n=Math.abs(t);if("latitude"===e&&n>90)throw new Error("latitude should be a number ranges from -90 to 90");if("longitude"===e&&n>180)throw new Error("longitude should be a number ranges from -180 to 180");return!0},e.isInteger=function(e,t){if(!Number.isInteger(t))throw new Error(e+o.IntergerError);return!0},e.isFieldOrder=function(e){if(-1===g.indexOf(e))throw new Error(o.DirectionError);return!0},e.isFieldPath=function(e){if(!/^[a-zA-Z0-9-_\.]/.test(e))throw new Error;return!0},e.isOperator=function(e){if(-1===b.indexOf(e))throw new Error(o.OpStrError);return!0},e.isCollName=function(e){if(!/^[a-zA-Z0-9]([a-zA-Z0-9-_]){1,32}$/.test(e))throw new Error(o.CollNameError);return!0},e.isDocID=function(e){if(!/^([a-fA-F0-9]){24}$/.test(e))throw new Error(o.DocIDError);return!0},e}(),oe=function(){function e(e,t){re.isGeopoint("longitude",e),re.isGeopoint("latitude",t),this.longitude=e,this.latitude=t}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"Point",coordinates:[this.longitude,this.latitude]},t},e.prototype.toJSON=function(){return{type:"Point",coordinates:[this.longitude,this.latitude]}},e.prototype.toReadableString=function(){return"[".concat(this.longitude,",").concat(this.latitude,"]")},e.validate=function(e){return"Point"===e.type&&B(e.coordinates)&&re.isGeopoint("longitude",e.coordinates[0])&&re.isGeopoint("latitude",e.coordinates[1])},Object.defineProperty(e.prototype,"_internalType",{get:function(){return P},enumerable:!1,configurable:!0}),e}(),ie=function(){var e=function(){};if(!Promise){e.promise={};var t=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}var n=new Promise((function(t,n){e=function(e,r){return e?n(e):t(r)}}));return e.promise=n,e};!function(e){e.SET="set",e.REMOVE="remove",e.INC="inc",e.MUL="mul",e.PUSH="push",e.PULL="pull",e.PULL_ALL="pullAll",e.POP="pop",e.SHIFT="shift",e.UNSHIFT="unshift",e.ADD_TO_SET="addToSet",e.BIT="bit",e.RENAME="rename",e.MAX="max",e.MIN="min"}(ee||(ee={}));var ae,se=function(){function e(e,t,n){this._internalType=O,Object.defineProperties(this,{_internalType:{enumerable:!1,configurable:!1}}),this.operator=e,this.operands=t,this.fieldName=n||S}return e.prototype._setFieldName=function(t){return new e(this.operator,this.operands,t)},e}();function ce(e){return e&&e instanceof se&&e._internalType===O}!function(e){e.AND="and",e.OR="or",e.NOT="not",e.NOR="nor"}(ae||(ae={}));var ue=function(){function e(e,t,n){if(this._internalType=A,Object.defineProperties(this,{_internalType:{enumerable:!1,configurable:!1}}),this.operator=e,this.operands=t,this.fieldName=n||S,this.fieldName!==S)if(Array.isArray(t)){t=t.slice(),this.operands=t;for(var r=0,o=t.length;r<o;r++)(le(i=t[r])||fe(i))&&(t[r]=i._setFieldName(this.fieldName))}else{var i;(le(i=t)||fe(i))&&(t=i._setFieldName(this.fieldName))}}return e.prototype._setFieldName=function(t){var n=this.operands.map((function(n){return n instanceof e?n._setFieldName(t):n}));return new e(this.operator,n,t)},e.prototype.and=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=Array.isArray(arguments[0])?arguments[0]:Array.from(arguments);return r.unshift(this),new e(ae.AND,r,this.fieldName)},e.prototype.or=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=Array.isArray(arguments[0])?arguments[0]:Array.from(arguments);return r.unshift(this),new e(ae.OR,r,this.fieldName)},e}();function le(e){return e&&e instanceof ue&&e._internalType===A}var pe,de=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){e.EQ="eq",e.NEQ="neq",e.GT="gt",e.GTE="gte",e.LT="lt",e.LTE="lte",e.IN="in",e.NIN="nin",e.ALL="all",e.ELEM_MATCH="elemMatch",e.EXISTS="exists",e.SIZE="size",e.MOD="mod",e.GEO_NEAR="geoNear",e.GEO_WITHIN="geoWithin",e.GEO_INTERSECTS="geoIntersects"}(pe||(pe={}));var he=function(e){function t(t,n,r){var o=e.call(this,t,n,r)||this;return o.operator=t,o._internalType=T,o}return de(t,e),t.prototype.toJSON=function(){var e,t;switch(this.operator){case pe.IN:case pe.NIN:return(e={})["$"+this.operator]=this.operands,e;default:return(t={})["$"+this.operator]=this.operands[0],t}},t.prototype._setFieldName=function(e){return new t(this.operator,this.operands,e)},t.prototype.eq=function(e){var n=new t(pe.EQ,[e],this.fieldName);return this.and(n)},t.prototype.neq=function(e){var n=new t(pe.NEQ,[e],this.fieldName);return this.and(n)},t.prototype.gt=function(e){var n=new t(pe.GT,[e],this.fieldName);return this.and(n)},t.prototype.gte=function(e){var n=new t(pe.GTE,[e],this.fieldName);return this.and(n)},t.prototype.lt=function(e){var n=new t(pe.LT,[e],this.fieldName);return this.and(n)},t.prototype.lte=function(e){var n=new t(pe.LTE,[e],this.fieldName);return this.and(n)},t.prototype.in=function(e){var n=new t(pe.IN,e,this.fieldName);return this.and(n)},t.prototype.nin=function(e){var n=new t(pe.NIN,e,this.fieldName);return this.and(n)},t.prototype.geoNear=function(e){if(!(e.geometry instanceof oe))throw new TypeError('"geometry" must be of type Point. Received type '.concat(typeof e.geometry));if(void 0!==e.maxDistance&&!q(e.maxDistance))throw new TypeError('"maxDistance" must be of type Number. Received type '.concat(typeof e.maxDistance));if(void 0!==e.minDistance&&!q(e.minDistance))throw new TypeError('"minDistance" must be of type Number. Received type '.concat(typeof e.minDistance));var n=new t(pe.GEO_NEAR,[e],this.fieldName);return this.and(n)},t.prototype.geoWithin=function(e){if(!(e.geometry instanceof $||e.geometry instanceof z))throw new TypeError('"geometry" must be of type Polygon or MultiPolygon. Received type '.concat(typeof e.geometry));var n=new t(pe.GEO_WITHIN,[e],this.fieldName);return this.and(n)},t.prototype.geoIntersects=function(e){if(!(e.geometry instanceof oe||e.geometry instanceof G||e.geometry instanceof z||e.geometry instanceof K||e.geometry instanceof J||e.geometry instanceof $))throw new TypeError('"geometry" must be of type Point, LineString, Polygon, MultiPoint, MultiLineString or MultiPolygon. Received type '.concat(typeof e.geometry));var n=new t(pe.GEO_INTERSECTS,[e],this.fieldName);return this.and(n)},t}(ue);function fe(e){return e&&e instanceof he&&e._internalType===T}function me(e){return fe(e)}var ve={};for(var ge in pe)ve[ge]="$"+ge;for(var ge in ae)ve[ge]="$"+ge;for(var ge in ee)ve[ge]="$"+ge;function be(e){return ve[e]||"$"+e}ve[pe.NEQ]="$ne",ve[ee.REMOVE]="$unset",ve[ee.SHIFT]="$pop",ve[ee.UNSHIFT]="$push";var ye=function(){return ye=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ye.apply(this,arguments)},_e=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},xe=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function we(e){return Ee(e,[e])}function Ee(e,t){if(!V(e)){if(F(e))return{$date:+e};if(W(e))return{$regex:e.source,$options:e.flags};if(B(e))return e.map((function(e){if(t.indexOf(e)>-1)throw new Error("Cannot convert circular structure to JSON");return Ee(e,xe(xe([],_e(t),!1),[e],!1))}));if(M(e)){var n=ye({},e);for(var r in n){if(t.indexOf(n[r])>-1)throw new Error("Cannot convert circular structure to JSON");n[r]=Ee(n[r],xe(xe([],_e(t),!1),[n[r]],!1))}return n}return e}switch(e._internalType){case P:return e.toJSON();case D:case U:return e.parse();default:return e.toJSON?e.toJSON():e}}var Ie=function(){return Ie=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ie.apply(this,arguments)},Se=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Oe=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function Te(e,t,n,r){var o=Ie({},e);for(var i in e)if(!/^\$/.test(i)){var a=e[i];if(a&&M(a)&&!t(a)){if(r.indexOf(a)>-1)throw new Error("Cannot convert circular structure to JSON");var s=Te(a,t,Oe(Oe([],Se(n),!1),[i],!1),Oe(Oe([],Se(r),!1),[a],!1));o[i]=s;var c=!1;for(var u in s)/^\$/.test(u)?c=!0:(o["".concat(i,".").concat(u)]=s[u],delete o[i][u]);c||delete o[i]}}return o}function Ae(e){return Te(e,Ce,[],[e])}function Pe(e,t,n){for(var r in t[n]||delete e[n],t)e[r]?B(e[r])?e[r].push(t[r]):M(e[r])?M(t[r])?Object.assign(e[r],t[r]):(console.warn("unmergable condition, query is object but condition is ".concat(L(t),", can only overwrite"),t,n),e[r]=t[r]):(console.warn("to-merge query is of type ".concat(L(e),", can only overwrite"),e,t,n),e[r]=t[r]):e[r]=t[r]}function Ce(e){return V(e)||F(e)||W(e)}function Re(e){return we(e)}var Ne=function(){function e(){}return e.encode=function(t){return(new e).encodeUpdate(t)},e.prototype.encodeUpdate=function(e){return ce(e)?this.encodeUpdateCommand(e):"object"===L(e)?this.encodeUpdateObject(e):e},e.prototype.encodeUpdateCommand=function(e){if(e.fieldName===S)throw new Error("Cannot encode a comparison command with unset field name");switch(e.operator){case ee.PUSH:case ee.PULL:case ee.PULL_ALL:case ee.POP:case ee.SHIFT:case ee.UNSHIFT:case ee.ADD_TO_SET:return this.encodeArrayUpdateCommand(e);default:return this.encodeFieldUpdateCommand(e)}},e.prototype.encodeFieldUpdateCommand=function(e){var t,n,r,o,i=be(e.operator);return e.operator===ee.REMOVE?((t={})[i]=((n={})[e.fieldName]="",n),t):((r={})[i]=((o={})[e.fieldName]=e.operands[0],o),r)},e.prototype.encodeArrayUpdateCommand=function(e){var t,n,r,o,i,a,s,c,u,l,p=be(e.operator);switch(e.operator){case ee.PUSH:var d=void 0;return d=B(e.operands)?{$each:e.operands.map(Re)}:e.operands,(t={})[p]=((n={})[e.fieldName]=d,n),t;case ee.UNSHIFT:return d={$each:e.operands.map(Re),$position:0},(r={})[p]=((o={})[e.fieldName]=d,o),r;case ee.POP:return(i={})[p]=((a={})[e.fieldName]=1,a),i;case ee.SHIFT:return(s={})[p]=((c={})[e.fieldName]=-1,c),s;default:return(u={})[p]=((l={})[e.fieldName]=Re(e.operands),l),u}},e.prototype.encodeUpdateObject=function(e){var t=Ae(e);for(var n in t)if(!/^\$/.test(n)){var r=t[n];if(ce(r))t[n]=r._setFieldName(n),Pe(t,this.encodeUpdateCommand(t[n]),n);else{t[n]=r=Re(r);var o=new se(ee.SET,[r],n);Pe(t,this.encodeUpdateCommand(o),n)}}return t},e}(),ke={};function je(e){if(!vt.wsClientClass)throw new Error("to use realtime you must import realtime module first");var t=e.config.env;return ke[t]||(ke[t]=new vt.wsClientClass({context:{appConfig:{docSizeLimit:1e3,realtimePingInterval:1e4,realtimePongWaitTimeout:5e3,request:vt.createRequest(e.config)}}})),ke[t]}var De=function(){return De=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},De.apply(this,arguments)},Ue=function(){function e(e,t,n,r){void 0===r&&(r={});var o=this;this.watch=function(e){return je(o._db).watch(De(De({},e),{envId:o._db.config.env,collectionName:o._coll,query:JSON.stringify({_id:o.id})}))},this._db=e,this._coll=t,this.id=n,this.request=vt.createRequest(this._db.config),this.projection=r}return e.prototype.create=function(e,t){t=t||ie();var n=Array.isArray(e),r={collectionName:this._coll,data:n?e.map((function(e){return we(e)})):we(e)};return!n&&this.id&&(r._id=this.id),this.request.send("database.addDocument",r).then((function(e){var r;e.code?t(0,e):t(0,n?{ids:(null===(r=e.data)||void 0===r?void 0:r.insertedIds)||[],requestId:e.requestId}:{id:e.data._id,requestId:e.requestId})})).catch((function(e){t(e)})),t.promise},e.prototype.set=function(e,t){if(t=t||ie(),!this.id)return Promise.resolve({code:"INVALID_PARAM",message:"docId不能为空"});if(!e||"object"!=typeof e)return Promise.resolve({code:"INVALID_PARAM",message:"参数必需是非空对象"});if(e.hasOwnProperty("_id"))return Promise.resolve({code:"INVALID_PARAM",message:"不能更新_id的值"});var n=!1,r=function(e){if("object"==typeof e)for(var t in e)e[t]instanceof se?n=!0:"object"==typeof e[t]&&r(e[t])};if(r(e),n)return Promise.resolve({code:"DATABASE_REQUEST_FAILED",message:"update operator complicit"});var o={collectionName:this._coll,queryType:s.DOC,data:we(e),multi:!1,merge:!1,upsert:!0};return this.id&&(o.query={_id:this.id}),this.request.send("database.updateDocument",o).then((function(e){e.code?t(0,e):t(0,{updated:e.data.updated,upsertedId:e.data.upserted_id,requestId:e.requestId})})).catch((function(e){t(e)})),t.promise},e.prototype.update=function(e,t){if(t=t||ie(),!e||"object"!=typeof e)return Promise.resolve({code:"INVALID_PARAM",message:"参数必需是非空对象"});if(e.hasOwnProperty("_id"))return Promise.resolve({code:"INVALID_PARAM",message:"不能更新_id的值"});var n={_id:this.id},r={collectionName:this._coll,data:Ne.encode(e),query:n,queryType:s.DOC,multi:!1,merge:!0,upsert:!1};return this.request.send("database.updateDocument",r).then((function(e){e.code?t(0,e):t(0,{updated:e.data.updated,upsertedId:e.data.upserted_id,requestId:e.requestId})})).catch((function(e){t(e)})),t.promise},e.prototype.remove=function(e){e=e||ie();var t={_id:this.id},n={collectionName:this._coll,query:t,queryType:s.DOC,multi:!1};return this.request.send("database.deleteDocument",n).then((function(t){t.code?e(0,t):e(0,{deleted:t.data.deleted,requestId:t.requestId})})).catch((function(t){e(t)})),e.promise},e.prototype.get=function(e){e=e||ie();var t={_id:this.id},n={collectionName:this._coll,query:t,queryType:s.DOC,multi:!1,projection:this.projection};return this.request.send("database.queryDocument",n).then((function(t){if(t.code)e(0,t);else{var n=ne.formatResDocumentData(t.data.list);e(0,{data:n,requestId:t.requestId})}})).catch((function(t){e(t)})),e.promise},e.prototype.field=function(t){for(var n in t)t[n]?t[n]=1:t[n]=0;return new e(this._db,this._coll,this.id,t)},e}(),Le=function(){function e(){}return e.encode=function(e){return(new Me).encodeQuery(e)},e}(),Me=function(){function e(){}return e.prototype.encodeQuery=function(e,t){var n;return Ce(e)?le(e)?this.encodeLogicCommand(e):fe(e)?this.encodeQueryCommand(e):((n={})[t]=this.encodeQueryObject(e),n):M(e)?this.encodeQueryObject(e):e},e.prototype.encodeRegExp=function(e){return{$regex:e.source,$options:e.flags}},e.prototype.encodeLogicCommand=function(e){var t,n,r,o,i,a,s,c=this;switch(e.operator){case ae.NOR:case ae.AND:case ae.OR:var u=be(e.operator),l=e.operands.map((function(t){return c.encodeQuery(t,e.fieldName)}));return(t={})[u]=l,t;case ae.NOT:u=be(e.operator);var p=e.operands[0];return W(p)?((n={})[e.fieldName]=((r={})[u]=this.encodeRegExp(p),r),n):(l=this.encodeQuery(p)[e.fieldName],(o={})[e.fieldName]=((i={})[u]=l,i),o);default:if(u=be(e.operator),1===e.operands.length){var d=this.encodeQuery(e.operands[0]);return(a={})[u]=d,a}return l=e.operands.map(this.encodeQuery.bind(this)),(s={})[u]=l,s}},e.prototype.encodeQueryCommand=function(e){return me(e),this.encodeComparisonCommand(e)},e.prototype.encodeComparisonCommand=function(e){var t,n,r,o,i,a,s,c,u;if(e.fieldName===S)throw new Error("Cannot encode a comparison command with unset field name");var l=be(e.operator);switch(e.operator){case pe.EQ:case pe.NEQ:case pe.LT:case pe.LTE:case pe.GT:case pe.GTE:case pe.ELEM_MATCH:case pe.EXISTS:case pe.SIZE:case pe.MOD:return(t={})[e.fieldName]=((n={})[l]=Re(e.operands[0]),n),t;case pe.IN:case pe.NIN:case pe.ALL:return(r={})[e.fieldName]=((o={})[l]=Re(e.operands),o),r;case pe.GEO_NEAR:var p=e.operands[0];return(i={})[e.fieldName]={$nearSphere:{$geometry:p.geometry.toJSON(),$maxDistance:p.maxDistance,$minDistance:p.minDistance}},i;case pe.GEO_WITHIN:return p=e.operands[0],(a={})[e.fieldName]={$geoWithin:{$geometry:p.geometry.toJSON()}},a;case pe.GEO_INTERSECTS:return p=e.operands[0],(s={})[e.fieldName]={$geoIntersects:{$geometry:p.geometry.toJSON()}},s;default:return(c={})[e.fieldName]=((u={})[l]=Re(e.operands[0]),u),c}},e.prototype.encodeQueryObject=function(e){var t=Ae(e);for(var n in t){var r=t[n];if(le(r)){t[n]=r._setFieldName(n);var o=this.encodeLogicCommand(t[n]);this.mergeConditionAfterEncode(t,o,n)}else me(r)?(t[n]=r._setFieldName(n),o=this.encodeComparisonCommand(t[n]),this.mergeConditionAfterEncode(t,o,n)):Ce(r)&&(t[n]=Re(r))}return t},e.prototype.mergeConditionAfterEncode=function(e,t,n){for(var r in t[n]||delete e[n],t)e[r]?B(e[r])?e[r]=e[r].concat(t[r]):M(e[r])?M(t[r])?Object.assign(e,t):(console.warn("unmergable condition, query is object but condition is ".concat(L(t),", can only overwrite"),t,n),e[r]=t[r]):(console.warn("to-merge query is of type ".concat(L(e),", can only overwrite"),e,t,n),e[r]=t[r]):e[r]=t[r]},e}(),qe=function(){return qe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},qe.apply(this,arguments)},Be=function(){function e(e,t,n,r,o){var i=this;this.watch=function(e){return je(i._db).watch(qe(qe({},e),{envId:i._db.config.env,collectionName:i._coll,query:JSON.stringify(i._fieldFilters||{}),limit:i._queryOptions.limit,orderBy:i._fieldOrders?i._fieldOrders.reduce((function(e,t){return e[t.field]=t.direction,e}),{}):void 0}))},this._db=e,this._coll=t,this._fieldFilters=n,this._fieldOrders=r||[],this._queryOptions=o||{},this._request=vt.createRequest(this._db.config)}return e.prototype.get=function(e){e=e||ie();var t=[];this._fieldOrders&&this._fieldOrders.forEach((function(e){t.push(e)}));var n={collectionName:this._coll,queryType:s.WHERE};return this._fieldFilters&&(n.query=this._fieldFilters),t.length>0&&(n.order=t),this._queryOptions.offset&&(n.offset=this._queryOptions.offset),this._queryOptions.limit?n.limit=this._queryOptions.limit<1e3?this._queryOptions.limit:1e3:n.limit=100,this._queryOptions.projection&&(n.projection=this._queryOptions.projection),this._request.send("database.queryDocument",n).then((function(t){if(t.code)e(0,t);else{var n={data:ne.formatResDocumentData(t.data.list),requestId:t.requestId};void 0!==t.total&&(n.total=t.total),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.offset&&(n.offset=t.offset),e(0,n)}})).catch((function(t){e(t)})),e.promise},e.prototype.count=function(e){e=e||ie();var t={collectionName:this._coll,queryType:s.WHERE};return this._fieldFilters&&(t.query=this._fieldFilters),this._request.send("database.countDocument",t).then((function(t){t.code?e(0,t):e(0,{requestId:t.requestId,total:t.data.total})})).catch((function(t){e(t)})),e.promise},e.prototype.where=function(t){if("Object"!==Object.prototype.toString.call(t).slice(8,-1))throw Error(o.QueryParamTypeError);var n=Object.keys(t),r=n.some((function(e){return void 0!==t[e]}));if(n.length&&!r)throw Error(o.QueryParamValueError);return new e(this._db,this._coll,Le.encode(t),this._fieldOrders,this._queryOptions)},e.prototype.orderBy=function(t,n){re.isFieldPath(t),re.isFieldOrder(n);var r={field:t,direction:n},o=this._fieldOrders.concat(r);return new e(this._db,this._coll,this._fieldFilters,o,this._queryOptions)},e.prototype.limit=function(t){re.isInteger("limit",t);var n=qe({},this._queryOptions);return n.limit=t,new e(this._db,this._coll,this._fieldFilters,this._fieldOrders,n)},e.prototype.skip=function(t){re.isInteger("offset",t);var n=qe({},this._queryOptions);return n.offset=t,new e(this._db,this._coll,this._fieldFilters,this._fieldOrders,n)},e.prototype.update=function(e,t){if(t=t||ie(),!e||"object"!=typeof e)return Promise.resolve({code:"INVALID_PARAM",message:"参数必需是非空对象"});if(e.hasOwnProperty("_id"))return Promise.resolve({code:"INVALID_PARAM",message:"不能更新_id的值"});var n={collectionName:this._coll,query:this._fieldFilters,queryType:s.WHERE,multi:!0,merge:!0,upsert:!1,data:Ne.encode(e)};return this._request.send("database.updateDocument",n).then((function(e){e.code?t(0,e):t(0,{requestId:e.requestId,updated:e.data.updated,upsertId:e.data.upsert_id})})).catch((function(e){t(e)})),t.promise},e.prototype.field=function(t){for(var n in t)t[n]?"object"!=typeof t[n]&&(t[n]=1):t[n]=0;var r=qe({},this._queryOptions);return r.projection=t,new e(this._db,this._coll,this._fieldFilters,this._fieldOrders,r)},e.prototype.remove=function(e){e=e||ie(),Object.keys(this._queryOptions).length>0&&console.warn("`offset`, `limit` and `projection` are not supported in remove() operation"),this._fieldOrders.length>0&&console.warn("`orderBy` is not supported in remove() operation");var t={collectionName:this._coll,query:Le.encode(this._fieldFilters),queryType:s.WHERE,multi:!0};return this._request.send("database.deleteDocument",t).then((function(t){t.code?e(0,t):e(0,{requestId:t.requestId,deleted:t.data.deleted})})).catch((function(t){e(t)})),e.promise},e}(),Fe=n(2701),We=function(){function e(e,t){this._stages=[],e&&t&&(this._db=e,this._request=vt.createRequest(this._db.config),this._collectionName=t)}return e.prototype.end=function(){return e=this,t=void 0,r=function(){var e;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}(this,(function(t){switch(t.label){case 0:if(!this._collectionName||!this._db)throw new Error("Aggregation pipeline cannot send request");return[4,this._request.send("database.aggregate",{collectionName:this._collectionName,stages:this._stages})];case 1:return(e=t.sent())&&e.data&&e.data.list?[2,{requestId:e.requestId,data:JSON.parse(e.data.list).map(Fe.EJSON.parse)}]:[2,e]}}))},new((n=void 0)||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}));var e,t,n,r},e.prototype.unwrap=function(){return this._stages},e.prototype.done=function(){return this._stages.map((function(e){var t,n=e.stageKey,r=e.stageValue;return(t={})[n]=JSON.parse(r),t}))},e.prototype._pipe=function(e,t){return this._stages.push({stageKey:"$".concat(e),stageValue:JSON.stringify(t)}),this},e.prototype.addFields=function(e){return this._pipe("addFields",e)},e.prototype.bucket=function(e){return this._pipe("bucket",e)},e.prototype.bucketAuto=function(e){return this._pipe("bucketAuto",e)},e.prototype.count=function(e){return this._pipe("count",e)},e.prototype.geoNear=function(e){return e.query&&(e.query=Le.encode(e.query)),e.distanceMultiplier&&"number"==typeof e.distanceMultiplier&&(e.distanceMultiplier=e.distanceMultiplier),e.near&&(e.near=new oe(e.near.longitude,e.near.latitude).toJSON()),this._pipe("geoNear",e)},e.prototype.group=function(e){return this._pipe("group",e)},e.prototype.limit=function(e){return this._pipe("limit",e)},e.prototype.match=function(e){return this._pipe("match",Le.encode(e))},e.prototype.project=function(e){return this._pipe("project",e)},e.prototype.lookup=function(e){return this._pipe("lookup",e)},e.prototype.replaceRoot=function(e){return this._pipe("replaceRoot",e)},e.prototype.sample=function(e){return this._pipe("sample",e)},e.prototype.skip=function(e){return this._pipe("skip",e)},e.prototype.sort=function(e){return this._pipe("sort",e)},e.prototype.sortByCount=function(e){return this._pipe("sortByCount",e)},e.prototype.unwind=function(e){return this._pipe("unwind",e)},e}();const Ve=We;var Ge=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),He=function(e){function t(t,n){return e.call(this,t,n)||this}return Ge(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return this._coll},enumerable:!1,configurable:!0}),t.prototype.doc=function(e){if("string"!=typeof e&&"number"!=typeof e)throw new Error("docId必须为字符串或数字");return new Ue(this._db,this._coll,e)},t.prototype.add=function(e,t){return new Ue(this._db,this._coll,void 0).create(e,t)},t.prototype.aggregate=function(){return new Ve(this._db,this._coll)},t}(Be),ze={eq:function(e){return new he(pe.EQ,[e])},neq:function(e){return new he(pe.NEQ,[e])},lt:function(e){return new he(pe.LT,[e])},lte:function(e){return new he(pe.LTE,[e])},gt:function(e){return new he(pe.GT,[e])},gte:function(e){return new he(pe.GTE,[e])},in:function(e){return new he(pe.IN,e)},nin:function(e){return new he(pe.NIN,e)},all:function(e){return new he(pe.ALL,e)},elemMatch:function(e){return new he(pe.ELEM_MATCH,[e])},exists:function(e){return new he(pe.EXISTS,[e])},size:function(e){return new he(pe.SIZE,[e])},mod:function(e){return new he(pe.MOD,[e])},geoNear:function(e){return new he(pe.GEO_NEAR,[e])},geoWithin:function(e){return new he(pe.GEO_WITHIN,[e])},geoIntersects:function(e){return new he(pe.GEO_INTERSECTS,[e])},and:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=B(arguments[0])?arguments[0]:Array.from(arguments);return new ue(ae.AND,n)},nor:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=B(arguments[0])?arguments[0]:Array.from(arguments);return new ue(ae.NOR,n)},or:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=B(arguments[0])?arguments[0]:Array.from(arguments);return new ue(ae.OR,n)},not:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=B(arguments[0])?arguments[0]:Array.from(arguments);return new ue(ae.NOT,n)},set:function(e){return new se(ee.SET,[e])},remove:function(){return new se(ee.REMOVE,[])},inc:function(e){return new se(ee.INC,[e])},mul:function(e){return new se(ee.MUL,[e])},push:function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(M(t[0])&&t[0].hasOwnProperty("each")){var r=t[0];e={$each:r.each,$position:r.position,$sort:r.sort,$slice:r.slice}}else e=B(t[0])?t[0]:Array.from(t);return new se(ee.PUSH,e)},pull:function(e){return new se(ee.PULL,e)},pullAll:function(e){return new se(ee.PULL_ALL,e)},pop:function(){return new se(ee.POP,[])},shift:function(){return new se(ee.SHIFT,[])},unshift:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=B(arguments[0])?arguments[0]:Array.from(arguments);return new se(ee.UNSHIFT,n)},addToSet:function(e){return new se(ee.ADD_TO_SET,e)},rename:function(e){return new se(ee.RENAME,[e])},bit:function(e){return new se(ee.BIT,[e])},max:function(e){return new se(ee.MAX,[e])},min:function(e){return new se(ee.MIN,[e])},expr:function(e){return{$expr:e}},jsonSchema:function(e){return{$jsonSchema:e}},text:function(e){return"string"===L(e)?{$search:e.search}:{$search:e.search,$language:e.language,$caseSensitive:e.caseSensitive,$diacriticSensitive:e.diacriticSensitive}},aggregate:{pipeline:function(){return new Ve},abs:function(e){return new Ke("abs",e)},add:function(e){return new Ke("add",e)},ceil:function(e){return new Ke("ceil",e)},divide:function(e){return new Ke("divide",e)},exp:function(e){return new Ke("exp",e)},floor:function(e){return new Ke("floor",e)},ln:function(e){return new Ke("ln",e)},log:function(e){return new Ke("log",e)},log10:function(e){return new Ke("log10",e)},mod:function(e){return new Ke("mod",e)},multiply:function(e){return new Ke("multiply",e)},pow:function(e){return new Ke("pow",e)},sqrt:function(e){return new Ke("sqrt",e)},subtract:function(e){return new Ke("subtract",e)},trunc:function(e){return new Ke("trunc",e)},arrayElemAt:function(e){return new Ke("arrayElemAt",e)},arrayToObject:function(e){return new Ke("arrayToObject",e)},concatArrays:function(e){return new Ke("concatArrays",e)},filter:function(e){return new Ke("filter",e)},in:function(e){return new Ke("in",e)},indexOfArray:function(e){return new Ke("indexOfArray",e)},isArray:function(e){return new Ke("isArray",e)},map:function(e){return new Ke("map",e)},range:function(e){return new Ke("range",e)},reduce:function(e){return new Ke("reduce",e)},reverseArray:function(e){return new Ke("reverseArray",e)},size:function(e){return new Ke("size",e)},slice:function(e){return new Ke("slice",e)},zip:function(e){return new Ke("zip",e)},and:function(e){return new Ke("and",e)},not:function(e){return new Ke("not",e)},or:function(e){return new Ke("or",e)},cmp:function(e){return new Ke("cmp",e)},eq:function(e){return new Ke("eq",e)},gt:function(e){return new Ke("gt",e)},gte:function(e){return new Ke("gte",e)},lt:function(e){return new Ke("lt",e)},lte:function(e){return new Ke("lte",e)},neq:function(e){return new Ke("ne",e)},cond:function(e){return new Ke("cond",e)},ifNull:function(e){return new Ke("ifNull",e)},switch:function(e){return new Ke("switch",e)},dateFromParts:function(e){return new Ke("dateFromParts",e)},dateFromString:function(e){return new Ke("dateFromString",e)},dayOfMonth:function(e){return new Ke("dayOfMonth",e)},dayOfWeek:function(e){return new Ke("dayOfWeek",e)},dayOfYear:function(e){return new Ke("dayOfYear",e)},isoDayOfWeek:function(e){return new Ke("isoDayOfWeek",e)},isoWeek:function(e){return new Ke("isoWeek",e)},isoWeekYear:function(e){return new Ke("isoWeekYear",e)},millisecond:function(e){return new Ke("millisecond",e)},minute:function(e){return new Ke("minute",e)},month:function(e){return new Ke("month",e)},second:function(e){return new Ke("second",e)},hour:function(e){return new Ke("hour",e)},week:function(e){return new Ke("week",e)},year:function(e){return new Ke("year",e)},literal:function(e){return new Ke("literal",e)},mergeObjects:function(e){return new Ke("mergeObjects",e)},objectToArray:function(e){return new Ke("objectToArray",e)},allElementsTrue:function(e){return new Ke("allElementsTrue",e)},anyElementTrue:function(e){return new Ke("anyElementTrue",e)},setDifference:function(e){return new Ke("setDifference",e)},setEquals:function(e){return new Ke("setEquals",e)},setIntersection:function(e){return new Ke("setIntersection",e)},setIsSubset:function(e){return new Ke("setIsSubset",e)},setUnion:function(e){return new Ke("setUnion",e)},concat:function(e){return new Ke("concat",e)},dateToString:function(e){return new Ke("dateToString",e)},indexOfBytes:function(e){return new Ke("indexOfBytes",e)},indexOfCP:function(e){return new Ke("indexOfCP",e)},split:function(e){return new Ke("split",e)},strLenBytes:function(e){return new Ke("strLenBytes",e)},strLenCP:function(e){return new Ke("strLenCP",e)},strcasecmp:function(e){return new Ke("strcasecmp",e)},substr:function(e){return new Ke("substr",e)},substrBytes:function(e){return new Ke("substrBytes",e)},substrCP:function(e){return new Ke("substrCP",e)},toLower:function(e){return new Ke("toLower",e)},toUpper:function(e){return new Ke("toUpper",e)},meta:function(e){return new Ke("meta",e)},addToSet:function(e){return new Ke("addToSet",e)},avg:function(e){return new Ke("avg",e)},first:function(e){return new Ke("first",e)},last:function(e){return new Ke("last",e)},max:function(e){return new Ke("max",e)},min:function(e){return new Ke("min",e)},push:function(e){return new Ke("push",e)},stdDevPop:function(e){return new Ke("stdDevPop",e)},stdDevSamp:function(e){return new Ke("stdDevSamp",e)},sum:function(e){return new Ke("sum",e)},let:function(e){return new Ke("let",e)}},project:{slice:function(e){return new Ye("slice",e)},elemMatch:function(e){return new Ye("elemMatch",e)}}},Ke=function(e,t){this["$"+e]=t},Ye=function(e,t){this["$"+e]=t},Je=function(){function e(e){var t=e.regexp,n=e.options;if(!t)throw new TypeError("regexp must be a string");this.$regex=t,this.$options=n}return e.prototype.parse=function(){return{$regex:this.$regex,$options:this.$options}},Object.defineProperty(e.prototype,"_internalType",{get:function(){return U},enumerable:!1,configurable:!0}),e}();function Qe(e){return new Je(e)}var $e="insert document failed",Xe="DATABASE_TRANSACTION_CONFLICT",Ze=function(){return Ze=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ze.apply(this,arguments)},et=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},tt=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},nt="database.updateDocInTransaction",rt=function(){function e(e,t,n){this._coll=t,this.id=n,this._transaction=e,this._request=this._transaction.getRequestMethod(),this._transactionId=this._transaction.getTransactionId()}return e.prototype.create=function(e){return et(this,void 0,void 0,(function(){var t,n,r,o;return tt(this,(function(i){switch(i.label){case 0:return t={collectionName:this._coll,transactionId:this._transactionId,data:Fe.EJSON.stringify(we(e),{relaxed:!1})},this.id&&(t._id=this.id),[4,this._request.send("database.insertDocInTransaction",t)];case 1:if((n=i.sent()).code)throw n;if(r=Fe.EJSON.parse(n.inserted),1==(o=Fe.EJSON.parse(n.ok))&&1==r)return[2,Ze(Ze({},n),{ok:o,inserted:r})];throw new Error($e)}}))}))},e.prototype.get=function(){return et(this,void 0,void 0,(function(){var e,t;return tt(this,(function(n){switch(n.label){case 0:return e={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}}},[4,this._request.send("database.getInTransaction",e)];case 1:if((t=n.sent()).code)throw t;return[2,{data:"null"!==t.data?ne.formatField(Fe.EJSON.parse(t.data)):Fe.EJSON.parse(t.data),requestId:t.requestId}]}}))}))},e.prototype.set=function(e){return et(this,void 0,void 0,(function(){var t,n;return tt(this,(function(r){switch(r.label){case 0:return t={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}},data:Fe.EJSON.stringify(we(e),{relaxed:!1}),upsert:!0},[4,this._request.send(nt,t)];case 1:if((n=r.sent()).code)throw n;return[2,Ze(Ze({},n),{updated:Fe.EJSON.parse(n.updated),upserted:n.upserted?JSON.parse(n.upserted):null})]}}))}))},e.prototype.update=function(e){return et(this,void 0,void 0,(function(){var t,n;return tt(this,(function(r){switch(r.label){case 0:return t={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}},data:Fe.EJSON.stringify(Ne.encode(e),{relaxed:!1})},[4,this._request.send(nt,t)];case 1:if((n=r.sent()).code)throw n;return[2,Ze(Ze({},n),{updated:Fe.EJSON.parse(n.updated)})]}}))}))},e.prototype.delete=function(){return et(this,void 0,void 0,(function(){var e,t;return tt(this,(function(n){switch(n.label){case 0:return e={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}}},[4,this._request.send("database.deleteDocInTransaction",e)];case 1:if((t=n.sent()).code)throw t;return[2,Ze(Ze({},t),{deleted:Fe.EJSON.parse(t.deleted)})]}}))}))},e}(),ot=function(){return ot=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ot.apply(this,arguments)},it=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},at=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},st="database.getInTransaction",ct=function(){function e(e,t,n,r,o){this._coll=t,this._transaction=e,this._fieldFilters=n,this._fieldOrders=r||[],this._queryOptions=o||{},this._request=this._transaction.getRequestMethod(),this._transactionId=this._transaction.getTransactionId()}return e.prototype.where=function(t){if("Object"!==Object.prototype.toString.call(t).slice(8,-1))throw Error(o.QueryParamTypeError);var n=Object.keys(t),r=n.some((function(e){return void 0!==t[e]}));if(n.length&&!r)throw Error(o.QueryParamValueError);return new e(this._transaction,this._coll,Le.encode(t),this._fieldOrders,this._queryOptions)},e.prototype.orderBy=function(t,n){re.isFieldPath(t),re.isFieldOrder(n);var r={field:t,direction:n},o=this._fieldOrders.concat(r);return new e(this._transaction,this._coll,this._fieldFilters,o,this._queryOptions)},e.prototype.limit=function(t){re.isInteger("limit",t);var n=ot({},this._queryOptions);return n.limit=t,new e(this._transaction,this._coll,this._fieldFilters,this._fieldOrders,n)},e.prototype.skip=function(t){re.isInteger("offset",t);var n=ot({},this._queryOptions);return n.offset=t,new e(this._transaction,this._coll,this._fieldFilters,this._fieldOrders,n)},e.prototype.field=function(t){for(var n in t)t[n]?"object"!=typeof t[n]&&(t[n]=1):t[n]=0;var r=ot({},this._queryOptions);return r.projection=t,new e(this._transaction,this._coll,this._fieldFilters,this._fieldOrders,r)},e.prototype.get=function(){return it(this,void 0,void 0,(function(){var e,t,n,r,o,i;return at(this,(function(a){switch(a.label){case 0:return e=[],this._fieldOrders&&this._fieldOrders.forEach((function(t){e.push(t)})),t={collectionName:this._coll,transactionId:this._transactionId},this._fieldFilters&&(t.query=this._fieldFilters),e.length>0&&(t.order=e),this._queryOptions.offset&&(t.offset=this._queryOptions.offset),this._queryOptions.limit?t.limit=this._queryOptions.limit<1e3?this._queryOptions.limit:1e3:t.limit=100,this._queryOptions.projection&&(t.projection=this._queryOptions.projection),[4,this._request.send(st,t)];case 1:if((n=a.sent()).code)throw n;return r="null"!==n.data?Fe.EJSON.parse(n.data):null,o=r?Array.isArray(r)?ne.formatResDocumentData(r):[ne.formatField(r)]:[],i={data:o,requestId:n.requestId},void 0!==n.total&&(i.total=n.total),void 0!==n.limit&&(i.limit=n.limit),void 0!==n.offset&&(i.offset=n.offset),[2,i]}}))}))},e.prototype.count=function(){return it(this,void 0,void 0,(function(){var e,t,n,r;return at(this,(function(o){switch(o.label){case 0:return e={collectionName:this._coll,transactionId:this._transactionId},this._fieldFilters&&(e.query=this._fieldFilters),[4,this._request.send(st,e)];case 1:if((t=o.sent()).code)throw t;return n="null"!==t.data?Fe.EJSON.parse(t.data):null,r=Array.isArray(n)?n.length:n?1:0,[2,{requestId:t.requestId,total:void 0!==t.total?t.total:r}]}}))}))},e.prototype.update=function(e){return it(this,void 0,void 0,(function(){var t,n;return at(this,(function(r){switch(r.label){case 0:if(!e||"object"!=typeof e)throw new Error("参数必需是非空对象");if(e.hasOwnProperty("_id"))throw new Error("不能更新_id的值");return t={collectionName:this._coll,transactionId:this._transactionId,query:this._fieldFilters,data:Fe.EJSON.stringify(Ne.encode(e),{relaxed:!1})},[4,this._request.send("database.updateDocInTransaction",t)];case 1:if((n=r.sent()).code)throw n;return[2,ot(ot({},n),{updated:Fe.EJSON.parse(n.updated)})]}}))}))},e.prototype.remove=function(){return it(this,void 0,void 0,(function(){var e,t;return at(this,(function(n){switch(n.label){case 0:return Object.keys(this._queryOptions).length>0&&console.warn("`offset`, `limit` and `projection` are not supported in remove() operation"),this._fieldOrders.length>0&&console.warn("`orderBy` is not supported in remove() operation"),e={collectionName:this._coll,transactionId:this._transactionId,query:this._fieldFilters},[4,this._request.send("database.deleteDocInTransaction",e)];case 1:if((t=n.sent()).code)throw t;return[2,ot(ot({},t),{deleted:Fe.EJSON.parse(t.deleted)})]}}))}))},e}(),ut=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),lt=function(e){function t(t,n){return e.call(this,t,n)||this}return ut(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return this._coll},enumerable:!1,configurable:!0}),t.prototype.doc=function(e){if("string"!=typeof e&&"number"!=typeof e)throw new Error("docId必须为字符串或数字");return new rt(this._transaction,this._coll,e)},t.prototype.add=function(e){var t;return void 0!==e._id&&(t=e._id),new rt(this._transaction,this._coll,t).create(e)},t}(ct),pt=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},dt=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},ht=function(){function e(e){this._db=e,this._request=vt.createRequest(this._db.config),this.aborted=!1,this.commited=!1,this.inited=!1}return e.prototype.init=function(){return pt(this,void 0,void 0,(function(){var e;return dt(this,(function(t){switch(t.label){case 0:return[4,this._request.send("database.startTransaction")];case 1:if((e=t.sent()).code)throw e;return this.inited=!0,this._id=e.transactionId,[2]}}))}))},e.prototype.collection=function(e){if(!e)throw new Error("Collection name is required");return new lt(this,e)},e.prototype.getTransactionId=function(){return this._id},e.prototype.getRequestMethod=function(){return this._request},e.prototype.commit=function(){return pt(this,void 0,void 0,(function(){var e,t;return dt(this,(function(n){switch(n.label){case 0:return e={transactionId:this._id},[4,this._request.send("database.commitTransaction",e)];case 1:if((t=n.sent()).code)throw t;return this.commited=!0,[2,t]}}))}))},e.prototype.rollback=function(e){return pt(this,void 0,void 0,(function(){var t,n;return dt(this,(function(r){switch(r.label){case 0:return t={transactionId:this._id},[4,this._request.send("database.abortTransaction",t)];case 1:if((n=r.sent()).code)throw n;return this.aborted=!0,this.abortReason=e,[2,n]}}))}))},e}();function ft(){return pt(this,void 0,void 0,(function(){var e;return dt(this,(function(t){switch(t.label){case 0:return[4,(e=new ht(this)).init()];case 1:return t.sent(),[2,e]}}))}))}function mt(e,t){return void 0===t&&(t=3),pt(this,void 0,void 0,(function(){var n,r,o,i,a=this;return dt(this,(function(s){switch(s.label){case 0:return s.trys.push([0,4,,10]),[4,(n=new ht(this)).init()];case 1:return s.sent(),[4,e(n)];case 2:if(r=s.sent(),!0===n.aborted)throw n.abortReason;return[4,n.commit()];case 3:return s.sent(),[2,r];case 4:if(o=s.sent(),!1===n.inited)throw o;return i=function(e){return pt(a,void 0,void 0,(function(){return dt(this,(function(t){switch(t.label){case 0:if(n.aborted||n.commited)return[3,5];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,n.rollback()];case 2:case 3:return t.sent(),[3,4];case 4:throw e;case 5:if(!0===n.aborted)throw n.abortReason;throw e}}))}))},t<=0?[4,i(o)]:[3,6];case 5:s.sent(),s.label=6;case 6:return o&&o.code===Xe?[4,mt.bind(this)(e,--t)]:[3,8];case 7:return[2,s.sent()];case 8:return[4,i(o)];case 9:return s.sent(),[3,10];case 10:return[2]}}))}))}var vt=function(){function e(e){this.config=e,this.Geo=i,this.serverDate=Z,this.command=ze,this.RegExp=Qe,this.startTransaction=ft,this.runTransaction=mt,this.logicCommand=ue,this.updateCommand=se,this.queryCommand=he}return e.createRequest=function(t){var n=new e.reqClass(t),r=n.send;return n.send=function(e,n){return t.instance&&(n.instance=t.instance),t.database&&(n.database=t.database),r.call(this,e,n)},n},e.prototype.collection=function(e){if(!e)throw new Error("Collection name is required");return new He(this,e)},e.prototype.createCollection=function(t){var n={collectionName:t};return e.createRequest(this.config).send("database.addCollection",n)},e}()},3388:e=>{e.exports={}},1012:(e,t,n)=>{"use strict";var r;if(n.r(t),n.d(t,{default:()=>L}),!globalThis.IS_MP_BUILD){var o="undefined"!=typeof globalThis?globalThis.navigator:window.globalThis,i="0123456789abcdefghijklmnopqrstuvwxyz";function M(e){return i.charAt(e)}function q(e,t){return e&t}function B(e,t){return e|t}function F(e,t){return e^t}function W(e,t){return e&~t}function V(e){if(0==e)return-1;var t=0;return 65535&e||(e>>=16,t+=16),255&e||(e>>=8,t+=8),15&e||(e>>=4,t+=4),3&e||(e>>=2,t+=2),1&e||++t,t}function G(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function H(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=a.charAt(n>>6)+a.charAt(63&n);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=a.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=a.charAt(n>>2)+a.charAt((3&n)<<4));(3&r.length)>0;)r+="=";return r}function z(e){var t,n="",r=0,o=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t){var i=a.indexOf(e.charAt(t));i<0||(0==r?(n+=M(i>>2),o=3&i,r=1):1==r?(n+=M(o<<2|i>>4),o=15&i,r=2):2==r?(n+=M(o),n+=M(i>>2),o=3&i,r=3):(n+=M(o<<2|i>>4),n+=M(15&i),r=0))}return 1==r&&(n+=M(o<<2)),n}var s,c,u={decode:function(e){var t;if(void 0===s){var n="0123456789ABCDEF";for(s={},t=0;t<16;++t)s[n.charAt(t)]=t;for(n=n.toLowerCase(),t=10;t<16;++t)s[n.charAt(t)]=t;for(t=0;t<8;++t)s[" \f\n\r\t \u2028\u2029".charAt(t)]=-1}var r=[],o=0,i=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if("="==a)break;if(-1!=(a=s[a])){if(void 0===a)throw new Error("Illegal character at offset "+t);o|=a,++i>=2?(r[r.length]=o,o=0,i=0):o<<=4}}if(i)throw new Error("Hex encoding incomplete: 4 bits missing");return r}},l={decode:function(e){var t;if(void 0===c){for(c=Object.create(null),t=0;t<64;++t)c["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(t=0;t<9;++t)c["= \f\n\r\t \u2028\u2029".charAt(t)]=-1}var n=[],r=0,o=0;for(t=0;t<e.length;++t){var i=e.charAt(t);if("="==i)break;if(-1!=(i=c[i])){if(void 0===i)throw new Error("Illegal character at offset "+t);r|=i,++o>=4?(n[n.length]=r>>16,n[n.length]=r>>8&255,n[n.length]=255&r,r=0,o=0):r<<=6}}switch(o){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=r>>10;break;case 3:n[n.length]=r>>16,n[n.length]=r>>8&255}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(e){var t=l.re.exec(e);if(t)if(t[1])e=t[1];else{if(!t[2])throw new Error("RegExp out of sync");e=t[2]}return l.decode(e)}},p=1e13;class K{constructor(e){this.buf=[+e||0]}mulAdd(e,t){var n,r,o=this.buf,i=o.length;for(n=0;n<i;++n)(r=o[n]*e+t)<p?t=0:r-=(t=0|r/p)*p,o[n]=r;t>0&&(o[n]=t)}sub(e){var t,n,r=this.buf,o=r.length;for(t=0;t<o;++t)(n=r[t]-e)<0?(n+=p,e=1):e=0,r[t]=n;for(;0===r[r.length-1];)r.pop()}toString(e){if(10!=(e||10))throw new Error("only base 10 is supported");for(var t=this.buf,n=t[t.length-1].toString(),r=t.length-2;r>=0;--r)n+=(p+t[r]).toString().substring(1);return n}valueOf(){for(var e=this.buf,t=0,n=e.length-1;n>=0;--n)t=t*p+e[n];return t}simplify(){var e=this.buf;return 1==e.length?e[0]:this}}var d,h=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,f=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function Y(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}class J{constructor(e,t){this.hexDigits="0123456789ABCDEF",e instanceof J?(this.enc=e.enc,this.pos=e.pos):(this.enc=e,this.pos=t)}get(e){if(void 0===e&&(e=this.pos++),e>=this.enc.length)throw new Error("Requesting byte offset "+e+" on a stream of length "+this.enc.length);return"string"==typeof this.enc?this.enc.charCodeAt(e):this.enc[e]}hexByte(e){return this.hexDigits.charAt(e>>4&15)+this.hexDigits.charAt(15&e)}hexDump(e,t,n){for(var r="",o=e;o<t;++o)if(r+=this.hexByte(this.get(o)),!0!==n)switch(15&o){case 7:r+=" ";break;case 15:r+="\n";break;default:r+=" "}return r}isASCII(e,t){for(var n=e;n<t;++n){var r=this.get(n);if(r<32||r>176)return!1}return!0}parseStringISO(e,t){for(var n="",r=e;r<t;++r)n+=String.fromCharCode(this.get(r));return n}parseStringUTF(e,t){for(var n="",r=e;r<t;){var o=this.get(r++);n+=o<128?String.fromCharCode(o):o>191&&o<224?String.fromCharCode((31&o)<<6|63&this.get(r++)):String.fromCharCode((15&o)<<12|(63&this.get(r++))<<6|63&this.get(r++))}return n}parseStringBMP(e,t){for(var n,r,o="",i=e;i<t;)n=this.get(i++),r=this.get(i++),o+=String.fromCharCode(n<<8|r);return o}parseTime(e,t,n){var r=this.parseStringISO(e,t),o=(n?h:f).exec(r);return o?(n&&(o[1]=+o[1],o[1]+=+o[1]<70?2e3:1900),r=o[1]+"-"+o[2]+"-"+o[3]+" "+o[4],o[5]&&(r+=":"+o[5],o[6]&&(r+=":"+o[6],o[7]&&(r+="."+o[7]))),o[8]&&(r+=" UTC","Z"!=o[8]&&(r+=o[8],o[9]&&(r+=":"+o[9]))),r):"Unrecognized time: "+r}parseInteger(e,t){for(var n,r=this.get(e),o=r>127,i=o?255:0,a="";r==i&&++e<t;)r=this.get(e);if(0==(n=t-e))return o?-1:0;if(n>4){for(a=r,n<<=3;!(128&(+a^i));)a=+a<<1,--n;a="("+n+" bit)\n"}o&&(r-=256);for(var s=new K(r),c=e+1;c<t;++c)s.mulAdd(256,this.get(c));return a+s.toString()}parseBitString(e,t,n){for(var r=this.get(e),o="("+((t-e-1<<3)-r)+" bit)\n",i="",a=e+1;a<t;++a){for(var s=this.get(a),c=a==t-1?r:0,u=7;u>=c;--u)i+=s>>u&1?"1":"0";if(i.length>n)return o+Y(i,n)}return o+i}parseOctetString(e,t,n){if(this.isASCII(e,t))return Y(this.parseStringISO(e,t),n);var r=t-e,o="("+r+" byte)\n";r>(n/=2)&&(t=e+n);for(var i=e;i<t;++i)o+=this.hexByte(this.get(i));return r>n&&(o+="…"),o}parseOID(e,t,n){for(var r="",o=new K,i=0,a=e;a<t;++a){var s=this.get(a);if(o.mulAdd(128,127&s),i+=7,!(128&s)){if(""===r)if((o=o.simplify())instanceof K)o.sub(80),r="2."+o.toString();else{var c=o<80?o<40?0:1:2;r=c+"."+(o-40*c)}else r+="."+o.toString();if(r.length>n)return Y(r,n);o=new K,i=0}}return i>0&&(r+=".incomplete"),r}}class Q{constructor(e,t,n,r,o){if(!(r instanceof $))throw new Error("Invalid tag value.");this.stream=e,this.header=t,this.length=n,this.tag=r,this.sub=o}typeName(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}}content(e){if(void 0===this.tag)return null;void 0===e&&(e=1/0);var t=this.posContent(),n=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+n,e);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(t)?"false":"true";case 2:return this.stream.parseInteger(t,t+n);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(t,t+n,e);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+n,e);case 6:return this.stream.parseOID(t,t+n,e);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return Y(this.stream.parseStringUTF(t,t+n),e);case 18:case 19:case 20:case 21:case 22:case 26:return Y(this.stream.parseStringISO(t,t+n),e);case 30:return Y(this.stream.parseStringBMP(t,t+n),e);case 23:case 24:return this.stream.parseTime(t,t+n,23==this.tag.tagNumber)}return null}toString(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"}toPrettyString(e){void 0===e&&(e="");var t=e+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(t+="+"),t+=this.length,this.tag.tagConstructed?t+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(t+=" (encapsulates)"),t+="\n",null!==this.sub){e+=" ";for(var n=0,r=this.sub.length;n<r;++n)t+=this.sub[n].toPrettyString(e)}return t}posStart(){return this.stream.pos}posContent(){return this.stream.pos+this.header}posEnd(){return this.stream.pos+this.header+Math.abs(this.length)}toHexString(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)}static decodeLength(e){var t=e.get(),n=127&t;if(n==t)return n;if(n>6)throw new Error("Length over 48 bits not supported at position "+(e.pos-1));if(0===n)return null;t=0;for(var r=0;r<n;++r)t=256*t+e.get();return t}getHexStringValue(){var e=this.toHexString(),t=2*this.header,n=2*this.length;return e.substr(t,n)}static decode(e){var t;t=e instanceof J?e:new J(e,0);var n=new J(t),r=new $(t),o=Q.decodeLength(t),i=t.pos,a=i-n.pos,s=null,c=function(){var e=[];if(null!==o){for(var n=i+o;t.pos<n;)e[e.length]=Q.decode(t);if(t.pos!=n)throw new Error("Content size is not correct for container starting at offset "+i)}else try{for(;;){var r=Q.decode(t);if(r.tag.isEOC())break;e[e.length]=r}o=i-t.pos}catch(e){throw new Error("Exception while decoding undefined length content: "+e)}return e};if(r.tagConstructed)s=c();else if(r.isUniversal()&&(3==r.tagNumber||4==r.tagNumber))try{if(3==r.tagNumber&&0!=t.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");s=c();for(var u=0;u<s.length;++u)if(s[u].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(e){s=null}if(null===s){if(null===o)throw new Error("We can't skip over an invalid tag with undefined length at offset "+i);t.pos=i+Math.abs(o)}return new Q(n,a,o,r,s)}}class ${constructor(e){var t=e.get();if(this.tagClass=t>>6,this.tagConstructed=!!(32&t),this.tagNumber=31&t,31==this.tagNumber){var n=new K;do{t=e.get(),n.mulAdd(128,127&t)}while(128&t);this.tagNumber=n.simplify()}}isUniversal(){return 0===this.tagClass}isEOC(){return 0===this.tagClass&&0===this.tagNumber}}var m=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],v=(1<<26)/m[m.length-1];class X{constructor(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}toString(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var n,r=(1<<t)-1,o=!1,i="",a=this.t,s=this.DB-a*this.DB%t;if(a-- >0)for(s<this.DB&&(n=this[a]>>s)>0&&(o=!0,i=M(n));a>=0;)s<t?(n=(this[a]&(1<<s)-1)<<t-s,n|=this[--a]>>(s+=this.DB-t)):(n=this[a]>>(s-=t)&r,s<=0&&(s+=this.DB,--a)),n>0&&(o=!0),o&&(i+=M(n));return o?i:"0"}negate(){var e=Z();return X.ZERO.subTo(this,e),e}abs(){return this.s<0?this.negate():this}compareTo(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0}bitLength(){return this.t<=0?0:this.DB*(this.t-1)+ae(this[this.t-1]^this.s&this.DM)}mod(e){var t=Z();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(X.ZERO)>0&&e.subTo(t,t),t}modPowInt(e,t){var n;return n=e<256||t.isEven()?new b(t):new y(t),this.exp(e,n)}clone(){var e=Z();return this.copyTo(e),e}intValue(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}byteValue(){return 0==this.t?this.s:this[0]<<24>>24}shortValue(){return 0==this.t?this.s:this[0]<<16>>16}signum(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}toByteArray(){var e=this.t,t=[];t[0]=this.s;var n,r=this.DB-e*this.DB%8,o=0;if(e-- >0)for(r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[o++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),128&n&&(n|=-256),0==o&&(128&this.s)!=(128&n)&&++o,(o>0||n!=this.s)&&(t[o++]=n);return t}equals(e){return 0==this.compareTo(e)}min(e){return this.compareTo(e)<0?this:e}max(e){return this.compareTo(e)>0?this:e}and(e){var t=Z();return this.bitwiseTo(e,q,t),t}or(e){var t=Z();return this.bitwiseTo(e,B,t),t}xor(e){var t=Z();return this.bitwiseTo(e,F,t),t}andNot(e){var t=Z();return this.bitwiseTo(e,W,t),t}not(){for(var e=Z(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e}shiftLeft(e){var t=Z();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}shiftRight(e){var t=Z();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}getLowestSetBit(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+V(this[e]);return this.s<0?this.t*this.DB:-1}bitCount(){for(var e=0,t=this.s&this.DM,n=0;n<this.t;++n)e+=G(this[n]^t);return e}testBit(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:!!(this[t]&1<<e%this.DB)}setBit(e){return this.changeBit(e,B)}clearBit(e){return this.changeBit(e,W)}flipBit(e){return this.changeBit(e,F)}add(e){var t=Z();return this.addTo(e,t),t}subtract(e){var t=Z();return this.subTo(e,t),t}multiply(e){var t=Z();return this.multiplyTo(e,t),t}divide(e){var t=Z();return this.divRemTo(e,t,null),t}remainder(e){var t=Z();return this.divRemTo(e,null,t),t}divideAndRemainder(e){var t=Z(),n=Z();return this.divRemTo(e,t,n),[t,n]}modPow(e,t){var n,r,o=e.bitLength(),i=ie(1);if(o<=0)return i;n=o<18?1:o<48?3:o<144?4:o<768?5:6,r=o<8?new b(t):t.isEven()?new _(t):new y(t);var a=[],s=3,c=n-1,u=(1<<n)-1;if(a[1]=r.convert(this),n>1){var l=Z();for(r.sqrTo(a[1],l);s<=u;)a[s]=Z(),r.mulTo(l,a[s-2],a[s]),s+=2}var p,d,h=e.t-1,f=!0,m=Z();for(o=ae(e[h])-1;h>=0;){for(o>=c?p=e[h]>>o-c&u:(p=(e[h]&(1<<o+1)-1)<<c-o,h>0&&(p|=e[h-1]>>this.DB+o-c)),s=n;!(1&p);)p>>=1,--s;if((o-=s)<0&&(o+=this.DB,--h),f)a[p].copyTo(i),f=!1;else{for(;s>1;)r.sqrTo(i,m),r.sqrTo(m,i),s-=2;s>0?r.sqrTo(i,m):(d=i,i=m,m=d),r.mulTo(m,a[p],i)}for(;h>=0&&!(e[h]&1<<o);)r.sqrTo(i,m),d=i,i=m,m=d,--o<0&&(o=this.DB-1,--h)}return r.revert(i)}modInverse(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return X.ZERO;for(var n=e.clone(),r=this.clone(),o=ie(1),i=ie(0),a=ie(0),s=ie(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),t?(o.isEven()&&i.isEven()||(o.addTo(this,o),i.subTo(e,i)),o.rShiftTo(1,o)):i.isEven()||i.subTo(e,i),i.rShiftTo(1,i);for(;r.isEven();)r.rShiftTo(1,r),t?(a.isEven()&&s.isEven()||(a.addTo(this,a),s.subTo(e,s)),a.rShiftTo(1,a)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);n.compareTo(r)>=0?(n.subTo(r,n),t&&o.subTo(a,o),i.subTo(s,i)):(r.subTo(n,r),t&&a.subTo(o,a),s.subTo(i,s))}return 0!=r.compareTo(X.ONE)?X.ZERO:s.compareTo(e)>=0?s.subtract(e):s.signum()<0?(s.addTo(e,s),s.signum()<0?s.add(e):s):s}pow(e){return this.exp(e,new g)}gcd(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var o=t.getLowestSetBit(),i=n.getLowestSetBit();if(i<0)return t;for(o<i&&(i=o),i>0&&(t.rShiftTo(i,t),n.rShiftTo(i,n));t.signum()>0;)(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return i>0&&n.lShiftTo(i,n),n}isProbablePrime(e){var t,n=this.abs();if(1==n.t&&n[0]<=m[m.length-1]){for(t=0;t<m.length;++t)if(n[0]==m[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<m.length;){for(var r=m[t],o=t+1;o<m.length&&r<v;)r*=m[o++];for(r=n.modInt(r);t<o;)if(r%m[t++]==0)return!1}return n.millerRabin(e)}copyTo(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}fromInt(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}fromString(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(256==t)n=8;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)return void this.fromRadix(e,t);n=2}this.t=0,this.s=0;for(var r=e.length,o=!1,i=0;--r>=0;){var a=8==n?255&+e[r]:oe(e,r);a<0?"-"==e.charAt(r)&&(o=!0):(o=!1,0==i?this[this.t++]=a:i+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-i)-1)<<i,this[this.t++]=a>>this.DB-i):this[this.t-1]|=a<<i,(i+=n)>=this.DB&&(i-=this.DB))}8==n&&128&+e[0]&&(this.s=-1,i>0&&(this[this.t-1]|=(1<<this.DB-i)-1<<i)),this.clamp(),o&&X.ZERO.subTo(this,this)}clamp(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}dlShiftTo(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s}drShiftTo(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s}lShiftTo(e,t){for(var n=e%this.DB,r=this.DB-n,o=(1<<r)-1,i=Math.floor(e/this.DB),a=this.s<<n&this.DM,s=this.t-1;s>=0;--s)t[s+i+1]=this[s]>>r|a,a=(this[s]&o)<<n;for(s=i-1;s>=0;--s)t[s]=0;t[i]=a,t.t=this.t+i+1,t.s=this.s,t.clamp()}rShiftTo(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,o=this.DB-r,i=(1<<r)-1;t[0]=this[n]>>r;for(var a=n+1;a<this.t;++a)t[a-n-1]|=(this[a]&i)<<o,t[a-n]=this[a]>>r;r>0&&(t[this.t-n-1]|=(this.s&i)<<o),t.t=this.t-n,t.clamp()}}subTo(e,t){for(var n=0,r=0,o=Math.min(e.t,this.t);n<o;)r+=this[n]-e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e[n],t[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()}multiplyTo(e,t){var n=this.abs(),r=e.abs(),o=n.t;for(t.t=o+r.t;--o>=0;)t[o]=0;for(o=0;o<r.t;++o)t[o+n.t]=n.am(0,r[o],t,o,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&X.ZERO.subTo(t,t)}squareTo(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()}divRemTo(e,t,n){var r=e.abs();if(!(r.t<=0)){var o=this.abs();if(o.t<r.t)return null!=t&&t.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=Z());var i=Z(),a=this.s,s=e.s,c=this.DB-ae(r[r.t-1]);c>0?(r.lShiftTo(c,i),o.lShiftTo(c,n)):(r.copyTo(i),o.copyTo(n));var u=i.t,l=i[u-1];if(0!=l){var p=l*(1<<this.F1)+(u>1?i[u-2]>>this.F2:0),d=this.FV/p,h=(1<<this.F1)/p,f=1<<this.F2,m=n.t,v=m-u,g=null==t?Z():t;for(i.dlShiftTo(v,g),n.compareTo(g)>=0&&(n[n.t++]=1,n.subTo(g,n)),X.ONE.dlShiftTo(u,g),g.subTo(i,i);i.t<u;)i[i.t++]=0;for(;--v>=0;){var b=n[--m]==l?this.DM:Math.floor(n[m]*d+(n[m-1]+f)*h);if((n[m]+=i.am(0,b,n,v,0,u))<b)for(i.dlShiftTo(v,g),n.subTo(g,n);n[m]<--b;)n.subTo(g,n)}null!=t&&(n.drShiftTo(u,t),a!=s&&X.ZERO.subTo(t,t)),n.t=u,n.clamp(),c>0&&n.rShiftTo(c,n),a<0&&X.ZERO.subTo(n,n)}}}invDigit(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t}isEven(){return 0==(this.t>0?1&this[0]:this.s)}exp(e,t){if(e>4294967295||e<1)return X.ONE;var n=Z(),r=Z(),o=t.convert(this),i=ae(e)-1;for(o.copyTo(n);--i>=0;)if(t.sqrTo(n,r),(e&1<<i)>0)t.mulTo(r,o,n);else{var a=n;n=r,r=a}return t.revert(n)}chunkSize(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}toRadix(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),r=ie(n),o=Z(),i=Z(),a="";for(this.divRemTo(r,o,i);o.signum()>0;)a=(n+i.intValue()).toString(e).substr(1)+a,o.divRemTo(r,o,i);return i.intValue().toString(e)+a}fromRadix(e,t){this.fromInt(0),null==t&&(t=10);for(var n=this.chunkSize(t),r=Math.pow(t,n),o=!1,i=0,a=0,s=0;s<e.length;++s){var c=oe(e,s);c<0?"-"==e.charAt(s)&&0==this.signum()&&(o=!0):(a=t*a+c,++i>=n&&(this.dMultiply(r),this.dAddOffset(a,0),i=0,a=0))}i>0&&(this.dMultiply(Math.pow(t,i)),this.dAddOffset(a,0)),o&&X.ZERO.subTo(this,this)}fromNumber(e,t,n){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(X.ONE.shiftLeft(e-1),B,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(X.ONE.shiftLeft(e-1),this);else{var r=[],o=7&e;r.length=1+(e>>3),t.nextBytes(r),o>0?r[0]&=(1<<o)-1:r[0]=0,this.fromString(r,256)}}bitwiseTo(e,t,n){var r,o,i=Math.min(e.t,this.t);for(r=0;r<i;++r)n[r]=t(this[r],e[r]);if(e.t<this.t){for(o=e.s&this.DM,r=i;r<this.t;++r)n[r]=t(this[r],o);n.t=this.t}else{for(o=this.s&this.DM,r=i;r<e.t;++r)n[r]=t(o,e[r]);n.t=e.t}n.s=t(this.s,e.s),n.clamp()}changeBit(e,t){var n=X.ONE.shiftLeft(e);return this.bitwiseTo(n,t,n),n}addTo(e,t){for(var n=0,r=0,o=Math.min(e.t,this.t);n<o;)r+=this[n]+e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e[n],t[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()}dMultiply(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}dAddOffset(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}multiplyLowerTo(e,t,n){var r=Math.min(this.t+e.t,t);for(n.s=0,n.t=r;r>0;)n[--r]=0;for(var o=n.t-this.t;r<o;++r)n[r+this.t]=this.am(0,e[r],n,r,0,this.t);for(o=Math.min(e.t,t);r<o;++r)this.am(0,e[r],n,r,0,t-r);n.clamp()}multiplyUpperTo(e,t,n){--t;var r=n.t=this.t+e.t-t;for(n.s=0;--r>=0;)n[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)n[this.t+r-t]=this.am(t-r,e[r],n,0,0,this.t+r-t);n.clamp(),n.drShiftTo(1,n)}modInt(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(0==t)n=this[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this[r])%e;return n}millerRabin(e){var t=this.subtract(X.ONE),n=t.getLowestSetBit();if(n<=0)return!1;var r=t.shiftRight(n);(e=e+1>>1)>m.length&&(e=m.length);for(var o=Z(),i=0;i<e;++i){o.fromInt(m[Math.floor(Math.random()*m.length)]);var a=o.modPow(r,this);if(0!=a.compareTo(X.ONE)&&0!=a.compareTo(t)){for(var s=1;s++<n&&0!=a.compareTo(t);)if(0==(a=a.modPowInt(2,this)).compareTo(X.ONE))return!1;if(0!=a.compareTo(t))return!1}}return!0}square(){var e=Z();return this.squareTo(e),e}gcda(e,t){var n=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(n.compareTo(r)<0){var o=n;n=r,r=o}var i=n.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)t(n);else{i<a&&(a=i),a>0&&(n.rShiftTo(a,n),r.rShiftTo(a,r));var s=()=>{(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),n.compareTo(r)>=0?(n.subTo(r,n),n.rShiftTo(1,n)):(r.subTo(n,r),r.rShiftTo(1,r)),n.signum()>0?setTimeout(s,0):(a>0&&r.lShiftTo(a,r),setTimeout((function(){t(r)}),0))};setTimeout(s,10)}}fromNumberAsync(e,t,n,r){if("number"==typeof t)if(e<2)this.fromInt(1);else{this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(X.ONE.shiftLeft(e-1),B,this),this.isEven()&&this.dAddOffset(1,0);var o=this,i=function(){o.dAddOffset(2,0),o.bitLength()>e&&o.subTo(X.ONE.shiftLeft(e-1),o),o.isProbablePrime(t)?setTimeout((function(){r()}),0):setTimeout(i,0)};setTimeout(i,0)}else{var a=[],s=7&e;a.length=1+(e>>3),t.nextBytes(a),s>0?a[0]&=(1<<s)-1:a[0]=0,this.fromString(a,256)}}}var g=function(){function e(){}return e.prototype.convert=function(e){return e},e.prototype.revert=function(e){return e},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n)},e.prototype.sqrTo=function(e,t){e.squareTo(t)},e}(),b=function(){function e(e){this.m=e}return e.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),y=function(){function e(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}return e.prototype.convert=function(e){var t=Z();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(X.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=Z();return e.copyTo(t),this.reduce(t),t},e.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=32767&e[t],r=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[n=t+this.m.t]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),_=function(){function e(e){this.m=e,this.r2=Z(),this.q3=Z(),X.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e)}return e.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=Z();return e.copyTo(t),this.reduce(t),t},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}();function Z(){return new X(null)}function ee(e,t){return new X(e,t)}function te(e,t,n,r,o,i){for(;--i>=0;){var a=t*this[e++]+n[r]+o;o=Math.floor(a/67108864),n[r++]=67108863&a}return o}function ne(e,t,n,r,o,i){for(var a=32767&t,s=t>>15;--i>=0;){var c=32767&this[e],u=this[e++]>>15,l=s*c+u*a;o=((c=a*c+((32767&l)<<15)+n[r]+(1073741823&o))>>>30)+(l>>>15)+s*u+(o>>>30),n[r++]=1073741823&c}return o}function re(e,t,n,r,o,i){for(var a=16383&t,s=t>>14;--i>=0;){var c=16383&this[e],u=this[e++]>>14,l=s*c+u*a;o=((c=a*c+((16383&l)<<14)+n[r]+o)>>28)+(l>>14)+s*u,n[r++]=268435455&c}return o}void 0!==o&&"Microsoft Internet Explorer"==(null==o?void 0:o.appName)?(X.prototype.am=ne,d=30):"Netscape"!=(null==o?void 0:o.appName)?(X.prototype.am=te,d=26):(X.prototype.am=re,d=28),X.prototype.DB=d,X.prototype.DM=(1<<d)-1,X.prototype.DV=1<<d,X.prototype.FV=Math.pow(2,52),X.prototype.F1=52-d,X.prototype.F2=2*d-52;var x,w,E=[];for(x="0".charCodeAt(0),w=0;w<=9;++w)E[x++]=w;for(x="a".charCodeAt(0),w=10;w<36;++w)E[x++]=w;for(x="A".charCodeAt(0),w=10;w<36;++w)E[x++]=w;function oe(e,t){var n=E[e.charCodeAt(t)];return null==n?-1:n}function ie(e){var t=Z();return t.fromInt(e),t}function ae(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}X.ZERO=ie(0),X.ONE=ie(1);class se{constructor(){this.i=0,this.j=0,this.S=[]}init(e){var t,n,r;for(t=0;t<256;++t)this.S[t]=t;for(n=0,t=0;t<256;++t)n=n+this.S[t]+e[t%e.length]&255,r=this.S[t],this.S[t]=this.S[n],this.S[n]=r;this.i=0,this.j=0}next(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]}}var I,S,O=null;if(null==O){O=[],S=0;var T,A,P=void 0;if("undefined"!=typeof window&&null!==(T=window)&&void 0!==T&&T.crypto&&null!==(A=window)&&void 0!==A&&A.crypto.getRandomValues){var C,R=new Uint32Array(256);for(null===(C=window)||void 0===C||C.crypto.getRandomValues(R),P=0;P<R.length;++P)O[S++]=255&R[P]}var N,k,j,D=function(e){var t,n,r;if(this.count=this.count||0,this.count>=256||S>=256){if("undefined"!=typeof window)if(null!==(t=window)&&void 0!==t&&t.removeEventListener)null===(r=window)||void 0===r||r.removeEventListener("mousemove",D,!1);else if(null!==(n=window)&&void 0!==n&&n.detachEvent){var o;null===(o=window)||void 0===o||o.detachEvent("onmousemove",D)}}else try{var i=e.x+e.y;O[S++]=255&i,this.count+=1}catch(e){}};if("undefined"!=typeof window)if(null!==(N=window)&&void 0!==N&&N.addEventListener)null===(j=window)||void 0===j||j.addEventListener("mousemove",D,!1);else if(null!==(k=window)&&void 0!==k&&k.attachEvent){var U;null===(U=window)||void 0===U||U.attachEvent("onmousemove",D)}}function ce(){if(null==I){for(I=new se;S<256;){var e=Math.floor(65536*Math.random());O[S++]=255&e}for(I.init(O),S=0;S<O.length;++S)O[S]=0;S=0}return I.next()}class ue{constructor(){}nextBytes(e){for(var t=0;t<e.length;++t)e[t]=ce()}}function le(e,t){if(t<e.length+11)return console.error("Message too long for RSA"),null;for(var n=[],r=e.length-1;r>=0&&t>0;){var o=e.charCodeAt(r--);o<128?n[--t]=o:o>127&&o<2048?(n[--t]=63&o|128,n[--t]=o>>6|192):(n[--t]=63&o|128,n[--t]=o>>6&63|128,n[--t]=o>>12|224)}n[--t]=0;for(var i=new ue,a=[];t>2;){for(a[0]=0;0==a[0];)i.nextBytes(a);n[--t]=a[0]}return n[--t]=2,n[--t]=0,new X(n)}class pe{constructor(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}doPublic(e){return e.modPowInt(this.e,this.n)}doPrivate(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),n=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(n)<0;)t=t.add(this.p);return t.subtract(n).multiply(this.coeff).mod(this.p).multiply(this.q).add(n)}setPublic(e,t){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=ee(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")}encrypt(e){var t=le(e,this.n.bitLength()+7>>3);if(null==t)return null;var n=this.doPublic(t);if(null==n)return null;var r=n.toString(16);return 1&r.length?"0"+r:r}encryptLong(e){var t=this,n=(this.n.bitLength()+7>>3)-11;try{var r="";return e.length>n?(e.match(/.{1,117}/g).forEach((function(e){var n=t.encrypt(e);r+=n})),H(r)):H(this.encrypt(e))}catch(e){return!1}}decryptLong(e){var t=this,n=this.n.bitLength()+7>>3;e=z(e);try{if(e.length>n){var r="";return e.match(/.{1,256}/g).forEach((function(e){var n=t.decrypt(e);r+=n})),r}return this.decrypt(e)}catch(e){return!1}}setPrivate(e,t,n){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=ee(e,16),this.e=parseInt(t,16),this.d=ee(n,16)):console.error("Invalid RSA private key")}setPrivateEx(e,t,n,r,o,i,a,s){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=ee(e,16),this.e=parseInt(t,16),this.d=ee(n,16),this.p=ee(r,16),this.q=ee(o,16),this.dmp1=ee(i,16),this.dmq1=ee(a,16),this.coeff=ee(s,16)):console.error("Invalid RSA private key")}generate(e,t){var n=new ue,r=e>>1;this.e=parseInt(t,16);for(var o=new X(t,16);;){for(;this.p=new X(e-r,1,n),0!=this.p.subtract(X.ONE).gcd(o).compareTo(X.ONE)||!this.p.isProbablePrime(10););for(;this.q=new X(r,1,n),0!=this.q.subtract(X.ONE).gcd(o).compareTo(X.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var i=this.p;this.p=this.q,this.q=i}var a=this.p.subtract(X.ONE),s=this.q.subtract(X.ONE),c=a.multiply(s);if(0==c.gcd(o).compareTo(X.ONE)){this.n=this.p.multiply(this.q),this.d=o.modInverse(c),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(s),this.coeff=this.q.modInverse(this.p);break}}}decrypt(e){var t=ee(e,16),n=this.doPrivate(t);return null==n?null:de(n,this.n.bitLength()+7>>3)}generateAsync(e,t,n){var r=new ue,o=e>>1;this.e=parseInt(t,16);var i=new X(t,16),a=this,s=()=>{var t=()=>{if(a.p.compareTo(a.q)<=0){var e=a.p;a.p=a.q,a.q=e}var t=a.p.subtract(X.ONE),r=a.q.subtract(X.ONE),o=t.multiply(r);0==o.gcd(i).compareTo(X.ONE)?(a.n=a.p.multiply(a.q),a.d=i.modInverse(o),a.dmp1=a.d.mod(t),a.dmq1=a.d.mod(r),a.coeff=a.q.modInverse(a.p),setTimeout((function(){n()}),0)):setTimeout(s,0)},c=()=>{a.q=Z(),a.q.fromNumberAsync(o,1,r,(function(){a.q.subtract(X.ONE).gcda(i,(function(e){0==e.compareTo(X.ONE)&&a.q.isProbablePrime(10)?setTimeout(t,0):setTimeout(c,0)}))}))},u=()=>{a.p=Z(),a.p.fromNumberAsync(e-o,1,r,(function(){a.p.subtract(X.ONE).gcda(i,(function(e){0==e.compareTo(X.ONE)&&a.p.isProbablePrime(10)?setTimeout(c,0):setTimeout(u,0)}))}))};setTimeout(u,0)};setTimeout(s,0)}}function de(e,t){for(var n=e.toByteArray(),r=0;r<n.length&&0==n[r];)++r;if(n.length-r!=t-1||2!=n[r])return null;for(++r;0!=n[r];)if(++r>=n.length)return null;for(var o="";++r<n.length;){var i=255&n[r];i<128?o+=String.fromCharCode(i):i>191&&i<224?(o+=String.fromCharCode((31&i)<<6|63&n[r+1]),++r):(o+=String.fromCharCode((15&i)<<12|(63&n[r+1])<<6|63&n[r+2]),r+=2)}return o}class he extends pe{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";super(),e&&("string"==typeof e?this.parseKey(e):(this.hasPrivateKeyProperty(e)||this.hasPublicKeyProperty(e))&&this.parsePropertiesFrom(e))}parseKey(e){try{var t=0,n=0,r=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(e)?u.decode(e):l.unarmor(e),o=Q.decode(r);if(3===o.sub.length&&(o=o.sub[2].sub[0]),9===o.sub.length){t=o.sub[1].getHexStringValue(),this.n=ee(t,16),n=o.sub[2].getHexStringValue(),this.e=parseInt(n,16);var i=o.sub[3].getHexStringValue();this.d=ee(i,16);var a=o.sub[4].getHexStringValue();this.p=ee(a,16);var s=o.sub[5].getHexStringValue();this.q=ee(s,16);var c=o.sub[6].getHexStringValue();this.dmp1=ee(c,16);var p=o.sub[7].getHexStringValue();this.dmq1=ee(p,16);var d=o.sub[8].getHexStringValue();this.coeff=ee(d,16)}else{if(2!==o.sub.length)return!1;var h=o.sub[1].sub[0];t=h.sub[0].getHexStringValue(),this.n=ee(t,16),n=h.sub[1].getHexStringValue(),this.e=parseInt(n,16)}return!0}catch(e){return!1}}hasPublicKeyProperty(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")}hasPrivateKeyProperty(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")&&e.hasOwnProperty("d")&&e.hasOwnProperty("p")&&e.hasOwnProperty("q")&&e.hasOwnProperty("dmp1")&&e.hasOwnProperty("dmq1")&&e.hasOwnProperty("coeff")}parsePropertiesFrom(e){this.n=e.n,this.e=e.e,e.hasOwnProperty("d")&&(this.d=e.d,this.p=e.p,this.q=e.q,this.dmp1=e.dmp1,this.dmq1=e.dmq1,this.coeff=e.coeff)}}(r=function(e){e=e||{},this.default_key_size=parseInt(e.default_key_size,10)||1024,this.default_public_exponent=e.default_public_exponent||"010001",this.log=e.log||!1,this.key=null}).prototype.setKey=function(e){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new he(e)},r.prototype.setPrivateKey=function(e){this.setKey(e)},r.prototype.setPublicKey=function(e){this.setKey(e)},r.prototype.decrypt=function(e){try{return this.getKey().decrypt(z(e))}catch(e){return!1}},r.prototype.encrypt=function(e){try{return H(this.getKey().encrypt(e))}catch(e){return!1}},r.prototype.encryptLong=function(e){try{for(var t=this.getKey().encryptLong(e)||"",n=this.getKey().decryptLong(t)||"",r=0,o=/null$/g;o.test(n)&&(r++,t=this.getKey().encryptLong(e)||"",n=this.getKey().decryptLong(t)||"",!(r>10)););return t}catch(e){return!1}},r.prototype.getKey=function(e){if(!this.key){if(this.key=new he,e&&"[object Function]"==={}.toString.call(e))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,e);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},r.version="3.1.4"}const L=r},8182:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useDefaultAdapter=t.useAdapters=t.RUNTIME=void 0;var s,c=a(n(4274)),u=n(3616);!function(e){e.WEB="web",e.WX_MP="wx_mp"}(s=t.RUNTIME||(t.RUNTIME={})),t.useAdapters=function(e,t){for(var n=0,o=(0,u.isArray)(e)?e:[e];n<o.length;n++){var i=o[n],a=i.isMatch,s=i.genAdapter,c=i.runtime;if(a())return{adapter:r({isMatch:a},s(t)),runtime:c}}},t.useDefaultAdapter=function(){return{adapter:r({},c.genAdapter()),runtime:s.WEB}}},4274:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.WebRequest=t.genAdapter=void 0;var c=n(2764),u=n(3616),l=n(2946),p=function(e){function t(t){var n=e.call(this)||this,r=t.timeout,o=t.timeoutMsg,i=t.restrictedMethods;return n.timeout=r||0,n.timeoutMsg=o||"请求超时",n.restrictedMethods=i||["get","post","upload","download"],n}return o(t,e),t.prototype.get=function(e){return this.request(i(i({},e),{method:"get"}),this.restrictedMethods.includes("get"))},t.prototype.post=function(e){return this.request(i(i({},e),{method:"post"}),this.restrictedMethods.includes("post"))},t.prototype.put=function(e){return this.request(i(i({},e),{method:"put"}))},t.prototype.upload=function(e){var t=e.data,n=e.file,r=e.name,o=e.method,a=e.headers,s=void 0===a?{}:a,c={post:"post",put:"put"}[null==o?void 0:o.toLowerCase()]||"put",u=new FormData;return"post"===c?(Object.keys(t).forEach((function(e){u.append(e,t[e])})),u.append("key",r),u.append("file",n),this.request(i(i({},e),{data:u,method:c}),this.restrictedMethods.includes("upload"))):this.request(i(i({},e),{method:"put",headers:s,body:n}),this.restrictedMethods.includes("upload"))},t.prototype.download=function(e){return a(this,void 0,void 0,(function(){var t,n,r,o;return s(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.get(i(i({},e),{headers:{},responseType:"blob"}))];case 1:return t=a.sent().data,n=window.URL.createObjectURL(new Blob([t])),r=decodeURIComponent(new URL(e.url).pathname.split("/").pop()||""),(o=document.createElement("a")).href=n,o.setAttribute("download",r),o.style.display="none",document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(n),document.body.removeChild(o),[3,3];case 2:return a.sent(),[3,3];case 3:return[2,new Promise((function(t){t({statusCode:200,tempFilePath:e.url})}))]}}))}))},t.prototype.fetch=function(e){var t;return a(this,void 0,void 0,(function(){var n,r,o,c,u,l,p,d,h,f,m,v,g,b=this;return s(this,(function(y){switch(y.label){case 0:return n=new AbortController,r=e.url,o=e.enableAbort,c=void 0!==o&&o,u=e.stream,l=void 0!==u&&u,p=e.signal,d=e.timeout,h=e.shouldThrowOnError,f=void 0===h||h,m=null!=d?d:this.timeout,p&&(p.aborted&&n.abort(),p.addEventListener("abort",(function(){return n.abort()}))),v=null,c&&m&&(v=setTimeout((function(){console.warn(b.timeoutMsg),n.abort(new Error(b.timeoutMsg))}),m)),[4,fetch(r,i(i({},e),{signal:n.signal})).then((function(e){return a(b,void 0,void 0,(function(){var t,n,r;return s(this,(function(o){switch(o.label){case 0:return clearTimeout(v),f?e.ok?(t=e,[3,3]):[3,1]:[3,4];case 1:return r=(n=Promise).reject,[4,e.json()];case 2:t=r.apply(n,[o.sent()]),o.label=3;case 3:return[2,t];case 4:return[2,e]}}))}))})).catch((function(e){return clearTimeout(v),Promise.reject(e)}))];case 1:return g=y.sent(),[2,{data:l?g.body:(null===(t=g.headers.get("content-type"))||void 0===t?void 0:t.includes("application/json"))?g.json():g.text(),statusCode:g.status,header:g.headers,response:g}]}}))}))},t.prototype.request=function(e,t){var n=this;void 0===t&&(t=!1);var r=String(e.method).toLowerCase()||"get";return new Promise((function(o){var i=e.url,a=e.headers,s=void 0===a?{}:a,c=e.data,p=e.responseType,d=e.withCredentials,h=e.body,f=e.onUploadProgress,m=(0,u.formatUrl)((0,l.getProtocol)(),i,"get"===r?c:{}),v=new XMLHttpRequest;v.open(r,m),p&&(v.responseType=p);var g,b,y=e.signal;y&&(y.aborted?v.abort():y.addEventListener("abort",(function(){return v.abort()}),{once:!0})),Object.keys(s).forEach((function(e){v.setRequestHeader(e,s[e])})),f&&v.upload.addEventListener("progress",f),v.onreadystatechange=function(){var e={};if(4===v.readyState){var t=v.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};t.forEach((function(e){var t=e.split(": "),r=t.shift().toLowerCase(),o=t.join(": ");n[r]=o})),e.header=n,e.statusCode=v.status;try{e.data="blob"===p?v.response:JSON.parse(v.responseText)}catch(t){e.data="blob"===p?v.response:v.responseText}clearTimeout(g),o(e)}},t&&n.timeout&&(g=setTimeout((function(){console.warn(n.timeoutMsg),v.abort()}),n.timeout)),b=(0,u.isFormData)(c)?c:"application/x-www-form-urlencoded"===s["content-type"]?(0,u.toQueryString)(c):h||(c?JSON.stringify(c):void 0),d&&(v.withCredentials=!0),v.send(b)}))},t}(c.AbstractSDKRequest);t.WebRequest=p,t.genAdapter=function(){return{type:"default",root:window,reqClass:p,wsClass:WebSocket,localStorage}}},2946:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.COMMUNITY_SITE_URL=t.IS_DEBUG_MODE=t.getProtocol=t.setProtocol=t.getSdkName=t.setSdkName=void 0;var n="@cloudbase/js-sdk";t.setSdkName=function(e){n=e},t.getSdkName=function(){return n};var r="https:";t.setProtocol=function(e){r=e},t.getProtocol=function(){return r},t.IS_DEBUG_MODE=!1,t.COMMUNITY_SITE_URL="https://support.qq.com/products/148793"},6205:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERRORS=void 0,t.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"}},794:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.OATUH_LOGINTYPE=void 0,o(n(2946),t),o(n(6205),t),t.OATUH_LOGINTYPE="constants"},7718:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.catchErrorsDecorator=void 0;var i=n(3616),a=n(794),s=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(s=-1!==navigator.userAgent.indexOf("Firefox"));var c=s?/(\.js\/)?__decorate(\$\d+)?<@.*\d$/:/(\/\w+\.js\.)?__decorate(\$\d+)?\s*\(.*\)$/,u=/https?:\/\/.+:\d*\/.*\.js:\d+:\d+/;function l(e){var t=e.err,n=e.className,r=e.methodName,o=e.sourceLink;if(!o)return null;var i,a=t.stack.split("\n"),c=s?/^catchErrorsDecorator\/<\/descriptor.value@.*\d$/:new RegExp("".concat(n,"\\.descriptor.value\\s*\\[as\\s").concat(r,"\\]\\s*\\(.*\\)$")),l=s?/^catchErrorsDecorator\/<\/descriptor.value/:new RegExp("".concat(n,"\\.descriptor.value\\s*\\[as\\s").concat(r,"\\]")),p=a.findIndex((function(e){return c.test(e)}));if(-1!==p){var d=a.filter((function(e,t){return t>p}));d.unshift(a[p].replace(l,"".concat(n,".").concat(r)).replace(u,o)),(i=new Error).stack="".concat(s?"@debugger":"Error","\n").concat(d.join("\n"))}return i}t.catchErrorsDecorator=function(e){var t=e.mode,n=void 0===t?"async":t,s=e.customInfo,p=void 0===s?{}:s,d=e.title,h=e.messages,f=void 0===h?[]:h;return function(e,t,s){if(a.IS_DEBUG_MODE){var h=p.className||e.constructor.name,m=p.methodName||t,v=s.value,g=function(){var e="",t=(new Error).stack.split("\n"),n=t.findIndex((function(e){return c.test(e)}));if(-1!==n){var r=u.exec(t[n+1]||"");e=r?r[0]:""}return e}();s.value="sync"===n?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=l({err:new Error,className:h,methodName:m,sourceLink:g});try{return v.apply(this,e)}catch(e){var r=e,o=e.message,a=e.error,s=e.error_description,c={title:d||"".concat(h,".").concat(m," failed"),content:[{type:"error",body:e}]};if(o&&/^\{.*\}$/.test(o)){var u=JSON.parse(o);c.subtitle=o,u.code&&(n?(n.code=u.code,n.msg=u.msg):(e.code=u.code,e.message=u.msg),r=n||e,c.content=f.map((function(e){return{type:"info",body:e}})))}throw a&&s&&(c.subtitle=s,n?(n.code=a,n.msg=s):(e.code=a,e.message=s),r=n||e,c.content=f.map((function(e){return{type:"info",body:e}}))),(0,i.printGroupLog)(c),r}}:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r(this,void 0,void 0,(function(){var t,n,r,a,s,c,u,p;return o(this,(function(o){switch(o.label){case 0:t=l({err:new Error,className:h,methodName:m,sourceLink:g}),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,v.apply(this,e)];case 2:return[2,o.sent()];case 3:throw n=o.sent(),r=n,a=n.message,s=n.error,c=n.error_description,u={title:d||"".concat(h,".").concat(m," failed"),content:[{type:"error",body:n}]},a&&/^\{.*\}$/.test(a)&&(p=JSON.parse(a),u.subtitle=p,p.code&&(t?(t.code=p.code,t.message=p.msg):(n.code=p.code,n.message=p.msg),r=t||n,u.content=f.map((function(e){return{type:"info",body:e}})))),s&&c&&(u.subtitle=c,t?(t.code=s,t.msg=c):(n.code=s,n.message=c),r=t||n,u.content=f.map((function(e){return{type:"info",body:e}}))),(0,i.printGroupLog)(u),r;case 4:return[2]}}))}))}}}}},141:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(7718),t)},6197:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.CloudbaseCache=void 0;var s=n(2764),c=n(3616),u=n(794),l=function(e){function t(t){var n=e.call(this)||this;return n.root=t,t.tcbCacheObject||(t.tcbCacheObject={}),n}return o(t,e),t.prototype.setItem=function(e,t){this.root.tcbCacheObject[e]=t},t.prototype.getItem=function(e){return this.root.tcbCacheObject[e]},t.prototype.removeItem=function(e){delete this.root.tcbCacheObject[e]},t.prototype.clear=function(){delete this.root.tcbCacheObject},t}(s.AbstractStorage),p=function(){function e(e){this.keys={};var t=e.persistence,n=e.platformInfo,r=void 0===n?{}:n,o=e.keys,i=void 0===o?{}:o;this.platformInfo=r,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||t,this.storage=function(e,t){switch(e){case"local":default:return t.localStorage?t.localStorage:((0,c.printWarn)(u.ERRORS.INVALID_PARAMS,"localStorage is not supported on current platform"),new l(t.root));case"none":return new l(t.root)}}(this.persistenceTag,this.platformInfo.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.persistenceTag},enumerable:!1,configurable:!0}),e.prototype.setStore=function(e,t,n){if("async"!==this.mode){if(this.storage)try{var r={version:n||"localCachev1",content:t};this.storage.setItem(e,JSON.stringify(r))}catch(e){throw new Error(JSON.stringify({code:u.ERRORS.OPERATION_FAIL,msg:"[".concat((0,u.getSdkName)(),"][").concat(u.ERRORS.OPERATION_FAIL,"]setStore failed"),info:e}))}}else(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},e.prototype.setStoreAsync=function(e,t,n){return i(this,void 0,void 0,(function(){var r;return a(this,(function(o){switch(o.label){case 0:if(!this.storage)return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),r={version:n||"localCachev1",content:t},[4,this.storage.setItem(e,JSON.stringify(r))];case 2:return o.sent(),[3,4];case 3:return o.sent(),[2];case 4:return[2]}}))}))},e.prototype.getStore=function(e,t){var n;if("async"!==this.mode){try{if("undefined"!=typeof process&&(null===(n={IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0})||void 0===n?void 0:n.tcb_token))return{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token;if(!this.storage)return""}catch(e){return""}t=t||"localCachev1";var r=this.storage.getItem(e);return r&&r.indexOf(t)>=0?JSON.parse(r).content:""}(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},e.prototype.getStoreAsync=function(e,t){var n;return i(this,void 0,void 0,(function(){var r;return a(this,(function(o){switch(o.label){case 0:try{if("undefined"!=typeof process&&(null===(n={IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0})||void 0===n?void 0:n.tcb_token))return[2,{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token];if(!this.storage)return[2,""]}catch(e){return[2,""]}return t=t||"localCachev1",[4,this.storage.getItem(e)];case 1:return(r=o.sent())&&r.indexOf(t)>=0?[2,JSON.parse(r).content]:[2,""]}}))}))},e.prototype.removeStore=function(e){"async"!==this.mode?this.storage.removeItem(e):(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},e.prototype.removeStoreAsync=function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.storage.removeItem(e)];case 1:return t.sent(),[2]}}))}))},e}();t.CloudbaseCache=p},9689:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.removeEventListener=t.activateEvent=t.addEventListener=t.CloudbaseEventEmitter=t.IErrorEvent=t.CloudbaseEvent=void 0;var a=n(3616),s=function(e,t){this.data=t||null,this.name=e};t.CloudbaseEvent=s;var c=function(e){function t(t,n){var r=e.call(this,"error",{error:t,data:n})||this;return r.error=t,r}return o(t,e),t}(s);t.IErrorEvent=c;var u=function(){function e(){this.listeners={}}return e.prototype.on=function(e,t){return function(e,t,n){n[e]=n[e]||[],n[e].push(t)}(e,t,this.listeners),this},e.prototype.off=function(e,t){return function(e,t,n){if(null==n?void 0:n[e]){var r=n[e].indexOf(t);-1!==r&&n[e].splice(r,1)}}(e,t,this.listeners),this},e.prototype.fire=function(e,t){if((0,a.isInstanceOf)(e,c))return console.error(e.error),this;var n=(0,a.isString)(e)?new s(e,t||{}):e,r=n.name;if(this.listens(r)){n.target=this;for(var o=0,u=this.listeners[r]?i([],this.listeners[r],!0):[];o<u.length;o++)u[o].call(this,n)}return this},e.prototype.listens=function(e){return this.listeners[e]&&this.listeners[e].length>0},e}();t.CloudbaseEventEmitter=u;var l=new u;t.addEventListener=function(e,t){l.on(e,t)},t.activateEvent=function(e,t){void 0===t&&(t={}),l.fire(e,t)},t.removeEventListener=function(e,t){l.off(e,t)}},3616:function(e,t,n){"use strict";var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.parseCaptcha=t.parseQueryString=t.transformPhone=t.sleep=t.printGroupLog=t.throwError=t.printInfo=t.printError=t.printWarn=t.execCallback=t.createPromiseCallback=t.removeParam=t.getHash=t.getQuery=t.toQueryString=t.formatUrl=t.generateRequestId=t.genSeqId=t.isFormData=t.isInstanceOf=t.isNull=t.isPalinObject=t.isUndefined=t.isString=t.isArray=void 0;var o=n(794);t.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},t.isString=function(e){return"string"==typeof e},t.isUndefined=function(e){return void 0===e},t.isPalinObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},t.isNull=function(e){return"[object Null]"===Object.prototype.toString.call(e)},t.isInstanceOf=function(e,t){return e instanceof t},t.isFormData=function(e){return"[object FormData]"===Object.prototype.toString.call(e)},t.genSeqId=function(){return Math.random().toString(16).slice(2)},t.generateRequestId=function(){var e=(new Date).getTime(),t=(null===Date||void 0===Date?void 0:Date.now)&&1e3*Date.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(n){var r=16*Math.random();return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),("x"===n?r:7&r|8).toString(16)}))},t.formatUrl=function(e,t,n){void 0===n&&(n={});var r=/\?/.test(t),o="";return Object.keys(n).forEach((function(e){""===o?!r&&(t+="?"):o+="&",o+="".concat(e,"=").concat(encodeURIComponent(n[e]))})),/^http(s)?:\/\//.test(t+=o)?t:"".concat(e).concat(t)},t.toQueryString=function(e){void 0===e&&(e={});var t=[];return Object.keys(e).forEach((function(n){t.push("".concat(n,"=").concat(encodeURIComponent(e[n])))})),t.join("&")},t.getQuery=function(e,t){if("undefined"==typeof window)return!1;var n=t||decodeURIComponent(window.location.search),r=new RegExp("(^|&)".concat(e,"=([^&]*)(&|$)")),o=n.substr(n.indexOf("?")+1).match(r);return null!=o?o[2]:""},t.getHash=function(e){if("undefined"==typeof window)return"";var t=window.location.hash.match(new RegExp("[#?&/]".concat(e,"=([^&#]*)")));return t?t[1]:""},t.removeParam=function(e,t){var n=t.split("?")[0],r=[],o=-1!==t.indexOf("?")?t.split("?")[1]:"";if(""!==o){for(var i=(r=o.split("&")).length-1;i>=0;i-=1)r[i].split("=")[0]===e&&r.splice(i,1);n="".concat(n,"?").concat(r.join("&"))}return n},t.createPromiseCallback=function(){var e={};if(!Promise){(e=function(){}).promise={};var t=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}var n=new Promise((function(t,n){e=function(e,r){return e?n(e):t(r)}}));return e.promise=n,e},t.execCallback=function(e,t,n){if(void 0===n&&(n=null),e&&"function"==typeof e)return e(t,n);if(t)throw t;return n},t.printWarn=function(e,t){console.warn("[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t))},t.printError=function(e,t){console.error({code:e,msg:"[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t)})},t.printInfo=function(e,t){console.log("[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t))},t.throwError=function(e,t){throw new Error(JSON.stringify({code:e,msg:"[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t)}))},t.printGroupLog=function(e){var t,n=e.title,r=e.subtitle,o=void 0===r?"":r,i=e.content,a=void 0===i?[]:i,s=e.printTrace,c=void 0!==s&&s,u=e.collapsed;void 0!==u&&u?(console.groupCollapsed||console.error)(n,o):(console.group||console.error)(n,o);for(var l=0,p=a;l<p.length;l++){var d=p[l],h=d.type,f=d.body;switch(h){case"info":console.log(f);break;case"warn":console.warn(f);break;case"error":console.error(f)}}c&&(console.trace||console.log)("stack trace:"),null===(t=console.groupEnd)||void 0===t||t.call(console)},t.sleep=function(e){return void 0===e&&(e=0),new Promise((function(t){return setTimeout(t,e)}))},t.transformPhone=function(e){return"+86".concat(e)},t.parseQueryString=function(e){e=e.replace(/^\?/,"");var t={};return e.split("&").forEach((function(e){var n=e.split("="),r=n[0],o=n[1];r=decodeURIComponent(r),o=decodeURIComponent(o),r&&(t[r]?Array.isArray(t[r])?t[r].push(o):t[r]=[t[r],o]:t[r]=o)})),t},t.parseCaptcha=function(e){var n={},o=e.match(/^(data:.*?)(\?[^#\s]*)?$/);if(o){e=o[1];var i=o[2];i&&(n=(0,t.parseQueryString)(i))}var a=n.token,s=r(n,["token"]);return/^data:/.test(e)&&!a?{error:"invalid_argument",error_description:"invalid captcha data: ".concat(e)}:a?{state:s.state,token:a,captchaData:e}:{error:"unimplemented",error_description:"need to impl captcha data"}}},6160:(e,t,n)=>{var r=n(3837),o=n(2781).Stream,i=n(8178);function a(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}e.exports=a,r.inherits(a,o),a.create=function(e){var t=new this;for(var n in e=e||{})t[n]=e[n];return t},a.isStreamLike=function(e){return"function"!=typeof e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&!Buffer.isBuffer(e)},a.prototype.append=function(e){if(a.isStreamLike(e)){if(!(e instanceof i)){var t=i.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=t}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this},a.prototype.pipe=function(e,t){return o.prototype.pipe.call(this,e,t),this.resume(),e},a.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop)this._pendingNext=!0;else{this._insideLoop=!0;try{do{this._pendingNext=!1,this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=!1}}},a.prototype._realGetNext=function(){var e=this._streams.shift();void 0!==e?"function"==typeof e?e(function(e){a.isStreamLike(e)&&(e.on("data",this._checkDataSize.bind(this)),this._handleErrors(e)),this._pipeNext(e)}.bind(this)):this._pipeNext(e):this.end()},a.prototype._pipeNext=function(e){if(this._currentStream=e,a.isStreamLike(e))return e.on("end",this._getNext.bind(this)),void e.pipe(this,{end:!1});var t=e;this.write(t),this._getNext()},a.prototype._handleErrors=function(e){var t=this;e.on("error",(function(e){t._emitError(e)}))},a.prototype.write=function(e){this.emit("data",e)},a.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.pause&&this._currentStream.pause(),this.emit("pause"))},a.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.resume&&this._currentStream.resume(),this.emit("resume")},a.prototype.end=function(){this._reset(),this.emit("end")},a.prototype.destroy=function(){this._reset(),this.emit("close")},a.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null},a.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}},a.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach((function(t){t.dataSize&&(e.dataSize+=t.dataSize)})),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)},a.prototype._emitError=function(e){this._reset(),this.emit("error",e)}},8178:(e,t,n)=>{var r=n(2781).Stream,o=n(3837);function i(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}e.exports=i,o.inherits(i,r),i.create=function(e,t){var n=new this;for(var r in t=t||{})n[r]=t[r];n.source=e;var o=e.emit;return e.emit=function(){return n._handleEmit(arguments),o.apply(e,arguments)},e.on("error",(function(){})),n.pauseStream&&e.pause(),n},Object.defineProperty(i.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),i.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},i.prototype.resume=function(){this._released||this.release(),this.source.resume()},i.prototype.pause=function(){this.source.pause()},i.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]},i.prototype.pipe=function(){var e=r.prototype.pipe.apply(this,arguments);return this.resume(),e},i.prototype._handleEmit=function(e){this._released?this.emit.apply(this,e):("data"===e[0]&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e))},i.prototype._checkIfMaxDataSizeExceeded=function(){if(!(this._maxDataSizeExceeded||this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}},1191:(e,t,n)=>{var r=n(6160),o=n(3837),i=n(1017),a=n(3685),s=n(5687),c=n(7310).parse,u=n(7147),l=n(2781).Stream,p=n(6856),d=n(9954),h=n(5488);function f(e){if(!(this instanceof f))return new f(e);for(var t in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],r.call(this),e=e||{})this[t]=e[t]}e.exports=f,o.inherits(f,r),f.LINE_BREAK="\r\n",f.DEFAULT_CONTENT_TYPE="application/octet-stream",f.prototype.append=function(e,t,n){"string"==typeof(n=n||{})&&(n={filename:n});var i=r.prototype.append.bind(this);if("number"==typeof t&&(t=""+t),o.isArray(t))this._error(new Error("Arrays are not supported."));else{var a=this._multiPartHeader(e,t,n),s=this._multiPartFooter();i(a),i(t),i(s),this._trackLength(a,t,n)}},f.prototype._trackLength=function(e,t,n){var r=0;null!=n.knownLength?r+=+n.knownLength:Buffer.isBuffer(t)?r=t.length:"string"==typeof t&&(r=Buffer.byteLength(t)),this._valueLength+=r,this._overheadLength+=Buffer.byteLength(e)+f.LINE_BREAK.length,t&&(t.path||t.readable&&t.hasOwnProperty("httpVersion")||t instanceof l)&&(n.knownLength||this._valuesToMeasure.push(t))},f.prototype._lengthRetriever=function(e,t){e.hasOwnProperty("fd")?null!=e.end&&e.end!=1/0&&null!=e.start?t(null,e.end+1-(e.start?e.start:0)):u.stat(e.path,(function(n,r){var o;n?t(n):(o=r.size-(e.start?e.start:0),t(null,o))})):e.hasOwnProperty("httpVersion")?t(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",(function(n){e.pause(),t(null,+n.headers["content-length"])})),e.resume()):t("Unknown stream")},f.prototype._multiPartHeader=function(e,t,n){if("string"==typeof n.header)return n.header;var r,o=this._getContentDisposition(t,n),i=this._getContentType(t,n),a="",s={"Content-Disposition":["form-data",'name="'+e+'"'].concat(o||[]),"Content-Type":[].concat(i||[])};for(var c in"object"==typeof n.header&&h(s,n.header),s)s.hasOwnProperty(c)&&null!=(r=s[c])&&(Array.isArray(r)||(r=[r]),r.length&&(a+=c+": "+r.join("; ")+f.LINE_BREAK));return"--"+this.getBoundary()+f.LINE_BREAK+a+f.LINE_BREAK},f.prototype._getContentDisposition=function(e,t){var n,r;return"string"==typeof t.filepath?n=i.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e.name||e.path?n=i.basename(t.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(n=i.basename(e.client._httpMessage.path||"")),n&&(r='filename="'+n+'"'),r},f.prototype._getContentType=function(e,t){var n=t.contentType;return!n&&e.name&&(n=p.lookup(e.name)),!n&&e.path&&(n=p.lookup(e.path)),!n&&e.readable&&e.hasOwnProperty("httpVersion")&&(n=e.headers["content-type"]),n||!t.filepath&&!t.filename||(n=p.lookup(t.filepath||t.filename)),n||"object"!=typeof e||(n=f.DEFAULT_CONTENT_TYPE),n},f.prototype._multiPartFooter=function(){return function(e){var t=f.LINE_BREAK;0===this._streams.length&&(t+=this._lastBoundary()),e(t)}.bind(this)},f.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+f.LINE_BREAK},f.prototype.getHeaders=function(e){var t,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)e.hasOwnProperty(t)&&(n[t.toLowerCase()]=e[t]);return n},f.prototype.setBoundary=function(e){this._boundary=e},f.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},f.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),n=0,r=this._streams.length;n<r;n++)"function"!=typeof this._streams[n]&&(e=Buffer.isBuffer(this._streams[n])?Buffer.concat([e,this._streams[n]]):Buffer.concat([e,Buffer.from(this._streams[n])]),"string"==typeof this._streams[n]&&this._streams[n].substring(2,t.length+2)===t||(e=Buffer.concat([e,Buffer.from(f.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},f.prototype._generateBoundary=function(){for(var e="--------------------------",t=0;t<24;t++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},f.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},f.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},f.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;this._streams.length&&(t+=this._lastBoundary().length),this._valuesToMeasure.length?d.parallel(this._valuesToMeasure,this._lengthRetriever,(function(n,r){n?e(n):(r.forEach((function(e){t+=e})),e(null,t))})):process.nextTick(e.bind(this,null,t))},f.prototype.submit=function(e,t){var n,r,o={method:"post"};return"string"==typeof e?(e=c(e),r=h({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(r=h(e,o)).port||(r.port="https:"==r.protocol?443:80),r.headers=this.getHeaders(e.headers),n="https:"==r.protocol?s.request(r):a.request(r),this.getLength(function(e,r){if(e&&"Unknown stream"!==e)this._error(e);else if(r&&n.setHeader("Content-Length",r),this.pipe(n),t){var o,i=function(e,r){return n.removeListener("error",i),n.removeListener("response",o),t.call(this,e,r)};o=i.bind(this,null),n.on("error",i),n.on("response",o)}}.bind(this)),n},f.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},f.prototype.toString=function(){return"[object FormData]"}},5488:e=>{e.exports=function(e,t){return Object.keys(t).forEach((function(n){e[n]=e[n]||t[n]})),e}},9515:(e,t,n)=>{var r=n(8761)(n(7772),"DataView");e.exports=r},9612:(e,t,n)=>{var r=n(2118),o=n(6909),i=n(8138),a=n(4174),s=n(7942);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},235:(e,t,n)=>{var r=n(3945),o=n(1846),i=n(8028),a=n(6018),s=n(4769);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},326:(e,t,n)=>{var r=n(8761)(n(7772),"Map");e.exports=r},6738:(e,t,n)=>{var r=n(2411),o=n(6417),i=n(6928),a=n(9493),s=n(4150);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},2760:(e,t,n)=>{var r=n(8761)(n(7772),"Promise");e.exports=r},2143:(e,t,n)=>{var r=n(8761)(n(7772),"Set");e.exports=r},6571:(e,t,n)=>{var r=n(235),o=n(5243),i=n(2858),a=n(4417),s=n(8605),c=n(1418);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=o,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=s,u.prototype.set=c,e.exports=u},857:(e,t,n)=>{var r=n(7772).Symbol;e.exports=r},9162:(e,t,n)=>{var r=n(7772).Uint8Array;e.exports=r},3215:(e,t,n)=>{var r=n(8761)(n(7772),"WeakMap");e.exports=r},2517:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},7552:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}},1634:(e,t,n)=>{var r=n(6473),o=n(9631),i=n(6152),a=n(3226),s=n(9045),c=n(7598),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),l=!n&&o(e),p=!n&&!l&&a(e),d=!n&&!l&&!p&&c(e),h=n||l||p||d,f=h?r(e.length,String):[],m=f.length;for(var v in e)!t&&!u.call(e,v)||h&&("length"==v||p&&("offset"==v||"parent"==v)||d&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,m))||f.push(v);return f}},343:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},5067:e=>{e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},91:(e,t,n)=>{var r=n(3940),o=n(1225),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];i.call(e,t)&&o(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},2218:(e,t,n)=>{var r=n(1225);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},7993:(e,t,n)=>{var r=n(752),o=n(249);e.exports=function(e,t){return e&&r(t,o(t),e)}},5906:(e,t,n)=>{var r=n(752),o=n(8582);e.exports=function(e,t){return e&&r(t,o(t),e)}},3940:(e,t,n)=>{var r=n(3043);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},8874:(e,t,n)=>{var r=n(6571),o=n(2517),i=n(91),a=n(7993),s=n(5906),c=n(2175),u=n(1522),l=n(7680),p=n(9987),d=n(3483),h=n(6939),f=n(940),m=n(9917),v=n(8222),g=n(8725),b=n(6152),y=n(3226),_=n(4714),x=n(9259),w=n(3679),E=n(249),I=n(8582),S="[object Arguments]",O="[object Function]",T="[object Object]",A={};A[S]=A["[object Array]"]=A["[object ArrayBuffer]"]=A["[object DataView]"]=A["[object Boolean]"]=A["[object Date]"]=A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Map]"]=A["[object Number]"]=A[T]=A["[object RegExp]"]=A["[object Set]"]=A["[object String]"]=A["[object Symbol]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A["[object Error]"]=A[O]=A["[object WeakMap]"]=!1,e.exports=function e(t,n,P,C,R,N){var k,j=1&n,D=2&n,U=4&n;if(P&&(k=R?P(t,C,R,N):P(t)),void 0!==k)return k;if(!x(t))return t;var L=b(t);if(L){if(k=m(t),!j)return u(t,k)}else{var M=f(t),q=M==O||"[object GeneratorFunction]"==M;if(y(t))return c(t,j);if(M==T||M==S||q&&!R){if(k=D||q?{}:g(t),!j)return D?p(t,s(k,t)):l(t,a(k,t))}else{if(!A[M])return R?t:{};k=v(t,M,j)}}N||(N=new r);var B=N.get(t);if(B)return B;N.set(t,k),w(t)?t.forEach((function(r){k.add(e(r,n,P,r,t,N))})):_(t)&&t.forEach((function(r,o){k.set(o,e(r,n,P,o,t,N))}));var F=L?void 0:(U?D?h:d:D?I:E)(t);return o(F||t,(function(r,o){F&&(r=t[o=r]),i(k,o,e(r,n,P,o,t,N))})),k}},9413:(e,t,n)=>{var r=n(9259),o=Object.create,i=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=i},3324:(e,t,n)=>{var r=n(7297),o=n(3812);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n<i;)e=e[o(t[n++])];return n&&n==i?e:void 0}},1897:(e,t,n)=>{var r=n(5067),o=n(6152);e.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}},3366:(e,t,n)=>{var r=n(857),o=n(2107),i=n(7157),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},5183:(e,t,n)=>{var r=n(3366),o=n(5125);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},4511:(e,t,n)=>{var r=n(940),o=n(5125);e.exports=function(e){return o(e)&&"[object Map]"==r(e)}},6840:(e,t,n)=>{var r=n(1049),o=n(7394),i=n(9259),a=n(7035),s=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,l=c.toString,p=u.hasOwnProperty,d=RegExp("^"+l.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?d:s).test(a(e))}},8436:(e,t,n)=>{var r=n(940),o=n(5125);e.exports=function(e){return o(e)&&"[object Set]"==r(e)}},5522:(e,t,n)=>{var r=n(3366),o=n(1158),i=n(5125),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[r(e)]}},6411:(e,t,n)=>{var r=n(6001),o=n(4248),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},8390:(e,t,n)=>{var r=n(9259),o=n(6001),i=n(2966),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=o(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},2857:(e,t,n)=>{var r=n(91),o=n(7297),i=n(9045),a=n(9259),s=n(3812);e.exports=function(e,t,n,c){if(!a(e))return e;for(var u=-1,l=(t=o(t,e)).length,p=l-1,d=e;null!=d&&++u<l;){var h=s(t[u]),f=n;if("__proto__"===h||"constructor"===h||"prototype"===h)return e;if(u!=p){var m=d[h];void 0===(f=c?c(m,h,d):void 0)&&(f=a(m)?m:i(t[u+1])?[]:{})}r(d,h,f),d=d[h]}return e}},9872:e=>{e.exports=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}},6473:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},1054:(e,t,n)=>{var r=n(857),o=n(343),i=n(6152),a=n(4795),s=r?r.prototype:void 0,c=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(a(t))return c?c.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},7826:e=>{e.exports=function(e){return function(t){return e(t)}}},9078:(e,t,n)=>{var r=n(7297),o=n(6974),i=n(2721),a=n(3812);e.exports=function(e,t){return t=r(t,e),null==(e=i(e,t))||delete e[a(o(t))]}},7297:(e,t,n)=>{var r=n(6152),o=n(1401),i=n(4452),a=n(6188);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:i(a(e))}},9882:(e,t,n)=>{var r=n(9162);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},2175:(e,t,n)=>{e=n.nmd(e);var r=n(7772),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},4727:(e,t,n)=>{var r=n(9882);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},6058:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},169:(e,t,n)=>{var r=n(857),o=r?r.prototype:void 0,i=o?o.valueOf:void 0;e.exports=function(e){return i?Object(i.call(e)):{}}},6190:(e,t,n)=>{var r=n(9882);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},1522:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},752:(e,t,n)=>{var r=n(91),o=n(3940);e.exports=function(e,t,n,i){var a=!n;n||(n={});for(var s=-1,c=t.length;++s<c;){var u=t[s],l=i?i(n[u],e[u],u,n,e):void 0;void 0===l&&(l=e[u]),a?o(n,u,l):r(n,u,l)}return n}},7680:(e,t,n)=>{var r=n(752),o=n(633);e.exports=function(e,t){return r(e,o(e),t)}},9987:(e,t,n)=>{var r=n(752),o=n(2680);e.exports=function(e,t){return r(e,o(e),t)}},4019:(e,t,n)=>{var r=n(7772)["__core-js_shared__"];e.exports=r},3043:(e,t,n)=>{var r=n(8761),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},1242:e=>{var t="object"==typeof global&&global&&global.Object===Object&&global;e.exports=t},3483:(e,t,n)=>{var r=n(1897),o=n(633),i=n(249);e.exports=function(e){return r(e,i,o)}},6939:(e,t,n)=>{var r=n(1897),o=n(2680),i=n(8582);e.exports=function(e){return r(e,i,o)}},7937:(e,t,n)=>{var r=n(8304);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},8761:(e,t,n)=>{var r=n(6840),o=n(8109);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},7353:(e,t,n)=>{var r=n(241)(Object.getPrototypeOf,Object);e.exports=r},2107:(e,t,n)=>{var r=n(857),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[s]=n:delete e[s]),o}},633:(e,t,n)=>{var r=n(7552),o=n(981),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return i.call(e,t)})))}:o;e.exports=s},2680:(e,t,n)=>{var r=n(5067),o=n(7353),i=n(633),a=n(981),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:a;e.exports=s},940:(e,t,n)=>{var r=n(9515),o=n(326),i=n(2760),a=n(2143),s=n(3215),c=n(3366),u=n(7035),l="[object Map]",p="[object Promise]",d="[object Set]",h="[object WeakMap]",f="[object DataView]",m=u(r),v=u(o),g=u(i),b=u(a),y=u(s),_=c;(r&&_(new r(new ArrayBuffer(1)))!=f||o&&_(new o)!=l||i&&_(i.resolve())!=p||a&&_(new a)!=d||s&&_(new s)!=h)&&(_=function(e){var t=c(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case m:return f;case v:return l;case g:return p;case b:return d;case y:return h}return t}),e.exports=_},8109:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},2118:(e,t,n)=>{var r=n(9191);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},6909:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},8138:(e,t,n)=>{var r=n(9191),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},4174:(e,t,n)=>{var r=n(9191),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},7942:(e,t,n)=>{var r=n(9191);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},9917:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},8222:(e,t,n)=>{var r=n(9882),o=n(4727),i=n(6058),a=n(169),s=n(6190);e.exports=function(e,t,n){var c=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return o(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return i(e);case"[object Symbol]":return a(e)}}},8725:(e,t,n)=>{var r=n(9413),o=n(7353),i=n(6001);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:r(o(e))}},9045:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},1401:(e,t,n)=>{var r=n(6152),o=n(4795),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||a.test(e)||!i.test(e)||null!=t&&e in Object(t)}},8304:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7394:(e,t,n)=>{var r,o=n(4019),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},6001:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},3945:e=>{e.exports=function(){this.__data__=[],this.size=0}},1846:(e,t,n)=>{var r=n(2218),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}},8028:(e,t,n)=>{var r=n(2218);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},6018:(e,t,n)=>{var r=n(2218);e.exports=function(e){return r(this.__data__,e)>-1}},4769:(e,t,n)=>{var r=n(2218);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},2411:(e,t,n)=>{var r=n(9612),o=n(235),i=n(326);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},6417:(e,t,n)=>{var r=n(7937);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},6928:(e,t,n)=>{var r=n(7937);e.exports=function(e){return r(this,e).get(e)}},9493:(e,t,n)=>{var r=n(7937);e.exports=function(e){return r(this,e).has(e)}},4150:(e,t,n)=>{var r=n(7937);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},7777:(e,t,n)=>{var r=n(733);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},9191:(e,t,n)=>{var r=n(8761)(Object,"create");e.exports=r},4248:(e,t,n)=>{var r=n(241)(Object.keys,Object);e.exports=r},2966:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},4146:(e,t,n)=>{e=n.nmd(e);var r=n(1242),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,s=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},7157:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},241:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},2721:(e,t,n)=>{var r=n(3324),o=n(9872);e.exports=function(e,t){return t.length<2?e:r(e,o(t,0,-1))}},7772:(e,t,n)=>{var r=n(1242),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},5243:(e,t,n)=>{var r=n(235);e.exports=function(){this.__data__=new r,this.size=0}},2858:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},4417:e=>{e.exports=function(e){return this.__data__.get(e)}},8605:e=>{e.exports=function(e){return this.__data__.has(e)}},1418:(e,t,n)=>{var r=n(235),o=n(326),i=n(6738);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},4452:(e,t,n)=>{var r=n(7777),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,n,r,o){t.push(r?o.replace(i,"$1"):n||e)})),t}));e.exports=a},3812:(e,t,n)=>{var r=n(4795);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7035:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},9850:(e,t,n)=>{var r=n(8874);e.exports=function(e){return r(e,5)}},1225:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},9631:(e,t,n)=>{var r=n(5183),o=n(5125),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=c},6152:e=>{var t=Array.isArray;e.exports=t},7878:(e,t,n)=>{var r=n(1049),o=n(1158);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},3226:(e,t,n)=>{e=n.nmd(e);var r=n(7772),o=n(6330),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,s=a&&a.exports===i?r.Buffer:void 0,c=(s?s.isBuffer:void 0)||o;e.exports=c},1049:(e,t,n)=>{var r=n(3366),o=n(9259);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1158:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},4714:(e,t,n)=>{var r=n(4511),o=n(7826),i=n(4146),a=i&&i.isMap,s=a?o(a):r;e.exports=s},9259:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5125:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},3679:(e,t,n)=>{var r=n(8436),o=n(7826),i=n(4146),a=i&&i.isSet,s=a?o(a):r;e.exports=s},4795:(e,t,n)=>{var r=n(3366),o=n(5125);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},7598:(e,t,n)=>{var r=n(5522),o=n(7826),i=n(4146),a=i&&i.isTypedArray,s=a?o(a):r;e.exports=s},249:(e,t,n)=>{var r=n(1634),o=n(6411),i=n(7878);e.exports=function(e){return i(e)?r(e):o(e)}},8582:(e,t,n)=>{var r=n(1634),o=n(8390),i=n(7878);e.exports=function(e){return i(e)?r(e,!0):o(e)}},6974:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},733:(e,t,n)=>{var r=n(6738);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},6765:(e,t,n)=>{var r=n(2857);e.exports=function(e,t,n){return null==e?e:r(e,t,n)}},981:e=>{e.exports=function(){return[]}},6330:e=>{e.exports=function(){return!1}},6188:(e,t,n)=>{var r=n(1054);e.exports=function(e){return null==e?"":r(e)}},7195:(e,t,n)=>{var r=n(9078);e.exports=function(e,t){return null==e||r(e,t)}},9474:(e,t,n)=>{e.exports=n(7104)},6856:(e,t,n)=>{"use strict";var r,o,i,a=n(9474),s=n(1017).extname,c=/^\s*([^;\s]*)(?:;|\s|$)/,u=/^text\//i;function l(e){if(!e||"string"!=typeof e)return!1;var t=c.exec(e),n=t&&a[t[1].toLowerCase()];return n&&n.charset?n.charset:!(!t||!u.test(t[1]))&&"UTF-8"}t.charset=l,t.charsets={lookup:l},t.contentType=function(e){if(!e||"string"!=typeof e)return!1;var n=-1===e.indexOf("/")?t.lookup(e):e;if(!n)return!1;if(-1===n.indexOf("charset")){var r=t.charset(n);r&&(n+="; charset="+r.toLowerCase())}return n},t.extension=function(e){if(!e||"string"!=typeof e)return!1;var n=c.exec(e),r=n&&t.extensions[n[1].toLowerCase()];return!(!r||!r.length)&&r[0]},t.extensions=Object.create(null),t.lookup=function(e){if(!e||"string"!=typeof e)return!1;var n=s("x."+e).toLowerCase().substr(1);return n&&t.types[n]||!1},t.types=Object.create(null),r=t.extensions,o=t.types,i=["nginx","apache",void 0,"iana"],Object.keys(a).forEach((function(e){var t=a[e],n=t.extensions;if(n&&n.length){r[e]=n;for(var s=0;s<n.length;s++){var c=n[s];if(o[c]){var u=i.indexOf(a[o[c]].source),l=i.indexOf(t.source);if("application/octet-stream"!==o[c]&&(u>l||u===l&&"application/"===o[c].substr(0,12)))continue}o[c]=e}}}))},2764:e=>{"use strict";e.exports=require("@cloudbase/adapter-interface")},7917:e=>{"use strict";e.exports=require("@cloudbase/adapter-wx_mp")},8899:e=>{"use strict";e.exports=require("@cloudbase/signature-nodejs")},8630:e=>{"use strict";e.exports=require("@cloudbase/wx-cloud-client-sdk")},766:e=>{"use strict";e.exports=require("@mattiasbuelens/web-streams-adapter")},2701:e=>{"use strict";e.exports=require("bson")},156:e=>{"use strict";e.exports=require("jsonwebtoken")},3107:e=>{"use strict";e.exports=require("jwt-decode")},6282:e=>{"use strict";e.exports=require("text-encoding-shim")},8775:e=>{"use strict";e.exports=require("web-streams-polyfill")},6850:e=>{"use strict";e.exports=require("ws")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},5687:e=>{"use strict";e.exports=require("https")},1017:e=>{"use strict";e.exports=require("path")},2781:e=>{"use strict";e.exports=require("stream")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")},7104:e=>{"use strict";e.exports=JSON.parse('{"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/3gpphal+json":{"source":"iana","compressible":true},"application/3gpphalforms+json":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/ace+cbor":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/alto-updatestreamcontrol+json":{"source":"iana","compressible":true},"application/alto-updatestreamparams+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/at+jwt":{"source":"iana"},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true,"extensions":["atomdeleted"]},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atsc-dwd+xml":{"source":"iana","compressible":true,"extensions":["dwd"]},"application/atsc-dynamic-event-message":{"source":"iana"},"application/atsc-held+xml":{"source":"iana","compressible":true,"extensions":["held"]},"application/atsc-rdt+json":{"source":"iana","compressible":true},"application/atsc-rsat+xml":{"source":"iana","compressible":true,"extensions":["rsat"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true,"extensions":["xcs"]},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/captive+json":{"source":"iana","compressible":true},"application/cbor":{"source":"iana"},"application/cbor-seq":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cdfx+xml":{"source":"iana","compressible":true,"extensions":["cdfx"]},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/cea":{"source":"iana"},"application/cea-2018+xml":{"source":"iana","compressible":true},"application/cellml+xml":{"source":"iana","compressible":true},"application/cfw":{"source":"iana"},"application/city+json":{"source":"iana","compressible":true},"application/clr":{"source":"iana"},"application/clue+xml":{"source":"iana","compressible":true},"application/clue_info+xml":{"source":"iana","compressible":true},"application/cms":{"source":"iana"},"application/cnrp+xml":{"source":"iana","compressible":true},"application/coap-group+json":{"source":"iana","compressible":true},"application/coap-payload":{"source":"iana"},"application/commonground":{"source":"iana"},"application/conference-info+xml":{"source":"iana","compressible":true},"application/cose":{"source":"iana"},"application/cose-key":{"source":"iana"},"application/cose-key-set":{"source":"iana"},"application/cpl+xml":{"source":"iana","compressible":true,"extensions":["cpl"]},"application/csrattrs":{"source":"iana"},"application/csta+xml":{"source":"iana","compressible":true},"application/cstadata+xml":{"source":"iana","compressible":true},"application/csvm+json":{"source":"iana","compressible":true},"application/cu-seeme":{"source":"apache","extensions":["cu"]},"application/cwt":{"source":"iana"},"application/cybercash":{"source":"iana"},"application/dart":{"compressible":true},"application/dash+xml":{"source":"iana","compressible":true,"extensions":["mpd"]},"application/dash-patch+xml":{"source":"iana","compressible":true,"extensions":["mpp"]},"application/dashdelta":{"source":"iana"},"application/davmount+xml":{"source":"iana","compressible":true,"extensions":["davmount"]},"application/dca-rft":{"source":"iana"},"application/dcd":{"source":"iana"},"application/dec-dx":{"source":"iana"},"application/dialog-info+xml":{"source":"iana","compressible":true},"application/dicom":{"source":"iana"},"application/dicom+json":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/dns-message":{"source":"iana"},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dots+cbor":{"source":"iana"},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/ecmascript":{"source":"iana","compressible":true,"extensions":["es","ecma"]},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/elm+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/elm+xml":{"source":"iana","compressible":true},"application/emergencycalldata.cap+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true,"extensions":["emotionml"]},"application/encaprtp":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/expect-ct-report+json":{"source":"iana","compressible":true},"application/express":{"source":"iana","extensions":["exp"]},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdt+xml":{"source":"iana","compressible":true,"extensions":["fdt"]},"application/fhir+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/fhir+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/flexfec":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geopackage+sqlite3":{"source":"iana"},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true,"extensions":["its"]},"application/java-archive":{"source":"apache","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/jscalendar+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true,"extensions":["lgr"]},"application/link-format":{"source":"iana"},"application/load-control+xml":{"source":"iana","compressible":true},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lpf+zip":{"source":"iana","compressible":false},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true,"extensions":["mpf"]},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mipc":{"source":"iana"},"application/missing-blocks+cbor-seq":{"source":"iana"},"application/mmt-aei+xml":{"source":"iana","compressible":true,"extensions":["maei"]},"application/mmt-usd+xml":{"source":"iana","compressible":true,"extensions":["musd"]},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true},"application/mrb-publish+xml":{"source":"iana","compressible":true},"application/msc-ivr+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msc-mixer+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/multipart-core":{"source":"iana"},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana","extensions":["nq"]},"application/n-triples":{"source":"iana","extensions":["nt"]},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana","charset":"US-ASCII"},"application/news-groupinfo":{"source":"iana","charset":"US-ASCII"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana","extensions":["cjs"]},"application/nss":{"source":"iana"},"application/oauth-authz-req+jwt":{"source":"iana"},"application/oblivious-dns-message":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":false,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odm+xml":{"source":"iana","compressible":true},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{"source":"iana","compressible":true},"application/oscore":{"source":"iana"},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p21":{"source":"iana"},"application/p21+zip":{"source":"iana","compressible":false},"application/p2p-overlay+xml":{"source":"iana","compressible":true,"extensions":["relo"]},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pem-certificate-chain":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana","extensions":["asc"]},"application/pgp-signature":{"source":"iana","extensions":["asc","sig"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pidf-diff+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true,"extensions":["provx"]},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.cyn":{"source":"iana","charset":"7-BIT"},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/pvd+json":{"source":"iana","compressible":true},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"iana"},"application/reputon+json":{"source":"iana","compressible":true},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true,"extensions":["rapd"]},"application/route-s-tsid+xml":{"source":"iana","compressible":true,"extensions":["sls"]},"application/route-usd+xml":{"source":"iana","compressible":true,"extensions":["rusd"]},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sarif+json":{"source":"iana","compressible":true},"application/sarif-external-properties+json":{"source":"iana","compressible":true},"application/sbe":{"source":"iana"},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true,"extensions":["senmlx"]},"application/senml-etch+cbor":{"source":"iana"},"application/senml-etch+json":{"source":"iana","compressible":true},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true,"extensions":["sensmlx"]},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana","extensions":["siv","sieve"]},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/sipc":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"iana"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spdx+json":{"source":"iana","compressible":true},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana"},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/stix+json":{"source":"iana","compressible":true},"application/swid+xml":{"source":"iana","compressible":true,"extensions":["swidtag"]},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/td+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/tetra_isi":{"source":"iana"},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/token-introspection+jwt":{"source":"iana"},"application/toml":{"compressible":true,"extensions":["toml"]},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana","extensions":["trig"]},"application/ttml+xml":{"source":"iana","compressible":true,"extensions":["ttml"]},"application/tve-trigger":{"source":"iana"},"application/tzif":{"source":"iana"},"application/tzif-leap":{"source":"iana"},"application/ubjson":{"compressible":false,"extensions":["ubj"]},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true,"extensions":["rsheet"]},"application/urc-targetdesc+xml":{"source":"iana","compressible":true,"extensions":["td"]},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true,"extensions":["1km"]},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.5gnas":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gtpc":{"source":"iana"},"application/vnd.3gpp.interworking-data":{"source":"iana"},"application/vnd.3gpp.lpp":{"source":"iana"},"application/vnd.3gpp.mc-signalling-ear":{"source":"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-init-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-transmission-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ngap":{"source":"iana"},"application/vnd.3gpp.pfcp":{"source":"iana"},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.s1ap":{"source":"iana"},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"iana","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.afplinedata-pagedef":{"source":"iana"},"application/vnd.afpc.cmoca-cmresource":{"source":"iana"},"application/vnd.afpc.foca-charset":{"source":"iana"},"application/vnd.afpc.foca-codedfont":{"source":"iana"},"application/vnd.afpc.foca-codepage":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.afpc.modca-cmtable":{"source":"iana"},"application/vnd.afpc.modca-formdef":{"source":"iana"},"application/vnd.afpc.modca-mediummap":{"source":"iana"},"application/vnd.afpc.modca-objectcontainer":{"source":"iana"},"application/vnd.afpc.modca-overlay":{"source":"iana"},"application/vnd.afpc.modca-pagesegment":{"source":"iana"},"application/vnd.age":{"source":"iana","extensions":["age"]},"application/vnd.ah-barcode":{"source":"iana"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.ota":{"source":"iana"},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.arrow.file":{"source":"iana"},"application/vnd.apache.arrow.stream":{"source":"iana"},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.aplextor.warrp+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.keynote":{"source":"iana","extensions":["key"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.numbers":{"source":"iana","extensions":["numbers"]},"application/vnd.apple.pages":{"source":"iana","extensions":["pages"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"iana"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true,"extensions":["bmml"]},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.error":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.bpf":{"source":"iana"},"application/vnd.bpf3":{"source":"iana"},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.ciedi":{"source":"iana"},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.cryptii.pipe+json":{"source":"iana","compressible":true},"application/vnd.crypto-shade-file":{"source":"iana"},"application/vnd.cryptomator.encrypted":{"source":"iana"},"application/vnd.cryptomator.vault":{"source":"iana"},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.cyclonedx+json":{"source":"iana","compressible":true},"application/vnd.cyclonedx+xml":{"source":"iana","compressible":true},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.d3m-dataset":{"source":"iana"},"application/vnd.d3m-problem":{"source":"iana"},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.dbf":{"source":"iana","extensions":["dbf"]},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume.movie":{"source":"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbisl+xml":{"source":"iana","compressible":true},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.eclipse.ditto+json":{"source":"iana","compressible":true},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eu.kasparian.car+json":{"source":"iana","compressible":true},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.exstream-empower+zip":{"source":"iana","compressible":false},"application/vnd.exstream-package":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.familysearch.gedcom+zip":{"source":"iana","compressible":false},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"iana","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.ffsns":{"source":"iana"},"application/vnd.ficlab.flb+zip":{"source":"iana","compressible":false},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{"source":"iana","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"iana","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujifilm.fb.docuworks":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.container":{"source":"iana"},"application/vnd.fujifilm.fb.jfi+xml":{"source":"iana","compressible":true},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.futoin+cbor":{"source":"iana"},"application/vnd.futoin+json":{"source":"iana","compressible":true},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.gentics.grd+json":{"source":"iana","compressible":true},"application/vnd.geo+json":{"source":"iana","compressible":true},"application/vnd.geocube+xml":{"source":"iana","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.slides":{"source":"iana"},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"iana","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hl7cda+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.hl7v2+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"iana"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"iana","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"iana"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.iso11783-10+zip":{"source":"iana","compressible":false},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las":{"source":"iana"},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.laszip":{"source":"iana"},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.logipipe.circuit+zip":{"source":"iana","compressible":false},"application/vnd.loom":{"source":"iana"},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana","extensions":["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxar.archive.3tz+zip":{"source":"iana","compressible":false},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.nacamar.ybrid+json":{"source":"iana","compressible":true},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nebumind.line":{"source":"iana"},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true,"extensions":["ac"]},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"iana","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"iana","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oci.image.manifest.v1+json":{"source":"iana","compressible":true},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+cbor":{"source":"iana"},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true,"extensions":["obgx"]},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true,"extensions":["osm"]},"application/vnd.opentimestamps.ots":{"source":"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos.xml":{"source":"iana"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.patientecommsdoc":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana","extensions":["rar"]},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.resilient.logic":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sar":{"source":"iana"},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.seis+json":{"source":"iana","compressible":true},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shade-save-file":{"source":"iana"},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.shopkick+json":{"source":"iana","compressible":true},"application/vnd.shp":{"source":"iana"},"application/vnd.shx":{"source":"iana"},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.snesdev-page-table":{"source":"iana"},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true,"extensions":["fo"]},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.sycle+xml":{"source":"iana","compressible":true},"application/vnd.syft+json":{"source":"iana","compressible":true},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","charset":"UTF-8","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.veritone.aion+json":{"source":"iana","compressible":true},"application/vnd.veryant.thin":{"source":"iana"},"application/vnd.ves.encrypted":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","charset":"UTF-8","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.dpp":{"source":"iana"},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.youtube.yt":{"source":"iana"},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"source":"iana","compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true,"extensions":["wif"]},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-iwork-keynote-sffkey":{"extensions":["key"]},"application/x-iwork-numbers-sffnumbers":{"extensions":["numbers"]},"application/x-iwork-pages-sffpages":{"extensions":["pages"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-keepass2":{"extensions":["kdbx"]},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-pki-message":{"source":"iana"},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"iana","extensions":["der","crt","pem"]},"application/x-x509-ca-ra-cert":{"source":"iana"},"application/x-x509-next-ca-cert":{"source":"iana"},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true,"extensions":["xav"]},"application/xcap-caps+xml":{"source":"iana","compressible":true,"extensions":["xca"]},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true,"extensions":["xel"]},"application/xcap-error+xml":{"source":"iana","compressible":true},"application/xcap-ns+xml":{"source":"iana","compressible":true,"extensions":["xns"]},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true,"extensions":["xlf"]},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xsl","xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zlib":{"source":"iana"},"application/zstd":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana"},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana","extensions":["amr"]},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/flexfec":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/mhas":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/mobile-xmf":{"source":"iana","extensions":["mxmf"]},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx","opus"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/scip":{"source":"iana"},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sofa":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tetra_acelp":{"source":"iana"},"audio/tetra_acelp_bb":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/tsvcis":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dts.uhd":{"source":"iana"},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"iana"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","compressible":true,"extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana","extensions":["exr"]},"image/apng":{"compressible":false,"extensions":["apng"]},"image/avci":{"source":"iana","extensions":["avci"]},"image/avcs":{"source":"iana","extensions":["avcs"]},"image/avif":{"source":"iana","compressible":false,"extensions":["avif"]},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana","extensions":["drle"]},"image/emf":{"source":"iana","extensions":["emf"]},"image/fits":{"source":"iana","extensions":["fits"]},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/heic":{"source":"iana","extensions":["heic"]},"image/heic-sequence":{"source":"iana","extensions":["heics"]},"image/heif":{"source":"iana","extensions":["heif"]},"image/heif-sequence":{"source":"iana","extensions":["heifs"]},"image/hej2k":{"source":"iana","extensions":["hej2"]},"image/hsj2":{"source":"iana","extensions":["hsj2"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/jls":{"source":"iana","extensions":["jls"]},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpeg","jpg","jpe"]},"image/jph":{"source":"iana","extensions":["jph"]},"image/jphc":{"source":"iana","extensions":["jhc"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/jxr":{"source":"iana","extensions":["jxr"]},"image/jxra":{"source":"iana","extensions":["jxra"]},"image/jxrs":{"source":"iana","extensions":["jxrs"]},"image/jxs":{"source":"iana","extensions":["jxs"]},"image/jxsc":{"source":"iana","extensions":["jxsc"]},"image/jxsi":{"source":"iana","extensions":["jxsi"]},"image/jxss":{"source":"iana","extensions":["jxss"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/ktx2":{"source":"iana","extensions":["ktx2"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif"]},"image/prs.pti":{"source":"iana","extensions":["pti"]},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana","extensions":["t38"]},"image/tiff":{"source":"iana","compressible":false,"extensions":["tif","tiff"]},"image/tiff-fx":{"source":"iana","extensions":["tfx"]},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana","extensions":["azv"]},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana","compressible":true,"extensions":["ico"]},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-dds":{"compressible":true,"extensions":["dds"]},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.pco.b16":{"source":"iana","extensions":["b16"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana","extensions":["tap"]},"image/vnd.valve.source.texture":{"source":"iana","extensions":["vtf"]},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana","extensions":["pcx"]},"image/webp":{"source":"apache","extensions":["webp"]},"image/wmf":{"source":"iana","extensions":["wmf"]},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/news":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime"]},"message/s-http":{"source":"iana"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"iana"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana","extensions":["3mf"]},"model/e57":{"source":"iana"},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/mtl":{"source":"iana","extensions":["mtl"]},"model/obj":{"source":"iana","extensions":["obj"]},"model/step":{"source":"iana"},"model/step+xml":{"source":"iana","compressible":true,"extensions":["stpx"]},"model/step+zip":{"source":"iana","compressible":false,"extensions":["stpz"]},"model/step-xml+zip":{"source":"iana","compressible":false,"extensions":["stpxz"]},"model/stl":{"source":"iana","extensions":["stl"]},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana","extensions":["ogex"]},"model/vnd.parasolid.transmit.binary":{"source":"iana","extensions":["x_b"]},"model/vnd.parasolid.transmit.text":{"source":"iana","extensions":["x_t"]},"model/vnd.pytha.pyox":{"source":"iana"},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.sap.vds":{"source":"iana","extensions":["vds"]},"model/vnd.usdz+zip":{"source":"iana","compressible":false,"extensions":["usdz"]},"model/vnd.valve.source.compiled-map":{"source":"iana","extensions":["bsp"]},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana","extensions":["x3db"]},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana","extensions":["x3dv"]},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana"},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/cql":{"source":"iana"},"text/cql-expression":{"source":"iana"},"text/cql-identifier":{"source":"iana"},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"iana"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/fhirpath":{"source":"iana"},"text/flexfec":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/gff3":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","compressible":true},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"compressible":true,"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["markdown","md"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mdx":{"compressible":true,"extensions":["mdx"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana","charset":"UTF-8"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana","charset":"UTF-8"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shaclc":{"source":"iana"},"text/shex":{"source":"iana","extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/spdx":{"source":"iana","extensions":["spdx"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana","charset":"UTF-8"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana","charset":"UTF-8"},"text/vnd.familysearch.gedcom":{"source":"iana","extensions":["ged"]},"text/vnd.ficlab.flt":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hans":{"source":"iana"},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.senx.warpscript":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"iana"},"text/vnd.sosi":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","charset":"UTF-8","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana","charset":"UTF-8"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vtt":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"compressible":true,"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/av1":{"source":"iana"},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/ffv1":{"source":"iana"},"video/flexfec":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/iso.segment":{"source":"iana","extensions":["m4s"]},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/jxsv":{"source":"iana"},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/scip":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vc2":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"iana"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vnd.youtube.yt":{"source":"iana"},"video/vp8":{"source":"iana"},"video/vp9":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}}')}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,o),i.loaded=!0,i.exports}t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);o.r(i);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&n;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((e=>a[e]=()=>n[e]));return a.default=()=>n,o.d(i,a),i},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var i=o(4144);module.exports=i})();
|
|
2
|
+
(()=>{var e,t,n={9954:(e,t,n)=>{e.exports={parallel:n(8197),serial:n(8967),serialOrdered:n(982)}},190:e=>{function t(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}e.exports=function(e){Object.keys(e.jobs).forEach(t.bind(e)),e.jobs={}}},1307:(e,t,n)=>{var r=n(8765);e.exports=function(e){var t=!1;return r((function(){t=!0})),function(n,o){t?e(n,o):r((function(){e(n,o)}))}}},8765:e=>{e.exports=function(e){var t="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;t?t(e):setTimeout(e,0)}},5798:(e,t,n)=>{var r=n(1307),o=n(190);e.exports=function(e,t,n,i){var a=n.keyedList?n.keyedList[n.index]:n.index;n.jobs[a]=function(e,t,n,o){return 2==e.length?e(n,r(o)):e(n,t,r(o))}(t,a,e[a],(function(e,t){a in n.jobs&&(delete n.jobs[a],e?o(n):n.results[a]=t,i(e,n.results))}))}},7379:e=>{e.exports=function(e,t){var n=!Array.isArray(e),r={index:0,keyedList:n||t?Object.keys(e):null,jobs:{},results:n?{}:[],size:n?Object.keys(e).length:e.length};return t&&r.keyedList.sort(n?t:function(n,r){return t(e[n],e[r])}),r}},3797:(e,t,n)=>{var r=n(190),o=n(1307);e.exports=function(e){Object.keys(this.jobs).length&&(this.index=this.size,r(this),o(e)(null,this.results))}},8197:(e,t,n)=>{var r=n(5798),o=n(7379),i=n(3797);e.exports=function(e,t,n){for(var a=o(e);a.index<(a.keyedList||e).length;)r(e,t,a,(function(e,t){e?n(e,t):0!==Object.keys(a.jobs).length||n(null,a.results)})),a.index++;return i.bind(a,n)}},8967:(e,t,n)=>{var r=n(982);e.exports=function(e,t,n){return r(e,t,null,n)}},982:(e,t,n)=>{var r=n(5798),o=n(7379),i=n(3797);function a(e,t){return e<t?-1:e>t?1:0}e.exports=function(e,t,n,a){var s=o(e,n);return r(e,t,s,(function n(o,i){o?a(o,i):(s.index++,s.index<(s.keyedList||e).length?r(e,t,s,n):a(null,s.results))})),i.bind(s,a)},e.exports.ascending=a,e.exports.descending=function(e,t){return-1*a(e,t)}},7756:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AI=void 0;var u=n(9737),l=a(n(5305)),p=n(1689),d=n(2877),h=l.MODELS,f=function(){function e(e,t,n,o){var i=this;this.req=e,this.baseUrl=t,this.modelRequest=function(e){var t=e.url,n=e.data,o=e.headers,a=e.stream,u=e.timeout;return s(i,void 0,void 0,(function(){var e,i,s,l,p,d,h;return c(this,(function(c){switch(c.label){case 0:return e={"Content-Type":"application/json"},a&&Object.assign(e,{Accept:"text/event-stream"}),[4,this.req.fetch({method:"post",headers:r(r((p={},p[null===(d=this.i18n)||void 0===d?void 0:d.LANG_HEADER_KEY]=null===(h=this.i18n)||void 0===h?void 0:h.lang,p),e),o),body:JSON.stringify(n),url:this.resolveUrl(t),stream:a,timeout:u})];case 1:return i=c.sent(),s=i.data,l=i.header,[2,this.handleResponseData(s,l)]}}))}))},this.botRequest=function(e){var t=e.method,n=e.url,o=e.data,a=void 0===o?{}:o,u=e.headers,l=e.stream,p=e.timeout;return s(i,void 0,void 0,(function(){var e,o,i,s,d,h,f,m,v;return c(this,(function(c){switch(c.label){case 0:return e=this.resolveUrl(n),"get"!==t?[3,2]:(o=this.handleResponseData,[4,this.req.fetch({url:"".concat(e,"?").concat((g=a,Object.entries(g).map((function(e){var t=e[0],n=e[1];return"".concat(t,"=").concat(n)})).join("&"))),method:t,headers:u,stream:l,timeout:p})]);case 1:return[2,o.apply(this,[c.sent().data])];case 2:return i={"Content-Type":"application/json"},l&&Object.assign(i,{Accept:"text/event-stream"}),[4,this.req.fetch({url:e,body:JSON.stringify(a),headers:r(r((f={},f[null===(m=this.i18n)||void 0===m?void 0:m.LANG_HEADER_KEY]=null===(v=this.i18n)||void 0===v?void 0:v.lang,f),i),u),stream:l,method:t,timeout:p})];case 3:return s=c.sent(),d=s.data,h=s.header,[2,this.handleResponseData(d,h)]}var g}))}))},this._getBaseUrl=o,this.bot=new u.Bot(this.botRequest,this.aiBotBaseUrl),this.i18n=n,d.langEvent.bus.on(d.langEvent.LANG_CHANGE_EVENT,(function(e){var t;i.i18n=(null===(t=e.data)||void 0===t?void 0:t.i18n)||i.i18n}))}return Object.defineProperty(e.prototype,"aiBaseUrl",{get:function(){return"".concat(this._getBaseUrl?this._getBaseUrl():this.baseUrl,"/ai")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"aiBotBaseUrl",{get:function(){return"".concat(this._getBaseUrl?this._getBaseUrl():this.baseUrl,"/aibot")},enumerable:!1,configurable:!0}),e.prototype.handleResponseData=function(e,t){var n,r;return s(this,void 0,void 0,(function(){var o,i;return c(this,(function(a){switch(a.label){case 0:return o="".concat(this.i18n.t("请检查调用方式,或前往云开发 AI+ 首页查看文档"),":https://tcb.cloud.tencent.com/dev#/ai"),"object"==typeof e&&e&&"then"in e?[4,e]:[3,2];case 1:if("object"==typeof(i=a.sent())&&i&&"code"in i&&"NORMAL"!==i.code)throw new Error("".concat(this.i18n.t("AI+ 请求出错,错误码"),":").concat(i.code,",").concat(this.i18n.t("错误信息"),":").concat(i.message,"\n").concat(o,"\n").concat(JSON.stringify(i,null,2)));return[2,e];case 2:return(null===(r=null===(n=null==t?void 0:t.get)||void 0===n?void 0:n.call(t,"content-type"))||void 0===r?void 0:r.includes("application/json"))?[4,(0,p.readableStream2JsonObject)(e)]:[3,4];case 3:if("object"==typeof(i=a.sent())&&i&&"code"in i&&"NORMAL"!==i.code)throw new Error("".concat(this.i18n.t("AI+ 请求出错,错误码"),":").concat(i.code,",").concat(this.i18n.t("错误信息"),":").concat(i.message,"\n").concat(o,"\n").concat(JSON.stringify(i,null,2)));a.label=4;case 4:return[2,e]}}))}))},e.prototype.createModel=function(e,t){var n,r=h[e];if(r)n=new r(this.modelRequest,this.aiBaseUrl);else{var o="string"==typeof(null==t?void 0:t.defaultModelSubUrl)?t.defaultModelSubUrl:"/chat/completions";n=new l.DefaultSimpleModel(this.modelRequest,this.aiBaseUrl,"".concat(e).concat(o))}return new l.ReactModel(n)},e.prototype.registerModel=function(e,t){null==h[e]?h[e]=t:console.warn("AI model ".concat(e," already exists!"))},e.prototype.createImageModel=function(e){return new l.DefaultImageModel(this.modelRequest,this.aiBaseUrl,e)},e.prototype.registerFunctionTool=function(e){l.toolMap.has(e.name)&&console.warn("AI function tool ".concat(e.name," already exists and will be overwritten!")),l.toolMap.set(e.name,e.fn)},e.prototype.resolveUrl=function(e){if(!this._getBaseUrl)return e;var t=this._getBaseUrl();return t!==this.baseUrl&&e.startsWith(this.baseUrl)?e.replace(this.baseUrl,t):e},e}();t.AI=f},9737:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},a=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.Bot=void 0;var s=n(1689),c=function(){function e(e,t){this.baseUrl=t;var n=arguments[2];this.req="string"==typeof n?function(t){var o=t.headers,i=void 0===o?{}:o,s=a(t,["headers"]);return e(r(r({},s),{headers:r(r({},i),{Authorization:"Bearer ".concat(n)})}))}:e}return e.prototype.list=function(e,t){return this.req({method:"get",url:this.join("bots"),data:e,timeout:null==t?void 0:t.timeout})},e.prototype.create=function(e,t){var n=e.botInfo;return this.req({method:"post",url:this.join("bots"),data:n,timeout:null==t?void 0:t.timeout})},e.prototype.get=function(e,t){var n=e.botId;return this.req({method:"get",url:this.join("bots/".concat(n)),timeout:null==t?void 0:t.timeout})},e.prototype.update=function(e,t){var n=e.botId,r=e.botInfo;return this.req({method:"PATCH",url:this.join("bots/".concat(n)),data:r,timeout:null==t?void 0:t.timeout})},e.prototype.delete=function(e,t){var n=e.botId;return this.req({method:"delete",url:this.join("bots/".concat(n)),timeout:null==t?void 0:t.timeout})},e.prototype.getChatRecords=function(e,t){return this.req({method:"get",url:this.join("bots/".concat(e.botId,"/records")),data:e,timeout:null==t?void 0:t.timeout})},e.prototype.sendFeedback=function(e,t){var n=e.userFeedback;return this.req({method:"post",url:this.join("bots/".concat(n.botId,"/feedback")),data:n,timeout:null==t?void 0:t.timeout})},e.prototype.getFeedback=function(e,t){return this.req({method:"get",url:this.join("bots/".concat(e.botId,"/feedback")),data:e,timeout:null==t?void 0:t.timeout})},e.prototype.uploadFiles=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.req({method:"post",url:this.join("bots/".concat(e.botId,"/files")),data:e,timeout:null==t?void 0:t.timeout})]}))}))},e.prototype.createConversation=function(e,t){var n=e.botId,r=a(e,["botId"]);return o(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.req({method:"post",url:this.join("bots/".concat(n,"/conversation")),data:r,timeout:null==t?void 0:t.timeout})]}))}))},e.prototype.getConversation=function(e,t){var n=e.pageSize,s=void 0===n?10:n,c=e.pageNumber,u=void 0===c?1:c,l=e.botId,p=a(e,["pageSize","pageNumber","botId"]);return o(this,void 0,void 0,(function(){var e,n;return i(this,(function(o){if(u<1)throw new Error("pageNumber must be greater than 0");return e=s*(u-1),n=s,[2,this.req({method:"get",url:this.join("bots/".concat(l,"/conversation")),data:r(r({},p),{offset:e,limit:n}),timeout:null==t?void 0:t.timeout})]}))}))},e.prototype.deleteConversation=function(e,t){var n=e.botId,r=e.conversationId,s=a(e,["botId","conversationId"]);return o(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.req({method:"delete",url:this.join("bots/".concat(n,"/conversation/").concat(r)),data:s,timeout:null==t?void 0:t.timeout})]}))}))},e.prototype.speechToText=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.req({method:"post",url:this.join("bots/".concat(e.botId,"/speech-to-text")),data:e,timeout:null==t?void 0:t.timeout})]}))}))},e.prototype.textToSpeech=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.req({method:"post",url:this.join("bots/".concat(e.botId,"/text-to-speech")),data:e,timeout:null==t?void 0:t.timeout})]}))}))},e.prototype.getTextToSpeechResult=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.req({method:"get",url:this.join("bots/".concat(e.botId,"/text-to-speech")),data:e,timeout:null==t?void 0:t.timeout})]}))}))},e.prototype.getRecommendQuestions=function(e,t){return o(this,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.req({method:"post",url:this.join("bots/".concat(e.botId,"/recommend-questions")),data:e,stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,new u(n)]}}))}))},e.prototype.generateBot=function(e,t){return o(this,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.req({method:"post",url:this.join("generate-bot"),data:e,stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,new u(n)]}}))}))},e.prototype.getPreview=function(e,t){return o(this,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.req({method:"post",url:this.join("preview"),data:e,stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,new u(n)]}}))}))},e.prototype.generateImage=function(e,t){return this.req({method:"post",url:this.join("generate-image"),data:e,timeout:null==t?void 0:t.timeout})},e.prototype.sendMessage=function(e,t){return o(this,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.req({method:"post",url:this.join("bots/".concat(e.botId,"/send-message")),data:e,stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,new u(n)]}}))}))},e.prototype.join=function(e){return"".concat(this.baseUrl,"/").concat(e)},e}();t.Bot=c;var u=function(){function e(e){var t=(0,s.toPolyfillReadable)(e);this._eventSourceStream=t.pipeThrough(new s.TextDecoderStream).pipeThrough((0,s.createEventSourceParserTransformStream)())}return Object.defineProperty(e.prototype,"teeedStream",{get:function(){var e=this._eventSourceStream.tee(),t=e[0],n=e[1];return this._eventSourceStream=n,t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"eventSourceStream",{get:function(){return(0,s.createAsyncIterable)(this.teeedStream)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataStream",{get:function(){return(0,s.createAsyncIterable)(this.eventSourceStream.pipeThrough(new s.TransformStream({transform:function(e,t){try{var n=JSON.parse(e.data);t.enqueue(n)}catch(n){"[DONE]"!==e.data?console.warn("Error when transforming event source data to json",n,e):t.terminate()}}})))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textStream",{get:function(){return(0,s.createAsyncIterable)(this.dataStream.pipeThrough(new s.TransformStream({transform:function(e,t){var n;t.enqueue(null!==(n=null==e?void 0:e.content)&&void 0!==n?n:"")}})))},enumerable:!1,configurable:!0}),e}()},9964:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createParser=void 0;var r=n(6298);Object.defineProperty(t,"createParser",{enumerable:!0,get:function(){return r.createParser}})},6298:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createParser=void 0,t.createParser=function(e){var t,r,o,i,a,s,c;return u(),{feed:function(e){r=r?r+e:e,t&&function(e){return n.every((function(t,n){return e.charCodeAt(n)===t}))}(r)&&(r=r.slice(n.length)),t=!1;for(var a=r.length,s=0,c=!1;s<a;){c&&("\n"===r[s]&&(s+=1),c=!1);for(var u=-1,p=i,d=void 0,h=o;u<0&&h<a;h++)":"===(d=r[h])&&p<0?p=h-s:"\r"===d?(c=!0,u=h-s):"\n"===d&&(u=h-s);if(u<0){o=a-s,i=p;break}o=0,i=-1,l(r,s,p,u),s+=u+1}s===a?r="":s>0&&(r=r.slice(s))},reset:u};function u(){t=!0,r="",o=0,i=-1,a=void 0,s=void 0,c=""}function l(t,n,r,o){if(0===o)return c.length>0&&(e({type:"event",id:a,event:s||void 0,data:c.slice(0,-1)}),c="",a=void 0),void(s=void 0);var i,u=r<0,l=t.slice(n,n+(u?o:r)),p=n+(i=u?o:" "===t[n+r+1]?r+2:r+1),d=o-i,h=t.slice(p,p+d).toString();if("data"===l)c+=h?"".concat(h,"\n"):"\n";else if("event"===l)s=h;else if("id"!==l||h.includes("\0")){if("retry"===l){var f=parseInt(h,10);Number.isNaN(f)||e({type:"reconnect-interval",value:f})}}else a=h}};var n=[239,187,191]},5337:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},c=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},u=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},l=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.registerAi=t.models=t.createAI=t.createAi=t.Bot=t.AI=void 0;var p=n(7756);Object.defineProperty(t,"AI",{enumerable:!0,get:function(){return p.AI}});var d=n(9737);Object.defineProperty(t,"Bot",{enumerable:!0,get:function(){return d.Bot}});var h=a(n(5305)),f=a(n(1689));t.utils=f,h.MODELS;var m=l(h,["MODELS"]);t.models=m;function v(e){var t=e.env,n=e.baseUrl,o=e.getBaseUrl,i=e.req,a=e.getAccessToken,s=e.handleReqInstance,d=e.i18n;return new p.AI(function(){if(null==s){if(null==a)throw new Error("`getAccessToken` is required when `handleReqInstance` is not provided!");return function(e){var t=e.getAccessToken,n=e.req;return{download:n.download,post:n.post,upload:n.upload,fetch:function(e){return c(void 0,void 0,void 0,(function(){var o,i,a,s,c;return u(this,(function(u){switch(u.label){case 0:if("function"!=typeof n.fetch)throw new Error("req.fetch is not a function");return o=e.token,i=e.headers,a=void 0===i?{}:i,s=l(e,["token","headers"]),null==o?[3,1]:(c=o,[3,3]);case 1:return[4,t()];case 2:c=u.sent().accessToken,u.label=3;case 3:return[2,n.fetch(r({headers:r({Authorization:"Bearer ".concat(c)},a)},s))]}}))}))}}}({req:i,getAccessToken:a})}return s({req:i})}(),function(){if(null!=o)return o();if(null!=n)return n;if(null==t)throw new Error("`env` is required when `baseUrl` is not provided!");return"https://".concat(t,".api.tcloudbasegateway.com/v1")}(),d,o)}t.createAI=v;var g=v;t.createAi=g;var b={name:"ai",entity:{ai:function(e){var t=this,n=this.request;if(null==n.fetch)throw new Error("cloudbase.request.fetch() unimplemented!");var r=function(){var e=t.getEndPointWithKey("GATEWAY"),n=e.BASE_URL,r=e.PROTOCOL;return"".concat(r).concat(n)};return(null==e?void 0:e.baseUrl)?v({req:n,baseUrl:e.baseUrl,handleReqInstance:function(e){return e.req},i18n:this.config.i18n}):v({req:n,baseUrl:r(),getBaseUrl:r,handleReqInstance:function(e){return e.req},i18n:this.config.i18n})}}};function y(e){try{e.registerComponent(b)}catch(e){console.warn(e)}}t.registerAi=y,s(n(4669),t);try{window.registerAi=y}catch(e){}},5476:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ArkSimpleModel=void 0;var a=n(1689);function s(e){var t=e.messages,n=e.model,o=e.temperature,i=e.tools,a=e.top_p;return r(r({},e),{messages:t,model:n,tools:i,top_p:a,temperature:o})}var c=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.subUrl="ark/api/v3/chat/completions",null!=n&&(this.subUrl=n)}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e,t){return o(this,void 0,Promise,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.req({url:this.url,data:r(r({},s(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=o.sent(),[2,r(r({},n),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return o(this,void 0,Promise,(function(){var n,o,c,u,l;return i(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:r(r({},s(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return o=i.sent(),c=(0,a.toPolyfillReadable)(o),u=(0,a.intoStandardStream)(c),l=u.pipeThrough(new a.TransformStream({transform:function(e,t){var o=e.choices.map((function(e){var t=e.delta;return null==n&&(n=(0,a.isToolCallAssistantMessage)(t)),n?r(r({},e),{finish_reason:"tool_calls",delta:t}):e})),i=r(r({},e),{choices:o});t.enqueue(r(r({},i),{rawResponse:e}))}})),[2,(0,a.createAsyncIterable)(l)]}}))}))},e}();t.ArkSimpleModel=c},7265:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.DSSimpleModel=void 0;var a=n(1689);function s(e){var t=e.messages,n=e.model,o=e.temperature,i=e.tools,a=e.top_p;return r(r({},e),{messages:t,model:n,tools:i,top_p:a,temperature:o})}var c=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.subUrl="dashscope/compatible-mode/v1/chat/completions",null!=n&&(this.subUrl=n)}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e,t){return o(this,void 0,Promise,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.req({url:this.url,data:r(r({},s(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=o.sent(),[2,r(r({},n),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return o(this,void 0,Promise,(function(){var n,o,c,u,l;return i(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:r(r({},s(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return o=i.sent(),c=(0,a.toPolyfillReadable)(o),u=(0,a.intoStandardStream)(c),l=u.pipeThrough(new a.TransformStream({transform:function(e,t){var o=e.choices.map((function(e){var t=Object.assign(e.delta,{role:"assistant"});return null==n&&(n=(0,a.isToolCallAssistantMessage)(t)),r(r({},e),n?{finish_reason:"tool_calls",delta:t}:{delta:t})})),i=r(r({},e),{choices:o});t.enqueue(r(r({},i),{rawResponse:e}))}})),[2,(0,a.createAsyncIterable)(l)]}}))}))},e}();t.DSSimpleModel=c},2102:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.DeepSeekSimpleModel=void 0;var a=n(1689),s=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.subUrl="deepseek/chat/completions",null!=n&&(this.subUrl=n)}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e,t){return o(this,void 0,Promise,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.req({url:this.url,data:r(r({},e),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=o.sent(),[2,r(r({},n),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return o(this,void 0,Promise,(function(){var n,o,s,c,u;return i(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:r(r({},e),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return o=i.sent(),s=(0,a.toPolyfillReadable)(o),c=(0,a.intoStandardStream)(s),u=c.pipeThrough(new a.TransformStream({transform:function(e,t){var o=e.choices.map((function(e){var t=e.delta;return null==n&&(n=(0,a.isToolCallAssistantMessage)(t)),n?r(r({},e),{finish_reason:"tool_calls",delta:t}):e})),i=r(r({},e),{choices:o});t.enqueue(r(r({},i),{rawResponse:e}))}})),[2,(0,a.createAsyncIterable)(u)]}}))}))},e}();t.DeepSeekSimpleModel=s},8017:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultSimpleModel=void 0;var a=n(1689),s=function(){function e(e,t,n){void 0===n&&(n=""),this.req=e,this.baseUrl=t,this.subUrl=n}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e){return o(this,void 0,Promise,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.req({url:this.url,data:r(r({},e),{stream:!1}),stream:!1})];case 1:return t=n.sent(),[2,r(r({},t),{rawResponse:t})]}}))}))},e.prototype.doStream=function(e){return o(this,void 0,Promise,(function(){var t,n,o,s,c;return i(this,(function(i){switch(i.label){case 0:return t=null,[4,this.req({url:this.url,data:r(r({},e),{stream:!0}),stream:!0})];case 1:return n=i.sent(),o=(0,a.toPolyfillReadable)(n),s=(0,a.intoStandardStream)(o),c=s.pipeThrough(new a.TransformStream({transform:function(e,n){var o=e.choices.map((function(e){var n=e.delta;return null==t&&(t=(0,a.isToolCallAssistantMessage)(n)),t?r(r({},e),{finish_reason:"tool_calls",delta:n}):e})),i=r(r({},e),{choices:o});n.enqueue(r(r({},i),{rawResponse:e}))}})),[2,(0,a.createAsyncIterable)(c)]}}))}))},e}();t.DefaultSimpleModel=s},7239:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.HunYuanSimpleModel=void 0;var a=n(1689),s=n(8586),c=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.subUrl="hunyuan",null!=n&&(this.subUrl=n)}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e,t){return o(this,void 0,Promise,(function(){var n,o;return i(this,(function(i){switch(i.label){case 0:return[4,this.req({url:this.url,headers:{"X-Tc-Action":"ChatCompletions"},data:r(r({},(0,s.processInput)(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=i.sent(),o=(0,s.titleCaseToSnakeCase)(n.Response),[2,r(r({},o),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return o(this,void 0,Promise,(function(){var n,o,c,u,l;return i(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,headers:{"X-Tc-Action":"ChatCompletions"},data:r(r({},e),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return o=i.sent(),c=(0,a.toPolyfillReadable)(o),u=(0,a.intoStandardStream)(c),l=u.pipeThrough(new a.TransformStream({transform:function(e,t){var o=(0,s.titleCaseToSnakeCase)(e),i=o.choices.map((function(e){var t=e.delta;return null==n&&(n=(0,a.isToolCallAssistantMessage)(t)),n?r(r({},e),{finish_reason:"tool_calls",delta:t}):e})),c=r(r({},o),{choices:i});t.enqueue(r(r({},c),{rawResponse:e}))}})),[2,(0,a.createAsyncIterable)(l)]}}))}))},e}();t.HunYuanSimpleModel=c},8586:function(e,t){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.titleCaseToSnakeCase=t.processInput=void 0,t.processInput=function(e){var t=e.messages,r=e.model,o=e.temperature,i=e.tool_choice,a=e.tools,s=e.top_p;return n(n({},e),{messages:(t.forEach((function(e){"tool_calls"in e&&e.tool_calls.filter((function(e){return"function"!==e.type})).forEach((function(t){return console.warn("`type` in tool_call is not 'function'",t,e)}))})),t),model:r,tools:function(){if(a)return a.forEach((function(e){"function"!==e.type&&console.warn("`type` in tool is not 'function'",e)})),a}(),top_p:s,tool_choice:i,temperature:o})},t.titleCaseToSnakeCase=function e(t){return"object"!=typeof t||null==t?t:Array.isArray(t)?t.map((function(t){return e(t)})):Object.entries(t).reduce((function(t,n){var r,o=n[0],i=n[1];return t["_"===(r=o.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))).charAt(0)?r.slice(1):r]="object"==typeof i?e(i):i,t}),{})}},9301:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.HunYuanBetaSimpleModel=void 0;var a=n(1689),s=n(8586),c=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.subUrl="hunyuan-beta/openapi/v1/chat/completions",null!=n&&(this.subUrl=n)}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e,t){return o(this,void 0,Promise,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.req({url:this.url,data:r(r({},(0,s.processInput)(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=o.sent(),[2,r(r({},n),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return o(this,void 0,Promise,(function(){var n,o,c,u,l;return i(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:r(r({},(0,s.processInput)(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return o=i.sent(),c=(0,a.toPolyfillReadable)(o),u=(0,a.intoStandardStream)(c),l=u.pipeThrough(new a.TransformStream({transform:function(e,t){var o=e.choices.map((function(e){var t=e.delta;return null==n&&(n=(0,a.isToolCallAssistantMessage)(t)),n?r(r({},e),{finish_reason:"tool_calls",delta:t}):e})),i=r(r({},e),{choices:o});t.enqueue(r(r({},i),{rawResponse:e}))}})),[2,(0,a.createAsyncIterable)(l)]}}))}))},e}();t.HunYuanBetaSimpleModel=c},5720:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.HunYuanExpSimpleModel=void 0;var a=n(1689),s=n(8586),c=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.subUrl="hunyuan-exp/chat/completions",null!=n&&(this.subUrl=n)}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e){return o(this,void 0,Promise,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.req({url:this.url,data:r(r({},(0,s.processInput)(e)),{stream:!1}),stream:!1})];case 1:return t=n.sent(),[2,r(r({},t),{rawResponse:t})]}}))}))},e.prototype.doStream=function(e){return o(this,void 0,Promise,(function(){var t,n,o,c,u;return i(this,(function(i){switch(i.label){case 0:return t=null,[4,this.req({url:this.url,data:r(r({},(0,s.processInput)(e)),{stream:!0}),stream:!0})];case 1:return n=i.sent(),o=(0,a.toPolyfillReadable)(n),c=(0,a.intoStandardStream)(o),u=c.pipeThrough(new a.TransformStream({transform:function(e,n){var o=e.choices.map((function(e){var n=e.delta;return null==t&&(t=(0,a.isToolCallAssistantMessage)(n)),t?r(r({},e),{finish_reason:"tool_calls",delta:n}):e})),i=r(r({},e),{choices:o});n.enqueue(r(r({},i),{rawResponse:e}))}})),[2,(0,a.createAsyncIterable)(u)]}}))}))},e}();t.HunYuanExpSimpleModel=c},1586:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.HunYuanOpenSimpleModel=void 0;var a=n(1689),s=n(8586),c=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.subUrl="hunyuan-open/v1/chat/completions",null!=n&&(this.subUrl=n)}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e,t){return o(this,void 0,Promise,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.req({url:this.url,data:r(r({},(0,s.processInput)(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=o.sent(),[2,r(r({},n),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return o(this,void 0,Promise,(function(){var n,o,c,u,l;return i(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:r(r({},(0,s.processInput)(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return o=i.sent(),c=(0,a.toPolyfillReadable)(o),u=(0,a.intoStandardStream)(c),l=u.pipeThrough(new a.TransformStream({transform:function(e,t){var o=e.choices.map((function(e){var t=e.delta;return null==n&&(n=(0,a.isToolCallAssistantMessage)(t)),n?r(r({},e),{finish_reason:"tool_calls",delta:t}):e})),i=r(r({},e),{choices:o});t.enqueue(r(r({},i),{rawResponse:e}))}})),[2,(0,a.createAsyncIterable)(l)]}}))}))},e}();t.HunYuanOpenSimpleModel=c},3925:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.MoonshotSimpleModel=void 0;var a=n(1689);function s(e){var t=e.messages,n=e.model,o=e.temperature,i=e.tools,a=e.top_p;return r(r({},e),{messages:t,model:n,tools:i,top_p:a,temperature:o})}var c=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.subUrl="moonshot/v1/chat/completions",null!=n&&(this.subUrl=n)}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e,t){return o(this,void 0,Promise,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.req({url:this.url,data:r(r({},s(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=o.sent(),[2,r(r({},n),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return o(this,void 0,Promise,(function(){var n,o,c,u,l;return i(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:r(r({},s(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return o=i.sent(),c=(0,a.toPolyfillReadable)(o),u=(0,a.intoStandardStream)(c),l=u.pipeThrough(new a.TransformStream({transform:function(e,t){var o=e.choices.map((function(e){var t=e.delta;return null==n&&(n=(0,a.isToolCallAssistantMessage)(t)),n?r(r({},e),{finish_reason:"tool_calls",delta:t}):e})),i=r(r({},e),{choices:o});t.enqueue(r(r({},i),{rawResponse:e}))}})),[2,(0,a.createAsyncIterable)(l)]}}))}))},e}();t.MoonshotSimpleModel=c},4532:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.YiSimpleModel=void 0;var a=n(1689);function s(e){var t=e.messages,n=e.model,o=e.temperature,i=e.tools,a=e.top_p;return r(r({},e),{messages:t,model:n,tools:i,top_p:a,temperature:o})}var c=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.subUrl="01-ai/v1/chat/completions",null!=n&&(this.subUrl=n)}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e,t){return o(this,void 0,Promise,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.req({url:this.url,data:r(r({},s(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=o.sent(),[2,r(r({},n),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return o(this,void 0,Promise,(function(){var n,o,c,u,l;return i(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:r(r({},s(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return o=i.sent(),c=(0,a.toPolyfillReadable)(o),u=(0,a.intoStandardStream)(c),l=u.pipeThrough(new a.TransformStream({transform:function(e,t){var o,i,s,c,u,l;if((null===(s=null===(i=null===(o=null==e?void 0:e.choices)||void 0===o?void 0:o[0])||void 0===i?void 0:i.delta)||void 0===s?void 0:s.content)||(null===(l=null===(u=null===(c=null==e?void 0:e.choices)||void 0===c?void 0:c[0])||void 0===u?void 0:u.delta)||void 0===l?void 0:l.tool_calls)){var p=e.choices.map((function(e){var t=Object.assign(e.delta,{role:"assistant"});return null==n&&(n=(0,a.isToolCallAssistantMessage)(t)),r(r({},e),n?{finish_reason:"tool_calls",delta:t}:{delta:t})})),d=r(r({},e),{choices:p});t.enqueue(r(r({},d),{rawResponse:e}))}}})),[2,(0,a.createAsyncIterable)(l)]}}))}))},e}();t.YiSimpleModel=c},7173:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ZhiPuSimpleModel=void 0;var a=n(1689);function s(e){var t=e.messages,n=e.model,o=e.temperature,i=e.tool_choice,a=e.tools,s=e.top_p;return r(r({},e),{messages:t,model:n,temperature:o,tool_choice:(i&&"auto"!==i&&console.warn("`tool_choice` is not 'auto'"),i),tools:a,top_p:s})}var c=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.subUrl="zhipu/api/paas/v4/chat/completions",null!=n&&(this.subUrl=n)}return Object.defineProperty(e.prototype,"url",{get:function(){return"".concat(this.baseUrl,"/").concat(this.subUrl)},enumerable:!1,configurable:!0}),e.prototype.doGenerate=function(e,t){return o(this,void 0,Promise,(function(){var n,o;return i(this,(function(i){switch(i.label){case 0:return n=s(e),[4,this.req({url:this.url,data:r(r({},n),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return o=i.sent(),[2,r(r({},o),{rawResponse:o})]}}))}))},e.prototype.doStream=function(e,t){return o(this,void 0,Promise,(function(){var n,o,c,u,l,p;return i(this,(function(i){switch(i.label){case 0:return n=s(e),o=null,[4,this.req({url:this.url,data:r(r({},n),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return c=i.sent(),u=(0,a.toPolyfillReadable)(c),l=(0,a.intoStandardStream)(u),p=l.pipeThrough(new a.TransformStream({transform:function(e,t){var n=e.choices.map((function(e){var t=e.delta;return null==o&&(o=(0,a.isToolCallAssistantMessage)(t)),o?r(r({},e),{finish_reason:"tool_calls",delta:t}):e})),i=r(r({},e),{choices:n});t.enqueue(r(r({},i),{rawResponse:e}))}})),[2,(0,a.createAsyncIterable)(p)]}}))}))},e}();t.ZhiPuSimpleModel=c},8328:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultImageModel=void 0;var o=function(){function e(e,t,n){this.req=e,this.baseUrl=t,this.provider=n,this.defaultGenerateImageSubUrl="images/ar/generations",this.generateImageSubUrlConfig={"hunyuan-image":[[/^hunyuan-image(-v[12](\..*)?)?$/,"images/generations"]]},this.generateImage=this.generateImageImpl.bind(this)}return e.prototype.generateImageImpl=function(e){return n(this,void 0,Promise,(function(){var t,n;return r(this,(function(r){switch(r.label){case 0:return t=this.defaultGenerateImageSubUrl,"object"==typeof e&&e&&"model"in e&&"string"==typeof e.model&&(n=this.getGenerateImageSubUrl(this.provider,e.model))&&(t=n),[4,this.req({url:this.getGenerateUrl(t),data:e,stream:!1})];case 1:return[2,r.sent()]}}))}))},e.prototype.getGenerateUrl=function(e){return"".concat(this.baseUrl,"/").concat(this.provider,"/").concat(e)},e.prototype.getGenerateImageSubUrl=function(e,t){var n=this.generateImageSubUrlConfig[e];if(n)for(var r=0,o=n;r<o.length;r++){var i=o[r],a=i[0],s=i[1];if(a.test(t))return s}},e}();t.DefaultImageModel=o},5305:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toolMap=t.ReactModel=t.DefaultImageModel=t.DefaultSimpleModel=t.HunYuanOpenSimpleModel=t.HunYuanExpSimpleModel=t.MoonshotSimpleModel=t.YiSimpleModel=t.DSSimpleModel=t.ArkSimpleModel=t.HunYuanSimpleModel=t.HunYuanBetaSimpleModel=t.ZhiPuSimpleModel=t.MODELS=void 0;var r=n(7173);Object.defineProperty(t,"ZhiPuSimpleModel",{enumerable:!0,get:function(){return r.ZhiPuSimpleModel}});var o=n(9301);Object.defineProperty(t,"HunYuanBetaSimpleModel",{enumerable:!0,get:function(){return o.HunYuanBetaSimpleModel}});var i=n(7239);Object.defineProperty(t,"HunYuanSimpleModel",{enumerable:!0,get:function(){return i.HunYuanSimpleModel}});var a=n(5476);Object.defineProperty(t,"ArkSimpleModel",{enumerable:!0,get:function(){return a.ArkSimpleModel}});var s=n(7265);Object.defineProperty(t,"DSSimpleModel",{enumerable:!0,get:function(){return s.DSSimpleModel}});var c=n(4532);Object.defineProperty(t,"YiSimpleModel",{enumerable:!0,get:function(){return c.YiSimpleModel}});var u=n(3925);Object.defineProperty(t,"MoonshotSimpleModel",{enumerable:!0,get:function(){return u.MoonshotSimpleModel}});var l=n(5720);Object.defineProperty(t,"HunYuanExpSimpleModel",{enumerable:!0,get:function(){return l.HunYuanExpSimpleModel}});var p=n(1586);Object.defineProperty(t,"HunYuanOpenSimpleModel",{enumerable:!0,get:function(){return p.HunYuanOpenSimpleModel}});var d=n(2102),h=n(8017);Object.defineProperty(t,"DefaultSimpleModel",{enumerable:!0,get:function(){return h.DefaultSimpleModel}});var f=n(8328);Object.defineProperty(t,"DefaultImageModel",{enumerable:!0,get:function(){return f.DefaultImageModel}}),t.MODELS={hunyuan:i.HunYuanSimpleModel,"hunyuan-beta":o.HunYuanBetaSimpleModel,ark:a.ArkSimpleModel,dashscope:s.DSSimpleModel,"01-ai":c.YiSimpleModel,moonshot:u.MoonshotSimpleModel,zhipu:r.ZhiPuSimpleModel,"hunyuan-exp":l.HunYuanExpSimpleModel,"hunyuan-open":p.HunYuanOpenSimpleModel,deepseek:d.DeepSeekSimpleModel};var m=n(1443);Object.defineProperty(t,"ReactModel",{enumerable:!0,get:function(){return m.ReactModel}}),Object.defineProperty(t,"toolMap",{enumerable:!0,get:function(){return m.toolMap}})},1443:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},a=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},s=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,o,(t=e[n](t)).done,t.value)}))}}},c=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.toolMap=t.ReactModel=void 0;var u=n(1689);function l(e){var t,n=e.onStepFinish,o=e.abortSignal,i=e.maxSteps,s=e.topP,c=e.toolChoice,l=a(e,["onStepFinish","abortSignal","maxSteps","topP","toolChoice"]);if(null!=i&&i<1)throw new Error("`maxSteps` muse be greater than 0.");return[{onStepFinish:n,abortSignal:o,maxSteps:i},r(r({},l),{tools:null===(t=l.tools)||void 0===t?void 0:t.map((function(e){return"fn"in e?(0,u.functionToolToModelTool)(e):e})),top_p:null!=s?s:l.top_p,tool_choice:null!=c?c:l.tool_choice})]}var p=function(){function e(e){this.model=e}return e.prototype.generateText=function(e,t){var n,r;return o(this,void 0,Promise,(function(){var o,a,s,u,p,g,b,y,_,x,w,E,I,S,O,T,A,P,C,R,N,k=this;return i(this,(function(i){switch(i.label){case 0:return o=[],a={completion_tokens:0,prompt_tokens:0,total_tokens:0},s=l(e),u=s[0],p=u.onStepFinish,g=u.maxSteps,b=void 0===g?10:g,y=s[1],[4,(_=function(){return k.model.doGenerate(y,t)})()];case 1:x=i.sent(),w=1,x.rawResponse&&o.push(x.rawResponse),E=null,i.label=2;case 2:if(!(w<b&&null!=(E=d(x))))return[3,9];I=m(x.usage),v(a,I),i.label=3;case 3:return i.trys.push([3,7,,8]),[4,f(E)];case 4:return S=i.sent(),O=x.choices[0],[4,null==p?void 0:p({finishReason:O.finish_reason,messages:y.messages.slice(),text:O.message.content,toolCall:E,toolResult:S,stepUsage:I,totalUsage:Object.assign({},a)})];case 5:return i.sent(),h(y.messages,O.message,S),[4,_()];case 6:return(x=i.sent()).rawResponse&&o.push(x.rawResponse),w+=1,[3,8];case 7:return T=i.sent(),[2,{text:"",messages:y.messages,usage:a,error:T,rawResponses:o}];case 8:return[3,2];case 9:return A=null===(n=null==x?void 0:x.choices)||void 0===n?void 0:n[0],P=null==A?void 0:A.message,C=null!==(r=null==P?void 0:P.content)&&void 0!==r?r:"",R=P?c(c([],y.messages,!0),[P],!1):y.messages,N=m(x.usage),v(a,N),[4,null==p?void 0:p({finishReason:A.finish_reason,messages:R.slice(),text:C,toolCall:d(x),toolResult:null,stepUsage:N,totalUsage:Object.assign({},a)})];case 10:return i.sent(),[2,{text:C,messages:R,usage:a,rawResponses:o}]}}))}))},e.prototype.streamText=function(e,t){var n;return o(this,void 0,Promise,(function(){var r,a,p,d,m,g,b,y,_,x,w,E,I,S,O,T,A,P,C,R,N,k,j,U,D,L,M,q,B,F,W,V,G,H,z,K,Y=this;return i(this,(function(J){switch(J.label){case 0:return r={completion_tokens:0,prompt_tokens:0,total_tokens:0},a=l(e),p=a[0],d=p.onStepFinish,m=p.maxSteps,g=void 0===m?10:m,b=a[1],[4,(y=function(){return Y.model.doStream(b,t)})()];case 1:_=J.sent(),x=1,w=null,E=function(){var e=_.tee(),t=e[0],n=e[1];return _=(0,u.createAsyncIterable)(t),function(e){var t,n,r,a,c,l,p,d,h,f;return o(this,void 0,Promise,(function(){var o,m,v,g,b,y,_,x,w,E,I,S,O;return i(this,(function(i){switch(i.label){case 0:o={completion_tokens:0,prompt_tokens:0,total_tokens:0},m=(0,u.createAsyncIterable)(e),g={role:"assistant",content:"",tool_calls:[v={id:"",function:{name:"",arguments:""},type:""}]},i.label=1;case 1:i.trys.push([1,6,7,12]),b=!0,y=s(m),i.label=2;case 2:return[4,y.next()];case 3:if(_=i.sent(),t=_.done)return[3,5];a=_.value,b=!1;try{if(!(w=null==(x=a)?void 0:x.choices[0]))return[2,null];if(E=w.finish_reason,I=w.delta,"tool_calls"!==E)return[2,null];if(!I)return[3,4];if(I.content&&(g.content+=I.content),!("tool_calls"in I))return[3,4];(null==(S=null===(c=null==I?void 0:I.tool_calls)||void 0===c?void 0:c[0])?void 0:S.id)&&(v.id=S.id),(null==S?void 0:S.type)&&(v.type=S.type),(null===(l=null==S?void 0:S.function)||void 0===l?void 0:l.name)&&(v.function.name=S.function.name),(null===(p=null==S?void 0:S.function)||void 0===p?void 0:p.arguments)&&(v.function.arguments+=S.function.arguments),(null===(d=null==x?void 0:x.usage)||void 0===d?void 0:d.completion_tokens)&&(o.completion_tokens=x.usage.completion_tokens),(null===(h=null==x?void 0:x.usage)||void 0===h?void 0:h.prompt_tokens)&&(o.prompt_tokens=x.usage.prompt_tokens),(null===(f=null==x?void 0:x.usage)||void 0===f?void 0:f.total_tokens)&&(o.total_tokens=x.usage.total_tokens)}finally{b=!0}i.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return O=i.sent(),n={error:O},[3,12];case 7:return i.trys.push([7,,10,11]),b||t||!(r=y.return)?[3,9]:[4,r.call(y)];case 8:i.sent(),i.label=9;case 9:return[3,11];case 10:if(n)throw n.error;return[7];case 11:return[7];case 12:return[2,{message:g,usage:o}]}}))}))}(n)},J.label=2;case 2:return(I=x<g)?[4,E()]:[3,4];case 3:I=null!=(w=J.sent()),J.label=4;case 4:if(!I)return[3,11];S=w.message,O=w.usage,v(r,O),T=null===(n=S.tool_calls)||void 0===n?void 0:n[0],J.label=5;case 5:return J.trys.push([5,9,,10]),[4,f(T)];case 6:return A=J.sent(),[4,null==d?void 0:d({finishReason:"tool_calls",messages:b.messages.slice(),text:S.content,toolCall:T,toolResult:A,stepUsage:O,totalUsage:Object.assign({},r)})];case 7:return J.sent(),h(b.messages,S,A),[4,y()];case 8:return _=J.sent(),[3,10];case 9:return P=J.sent(),C=_.tee(),R=C[0],N=C[1],[2,{messages:Promise.resolve(b.messages),dataStream:(0,u.createAsyncIterable)(R),textStream:(0,u.createAsyncIterable)(N.pipeThrough(new u.TransformStream({transform:function(e,t){var n,r,o,i=null===(o=null===(r=null===(n=null==e?void 0:e.choices)||void 0===n?void 0:n[0])||void 0===r?void 0:r.delta)||void 0===o?void 0:o.content;"string"==typeof i&&t.enqueue(i)}}))),usage:Promise.resolve(r),error:P}];case 10:return[3,2];case 11:return[4,E()];case 12:return(w=J.sent())?(k=w.message,j=w.usage,v(r,j),U=c(c([],b.messages,!0),[k],!1),d({messages:U.slice(),finishReason:"tool_call",stepUsage:j,text:k.content,toolCall:k.tool_calls[0],totalUsage:Object.assign({},r)}),D=_.tee(),L=D[0],M=D[1],[2,{messages:Promise.resolve(c(c([],b.messages,!0),[k],!1)),dataStream:(0,u.createAsyncIterable)(L),textStream:(0,u.createAsyncIterable)(M.pipeThrough(new u.TransformStream({transform:function(e,t){var n,r,o,i=null===(o=null===(r=null===(n=null==e?void 0:e.choices)||void 0===n?void 0:n[0])||void 0===r?void 0:r.delta)||void 0===o?void 0:o.content;"string"==typeof i&&t.enqueue(i)}}))),usage:Promise.resolve(r)}]):(q=(0,u.createPromise)(),B=(0,u.createPromise)(),F={role:"assistant",content:""},W="",V={completion_tokens:0,prompt_tokens:0,total_tokens:0},G=_.pipeThrough(new u.TransformStream({transform:function(e,t){var n,r,o,i,a,s,c,u,l=null===(o=null===(r=null===(n=null==e?void 0:e.choices)||void 0===n?void 0:n[0])||void 0===r?void 0:r.delta)||void 0===o?void 0:o.content;"string"==typeof l&&(F.content+=l);var p=null===(a=null===(i=null==e?void 0:e.choices)||void 0===i?void 0:i[0])||void 0===a?void 0:a.finish_reason;p&&(W=p),(null===(s=null==e?void 0:e.usage)||void 0===s?void 0:s.completion_tokens)&&(V.completion_tokens=e.usage.completion_tokens),(null===(c=null==e?void 0:e.usage)||void 0===c?void 0:c.prompt_tokens)&&(V.prompt_tokens=e.usage.prompt_tokens),(null===(u=null==e?void 0:e.usage)||void 0===u?void 0:u.total_tokens)&&(V.total_tokens=e.usage.total_tokens),t.enqueue(e)},flush:function(){q.res(c(c([],b.messages,!0),[F],!1)),v(r,V),B.res(Object.assign({},r)),null==d||d({messages:c(c([],b.messages,!0),[F],!1),finishReason:W,text:F.content,stepUsage:V,totalUsage:Object.assign({},r)})}})),H=G.tee(),z=H[0],K=H[1],[2,{messages:q.promise,dataStream:(0,u.createAsyncIterable)(z),textStream:(0,u.createAsyncIterable)(K.pipeThrough(new u.TransformStream({transform:function(e,t){var n,r,o,i=null===(o=null===(r=null===(n=null==e?void 0:e.choices)||void 0===n?void 0:n[0])||void 0===r?void 0:r.delta)||void 0===o?void 0:o.content;"string"==typeof i&&t.enqueue(i)}}))),usage:B.promise}])}}))}))},e}();function d(e){var t,n=null===(t=null==e?void 0:e.choices)||void 0===t?void 0:t[0];if(!n)return null;var r=n.finish_reason,o=n.message;return"tool_calls"!==r?null:o&&(0,u.isToolCallAssistantMessage)(o)?o.tool_calls[0]:null}function h(e,t,n){e.push(t,{role:"tool",tool_call_id:t.tool_calls[0].id,content:JSON.stringify(n)})}function f(e){return t.toolMap.get(e.function.name)(JSON.parse(e.function.arguments))}function m(e){var t,n,r;return{completion_tokens:null!==(t=null==e?void 0:e.completion_tokens)&&void 0!==t?t:0,prompt_tokens:null!==(n=null==e?void 0:e.prompt_tokens)&&void 0!==n?n:0,total_tokens:null!==(r=null==e?void 0:e.total_tokens)&&void 0!==r?r:0}}function v(e,t){e.completion_tokens+=t.completion_tokens,e.prompt_tokens+=t.prompt_tokens,e.total_tokens+=t.total_tokens}t.ReactModel=p,t.toolMap=new Map},4669:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleChatModel=void 0;t.SimpleChatModel=function(){}},1689:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},i=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,o,(t=e[n](t)).done,t.value)}))}}};Object.defineProperty(t,"__esModule",{value:!0}),t.functionToolToModelTool=t.isToolCallAssistantMessage=t.createPromise=t.readableStream2JsonObject=t.intoTextStream=t.intoStandardStream=t.createAsyncIterable=t.TextDecoderStream=t.toPolyfillReadable=t.createEventSourceParserTransformStream=t.TransformStream=t.ReadableStream=void 0;var a=n(8775),s=n(766),c=n(9964),u=n(6282);t.ReadableStream=a.ReadableStream,t.TransformStream=a.TransformStream,t.createEventSourceParserTransformStream=function(){var e;return new t.TransformStream({start:function(t){e=(0,c.createParser)((function(e){"event"===e.type&&t.enqueue(e)}))},transform:function(t){e.feed(t)}})},t.toPolyfillReadable=(0,s.createReadableStreamWrapper)(t.ReadableStream);var l=function(){function e(e,n){void 0===e&&(e="utf-8"),void 0===n&&(n={});var r=this;this.transform=new t.TransformStream({transform:function(e,t){var n=r.handle.decode(new Uint8Array(e),{stream:!0});n&&t.enqueue(n)},flush:function(e){var t=r.handle.decode();t&&e.enqueue(t),e.terminate()}}),this.handle=new u.TextDecoder(e,n)}return Object.defineProperty(e.prototype,"encoding",{get:function(){return this.handle.encoding},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fatal",{get:function(){return this.handle.fatal},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ignoreBOM",{get:function(){return this.handle.ignoreBOM},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"readable",{get:function(){return this.transform.readable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"writable",{get:function(){return this.transform.writable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return"TextDecoderStream"},enumerable:!1,configurable:!0}),e}();function p(e){var t=e;return t[Symbol.asyncIterator]=function(){var t=e.getReader();return{next:function(){return r(this,void 0,Promise,(function(){var e,n,r;return o(this,(function(o){switch(o.label){case 0:return[4,t.read()];case 1:return e=o.sent(),n=e.done,r=e.value,[2,n?{done:!0,value:void 0}:{done:!1,value:r}]}}))}))}}},t}function d(e){return p((0,t.toPolyfillReadable)(e).pipeThrough(new l))}t.TextDecoderStream=l,t.createAsyncIterable=p,t.intoStandardStream=function(e){return p(e.pipeThrough(new l).pipeThrough((0,t.createEventSourceParserTransformStream)()).pipeThrough(new t.TransformStream({transform:function(e,t){try{var n=JSON.parse(e.data);t.enqueue(n)}catch(n){"[DONE]"!==e.data?console.warn("Error when transforming event source data to json",n,e):t.terminate()}}})))},t.intoTextStream=d,t.readableStream2JsonObject=function(e){var t,n,a,s;return r(this,void 0,void 0,(function(){var r,c,u,l,p,h;return o(this,(function(o){switch(o.label){case 0:r=d(e),c="",o.label=1;case 1:o.trys.push([1,6,7,12]),u=!0,l=i(r),o.label=2;case 2:return[4,l.next()];case 3:if(p=o.sent(),t=p.done)return[3,5];s=p.value,u=!1;try{c+=s}finally{u=!0}o.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return h=o.sent(),n={error:h},[3,12];case 7:return o.trys.push([7,,10,11]),u||t||!(a=l.return)?[3,9]:[4,a.call(l)];case 8:o.sent(),o.label=9;case 9:return[3,11];case 10:if(n)throw n.error;return[7];case 11:return[7];case 12:return[2,JSON.parse(c)]}}))}))},t.createPromise=function(){var e,t;return{promise:new Promise((function(n,r){e=n,t=r})),res:e,rej:t}},t.isToolCallAssistantMessage=function(e){var t;return"assistant"===e.role&&"tool_calls"in e&&null!=(null===(t=e.tool_calls)||void 0===t?void 0:t[0])},t.functionToolToModelTool=function(e){return{type:"function",function:{description:e.description,name:e.name,parameters:e.parameters}}}},5378:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.generateApis=t.generateCallApis=t.callApi=void 0;var a=n(794);function s(e,t){var n,s,c,u;return o(this,void 0,Promise,(function(){var o,l,p,d,h,f,m,v,g,b,y,_,x,w,E,I,S,O,T,A,P,C,R;return i(this,(function(i){switch(i.label){case 0:l=(o=e||{}).name,p=o.body,d=o.path,h=void 0===d?"":d,f=o.method,m=void 0===f?"POST":f,v=o.headers,g=void 0===v?{}:v,b=(e||{}).token,y={};try{y=JSON.parse(p)}catch(e){y=p||{}}if(!l)throw new Error(JSON.stringify({code:a.ERRORS.INVALID_PARAMS,msg:"[apis] invalid api name"}));return _="",w=(x=this).gatewayOrigin,E=x.getAccessToken,I=x.env,w?_="".concat(w,"/v1"):this.getEndPointWithKey?(S=this.getEndPointWithKey("GATEWAY"),O=S.BASE_URL,T=S.PROTOCOL,_="".concat(T).concat(O)):_="https://".concat(I,".api.tcloudbasegateway.com/v1"),A="".concat(_,"/apis/").concat(l),P=h.startsWith("/")?h:"/".concat(h),E?[4,E()]:[3,2];case 1:C=i.sent().accessToken,g.Authorization="Bearer ".concat(C),i.label=2;case 2:if(R=["GET","HEAD"].includes(null===(n=null==m?void 0:m.toUpperCase)||void 0===n?void 0:n.call(m)))try{P="".concat(P).concat(P.includes("?")?"&":"?").concat(Object.keys(y).map((function(e){return"".concat(e,"=").concat(y[e])})).join("&"))}catch(e){}return[4,this.request.fetch(r(r(r({url:"".concat(A).concat(P),method:m||"POST",headers:r({"Content-Type":"application/json; charset=utf-8"},g)},R?{}:{body:JSON.stringify(y)}),{token:(null===(s=null==b?void 0:b.trim)||void 0===s?void 0:s.call(b))||(null===(u=null===(c=g.Authorization)||void 0===c?void 0:c.replace)||void 0===u?void 0:u.call(c,/^Bearer /,""))||null}),t))];case 3:return[4,i.sent().data];case 4:return[2,i.sent()]}}))}))}t.callApi=s;var c=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH","REQUEST"];function u(e){var t=this;return new Proxy({},{get:function(n,a){if("string"!=typeof a)throw new Error("[apis] method must be string");var u=a.toLocaleUpperCase();if(!c.includes(u))throw new Error("[apis] invalid method: ".concat(a));return function(n,a){return o(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,s.call(this,r({name:e,method:("REQUEST"===u?n.method:u)||"POST"},n),a)];case 1:return[2,t.sent()]}}))}))}}})}t.generateCallApis=u,t.generateApis=function(e){var t=this;return Object.keys(e||{}).forEach((function(n){void 0!==e[n]&&(t[n]=e[n])})),new Proxy({},{get:function(e,n){if("string"==typeof n)return u.call(t,n)}})}},1944:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.registerApis=t.generateApis=void 0;var i=n(5378);Object.defineProperty(t,"generateApis",{enumerable:!0,get:function(){return i.generateApis}});var a="apis",s={name:a,IIFE:!0,entity:function(){Object.defineProperty(this.prototype,a,{get:function(){return i.generateApis.call(this)},configurable:!0,enumerable:!0})}};function c(e){try{e.registerComponent(s)}catch(e){console.warn(e)}}t.registerApis=c;try{cloudbase.registerComponent(s)}catch(e){}o(n(2026),t);try{window.registerApis=c}catch(e){}},2026:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7922:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.OAUTH2_LOGINTYPE_PREFIX=t.LOGINTYPE=t.getBaseEndPoint=t.setRegionLevelEndpoint=t.setGatewayEndPointWithEnv=t.getEndPointInfo=t.setEndPointInfo=t.DEFAULT_PROTOCOL=t.DATA_VERSION=t.getSdkName=t.setSdkName=t.getSdkVersion=t.setSdkVersion=void 0;var o=n(2877),i=o.constants.setSdkName,a=o.constants.setProtocol,s="",c="@cloudbase/js-sdk";t.setSdkVersion=function(e){s=e},t.getSdkVersion=function(){return s},t.setSdkName=function(e){c=e,i(e)},t.getSdkName=function(){return c},t.DATA_VERSION="2020-01-10";var u,l=[],p=["env","endPointKey","region"];function d(e){return l.find((function(t){return p.filter((function(t){return null!=e[t]})).every((function(n){return t[n]===e[n]}))}))}function h(e){var n,o;e.protocol&&!/:$/.test(e.protocol)&&(e.protocol="".concat(e.protocol,":"));var i=d(e);i?(null!=e.baseUrl&&(i.baseUrl=e.baseUrl),null!=e.protocol&&(i.protocol=e.protocol)):l.push(r(r({},e),{protocol:null!==(n=e.protocol)&&void 0!==n?n:t.DEFAULT_PROTOCOL})),"CLOUD_API"===e.endPointKey&&a(null!==(o=e.protocol)&&void 0!==o?o:t.DEFAULT_PROTOCOL)}function f(e,t,n){return d({env:e,endPointKey:t,region:n})}t.DEFAULT_PROTOCOL="https:",t.setEndPointInfo=h,t.getEndPointInfo=f,t.setGatewayEndPointWithEnv=function(e,t,n){var r="//".concat(e,".api.tcloudbasegateway.com/v1");n&&(r="//".concat(e,".api.intl.tcloudbasegateway.com/v1")),h({endPointKey:"GATEWAY",env:e,baseUrl:r,protocol:t})},t.setRegionLevelEndpoint=function(e,t,n){h({env:e,region:t,baseUrl:"//".concat(e,".").concat(t||"ap-shanghai",".tcb-api.tencentcloudapi.com/web"),protocol:n,endPointKey:"CLOUD_API"})},t.getBaseEndPoint=function(e,t){void 0===t&&(t="CLOUD_API");var n=f(e,t||"CLOUD_API"),r=n.protocol,o=n.baseUrl;return"".concat(r).concat(o).match(/(http(s)?:)?\/\/([^/?#]*)/)[0]},(u=t.LOGINTYPE||(t.LOGINTYPE={})).NULL="NULL",u.ANONYMOUS="ANONYMOUS",u.WECHAT="WECHAT",u.WECHAT_PUBLIC="WECHAT-PUBLIC",u.WECHAT_OPEN="WECHAT-OPEN",u.CUSTOM="CUSTOM",u.EMAIL="EMAIL",u.USERNAME="USERNAME",u.PHONE="PHONE",t.OAUTH2_LOGINTYPE_PREFIX="OAUTH2"},6950:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.cloudbase=t.LANGS=t.getBaseEndPoint=void 0;var c=n(2877),u=n(4276),l=n(1985),p=n(6938),d=n(901),h=n(7922),f=n(3509),m=n(7922);Object.defineProperty(t,"getBaseEndPoint",{enumerable:!0,get:function(){return m.getBaseEndPoint}});var v=n(3509);Object.defineProperty(t,"LANGS",{enumerable:!0,get:function(){return v.LANGS}});var g=c.adapters.useAdapters,b=c.adapters.useDefaultAdapter,y=c.constants.ERRORS,_=c.constants.COMMUNITY_SITE_URL,x=c.utils.printWarn,w=c.helpers.catchErrorsDecorator,E={timeout:15e3,persistence:"local"},I=6e5,S={},O=function(){function e(e){this.cloudbaseConfig=e||this.cloudbaseConfig,this.authInstance=null,this.oauthInstance=null,this.version=(0,h.getSdkVersion)()}return Object.defineProperty(e.prototype,"config",{get:function(){return this.cloudbaseConfig},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"platform",{get:function(){return l.Platform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cache",{get:function(){return(0,p.getCacheByEnvId)(this.cloudbaseConfig.env)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localCache",{get:function(){return(0,p.getLocalCache)(this.cloudbaseConfig.env)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){return(0,d.getRequestByEnvId)(this.cloudbaseConfig.env)},enumerable:!1,configurable:!0}),e.prototype.init=function(t){var n,o,i;if(void 0===t&&(t={env:""}),t.endPointMode=t.endPointMode||"GATEWAY",l.Platform.adapter||this.useDefaultAdapter(),!(t=this.dealNodeAdapterConfig(t)).env)throw new Error(JSON.stringify({code:y.INVALID_PARAMS,msg:"env must not be specified"}));this.isInitialized(t);var a={timeout:t.timeout||15e3,timeoutMsg:"[".concat((0,h.getSdkName)(),"][REQUEST TIMEOUT] request had been abort since didn't finished within").concat(t.timeout/1e3,"s"),auth:t.auth};this.requestClient=new l.Platform.adapter.reqClass(a),this.cloudbaseConfig=r(r(r({},E),t),{i18n:(0,f.i18nProxy)(l.Platform,t)}),delete this.cloudbaseConfig.lang,this.cloudbaseConfig.timeout=this.formatTimeout(this.cloudbaseConfig.timeout);var s=this.cloudbaseConfig,c=s.env,u=s.persistence,m=s.debug,v=s.timeout,g=s.oauthClient,b=s.i18n;(0,p.initCache)({env:c,persistence:u,debug:m,platformInfo:this.platform}),(0,h.setRegionLevelEndpoint)(c,t.region||""),(0,h.setGatewayEndPointWithEnv)(c,h.DEFAULT_PROTOCOL,t.intl);var _=new e(this.cloudbaseConfig);return(0,d.initRequest)({env:c,region:t.region||"",timeout:v,oauthClient:g,_fromApp:_,i18n:b,endPointMode:t.endPointMode,auth:t.auth}),_.requestClient=this.requestClient,null===(n=null==this?void 0:this.fire)||void 0===n||n.call(this,"cloudbase_init",_),this.try2InitAuth(_),(null===(o=l.Platform.adapter)||void 0===o?void 0:o.nodeTool)&&(null===(i=l.Platform.adapter)||void 0===i||i.nodeTool(_,this.cloudbaseConfig)),_},e.prototype.updateConfig=function(e){var t=e.persistence,n=e.debug;this.cloudbaseConfig.persistence=t,this.cloudbaseConfig.debug=n,(0,p.initCache)({env:this.cloudbaseConfig.env,persistence:t,debug:n,platformInfo:this.platform})},e.prototype.updateLang=function(e){var t;e&&e!==(null===(t=this.cloudbaseConfig.i18n)||void 0===t?void 0:t.lang)&&(this.cloudbaseConfig.i18n.lang=e)},e.prototype.registerExtension=function(e){S[e.name]=e},e.prototype.invokeExtension=function(e,t){return a(this,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:if(!(n=S[e]))throw new Error(JSON.stringify({code:y.INVALID_PARAMS,msg:"extension:".concat(e," must be registered before invoke")}));return[4,n.invoke(t,this)];case 1:return[2,r.sent()]}}))}))},e.prototype.useAdapters=function(e,t){var n=g(e,t)||{},r=n.adapter,o=n.runtime;r&&(l.Platform.adapter=r),o&&(l.Platform.runtime=o)},e.prototype.registerHook=function(t){(0,u.registerHook)(e,t)},e.prototype.registerComponent=function(t){(0,u.registerComponent)(e,t)},e.prototype.registerVersion=function(e){(0,h.setSdkVersion)(e),this.version=e},e.prototype.registerSdkName=function(e){(0,h.setSdkName)(e)},e.prototype.isInitialized=function(e){return void 0===e&&(e=this.cloudbaseConfig),["your-env-id","your-envid","your_env_id","xxx-yyy","xxxx-yyy","envId","env-id","your-environment-id","REPLACE_ME"].some((function(t){return e.env.toLowerCase()===t.toLowerCase()}))&&x(y.INVALID_PARAMS,'[CloudBase] 检测到环境 ID "'.concat(e.env,'" 可能是占位符,请替换为真实的环境 ID。\n')+" 获取方式:登录腾讯云开发平台 → 环境管理 → 环境设置 → 环境 ID\n 建议通过环境变量配置:process.env.CLOUDBASE_ENV 或 import.meta.env.VITE_CLOUDBASE_ENV"),!!(null==e?void 0:e.env)},e.prototype.registerEndPoint=function(e,t){(0,h.setEndPointInfo)({baseUrl:e,protocol:t,env:this.config.env,endPointKey:"CLOUD_API"})},e.prototype.registerEndPointWithKey=function(e){(0,h.setEndPointInfo)({env:this.config.env,endPointKey:e.key,baseUrl:e.url,protocol:e.protocol})},e.prototype.registerHost=function(e,t){void 0===t&&(t="http");var n=e.replace(/^(https?:)?\/\//,""),r="//".concat(n);(0,h.setEndPointInfo)({baseUrl:"".concat(r,"/web"),protocol:t,env:this.config.env,endPointKey:"CLOUD_API"}),(0,h.setEndPointInfo)({baseUrl:"".concat(r,"/v1"),protocol:t,env:this.config.env,endPointKey:"GATEWAY"})},e.prototype.getEndPointWithKey=function(e){var t=(0,h.getEndPointInfo)(this.config.env,e);return{BASE_URL:t.baseUrl,PROTOCOL:t.protocol}},e.prototype.parseCaptcha=function(e){return c.utils.parseCaptcha(e)},e.prototype.useDefaultAdapter=function(){var e=b.bind(this)(),t=e.adapter,n=e.runtime;l.Platform.adapter=t,l.Platform.runtime=n},e.prototype.formatTimeout=function(e){switch(!0){case e>I:return x(y.INVALID_PARAMS,"timeout is greater than maximum value[10min]"),I;case e<100:return x(y.INVALID_PARAMS,"timeout is less than maximum value[100ms]"),100;default:return e}},e.prototype.try2InitAuth=function(e){try{e.auth()}catch(e){console.log("try2InitAuth error:",e)}},e.prototype.dealNodeAdapterConfig=function(e){var t,n;if("undefined"!=typeof process&&void 0!=={IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}&&(null===(t=l.Platform.adapter)||void 0===t?void 0:t.getSecretInfo)){var o=null===(n=l.Platform.adapter)||void 0===n?void 0:n.getSecretInfo(e);e.auth=r(r({},e.auth),{secretId:o.secretId,secretKey:o.secretKey,sessionToken:o.sessionToken,secretType:o.secretType}),e.env||(e.env=o.env),!e.accessKey&&o.accessKey&&(e.accessKey=o.accessKey)}return e},o([w({mode:"sync",title:"Cloudbase 初始化失败",messages:["请确认以下各项:"," 1 - 调用 cloudbase.init() 的语法或参数是否正确"," 2 - 如果是非浏览器环境,是否配置了安全应用来源(https://docs.cloudbase.net/api-reference/webv3/adapter#%E7%AC%AC-2-%E6%AD%A5%E9%85%8D%E7%BD%AE%E5%AE%89%E5%85%A8%E5%BA%94%E7%94%A8%E6%9D%A5%E6%BA%90)","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(_)]}),i("design:type",Function),i("design:paramtypes",[Object]),i("design:returntype",e)],e.prototype,"init",null),o([w({title:"调用扩展能力失败",messages:["请确认以下各项:"," 1 - 调用 invokeExtension() 的语法或参数是否正确"," 2 - 被调用的扩展能力是否已经安装并通过 registerExtension() 注册","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(_)]}),i("design:type",Function),i("design:paramtypes",[String,Object]),i("design:returntype",Promise)],e.prototype,"invokeExtension",null),e}();t.cloudbase=new O;var T=(0,l.getWxDefaultAdapter)();T&&t.cloudbase.useAdapters(T),t.default=t.cloudbase},1197:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SECRET_TYPE=t.checkCustomUserIdRegex=t.CLIENT_AUTH_PATH=t.ADMIN_PATH=t.ERROR=void 0,t.ERROR={INVALID_PARAM:{code:"INVALID_PARAM",message:"invalid param"},SYS_ERR:{code:"SYS_ERR",message:"system error"},STORAGE_REQUEST_FAIL:{code:"STORAGE_REQUEST_FAIL",message:"storage request fail"},STORAGE_FILE_NONEXIST:{code:"STORAGE_FILE_NONEXIST",message:"storage file not exist"},TCB_CLS_UNOPEN:{code:"TCB_CLS_UNOPEN",message:"需要先开通日志检索功能"},INVALID_CONTEXT:{code:"INVALID_CONTEXT",message:"无效的context对象,请使用 云函数入口的context参数"}},t.ADMIN_PATH="/admin",t.CLIENT_AUTH_PATH="/auth/v1/token/clientCredential",t.checkCustomUserIdRegex=/^[a-zA-Z0-9_\-#@~=*(){}[\]:.,<>+]{4,32}$/,(n=t.SECRET_TYPE||(t.SECRET_TYPE={})).SECRET="SECRET",n.SESSION_SECRET="SESSION_SECRET"},9094:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getSecretInfo=t.INIT_CONFIG=t.getServerInjectUrl=t.getTcbContextConfig=t.getCloudbaseContext=t.parseContext=void 0;var o=n(1197),i=n(4353);function a(e){if("object"!=typeof e)throw r(r({},o.ERROR.INVALID_CONTEXT),{message:"context 必须为对象类型"});var t={},n=e.memory_limit_in_mb,i=e.time_limit_in_ms,a=e.request_id,s=e.function_version,c=e.namespace,u=e.function_name,l=e.environ,p=e.environment;try{if(t.memoryLimitInMb=n,t.timeLimitIns=i,t.requestId=a,t.functionVersion=s,t.namespace=c,t.functionName=u,p)t.environment=JSON.parse(p);else{var d=null==l?void 0:l.split(";"),h={};for(var f in d)if(d[f].includes("=")){var m=d[f].indexOf("="),v=d[f].slice(0,m),g=d[f].slice(m+1);g.indexOf(",")>=0&&(g=g.split(",")),h[v]=g}t.environ=h}}catch(e){throw r({},o.ERROR.INVALID_CONTEXT)}return t}function s(){try{var e=(0,t.getCloudbaseContext)().TCB_CONTEXT_CNFG;return e?JSON.parse(e):{}}catch(e){return console.error("[TCB][ERROR] parse context error: ",e),{}}}t.parseContext=a,t.getCloudbaseContext=function(e){(0,i.checkIsInScf)()&&((0,i.getEnv)("TENCENTCLOUD_REGION")||console.error("[TCB][ERROR] missing `TENCENTCLOUD_REGION` environment"),(0,i.getEnv)("SCF_NAMESPACE")||console.error("[TCB][ERROR] missing `SCF_NAMESPACE` environment"));var t=(0,i.getEnv)(),n={TRIGGER_SRC:t.TRIGGER_SRC,_SCF_TCB_LOG:t._SCF_TCB_LOG,SCF_NAMESPACE:t.SCF_NAMESPACE,TENCENTCLOUD_RUNENV:t.TENCENTCLOUD_RUNENV,TENCENTCLOUD_SECRETID:t.TENCENTCLOUD_SECRETID,TENCENTCLOUD_SECRETKEY:t.TENCENTCLOUD_SECRETKEY,TENCENTCLOUD_SESSIONTOKEN:t.TENCENTCLOUD_SESSIONTOKEN,WX_CONTEXT_KEYS:t.WX_CONTEXT_KEYS,WX_TRIGGER_API_TOKEN_V0:t.WX_TRIGGER_API_TOKEN_V0,WX_CLIENTIP:t.WX_CLIENTIP,WX_CLIENTIPV6:t.WX_CLIENTIPV6,TCB_CONTEXT_KEYS:t.TCB_CONTEXT_KEYS,TCB_CONTEXT_CNFG:t.TCB_CONTEXT_CNFG,LOGINTYPE:t.LOGINTYPE},o={};if(e){var s=a(e),c=s.environment,u=s.environ;o=c||u||{}}for(var l=0,p=[o.TCB_CONTEXT_KEYS||t.TCB_CONTEXT_KEYS,o.WX_CONTEXT_KEYS||t.WX_CONTEXT_KEYS];l<p.length;l++){var d=p[l];if(d)try{for(var h=0,f=d.split(",");h<f.length;h++){var m=f[h];n[m]=o[m]||(0,i.getEnv)(m)}}catch(e){}}var v=r(r({},n),o);return Object.fromEntries(Object.entries(v).filter((function(e){return void 0!==e[1]})))},t.getTcbContextConfig=s,t.getServerInjectUrl=function(){return s().URL||""},t.INIT_CONFIG={},t.getSecretInfo=function(e){var n,a,s,c,u;t.INIT_CONFIG=JSON.parse(JSON.stringify(e||t.INIT_CONFIG));var l=(0,i.getEnv)(),p=l.TCB_ENV,d=l.SCF_NAMESPACE,h=l.TENCENTCLOUD_RUNENV,f=l.TENCENTCLOUD_SECRETID,m=l.TENCENTCLOUD_SECRETKEY,v=l.TENCENTCLOUD_SESSIONTOKEN,g=l.CLOUDBASE_APIKEY,b=r(r({},t.INIT_CONFIG),e),y="";"local"===(y="symbol"!=typeof(null==e?void 0:e.env)&&(null==e?void 0:e.env)?e.env:p||d||"")&&"WX_LOCAL_SCF"===h&&(y="");var _={env:y,secretId:"",secretKey:"",sessionToken:"",accessKey:"",secretType:"",credentials:void 0,context:void 0};if((null==b?void 0:b.context)&&(_.context=b.context),(null==b?void 0:b.credentials)&&(_.credentials=b.credentials),(null==e?void 0:e.accessKey)||(null==b?void 0:b.accessKey))return _.accessKey=(null==e?void 0:e.accessKey)||(null==b?void 0:b.accessKey),_;if((null==b?void 0:b.secretId)&&(null==b?void 0:b.secretKey))return r(r({},_),{secretId:b.secretId,secretKey:b.secretKey,sessionToken:v||"",secretType:b.sessionToken?o.SECRET_TYPE.SESSION_SECRET:o.SECRET_TYPE.SECRET});if((null===(n=null==e?void 0:e.auth)||void 0===n?void 0:n.secretId)&&(null===(a=null==e?void 0:e.auth)||void 0===a?void 0:a.secretKey))return r(r({},_),{secretId:e.auth.secretId,secretKey:e.auth.secretKey,sessionToken:v||"",secretType:e.auth.secretType||o.SECRET_TYPE.SECRET});if(g)return r(r({},_),{accessKey:g});if(f&&m)return r(r({},_),{secretId:f,secretKey:m,sessionToken:v||"",secretType:o.SECRET_TYPE.SESSION_SECRET});var x=(null==b?void 0:b.context)||(null==e?void 0:e.context);if(null==x?void 0:x.extendedContext){var w=x.extendedContext;return y||(y=w.envId||""),r(r({},_),{env:y,secretId:(null===(s=null==w?void 0:w.tmpSecret)||void 0===s?void 0:s.secretId)||"",secretKey:(null===(c=null==w?void 0:w.tmpSecret)||void 0===c?void 0:c.secretKey)||"",sessionToken:(null===(u=null==w?void 0:w.tmpSecret)||void 0===u?void 0:u.token)||""})}return r({},_)}},2293:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.getWxOptions=t.wxCallContainerApi=t.callWxPayApi=t.callCompatibleWxOpenApi=t.callWxOpenApi=t.sendWxFormDataRequest=t.sendWxRequest=t.buildAdminUrl=t.getWxCloudToken=t.getTcbContextConfig=t.getServerInjectUrl=t.getSecretInfo=t.parseContext=t.getCloudbaseContext=t.setThrowOnCode=t.processReturn=t.filterUndefined=t.filterValue=t.isPageModuleName=t.isValidEnvFormat=t.SYMBOL_DEFAULT_ENV=t.SYMBOL_CURRENT_ENV=t.TcbError=t.E=t.createWebStreamFromNodeReadableStream=t.parseQueryString=t.NodeRequest=void 0;var i=n(2764),a=n(9768),s=n(5434),c=n(9094),u=n(4353),l=null;function p(){if(!l)try{l=n(6850)}catch(e){console.error("缺少依赖 ws,请执行以下命令安装:\n\n npm install ws\n\n该依赖用于 Node 环境下的 WebSocket 连接。")}return l}var d=n(9768);Object.defineProperty(t,"NodeRequest",{enumerable:!0,get:function(){return d.NodeRequest}});var h=n(4353);Object.defineProperty(t,"parseQueryString",{enumerable:!0,get:function(){return h.parseQueryString}}),Object.defineProperty(t,"createWebStreamFromNodeReadableStream",{enumerable:!0,get:function(){return h.createWebStreamFromNodeReadableStream}}),Object.defineProperty(t,"E",{enumerable:!0,get:function(){return h.E}}),Object.defineProperty(t,"TcbError",{enumerable:!0,get:function(){return h.TcbError}}),Object.defineProperty(t,"SYMBOL_CURRENT_ENV",{enumerable:!0,get:function(){return h.SYMBOL_CURRENT_ENV}}),Object.defineProperty(t,"SYMBOL_DEFAULT_ENV",{enumerable:!0,get:function(){return h.SYMBOL_DEFAULT_ENV}}),Object.defineProperty(t,"isValidEnvFormat",{enumerable:!0,get:function(){return h.isValidEnvFormat}}),Object.defineProperty(t,"isPageModuleName",{enumerable:!0,get:function(){return h.isPageModuleName}}),Object.defineProperty(t,"filterValue",{enumerable:!0,get:function(){return h.filterValue}}),Object.defineProperty(t,"filterUndefined",{enumerable:!0,get:function(){return h.filterUndefined}}),Object.defineProperty(t,"processReturn",{enumerable:!0,get:function(){return h.processReturn}}),Object.defineProperty(t,"setThrowOnCode",{enumerable:!0,get:function(){return h.setThrowOnCode}});var f=n(9094);Object.defineProperty(t,"getCloudbaseContext",{enumerable:!0,get:function(){return f.getCloudbaseContext}}),Object.defineProperty(t,"parseContext",{enumerable:!0,get:function(){return f.parseContext}}),Object.defineProperty(t,"getSecretInfo",{enumerable:!0,get:function(){return f.getSecretInfo}}),Object.defineProperty(t,"getServerInjectUrl",{enumerable:!0,get:function(){return f.getServerInjectUrl}}),Object.defineProperty(t,"getTcbContextConfig",{enumerable:!0,get:function(){return f.getTcbContextConfig}});var m=n(6480);Object.defineProperty(t,"getWxCloudToken",{enumerable:!0,get:function(){return m.getWxCloudToken}}),Object.defineProperty(t,"buildAdminUrl",{enumerable:!0,get:function(){return m.buildAdminUrl}}),Object.defineProperty(t,"sendWxRequest",{enumerable:!0,get:function(){return m.sendWxRequest}}),Object.defineProperty(t,"sendWxFormDataRequest",{enumerable:!0,get:function(){return m.sendWxFormDataRequest}}),Object.defineProperty(t,"callWxOpenApi",{enumerable:!0,get:function(){return m.callWxOpenApi}}),Object.defineProperty(t,"callCompatibleWxOpenApi",{enumerable:!0,get:function(){return m.callCompatibleWxOpenApi}}),Object.defineProperty(t,"callWxPayApi",{enumerable:!0,get:function(){return m.callWxPayApi}}),Object.defineProperty(t,"wxCallContainerApi",{enumerable:!0,get:function(){return m.wxCallContainerApi}}),Object.defineProperty(t,"getWxOptions",{enumerable:!0,get:function(){return m.getWxOptions}});var v,g=(v=new Map,{mode:"sync",setItem:function(e,t){v.set(e,t)},getItem:function(e){return v.get(e)},removeItem:function(e){v.delete(e)},clear:function(){v.clear()}}),b={genAdapter:function(e){return{nodeTool:s.nodeTool,getSecretInfo:c.getSecretInfo,root:{globalThis:{}},reqClass:a.NodeRequest,wsClass:p(),sessionStorage:g,localStorage:g,primaryStorage:i.StorageType.session,captchaOptions:{openURIWithCallback:function(t){var n=e.EventBus,i={},a=t,s=t.match(/^(data:.*?)(\?[^#\s]*)?$/);if(s){a=s[1];var c=s[2];c&&(i=(0,u.parseQueryString)(c))}var l=i.token,p=o(i,["token"]);return/^data:/.test(a)&&!l?Promise.reject({error:"invalid_argument",error_description:"invalie captcha data: ".concat(t)}):l?new Promise((function(e){n.$emit("CAPTCHA_DATA_CHANGE",r(r({},p),{token:l,url:a})),n.$once("RESOLVE_CAPTCHA_DATA",(function(t){e(t)}))})):Promise.reject({error:"unimplemented",error_description:"need to impl captcha data"})}}}},isMatch:function(){return"undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node},runtime:"node-adapter"};t.default=b},1651:function(e,t){"use strict";var n,r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};function i(e){return/^[1-9][0-9]{4,64}$/gim.test(e)}function a(e,i){return void 0===i&&(i={}),r(this,void 0,Promise,(function(){var r,a,s,c;return o(this,(function(o){switch(o.label){case 0:r="".concat(t.kMetadataBaseUrl,"/").concat(n.latest,"/").concat(e),a=new AbortController,i.timeout&&(s=setTimeout((function(){return a.abort()}),i.timeout)),o.label=1;case 1:return o.trys.push([1,,5,6]),[4,fetch(r,{signal:a.signal})];case 2:return 200!==(c=o.sent()).status?[3,4]:[4,c.text()];case 3:return[2,o.sent()];case 4:throw new Error("[ERROR] GET ".concat(r," status: ").concat(c.status));case 5:return s&&clearTimeout(s),[7];case 6:return[2]}}))}))}Object.defineProperty(t,"__esModule",{value:!0}),t.lookupCredentials=t.lookupAppId=t.lookup=t.isAppId=t.kMetadataVersions=t.kSecurityCredentialsPath=t.kAppIdPath=t.kMetadataBaseUrl=void 0,t.kMetadataBaseUrl="http://metadata.tencentyun.com",t.kAppIdPath="meta-data/app-id",t.kSecurityCredentialsPath="meta-data/cam/security-credentials",function(e){e.v20170919="2017-09-19",e["v1.0"]="1.0",e.latest="latest"}(n=t.kMetadataVersions||(t.kMetadataVersions={})),t.isAppId=i,t.lookup=a;var s={appId:void 0};t.lookupAppId=function(){return r(this,void 0,Promise,(function(){var e;return o(this,(function(n){switch(n.label){case 0:if(void 0!==s.appId)return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,a(t.kAppIdPath,{timeout:30})];case 2:return i(e=n.sent())?s.appId=e:s.appId="",[3,4];case 3:return n.sent(),[3,4];case 4:return[2,s.appId||""]}}))}))},t.lookupCredentials=function(e){return r(this,void 0,Promise,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,a("".concat(t.kSecurityCredentialsPath,"/").concat(e),{timeout:200})];case 1:return[2,n.sent()]}}))}))}},9768:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeRequest=void 0;var u=a(n(7147)),l=a(n(1017)),p=n(2764),d=n(1197),h=n(9094),f=n(4353),m=n(7922),v=null;function g(){return s(this,void 0,void 0,(function(){var e;return c(this,(function(t){switch(t.label){case 0:if(v)return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Promise.resolve().then(n.t.bind(n,8899,23))];case 2:return e=t.sent(),v=e.sign,[3,4];case 3:return t.sent(),console.error("缺少依赖 @cloudbase/signature-nodejs,请执行以下命令安装:\n\n npm install @cloudbase/signature-nodejs\n\n该依赖用于 Node 环境下的请求签名。"),[3,4];case 4:return[2,v]}}))}))}var b=function(){function e(e){var t=this;this.getReqOptions=function(e,n){return s(t,void 0,void 0,(function(){var t,o,i,a,s,u,l,p,v,b,y,_,x,w,E,I,S,O,T,A,P,C,R,N,k,j,U,D,L,M,q,B,F,W,V;return c(this,(function(c){switch(c.label){case 0:return t=new URL(e),o=(0,h.getCloudbaseContext)().TCB_SOURCE,s=(a="".concat((null===(L=null===(D=h.INIT_CONFIG.context)||void 0===D?void 0:D.extendedContext)||void 0===L?void 0:L.source)||o||"",",")).concat,[4,(0,f.getCurrRunEnvTag)()];case 1:return i=s.apply(a,[c.sent()]),n.headers=r(r({},n.headers),{"User-Agent":"adapter-node/".concat((null===(M=n.headers)||void 0===M?void 0:M["X-SDK-Version"])||"@cloudbase/js-sdk/".concat((0,m.getSdkVersion)())),"X-TCB-Source":i,"X-Client-Timestamp":(new Date).valueOf(),"X-TCB-Region":h.INIT_CONFIG.region||(0,f.getEnv)("TENCENTCLOUD_REGION")||"",Host:t.host}),!1===n.withCredentials||(null===(B=null===(q=n.headers.Authorization)||void 0===q?void 0:q.replace("Bearer",""))||void 0===B?void 0:B.trim())||t.pathname.startsWith("/auth/")&&t.pathname!==d.CLIENT_AUTH_PATH?[2,n]:(u=t.pathname===d.ADMIN_PATH,["/v1/model/","/v1/rdb/","/v1/ai/"].some((function(e){return t.pathname.startsWith(e)}))?[4,this.getClientCredential({origin:t.origin})]:[3,3]);case 2:return l=c.sent(),n.headers.Authorization="Bearer ".concat(l),[2,n];case 3:return p=(null===(F=this.config)||void 0===F?void 0:F.auth)||{},v=p.secretId,b=p.secretKey,y=p.sessionToken,_=((null===(W=this.config)||void 0===W?void 0:W.auth)||{}).secretType,x=n.method,w=n.body,E=JSON.parse(JSON.stringify(n.headers)),I=this.isNpmFormData(w),(S=I?w.__plainObj?r({},w.__plainObj):{}:"object"==typeof w?w:(0,f.safeParseJson)(w)||{}).envName=(null==S?void 0:S.env)||this.config.env||(null===(V=(0,h.getSecretInfo)())||void 0===V?void 0:V.env)||"",S.access_token?[2,n]:("get"===x.toLowerCase()&&(S=void 0),v&&b&&"SESSION_SECRET"!==_||(O=(0,h.getSecretInfo)(),v=O.secretId,b=O.secretKey,y=O.sessionToken),v&&b?(delete E.Authorization,E["content-type"]?E["content-type"]=E["content-type"].toLowerCase():E["Content-Type"]&&(E["Content-Type"]=E["Content-Type"].toLowerCase()),u&&y&&(S.sessionToken=y),T={secretId:v,secretKey:b,method:x,url:e,params:S,headers:E,withSignedParams:u,timestamp:Math.floor((new Date).getTime()/1e3)-1,isCloudApi:!u},E["content-type"]||E["Content-Type"]?[4,g()]:[2,n]):[2,n]);case 4:return(A=c.sent())?(P=A(T),C=P.authorization,R=P.timestamp,"string"==typeof y&&""!==y?u?(E.Authorization="".concat(C),E["X-Timestamp"]=R,E["X-Signature-Expires"]=600):E.Authorization="".concat(C,", Timestamp=").concat(R,", Token=").concat(y):(E.Authorization="".concat(C,", Timestamp=").concat(R),u&&(E["X-Timestamp"]=R,E["X-Signature-Expires"]=600)),I?(N=w,k=new Set(Object.keys(N.__plainObj||{})),S.envName&&!k.has("envName")&&N.append("envName",S.envName),S.sessionToken&&!k.has("sessionToken")&&N.append("sessionToken",S.sessionToken),j=N.getBuffer(),U=N.getHeaders(),[2,r(r({},n),{headers:r(r(r({},E),U),{"content-length":String(j.length)}),body:j})]):[2,r(r({},n),{headers:E,body:"object"==typeof S?JSON.stringify(S):S})]):[2,n]}}))}))},this.get=function(e){return t.request(r(r({},e),{method:"get"}),t.restrictedMethods.includes("get"))},this.post=function(e){return t.request(r(r({},e),{method:"post"}),t.restrictedMethods.includes("post"))},this.put=function(e){return t.request(r(r({},e),{method:"put"}))},this.upload=function(e){var n,o=e,i=o.data,a=o.file,s=o.fileContent,c=o.name,u=o.method,l=o.headers,p=void 0===l?{}:l,d=null!=a?a:s;if(void 0===d||void 0===c)throw new Error("file and name is required");var h=(0,f.obj2StrRecord)(null!=i?i:{}),m=null==u?void 0:u.toLowerCase(),v=null!==(n=["post","put"].find((function(e){return e===m})))&&void 0!==n?n:"put",g=new FormData;return"post"===v?(Object.keys(h).forEach((function(e){g.append(e,h[e])})),g.append("key",c),g.append("file",d instanceof Blob?d:new Blob([d])),t.request(r(r({},e),{data:g,method:v}),t.restrictedMethods.includes("upload"))):t.request(r(r({},e),{method:"put",headers:p,body:d}),t.restrictedMethods.includes("upload"))},this.download=function(e){return s(t,void 0,Promise,(function(){var t,n,r,o,i;return c(this,(function(a){switch(a.label){case 0:return[4,fetch(e.url,{headers:{},signal:AbortSignal.timeout(this.timeout)})];case 1:if(!(t=a.sent()).ok)throw new Error("Download failed with status ".concat(t.status));return[4,t.arrayBuffer()];case 2:return n=a.sent(),r=Buffer.from(n),(o=e.tempFilePath)?(i=l.dirname(o),u.existsSync(i)||u.mkdirSync(i,{recursive:!0}),u.writeFileSync(o,r),[2,{statusCode:200,tempFilePath:o}]):[2,{statusCode:200,tempFilePath:e.url,fileContent:r}]}}))}))},this.fetch=function(e){return s(t,void 0,Promise,(function(){var t,n,o,i,a,s,u,l,p,d,h,m,v,g,b,y;return c(this,(function(c){switch(c.label){case 0:return t=e.enableAbort,n=void 0!==t&&t,o=e.stream,i=void 0!==o&&o,a=e.signal,s=e.customReqOpts,u=this.getRealUrl(e.url,e.headers||{},e.body),l=(null==s?void 0:s.timeout)||this.timeout,p=this.createAbortController(l,n,a),d=p[0],h=p[1],m=e.headers?(0,f.headersInit2Indexable)(e.headers):void 0,[4,this.getReqOptions(u,r(r({},e),{headers:m,body:e.body,signal:d.signal}))];case 1:v=c.sent(),this.applyDuplexIfNeeded(v),c.label=2;case 2:return c.trys.push([2,,8,9]),[4,fetch(u,v)];case 3:return g=c.sent(),b=void 0,204!=+g.status?[3,4]:(b="",[3,7]);case 4:return i?(b=g.body,[3,7]):[3,5];case 5:return y=f.safeParseJson,[4,g.text()];case 6:b=y.apply(void 0,[c.sent()]),c.label=7;case 7:return[2,{data:b,statusCode:g.status,header:g.headers,response:g}];case 8:return h(),[7];case 9:return[2]}}))}))},this.request=function(e,n){return void 0===n&&(n=!1),s(t,void 0,Promise,(function(){var t,r,o,i,a,s,u,l,d,h,m,v,g,b,y,_,x,w,E,I,S,O,T,A,P,C,R,N,k,j,U,D,L;return c(this,(function(c){switch(c.label){case 0:return t=e.url,r=e.headers,o=void 0===r?{}:r,i=e.data,a=e.responseType,s=e.withCredentials,u=e.body,l=e.method,d=e.customReqOpts,h=(0,f.obj2StrRecord)(o),m=String(l).toLowerCase()||"get",v=(null==d?void 0:d.timeout)||this.timeout,g=e.signal,b=this.createAbortController(v,n,g),y=b[0],_=b[1],x=(0,f.isFormData)(i)?i:"application/x-www-form-urlencoded"===h["content-type"]?(0,f.toQueryString)(null!=i?i:{}):u||(i?JSON.stringify(i):void 0),w=this.getRealUrl((0,p.formatUrl)("https",null!=t?t:"","get"===m?i:{}),e.headers||{},x),[4,this.getReqOptions(w,{method:m,headers:h,body:x,credentials:s?"include":"same-origin",signal:y.signal})];case 1:E=c.sent(),this.applyDuplexIfNeeded(E),c.label=2;case 2:return c.trys.push([2,,19,20]),[4,fetch(w,E)];case 3:I=c.sent(),S={header:{},statusCode:I.status},c.label=4;case 4:return c.trys.push([4,11,,18]),"blob"!==a?[3,6]:(O=S,[4,I.blob()]);case 5:return O.data=c.sent(),[3,10];case 6:return"buffer"!==a?[3,8]:(T=S,P=(A=Buffer).from,[4,I.arrayBuffer()]);case 7:return T.data=P.apply(A,[c.sent()]),[3,10];case 8:return C=S,R=f.safeParseJson,[4,I.text()];case 9:C.data=R.apply(void 0,[c.sent()]),c.label=10;case 10:return[3,18];case 11:return N=c.sent(),console.log("catch an error",N),"blob"!==a?[3,13]:(k=S,[4,I.blob()]);case 12:return k.data=c.sent(),[3,17];case 13:return"buffer"!==a?[3,15]:(j=S,D=(U=Buffer).from,[4,I.arrayBuffer()]);case 14:return j.data=D.apply(U,[c.sent()]),[3,17];case 15:return L=S,[4,I.text()];case 16:L.data=c.sent(),c.label=17;case 17:return[3,18];case 18:return I.headers.forEach((function(e,t){return S.header[t.toLowerCase()]=e})),[2,S];case 19:return _(),[7];case 20:return[2]}}))}))};var n=e.timeout,o=e.restrictedMethods;this.timeout=n||15e3,this.restrictedMethods=o||["get","post","upload","download"],this.config=e}return e.prototype.getClientCredential=function(e){var t;return s(this,void 0,Promise,(function(){var n;return c(this,(function(r){switch(r.label){case 0:return[4,this.fetch({url:"".concat(e.origin).concat(d.CLIENT_AUTH_PATH),method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials"})})];case 1:return n=r.sent(),[2,null===(t=n.data)||void 0===t?void 0:t.access_token]}}))}))},e.prototype.getRealUrl=function(e,t,n){var r,o,i,a;if(null===(o=null===(r=t.Authorization)||void 0===r?void 0:r.replace("Bearer",""))||void 0===o?void 0:o.trim())return e;if(("object"==typeof n?n:(0,f.safeParseJson)(n)||"").access_token)return e;var s=new URL(e);return"/web"===s.pathname&&(null===(i=this.config.auth)||void 0===i?void 0:i.secretId)&&(null===(a=this.config.auth)||void 0===a?void 0:a.secretKey)&&(s.pathname=d.ADMIN_PATH),s.toString()},e.prototype.createAbortController=function(e,t,n){var r,o=new AbortController;return n&&(n.aborted?o.abort():n.addEventListener("abort",(function(){return o.abort()}),{once:!0})),(t||e)&&(r=setTimeout((function(){var t="请求在".concat(e/1e3,"s内未完成,已中断");console.warn(t),o.abort(new Error(t))}),e)),[o,function(){return clearTimeout(r)}]},e.prototype.applyDuplexIfNeeded=function(e){var t;e.body&&"function"==typeof(null===(t=e.body)||void 0===t?void 0:t.pipe)&&(e.duplex="half")},e.prototype.isNpmFormData=function(e){return e&&"object"==typeof e&&"function"==typeof e.getHeaders&&"function"==typeof e.getBuffer},e}();t.NodeRequest=b},5434:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.nodeTool=void 0;var a=n(1197),s=n(9094),c=n(4353),u=n(6480),l=null;function p(){var e;return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:if(l)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Promise.resolve().then(n.t.bind(n,156,23))];case 2:return t=r.sent(),l=(null===(e=t.default)||void 0===e?void 0:e.sign)||t.sign,[3,4];case 3:return r.sent(),console.error("缺少依赖 jsonwebtoken,请执行以下命令安装:\n\n npm install jsonwebtoken\n\n该依赖用于 Node 环境下的自定义登录票据生成。"),[3,4];case 4:return[2,l]}}))}))}function d(){var e=(0,s.getCloudbaseContext)();return{openId:e.WX_OPENID||"",appId:e.WX_APPID||"",uid:e.TCB_UUID||"",customUserId:e.TCB_CUSTOM_USER_ID||"",isAnonymous:"true"===e.TCB_ISANONYMOUS_USER}}function h(e,t){var n,r;return null===(r=null===(n=null==e?void 0:e.request)||void 0===n?void 0:n.send)||void 0===r?void 0:r.call(n,"auth.getUserInfoForAdmin",t,{pathname:"web",endPointMode:"CLOUD_API"})}var f=null;t.nodeTool=function(e,t){var n=t;if(e.parseContext=function(e){var t=(0,s.parseContext)(e);return f=t,t},e.getCloudbaseContext=function(e){return(0,s.getCloudbaseContext)(e)},e.auth){var l={getUserInfo:function(){return d()},getEndUserInfo:function(n){return o(this,void 0,Promise,(function(){var o;return i(this,(function(i){return o=d(),void 0===n?[2,{userInfo:o}]:((0,c.validateUid)(n),[2,h(e,{uuid:n,envName:t.env}).then((function(e){return e.code?e:{userInfo:r(r({},o),e.data),requestId:e.requestId}}))])}))}))},createTicket:function(e,n){return void 0===n&&(n={}),o(this,void 0,Promise,(function(){var o,s,u,l,d,h,f,m,v;return i(this,(function(i){switch(i.label){case 0:if((0,c.validateUid)(e),o=(new Date).getTime(),s=(t.auth||{}).credentials,!(u=t.env))throw r(r({},a.ERROR.INVALID_PARAM),{message:"no env in config"});if(!(null==s?void 0:s.env_id))throw r(r({},a.ERROR.INVALID_PARAM),{message:"当前私钥未包含env_id 信息, 请前往腾讯云云开发控制台,获取自定义登录最新私钥"});if(s.env_id!==u)throw r(r({},a.ERROR.INVALID_PARAM),{message:"当前私钥所属环境与 init 指定环境不一致!"});return l=n.refresh,d=void 0===l?36e5:l,h=n.expire,f=void 0===h?o+6048e5:h,[4,p()];case 1:return m=i.sent(),v=m({alg:"RS256",env:u,iat:o,exp:o+6e5,uid:e,refresh:d,expire:f},s.private_key,{allowInsecureKeySizes:!0,algorithm:"RS256"}),[2,"".concat(s.private_key_id,"/@@/").concat(v)]}}))}))},queryUserInfo:function(n){return o(this,void 0,Promise,(function(){var o,a,s;return i(this,(function(i){return o=n.uid,a=n.platform,s=n.platformId,[2,h(e,{uuid:o,platform:a,platformId:s,envName:t.env}).then((function(e){return e.code?e:{userInfo:r({},e.data),requestId:e.requestId}}))]}))}))},getClientIP:function(){return(0,s.getCloudbaseContext)().TCB_SOURCE_IP||""},getAuthContext:function(e){var t=(0,s.getCloudbaseContext)(e),n=t.TCB_UUID,r=t.LOGINTYPE,o=t.QQ_OPENID,i=t.QQ_APPID,a={uid:n,loginType:r};return"QQ-MINI"===r&&(a.appId=i,a.openId=o),a},getClientCredential:function(r){return o(this,void 0,void 0,(function(){var o;return i(this,(function(i){switch(i.label){case 0:return n.accessKey||t.accessKey?[2,n.accessKey||t.accessKey]:(o=e.request.getBaseEndPoint("GATEWAY"),[4,e.request.post({url:"".concat(o).concat("/auth/v1/token/clientCredential"),data:{grant_type:"client_credentials"},headers:{"content-type":"application/json"}},r?{timeout:r.timeout}:void 0)]);case 1:return[2,i.sent().data]}}))}))}},m=e.auth;Object.keys(l).forEach((function(e){m[e]=l[e]})),e.auth=new Proxy(m,{apply:function(e,t,n){var r=Reflect.apply(e,t,n);return r&&"object"==typeof r&&Object.keys(l).forEach((function(e){e in r||(r[e]=l[e])})),r}})}function v(){var t=n.serviceUrl||(0,s.getServerInjectUrl)()||void 0;return(0,u.getWxOptions)(n,f,t||"",e.request)}e.sendTemplateNotification=function(t,n){var r;return null===(r=null==e?void 0:e.callFunction)||void 0===r?void 0:r.call(e,{name:"lowcode-datasource",data:{methodName:"callWedaApi",params:{action:"PushNotifyMsg",data:{NotifyId:t.notifyId,Data:JSON.stringify(t.data),NotifyUsers:void 0,Url:t.url}},mode:"c"}},void 0,n)},e.callWxOpenApi=function(e,t){return(0,u.callWxOpenApi)(v(),e,t)},e.callWxPayApi=function(e,t){return(0,u.callWxPayApi)(v(),e,t)},e.wxCallContainerApi=function(e,t){return(0,u.wxCallContainerApi)(v(),e,t)},e.callCompatibleWxOpenApi=function(e,t){return(0,u.callCompatibleWxOpenApi)(v(),e,t)},e.getFileAuthority=function(t,n){var u=t.fileList;return o(void 0,void 0,void 0,(function(){var t,o,l,p,d,h;return i(this,(function(i){switch(i.label){case 0:if(t=(0,s.getCloudbaseContext)().LOGINTYPE,!Array.isArray(u))throw(0,c.E)(r(r({},a.ERROR.INVALID_PARAM),{message:"[js-sdk] getCosFileAuthority fileList must be a array"}));if(u.some((function(e){return!(null==e?void 0:e.path)||!["READ","WRITE","READWRITE"].includes(e.type)})))throw(0,c.E)(r(r({},a.ERROR.INVALID_PARAM),{message:"[js-sdk] getCosFileAuthority fileList param error"}));return[4,e.auth.getEndUserInfo()];case 1:if(o=i.sent().userInfo,l=o.openId,p=o.uid,!l&&!p)throw(0,c.E)(r(r({},a.ERROR.INVALID_PARAM),{message:"[js-sdk] admin do not need getCosFileAuthority."}));return d={openId:l,uid:p,loginType:t,fileList:u},[4,e.request.send("storage.getFileAuthority",d,{pathname:"web",endPointMode:"GATEWAY"},n?{timeout:n.timeout}:void 0)];case 2:if((h=i.sent()).code)throw(0,c.E)(r(r({},h),{message:"[js-sdk] getCosFileAuthority failed: ".concat(h.code)}));return[2,h]}}))}))},e.callApis=function(t,n){return o(void 0,void 0,void 0,(function(){var r,o,a,s,c,u,l,p,d,h,f,m;return i(this,(function(i){if(e.apis)return r=t.name,o=t.path,a=void 0===o?"":o,s=t.method,c=void 0===s?"POST":s,u=t.header,l=void 0===u?{}:u,p=t.body,d=t.token,h=(c||"POST").toLowerCase(),[2,null===(m=null===(f=e.apis[r])||void 0===f?void 0:f[h])||void 0===m?void 0:m.call(f,{path:a,method:c,headers:l,body:p,token:d},n)];throw new Error("callApis is not supported in current configuration")}))}))}}},4353:function(e,t,n){"use strict";var r,o,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.SYMBOL_DEFAULT_ENV=t.SYMBOL_CURRENT_ENV=t.isValidEnvFormat=t.isPageModuleName=t.processReturn=t.setThrowOnCode=t.filterUndefined=t.filterValue=t.E=t.TcbError=t.createWebStreamFromNodeReadableStream=t.parseQueryString=t.headersInit2Indexable=t.obj2StrRecord=t.safeParseJson=t.validateUid=t.getCurrRunEnvTag=t.checkIsInTencentCloud=t.checkIsInSumeru=t.checkIsInCBR=t.checkIsInScf=t.getEnv=t.toQueryString=t.isFormData=void 0;var u=n(2877),l=n(8775),p=n(1197),d=n(1651);function h(e){return"undefined"==typeof process?void 0!==e?void 0:{}:void 0!==e?{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}[e]:{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}}function f(){return!!h("CBR_ENV_ID")}t.isFormData=(o=u.utils).isFormData,t.toQueryString=o.toQueryString,t.getEnv=h,t.checkIsInScf=function(){return"SCF"===h("TENCENTCLOUD_RUNENV")},t.checkIsInCBR=f;var m=new Set(["formal","pre","test"]);function v(){return m.has(h("SUMERU_ENV")||"")}function g(){return s(this,void 0,Promise,(function(){var e;return c(this,(function(t){switch(t.label){case 0:return"true"===h("TENCENTCLOUD")?[2,!0]:[4,(0,d.lookupAppId)()];case 1:return[2,"string"==typeof(e=t.sent())&&""!==e]}}))}))}t.checkIsInSumeru=v,t.checkIsInTencentCloud=g,t.getCurrRunEnvTag=function(){return s(void 0,void 0,Promise,(function(){return c(this,(function(e){switch(e.label){case 0:return(0,t.checkIsInScf)()?[2,"scf"]:f()?[2,"cbr"]:v()?[2,"sumeru"]:[4,g()];case 1:return e.sent()?[2,"tencentcloud"]:[2,"unknown"]}}))}))},t.validateUid=function(e){if("string"!=typeof e)throw a(a({},p.ERROR.INVALID_PARAM),{message:"uid must be a string"});if(!p.checkCustomUserIdRegex.test(e))throw a(a({},p.ERROR.INVALID_PARAM),{message:'Invalid uid: "'.concat(e,'"')})},t.safeParseJson=function(e){if(!e||!e.trim())return null;try{return JSON.parse(e)}catch(t){return console.warn("catch an error",{e:t,text:e}),e}},t.obj2StrRecord=function(e){return Object.entries(e).reduce((function(e,t){var n=t[0],r=t[1];return e[n]=String(r),e}),{})},t.headersInit2Indexable=function(e){if(function(e){try{return e instanceof Headers}catch(e){return!1}}(e)){var t={};return e.forEach((function(e,n){t[n]=e})),t}return e},t.parseQueryString=function(e){var t={},n=e.replace(/^[?#]/,"");return n?(n.split("&").forEach((function(e){var n=e.split("="),r=n[0],o=n[1];r=decodeURIComponent(r),o=decodeURIComponent(o||""),r&&(t[r]?Array.isArray(t[r])?t[r].push(o):t[r]=[t[r],o]:t[r]=o)})),t):t},t.createWebStreamFromNodeReadableStream=function(e){var t=e[Symbol.asyncIterator]();return new l.ReadableStream({pull:function(e){return s(this,void 0,void 0,(function(){var n;return c(this,(function(r){switch(r.label){case 0:return[4,t.next()];case 1:return(n=r.sent()).done?e.close():e.enqueue(n.value),[2]}}))}))}})};var b=function(e){function t(t){var n=e.call(this,t.message)||this;return n.code=t.code||"",n.message=t.message||"",n.requestId=t.requestId||"",n}return i(t,e),t}(Error);function y(e){return new b(e)}function _(e,t){for(var n in e)e[n]===t&&delete e[n]}t.TcbError=b,t.E=y,t.filterValue=_,t.filterUndefined=function(e){_(e,void 0)};var x=!0;t.setThrowOnCode=function(e){x=e},t.processReturn=function(e){if(!x)return e;throw y(a({},e))},t.isPageModuleName=function(e){return void 0===e&&(e=""),"string"==typeof e&&e.startsWith("$:")};var w=/^[a-z0-9_-]{1,40}$/;t.isValidEnvFormat=function(e){return void 0===e&&(e=""),"string"==typeof e&&w.test(e)},t.SYMBOL_CURRENT_ENV=Symbol.for("SYMBOL_CURRENT_ENV"),t.SYMBOL_DEFAULT_ENV=Symbol.for("SYMBOL_DEFAULT_ENV")},6480:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.wxCallContainerApi=t.callWxPayApi=t.callCompatibleWxOpenApi=t.callWxOpenApi=t.getWxOptions=t.sendWxFormDataRequest=t.sendWxRequest=t.buildAdminUrl=t.getWxCloudToken=void 0;var u=a(n(7147)),l=n(9094),p=n(4353),d=n(1197),h="/.tencentcloudbase/wx/cloudbase_access_token",f=6e5,m={token:"",timestamp:0};function v(){var e=(0,l.getCloudbaseContext)(),t=e.TRIGGER_SRC,n=e.WX_TRIGGER_API_TOKEN_V0,r=e.WX_API_TOKEN,o=e.WX_CLOUDBASE_ACCESSTOKEN,i=void 0===o?"":o,a={};return a.wxCloudApiToken="timer"===t?n||r||"":r||"",a.wxCloudApiToken||(a.wxCloudbaseAccesstoken=i||function(){if(m.token&&Date.now()-m.timestamp<f)return m.token;try{if(("WX_LOCAL_SCF"==={IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.TENCENTCLOUD_RUNENV||"SCF"==={IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.TENCENTCLOUD_RUNENV)&&u.existsSync(h))return m.token=u.readFileSync(h).toString(),m.timestamp=Date.now(),m.token}catch(e){console.warn("[TCB][ERROR]: loadWxCloudbaseAccesstoken error: ",e)}return""}()),a}t.getWxCloudToken=v;var g=0;function b(e,t,n){var r="symbol"==typeof e.env?{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.TCB_ENV||{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.SCF_NAMESPACE||"":e.env||"",o=e.region||{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.TENCENTCLOUD_REGION||"",i=function(){g+=1;var e="".concat(Date.now().toString(16),"_").concat(g.toString(16)),t=(0,l.getCloudbaseContext)().TCB_SEQID,n=void 0===t?"":t;return n?"".concat(n,"-").concat(e):e}(),a=o?"".concat(o,".tcb-api.tencentcloudapi.com"):"tcb-api.tencentcloudapi.com",s=function(e){return/^[a-z][a-z0-9-]*[a-z0-9]$/.test(e)}(r)?"".concat(r,".").concat(a):a,c="".concat("https","://").concat(s).concat("/admin"),u=n||c,p=t?"env=".concat(r,"&seqId=").concat(i,"&scfRequestId=").concat(t.requestId):"env=".concat(r,"&seqId=").concat(i);return u.includes("?")?"".concat(u).concat(p):"".concat(u,"?").concat(p)}function y(e){var t=(0,l.getCloudbaseContext)(),n=v(),r=n.wxCloudApiToken,o=n.wxCloudbaseAccesstoken;e.wxCloudApiToken=r,o&&(e.wxCloudbaseAccesstoken=o),e.tcb_sessionToken=t.TCB_SESSIONTOKEN||""}function _(e,t,n,r){return s(this,void 0,void 0,(function(){return c(this,(function(o){return y(n),[2,e.requestInstance.send(t,n,{pathname:"web",endPointMode:"GATEWAY"},r?{timeout:r.timeout}:void 0)]}))}))}function x(e,t,o,i){return s(this,void 0,Promise,(function(){var a,s,u,l,p,d,h,f;return c(this,(function(c){switch(c.label){case 0:y(o);try{a=n(1191)}catch(e){throw new Error("缺少依赖 form-data,请执行 npm install form-data")}for((s=new a).append("action",t),u=0,l=Object.keys(o);u<l.length;u++)p=l[u],void 0!==o[p]&&s.append(p,o[p]);return d=r({action:t},o),s.__plainObj=d,h=b(e.config,e.scfContext,e.serviceUrl),[4,e.requestInstance.post({url:h,body:s,headers:s.getHeaders(),responseType:"buffer"},i?{timeout:i.timeout}:void 0)];case 1:return(f=c.sent()).data?[2,f.data]:[2,f]}}))}))}function w(e,t){if(void 0===t&&(t={}),t.getCrossAccountInfo||e.getCrossAccountInfo)throw(0,p.E)(r(r({},d.ERROR.INVALID_PARAM),{message:"invalid config: getCrossAccountInfo"}))}function E(e,t,n,r){var o=n.apiName,i=n.apiOptions,a=n.cgiName,u=n.requestData;return s(this,void 0,void 0,(function(){return c(this,(function(n){return w(t.config,r),[2,x(t,e,{apiName:o,apiOptions:i,cgiName:a,requestData:u},r)]}))}))}t.buildAdminUrl=b,t.sendWxRequest=_,t.sendWxFormDataRequest=x,t.getWxOptions=function(e,t,n,r){return{requestInstance:r,config:e,scfContext:t,serviceUrl:n}},t.callWxOpenApi=function(e,t,n){var o=t.apiName,i=t.apiOptions,a=t.cgiName,u=t.requestData;return s(this,void 0,void 0,(function(){var t,s,l;return c(this,(function(c){switch(c.label){case 0:try{t=u?JSON.stringify(u):""}catch(e){throw(0,p.E)(r(r({},e),{code:d.ERROR.INVALID_PARAM.code,message:"对象出现了循环引用"}))}return w(e.config,n),[4,_(e,"wx.api",{apiName:o,apiOptions:i,cgiName:a,requestData:t},n)];case 1:if((s=c.sent()).code)return[2,s];try{l=JSON.parse(s.responseData)}catch(e){l=s.responseData}return[2,{result:l,requestId:s.requestId}]}}))}))},t.callCompatibleWxOpenApi=function(e,t,n){return E("wx.openApi",e,t,n)},t.callWxPayApi=function(e,t,n){return E("wx.wxPayApi",e,t,n)},t.wxCallContainerApi=function(e,t,n){return E("wx.wxCallContainerApi",e,t,n)}},1985:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},s=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.getWxDefaultAdapter=t.Platform=void 0;var c=a(n(7917)),u=n(2764);t.Platform={},t.getWxDefaultAdapter=function(){return void 0===c.WxRequest?null:(c.WxRequest.prototype.upload=function(e){var t=this,n=this;return new Promise((function(o){var i=e.url,a=e.file,s=e.data,c=e.headers,u=wx.getFileSystemManager(),l=wx.request({url:i,method:e.method,header:r({"content-type":" "},c),data:u.readFileSync(a),timeout:t._timeout,success:function(e){var t={statusCode:e.statusCode,data:e.data||{}};200===e.statusCode&&(null==s?void 0:s.success_action_status)&&(t.statusCode=parseInt(s.success_action_status,10)),o(t)},fail:function(e){o(e)},complete:function(e){if((null==e?void 0:e.errMsg)&&n._timeout&&-1!==n._restrictedMethods.indexOf("upload")&&"request:fail timeout"===e.errMsg){console.warn(n._timeoutMsg);try{l.abort()}catch(e){}}}})}))},c.default.genAdapter=function(e){return{root:{globalThis:{}},reqClass:c.WxRequest,wsClass:c.WxMpWebSocket,captchaOptions:{openURIWithCallback:function(t){var n=e.EventBus,o={},i=t;console.log("openURIWithCallback",t);var a=t.match(/^(data:.*?)(\?[^#\s]*)?$/);if(a){i=a[1],console.log("openURIWithCallback url",i);var u=a[2];u&&(o=(0,c.parseQueryString)(u))}console.log("openURIWithCallback queryObj",o);var l=o.token,p=s(o,["token"]);return/^data:/.test(i)&&!l?Promise.reject({error:"invalid_argument",error_description:"invalie captcha data: ".concat(t)}):l?new Promise((function(e){console.log("wait for captcha..."),n.$emit("CAPTCHA_DATA_CHANGE",r(r({},p),{token:l,url:i})),n.$once("RESOLVE_CAPTCHA_DATA",(function(t){e(t)}))})):Promise.reject({error:"unimplemented",error_description:"need to impl captcha data"})}},localStorage:c.wxMpStorage,primaryStorage:u.StorageType.local,getAppSign:function(){var e=wx.getAccountInfoSync();return"undefined"!=typeof App||"undefined"!=typeof getApp||wx.onAppHide||wx.offAppHide||wx.onAppShow||wx.offAppShow?e&&e.miniProgram?e.miniProgram.appId:"":e&&e.plugin?e.plugin.appId:""}}},c.default)}},6938:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalCache=t.getCacheByEnvId=t.initCache=void 0;var o=n(2877).cache.CloudbaseCache,i={},a={};t.initCache=function(e){var t=e.env,n=e.platformInfo,s={userInfoKey:"".concat("user_info","_").concat(t)};i[t]=i[t]||new o(r(r({},e),{keys:s,platformInfo:n})),a[t]=a[t]||new o(r(r({},e),{keys:s,platformInfo:n,persistence:"local"}))},t.getCacheByEnvId=function(e){return i[e]},t.getLocalCache=function(e){return a[e]}},4276:function(e,t,n){"use strict";var r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.registerHook=t.registerComponent=void 0;var o=n(2877).constants.ERRORS,i={};function a(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=a(e[o],t[o]))}return e}t.registerComponent=function(e,t){var n=t.name,s=t.namespace,c=t.entity,u=t.injectEvents,l=t.IIFE,p=void 0!==l&&l;if(i[n]||s&&e[s])throw new Error(JSON.stringify({code:o.INVALID_OPERATION,msg:"Duplicate component ".concat(n)}));if(p){if(!c||"function"!=typeof c)throw new Error(JSON.stringify({code:o.INVALID_PARAMS,msg:"IIFE component's entity must be a function"}));c.call(e)}if(i[n]=t,s?e.prototype[s]=c:a(e.prototype,c),u){var d=u.bus,h=u.events;if(!d||!h||0===h.length)return;var f=e.prototype.fire||function(){};e.prototype.events||(e.prototype.events={}),(e.prototype.events||{})[n]?e.prototype.events[n].events=r(r([],e.prototype.events[n].events,!0),h,!0):e.prototype.events[n]={bus:d,events:h},e.prototype.fire=function(e,t){f(e,t);for(var n=0,r=Object.keys(this.events);n<r.length;n++){var o=r[n],i=this.events[o],a=i.bus;if(i.events.includes(e)){a.fire(e,t);break}}}}},t.registerHook=function(e,t){var n=t.entity,i=t.target;if(Object.prototype.hasOwnProperty.call(e,i))throw new Error(JSON.stringify({code:o.INVALID_OPERATION,msg:"target:".concat(i," is not exist")}));var a=e.prototype[i];if("function"!=typeof a)throw new Error(JSON.stringify({code:o.INVALID_OPERATION,msg:"target:".concat(i," is not a function which is the only type supports hook")}));e.prototype[i]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.call.apply(n,r([this],e,!1)),a.call.apply(a,r([this],e,!1))}}},3509:(e,t,n)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.i18nProxy=t.t=t.langMap=t.LANG_HEADER_KEY=t.LANGS=void 0;var o,i=n(2877);!function(e){e.ZH="zh-CN",e.EN="en-US"}(o=t.LANGS||(t.LANGS={})),t.LANG_HEADER_KEY="Accept-Language",t.langMap=((r={})[o.EN]={"请检查调用方式,或前往云开发 AI+ 首页查看文档":"Please check the calling method or visit the AI+ homepage to view the documentation","AI+ 请求出错,错误码":"AI+ request error, error code",错误信息:"error message",未实现:"not implemented","小程序不支持 wasm 加载":"wasm loading is not supported in mini programs","小程序不支持动态 js 加载":"dynamic js loading is not supported in mini programs",请求超时:"request timeout","缺少 privatelink sdk 地址":"missing privatelink sdk address"},r),t.t=function(e,n){var r;return(null===(r=t.langMap[n])||void 0===r?void 0:r[e])||e},t.i18nProxy=function(e,n){var r,a,s=function(e){return"lang_".concat(e.clientId||e.env)}(n),c=(e.adapter||{}).localStorage,u=n.lang||(null===(r=null==c?void 0:c.getItem)||void 0===r?void 0:r.call(c,s))||o.ZH;return null===(a=null==c?void 0:c.setItem)||void 0===a||a.call(c,s,u),new Proxy({t:function(e){return(0,t.t)(e,u)},LANG_HEADER_KEY:t.LANG_HEADER_KEY,lang:u},{get:function(e,t){var n;return"lang"===t&&(null===(n=null==c?void 0:c.getItem)||void 0===n?void 0:n.call(c,s))||e[t]},set:function(e,n,r){var o;return"lang"===n&&r!==e[n]&&(e[n]=r,e.t=function(e){return(0,t.t)(e,r)},null===(o=null==c?void 0:c.setItem)||void 0===o||o.call(c,s,r),i.langEvent.bus.fire(i.langEvent.LANG_CHANGE_EVENT,{i18n:e})),e[n]=r,!0}})}},901:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},a=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.getRequestByEnvId=t.initRequest=t.CloudbaseRequest=void 0;var s=n(7922),c=n(2877),u=n(6938),l=n(1985),p=c.constants.ERRORS,d=c.utils.genSeqId,h=c.utils.isFormData,f=c.utils.formatUrl,m=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"];function v(e,t,n){var o=e[t];e[t]=function(t){var i={},a={};n.forEach((function(n){var r=n.call(e,t),o=r.data,s=r.headers;Object.assign(i,o),Object.assign(a,s)}));var s=t.data;return s&&(h(s)?Object.keys(i).forEach((function(e){s.append(e,i[e])})):t.data=r(r({},s),i)),t.headers=r(r({},t.headers||{}),a),o.call(e,t)}}function g(){var e=d();return{data:{seqId:e},headers:{"X-SDK-Version":"@cloudbase/js-sdk/".concat((0,s.getSdkVersion)()),"x-seqid":e}}}var b=function(){function e(e){var t=this;this.throwWhenRequestFail=!1,this.config=e;var n={timeout:this.config.timeout,timeoutMsg:"[@cloudbase/js-sdk] 请求在".concat(this.config.timeout/1e3,"s内未完成,已中断"),restrictedMethods:["post","put"],auth:e.auth};this.reqClass=new l.Platform.adapter.reqClass(n),this.throwWhenRequestFail=e.throw||!1,this.localCache=(0,u.getLocalCache)(this.config.env),"GATEWAY"!==this.config.endPointMode&&(v(this.reqClass,"post",[g]),v(this.reqClass,"upload",[g]),v(this.reqClass,"download",[g])),c.langEvent.bus.on(c.langEvent.LANG_CHANGE_EVENT,(function(e){var n;t.config.i18n=(null===(n=e.data)||void 0===n?void 0:n.i18n)||t.config.i18n}))}return e.prototype.getAccessToken=function(e){return void 0===e&&(e=null),o(this,void 0,void 0,(function(){var t,n,r;return i(this,(function(o){switch(o.label){case 0:if(null!=e)return[2,e];if(!(t=this.config._fromApp).oauthInstance)throw new Error("you can't request without auth");return n=t.oauthInstance,r=n.oauth2client,[4,this.getOauthAccessTokenV2(r)];case 1:return[2,o.sent().accessToken]}}))}))},e.prototype.getDefaultHeaders=function(){var e,t,n;return(e={})[null===(t=this.config.i18n)||void 0===t?void 0:t.LANG_HEADER_KEY]=null===(n=this.config.i18n)||void 0===n?void 0:n.lang,e["X-SDK-Version"]="@cloudbase/js-sdk/".concat((0,s.getSdkVersion)()),e},e.prototype.post=function(e,t){return o(this,void 0,Promise,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,this.reqClass.post(r(r({},e),{headers:r(r({},e.headers),this.getDefaultHeaders()),customReqOpts:t}))];case 1:return[2,n.sent()]}}))}))},e.prototype.upload=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.reqClass.upload(r(r({},e),{headers:r(r({},e.headers),this.getDefaultHeaders())}))];case 1:return[2,t.sent()]}}))}))},e.prototype.download=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.reqClass.download(r(r({},e),{headers:r(r({},e.headers),this.getDefaultHeaders())}))];case 1:return[2,t.sent()]}}))}))},e.prototype.getBaseEndPoint=function(e){return void 0===e&&(e="CLOUD_API"),(0,s.getBaseEndPoint)(this.config.env,e)},e.prototype.getOauthAccessTokenV2=function(e){return o(this,void 0,Promise,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,e.getAccessToken()];case 1:return t=r.sent(),[4,e.getCredentials()];case 2:return n=r.sent(),[2,{accessToken:t,accessTokenExpire:new Date(n.expires_at).getTime()}]}}))}))},e.prototype.request=function(e,t,n,a){var c,u;return o(this,void 0,Promise,(function(){var o,l,p,d,h,v,g,b,y,_,x,w,E,I,S,O,T,A,P,C,R,N,k;return i(this,(function(i){switch(i.label){case 0:if(i.trys.push([0,4,,5]),o="x-tcb-trace_".concat(this.config.env),l="application/x-www-form-urlencoded",p=r({action:e,dataVersion:s.DATA_VERSION,env:this.config.env},t),-1!==m.indexOf(e))return[3,2];if(!(d=this.config._fromApp).oauthInstance)throw new Error("you can't request without auth");return h=d.oauthInstance,v=h.oauth2client,g=p,[4,this.getOauthAccessTokenV2(v)];case 1:g.access_token=i.sent().accessToken,i.label=2;case 2:return"storage.uploadFile"===e?(b=new FormData,Object.keys(b).forEach((function(e){Object.prototype.hasOwnProperty.call(b,e)&&void 0!==b[e]&&b.append(e,p[e])})),l="multipart/form-data"):(l="application/json;charset=UTF-8",b={},Object.keys(p).forEach((function(e){void 0!==p[e]&&(b[e]=p[e])}))),y={headers:r(r({"content-type":l},this.getDefaultHeaders()),null==n?void 0:n.headers)},(null==n?void 0:n.onUploadProgress)&&(y.onUploadProgress=n.onUploadProgress),this.config.region&&(y.headers["X-TCB-Region"]=this.config.region),(_=this.localCache.getStore(o))&&(y.headers["X-TCB-Trace"]=_),x=void 0!==(null==n?void 0:n.parse)?n.parse:t.parse,w=void 0!==(null==n?void 0:n.inQuery)?n.inQuery:t.inQuery,E=void 0!==(null==n?void 0:n.search)?n.search:t.search,I=r(r({},(null==n?void 0:n.defaultQuery)||{}),{env:this.config.env}),x&&(I.parse=!0),w&&(I=r(r({},w),I)),S=(null==n?void 0:n.endPointMode)||this.config.endPointMode||"CLOUD_API",O=(0,s.getEndPointInfo)(this.config.env,S),T=O.baseUrl,A=O.protocol,"GATEWAY"===S&&/^((database)\.)|(auth\.wsWebSign)/.test(e)&&(P=(0,s.getEndPointInfo)(this.config.env,"CLOUD_API"),T="".concat(P.baseUrl.match(/\/\/([^/?#]*)/)[0],"/web")),C=void 0,C=n.pathname?f(A,"".concat(null===(c=(0,s.getBaseEndPoint)(this.config.env,S))||void 0===c?void 0:c.replace(/^https?:/,""),"/").concat(n.pathname),I):f(A,T,I),E&&(C+=E),[4,this.post(r({url:C,data:b},y),a)];case 3:if(R=i.sent(),(N=null===(u=R.header)||void 0===u?void 0:u["x-tcb-trace"])&&this.localCache.setStore(o,N),200!==Number(R.status)&&200!==Number(R.statusCode)||!R.data)throw new Error("network request error");return[2,R];case 4:k=i.sent();try{k.requestId=k.requestId||(null==n?void 0:n.headers["x-request-id"])||(null==n?void 0:n.headers["X-Request-Id"])||""}catch(e){}throw k;case 5:return[2]}}))}))},e.prototype.fetch=function(e){var t,n,c,u,l,p,d,h;return o(this,void 0,Promise,(function(){var f,m,v,g,b,y,_,x,w=this;return i(this,(function(E){switch(E.label){case 0:f=e.token,m=e.headers,v=void 0===m?{}:m,g=e.withCredentials,b=void 0===g||g,y=a(e,["token","headers","withCredentials"]),_=function(){return o(w,void 0,void 0,(function(){var e,t,n,o;return i(this,(function(i){switch(i.label){case 0:if(e={},!b)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.getAccessToken(f)];case 2:return(t=i.sent())&&(e.Authorization="Bearer ".concat(t)),[3,4];case 3:if(n=i.sent(),"undefined"==typeof process||null==process.versions||null==process.versions.node)throw n;return[3,4];case 4:return o=r({headers:r(r(r({"X-SDK-Version":"@cloudbase/js-sdk/".concat((0,s.getSdkVersion)())},e),this.getDefaultHeaders()),v),withCredentials:b},y),[2,this.reqClass.fetch(o)]}}))}))},E.label=1;case 1:return E.trys.push([1,3,,6]),[4,_()];case 2:return[2,E.sent()];case 3:x=E.sent();try{x.requestId=x.requestId||v["x-request-id"]||v["X-Request-Id"]||""}catch(e){}if("ACCESS_TOKEN_EXPIRED"!==(null==x?void 0:x.code))return[3,5];if("function"!=typeof(null===(u=null===(c=null===(n=null===(t=this.config)||void 0===t?void 0:t._fromApp)||void 0===n?void 0:n.oauthInstance)||void 0===c?void 0:c.authApi)||void 0===u?void 0:u.refreshTokenForce))throw x;return[4,null===(h=null===(d=null===(p=null===(l=this.config)||void 0===l?void 0:l._fromApp)||void 0===p?void 0:p.oauthInstance)||void 0===d?void 0:d.authApi)||void 0===h?void 0:h.refreshTokenForce()];case 4:return E.sent(),[2,_()];case 5:throw x;case 6:return[2]}}))}))},e.prototype.send=function(e,t,n,a){return void 0===t&&(t={}),void 0===n&&(n={}),o(this,void 0,Promise,(function(){var o;return i(this,(function(i){switch(i.label){case 0:return[4,this.request(e,t,r(r({},n),{onUploadProgress:t.onUploadProgress}),a)];case 1:if((o=i.sent()).data.code&&this.throwWhenRequestFail)throw new Error(JSON.stringify({code:p.OPERATION_FAIL,msg:"[".concat(o.data.code,"] ").concat(o.data.message)}));return[2,o.data]}}))}))},e.prototype.gateWay=function(e,t){var n;return o(this,void 0,void 0,(function(){var o,a,u,l,d,h,f,m,v,g,b,y,_,x,w,E,I,S,O;return i(this,(function(i){switch(i.label){case 0:if(o=e.url,a=e.name,u=e.data,l=e.path,d=void 0===l?"":l,h=e.method,f=e.header,m=void 0===f?{}:f,!(a&&d||o))throw new Error(JSON.stringify({code:p.INVALID_PARAMS,msg:"[gateWay] invalid function name or path or url"}));try{v=u?JSON.stringify(u):""}catch(e){throw new Error(JSON.stringify({code:p.INVALID_PARAMS,msg:"[gateWay] invalid data"}))}if(g=c.utils.generateRequestId(),b=(0,s.getEndPointInfo)(this.config.env,"GATEWAY"),y=b.baseUrl,_=b.protocol,x="".concat(_).concat(y).concat(o||"/".concat(d,"/").concat(a)),w=["GET","HEAD"].includes(null===(n=null==h?void 0:h.toUpperCase)||void 0===n?void 0:n.call(h)))try{E={};try{E=JSON.parse(u)}catch(e){E=u||{}}x="".concat(x).concat(x.includes("?")?"&":"?").concat(Object.keys(E).map((function(e){return"".concat(e,"=").concat(E[e])})).join("&"))}catch(e){}return[4,this.fetch(r(r({method:h||"POST",headers:r({"Content-Type":"application/json; charset=utf-8","X-Request-Id":g},m)},w?{}:{body:v}),{url:x,customReqOpts:t}))];case 1:return I=i.sent(),S=[r({requestId:g},I)],O={},[4,I.data];case 2:return[2,r.apply(void 0,S.concat([(O.data=i.sent(),O)]))]}}))}))},e}();t.CloudbaseRequest=b;var y={};t.initRequest=function(e){y[e.env]=new b(r(r({},e),{throw:!0}))},t.getRequestByEnvId=function(e){return y[e]}},3548:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useAuthAdapter=void 0;var a=n(1019),s=function(){function e(e){var t,n;try{this.localStorage=(null==e?void 0:e.localStorage)||((null===(n=null===(t=null==e?void 0:e.adapter)||void 0===t?void 0:t.root)||void 0===n?void 0:n.globalThis)||globalThis).localStorage}catch(t){this.localStorage=(null==e?void 0:e.localStorage)||{}}}return e.prototype.getItem=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.localStorage.getItem(e)]}))}))},e.prototype.removeItem=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return this.localStorage.removeItem(e),[2]}))}))},e.prototype.setItem=function(e,t){return o(this,void 0,Promise,(function(){return i(this,(function(n){return this.localStorage.setItem(e,t),[2]}))}))},e.prototype.getItemSync=function(e){return this.localStorage.getItem(e)},e.prototype.setItemSync=function(e,t){this.localStorage.setItem(e,t)},e.prototype.removeItemSync=function(e){this.localStorage.removeItem(e)},e}(),c=/^[^:]+:\/\/[^/]+(\/[^?#]+)/,u=function(e,t){var n,r,o,i,a=null===(n=null==t?void 0:t.headers)||void 0===n?void 0:n["x-request-id"];return e||(e={}),((null==e?void 0:e.code)||(null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.error_code))&&(e={error:e.code||e.data.error,error_description:e.data.error_description||e.message||e.code||e.data.error_code,request_id:e.requestId,error_code:null===(o=e.data)||void 0===o?void 0:o.error_code}),(null==e?void 0:e.request_id)||(e.request_id=e.request_id||a),(null==e?void 0:e.error)?(e.error_uri=(i=null==t?void 0:t.url,c.test(i)?RegExp.$1:i),e):(null==e?void 0:e.data)||{}};t.useAuthAdapter=function(e){return e.adapter&&"default"!==e.adapter.type?function(e,t){var n=r({},e);try{if(!(null==e?void 0:e.storage)&&(null==t?void 0:t.localStorage)&&(n.storage=new s({localStorage:t.localStorage,adapter:t})),!e.captchaOptions&&(null==t?void 0:t.captchaOptions)&&(n.captchaOptions=t.captchaOptions),!e.baseRequest&&!e.request&&(null==t?void 0:t.reqClass)){var a={timeout:1e4,restrictedMethods:["get","post","upload","download","request"],auth:e.auth},c=new t.reqClass(a);n.baseRequest=function(e,t){var n,a,s,l,p;return o(this,void 0,void 0,(function(){var o,d,h,f;return i(this,(function(i){switch(i.label){case 0:if(o={},d=(null===(n=t.method)||void 0===n?void 0:n.toLocaleLowerCase())||"post","function"!=typeof(h=null===(s=null===(a=null==c?void 0:c[d])||void 0===a?void 0:a.bind)||void 0===s?void 0:s.call(a,c)))throw new Error("invalid 【".concat(d,"】 request method"));i.label=1;case 1:return i.trys.push([1,3,,4]),(null===(l=t.headers)||void 0===l?void 0:l["content-type"])&&!(null===(p=t.headers)||void 0===p?void 0:p["content-type"].includes("application/json"))||["string","undefined"].includes(typeof t.body)||(t.data=t.data||t.body,t.body=JSON.stringify(t.body)),[4,h(r({url:e},t))];case 2:return o=i.sent(),o=u(o,r(r({},t),{url:e})),[3,4];case 3:throw f=i.sent(),o=r(r({},null==f?void 0:f.data),f);case 4:if(null==o?void 0:o.error)throw o;return[2,o]}}))}))}}}catch(e){console.error("user adapter generate fail:",e)}return n}(e,e.adapter):function(e,t){var n=r({},e),c={};if((null==t?void 0:t.captchaOptions)&&(n.captchaOptions=t.captchaOptions),!a.adapterForWxMp.isMatch()||e.storage&&e.baseRequest)return n;try{var l=a.adapterForWxMp.genAdapter({}),p=l.localStorage,d=l.reqClass;if(p&&(c.storage=new s({localStorage:p,adapter:t})),d){var h=new d({timeout:1e4,restrictedMethods:["get","post","upload","download","request"]});c.request=function(e){return function(t,n){return o(this,void 0,void 0,(function(){return i(this,(function(o){return[2,new Promise((function(o,i){var a=Object.assign({},n);a.body&&"string"!=typeof a.body&&(a.body=JSON.stringify(a.body));var s=wx.request({url:t,data:a.body,timeout:e._timeout,method:a.method||"GET",header:a.headers,success:function(e){(e=u(e,r(r({},n),{url:t}))).error&&i(e),o(e)},fail:function(e){i({error:"unreachable",error_description:e.message})},complete:function(t){if(t&&t.errMsg&&e._timeout&&-1!==e._restrictedMethods.indexOf("request")&&"request:fail timeout"===t.errMsg){console.warn(e._timeoutMsg);try{s.abort()}catch(e){}}}})}))]}))}))}}(h)}return n.captchaOptions&&(c.baseRequest=c.request,c.request=void 0),r(r({},n),c)}catch(e){console.error("adapter generate fail:",e)}return n}(e,e.adapter)}},9895:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},u=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},l=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.registerAuth=t.AuthError=t.AuthErrorCode=t.AuthErrorCategory=t.AnonymousAuthProvider=t.CustomAuthProvider=t.WeixinAuthProvider=t.Auth=t.generateAuthInstance=t.LoginState=t.User=void 0;var p=n(6722),d=n(3548),h=n(1019),f=n(5266),m=n(916);Object.defineProperty(t,"WeixinAuthProvider",{enumerable:!0,get:function(){return m.WeixinAuthProvider}}),Object.defineProperty(t,"CustomAuthProvider",{enumerable:!0,get:function(){return m.CustomAuthProvider}}),Object.defineProperty(t,"AnonymousAuthProvider",{enumerable:!0,get:function(){return m.AnonymousAuthProvider}});var v=n(2877),g=function(){return"undefined"!=typeof window&&"undefined"!=typeof document},b=t.User=function(){function e(e){var t=e.cache,n=e.oauthInstance;this.cache=t,this.oauthInstance=n,this.setUserInfo()}var t,n,r;return e.prototype.checkLocalInfo=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){return this.uid=this.getLocalUserInfo("uid"),this.gender=this.getLocalUserInfo("gender"),this.picture=this.getLocalUserInfo("picture"),this.email=this.getLocalUserInfo("email"),this.emailVerified=this.getLocalUserInfo("email_verified"),this.phoneNumber=this.getLocalUserInfo("phone_number"),this.username=this.getLocalUserInfo("username"),this.name=this.getLocalUserInfo("name"),this.birthdate=this.getLocalUserInfo("birthdate"),this.zoneinfo=this.getLocalUserInfo("zoneinfo"),this.locale=this.getLocalUserInfo("locale"),this.sub=this.getLocalUserInfo("sub"),this.createdFrom=this.getLocalUserInfo("created_from"),this.providers=this.getLocalUserInfo("providers"),[2]}))}))},e.prototype.checkLocalInfoAsync=function(){return c(this,void 0,void 0,(function(){var e,t,n,r;return u(this,(function(o){switch(o.label){case 0:return e=this,[4,this.getLocalUserInfoAsync("uid")];case 1:return e.uid=o.sent(),t=this,[4,this.getLocalUserInfoAsync("gender")];case 2:return t.gender=o.sent(),this.picture=this.getLocalUserInfo("picture"),n=this,[4,this.getLocalUserInfoAsync("email")];case 3:return n.email=o.sent(),this.emailVerified=this.getLocalUserInfo("email_verified"),this.phoneNumber=this.getLocalUserInfo("phone_number"),r=this,[4,this.getLocalUserInfoAsync("username")];case 4:return r.username=o.sent(),this.name=this.getLocalUserInfo("name"),this.birthdate=this.getLocalUserInfo("birthdate"),this.zoneinfo=this.getLocalUserInfo("zoneinfo"),this.locale=this.getLocalUserInfo("locale"),this.sub=this.getLocalUserInfo("sub"),this.createdFrom=this.getLocalUserInfo("created_from"),this.providers=this.getLocalUserInfo("providers"),[2]}}))}))},e.prototype.update=function(e){return c(this,void 0,Promise,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return[4,this.oauthInstance.authApi.setUserProfile(i({},e))];case 1:return t=n.sent(),this.setLocalUserInfo(t),[2]}}))}))},e.prototype.updateUserBasicInfo=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.updateUserBasicInfo(i({},e))];case 1:return t.sent(),[4,this.refresh()];case 2:return t.sent(),[2]}}))}))},e.prototype.updatePassword=function(e,t){return this.oauthInstance.authApi.updatePasswordByOld({old_password:t,new_password:e})},e.prototype.updateUsername=function(e){return"string"!=typeof e&&(0,h.throwError)(h.ERRORS.INVALID_PARAMS,"username must be a string"),this.update({username:e})},e.prototype.refresh=function(e){return c(this,void 0,Promise,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return[4,this.oauthInstance.authApi.getUserInfo(e)];case 1:if("INVALID_ACCESS_TOKEN"===(t=n.sent()).code)throw this.setLocalUserInfo({}),t;return this.setLocalUserInfo(t),[2,t]}}))}))},e.prototype.getLocalUserInfo=function(e){var t=this.cache.keys.userInfoKey,n=this.cache.getStore(t);return e?n[e]:n||{}},e.prototype.setLocalUserInfo=function(e){var t=this.cache.keys.userInfoKey;this.cache.setStore(t,e),this.setUserInfo()},e.prototype.getLocalUserInfoAsync=function(e){return c(this,void 0,Promise,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return t=this.cache.keys.userInfoKey,[4,this.cache.getStoreAsync(t)];case 1:return[2,n.sent()[e]]}}))}))},e.prototype.setUserInfo=function(){var e=this,t=this.cache.keys.userInfoKey,n=this.cache.getStore(t);["uid","email","name","gender","picture","email_verified","phone_number","birthdate","zoneinfo","locale","sub","created_from","providers","username","created_at","open_id"].forEach((function(t){e[t]=n[t]}))},a([(0,h.catchErrorsDecorator)({title:"更新用户信息失败",messages:["请确认以下各项:"," 1 - 调用 User.update() 的语法或参数是否正确"," 2 - 用户信息中是否包含非法值","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",["function"==typeof(t=void 0!==p.authModels&&p.authModels.UserProfile)?t:Object]),s("design:returntype","function"==typeof(n="undefined"!=typeof Promise&&Promise)?n:Object)],e.prototype,"update",null),a([(0,h.catchErrorsDecorator)({title:"更新密码失败",messages:["请确认以下各项:"," 1 - 调用 User.updatePassword() 的语法或参数是否正确"," 3 - 新密码中是否包含非法字符","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[String,String]),s("design:returntype",void 0)],e.prototype,"updatePassword",null),a([(0,h.catchErrorsDecorator)({title:"更新用户名失败",messages:["请确认以下各项:"," 1 - 调用 User.updateUsername() 的语法或参数是否正确"," 2 - 当前环境是否开通了用户名密码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[String]),s("design:returntype",void 0)],e.prototype,"updateUsername",null),a([(0,h.catchErrorsDecorator)({title:"刷新本地用户信息失败",messages:["请确认以下各项:"," 1 - 调用 User.refresh() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[Object]),s("design:returntype","function"==typeof(r="undefined"!=typeof Promise&&Promise)?r:Object)],e.prototype,"refresh",null),e}();(0,m.applyUserV1Compat)(b);var y=function(){function e(e){var t=e.envId,n=e.cache,r=e.oauthInstance;t||(0,h.throwError)(h.ERRORS.INVALID_PARAMS,"envId is not defined"),this.cache=n,this.oauthInstance=r,this.user=new b({cache:this.cache,oauthInstance:r})}return e.prototype.checkLocalState=function(){var e;this.oauthLoginState=null===(e=this.oauthInstance)||void 0===e?void 0:e.authApi.hasLoginStateSync(),this.user.checkLocalInfo()},e.prototype.checkLocalStateAsync=function(){var e;return c(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,null===(e=this.oauthInstance)||void 0===e?void 0:e.authApi.getLoginState()];case 1:return t.sent(),[4,this.user.checkLocalInfoAsync()];case 2:return t.sent(),[2]}}))}))},e}();t.LoginState=y;var _=function(e){function t(t){var n=e.call(this)||this;return n.listeners=new Map,n.hasListenerSetUp=!1,n.config=t,n.oauthInstance=t.oauthInstance,n.cache=t.cache,n.init(),n.setAccessKey(),n}var n,r,d,m,b,_,x,w,E,I,S,O,T,A,P,C,R,N,k,j;return o(t,e),t.prototype.signInAnonymously=function(e){return c(this,void 0,Promise,(function(){var t,n,r,o,a;return u(this,(function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),[4,this.oauthInstance.authApi.signInAnonymously(e)];case 1:return s.sent(),[4,this.createLoginState()];case 2:return t=s.sent(),[4,this.getSession()];case 3:return n=s.sent().data,r=(void 0===n?{}:n).session,[2,i(i({},t),{data:{user:r.user,session:r},error:null})];case 4:return o=s.sent(),(a=new p.AuthError(o,{method:"signInAnonymously"})).category===p.AuthErrorCategory.PROVIDER_NOT_ENABLED?(console.error(a.helpMessage),console.error("[CloudBase Auth] 提示:匿名登录需要在控制台开启「匿名登录」。\n 如果您需要使用用户名密码登录,请改用 auth.signInWithPassword({ username, password })。\n 不要在匿名登录失败后自动回退到密码登录,这两种方式的使用场景不同。")):(console.warn("[CloudBase Auth] signInAnonymously 失败 [".concat(a.category,"]: ").concat(a.message)),a.loginMethodHint&&console.warn(a.loginMethodHint)),[2,{data:{user:null,session:null},error:a}];case 5:return[2]}}))}))},t.prototype.signUp=function(e){return c(this,void 0,Promise,(function(){var t,n,r=this;return u(this,(function(o){switch(o.label){case 0:return e.phone_number||e.verification_code||e.verification_token||e.provider_token?(e.phone_number&&(e.phone_number=this.formatPhone(e.phone_number)),[4,this.oauthInstance.authApi.signUp(e)]):[3,2];case 1:return o.sent(),[2,this.createLoginState()];case 2:return o.trys.push([2,4,,5]),this.validateAtLeastOne(e,[["email"],["phone"]],"You must provide either an email or phone number"),[4,this.getVerification(e.email?{email:e.email}:{phone_number:this.formatPhone(e.phone)})];case 3:return t=o.sent(),[2,{data:{verifyOtp:function(n){var o=n.token,a=n.messageId,s=void 0===a?t.verification_id:a;return c(r,void 0,Promise,(function(){var n,r,a,c,l;return u(this,(function(u){switch(u.label){case 0:return u.trys.push([0,8,,9]),[4,this.verify({verification_id:s||t.verification_id,verification_code:String(o)})];case 1:return n=u.sent(),t.is_user?[4,this.signIn({username:e.email||this.formatPhone(e.phone),verification_token:n.verification_token})]:[3,3];case 2:return u.sent(),[3,6];case 3:return delete(r=JSON.parse(JSON.stringify(e))).email,delete r.phone,[4,this.oauthInstance.authApi.signUp(i(i(i({},r),e.email?{email:e.email}:{phone_number:this.formatPhone(e.phone)}),{verification_token:n.verification_token,verification_code:o}))];case 4:return u.sent(),[4,this.createLoginState()];case 5:u.sent(),u.label=6;case 6:return[4,this.getSession()];case 7:return a=u.sent().data,[2,{data:{user:(c=(void 0===a?{}:a).session).user,session:c},error:null}];case 8:return l=u.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(l,{method:"signUp"})}];case 9:return[2]}}))}))}},error:null}];case 4:return n=o.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(n,{method:"signUp"})}];case 5:return[2]}}))}))},t.prototype.signOut=function(e){var t,n;return c(this,void 0,Promise,(function(){var r,o,a;return u(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),r=this.cache.keys.userInfoKey,[4,this.oauthInstance.authApi.signOut(e)];case 1:return o=s.sent(),[4,this.cache.removeStoreAsync(r)];case 2:return s.sent(),this.setAccessKey(),null===(t=this.config.eventBus)||void 0===t||t.fire(p.EVENTS.LOGIN_STATE_CHANGED,{eventType:p.LOGIN_STATE_CHANGED_TYPE.SIGN_OUT}),null===(n=this.config.eventBus)||void 0===n||n.fire(p.EVENTS.AUTH_STATE_CHANGED,{event:p.AUTH_STATE_CHANGED_TYPE.SIGNED_OUT}),[2,i(i({},o),{data:{},error:null})];case 3:return a=s.sent(),[2,{data:{},error:new p.AuthError(a,{method:"signOut"})}];case 4:return[2]}}))}))},t.prototype.onAuthStateChange=function(e){var t=this;this.hasListenerSetUp||(this.setupListeners(),this.hasListenerSetUp=!0);var n=Math.random().toString(36);return this.listeners.has(n)||this.listeners.set(n,new Set),this.listeners.get(n).add(e),{data:{subscription:{id:n,callback:e,unsubscribe:function(){var r=t.listeners.get(n);r&&(r.delete(e),0===r.size&&t.listeners.delete(n))}}}}},t.prototype.signInWithPassword=function(e){return c(this,void 0,Promise,(function(){var t,n,r,o;return u(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),this.validateAtLeastOne(e,[["username"],["email"],["phone"]],"You must provide either username, email, or phone"),this.validateParams(e,{password:{required:!0,message:"Password is required"}}),[4,this.signIn(i({username:e.username||e.email||this.formatPhone(e.phone),password:e.password},e.is_encrypt?{isEncrypt:!0,version:"v2"}:{}))];case 1:return a.sent(),[4,this.getSession()];case 2:return t=a.sent().data,[2,{data:{user:(n=(void 0===t?{}:t).session).user,session:n},error:null}];case 3:return r=a.sent(),(o=new p.AuthError(r,{method:"signInWithPassword"})).category===p.AuthErrorCategory.PROVIDER_NOT_ENABLED?console.error(o.helpMessage):o.category===p.AuthErrorCategory.INVALID_CREDENTIALS||o.category===p.AuthErrorCategory.USER_NOT_FOUND?console.warn(o.helpMessage):console.warn("[CloudBase Auth] signInWithPassword 失败 [".concat(o.category,"]: ").concat(o.message)),o.loginMethodHint&&console.info(o.loginMethodHint),[2,{data:{user:null,session:null},error:o}];case 4:return[2]}}))}))},t.prototype.signInWithIdToken=function(e){return c(this,void 0,Promise,(function(){var t,n,r;return u(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),this.validateParams(e,{token:{required:!0,message:"Token is required"}}),[4,this.signInWithProvider({provider_token:e.token})];case 1:return o.sent(),[4,this.getSession()];case 2:return t=o.sent().data,[2,{data:{user:(n=(void 0===t?{}:t).session).user,session:n},error:null}];case 3:return r=o.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(r,{method:"signInWithIdToken"})}];case 4:return[2]}}))}))},t.prototype.signInWithOtp=function(e){var t,n,r,o;return c(this,void 0,Promise,(function(){var a,s,l=this;return u(this,(function(d){switch(d.label){case 0:if(!(null===(t=e.options)||void 0===t?void 0:t.emailRedirectTo)&&(void 0===(null===(n=e.options)||void 0===n?void 0:n.shouldCreateUser)||(null===(r=e.options)||void 0===r?void 0:r.shouldCreateUser)))return[2,this.signUp({email:e.email,phone:e.phone})];d.label=1;case 1:return d.trys.push([1,3,,4]),this.validateAtLeastOne(e,[["email"],["phone"]],"You must provide either an email or phone number"),[4,this.getVerification(i(i({email_redirect_to:null===(o=e.options)||void 0===o?void 0:o.emailRedirectTo},e.email?{email:e.email}:{phone_number:this.formatPhone(e.phone)}),{target:"USER"}))];case 2:return a=d.sent(),[2,{data:{user:null,session:null,verifyOtp:function(t){var n=t.token,r=t.messageId,o=void 0===r?a.verification_id:r;return c(l,void 0,Promise,(function(){return u(this,(function(t){return[2,this.verifyOtp({email:e.email,phone:e.phone,token:String(n),messageId:o})]}))}))}},error:null}];case 3:return s=d.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(s,{method:"signInWithOtp"})}];case 4:return[2]}}))}))},t.prototype.verifyOAuth=function(e){return c(this,void 0,Promise,(function(){var t,n,r,o,a,s,c,l,d;return u(this,(function(u){switch(u.label){case 0:t={},u.label=1;case 1:return u.trys.push([1,7,,8]),n=(null==e?void 0:e.code)||v.utils.getQuery("code"),r=(null==e?void 0:e.state)||v.utils.getQuery("state"),n?r?(o=(0,f.getBrowserSession)(r),t.type=null==o?void 0:o.type,(a=(null==e?void 0:e.provider)||(null==o?void 0:o.provider)||v.utils.getQuery("provider"))?[4,this.grantProviderToken({provider_id:a,provider_redirect_uri:location.origin+location.pathname,provider_code:n})]:[2,{data:i(i({},t),{user:null,session:null,redirectUrl:null}),error:new p.AuthError({message:"Provider is required"})}]):[2,{data:{user:null,session:null,redirectUrl:null},error:new p.AuthError({message:"State is required"})}]:[2,{data:{user:null,session:null,redirectUrl:null},error:new p.AuthError({message:"Code is required"})}];case 2:return s=u.sent().provider_token,c=void 0,o.type!==p.OAUTH_TYPE.BIND_IDENTITY?[3,4]:[4,this.oauthInstance.authApi.toBindIdentity({provider_token:s,provider:a,fireEvent:!0})];case 3:return c=u.sent(),[3,6];case 4:return[4,this.signInWithIdToken({token:s})];case 5:(c=u.sent()).data=i(i({},t),c.data),u.label=6;case 6:return(l=new URLSearchParams(null===location||void 0===location?void 0:location.search)).delete("code"),l.delete("state"),c.data.redirectUrl=(0,f.addUrlSearch)(void 0===(null==o?void 0:o.search)?"?".concat(l.toString()):null==o?void 0:o.search,(null==o?void 0:o.hash)||location.hash),(0,f.removeBrowserSession)(r),[2,c];case 7:return d=u.sent(),[2,{data:i(i({},t),{user:null,session:null,redirectUrl:null}),error:new p.AuthError(d,{method:"verifyOAuth"})}];case 8:return[2]}}))}))},t.prototype.signInWithOAuth=function(e){var t,n,r,o,i;return c(this,void 0,Promise,(function(){var a,s,c,l,d,h,m,v,b;return u(this,(function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),this.validateParams(e,{provider:{required:!0,message:"Provider is required"}}),a=(null===(t=e.options)||void 0===t?void 0:t.redirectTo)||location.href,s=new URL(a),c=s.origin+s.pathname,l=(null===(n=e.options)||void 0===n?void 0:n.state)||"prd-".concat(e.provider,"-").concat(Math.random().toString(36).slice(2)),[4,this.genProviderRedirectUri({provider_id:e.provider,provider_redirect_uri:c,state:l})];case 1:return d=u.sent().uri,h=decodeURIComponent(d),m=h,(null===(r=e.options)||void 0===r?void 0:r.queryParams)&&(v=new URL(h),Object.entries(e.options.queryParams).forEach((function(e){var t=e[0],n=e[1];v.searchParams.set(t,n)})),m=v.toString()),(0,f.saveToBrowserSession)(l,{provider:e.provider,search:s.search,hash:s.hash,type:(null===(o=e.options)||void 0===o?void 0:o.type)||p.OAUTH_TYPE.SIGN_IN}),g()&&!(null===(i=e.options)||void 0===i?void 0:i.skipBrowserRedirect)&&window.location.assign(m),[2,{data:{url:m,provider:e.provider},error:null}];case 2:return b=u.sent(),[2,{data:{url:null,provider:null},error:new p.AuthError(b,{method:"signInWithOAuth"})}];case 3:return[2]}}))}))},t.prototype.getClaims=function(){return c(this,void 0,Promise,(function(){var e,t;return u(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getAccessToken()];case 1:return e=n.sent().accessToken,[2,{data:(0,p.weAppJwtDecodeAll)(e),error:null}];case 2:return t=n.sent(),[2,{data:{claims:null,header:null,signature:null},error:new p.AuthError(t,{method:"getClaims"})}];case 3:return[2]}}))}))},t.prototype.resetPasswordForEmail=function(e,t){return c(this,void 0,Promise,(function(){var n,r,o,a,s,l,d=this;return u(this,(function(h){switch(h.label){case 0:return h.trys.push([0,2,,3]),this.validateParams({emailOrPhone:e},{emailOrPhone:{required:!0,message:"Email or phone is required"}}),n=(t||{}).redirectTo,r=e.includes("@"),o=void 0,r?o={email:e}:(a=this.formatPhone(e),o={phone_number:a}),[4,this.getVerification(i(i({},o),{target:"USER"}))];case 1:return s=h.sent(),[2,{data:{updateUser:function(t){return c(d,void 0,Promise,(function(){var o,i,a,c;return u(this,(function(u){switch(u.label){case 0:this.validateParams(t,{nonce:{required:!0,message:"Nonce is required"},password:{required:!0,message:"Password is required"}}),u.label=1;case 1:return u.trys.push([1,5,,6]),[4,this.verify({verification_id:s.verification_id,verification_code:t.nonce})];case 2:return o=u.sent(),[4,this.oauthInstance.authApi.resetPassword({email:r?e:void 0,phone_number:r?void 0:e,new_password:t.password,verification_token:o.verification_token})];case 3:return u.sent(),null===(c=this.config.eventBus)||void 0===c||c.fire(p.EVENTS.AUTH_STATE_CHANGED,{event:p.AUTH_STATE_CHANGED_TYPE.PASSWORD_RECOVERY}),[4,this.signInWithPassword({email:r?e:void 0,phone:r?void 0:e,password:t.password})];case 4:return i=u.sent(),n&&g()&&window.location.assign(n),[2,i];case 5:return a=u.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(a,{method:"resetPasswordForEmail"})}];case 6:return[2]}}))}))}},error:null}];case 2:return l=h.sent(),[2,{data:{updateUser:null},error:new p.AuthError(l,{method:"resetPasswordForEmail"})}];case 3:return[2]}}))}))},t.prototype.resetPasswordForOld=function(e){return c(this,void 0,void 0,(function(){var t,n,r;return u(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this.oauthInstance.authApi.updatePasswordByOld({old_password:e.old_password,new_password:e.new_password})];case 1:return o.sent(),[4,this.getSession()];case 2:return t=o.sent().data,[2,{data:{user:(n=(void 0===t?{}:t).session).user,session:n},error:null}];case 3:return r=o.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(r,{method:"resetPasswordForOld"})}];case 4:return[2]}}))}))},t.prototype.verifyOtp=function(e){return c(this,void 0,Promise,(function(){var t,n,r,o,i;return u(this,(function(a){switch(a.label){case 0:return a.trys.push([0,6,,7]),t=e.type,n=String(e.token),this.validateParams(e,{token:{required:!0,message:"Token is required"},messageId:{required:!0,message:"messageId is required"}}),["phone_change","email_change"].includes(t)?[4,this.verify({verification_id:e.messageId,verification_code:n})]:[3,2];case 1:return a.sent(),[3,4];case 2:return[4,this.signInWithUsername({verificationInfo:{verification_id:e.messageId,is_user:!0},verificationCode:n,username:e.email||this.formatPhone(e.phone)||"",loginType:e.email?"email":"phone"})];case 3:a.sent(),a.label=4;case 4:return[4,this.getSession()];case 5:return r=a.sent().data,[2,{data:{user:(o=(void 0===r?{}:r).session).user,session:o},error:null}];case 6:return i=a.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(i,{method:"verifyOtp"})}];case 7:return[2]}}))}))},t.prototype.getSession=function(){return c(this,void 0,Promise,(function(){var e,t,n,r;return u(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this.oauthInstance.oauth2client.getCredentials()];case 1:return(e=o.sent())&&"accessKey"!==e.scope?[4,this.getUser(!1)]:[2,{data:{session:null,user:null},error:null}];case 2:return t=o.sent().data,n=(void 0===t?{}:t).user,[2,{data:{session:i(i({},e),{user:n}),user:n},error:null}];case 3:return r=o.sent(),[2,{data:{session:null,user:null},error:new p.AuthError(r,{method:"getSession"})}];case 4:return[2]}}))}))},t.prototype.refreshSession=function(e){return c(this,void 0,Promise,(function(){var t,n,r,o,a;return u(this,(function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),[4,this.oauthInstance.oauth2client.localCredentials.getCredentials()];case 1:return(t=s.sent()).refresh_token=e||t.refresh_token,[4,this.oauthInstance.oauth2client.refreshToken(t)];case 2:return n=s.sent(),[4,this.getUser(!1)];case 3:return r=s.sent().data,[2,{data:{user:o=(void 0===r?{}:r).user,session:i(i({},n),{user:o})},error:null}];case 4:return a=s.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(a,{method:"refreshSession"})}];case 5:return[2]}}))}))},t.prototype.getUser=function(e){return void 0===e&&(e=!0),c(this,void 0,Promise,(function(){var t,n,r;return u(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this.oauthInstance.oauth2client.getCredentials()];case 1:return(t=o.sent())&&"accessKey"!==t.scope?(n=this.convertToUser,[4,this.getCurrentUser(e)]):[2,{data:{user:null},error:null}];case 2:return[2,{data:{user:n.apply(this,[o.sent()])},error:null}];case 3:return r=o.sent(),[2,{data:{user:null},error:new p.AuthError(r,{method:"getUser"})}];case 4:return[2]}}))}))},t.prototype.refreshUser=function(){return c(this,void 0,Promise,(function(){var e,t,n;return u(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,this.currentUser.refresh()];case 1:return r.sent(),[4,this.getSession()];case 2:return e=r.sent().data,[2,{data:{user:(t=(void 0===e?{}:e).session).user,session:t},error:null}];case 3:return n=r.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(n,{method:"refreshUser"})}];case 4:return[2]}}))}))},t.prototype.updateUser=function(e){var t;return c(this,void 0,Promise,(function(){var n,r,o,a,s,d,h,f,m,v,g,b,y=this;return u(this,(function(_){switch(_.label){case 0:if(_.trys.push([0,8,,9]),!Object.keys(e).some((function(t){return void 0!==e[t]&&null!==e[t]&&""!==e[t]})))throw new p.AuthError({message:"At least one field must be provided for update"});return n=e.email,r=e.phone,o=l(e,["email","phone"]),s=void 0!==r,d={},(a=void 0!==n)||s?(h=void 0,a?(h={email:e.email},f="email_change"):(m=this.formatPhone(e.phone),h={phone_number:m},f="phone_change"),[4,this.getVerification(i({},h))]):[3,4];case 1:return v=_.sent(),Object.keys(o).length>0?[4,this.updateUserBasicInfo(o)]:[3,3];case 2:_.sent(),_.label=3;case 3:return d={messageId:v.verification_id,verifyOtp:function(t){return c(y,void 0,Promise,(function(){var n,r,o,i;return u(this,(function(s){switch(s.label){case 0:return s.trys.push([0,11,,12]),t.email&&e.email===t.email?[4,this.verifyOtp({type:"email_change",email:e.email,token:t.token,messageId:v.verification_id})]:[3,3];case 1:return(n=s.sent()).error?[2,n]:[4,this.updateUserBasicInfo({email:e.email})];case 2:return s.sent(),[3,9];case 3:return t.phone&&e.phone===t.phone?[4,this.verifyOtp({type:"phone_change",phone:e.phone,token:t.token,messageId:v.verification_id})]:[3,6];case 4:return(n=s.sent()).error?[2,n]:[4,this.updateUserBasicInfo({phone:this.formatPhone(e.phone)})];case 5:return s.sent(),[3,9];case 6:return[4,this.verifyOtp({type:f,email:a?e.email:void 0,phone:a?void 0:e.phone,token:t.token,messageId:v.verification_id})];case 7:return(n=s.sent()).error?[2,n]:[4,this.updateUserBasicInfo(e)];case 8:s.sent(),s.label=9;case 9:return[4,this.getUser(!1)];case 10:return r=s.sent().data.user,null===(i=this.config.eventBus)||void 0===i||i.fire(p.EVENTS.AUTH_STATE_CHANGED,{event:p.AUTH_STATE_CHANGED_TYPE.USER_UPDATED}),[2,{data:{user:r},error:null}];case 11:return o=s.sent(),[2,{data:{user:null},error:new p.AuthError(o,{method:"updateUser"})}];case 12:return[2]}}))}))}},[3,6];case 4:return[4,this.updateUserBasicInfo(e)];case 5:_.sent(),_.label=6;case 6:return[4,this.getUser(!1)];case 7:return g=_.sent().data.user,Object.keys(o).length>0&&(null===(t=this.config.eventBus)||void 0===t||t.fire(p.EVENTS.AUTH_STATE_CHANGED,{event:p.AUTH_STATE_CHANGED_TYPE.USER_UPDATED})),[2,{data:i({user:g},d),error:null}];case 8:return b=_.sent(),[2,{data:{user:null},error:new p.AuthError(b,{method:"updateUser"})}];case 9:return[2]}}))}))},t.prototype.getUserIdentities=function(){var e;return c(this,void 0,Promise,(function(){var t,n;return u(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.oauthInstance.authApi.getProviders()];case 1:return t=r.sent(),[2,{data:{identities:null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.filter((function(e){return!!e.bind}))},error:null}];case 2:return n=r.sent(),[2,{data:{identities:null},error:new p.AuthError(n,{method:"getUserIdentities"})}];case 3:return[2]}}))}))},t.prototype.linkIdentity=function(e){return c(this,void 0,Promise,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.validateParams(e,{provider:{required:!0,message:"Provider is required"}}),[4,this.signInWithOAuth({provider:e.provider,options:{type:p.OAUTH_TYPE.BIND_IDENTITY}})];case 1:return n.sent(),[2,{data:{provider:e.provider},error:null}];case 2:return t=n.sent(),[2,{data:{provider:null},error:new p.AuthError(t,{method:"linkIdentity"})}];case 3:return[2]}}))}))},t.prototype.unlinkIdentity=function(e){return c(this,void 0,Promise,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.validateParams(e,{provider:{required:!0,message:"Provider is required"}}),[4,this.oauthInstance.authApi.unbindProvider({provider_id:e.provider})];case 1:return n.sent(),[2,{data:{},error:null}];case 2:return t=n.sent(),[2,{data:{},error:new p.AuthError(t,{method:"unlinkIdentity"})}];case 3:return[2]}}))}))},t.prototype.reauthenticate=function(){return c(this,void 0,Promise,(function(){var e,t,n,r,o=this;return u(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.getUser(!1)];case 1:return e=a.sent().data.user,this.validateAtLeastOne(e,[["email","phone"]],"You must provide either an email or phone number"),t=e.email?{email:e.email}:{phone_number:this.formatPhone(e.phone)},[4,this.getVerification(t)];case 2:return n=a.sent(),[2,{data:{updateUser:function(e){return c(o,void 0,Promise,(function(){var r,o,a,s,c;return u(this,(function(u){switch(u.label){case 0:this.validateParams(e,{nonce:{required:!0,message:"Nonce is required"}}),u.label=1;case 1:return u.trys.push([1,9,,10]),e.password?[4,this.verify({verification_id:n.verification_id,verification_code:e.nonce})]:[3,5];case 2:return r=u.sent(),[4,this.oauthInstance.authApi.sudo({verification_token:r.verification_token})];case 3:return o=u.sent(),[4,this.oauthInstance.authApi.setPassword({new_password:e.password,sudo_token:o.sudo_token})];case 4:return u.sent(),[3,7];case 5:return[4,this.signInWithUsername(i(i({verificationInfo:n,verificationCode:e.nonce},t),{loginType:t.email?"email":"phone"}))];case 6:u.sent(),u.label=7;case 7:return[4,this.getSession()];case 8:return a=u.sent().data,[2,{data:{user:(s=(void 0===a?{}:a).session).user,session:s},error:null}];case 9:return c=u.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(c,{method:"reauthenticate"})}];case 10:return[2]}}))}))}},error:null}];case 3:return r=a.sent(),[2,{data:{updateUser:null},error:new p.AuthError(r,{method:"reauthenticate"})}];case 4:return[2]}}))}))},t.prototype.resend=function(e){return c(this,void 0,Promise,(function(){var t,n,r;return u(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.validateAtLeastOne(e,[["email"],["phone"]],"You must provide either an email or phone number"),t="signup"===e.type?"ANY":"USER",n={target:t},"email"in e&&(n.email=e.email),"phone"in e&&(n.phone_number=this.formatPhone(e.phone)),[4,this.oauthInstance.authApi.getVerification(n)];case 1:return[2,{data:{messageId:o.sent().verification_id},error:null}];case 2:return r=o.sent(),[2,{data:{messageId:null},error:new p.AuthError(r,{method:"resend"})}];case 3:return[2]}}))}))},t.prototype.setSession=function(e){var t;return c(this,void 0,Promise,(function(){var n,r,o;return u(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),this.validateParams(e,{access_token:{required:!0,message:"Access token is required"},refresh_token:{required:!0,message:"Refresh token is required"}}),[4,this.oauthInstance.oauth2client.refreshToken(e,{throwError:!0})];case 1:return i.sent(),[4,this.getSession()];case 2:return n=i.sent().data,r=(void 0===n?{}:n).session,null===(t=this.config.eventBus)||void 0===t||t.fire(p.EVENTS.AUTH_STATE_CHANGED,{event:p.AUTH_STATE_CHANGED_TYPE.SIGNED_IN}),[2,{data:{user:r.user,session:r},error:null}];case 3:return o=i.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(o,{method:"setSession"})}];case 4:return[2]}}))}))},t.prototype.exchangeCodeForSession=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){return[2]}))}))},t.prototype.deleteUser=function(e){return c(this,void 0,Promise,(function(){var t,n;return u(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),this.validateParams(e,{password:{required:!0,message:"Password is required"}}),[4,this.oauthInstance.authApi.sudo(e)];case 1:return t=r.sent().sudo_token,[4,this.oauthInstance.authApi.deleteMe({sudo_token:t})];case 2:return r.sent(),[2,{data:{},error:null}];case 3:return n=r.sent(),[2,{data:{},error:new p.AuthError(n,{method:"deleteUser"})}];case 4:return[2]}}))}))},t.prototype.toDefaultLoginPage=function(e){return void 0===e&&(e={}),c(this,void 0,Promise,(function(){var t,n,r,o,i;return u(this,(function(a){try{return t=e.config_version||"env",n=Object.keys(e.query||{}).map((function(t){return"".concat(t,"=").concat(e.query[t])})).join("&"),h.adapterForWxMp.isMatch()?wx.navigateTo({url:"/packages/$wd_system/pages/login/index".concat(n?"?".concat(n):"")}):(r=e.redirect_uri||window.location.href,o=new URL(r),i="".concat(o.origin,"/__auth/?app_id=").concat(e.app_id||"","&env_id=").concat(this.config.env,"&client_id=").concat(this.config.clientId||this.config.env,"&config_version=").concat(t,"&redirect_uri=").concat(encodeURIComponent(r)).concat(n?"&".concat(n):""),window.location.href=i),[2,{data:{},error:null}]}catch(e){return[2,{data:{},error:new p.AuthError(e,{method:"toDefaultLoginPage"})}]}return[2]}))}))},t.prototype.signInWithCustomTicket=function(e){return c(this,void 0,Promise,(function(){var t,n,r,o;return u(this,(function(a){switch(a.label){case 0:e&&this.setCustomSignFunc(e),a.label=1;case 1:return a.trys.push([1,5,,6]),[4,this.oauthInstance.authApi.signInWithCustomTicket()];case 2:return a.sent(),[4,this.createLoginState()];case 3:return t=a.sent(),[4,this.getSession()];case 4:return n=a.sent().data,r=(void 0===n?{}:n).session,[2,i(i({},t),{data:{user:r.user,session:r},error:null})];case 5:return o=a.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(o,{method:"signInWithCustomTicket"})}];case 6:return[2]}}))}))},t.prototype.signInWithOpenId=function(e){var t=(void 0===e?{}:e).useWxCloud,n=void 0===t||t;return c(this,void 0,Promise,(function(){var e,t,r,o,a,s,l=this;return u(this,(function(d){switch(d.label){case 0:if(!h.adapterForWxMp.isMatch())throw Error("wx api undefined");e=wx.getAccountInfoSync().miniProgram,t=function(t){return c(l,void 0,void 0,(function(){var r,o;return u(this,(function(i){switch(i.label){case 0:r=void 0,o=void 0,i.label=1;case 1:return i.trys.push([1,4,,5]),[4,this.oauthInstance.authApi.grantProviderToken({provider_id:null==e?void 0:e.appId,provider_code:t,provider_params:{provider_code_type:"open_id",appid:null==e?void 0:e.appId}},n)];case 2:if((null==(r=i.sent())?void 0:r.error_code)||!r.provider_token)throw r;return[4,this.oauthInstance.authApi.signInWithProvider({provider_token:r.provider_token},n)];case 3:if(null==(o=i.sent())?void 0:o.error_code)throw o;return[3,5];case 4:throw i.sent();case 5:return[4,this.oauthInstance.oauth2client.setCredentials(o)];case 6:return i.sent(),[2]}}))}))},d.label=1;case 1:return d.trys.push([1,5,,6]),[4,new Promise((function(e,n){wx.login({success:function(r){return c(l,void 0,void 0,(function(){var o;return u(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,t(r.code)];case 1:return i.sent(),e(!0),[3,3];case 2:return o=i.sent(),n(o),[3,3];case 3:return[2]}}))}))},fail:function(e){var t=new Error(null==e?void 0:e.errMsg);t.code=null==e?void 0:e.errno,n(t)}})}))];case 2:return d.sent(),[4,this.createLoginState()];case 3:return r=d.sent(),[4,this.getSession()];case 4:return o=d.sent().data,a=(void 0===o?{}:o).session,[2,i(i({},r),{data:{user:a.user,session:a},error:null})];case 5:return s=d.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(s,{method:"signInWithOpenId"})}];case 6:return[2]}}))}))},t.prototype.signInWithPhoneAuth=function(e){var t=e.phoneCode,n=void 0===t?"":t,r=e.useWxCloud,o=void 0!==r&&r;return c(this,void 0,Promise,(function(){var e,t,r,a,s,c,l,d,f;return u(this,(function(u){switch(u.label){case 0:return h.adapterForWxMp.isMatch()?(e=wx.getAccountInfoSync().miniProgram,t={provider_params:{provider_code_type:"phone",code:n,appid:e.appId},provider_id:e.appId},[4,wx.login()]):[2,{data:{user:null,session:null},error:new p.AuthError({message:"wx api undefined"})}];case 1:r=u.sent().code,t.provider_code=r,u.label=2;case 2:return u.trys.push([2,5,,6]),[4,this.oauthInstance.authApi.grantProviderToken(t,o)];case 3:if((a=u.sent()).error_code)throw a;return[4,this.oauthInstance.authApi.signInWithProvider({provider_token:a.provider_token},o)];case 4:if(null==(s=u.sent())?void 0:s.error_code)throw s;return[3,6];case 5:return c=u.sent(),[2,{data:{user:null,session:null},error:new p.AuthError(c,{method:"signInWithPhoneAuth"})}];case 6:return[4,this.createLoginState()];case 7:return l=u.sent(),[4,this.getSession()];case 8:return d=u.sent().data,f=(void 0===d?{}:d).session,[2,i(i({},l),{data:{user:f.user,session:f},error:null})]}}))}))},t.prototype.bindPhoneNumber=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.editContact(e)]}))}))},t.prototype.unbindProvider=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.unbindProvider(e)]}))}))},t.prototype.bindEmail=function(e){return this.oauthInstance.authApi.editContact(e)},t.prototype.verify=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.verify(e)]}))}))},t.prototype.getVerification=function(e,t){return c(this,void 0,Promise,(function(){return u(this,(function(n){return e.phone_number&&(e.phone_number=this.formatPhone(e.phone_number)),[2,this.oauthInstance.authApi.getVerification(e,t)]}))}))},Object.defineProperty(t.prototype,"currentUser",{get:function(){if("async"!==this.cache.mode){var e=this.hasLoginState();return e&&e.user||null}(0,h.printWarn)(h.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getCurrentUser instead")},enumerable:!1,configurable:!0}),t.prototype.getCurrentUser=function(e){return void 0===e&&(e=!0),c(this,void 0,Promise,(function(){var t,n,r;return u(this,(function(o){switch(o.label){case 0:return o.trys.push([0,4,,5]),e?[4,this.getLoginState()]:[3,3];case 1:return(t=o.sent())?[4,t.user.refresh()]:[3,3];case 2:o.sent(),o.label=3;case 3:return[3,5];case 4:return o.sent(),[3,5];case 5:return[4,this.getLoginState()];case 6:return(n=o.sent())?(r=n.user.getLocalUserInfo(),[4,n.user.checkLocalInfoAsync()]):[3,8];case 7:return o.sent(),[2,i(i({},n.user),r)];case 8:return[2,null]}}))}))},t.prototype.signInAnonymouslyInWx=function(e){var t=(void 0===e?{}:e).useWxCloud;return c(this,void 0,Promise,(function(){var e,n,r=this;return u(this,(function(o){switch(o.label){case 0:if(!h.adapterForWxMp.isMatch())throw Error("wx api undefined");return e=wx.getAccountInfoSync().miniProgram,n=function(n){return c(r,void 0,void 0,(function(){var r,o;return u(this,(function(i){switch(i.label){case 0:r=void 0,o=void 0,i.label=1;case 1:return i.trys.push([1,4,,5]),[4,this.oauthInstance.authApi.grantProviderToken({provider_id:null==e?void 0:e.appId,provider_code:n,provider_params:{provider_code_type:"open_id",appid:null==e?void 0:e.appId}},t)];case 2:if((null==(r=i.sent())?void 0:r.error_code)||!r.provider_token)throw r;return[4,this.oauthInstance.authApi.signInAnonymously({provider_token:r.provider_token},t)];case 3:if(null==(o=i.sent())?void 0:o.error_code)throw o;return[3,5];case 4:throw i.sent();case 5:return[2]}}))}))},[4,new Promise((function(e,t){wx.login({success:function(o){return c(r,void 0,void 0,(function(){var r;return u(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,n(o.code)];case 1:return i.sent(),e(!0),[3,3];case 2:return r=i.sent(),t(r),[3,3];case 3:return[2]}}))}))},fail:function(e){var n=new Error(null==e?void 0:e.errMsg);n.code=null==e?void 0:e.errno,t(n)}})}))];case 1:return o.sent(),[2,this.createLoginState(void 0,{asyncRefreshUser:!0})]}}))}))},t.prototype.bindOpenId=function(){return c(this,void 0,Promise,(function(){var e,t,n=this;return u(this,(function(r){switch(r.label){case 0:if(!h.adapterForWxMp.isMatch())throw Error("wx api undefined");return e=wx.getAccountInfoSync().miniProgram,t=function(t){return c(n,void 0,void 0,(function(){var n;return u(this,(function(r){switch(r.label){case 0:n=void 0,r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this.oauthInstance.authApi.grantProviderToken({provider_id:null==e?void 0:e.appId,provider_code:t,provider_params:{provider_code_type:"open_id",appid:null==e?void 0:e.appId}})];case 2:if((null==(n=r.sent())?void 0:n.error_code)||!n.provider_token)throw n;return[4,this.oauthInstance.authApi.bindWithProvider({provider_token:n.provider_token})];case 3:return r.sent(),[3,5];case 4:throw r.sent();case 5:return[2]}}))}))},[4,new Promise((function(e,r){wx.login({success:function(o){return c(n,void 0,void 0,(function(){var n;return u(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,t(o.code)];case 1:return i.sent(),e(!0),[3,3];case 2:return n=i.sent(),r(n),[3,3];case 3:return[2]}}))}))},fail:function(e){var t=new Error(null==e?void 0:e.errMsg);t.code=null==e?void 0:e.errno,r(t)}})}))];case 1:return r.sent(),[2]}}))}))},t.prototype.signInWithUnionId=function(){return c(this,void 0,Promise,(function(){var e=this;return u(this,(function(t){switch(t.label){case 0:if(!h.adapterForWxMp.isMatch())throw Error("wx api undefined");t.label=1;case 1:return t.trys.push([1,3,,4]),[4,new Promise((function(t,n){var r=wx.getAccountInfoSync().miniProgram;wx.login({success:function(o){return c(e,void 0,void 0,(function(){var e,i,a,s,c;return u(this,(function(u){switch(u.label){case 0:e=null==r?void 0:r.appId,u.label=1;case 1:return u.trys.push([1,4,,5]),[4,this.oauthInstance.authApi.grantProviderToken({provider_code:o.code,provider_id:e,provider_params:{provider_code_type:"union_id",appid:null==r?void 0:r.appId}})];case 2:return i=u.sent(),(a=i.provider_token)?[4,this.oauthInstance.authApi.signInWithProvider({provider_id:e,provider_token:a})]:(n(i),[2]);case 3:return(null==(s=u.sent())?void 0:s.error_code)?(n(s),[2]):(t(!0),[3,5]);case 4:return c=u.sent(),n(c),[3,5];case 5:return[2]}}))}))},fail:function(e){var t=new Error(null==e?void 0:e.errMsg);t.code=null==e?void 0:e.errno,n(t)}})}))];case 2:return t.sent(),[3,4];case 3:throw t.sent();case 4:return[2,this.createLoginState()]}}))}))},t.prototype.signInWithSms=function(e){var t=e.verificationInfo,n=void 0===t?{verification_id:"",is_user:!1}:t,r=e.verificationCode,o=void 0===r?"":r,i=e.phoneNum,a=void 0===i?"":i,s=e.bindInfo,l=void 0===s?void 0:s;return c(this,void 0,Promise,(function(){return u(this,(function(e){try{return[2,this.signInWithUsername({verificationInfo:n,verificationCode:o,bindInfo:l,username:a,loginType:"sms"})]}catch(e){throw e}return[2]}))}))},t.prototype.signInWithEmail=function(e){var t=e.verificationInfo,n=void 0===t?{verification_id:"",is_user:!1}:t,r=e.verificationCode,o=void 0===r?"":r,i=e.bindInfo,a=void 0===i?void 0:i,s=e.email,l=void 0===s?"":s;return c(this,void 0,Promise,(function(){return u(this,(function(e){try{return[2,this.signInWithUsername({verificationInfo:n,verificationCode:o,bindInfo:a,username:l,loginType:"email"})]}catch(e){throw e}return[2]}))}))},t.prototype.setCustomSignFunc=function(e){this.oauthInstance.authApi.setCustomSignFunc(e)},t.prototype.signIn=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.signIn(e)];case 1:return t.sent(),[2,this.createLoginState(e)]}}))}))},t.prototype.setPassword=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.setPassword(e)]}))}))},t.prototype.isUsernameRegistered=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){switch(t.label){case 0:return"string"!=typeof e&&(0,h.throwError)(h.ERRORS.INVALID_PARAMS,"username must be a string"),[4,this.oauthInstance.authApi.checkIfUserExist({username:e})];case 1:return[2,t.sent().exist]}}))}))},t.prototype.hasLoginState=function(){var e;if("async"!==this.cache.mode)return(null===(e=this.oauthInstance)||void 0===e?void 0:e.authApi.hasLoginStateSync())?new y({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance}):null;(0,h.printWarn)(h.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getLoginState instead")},t.prototype.getLoginState=function(){return c(this,void 0,void 0,(function(){var e;return u(this,(function(t){switch(t.label){case 0:e=null,t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.oauthInstance.authApi.getLoginState()];case 2:return e=t.sent(),[3,4];case 3:return t.sent(),[2,null];case 4:return e?[2,new y({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance})]:[2,null]}}))}))},t.prototype.getUserInfo=function(){return c(this,void 0,Promise,(function(){return u(this,(function(e){return[2,this.getCurrentUser()]}))}))},t.prototype.getWedaUserInfo=function(){return c(this,void 0,Promise,(function(){return u(this,(function(e){return[2,this.oauthInstance.authApi.getWedaUserInfo()]}))}))},t.prototype.updateUserBasicInfo=function(e){return c(this,void 0,void 0,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return[4,this.getLoginState()];case 1:return(t=n.sent())?[4,t.user.updateUserBasicInfo(e)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))},t.prototype.getAuthHeader=function(){return console.error("Auth.getAuthHeader API 已废弃"),{}},t.prototype.bindWithProvider=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.bindWithProvider(e)]}))}))},t.prototype.queryUser=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.queryUserProfile(e)]}))}))},t.prototype.getAccessToken=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return[4,this.oauthInstance.oauth2client.getAccessToken()];case 1:return[2,{accessToken:e.sent(),env:this.config.env}]}}))}))},t.prototype.grantProviderToken=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.grantProviderToken(e)]}))}))},t.prototype.patchProviderToken=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.patchProviderToken(e)]}))}))},t.prototype.signInWithProvider=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.signInWithProvider(e)];case 1:return t.sent(),[2,this.createLoginState(e)]}}))}))},t.prototype.signInWithWechat=function(e){return void 0===e&&(e={}),c(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.signInWithWechat(e)];case 1:return t.sent(),[2,this.createLoginState(e)]}}))}))},t.prototype.grantToken=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.grantToken(e)];case 1:return t.sent(),[2,this.createLoginState()]}}))}))},t.prototype.genProviderRedirectUri=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.genProviderRedirectUri(e)]}))}))},t.prototype.resetPassword=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.resetPassword(e)]}))}))},t.prototype.deviceAuthorize=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.deviceAuthorize(e)]}))}))},t.prototype.sudo=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.sudo(e)]}))}))},t.prototype.deleteMe=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.deleteMe(e)]}))}))},t.prototype.getProviders=function(){return c(this,void 0,Promise,(function(){return u(this,(function(e){return[2,this.oauthInstance.authApi.getProviders()]}))}))},t.prototype.loginScope=function(){return c(this,void 0,Promise,(function(){return u(this,(function(e){return[2,this.oauthInstance.authApi.loginScope()]}))}))},t.prototype.loginGroups=function(){return c(this,void 0,Promise,(function(){return u(this,(function(e){return[2,this.oauthInstance.authApi.loginGroups()]}))}))},t.prototype.onLoginStateChanged=function(e){var t;return c(this,void 0,void 0,(function(){var n,r=this;return u(this,(function(o){switch(o.label){case 0:return null===(t=this.config.eventBus)||void 0===t||t.on(p.EVENTS.LOGIN_STATE_CHANGED,(function(t){return c(r,void 0,void 0,(function(){var n,r,o;return u(this,(function(a){switch(a.label){case 0:return(null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.eventType)===p.LOGIN_STATE_CHANGED_TYPE.CREDENTIALS_ERROR?[3,2]:[4,this.getLoginState()];case 1:return r=a.sent(),[3,3];case 2:r={},a.label=3;case 3:return n=r,e.call(this,i(i({},t),n)),[2]}}))}))})),[4,this.getLoginState()];case 1:return n=o.sent(),e.call(this,n),[2]}}))}))},t.prototype.refreshTokenForce=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.refreshTokenForce(e)]}))}))},t.prototype.getCredentials=function(){return c(this,void 0,Promise,(function(){return u(this,(function(e){return[2,this.oauthInstance.authApi.getCredentials()]}))}))},t.prototype.setCredentials=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,this.oauthInstance.oauth2client.setCredentials(e)];case 1:return t.sent(),[2]}}))}))},t.prototype.getProviderSubType=function(){return c(this,void 0,Promise,(function(){return u(this,(function(e){return[2,this.oauthInstance.authApi.getProviderSubType()]}))}))},t.prototype.createCaptchaData=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.createCaptchaData(e)]}))}))},t.prototype.verifyCaptchaData=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.verifyCaptchaData(e)]}))}))},t.prototype.getMiniProgramQrCode=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.getMiniProgramCode(e)]}))}))},t.prototype.getMiniProgramQrCodeStatus=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.getMiniProgramQrCodeStatus(e)]}))}))},t.prototype.modifyPassword=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.modifyPassword(e)]}))}))},t.prototype.modifyPasswordWithoutLogin=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.modifyPasswordWithoutLogin(e)]}))}))},t.prototype.getUserBehaviorLog=function(e){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.oauthInstance.authApi.getUserBehaviorLog(e)]}))}))},t.prototype.signInWithUsername=function(e){var t=e.verificationInfo,n=void 0===t?{verification_id:"",is_user:!1}:t,r=e.verificationCode,o=void 0===r?"":r,a=e.username,s=void 0===a?"":a,l=e.bindInfo,p=void 0===l?void 0:l,d=e.loginType,h=void 0===d?"":d;return c(this,void 0,Promise,(function(){var e,t,r,a,c,l,d;return u(this,(function(u){switch(u.label){case 0:return u.trys.push([0,8,,9]),[4,this.oauthInstance.authApi.verify({verification_id:n.verification_id,verification_code:o})];case 1:if(null==(e=u.sent())?void 0:e.error_code)throw e;return t=e.verification_token,r=this.formatPhone(s),a={phone_number:r},"email"===h&&(a={email:r=s}),n.is_user?[4,this.oauthInstance.authApi.signIn({username:r,verification_token:t})]:[3,5];case 2:if(null==(c=u.sent())?void 0:c.error_code)throw c;return p?[4,this.oauthInstance.authApi.bindWithProvider({provider_token:null==p?void 0:p.providerToken})]:[3,4];case 3:if(null==(l=u.sent())?void 0:l.error_code)throw l;u.label=4;case 4:return[3,7];case 5:return[4,this.oauthInstance.authApi.signUp(i(i({},a),{verification_token:t,provider_token:null==p?void 0:p.providerId}))];case 6:if(null==(d=u.sent())?void 0:d.error_code)throw d;u.label=7;case 7:return[2,this.createLoginState()];case 8:throw u.sent();case 9:return[2]}}))}))},t.prototype.createLoginState=function(e,t){var n,r;return c(this,void 0,Promise,(function(){var o;return u(this,(function(i){switch(i.label){case 0:return[4,(o=new y({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance})).checkLocalStateAsync()];case 1:return i.sent(),(null==t?void 0:t.userInfo)?(o.user.setLocalUserInfo(t.userInfo),[3,5]):[3,2];case 2:return(null==t?void 0:t.asyncRefreshUser)?(o.user.refresh(e),[3,5]):[3,3];case 3:return[4,o.user.refresh(e)];case 4:i.sent(),i.label=5;case 5:return null===(n=this.config.eventBus)||void 0===n||n.fire(p.EVENTS.LOGIN_STATE_CHANGED,{eventType:p.LOGIN_STATE_CHANGED_TYPE.SIGN_IN}),null===(r=this.config.eventBus)||void 0===r||r.fire(p.EVENTS.AUTH_STATE_CHANGED,{event:p.AUTH_STATE_CHANGED_TYPE.SIGNED_IN}),[2,o]}}))}))},t.prototype.setAccessKey=function(){var e,t;return c(this,void 0,void 0,(function(){var n,r;return u(this,(function(o){if(n="",r="",this.config.accessKey?(n=this.config.accessKey,r="accessKey"):(null===(e=this.config.auth)||void 0===e?void 0:e.secretId)&&(null===(t=this.config.auth)||void 0===t?void 0:t.secretKey)&&(n="",r=p.DEFAULT_NODE_ACCESS_SCOPE),!r)return[2];try{this.oauthInstance.oauth2client.setAccessKeyCredentials({access_token:n,token_type:"Bearer",scope:r,expires_at:new Date(+new Date+ +new Date),expires_in:+new Date+ +new Date})}catch(e){console.warn("accessKey error: ",e)}return[2]}))}))},t.prototype.formatPhone=function(e){return!/\s+/.test(e)&&/^\+\d{1,3}\d+/.test(e)?e.replace(/^(\+\d{1,2})(\d+)$/,"$1 $2"):/^\+\d{1,3}\s+/.test(e)?e:"+86 ".concat(e)},t.prototype.notifyListeners=function(e,t,n){this.listeners.forEach((function(r){r.forEach((function(r){try{r(e,t,n)}catch(e){console.error("Error in auth state change callback:",e)}}))}))},t.prototype.setupListeners=function(){var e,t=this;null===(e=this.config.eventBus)||void 0===e||e.on(p.EVENTS.AUTH_STATE_CHANGED,(function(e){return c(t,void 0,void 0,(function(){var t,n,r,o,i;return u(this,(function(a){switch(a.label){case 0:return t=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.event,n=null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.info,[4,this.getSession()];case 1:return r=a.sent().data.session,this.notifyListeners(t,r,n),[2]}}))}))}))},t.prototype.convertToUser=function(e){var t,n,r,o,i,a;if(!e)return null;var s=(null==e?void 0:e.email)||"",c=(null==e?void 0:e.phone_number)||"",u=(null==e?void 0:e.sub)||(null==e?void 0:e.uid)||"";return{id:u,aud:"authenticated",role:null===(n=null===(t=e.groups)||void 0===t?void 0:t.map)||void 0===n?void 0:n.call(t,(function(e){return"string"==typeof e?e:e.id})),email:s||"",email_confirmed_at:(null==e||e.email_verified,e.created_at),phone:c,phone_confirmed_at:c?e.created_at:void 0,confirmed_at:e.created_at,last_sign_in_at:e.last_sign_in_at,app_metadata:{provider:(null===(r=e.loginType)||void 0===r?void 0:r.toLowerCase())||"cloudbase",providers:[(null===(o=e.loginType)||void 0===o?void 0:o.toLowerCase())||"cloudbase"]},user_metadata:{name:null==e?void 0:e.name,picture:null==e?void 0:e.picture,username:null==e?void 0:e.username,gender:null==e?void 0:e.gender,locale:null==e?void 0:e.locale,uid:e.uid,nickName:e.nickName||(null==e?void 0:e.name),avatarUrl:e.avatarUrl||e.picture,location:e.location,hasPassword:null!==(i=e.hasPassword)&&void 0!==i?i:"SET"===e.password,open_id:null==e?void 0:e.open_id},identities:(null===(a=null==e?void 0:e.providers)||void 0===a?void 0:a.map((function(t){return{id:t.id||"",identity_id:t.id||"",user_id:u,identity_data:{provider_id:t.id,provider_user_id:t.provider_user_id,name:t.name},provider:t.id||"cloudbase",created_at:e.created_at,updated_at:e.updated_at,last_sign_in_at:e.last_sign_in_at}})))||[],created_at:e.created_at,updated_at:e.updated_at,is_anonymous:"anonymous"===e.name}},t.prototype.validateParams=function(e,t){for(var n=0,r=Object.entries(t);n<r.length;n++){var o=r[n],i=o[0],a=o[1];if(a.required&&(void 0===(null==e?void 0:e[i])||null===(null==e?void 0:e[i])||""===(null==e?void 0:e[i])))throw new p.AuthError({message:a.message})}},t.prototype.validateAtLeastOne=function(e,t,n){if(!t.some((function(t){return t.some((function(t){return void 0!==(null==e?void 0:e[t])&&null!==(null==e?void 0:e[t])&&""!==(null==e?void 0:e[t])}))})))throw new p.AuthError({message:n})},t.prototype.init=function(){var e;return c(this,void 0,Promise,(function(){return u(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.oauthInstance.oauth2client.localCredentials.getCredentials()];case 1:return t.sent()&&(null===(e=this.config.eventBus)||void 0===e||e.fire(p.EVENTS.AUTH_STATE_CHANGED,{event:p.AUTH_STATE_CHANGED_TYPE.INITIAL_SESSION})),[3,3];case 2:return t.sent(),[3,3];case 3:return[2,{error:null}]}}))}))},a([(0,h.catchErrorsDecorator)({title:"绑定手机号失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindPhoneNumber() 的语法或参数是否正确"," 2 - 当前环境是否开通了短信验证码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",["function"==typeof(n=void 0!==p.authModels&&p.authModels.BindPhoneRequest)?n:Object]),s("design:returntype",Promise)],t.prototype,"bindPhoneNumber",null),a([(0,h.catchErrorsDecorator)({title:"解除三方绑定失败",messages:["请确认以下各项:"," 1 - 调用 auth().unbindProvider() 的语法或参数是否正确"," 2 - 当前账户是否已经与此登录方式解绑","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",["function"==typeof(r=void 0!==p.authModels&&p.authModels.UnbindProviderRequest)?r:Object]),s("design:returntype","function"==typeof(d="undefined"!=typeof Promise&&Promise)?d:Object)],t.prototype,"unbindProvider",null),a([(0,h.catchErrorsDecorator)({title:"绑定邮箱地址失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindEmail() 的语法或参数是否正确"," 2 - 当前环境是否开通了邮箱密码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",["function"==typeof(m=void 0!==p.authModels&&p.authModels.BindEmailRequest)?m:Object]),s("design:returntype",void 0)],t.prototype,"bindEmail",null),a([(0,h.catchErrorsDecorator)({title:"验证码验证失败",messages:["请确认以下各项:"," 1 - 调用 auth().verify() 的语法或参数是否正确"," 2 - 当前环境是否开通了手机验证码/邮箱登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",["function"==typeof(b=void 0!==p.authModels&&p.authModels.VerifyRequest)?b:Object]),s("design:returntype","function"==typeof(_="undefined"!=typeof Promise&&Promise)?_:Object)],t.prototype,"verify",null),a([(0,h.catchErrorsDecorator)({title:"获取验证码失败",messages:["请确认以下各项:"," 1 - 调用 auth().getVerification() 的语法或参数是否正确"," 2 - 当前环境是否开通了手机验证码/邮箱登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",["function"==typeof(x=void 0!==p.authModels&&p.authModels.GetVerificationRequest)?x:Object,Object]),s("design:returntype","function"==typeof(w="undefined"!=typeof Promise&&Promise)?w:Object)],t.prototype,"getVerification",null),a([(0,h.catchErrorsDecorator)({title:"获取用户信息失败",messages:["请确认以下各项:"," 1 - 调用 auth().getCurrentUser() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[Object]),s("design:returntype","function"==typeof(E="undefined"!=typeof Promise&&Promise)?E:Object)],t.prototype,"getCurrentUser",null),a([(0,h.catchErrorsDecorator)({title:"小程序匿名登录失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了匿名登录"," 2 - 调用 auth().signInAnonymouslyInWx() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[Object]),s("design:returntype","function"==typeof(I="undefined"!=typeof Promise&&Promise)?I:Object)],t.prototype,"signInAnonymouslyInWx",null),a([(0,h.catchErrorsDecorator)({title:"小程序绑定OpenID失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序openId静默登录"," 2 - 调用 auth().bindOpenId() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[]),s("design:returntype","function"==typeof(S="undefined"!=typeof Promise&&Promise)?S:Object)],t.prototype,"bindOpenId",null),a([(0,h.catchErrorsDecorator)({title:"小程序unionId静默登录失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序unionId静默登录"," 2 - 调用 auth().signInWithUnionId() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[]),s("design:returntype","function"==typeof(O="undefined"!=typeof Promise&&Promise)?O:Object)],t.prototype,"signInWithUnionId",null),a([(0,h.catchErrorsDecorator)({title:"短信验证码登陆",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序短信验证码登陆"," 2 - 调用 auth().signInWithSms() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[Object]),s("design:returntype","function"==typeof(T="undefined"!=typeof Promise&&Promise)?T:Object)],t.prototype,"signInWithSms",null),a([(0,h.catchErrorsDecorator)({title:"邮箱验证码登陆",messages:["请确认以下各项:"," 1 - 当前环境是否开启了邮箱登陆"," 2 - 调用 auth().signInWithEmail() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[Object]),s("design:returntype","function"==typeof(A="undefined"!=typeof Promise&&Promise)?A:Object)],t.prototype,"signInWithEmail",null),a([(0,h.catchErrorsDecorator)({title:"获取用户是否被占用失败",messages:["请确认以下各项:"," 1 - 调用 auth().isUsernameRegistered() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[String]),s("design:returntype","function"==typeof(P="undefined"!=typeof Promise&&Promise)?P:Object)],t.prototype,"isUsernameRegistered",null),a([(0,h.catchErrorsDecorator)({title:"获取本地登录态失败",messages:["请确认以下各项:"," 1 - 调用 auth().getLoginState() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[]),s("design:returntype",Promise)],t.prototype,"getLoginState",null),a([(0,h.catchErrorsDecorator)({title:"获取用户信息失败",messages:["请确认以下各项:"," 1 - 是否已登录"," 2 - 调用 auth().getUserInfo() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[]),s("design:returntype","function"==typeof(C="undefined"!=typeof Promise&&Promise)?C:Object)],t.prototype,"getUserInfo",null),a([(0,h.catchErrorsDecorator)({title:"获取微搭插件用户信息失败",messages:["请确认以下各项:"," 1 - 是否已登录"," 2 - 调用 auth().getWedaUserInfo() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[]),s("design:returntype","function"==typeof(R="undefined"!=typeof Promise&&Promise)?R:Object)],t.prototype,"getWedaUserInfo",null),a([(0,h.catchErrorsDecorator)({title:"绑定第三方登录方式失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindWithProvider() 的语法或参数是否正确"," 2 - 此账户是否已经绑定此第三方","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",["function"==typeof(N=void 0!==p.authModels&&p.authModels.BindWithProviderRequest)?N:Object]),s("design:returntype","function"==typeof(k="undefined"!=typeof Promise&&Promise)?k:Object)],t.prototype,"bindWithProvider",null),a([(0,h.catchErrorsDecorator)({title:"获取身份源类型",messages:["请确认以下各项:"," 1 - 调用 auth().getProviderSubType() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h.COMMUNITY_SITE_URL)]}),s("design:type",Function),s("design:paramtypes",[]),s("design:returntype","function"==typeof(j="undefined"!=typeof Promise&&Promise)?j:Object)],t.prototype,"getProviderSubType",null),t}(m.AuthV1Compat);function x(e,t){var n,r,o,a,s=this,l=e.region,f=void 0===l?"ap-shanghai":l,m=e.i18n,v=e.accessKey,g=e.useWxCloud,b=(null==t?void 0:t.platform)||h.useDefaultAdapter.bind(t)(),y=b.runtime,x=b.adapter,w=t||{},E=w.env,I=w.clientId,S=w.debug,O=w.cache,T=w.app,A=w.getApiOrigin,P=(t||{}).apiOrigin;P||(P="https://".concat(E,".").concat(f,".tcb-api.tencentcloudapi.com"));var C,R={env:E,clientId:I,i18n:m,accessKey:v,useWxCloud:g,eventBus:new h.CloudbaseEventEmitter},N=new p.CloudbaseOAuth((0,d.useAuthAdapter)(i(i({},R),{apiOrigin:P,getApiOrigin:A,apiPath:(null==e?void 0:e.apiPath)||p.AUTH_API_PREFIX,storage:null==e?void 0:e.storage,baseRequest:null==e?void 0:e.baseRequest,request:null==e?void 0:e.request,anonymousSignInFunc:null==e?void 0:e.anonymousSignInFunc,captchaOptions:null==e?void 0:e.captchaOptions,wxCloud:null==e?void 0:e.wxCloud,adapter:x,onCredentialsError:(C=R.eventBus,function(e){C.fire(p.EVENTS.LOGIN_STATE_CHANGED,i(i({},e),{eventType:p.LOGIN_STATE_CHANGED_TYPE.CREDENTIALS_ERROR}))}),headers:i({"X-SDK-Version":"@cloudbase/js-sdk/".concat(e.sdkVersion)},e.headers||{}),detectSessionInUrl:e.detectSessionInUrl,debug:S,auth:null===(r=null===(n=t.app)||void 0===n?void 0:n.config)||void 0===r?void 0:r.auth}))),k=new _(i(i({},R),{region:f,persistence:e.persistence,debug:S,cache:O||new h.CloudbaseCache({persistence:e.persistence,keys:{userInfoKey:"user_info_".concat(E)},platformInfo:b}),runtime:y||"web",_fromApp:T,oauthInstance:N,auth:null===(a=null===(o=t.app)||void 0===o?void 0:o.config)||void 0===a?void 0:a.auth}));return N.initializeSession((function(e,t){return c(s,void 0,void 0,(function(){return u(this,(function(n){return e?(e.type===p.OAUTH_TYPE.SIGN_IN?t?R.eventBus.fire(p.EVENTS.AUTH_STATE_CHANGED,{event:p.AUTH_STATE_CHANGED_TYPE.SIGNED_IN,info:i(i({},e),{error:t})}):e.user&&k.createLoginState({},{userInfo:e.user}):e.type===p.OAUTH_TYPE.BIND_IDENTITY&&R.eventBus.fire(p.EVENTS.AUTH_STATE_CHANGED,{event:p.AUTH_STATE_CHANGED_TYPE.BIND_IDENTITY,info:i(i({},e),{error:t})}),[2]):[2]}))}))})),{authInstance:k,oauthInstance:N}}t.Auth=_,t.generateAuthInstance=x;var w="auth";function E(e,t){for(var n=[],r=0;r<=e.length;r++)n[r]=[r];for(var o=0;o<=t.length;o++)n[0][o]=o;for(r=1;r<=e.length;r++)for(o=1;o<=t.length;o++){var i=e[r-1].toLowerCase()===t[o-1].toLowerCase()?0:1;n[r][o]=Math.min(n[r-1][o]+1,n[r][o-1]+1,n[r-1][o-1]+i)}return n[e.length][t.length]}var I={name:"auth",namespace:w,entity:function(e){var t=function(e){var t,n=this;if(this.authInstance&&!e)return this.authInstance;e=e||{region:"",persistence:"local",apiPath:p.AUTH_API_PREFIX};var r=this.platform.adapter,o=e.persistence||r.primaryStorage;o&&o!==this.config.persistence&&this.updateConfig({persistence:o});var a=x(i(i({wxCloud:this.config.wxCloud,storage:this.config.storage},e),{persistence:this.config.persistence,i18n:this.config.i18n,accessKey:this.config.accessKey,useWxCloud:this.config.useWxCloud,sdkVersion:this.version,detectSessionInUrl:null===(t=this.config.auth)||void 0===t?void 0:t.detectSessionInUrl}),{env:this.config.env,clientId:this.config.clientId,getApiOrigin:function(){return n.request.getBaseEndPoint(n.config.endPointMode||"CLOUD_API")},platform:this.platform,cache:this.cache,app:this,debug:this.config.debug}),s=a.authInstance,c=a.oauthInstance;return this.oauthInstance=c,this.authInstance=s,this.authInstance},n=t.call(this,e);Object.assign(t,n),Object.setPrototypeOf(t,Object.getPrototypeOf(n));var r="undefined"!=typeof Proxy?new Proxy(t,{get:function(e,t,n){var r=Reflect.get(e,t,n);if(void 0!==r||"string"!=typeof t)return r;var o=function(e,t){for(var n=null,r=1/0,o=0,i=t;o<i.length;o++){var a=i[o];if(!a.startsWith("_")&&"constructor"!==a){var s=E(e,a);s<r&&(r=s,n=a)}}return n}(t,Object.getOwnPropertyNames(Object.getPrototypeOf(e)).concat(Object.keys(e)).filter((function(t){return"function"==typeof e[t]})));return o&&console.warn("[CloudBase Auth] auth.".concat(t," is not a function. Did you mean: auth.").concat(o,"() ?")),r}}):t;return this[w]=r,r}};try{cloudbase.registerComponent(I)}catch(e){}var S=n(6722);Object.defineProperty(t,"AuthErrorCategory",{enumerable:!0,get:function(){return S.AuthErrorCategory}}),Object.defineProperty(t,"AuthErrorCode",{enumerable:!0,get:function(){return S.AuthErrorCode}}),Object.defineProperty(t,"AuthError",{enumerable:!0,get:function(){return S.AuthError}}),t.registerAuth=function(e){try{e.registerComponent(I)}catch(e){console.warn(e)}}},1019:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useDefaultAdapter=t.adapterForWxMp=t.CloudbaseCache=t.CloudbaseEventEmitter=t.catchErrorsDecorator=t.COMMUNITY_SITE_URL=t.ERRORS=t.throwError=t.printWarn=void 0;var o=n(3616);Object.defineProperty(t,"printWarn",{enumerable:!0,get:function(){return o.printWarn}}),Object.defineProperty(t,"throwError",{enumerable:!0,get:function(){return o.throwError}});var i=n(794);Object.defineProperty(t,"ERRORS",{enumerable:!0,get:function(){return i.ERRORS}}),Object.defineProperty(t,"COMMUNITY_SITE_URL",{enumerable:!0,get:function(){return i.COMMUNITY_SITE_URL}});var a=n(141);Object.defineProperty(t,"catchErrorsDecorator",{enumerable:!0,get:function(){return a.catchErrorsDecorator}});var s=n(9689);Object.defineProperty(t,"CloudbaseEventEmitter",{enumerable:!0,get:function(){return s.CloudbaseEventEmitter}});var c=n(6197);Object.defineProperty(t,"CloudbaseCache",{enumerable:!0,get:function(){return c.CloudbaseCache}});var u=n(7917);Object.defineProperty(t,"adapterForWxMp",{enumerable:!0,get:function(){return r(u).default}});var l=n(8182);Object.defineProperty(t,"useDefaultAdapter",{enumerable:!0,get:function(){return l.useDefaultAdapter}})},5266:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeUrlParams=t.addUrlSearch=t.removeBrowserSession=t.getBrowserSession=t.saveToBrowserSession=void 0,t.saveToBrowserSession=function(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){console.error("Failed to save to browser session:",e)}},t.getBrowserSession=function(e){try{return JSON.parse(sessionStorage.getItem(e))}catch(e){return console.error("Failed to get browser session:",e),null}},t.removeBrowserSession=function(e){try{return sessionStorage.removeItem(e),!0}catch(e){return console.error("Failed to remove browser session:",e),null}},t.addUrlSearch=function(e,t){if(void 0!==e){var n=new URL(window.location.href);return n.search=e,n.hash=t||n.hash,window.history.replaceState({},"",n.href),n.href}},t.removeUrlParams=function(e){if("undefined"!=typeof window)try{var t=new URL(window.location.href);e.forEach((function(e){t.searchParams.delete(e)})),window.history.replaceState({},"",t.href)}catch(e){console.error("Failed to remove URL params:",e)}}},916:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.applyUserV1Compat=t.AuthV1Compat=t.AnonymousAuthProvider=t.CustomAuthProvider=t.WeixinAuthProvider=void 0;var a=n(6722),s=n(1019),c=function(){function e(e){}return e.prototype.signInWithRedirect=function(){throw new Error("[v1 兼容] WeixinAuthProvider.signInWithRedirect() 在当前版本中无法实现。 建议使用 auth.signInWithOAuth({ provider: 'providerId' }) 替代。")},e.prototype.getRedirectResult=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(e){throw new Error("[v1 兼容] WeixinAuthProvider.getRedirectResult() 在当前版本中无法实现。 建议使用 auth.verifyOAuth({ code, state, provider }) 替代。")}))}))},e.prototype.getLinkRedirectResult=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(e){throw new Error("[v1 兼容] WeixinAuthProvider.getLinkRedirectResult() 在当前版本中无法实现。 建议使用 auth.linkIdentity({ provider: 'providerId' }) 替代。")}))}))},e}();t.WeixinAuthProvider=c;var u=function(){function e(e){this.authInstance=e.authInstance}return e.prototype.signIn=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.authInstance.signInWithCustomTicket((function(){return Promise.resolve(e)}))];case 1:return t.sent(),[2]}}))}))},e}();t.CustomAuthProvider=u;var l=function(){function e(e){this.authInstance=e.authInstance}return e.prototype.signIn=function(){return o(this,void 0,Promise,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.authInstance.signInAnonymously({})];case 1:return e.sent(),[2]}}))}))},e}();t.AnonymousAuthProvider=l;var p=function(){function e(){}return e.prototype.weixinAuthProvider=function(e){return new c({authInstance:this,appid:e.appid,scope:e.scope})},e.prototype.customAuthProvider=function(){return new u({authInstance:this})},e.prototype.anonymousAuthProvider=function(){return new l({authInstance:this})},e.prototype.signUpWithEmailAndPassword=function(e,t){return o(this,void 0,Promise,(function(){return i(this,(function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"email must be a string"),"string"!=typeof t&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"password must be a string"),[4,this.signUp({email:e,password:t})];case 1:return[2,n.sent()]}}))}))},e.prototype.signInWithEmailAndPassword=function(e,t){return o(this,void 0,Promise,(function(){return i(this,(function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"email must be a string"),"string"!=typeof t&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"password must be a string"),[4,this.signIn({username:e,password:t})];case 1:return n.sent(),[2,this.createLoginState()]}}))}))},e.prototype.sendPasswordResetEmail=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){switch(t.label){case 0:return"string"!=typeof e&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"email must be a string"),[4,this.getVerification({email:e})];case 1:return t.sent(),[2]}}))}))},e.prototype.signInWithUsernameAndPassword=function(e,t){return o(this,void 0,Promise,(function(){return i(this,(function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"username must be a string"),"string"!=typeof t&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"password must be a string"),[4,this.signIn({username:e,password:t})];case 1:return n.sent(),[2,this.createLoginState()]}}))}))},e.prototype.sendPhoneCode=function(e){return o(this,void 0,Promise,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"phoneNumber must be a string"),t=this.formatPhone(e),[4,this.getVerification({phone_number:t})];case 1:return n.sent(),[2,!0]}}))}))},e.prototype.signUpWithPhoneCode=function(e,t,n){return o(this,void 0,Promise,(function(){var o;return i(this,(function(i){switch(i.label){case 0:return"string"!=typeof e&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"phoneNumber must be a string"),"string"!=typeof t&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"phoneCode must be a string"),o=this.formatPhone(e),[4,this.signUp(r({phone_number:o,verification_code:t},n?{password:n}:{}))];case 1:return i.sent(),[2,this.createLoginState()]}}))}))},e.prototype.signInWithPhoneCodeOrPassword=function(e){return o(this,void 0,Promise,(function(){var t,n,r,o;return i(this,(function(i){switch(i.label){case 0:return t=e.phoneNumber,n=e.phoneCode,r=e.password,"string"!=typeof t&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"phoneNumber must be a string"),o=this.formatPhone(t),r?[4,this.signIn({username:o,password:r})]:[3,2];case 1:return i.sent(),[3,5];case 2:return n?[4,this.signIn({username:o,verification_token:n})]:[3,4];case 3:return i.sent(),[3,5];case 4:(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"phoneCode or password must be provided"),i.label=5;case 5:return[2,this.createLoginState()]}}))}))},e.prototype.forceResetPwdByPhoneCode=function(e){return o(this,void 0,Promise,(function(){var t,n,r,o;return i(this,(function(i){switch(i.label){case 0:return t=e.phoneNumber,n=e.phoneCode,r=e.password,"string"!=typeof t&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"phoneNumber must be a string"),"string"!=typeof n&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"phoneCode must be a string"),"string"!=typeof r&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"password must be a string"),o=this.formatPhone(t),[4,this.resetPassword({phone_number:o,new_password:r,verification_token:n})];case 1:return i.sent(),[4,this.signIn({username:o,password:r})];case 2:return i.sent(),[2,this.createLoginState()]}}))}))},e.prototype.shouldRefreshAccessToken=function(e){throw new Error("[v1 兼容] shouldRefreshAccessToken() 在当前版本中无法实现。 建议使用 auth.onAuthStateChange(callback) 来监听 TOKEN_REFRESHED 事件替代。")},e.prototype.onLoginStateExpired=function(e){var t=this;this.onLoginStateChanged((function(n){(null==n?void 0:n.eventType)===a.LOGIN_STATE_CHANGED_TYPE.CREDENTIALS_ERROR&&e.call(t)}))},e.prototype.onAccessTokenRefreshed=function(e){var t=this;this.onAuthStateChange((function(n){n===a.AUTH_STATE_CHANGED_TYPE.TOKEN_REFRESHED&&e.call(t)}))},e.prototype.onAnonymousConverted=function(e){var t=this;this.onAuthStateChange((function(n){n===a.AUTH_STATE_CHANGED_TYPE.SIGNED_IN&&e.call(t)}))},e.prototype.onLoginTypeChanged=function(e){var t=this;this.onAuthStateChange((function(n){n!==a.AUTH_STATE_CHANGED_TYPE.SIGNED_IN&&n!==a.AUTH_STATE_CHANGED_TYPE.SIGNED_OUT||e.call(t)}))},e}();t.AuthV1Compat=p,t.applyUserV1Compat=function(e){e.prototype.linkWithTicket=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(e){throw new Error("[v1 兼容] User.linkWithTicket() 在当前版本中无法实现。 建议使用 auth.signInWithCustomTicket(() => Promise.resolve(ticket)) 替代。")}))}))},e.prototype.linkWithRedirect=function(e){throw new Error("[v1 兼容] User.linkWithRedirect() 在当前版本中无法实现。 建议使用 auth.linkIdentity({ provider: 'providerId' }) 替代。")},e.prototype.updateEmail=function(e,t){return o(this,void 0,Promise,(function(){return i(this,(function(t){switch(t.label){case 0:return"string"!=typeof e&&(0,s.throwError)(s.ERRORS.INVALID_PARAMS,"newEmail must be a string"),[4,this.updateUserBasicInfo({email:e})];case 1:return t.sent(),[2]}}))}))},e.prototype.linkWithPhoneNumber=function(e,t){return o(this,void 0,Promise,(function(){return i(this,(function(e){throw new Error("[v1 兼容] User.linkWithPhoneNumber() 在当前版本中无法实现。 建议使用 auth.bindPhoneNumber({ phone_number, verification_token, sudo_token }) 替代。")}))}))},e.prototype.updatePhoneNumber=function(e,t){return o(this,void 0,Promise,(function(){return i(this,(function(e){throw new Error("[v1 兼容] User.updatePhoneNumber() 在当前版本中无法实现。 建议使用 auth.updateUser({ phone: newPhoneNumber }) 替代。")}))}))},e.prototype.unlink=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(e){throw new Error("[v1 兼容] User.unlink() 在当前版本中无法实现。 建议使用 auth.unlinkIdentity({ provider: loginType }) 替代。")}))}))}}},3198:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.registerDatabase=void 0;var c=n(543),u=n(2701),l={filterRes:function(e){return delete e.header,delete e.statusCode,e},flattenResData:function(e){if("object"==typeof e.data&&null!==e.data){var t=i(i({},e),e.data);return delete t.data,t}return e},safeParseEJSON:function(e){if("string"!=typeof e)return e;try{return u.EJSON.parse(e)}catch(t){return e}},buildQueryParams:function(e){return Object.entries(e).filter((function(e){e[0];var t=e[1];return null!=t&&""!==t})).map((function(e){var t=e[0],n=e[1],r="object"==typeof n?JSON.stringify(n):String(n);return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(r))})).join("&")},getUrlPrefix:function(e){var t=(null==e?void 0:e.instance)||"(default)",n=(null==e?void 0:e.database)||"(default)";return"/database/instances/".concat(t,"/databases/").concat(n)},"database.queryDocument":function(e){var t,n,r,o,c,p,d,h;return a(this,void 0,Promise,(function(){var a,f,m,v;return s(this,(function(s){switch(s.label){case 0:return a=!!(null===(n=null===(t=e.query)||void 0===t?void 0:t._id)||void 0===n?void 0:n.$eq),f=l.buildQueryParams(i({projection:e.projection,transactionId:e.transactionId},a?{}:{offset:null!==(r=e.offset)&&void 0!==r?r:0,limit:null!==(o=e.limit)&&void 0!==o?o:100,order:e.order,query:e.query?u.EJSON.stringify(e.query,{relaxed:!1}):void 0})),m="".concat(l.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents?").concat(f),a&&(m="".concat(l.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents/").concat((null===(c=e.query._id)||void 0===c?void 0:c.$eq)||e.query._id,"?").concat(f)),[4,this.gateWay({url:m,method:"GET"})];case 1:return(v=s.sent()).data=l.safeParseEJSON(JSON.stringify(v.data)),!a||v.code||(null===(p=v.data)||void 0===p?void 0:p.code)?(v.code||(null===(d=v.data)||void 0===d?void 0:d.code)?v=i(i({},v),{code:v.code||(null===(h=v.data)||void 0===h?void 0:h.code),data:i(i({},v.data),{list:[]})}):Array.isArray(v.data)?v=i(i({},v),{data:{list:v.data}}):v.data&&!Array.isArray(v.data.list)&&(v=i(i({},v),{data:i(i({},v.data),{list:[]})})),[2,l.filterRes(v)]):[2,i(i({},v),{data:{list:[v.data]}})]}}))}))},"database.addDocument":function(e){var t,n,r;return a(this,void 0,Promise,(function(){var o;return s(this,(function(a){switch(a.label){case 0:return[4,this.gateWay({url:"".concat(l.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents"),method:"POST",data:i({data:Array.isArray(e.data)?e.data:[e.data]},e.transactionId&&{transactionId:e.transactionId})})];case 1:return o=a.sent(),Array.isArray(e.data)?o=i(i({},o),{data:i({ids:(null===(t=o.data)||void 0===t?void 0:t.insertedIds)||[]},o.data)}):(null===(r=null===(n=o.data)||void 0===n?void 0:n.insertedIds)||void 0===r?void 0:r[0])&&(o=i(i({},o),{data:i({_id:o.data.insertedIds[0]},o.data)})),[2,l.filterRes(o)]}}))}))},"database.updateDocument":function(e){return a(this,void 0,Promise,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(l.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents"),method:"PATCH",data:i({query:e.query,data:e.data,multi:!!e.multi,upsert:!!e.upsert,replaceMode:!!e.replaceMode},e.transactionId&&{transactionId:e.transactionId})})];case 1:return t=n.sent(),[2,l.filterRes(t)]}}))}))},"database.deleteDocument":function(e){return a(this,void 0,Promise,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(l.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents/remove"),method:"POST",data:i({query:e.query,multi:!!e.multi},e.transactionId&&{transactionId:e.transactionId})})];case 1:return t=n.sent(),[2,l.filterRes(t)]}}))}))},"database.countDocument":function(e){return a(this,void 0,Promise,(function(){var t,n;return s(this,(function(r){switch(r.label){case 0:return t=l.buildQueryParams({count:!0,query:e.query?u.EJSON.stringify(e.query,{relaxed:!1}):void 0}),[4,this.gateWay({url:"".concat(l.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents?").concat(t),method:"GET"})];case 1:return n=r.sent(),[2,l.filterRes(n)]}}))}))},"database.addCollection":function(e){return a(this,void 0,Promise,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(l.getUrlPrefix(e),"/collections"),method:"POST",data:{collectionName:e.collectionName}})];case 1:return t=n.sent(),[2,l.filterRes(t)]}}))}))},"database.aggregate":function(e){var t;return a(this,void 0,Promise,(function(){var n,r;return s(this,(function(o){switch(o.label){case 0:return n=e.stages.map((function(e){var t,n;try{var r="string"==typeof e.stageValue?JSON.parse(e.stageValue):e.stageValue;return(t={})[e.stageKey]=u.EJSON.serialize(r),t}catch(t){return(n={})[e.stageKey]=e.stageValue,n}})),[4,this.gateWay({url:"".concat(l.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents/aggregations"),method:"POST",data:{pipeline:n}})];case 1:return r=o.sent(),Array.isArray(null===(t=r.data)||void 0===t?void 0:t.list)&&(r.data.list=JSON.stringify(r.data.list.map((function(e){return JSON.stringify(e)})))),[2,l.filterRes(r)]}}))}))},"database.startTransaction":function(e){return a(this,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(l.getUrlPrefix(e),"/transactions"),method:"POST"})];case 1:return t=n.sent(),[2,l.filterRes(l.flattenResData(t))]}}))}))},"database.commitTransaction":function(e){return a(this,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(l.getUrlPrefix(e),"/transactions/").concat(e.transactionId,"/commit"),method:"POST"})];case 1:return t=n.sent(),[2,l.filterRes(t)]}}))}))},"database.abortTransaction":function(e){return a(this,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(l.getUrlPrefix(e),"/transactions/").concat(e.transactionId,"/rollback"),method:"POST"})];case 1:return t=n.sent(),[2,l.filterRes(t)]}}))}))},"database.getInTransaction":function(e){var t;return a(this,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return[4,l["database.queryDocument"].call(this,e)];case 1:return"object"==typeof(n=r.sent()).data&&null!==n.data?(null===(t=n.data)||void 0===t?void 0:t.code)?[2,l.flattenResData(n)]:[2,i(i({},n),{data:JSON.stringify(n.data)})]:[2,n]}}))}))},"database.updateDocInTransaction":function(e){return a(this,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return e.data=l.safeParseEJSON(e.data),[4,l["database.updateDocument"].call(this,e)];case 1:return t=n.sent(),[2,l.flattenResData(t)]}}))}))},"database.deleteDocInTransaction":function(e){return a(this,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,l["database.deleteDocument"].call(this,e)];case 1:return t=n.sent(),[2,l.flattenResData(t)]}}))}))},"database.insertDocInTransaction":function(e){var t;return a(this,void 0,Promise,(function(){var n,r;return s(this,(function(o){switch(o.label){case 0:return e.data=l.safeParseEJSON(e.data),[4,l["database.addDocument"].call(this,e)];case 1:return"object"==typeof(n=o.sent()).data&&null!==n.data?(r=!!(null===(t=n.data)||void 0===t?void 0:t._id),n=i(i(i({},n),{inserted:r?1:0,ok:r?1:0}),n.data)):n=i({inserted:0,ok:0},n),delete n.data,[2,n]}}))}))},"database.runCommands":function(e){return a(this,void 0,Promise,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(l.getUrlPrefix(e),"/commands"),method:"POST",data:i({commands:u.EJSON.serialize(e.commands)},e.transactionId&&{transactionId:e.transactionId})})];case 1:"object"==typeof(t=n.sent()).data&&null!==t.data&&(delete(t=i(i({},t),t.data)).data,delete t.request_id);try{t=u.EJSON.deserialize(t)}catch(e){}return[2,l.filterRes(t)]}}))}))}},p={name:"database",entity:{database:function(e){var t=this.platform,n=t.adapter,r=t.runtime,u=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype.send=function(t,n){return a(this,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:return r=null,"GATEWAY"===this.config.endPointMode&&l[t]?[4,l[t].call(this,n)]:[3,2];case 1:return r=o.sent(),[3,4];case 2:return[4,e.prototype.send.call(this,t,n)];case 3:r=o.sent(),o.label=4;case 4:return[2,r]}}))}))},t}(this.request.constructor);return c.Db.reqClass=u,c.Db.getAccessToken=this.authInstance?this.authInstance.getAccessToken.bind(this.authInstance):function(){return""},c.Db.runtime=r,this.wsClientClass&&(c.Db.wsClass=n.wsClass,c.Db.wsClientClass=this.wsClientClass),c.Db.ws||(c.Db.ws=null),new(function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype.runCommands=function(e){return a(this,void 0,Promise,(function(){return s(this,(function(t){return[2,c.Db.createRequest(this.config).send("database.runCommands",e)]}))}))},t}(c.Db))(i(i(i({},this.config),{_fromApp:this}),e))}}};try{cloudbase.registerComponent(p)}catch(e){}function d(e){try{e.registerComponent(p)}catch(e){console.warn(e)}}t.registerDatabase=d;try{window.registerDatabase=d}catch(e){}},4144:function(e,t,n){"use strict";var r=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(n(6950)),o=n(9895),i=n(1060),a=n(3456),s=n(7209),c=n(3645),u=n(5337),l=n(9253),p=n(9126),d=n(1944),h=n(3198);r.default.registerVersion("3.5.4");try{var f=n(7922).getSdkVersion,m=n(2293);r.default.useAdapters(m.default);var v=r.default;v.version=f(),v.SYMBOL_CURRENT_ENV=m.SYMBOL_CURRENT_ENV,v.SYMBOL_DEFAULT_ENV=m.SYMBOL_DEFAULT_ENV,v.parseContext=m.parseContext,v.getCloudbaseContext=m.getCloudbaseContext}catch(e){}try{(0,o.registerAuth)(r.default),(0,i.registerFunctions)(r.default),(0,a.registerStorage)(r.default),(0,h.registerDatabase)(r.default),(0,s.registerRealtime)(r.default),(0,c.registerModel)(r.default),(0,u.registerAi)(r.default),(0,l.registerCloudrun)(r.default),(0,p.registerMySQL)(r.default),(0,d.registerApis)(r.default)}catch(e){}try{window.cloudbase=r.default}catch(e){}t.default=r.default,e.exports=r.default},9253:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.registerCloudrun=t.requestContainer=void 0;var a=n(2877).constants.ERRORS,s="cloudrun",c=function(){function e(){}return e.prototype.callContainer=function(e,t){return o(this,void 0,void 0,(function(){var n,o,c;return i(this,(function(i){switch(i.label){case 0:if(n=e.name,o=e.data,!n)throw new Error(JSON.stringify({code:a.INVALID_PARAMS,msg:"[".concat(s,".callContainer] invalid name")}));try{c=o?JSON.stringify(o):""}catch(e){throw new Error(JSON.stringify({code:a.INVALID_PARAMS,msg:"[".concat(s,".callContainer] invalid data")}))}return[4,u.call(this,r(r({},e),{data:c}),t)];case 1:return[2,i.sent()]}}))}))},e}();function u(e,t){var n;return o(this,void 0,void 0,(function(){var o,a,s,c,u,l,p,d,h,f,m,v,g,b,y;return i(this,(function(i){switch(i.label){case 0:if(o=e.name,a=e.data,s=e.path,c=void 0===s?"":s,u=e.method,l=e.header,p=void 0===l?{}:l,d=this.getEndPointWithKey("GATEWAY"),h=d.BASE_URL,f=d.PROTOCOL,m="".concat(f).concat(h,"/cloudrun/").concat(o),v=c.startsWith("/")?c:"/".concat(c),g=["GET","HEAD"].includes(null===(n=null==u?void 0:u.toUpperCase)||void 0===n?void 0:n.call(u)))try{b={};try{b=JSON.parse(a)}catch(e){b=a||{}}v="".concat(v).concat(v.includes("?")?"&":"?").concat(Object.keys(b).map((function(e){return"".concat(e,"=").concat(b[e])})).join("&"))}catch(e){}return[4,this.request.fetch(r(r({method:u||"POST",headers:Object.assign({},{"Content-Type":"application/json; charset=utf-8"},p)},g?{}:{body:a}),{url:"".concat(m).concat(v),customReqOpts:t}))];case 1:return y=i.sent(),"node-sdk"===(null==t?void 0:t.from)?[2,y]:[4,y.data];case 2:return[2,i.sent()]}}))}))}t.requestContainer=u;var l=new c,p={name:s,entity:{callContainer:l.callContainer}};try{cloudbase.registerComponent(p)}catch(e){}function d(e){try{e.registerComponent(p)}catch(e){console.warn(e)}}t.registerCloudrun=d;try{window.registerCloudrun=d}catch(e){}},1060:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.registerFunctions=void 0;var c=n(3388),u=n(2877),l=n(9253),p=u.constants.getSdkName,d=u.constants.ERRORS,h=u.constants.COMMUNITY_SITE_URL,f=u.utils.execCallback,m=u.helpers.catchErrorsDecorator,v="functions",g=new(function(){function e(){}var t,n,g;return e.prototype.callFunction=function(e,t,n){var o,i,c;return a(this,void 0,void 0,(function(){var a,h,m,g,b,y,_,x,w,E,I,S,O,T,A,P,C,R,N,k,j,U,D;return s(this,(function(s){switch(s.label){case 0:if(a=e.name,h=e.data,m=e.query,g=e.parse,b=e.search,y=e.type,_=e.path,x=void 0===_?"":_,w=e.method,E=e.header,I=void 0===E?{}:E,!a)throw new Error(JSON.stringify({code:d.INVALID_PARAMS,msg:"[".concat(v,".callFunction] invalid function name")}));try{S=h?JSON.stringify(h):""}catch(e){throw new Error(JSON.stringify({code:d.INVALID_PARAMS,msg:"[".concat(v,".callFunction] invalid data")}))}return"cloudrun"!==y?[3,2]:(O=u.utils.generateRequestId(),[4,l.requestContainer.call(this,{name:a,data:S,path:x,method:w,header:r(r({},I),{"X-Request-Id":O})})]);case 1:return[2,{result:U=s.sent(),requestId:O}];case 2:A=(T=this).request,P=T.config,C="functions.invokeFunction",R={inQuery:m,parse:g,search:b,function_name:a,request_data:S},N={},k=!("GATEWAY"!==P.endPointMode||(L=a,"lcap-common-service"===L||"lcap-datasource-test"===L||L.startsWith("lcap-data")||L.startsWith("lowcode-datasource")||"cloudbase_module"===L)||function(e){return"lowcode-wx-datasource"===e}(a)),s.label=3;case 3:return s.trys.push([3,8,,9]),k?[4,A.gateWay(r(r({},e),{path:"functions"}),n)]:[3,5];case 4:return j=s.sent(),N=r({requestId:j.requestId},(null===(o=j.data)||void 0===o?void 0:o.code)?j.data:{data:{response_data:j.data}}),[3,7];case 5:return[4,A.send(C,R,{endPointMode:"CLOUD_API",defaultQuery:(null===(i=null==h?void 0:h.params)||void 0===i?void 0:i.action)?{action:null===(c=null==h?void 0:h.params)||void 0===c?void 0:c.action}:{}},n)];case 6:N=s.sent(),s.label=7;case 7:if(N.code)return[2,f(t,null,N)];if(U=N.data.response_data,g||k)return[2,f(t,null,{result:U,requestId:N.requestId})];try{return U=JSON.parse(N.data.response_data),[2,f(t,null,{result:U,requestId:N.requestId})]}catch(e){f(t,new Error("[".concat(p(),"][").concat(d.INVALID_PARAMS,"][").concat(v,".callFunction] response data must be json")))}return[3,9];case 8:return D=s.sent(),f(t,D),[3,9];case 9:return[2]}var L}))}))},o([m({customInfo:{className:"Cloudbase",methodName:"callFunction"},title:"函数调用失败",messages:["请确认以下各项:"," 1 - 调用 callFunction() 的语法或参数是否正确"," 2 - 当前环境下是否存在此函数"," 3 - 函数安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(h)]}),i("design:type",Function),i("design:paramtypes",["function"==typeof(t=void 0!==c.ICallFunctionOptions&&c.ICallFunctionOptions)?t:Object,"function"==typeof(n="undefined"!=typeof Function&&Function)?n:Object,"function"==typeof(g=void 0!==c.ICustomReqOpts&&c.ICustomReqOpts)?g:Object]),i("design:returntype",Promise)],e.prototype,"callFunction",null),e}()),b={name:v,entity:{callFunction:g.callFunction}};try{cloudbase.registerComponent(b)}catch(e){}t.registerFunctions=function(e){try{e.registerComponent(b)}catch(e){console.warn(e)}}},3645:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.registerModel=t.lazyGetEntity=void 0;var c=n(8630),u=n(2877).events.CloudbaseEventEmitter,l="models",p=new WeakMap;function d(e){return new Proxy({},{get:function(t,n){var o=e.getEndPointWithKey("GATEWAY"),i=o.BASE_URL,u=o.PROTOCOL,l=r(r({},e),{BASE_URL:i,PROTOCOL:u}),d=p.get(l);return d||(d=function(e){var t=this,n=e.callFunction.bind(e),o=e.request.fetch.bind(e.request),i=e.getEndPointWithKey("GATEWAY"),u=i.BASE_URL,l=i.PROTOCOL,p="".concat(l).concat(u,"/model"),d="".concat(l).concat(u,"/sql"),h=(0,c.generateHTTPClient)(n,(function(e){return a(t,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,o(r(r({},e),{headers:r({"Content-Type":"application/json"},e.headers)}))];case 1:return[4,t.sent().data];case 2:return[2,t.sent()]}}))}))}),p,{sqlBaseUrl:d});return h}(e),p.set(l,d)),d[n]}})}t.lazyGetEntity=d;var h="cloudbase_init",f=new u;f.on(h,(function(e){var t=e.data;Object.assign(t,{models:d(t)})}));var m={name:l,namespace:l,entity:new Proxy({},{get:function(e,t){console.warn("【deprecated】Accessing Cloudbase.prototype.models.".concat(t,"."))}}),injectEvents:{bus:f,events:[h]}};try{cloudbase.registerComponent(m)}catch(e){}function v(e){try{e.registerComponent(m)}catch(e){console.warn(e)}}t.registerModel=v;try{window.registerModel=v}catch(e){}i(n(8630),t)},9126:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.registerMySQL=void 0;var c=n(8630);function u(e,t,n){var o=this,i=e.request.fetch.bind(e.request),u=t||{},l=u.instance,p=void 0===l?n?void 0:"default":l,d=u.database,h=void 0===d?n?void 0:e.config.env:d,f=e.getEndPointWithKey("GATEWAY"),m=f.BASE_URL,v=f.PROTOCOL,g="".concat(v).concat(m),b=function(t,n){return a(o,void 0,void 0,(function(){var o,a,c,u,l,d,f,m,v;return s(this,(function(s){switch(s.label){case 0:return o={},n.headers instanceof Headers?n.headers.forEach((function(e,t){o[t]=e})):o=n.headers||{},[["X-Db-Instance",p],["Accept-Profile",h],["Content-Profile",h]].forEach((function(e){var t=e[0],n=e[1];o[t]||o[t.toLocaleLowerCase()]||!n||(o[t]=n)})),a=t.toString(),c=e.getEndPointWithKey("GATEWAY"),u=c.BASE_URL,l=c.PROTOCOL,(d="".concat(l).concat(u))!==g&&a.startsWith(g)&&(a=a.replace(g,d)),[4,i(r(r({url:a},n),{headers:r({"Content-Type":"application/json"},o),shouldThrowOnError:!1}))];case 1:f=s.sent(),m={},s.label=2;case 2:return s.trys.push([2,4,,5]),[4,f.data];case 3:return m=s.sent(),[3,5];case 4:if(!(v=s.sent()).message.includes("Unexpected end of JSON input"))throw v;return[3,5];case 5:return[2,{ok:(null==f?void 0:f.statusCode)>=200&&(null==f?void 0:f.statusCode)<300,status:(null==f?void 0:f.statusCode)||200,statusText:(null==f?void 0:f.statusMessage)||"OK",json:function(){return Promise.resolve(m||{})},text:function(){return Promise.resolve("string"==typeof m?m:JSON.stringify(m||{}))},headers:null==f?void 0:f.header}]}}))}))},y="".concat(v).concat(m,"/rdb/rest");return n?(0,c.generatePGClient)(e,{pgBaseUrl:y,fetch:b}):(0,c.generateMySQLClient)(e,{mysqlBaseUrl:y,fetch:b})}var l={name:"mysql",entity:{mysql:function(e){return u(this,e,!1)(e)}}},p={name:"rdb",entity:{rdb:function(e){return u(this,e,!0)(e)}}};try{cloudbase.registerComponent(l),cloudbase.registerComponent(p)}catch(e){}function d(e){try{e.registerComponent(l),e.registerComponent(p)}catch(e){console.warn(e)}}t.registerMySQL=d;try{window.registerMySQL=d}catch(e){}i(n(8630),t)},5413:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},a=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Auth=void 0;var c=n(4949),u=n(5257),l=n(2962),p=n(2631),d=s(n(9639)),h=n(8308);function f(e,t){var r;return o(this,void 0,void 0,(function(){var a,s=this;return i(this,(function(c){a=function(){return o(s,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return e.trys.push([0,1,,6]),[2,n(5814)];case 1:e.sent(),e.label=2;case 2:return e.trys.push([2,4,,5]),[4,Promise.resolve().then(n.t.bind(n,5814,23))];case 3:return[2,e.sent()];case 4:return e.sent(),[2];case 5:return[3,6];case 6:return[2]}}))}))};try{if(((null===(r=null==t?void 0:t.root)||void 0===r?void 0:r.globalThis)||globalThis).IS_MP_BUILD)return[2];if(e)return[2,a()]}catch(t){if(e)return[2,a()]}return[2]}))}))}var m=function(){function e(e){var t=e.request,n=e.credentialsClient;if(!n){var o={apiOrigin:e.apiOrigin,apiPath:e.apiPath,clientId:e.clientId,storage:e.storage,env:e.env,baseRequest:e.baseRequest,anonymousSignInFunc:e.anonymousSignInFunc,wxCloud:e.wxCloud,onCredentialsError:e.onCredentialsError,headers:e.headers||{},i18n:e.i18n,debug:e.debug};n=new u.OAuth2Client(o)}if(!t){var i=n.request.bind(n),a=new l.Captcha(r({env:e.env,clientId:e.clientId,request:i,storage:e.storage,adapter:e.adapter,oauthInstance:this},e.captchaOptions));t=a.request.bind(a)}this.config={env:e.env,apiOrigin:e.apiOrigin,apiPath:e.apiPath,clientId:e.clientId,request:t,credentialsClient:n,storage:e.storage||u.defaultStorage,adapter:e.adapter}}return e.parseParamsToSearch=function(e){return Object.keys(e).forEach((function(t){e[t]||delete e[t]})),new d.default(e).toString()},e.prototype.getParamsByVersion=function(e,t){var n,r=(0,p.deepClone)(e),o=(null===(n={v2:c.ApiUrlsV2}[null==r?void 0:r.version])||void 0===n?void 0:n[t])||c.ApiUrls[t];return r&&delete r.version,{params:r,url:o}},e.prototype.signIn=function(e){return o(this,void 0,Promise,(function(){var t,n,o,a;return i(this,(function(i){switch(i.label){case 0:return t=e.version||"v1",(n=this.getParamsByVersion(e,"AUTH_SIGN_IN_URL")).params.query&&delete n.params.query,[4,this.getEncryptParams(n.params)];case 1:return o=i.sent(),[4,this.config.request(n.url,{method:"POST",body:o})];case 2:return a=i.sent(),[4,this.config.credentialsClient.setCredentials(r(r({},a),{version:t}))];case 3:return i.sent(),[2,Promise.resolve(a)]}}))}))},e.prototype.signInAnonymously=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=!1),o(this,void 0,Promise,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.config.request(c.ApiUrls.AUTH_SIGN_IN_ANONYMOUSLY_URL,{method:"POST",body:e,useWxCloud:t})];case 1:return n=r.sent(),[4,this.config.credentialsClient.setCredentials(n)];case 2:return r.sent(),[2,Promise.resolve(n)]}}))}))},e.prototype.signUp=function(e){return o(this,void 0,Promise,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.config.request(c.ApiUrls.AUTH_SIGN_UP_URL,{method:"POST",body:e})];case 1:return t=n.sent(),[4,this.config.credentialsClient.setCredentials(t)];case 2:return n.sent(),[2,Promise.resolve(t)]}}))}))},e.prototype.signOut=function(e){return o(this,void 0,Promise,(function(){var t,n,r,o;return i(this,(function(i){switch(i.label){case 0:if(t={},!e)return[3,6];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.config.request(c.ApiUrls.AUTH_SIGNOUT_URL,{method:"POST",withCredentials:!0,body:e})];case 2:return t=i.sent(),[3,4];case 3:return(n=i.sent()).error!==c.ErrorType.UNAUTHENTICATED&&console.log("sign_out_error",n),[3,4];case 4:return[4,this.config.credentialsClient.setCredentials()];case 5:return i.sent(),[2,t];case 6:return[4,this.config.credentialsClient.getAccessToken()];case 7:return r=i.sent(),[4,this.config.request(c.ApiUrls.AUTH_REVOKE_URL,{method:"POST",body:{token:r}})];case 8:return o=i.sent(),[4,this.config.credentialsClient.setCredentials()];case 9:return i.sent(),[2,Promise.resolve(o)]}}))}))},e.prototype.revokeAllDevices=function(){return o(this,void 0,Promise,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.config.request(c.ApiUrls.AUTH_REVOKE_ALL_URL,{method:"DELETE",withCredentials:!0})];case 1:return e.sent(),[2]}}))}))},e.prototype.revokeDevice=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.config.request(c.ApiUrls.AUTHORIZED_DEVICES_DELETE_URL+e.device_id,{method:"DELETE",withCredentials:!0})];case 1:return t.sent(),[2]}}))}))},e.prototype.getVerification=function(e,t){return o(this,void 0,Promise,(function(){var n,r;return i(this,(function(o){switch(o.label){case 0:return n=!1,"CUR_USER"!==e.target?[3,1]:(n=!0,[3,3]);case 1:return[4,this.hasLoginState()];case 2:o.sent()&&(n=!0),o.label=3;case 3:return(r=(0,p.deepClone)(e)).phone_number&&!/^\+\d{1,3}\s+\d+/.test(r.phone_number)&&(r.phone_number="+86 ".concat(r.phone_number)),[2,this.config.request(c.ApiUrls.VERIFICATION_URL,{method:"POST",body:r,withCaptcha:(null==t?void 0:t.withCaptcha)||!1,withCredentials:n})]}}))}))},e.prototype.verify=function(e){return o(this,void 0,Promise,(function(){var t,n;return i(this,(function(o){switch(o.label){case 0:return t=this.getParamsByVersion(e,"VERIFY_URL"),[4,this.config.request(t.url,{method:"POST",body:t.params})];case 1:return n=o.sent(),"v2"!==(null==e?void 0:e.version)?[3,3]:[4,this.config.credentialsClient.setCredentials(r(r({},n),{version:"v2"}))];case 2:o.sent(),o.label=3;case 3:return[2,n]}}))}))},e.prototype.genProviderRedirectUri=function(t){return o(this,void 0,Promise,(function(){var n,r,o,s,u;return i(this,(function(i){return n=t.provider_redirect_uri,r=t.other_params,o=void 0===r?{}:r,s=a(t,["provider_redirect_uri","other_params"]),n&&!s.redirect_uri&&(s.redirect_uri=n),u="".concat(c.ApiUrls.PROVIDER_URI_URL,"?").concat(e.parseParamsToSearch(s)),Object.keys(o).forEach((function(e){var t=o[e];("sign_out_uri"!==e||(null==t?void 0:t.length)>0)&&(u+="&other_params[".concat(e,"]=").concat(encodeURIComponent(t)))})),[2,this.config.request(u,{method:"GET"})]}))}))},e.prototype.grantProviderToken=function(e,t){return void 0===t&&(t=!1),o(this,void 0,Promise,(function(){return i(this,(function(n){return[2,this.config.request(c.ApiUrls.PROVIDER_TOKEN_URL,{method:"POST",body:e,useWxCloud:t})]}))}))},e.prototype.patchProviderToken=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.PROVIDER_TOKEN_URL,{method:"PATCH",body:e})]}))}))},e.prototype.signInWithProvider=function(e,t){return void 0===t&&(t=!1),o(this,void 0,Promise,(function(){var n,o;return i(this,(function(i){switch(i.label){case 0:return n=this.getParamsByVersion(e,"AUTH_SIGN_IN_WITH_PROVIDER_URL"),[4,this.config.request(n.url,{method:"POST",body:n.params,useWxCloud:t})];case 1:return o=i.sent(),[4,this.config.credentialsClient.setCredentials(r(r({},o),{version:(null==e?void 0:e.version)||"v1"}))];case 2:return i.sent(),[2,Promise.resolve(o)]}}))}))},e.prototype.toBindIdentity=function(e){var t,n;return o(this,void 0,void 0,(function(){var r,o,a,s;return i(this,(function(i){switch(i.label){case 0:return(o=e.credentials)?[3,2]:[4,this.config.credentialsClient.localCredentials.getCredentials()];case 1:o=i.sent(),i.label=2;case 2:r=o,i.label=3;case 3:return i.trys.push([3,5,,6]),[4,this.bindWithProvider({provider_token:e.provider_token},r)];case 4:return i.sent(),a={data:{type:c.OAUTH_TYPE.BIND_IDENTITY,provider:e.provider},error:null},[3,6];case 5:return s=i.sent(),a={data:{type:c.OAUTH_TYPE.BIND_IDENTITY},error:new h.AuthError(s)},[3,6];case 6:return e.fireEvent&&(null===(n=null===(t=this.config.eventBus)||void 0===t?void 0:t.fire)||void 0===n||n.call(t,c.EVENTS.AUTH_STATE_CHANGED,{event:c.AUTH_STATE_CHANGED_TYPE.BIND_IDENTITY,info:a})),[2,a]}}))}))},e.prototype.getInitialSession=function(){return o(this,void 0,Promise,(function(){var e,t,n,o,a,s,u,l,p,d,f,m,v,g,b;return i(this,(function(i){switch(i.label){case 0:e={},i.label=1;case 1:if(i.trys.push([1,12,,13]),"undefined"==typeof window||"undefined"==typeof document)return[2,{data:null,error:null}];if(t=new URLSearchParams(null===location||void 0===location?void 0:location.search),n=t.get("code"),o=t.get("state"),!n||!o)return[2,{data:null,error:null}];a=null;try{a=JSON.parse(sessionStorage.getItem(o)||"null")}catch(e){}return e={type:null==a?void 0:a.type},s=t.get("error"),u=t.get("error_description"),s||u?[2,{data:e,error:new h.AuthError({message:u||s||"Unknown error from OAuth provider"})}]:(l=(null==a?void 0:a.provider)||t.get("provider"))?(p=location.origin+location.pathname,[4,this.grantProviderToken({provider_id:l,provider_redirect_uri:p,provider_code:n})]):[2,{data:e,error:new h.AuthError({message:"Provider is required for OAuth verification"})}];case 2:return d=i.sent().provider_token,f=void 0,m=null,v=void 0,a.type!==c.OAUTH_TYPE.BIND_IDENTITY?[3,5]:[4,this.config.credentialsClient.localCredentials.getCredentials()];case 3:return f=i.sent(),[4,this.toBindIdentity({provider:l,provider_token:d,credentials:f})];case 4:return v=i.sent(),[3,11];case 5:return a.type!==c.OAUTH_TYPE.SIGN_IN?[3,11]:(v=this.getParamsByVersion({provider:l},"AUTH_SIGN_IN_WITH_PROVIDER_URL"),[4,this.config.request(v.url,{method:"POST",body:{provider_token:d}})]);case 6:f=i.sent(),i.label=7;case 7:return i.trys.push([7,9,,10]),[4,this.getUserInfo({credentials:f})];case 8:return m=i.sent(),[3,10];case 9:return g=i.sent(),console.error("get user info error",g),[3,10];case 10:v={data:r(r({},e),{session:f,user:m}),error:null},i.label=11;case 11:t.delete("code"),t.delete("state"),t.delete("provider"),this.restoreUrlState(void 0===(null==a?void 0:a.search)?"?".concat(t.toString()):a.search,(null==a?void 0:a.hash)||location.hash);try{sessionStorage.removeItem(o)}catch(e){}return[2,v];case 12:return b=i.sent(),[2,{data:e,error:new h.AuthError(b)}];case 13:return[2]}}))}))},e.prototype.signInCustom=function(e){return o(this,void 0,Promise,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.config.request(c.ApiUrls.AUTH_SIGN_IN_CUSTOM,{method:"POST",body:e})];case 1:return t=n.sent(),[4,this.config.credentialsClient.setCredentials(t)];case 2:return n.sent(),[2,Promise.resolve(t)]}}))}))},e.prototype.signInWithWechat=function(e){return void 0===e&&(e={}),o(this,void 0,Promise,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.config.request(c.ApiUrls.AUTH_SIGN_IN_WITH_WECHAT_URL,{method:"POST",body:e})];case 1:return t=n.sent(),[4,this.config.credentialsClient.setCredentials(t)];case 2:return n.sent(),[2,Promise.resolve(t)]}}))}))},e.prototype.bindWithProvider=function(e,t){return o(this,void 0,Promise,(function(){return i(this,(function(n){return[2,this.config.request(c.ApiUrls.PROVIDER_BIND_URL,{method:"POST",body:e,withCredentials:!0,getCredentials:t?function(){return t}:void 0})]}))}))},e.prototype.getUserProfile=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.getUserInfo(e)]}))}))},e.prototype.getUserInfo=function(e){var t,n,r;return void 0===e&&(e={}),o(this,void 0,Promise,(function(){var o,a,s,c,u;return i(this,(function(i){switch(i.label){case 0:return o=this.getParamsByVersion(e,"USER_ME_URL"),(null===(t=o.params)||void 0===t?void 0:t.query)&&(a=new d.default(o.params.query),o.url+="?".concat(a.toString())),[4,this.config.request(o.url,{method:"GET",withCredentials:!0,getCredentials:e.credentials?function(){return e.credentials}:void 0})];case 1:if((s=i.sent()).sub&&(s.uid=s.sub),null===(n=s.providers)||void 0===n?void 0:n.length)try{"undefined"!=typeof wx&&wx.getAccountInfoSync&&(c=null===(r=wx.getAccountInfoSync().miniProgram)||void 0===r?void 0:r.appId,(null==(u=s.providers.find((function(e){return e.id===c})))?void 0:u.provider_user_id)&&(s.open_id=u.provider_user_id))}catch(e){}return[2,s]}}))}))},e.prototype.getWedaUserInfo=function(){return o(this,void 0,Promise,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.config.request(c.ApiUrls.WEDA_USER_URL,{method:"GET",withCredentials:!0})];case 1:return[2,e.sent()]}}))}))},e.prototype.deleteMe=function(t){return o(this,void 0,Promise,(function(){var n,r;return i(this,(function(o){return n=this.getParamsByVersion(t,"USER_ME_URL"),r="".concat(n.url,"?").concat(e.parseParamsToSearch(n.params)),[2,this.config.request(r,{method:"DELETE",withCredentials:!0})]}))}))},e.prototype.hasLoginState=function(){return o(this,void 0,Promise,(function(){return i(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.config.credentialsClient.getAccessToken()];case 1:return e.sent(),[2,!0];case 2:return e.sent(),[2,!1];case 3:return[2]}}))}))},e.prototype.hasLoginStateSync=function(){return this.config.credentialsClient.getCredentialsSync()},e.prototype.getLoginState=function(){return o(this,void 0,Promise,(function(){return i(this,(function(e){return[2,this.config.credentialsClient.getCredentialsAsync()]}))}))},e.prototype.transByProvider=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.USER_TRANS_BY_PROVIDER_URL,{method:"PATCH",body:e,withCredentials:!0})]}))}))},e.prototype.grantToken=function(e){return o(this,void 0,Promise,(function(){var t;return i(this,(function(n){return t=this.getParamsByVersion(e,"AUTH_TOKEN_URL"),[2,this.config.request(t.url,{method:"POST",body:t.params})]}))}))},e.prototype.getProviders=function(){return o(this,void 0,Promise,(function(){return i(this,(function(e){return[2,this.config.request(c.ApiUrls.PROVIDER_LIST,{method:"GET",withCredentials:!0})]}))}))},e.prototype.unbindProvider=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request("".concat(c.ApiUrls.PROVIDER_UNBIND_URL,"/").concat(e.provider_id),{method:"DELETE",withCredentials:!0})]}))}))},e.prototype.checkPassword=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request("".concat(c.ApiUrls.CHECK_PWD_URL),{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.editContact=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request("".concat(c.ApiUrls.BIND_CONTACT_URL),{method:"PATCH",withCredentials:!0,body:e})]}))}))},e.prototype.setPassword=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request("".concat(c.ApiUrls.AUTH_SET_PASSWORD),{method:"PATCH",withCredentials:!0,body:e})]}))}))},e.prototype.updatePasswordByOld=function(e){return o(this,void 0,Promise,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.sudo({password:e.old_password})];case 1:return t=n.sent(),[2,this.setPassword({sudo_token:t.sudo_token,new_password:e.new_password})]}}))}))},e.prototype.sudo=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request("".concat(c.ApiUrls.SUDO_URL),{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.sendVerificationCodeToCurrentUser=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return e.target="CUR_USER",[2,this.config.request(c.ApiUrls.VERIFICATION_URL,{method:"POST",body:e,withCredentials:!0,withCaptcha:!0})]}))}))},e.prototype.changeBoundProvider=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request("".concat(c.ApiUrls.PROVIDER_LIST,"/").concat(e.provider_id,"/trans"),{method:"POST",body:{provider_trans_token:e.trans_token},withCredentials:!0})]}))}))},e.prototype.setUserProfile=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.USER_PRIFILE_URL,{method:"PATCH",body:e,withCredentials:!0})]}))}))},e.prototype.updateUserBasicInfo=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.USER_BASIC_EDIT_URL,{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.queryUserProfile=function(e){return o(this,void 0,Promise,(function(){var t;return i(this,(function(n){return t=new d.default(e),[2,this.config.request("".concat(c.ApiUrls.USER_QUERY_URL,"?").concat(t.toString()),{method:"GET",withCredentials:!0})]}))}))},e.prototype.setCustomSignFunc=function(e){this.getCustomSignTicketFn=e},e.prototype.signInWithCustomTicket=function(){return o(this,void 0,Promise,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return(e=this.getCustomSignTicketFn)?[4,e()]:[2,Promise.reject({error:"failed_precondition",error_description:"please use setCustomSignFunc to set custom sign function"})];case 1:return t=n.sent(),[2,this.signInCustom({provider_id:"custom",ticket:t})]}}))}))},e.prototype.resetPassword=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.AUTH_RESET_PASSWORD,{method:"POST",body:e})]}))}))},e.prototype.authorize=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.AUTHORIZE_URL,{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.authorizeDevice=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.AUTHORIZE_DEVICE_URL,{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.deviceAuthorize=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.AUTH_GET_DEVICE_CODE,{method:"POST",body:e})]}))}))},e.prototype.authorizeInfo=function(t){return o(this,void 0,Promise,(function(){var n,r,o;return i(this,(function(i){switch(i.label){case 0:return n="".concat(c.ApiUrls.AUTHORIZE_INFO_URL,"?").concat(e.parseParamsToSearch(t)),r=!0,o=!1,[4,this.hasLoginState()];case 1:return i.sent()&&(o=!0,r=!1),[2,this.config.request(n,{method:"GET",withBasicAuth:r,withCredentials:o})]}}))}))},e.prototype.checkUsername=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.CHECK_USERNAME,{method:"GET",body:e,withCredentials:!0})]}))}))},e.prototype.checkIfUserExist=function(e){return o(this,void 0,Promise,(function(){var t;return i(this,(function(n){return t=new d.default(e),[2,this.config.request("".concat(c.ApiUrls.CHECK_IF_USER_EXIST,"?").concat(t.toString()),{method:"GET"})]}))}))},e.prototype.loginScope=function(){return o(this,void 0,Promise,(function(){return i(this,(function(e){return[2,this.config.credentialsClient.getScope()]}))}))},e.prototype.loginGroups=function(){return o(this,void 0,Promise,(function(){return i(this,(function(e){return[2,this.config.credentialsClient.getGroups()]}))}))},e.prototype.refreshTokenForce=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.config.credentialsClient.getCredentials()];case 1:return t=n.sent(),[4,this.config.credentialsClient.refreshToken(r(r({},t),{version:(null==e?void 0:e.version)||"v1"}))];case 2:return[2,n.sent()]}}))}))},e.prototype.getCredentials=function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.config.credentialsClient.getCredentials()]}))}))},e.prototype.getPublicKey=function(){return o(this,void 0,Promise,(function(){return i(this,(function(e){return[2,this.config.request(c.ApiUrlsV2.AUTH_PUBLIC_KEY,{method:"POST",body:{}})]}))}))},e.prototype.getEncryptParams=function(e){return o(this,void 0,Promise,(function(){var t,n,r,o,a,s;return i(this,(function(i){switch(i.label){case 0:return t=e.isEncrypt,delete e.isEncrypt,n=(0,p.deepClone)(e),[4,f(t,this.config.adapter)];case 1:if(!(r=i.sent()))return[2,e];o="",a="",i.label=2;case 2:return i.trys.push([2,4,,5]),[4,this.getPublicKey()];case 3:if(s=i.sent(),o=s.public_key,a=s.public_key_thumbprint,!o||!a)throw s;return[3,5];case 4:throw i.sent();case 5:return[2,{params:r.getEncryptInfo({publicKey:o,payload:n}),public_key_thumbprint:a}]}}))}))},e.prototype.getProviderSubType=function(){return o(this,void 0,Promise,(function(){return i(this,(function(e){return[2,this.config.request(c.ApiUrls.GET_PROVIDER_TYPE,{method:"POST",body:{provider_id:"weda"}})]}))}))},e.prototype.verifyCaptchaData=function(e){var t=e.token,n=e.key;return o(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.config.request(c.ApiUrls.VERIFY_CAPTCHA_DATA_URL,{method:"POST",body:{token:t,key:n},withCredentials:!1})]}))}))},e.prototype.createCaptchaData=function(e){var t=e.state,n=e.redirect_uri,r=void 0===n?void 0:n;return o(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.config.request(c.ApiUrls.CAPTCHA_DATA_URL,{method:"POST",body:{state:t,redirect_uri:r},withCredentials:!1})]}))}))},e.prototype.getMiniProgramCode=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.GET_MINIPROGRAM_QRCODE,{method:"POST",body:e})]}))}))},e.prototype.getMiniProgramQrCodeStatus=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.config.request(c.ApiUrls.GET_MINIPROGRAM_QRCODE_STATUS,{method:"POST",body:e})]}))}))},e.prototype.getUserBehaviorLog=function(e){return o(this,void 0,Promise,(function(){var t,n;return i(this,(function(r){return t={LOGIN:"query[action]=USER_LOGIN",MODIFY:"ne_query[action]=USER_LOGIN"},n="".concat(c.ApiUrls.GET_USER_BEHAVIOR_LOG,"?").concat(t[e.type],"&limit=").concat(e.limit).concat(e.page_token?"&page_token=".concat(e.page_token):""),[2,this.config.request(n,{method:"GET",withCredentials:!0})]}))}))},e.prototype.modifyPassword=function(e){return o(this,void 0,Promise,(function(){var t,n,r,o,a,s;return i(this,(function(i){switch(i.label){case 0:return t="",n="",[4,f(!0,this.config.adapter)];case 1:if(!(r=i.sent()))throw new Error("do not support encrypt, a encrypt util required.");i.label=2;case 2:return i.trys.push([2,4,,5]),[4,this.getPublicKey()];case 3:if(o=i.sent(),t=o.public_key,n=o.public_key_thumbprint,!t||!n)throw o;return[3,5];case 4:throw i.sent();case 5:return a=e.password?r.getEncryptInfo({publicKey:t,payload:e.password}):"",s=r.getEncryptInfo({publicKey:t,payload:e.new_password}),[2,this.config.request(c.ApiUrls.USER_BASIC_EDIT_URL,{method:"POST",withCredentials:!0,body:{user_id:e.user_id,encrypt_password:a,encrypt_new_password:s,public_key_thumbprint:n}})]}}))}))},e.prototype.modifyPasswordWithoutLogin=function(e){return o(this,void 0,Promise,(function(){var t,n,r,o,a,s;return i(this,(function(i){switch(i.label){case 0:return t="",n="",[4,f(!0,this.config.adapter)];case 1:if(!(r=i.sent()))throw new Error("do not support encrypt, a encrypt util required.");i.label=2;case 2:return i.trys.push([2,4,,5]),[4,this.getPublicKey()];case 3:if(o=i.sent(),t=o.public_key,n=o.public_key_thumbprint,!t||!n)throw o;return[3,5];case 4:throw i.sent();case 5:return a=e.password?r.getEncryptInfo({publicKey:t,payload:e.password}):"",s=r.getEncryptInfo({publicKey:t,payload:e.new_password}),[2,this.config.request(c.ApiUrlsV2.AUTH_RESET_PASSWORD,{method:"POST",body:{username:e.username,password:a,new_password:s,public_key_thumbprint:n}})]}}))}))},e.prototype.restoreUrlState=function(e,t){if(void 0!==e)try{var n=new URL(window.location.href);n.search=e,n.hash=t||"",window.history.replaceState(null,"",n.toString()),window.location.replace(n.toString())}catch(e){}},e}();t.Auth=m},8308:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AuthError=t.AuthErrorCategory=void 0;var i,a=n(4949);!function(e){e.PROVIDER_NOT_ENABLED="PROVIDER_NOT_ENABLED",e.INVALID_CREDENTIALS="INVALID_CREDENTIALS",e.USER_NOT_FOUND="USER_NOT_FOUND",e.USER_STATUS_ABNORMAL="USER_STATUS_ABNORMAL",e.SERVICE_ERROR="SERVICE_ERROR",e.INVALID_PARAMS="INVALID_PARAMS",e.AUTH_METHOD_MISMATCH="AUTH_METHOD_MISMATCH",e.RATE_LIMITED="RATE_LIMITED",e.CAPTCHA_REQUIRED="CAPTCHA_REQUIRED",e.CAPTCHA_INVALID="CAPTCHA_INVALID",e.MFA_REQUIRED="MFA_REQUIRED",e.PRECONDITION_FAILED="PRECONDITION_FAILED",e.VERIFICATION_FAILED="VERIFICATION_FAILED",e.UNKNOWN="UNKNOWN"}(i=t.AuthErrorCategory||(t.AuthErrorCategory={}));var s="https://tcb.cloud.tencent.com/dev?envId=#/identity/login-manage",c="https://docs.cloudbase.net/api-reference/webv3-next/initialization",u=function(e){function t(t,n){var r,o=this,u=t.error_description||t.message;return(o=e.call(this,u)||this).__isAuthError=!0,o.name="AuthError",o.status=t.error,o.code=String(t.error||t.error_code||"unknown").toLowerCase(),o.errorCode="number"==typeof t.error_code?t.error_code:"string"==typeof t.error_code&&parseInt(t.error_code,10)||void 0,o.requestId=t.requestId,o.category=function(e,t,n){if(!e&&!t&&!n)return i.UNKNOWN;try{var r=(e||"").toLowerCase(),o="string"==typeof n?parseInt(n,10):n;return o===a.AuthErrorCode.CAPTCHA_REQUIRED||t===a.ErrorType.CAPTCHA_REQUIRED?i.CAPTCHA_REQUIRED:o===a.AuthErrorCode.CAPTCHA_INVALID||t===a.ErrorType.CAPTCHA_INVALID?i.CAPTCHA_INVALID:o===a.AuthErrorCode.MFA_PHONE_REQUIRED||t===a.ErrorType.MFA_PHONE_REQUIRED?i.MFA_REQUIRED:o===a.AuthErrorCode.LOGIN_TYPE_DISABLED||t===a.ErrorType.LOGIN_TYPE_DISABLED?i.PROVIDER_NOT_ENABLED:o===a.AuthErrorCode.RESOURCE_EXHAUSTED||t===a.ErrorType.RESOURCE_EXHAUSTED?i.RATE_LIMITED:o===a.AuthErrorCode.INTERNAL||o===a.AuthErrorCode.UNAVAILABLE||o===a.AuthErrorCode.UNIMPLEMENTED||o===a.AuthErrorCode.ABORTED?i.SERVICE_ERROR:o===a.AuthErrorCode.NOT_FOUND?i.USER_NOT_FOUND:o===a.AuthErrorCode.UNAUTHENTICATED?i.INVALID_CREDENTIALS:o===a.AuthErrorCode.INVALID_ARGUMENT&&(r.includes("验证码")||r.includes("verification")||r.includes("verification_code")||r.includes("verification_id")||r.includes("does not match")||r.includes("token expired")||r.includes("token error")||r.includes("过期"))?i.VERIFICATION_FAILED:t===a.ErrorType.PROVIDER_NOT_ENABLED||t===a.ErrorType.LOGIN_METHOD_DISABLED||r.includes("身份源")||r.includes("开启")||r.includes("identity provider")||r.includes("provider not enabled")||r.includes("login method")||r.includes("登录方式")||r.includes("not enabled")||r.includes("未开启")||r.includes("未启用")||r.includes("请联系开发者")||r.includes("anonymous login is not enabled")||r.includes("匿名登录未开启")?i.PROVIDER_NOT_ENABLED:t===a.ErrorType.FAILED_PRECONDITION||o===a.AuthErrorCode.FAILED_PRECONDITION&&!r.includes("请联系开发者")?r.includes("不存在")||r.includes("not found")||r.includes("未注册")?i.USER_NOT_FOUND:i.PRECONDITION_FAILED:t===a.ErrorType.INVALID_PASSWORD||t===a.ErrorType.INVALID_GRANT||t===a.ErrorType.INVALID_VERIFICATION_CODE||t===a.ErrorType.INVALID_USERNAME_OR_PASSWORD||t===a.ErrorType.INVALID_CREDENTIALS||t===a.ErrorType.WRONG_PASSWORD||t===a.ErrorType.UNAUTHENTICATED||t===a.ErrorType.INVALID_TWO_FACTOR||t===a.ErrorType.INVALID_TWO_FACTOR_RECOVERY||t===a.ErrorType.PASSWORD_NOT_SET||r.includes("密码不正确")||r.includes("password")||r.includes("invalid_password")||r.includes("凭据")||r.includes("credentials")||r.includes("验证码")||r.includes("verification")||r.includes("invalid_verification_code")||r.includes("invalid_username_or_password")||r.includes("username or password")||r.includes("用户名或密码")||r.includes("wrong password")||r.includes("incorrect password")?i.INVALID_CREDENTIALS:t===a.ErrorType.NOT_FOUND||t===a.ErrorType.USER_NOT_FOUND||r.includes("用户不存在")||r.includes("not found")||r.includes("user not found")||r.includes("no such user")||r.includes("user does not exist")?i.USER_NOT_FOUND:t===a.ErrorType.USER_BLOCKED||t===a.ErrorType.USER_PENDING||t===a.ErrorType.UNDER_REVIEW||t===a.ErrorType.INVALID_STATUS||r.includes("被封禁")||r.includes("blocked")||r.includes("pending")||r.includes("审核")||r.includes("review")||r.includes("locked")||r.includes("已锁定")?i.USER_STATUS_ABNORMAL:t===a.ErrorType.SERVER_ERROR||t===a.ErrorType.UNAVAILABLE||t===a.ErrorType.TEMPORARILY_UNAVAILABLE||t===a.ErrorType.INTERNAL||t===a.ErrorType.UNREACHABLE||t===a.ErrorType.DEADLINE_EXCEEDED||t===a.ErrorType.DATA_LOSS||t===a.ErrorType.ABORTED||r.includes("network")||r.includes("timeout")||r.includes("timed out")||r.includes("超时")||r.includes("smtp is not set")||r.includes("sms sender does not config")?i.SERVICE_ERROR:t===a.ErrorType.INVALID_ARGUMENT||t===a.ErrorType.INVALID_REQUEST||t===a.ErrorType.INVALID_SCOPE||t===a.ErrorType.INVALID_REQUEST_URI||t===a.ErrorType.INVALID_REQUEST_OBJECT||o===a.AuthErrorCode.INVALID_ARGUMENT?i.INVALID_PARAMS:t===a.ErrorType.PERMISSION_DENIED||t===a.ErrorType.ACCESS_DENIED||t===a.ErrorType.UNAUTHORIZED_CLIENT?i.PROVIDER_NOT_ENABLED:i.UNKNOWN}catch(e){return t}}(u,o.status,o.errorCode),o.helpMessage=function(e,t){var n=(null==t?void 0:t.method)||"signIn",r={signInWithPassword:"「用户名密码登录」",signInAnonymously:"「匿名登录」",signInWithOtp:"「短信验证码登录」或「邮箱验证码登录」",signUp:"「短信验证码登录」或「邮箱验证码登录」",signInWithOAuth:"对应的第三方身份源",signInWithIdToken:"对应的第三方身份源",signInWithOpenId:"「微信小程序 OpenID 登录」",signInWithPhoneAuth:"「微信小程序手机号授权登录」",signInWithCustomTicket:"「自定义登录」",getVerification:"「短信验证码登录」或「邮箱验证码登录」",verify:"「短信验证码登录」或「邮箱验证码登录」",verifyOtp:"「短信验证码登录」或「邮箱验证码登录」",resetPasswordForEmail:"「邮箱验证码登录」",reauthenticate:"「短信验证码登录」或「邮箱验证码登录」"}[n]||"对应的登录方式";switch(e){case i.PROVIDER_NOT_ENABLED:return"[CloudBase Auth] 登录方式未开启\n\n"+" 当前调用的 ".concat(n,"() 所需的登录方式尚未在云开发控制台启用。\n")+" 需要开启的登录方式:".concat(r,"\n")+"\n 请按以下步骤开启:\n"+" 1. 打开云开发控制台:".concat(s,"\n")+" 2. 选择对应的云开发环境\n 3. 进入「登录授权」页面,在「登录方式」或「身份源列表」中开启所需的登录方式\n\n 各登录方法与所需登录方式的对应关系:\n - signInWithPassword → 「用户名密码登录」\n - signInAnonymously → 「匿名登录」\n - signInWithOtp/signUp → 「短信验证码登录」或「邮箱验证码登录」\n - signInWithOAuth/signInWithIdToken → 对应的第三方身份源\n\n 如使用 CLI/MCP 工具,可通过 auth 工具查询和配置身份源状态。\n"+" 更多帮助请参考文档:".concat(c);case i.INVALID_CREDENTIALS:return"[CloudBase Auth] 凭据验证失败\n\n"+" 调用 ".concat(n,"() 时凭据校验未通过。\n")+"\n 请按优先级逐项排查:\n 1. 确认用户名/邮箱/手机号是否拼写正确、格式完整\n 2. 确认密码是否正确(注意大小写、特殊字符、前后空格)\n 3. 确认用户账号确实存在(可通过 auth.isUsernameRegistered() 检查)\n 4. 确认凭据参数来源可靠(环境变量、配置文件中的值是否已正确设置)\n 5. 如使用加密登录(is_encrypt: true),请确认公钥版本正确\n\n 如忘记密码,可通过 auth.resetPasswordForEmail() 重置密码。\n\n 提示:如果是 AI agent / 自动化测试场景,请确认 ENV_ID、USERNAME、PASSWORD\n 等环境变量已正确传入,且对应用户已在目标环境中注册。";case i.USER_NOT_FOUND:return"[CloudBase Auth] 用户不存在\n\n 请检查以下项目:\n 1. 确认用户名/邮箱/手机号是否正确\n 2. 确认是在正确的云开发环境(envId)下操作\n 3. 如果是新用户,请先通过 auth.signUp() 注册\n"+" 4. 也可在云开发控制台手动创建用户:".concat(s,"\n")+"\n 提示:不同环境(开发/测试/生产)的用户库是隔离的,请确认 envId 正确。";case i.USER_STATUS_ABNORMAL:return"[CloudBase Auth] 用户状态异常\n\n 当前用户账号可能处于以下状态之一:\n - 账号已被封禁\n - 账号正在审核中\n - 账号已被锁定(多次密码错误)\n\n"+" 请联系管理员在云开发控制台检查用户状态:".concat(s);case i.SERVICE_ERROR:return"[CloudBase Auth] 服务异常\n\n 请检查以下项目:\n 1. 网络连接是否正常\n 2. 云开发环境是否正常运行\n 3. 稍后重试,如持续失败请联系技术支持\n\n 提示:如果是超时错误,请检查网络环境和请求频率。\n 常见服务端错误:smtp 未配置、短信服务未配置、wedaapis 未设置等。";case i.INVALID_PARAMS:return"[CloudBase Auth] 参数错误\n\n 请检查传入的参数是否符合要求:\n - 不能同时输入手机号和邮箱\n - 手机号格式需正确(如 +86 开头)\n - 必须提供手机号或邮箱\n\n"+" 参考 API 文档确认各参数的格式和约束:".concat(c);case i.AUTH_METHOD_MISMATCH:return"[CloudBase Auth] 登录方式不匹配\n\n"+" 调用 ".concat(n,"() 时遇到错误,可能原因:\n")+" - 匿名登录失败后尝试了用户名密码登录,但凭据不正确或用户不存在\n - 应使用匿名登录但传入了密码参数\n - 应使用密码登录但未传入正确的凭据\n\n 建议:\n 1. 明确当前场景需要的登录方式:\n - 无需用户注册 → auth.signInAnonymously()\n - 有用户名和密码 → auth.signInWithPassword({ username, password })\n - 第三方平台 → auth.signInWithOAuth({ provider })\n 2. 不要在同一流程中混合使用不同的登录方式\n 3. 每种登录方式需要在控制台开启对应的身份源\n"+" 4. 控制台地址:".concat(s);case i.RATE_LIMITED:return"[CloudBase Auth] 发送频率受限\n\n 验证码发送过于频繁,已触发频率限制。\n\n 限制规则:\n - 手机号:每分钟最多 1 条,每天有上限\n - 邮箱:每分钟有上限,每天有上限(默认 50 条)\n\n 建议:\n 1. 检查 error.retryAfter 获取建议等待时间\n 2. 在 UI 中显示倒计时,防止用户重复点击\n 3. 如业务需要更高频率,请联系技术支持调整限额";case i.CAPTCHA_REQUIRED:return"[CloudBase Auth] 需要滑块验证码\n\n 当前操作触发了风控策略,需要完成滑块验证。\n\n 处理方式:\n 1. 调用滑块验证码 SDK 展示验证组件\n 2. 用户完成验证后,将 captcha_token 附带到请求中重新发送\n 3. 可通过 getVerification 的 options.withCaptcha 参数自动携带验证码";case i.CAPTCHA_INVALID:return"[CloudBase Auth] 滑块验证码校验失败\n\n 提交的验证码 token 校验未通过(可能已过期或 client_id 不匹配)。\n\n 处理方式:\n 1. 刷新滑块验证码,让用户重新验证\n 2. 确认 captcha 组件初始化的 client_id 与认证配置一致";case i.MFA_REQUIRED:return"[CloudBase Auth] 需要 MFA 验证\n\n 当前操作要求用户绑定手机号进行多因素认证 (MFA)。\n\n 处理方式:\n 1. 引导用户进入手机号绑定流程\n 2. 绑定完成后重新执行原操作\n 3. error 中可能包含 MFA 详情信息";case i.PRECONDITION_FAILED:return"[CloudBase Auth] 前置条件不满足\n\n 当前操作的前置条件不满足,常见原因:\n - 该手机号/邮箱已被其他账号绑定\n - 目标用户不存在或已存在(与 target 参数冲突)\n - 当前邮箱/手机号未注册用户\n\n 请根据 error.message 中的具体描述处理。";case i.VERIFICATION_FAILED:return'[CloudBase Auth] 验证码校验失败\n\n 验证码验证未通过,常见原因:\n - 验证码已过期(通常有效期为几分钟)\n - 验证码输入不正确\n - verification_id 无效或已被使用\n - 验证码不属于当前项目(project id does not match)\n\n 处理方式:\n 1. 提示用户"验证码已过期或不正确,请重新获取"\n 2. 调用 getVerification() 重新发送验证码\n 3. 确保 verification_id 与最新发送的验证码对应\n\n 注意:每次重新发送验证码后,之前的 verification_id 即失效。';default:return"[CloudBase Auth] 操作失败\n\n 如果问题持续存在,建议:\n"+" 1. 检查云开发控制台的认证配置:".concat(s,"\n")+" 2. 到官方问答社区提问:https://cnb.cool/tencent/cloud/cloudbase/community/-/issues\n"+" 3. 查阅文档:".concat(c)}}(o.category,n),o.loginMethodHint=(r=null==n?void 0:n.method)&&{signInWithPassword:"当前使用「用户名密码登录」,需确保:\n ✓ 控制台已开启「用户名密码登录」\n ✓ 用户已注册且凭据正确\n 如果不需要用户系统,建议改用 auth.signInAnonymously()",signInAnonymously:"当前使用「匿名登录」,需确保:\n ✓ 控制台已开启「匿名登录」\n 注意:匿名用户无需用户名密码,适用于快速体验或临时访问场景",signInWithOtp:"当前使用「OTP 验证码登录」,需确保:\n ✓ 控制台已开启「短信验证码登录」或「邮箱验证码登录」",signInWithOAuth:"当前使用「第三方 OAuth 登录」,需确保:\n ✓ 控制台已配置并开启对应的第三方身份源"}[r]||"",o.category===i.RATE_LIMITED&&(o.retryAfter=t.retry_after||t.retryAfter||void 0),o}return o(t,e),t}(Error);t.AuthError=u},4949:(e,t)=>{"use strict";var n,r,o,i,a;Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_NODE_ACCESS_SCOPE=t.OAUTH_TYPE=t.EVENTS=t.AUTH_STATE_CHANGED_TYPE=t.LOGIN_STATE_CHANGED_TYPE=t.AuthErrorCode=t.ErrorType=t.VerificationUsages=t.ApiUrlsV2=t.ApiUrls=t.AUTH_API_PREFIX=void 0,t.AUTH_API_PREFIX="/auth",(a=t.ApiUrls||(t.ApiUrls={})).AUTH_SIGN_UP_URL="/v1/signup",a.AUTH_TOKEN_URL="/v1/token",a.AUTH_REVOKE_URL="/v1/revoke",a.WEDA_USER_URL="/v1/plugin/weda/userinfo",a.AUTH_RESET_PASSWORD="/v1/reset",a.AUTH_GET_DEVICE_CODE="/v1/device/code",a.CHECK_USERNAME="/v1/checkUsername",a.CHECK_IF_USER_EXIST="/v1/checkIfUserExist",a.GET_PROVIDER_TYPE="/v1/mgr/provider/providerSubType",a.AUTH_SIGN_IN_URL="/v1/signin",a.AUTH_SIGN_IN_ANONYMOUSLY_URL="/v1/signin/anonymously",a.AUTH_SIGN_IN_WITH_PROVIDER_URL="/v1/signin/with/provider",a.AUTH_SIGN_IN_WITH_WECHAT_URL="/v1/signin/wechat/noauth",a.AUTH_SIGN_IN_CUSTOM="/v1/signin/custom",a.PROVIDER_TOKEN_URL="/v1/provider/token",a.PROVIDER_URI_URL="/v1/provider/uri",a.USER_ME_URL="/v1/user/me",a.AUTH_SIGNOUT_URL="/v1/user/signout",a.USER_QUERY_URL="/v1/user/query",a.USER_PRIFILE_URL="/v1/user/profile",a.USER_BASIC_EDIT_URL="/v1/user/basic/edit",a.USER_TRANS_BY_PROVIDER_URL="/v1/user/trans/by/provider",a.PROVIDER_LIST="/v1/user/provider",a.PROVIDER_BIND_URL="/v1/user/provider/bind",a.PROVIDER_UNBIND_URL="/v1/user/provider",a.CHECK_PWD_URL="/v1/user/sudo",a.SUDO_URL="/v1/user/sudo",a.BIND_CONTACT_URL="/v1/user/contact",a.AUTH_SET_PASSWORD="/v1/user/password",a.AUTHORIZE_DEVICE_URL="/v1/user/device/authorize",a.AUTHORIZE_URL="/v1/user/authorize",a.AUTHORIZE_INFO_URL="/v1/user/authorize/info",a.AUTHORIZED_DEVICES_DELETE_URL="/v1/user/authorized/devices/",a.AUTH_REVOKE_ALL_URL="/v1/user/revoke/all",a.GET_USER_BEHAVIOR_LOG="/v1/user/security/history",a.VERIFICATION_URL="/v1/verification",a.VERIFY_URL="/v1/verification/verify",a.CAPTCHA_DATA_URL="/v1/captcha/data",a.VERIFY_CAPTCHA_DATA_URL="/v1/captcha/data/verify",a.GET_CAPTCHA_URL="/v1/captcha/init",a.GET_MINIPROGRAM_QRCODE="/v1/qrcode/generate",a.GET_MINIPROGRAM_QRCODE_STATUS="/v1/qrcode/get/status",(i=t.ApiUrlsV2||(t.ApiUrlsV2={})).AUTH_SIGN_IN_URL="/v2/signin/username",i.AUTH_TOKEN_URL="/v2/token",i.USER_ME_URL="/v2/user/me",i.VERIFY_URL="/v2/signin/verificationcode",i.AUTH_SIGN_IN_WITH_PROVIDER_URL="/v2/signin/with/provider",i.AUTH_PUBLIC_KEY="/v2/signin/publichkey",i.AUTH_RESET_PASSWORD="/v2/signin/password/update",(o=t.VerificationUsages||(t.VerificationUsages={})).REGISTER="REGISTER",o.SIGN_IN="SIGN_IN",o.PASSWORD_RESET="PASSWORD_RESET",o.EMAIL_ADDRESS_CHANGE="EMAIL_ADDRESS_CHANGE",o.PHONE_NUMBER_CHANGE="PHONE_NUMBER_CHANGE",(r=t.ErrorType||(t.ErrorType={})).UNREACHABLE="unreachable",r.LOCAL="local",r.CANCELLED="cancelled",r.UNKNOWN="unknown",r.UNAUTHENTICATED="unauthenticated",r.RESOURCE_EXHAUSTED="resource_exhausted",r.FAILED_PRECONDITION="failed_precondition",r.INVALID_ARGUMENT="invalid_argument",r.DEADLINE_EXCEEDED="deadline_exceeded",r.NOT_FOUND="not_found",r.ALREADY_EXISTS="already_exists",r.PERMISSION_DENIED="permission_denied",r.ABORTED="aborted",r.OUT_OF_RANGE="out_of_range",r.UNIMPLEMENTED="unimplemented",r.INTERNAL="internal",r.UNAVAILABLE="unavailable",r.DATA_LOSS="data_loss",r.INVALID_PASSWORD="invalid_password",r.PASSWORD_NOT_SET="password_not_set",r.INVALID_STATUS="invalid_status",r.USER_PENDING="user_pending",r.USER_BLOCKED="user_blocked",r.INVALID_VERIFICATION_CODE="invalid_verification_code",r.TWO_FACTOR_REQUIRED="two_factor_required",r.INVALID_TWO_FACTOR="invalid_two_factor",r.INVALID_TWO_FACTOR_RECOVERY="invalid_two_factor_recovery",r.UNDER_REVIEW="under_review",r.INVALID_REQUEST="invalid_request",r.UNAUTHORIZED_CLIENT="unauthorized_client",r.ACCESS_DENIED="access_denied",r.UNSUPPORTED_RESPONSE_TYPE="unsupported_response_type",r.INVALID_SCOPE="invalid_scope",r.INVALID_GRANT="invalid_grant",r.SERVER_ERROR="server_error",r.TEMPORARILY_UNAVAILABLE="temporarily_unavailable",r.INTERACTION_REQUIRED="interaction_required",r.LOGIN_REQUIRED="login_required",r.ACCOUNT_SELECTION_REQUIRED="account_selection_required",r.CONSENT_REQUIRED="consent_required",r.INVALID_REQUEST_URI="invalid_request_uri",r.INVALID_REQUEST_OBJECT="invalid_request_object",r.REQUEST_NOT_SUPPORTED="request_not_supported",r.REQUEST_URI_NOT_SUPPORTED="request_uri_not_supported",r.REGISTRATION_NOT_SUPPORTED="registration_not_supported",r.CAPTCHA_REQUIRED="captcha_required",r.CAPTCHA_INVALID="captcha_invalid",r.PROVIDER_NOT_ENABLED="provider_not_enabled",r.LOGIN_METHOD_DISABLED="login_method_disabled",r.INVALID_USERNAME_OR_PASSWORD="invalid_username_or_password",r.INVALID_CREDENTIALS="invalid_credentials",r.WRONG_PASSWORD="wrong_password",r.USER_NOT_FOUND="user_not_found",r.MFA_PHONE_REQUIRED="mfa_phone_required",r.LOGIN_TYPE_DISABLED="login_type_disabled",r.PROVIDER_ERROR="provider_error",(n=t.AuthErrorCode||(t.AuthErrorCode={}))[n.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",n[n.NOT_FOUND=5]="NOT_FOUND",n[n.PERMISSION_DENIED=7]="PERMISSION_DENIED",n[n.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",n[n.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",n[n.ABORTED=10]="ABORTED",n[n.UNIMPLEMENTED=12]="UNIMPLEMENTED",n[n.INTERNAL=13]="INTERNAL",n[n.UNAVAILABLE=14]="UNAVAILABLE",n[n.UNAUTHENTICATED=16]="UNAUTHENTICATED",n[n.CAPTCHA_REQUIRED=4001]="CAPTCHA_REQUIRED",n[n.CAPTCHA_INVALID=4002]="CAPTCHA_INVALID",n[n.PROVIDER_ERROR=4019]="PROVIDER_ERROR",n[n.UNAUTHORIZED_CLIENT=4022]="UNAUTHORIZED_CLIENT",n[n.MFA_PHONE_REQUIRED=4042]="MFA_PHONE_REQUIRED",n[n.LOGIN_TYPE_DISABLED=4045]="LOGIN_TYPE_DISABLED",t.LOGIN_STATE_CHANGED_TYPE={SIGN_OUT:"sign_out",SIGN_IN:"sign_in",CREDENTIALS_ERROR:"credentials_error"},t.AUTH_STATE_CHANGED_TYPE={SIGNED_OUT:"SIGNED_OUT",SIGNED_IN:"SIGNED_IN",INITIAL_SESSION:"INITIAL_SESSION",PASSWORD_RECOVERY:"PASSWORD_RECOVERY",TOKEN_REFRESHED:"TOKEN_REFRESHED",USER_UPDATED:"USER_UPDATED",BIND_IDENTITY:"BIND_IDENTITY"},t.EVENTS={LOGIN_STATE_CHANGED:"loginStateChanged",AUTH_STATE_CHANGED:"authStateChanged"},t.OAUTH_TYPE={SIGN_IN:"sign_in",BIND_IDENTITY:"bind_identity"},t.DEFAULT_NODE_ACCESS_SCOPE="node-sdk-scope"},3538:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2084:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.openURIWithCallback=void 0;var a=n(9689),s=n(3616),c=function(e,t){var n;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];clearTimeout(n),n=setTimeout((function(){return e.apply(null,r)}),t)}},u=new a.CloudbaseEventEmitter,l="resolveCaptchaData",p="padding:10px 8px;background:#007bff;color:#fff;border:none;border-radius:4px;cursor:pointer;flex:1;white-space:nowrap;margin-left:10px",d="width:100%;padding:10px;background:#007bff;color:#fff;border:none;border-radius:4px;cursor:pointer",h="background:#6c757d;cursor:not-allowed";t.openURIWithCallback=function(e,t){return o(void 0,void 0,Promise,(function(){var n,a,f,m;return i(this,(function(v){return n=(0,s.parseCaptcha)(e),a=n.captchaData,f=n.state,m=n.token,function(e){var t=e.oauthInstance,n=e.captchaState,a="captcha-image",s=function(){return o(void 0,void 0,void 0,(function(){var e,o;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,t.createCaptchaData({state:n.state})];case 1:return e=i.sent(),n=r(r({},n),{captchaData:e.data,token:e.token}),document.getElementById(a).src=e.data,[3,3];case 2:return o=i.sent(),console.error("刷新图形验证码失败",o),[3,3];case 3:return[2]}}))}))},f=function(e,t,n){var r=document.createElement(e);return t&&(r.style.cssText=t),n&&(r.textContent=n),r},m=f("div","position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.5);z-index:999"),v=f("div","position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:320px;padding:20px;background:#fff;border-radius:8px;box-shadow:0 0 10px rgba(0,0,0,0.2);z-index:1000");v.appendChild(f("p","margin-bottom:15px","请输入你看到的字符:"));var g=f("div","display:flex;align-items:center;justify-content:space-between;margin-bottom:15px"),b=f("img","width:100%;height:auto;border:1px solid #eee");b.id=a,b.src=n.captchaData,g.appendChild(b);var y=f("button",p,"刷新");y.onclick=c((function(){return o(void 0,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:y.textContent="加载中...",y.disabled=!0,y.style.cssText="".concat(p,";").concat(h),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,s()];case 2:return e.sent(),[3,4];case 3:return y.textContent="刷新",y.disabled=!1,y.style.cssText=p,[7];case 4:return[2]}}))}))}),500),g.appendChild(y),v.appendChild(g);var _=f("input","width:100%;padding:14px 16px;margin-bottom:15px;box-sizing:border-box;border:2px solid #e8ecf4;border-radius:10px;font-size:15px");_.type="text",_.placeholder="输入字符",_.maxLength=4,v.appendChild(_);var x=f("div","color:#dc3545;font-size:12px;margin-bottom:10px;display:none;padding:8px;background:#f8d7da;border:1px solid #f5c6cb;border-radius:4px");v.appendChild(x);var w=function(e){x.textContent=e,x.style.display="block"},E=f("button",d,"确定");E.onclick=c((function(){return o(void 0,void 0,void 0,(function(){var e,r,o,a;return i(this,(function(i){switch(i.label){case 0:if(!(e=_.value.trim()))return w("请输入字符"),[2];x.style.display="none",E.textContent="验证中...",E.disabled=!0,E.style.cssText="".concat(d,";").concat(h),i.label=1;case 1:return i.trys.push([1,3,5,6]),[4,t.verifyCaptchaData({token:n.token,key:e})];case 2:return r=i.sent(),u.fire(l,r),console.log("图形验证码校验成功"),document.body.removeChild(m),document.body.removeChild(v),[3,6];case 3:return o=i.sent(),console.error("图形验证码校验失败",o),a=o.error_description||"图形验证码校验失败",w(a),_.value="",_.focus(),[4,s()];case 4:return i.sent(),[3,6];case 5:return E.textContent="确定",E.disabled=!1,E.style.cssText=d,[7];case 6:return[2]}}))}))}),500),v.appendChild(E),document.body.appendChild(m),document.body.appendChild(v)}({oauthInstance:t,captchaState:{captchaData:a,state:f,token:m}}),[2,new Promise((function(e){console.log("等待图形验证码校验结果..."),u.on(l,(function(t){e(null==t?void 0:t.data)}))}))]}))}))}},2962:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Captcha=void 0;var i=n(4949),a=n(5257),s=n(7425),c=n(2084),u=function(){function e(e){e.openURIWithCallback||(e.openURIWithCallback=this.getDefaultOpenURIWithCallback()),e.storage||(e.storage=a.defaultStorage),this.config=e,this.tokenSectionName="captcha_".concat(e.clientId||e.env)}return e.prototype.isMatch=function(){var e,t,n;return(null===(n=null===(t=null===(e=this.config)||void 0===e?void 0:e.adapter)||void 0===t?void 0:t.isMatch)||void 0===n?void 0:n.call(t))||(0,s.isMp)()},e.prototype.request=function(e,t){return r(this,void 0,Promise,(function(){var n,r,a,s;return o(this,(function(o){switch(o.label){case 0:return t||(t={}),t.method||(t.method="GET"),n="".concat(t.method,":").concat(e),r=e,t.withCaptcha?[4,this.appendCaptchaTokenToURL(e,n,!1)]:[3,2];case 1:r=o.sent(),o.label=2;case 2:return o.trys.push([2,4,,7]),[4,this.config.request(r,t)];case 3:return a=o.sent(),[3,7];case 4:return(s=o.sent()).error!==i.ErrorType.CAPTCHA_REQUIRED&&s.error!==i.ErrorType.CAPTCHA_INVALID?[3,6]:[4,this.appendCaptchaTokenToURL(e,n,s.error===i.ErrorType.CAPTCHA_INVALID)];case 5:return e=o.sent(),[2,this.config.request(e,t)];case 6:return[2,Promise.reject(s)];case 7:return[2,a]}}))}))},e.prototype.getDefaultOpenURIWithCallback=function(){var e=this;return function(t){return(0,c.openURIWithCallback)(t,e.config.oauthInstance)}},e.prototype.getCaptchaToken=function(e,t){return r(this,void 0,Promise,(function(){var n,r,a,s;return o(this,(function(o){switch(o.label){case 0:return e?[3,2]:[4,this.findCaptchaToken()];case 1:if(n=o.sent())return[2,n];o.label=2;case 2:return[4,this.config.request(i.ApiUrls.CAPTCHA_DATA_URL,{method:"POST",body:{state:t,redirect_uri:""},withCredentials:!1})];case 3:return r=o.sent(),a="".concat(r.data,"?state=").concat(encodeURIComponent(t),"&token=").concat(encodeURIComponent(r.token)),[4,this.config.openURIWithCallback(a)];case 4:return s=o.sent(),this.saveCaptchaToken(s),[2,s.captcha_token]}}))}))},e.prototype.appendCaptchaTokenToURL=function(e,t,n){return r(this,void 0,Promise,(function(){var r;return o(this,(function(o){switch(o.label){case 0:return[4,this.getCaptchaToken(n,t)];case 1:return r=o.sent(),e.indexOf("?")>0?e+="&captcha_token=".concat(r):e+="?captcha_token=".concat(r),[2,e]}}))}))},e.prototype.saveCaptchaToken=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return e.expires_at=new Date(Date.now()+1e3*(e.expires_in-10)),t=JSON.stringify(e),[4,this.config.storage.setItem(this.tokenSectionName,t)];case 1:return n.sent(),[2]}}))}))},e.prototype.findCaptchaToken=function(){return r(this,void 0,Promise,(function(){var e,t;return o(this,(function(n){switch(n.label){case 0:return[4,this.config.storage.getItem(this.tokenSectionName)];case 1:if(null==(e=n.sent()))return[3,5];n.label=2;case 2:return n.trys.push([2,3,,5]),(null==(t=JSON.parse(e))?void 0:t.expires_at)&&(t.expires_at=new Date(t.expires_at)),t.expires_at<new Date?[2,null]:[2,t.captcha_token];case 3:return n.sent(),[4,this.config.storage.removeItem(this.tokenSectionName)];case 4:return n.sent(),[2,null];case 5:return[2,null]}}))}))},e}();t.Captcha=u},6722:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.CloudbaseOAuth=t.AuthErrorCode=t.AUTH_STATE_CHANGED_TYPE=t.EVENTS=t.LOGIN_STATE_CHANGED_TYPE=t.DEFAULT_NODE_ACCESS_SCOPE=t.OAUTH_TYPE=t.AUTH_API_PREFIX=t.weAppJwtDecodeAll=t.authModels=t.AuthErrorCategory=t.AuthError=t.Auth=void 0;var s=n(5257),c=n(5413),u=n(4949),l=n(5413);Object.defineProperty(t,"Auth",{enumerable:!0,get:function(){return l.Auth}});var p=n(8308);Object.defineProperty(t,"AuthError",{enumerable:!0,get:function(){return p.AuthError}}),Object.defineProperty(t,"AuthErrorCategory",{enumerable:!0,get:function(){return p.AuthErrorCategory}}),t.authModels=a(n(3538));var d=n(2344);Object.defineProperty(t,"weAppJwtDecodeAll",{enumerable:!0,get:function(){return d.weAppJwtDecodeAll}});var h=n(4949);Object.defineProperty(t,"AUTH_API_PREFIX",{enumerable:!0,get:function(){return h.AUTH_API_PREFIX}}),Object.defineProperty(t,"OAUTH_TYPE",{enumerable:!0,get:function(){return h.OAUTH_TYPE}}),Object.defineProperty(t,"DEFAULT_NODE_ACCESS_SCOPE",{enumerable:!0,get:function(){return h.DEFAULT_NODE_ACCESS_SCOPE}}),Object.defineProperty(t,"LOGIN_STATE_CHANGED_TYPE",{enumerable:!0,get:function(){return h.LOGIN_STATE_CHANGED_TYPE}}),Object.defineProperty(t,"EVENTS",{enumerable:!0,get:function(){return h.EVENTS}}),Object.defineProperty(t,"AUTH_STATE_CHANGED_TYPE",{enumerable:!0,get:function(){return h.AUTH_STATE_CHANGED_TYPE}}),Object.defineProperty(t,"AuthErrorCode",{enumerable:!0,get:function(){return h.AuthErrorCode}});var f=function(){function e(e){var t=e.apiOrigin,n=e.getApiOrigin,o=e.apiPath,i=void 0===o?u.AUTH_API_PREFIX:o,a=e.clientId,l=e.env,p=e.storage,d=e.request,h=e.baseRequest,f=e.anonymousSignInFunc,m=e.wxCloud,v=e.adapter,g=e.onCredentialsError,b=e.headers,y=e.i18n,_=e.useWxCloud,x=e.eventBus,w=e.detectSessionInUrl,E=e.debug;if(this.detectSessionInUrl=null!=w&&w,this.oauth2client=new s.OAuth2Client({apiOrigin:t,getApiOrigin:n,apiPath:i,clientId:a,env:l,storage:p,baseRequest:h||d,anonymousSignInFunc:f,wxCloud:m,onCredentialsError:g,headers:b||{},i18n:y,useWxCloud:_,eventBus:x,debug:E}),this.authApi=new c.Auth(r(r({credentialsClient:this.oauth2client},e),{request:d?this.oauth2client.request.bind(this.oauth2client):void 0,adapter:v})),w)this.oauth2client.setGetInitialSession(this.authApi.getInitialSession.bind(this.authApi));else try{var I=new URL(window.location.href),S=I.searchParams.get("code"),O=I.searchParams.get("state"),T=JSON.parse(sessionStorage.getItem(O)||"null");S&&O&&(null==T?void 0:T.hash)&&(I.hash=T.hash,window.history.replaceState(null,"",I.toString()),window.location.replace(I.toString()))}catch(e){}}return e.prototype.initializeSession=function(e){this.detectSessionInUrl?(this.oauth2client.setOnInitialSessionObtained(e),this.oauth2client.initialize()):this.oauth2client.initialize(Promise.resolve({error:null}))},e}();t.CloudbaseOAuth=f},6877:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Syntax=t.ErrorType=void 0;var r,o=n(4949);Object.defineProperty(t,"ErrorType",{enumerable:!0,get:function(){return o.ErrorType}}),(r=t.Syntax||(t.Syntax={})).CLIENT_ID="client_id",r.CLIENT_SECRET="client_secret",r.RESPONSE_TYPE="response_type",r.SCOPE="scope",r.STATE="state",r.REDIRECT_URI="redirect_uri",r.ERROR="error",r.ERROR_DESCRIPTION="error_description",r.ERROR_URI="error_uri",r.GRANT_TYPE="grant_type",r.CODE="code",r.ACCESS_TOKEN="access_token",r.TOKEN_TYPE="token_type",r.EXPIRES_IN="expires_in",r.USERNAME="username",r.PASSWORD="password",r.REFRESH_TOKEN="refresh_token"},5257:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},a=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.OAuth2Client=t.defaultStorage=t.generateRequestId=t.toResponseError=t.defaultRequest=void 0;var s=n(6877),c=n(4949),u=n(873),l=n(2631),p=n(8547),d=n(2344),h=n(7425),f=n(2877),m="x-request-id",v="x-device-id",g="device_id";function b(){return(0,u.uuidv4)()}t.defaultRequest=function(e,t){return o(this,void 0,Promise,(function(){var n,r,o,a,c;return i(this,(function(i){switch(i.label){case 0:n=null,r=null,i.label=1;case 1:return i.trys.push([1,4,,5]),(o=Object.assign({},t)).method||(o.method="GET"),o.body&&"string"!=typeof o.body&&(o.body=JSON.stringify(o.body)),[4,fetch(e,o)];case 2:return[4,i.sent().json()];case 3:return(null==(a=i.sent())?void 0:a.error)?(r=a).error_uri=new URL(e).pathname:n=a,[3,5];case 4:return c=i.sent(),r={error:s.ErrorType.UNREACHABLE,error_description:c.message,error_uri:new URL(e).pathname},[3,5];case 5:if(r)throw r;return[2,n]}}))}))},t.toResponseError=function(e,t){var n,r=t||{};if(e instanceof Error)n={error:r.error||s.ErrorType.LOCAL,error_description:r.error_description||e.message,error_uri:r.error_uri,details:r.details||e.stack};else{var o=e||{};n={error:r.error||o.error||s.ErrorType.LOCAL,error_description:r.error_description||o.error_description,error_uri:r.error_uri||o.error_uri,details:r.details||o.details}}return n},t.generateRequestId=b;var y=function(){function e(e){this._env=(null==e?void 0:e.env)||""}return e.prototype.getItem=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,window.localStorage.getItem("".concat(e).concat(this._env))]}))}))},e.prototype.removeItem=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return window.localStorage.removeItem("".concat(e).concat(this._env)),[2]}))}))},e.prototype.setItem=function(e,t){return o(this,void 0,Promise,(function(){return i(this,(function(n){return window.localStorage.setItem("".concat(e).concat(this._env),t),[2]}))}))},e.prototype.getItemSync=function(e){return window.localStorage.getItem("".concat(e).concat(this._env))},e.prototype.removeItemSync=function(e){window.localStorage.removeItem("".concat(e).concat(this._env))},e.prototype.setItemSync=function(e,t){window.localStorage.setItem("".concat(e).concat(this._env),t)},e}();function _(e){var t=!0;return(null==e?void 0:e.expires_at)&&(null==e?void 0:e.access_token)&&(t=e.expires_at<new Date),t}t.defaultStorage=new y;var x=function(){function e(e){this.credentials=null,this.accessKeyCredentials=null,this.singlePromise=null,this.tokenSectionName=e.tokenSectionName,this.storage=e.storage,this.clientId=e.clientId,this.singlePromise=new p.SinglePromise({clientId:this.clientId}),this.credentials=e.credentials||null}return e.prototype.getStorageCredentialsSync=function(){var e=null,t=this.storage.getItemSync(this.tokenSectionName);if(null!=t)try{(null==(e=JSON.parse(t))?void 0:e.expires_at)&&(e.expires_at=new Date(e.expires_at))}catch(t){this.storage.removeItem(this.tokenSectionName),e=null}return e},e.prototype.setCredentials=function(e){return o(this,void 0,Promise,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return(null==e?void 0:e.expires_in)?((null==e?void 0:e.expires_at)||(e.expires_at=new Date(Date.now()+1e3*(e.expires_in-30))),this.storage?(t=JSON.stringify(e),[4,this.storage.setItem(this.tokenSectionName,t)]):[3,2]):[3,3];case 1:n.sent(),n.label=2;case 2:return this.credentials=e,[3,6];case 3:return this.storage?[4,this.storage.removeItem(this.tokenSectionName)]:[3,5];case 4:n.sent(),n.label=5;case 5:this.credentials=null,n.label=6;case 6:return[2]}}))}))},e.prototype.setAccessKeyCredentials=function(e){this.accessKeyCredentials=e,e.scope===c.DEFAULT_NODE_ACCESS_SCOPE&&(this.credentials=e)},e.prototype.getCredentials=function(){return o(this,void 0,Promise,(function(){var e=this;return i(this,(function(t){return[2,this.singlePromise.run("getCredentials",(function(){return o(e,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return _(this.credentials)?[4,this.getStorageCredentials()]:[3,2];case 1:if(e=n.sent(),t=e.credentials,e.isAccessKeyCredentials)return[2,t];this.credentials=t,n.label=2;case 2:return[2,this.credentials]}}))}))}))]}))}))},e.prototype.getStorageCredentials=function(){return o(this,void 0,Promise,(function(){var e=this;return i(this,(function(t){return[2,this.singlePromise.run("_getStorageCredentials",(function(){return o(e,void 0,void 0,(function(){var e,t,n;return i(this,(function(r){switch(r.label){case 0:return e=null,t=!1,[4,this.storage.getItem(this.tokenSectionName)];case 1:if(!(n=r.sent()))return[3,6];r.label=2;case 2:return r.trys.push([2,3,,5]),(null==(e=JSON.parse(n))?void 0:e.expires_at)&&(e.expires_at=new Date(e.expires_at)),[3,5];case 3:return r.sent(),[4,this.storage.removeItem(this.tokenSectionName)];case 4:return r.sent(),e=null,[3,5];case 5:return[3,7];case 6:e=this.accessKeyCredentials||null,t=!0,r.label=7;case 7:return[2,{credentials:e,isAccessKeyCredentials:t}]}}))}))}))]}))}))},e}();t.OAuth2Client=function(){function e(n){var r,o=this;this.initializePromise=null,this.lockAcquired=!1,this.pendingInLock=[],this.singlePromise=null,n.clientSecret||(n.clientSecret=""),!n.clientId&&n.env&&(n.clientId=n.env),this.apiOrigin=n.apiOrigin,this.getApiOriginFunc=n.getApiOrigin,this.apiPath=n.apiPath||c.AUTH_API_PREFIX,this.clientId=n.clientId,this.i18n=n.i18n,this.eventBus=n.eventBus,this.singlePromise=new p.SinglePromise({clientId:this.clientId}),this.retry=this.formatRetry(n.retry,e.defaultRetry),n.baseRequest?this.baseRequest=n.baseRequest:this.baseRequest=t.defaultRequest,this.tokenInURL=n.tokenInURL,this.headers=n.headers,this.storage=n.storage||t.defaultStorage,this.localCredentials=new x({tokenSectionName:"credentials_".concat(n.clientId),storage:this.storage,clientId:n.clientId}),this.clientSecret=n.clientSecret,n.clientId&&(this.basicAuth="Basic ".concat((0,d.weBtoa)("".concat(n.clientId,":").concat(this.clientSecret)))),this.wxCloud=n.wxCloud;try{(0,h.isMp)()&&(this.useWxCloud=n.useWxCloud,void 0===this.wxCloud&&n.env&&(wx.cloud.init({env:n.env}),this.wxCloud=wx.cloud))}catch(e){}this.refreshTokenFunc=n.refreshTokenFunc||this.defaultRefreshTokenFunc,this.anonymousSignInFunc=n.anonymousSignInFunc,this.onCredentialsError=n.onCredentialsError,this.getInitialSession=n.getInitialSession,this.onInitialSessionObtained=n.onInitialSessionObtained,this.logDebugMessages=null!==(r=n.debug)&&void 0!==r&&r,f.langEvent.bus.on(f.langEvent.LANG_CHANGE_EVENT,(function(e){var t;o.i18n=(null===(t=e.data)||void 0===t?void 0:t.i18n)||o.i18n}))}return e.prototype.setGetInitialSession=function(e){this.getInitialSession=e},e.prototype.setOnInitialSessionObtained=function(e){this.onInitialSessionObtained=e},e.prototype.initialize=function(e){return o(this,void 0,Promise,(function(){var t=this;return i(this,(function(n){switch(n.label){case 0:return this.initializePromise?[4,this.initializePromise]:[3,2];case 1:case 3:case 5:return[2,n.sent()];case 2:return void 0===e?[3,4]:(this.initializePromise=e,[4,this.initializePromise]);case 4:return this.initializePromise=o(t,void 0,void 0,(function(){var e=this;return i(this,(function(t){switch(t.label){case 0:return[4,this._acquireLock(-1,(function(){return o(e,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this._initialize()];case 1:return[2,e.sent()]}}))}))}))];case 1:return[2,t.sent()]}}))})),[4,this.initializePromise]}}))}))},e.prototype.setCredentials=function(e){return o(this,void 0,Promise,(function(){var t=this;return i(this,(function(n){switch(n.label){case 0:return[4,this.initializePromise];case 1:return n.sent(),[2,this._acquireLock(-1,(function(){return o(t,void 0,void 0,(function(){return i(this,(function(t){return[2,this.localCredentials.setCredentials(e)]}))}))}))]}}))}))},e.prototype.setAccessKeyCredentials=function(e){return this.localCredentials.setAccessKeyCredentials(e)},e.prototype.getAccessToken=function(){return o(this,void 0,Promise,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return[4,this.initializePromise];case 1:return n.sent(),[4,this.getCredentials()];case 2:return(null==(e=n.sent())?void 0:e.scope)===c.DEFAULT_NODE_ACCESS_SCOPE||(null==e?void 0:e.access_token)?[2,Promise.resolve(e.access_token)]:(t={error:s.ErrorType.UNAUTHENTICATED},[2,Promise.reject(t)])}}))}))},e.prototype.request=function(t,n){var a,c;return o(this,void 0,Promise,(function(){var o,u,l,p,d,h,f,g,y,_;return i(this,(function(i){switch(i.label){case 0:return n||(n={}),o=this.formatRetry(n.retry,this.retry),n.headers=r(r({},n.headers),((_={})[null===(a=this.i18n)||void 0===a?void 0:a.LANG_HEADER_KEY]=null===(c=this.i18n)||void 0===c?void 0:c.lang,_)),this.headers&&(n.headers=r(r({},this.headers),n.headers)),n.headers[m]||(n.headers[m]=b()),n.headers[v]?[3,2]:[4,this.getDeviceId()];case 1:u=i.sent(),n.headers[v]=u,i.label=2;case 2:return(null==n?void 0:n.withBasicAuth)&&this.basicAuth&&(n.headers.Authorization=this.basicAuth),(null==n?void 0:n.withCredentials)?n.getCredentials?[4,n.getCredentials()]:[3,4]:[3,7];case 3:return p=i.sent(),[3,6];case 4:return[4,this.getCredentials()];case 5:p=i.sent(),i.label=6;case 6:return(l=p)&&(this.tokenInURL?(t.indexOf("?")<0&&(t+="?"),t+="access_token=".concat(l.access_token)):n.headers.Authorization="".concat(l.token_type," ").concat(l.access_token)),[3,8];case 7:this.clientId&&t.indexOf("client_id")<0&&(t+=t.indexOf("?")<0?"?":"&",t+="client_id=".concat(this.clientId)),i.label=8;case 8:t.startsWith("/")&&(d=this.getApiOriginFunc?this.getApiOriginFunc():this.apiOrigin,t="".concat(d).concat(this.apiPath).concat(t)),h=null,f=o+1,g=0,i.label=9;case 9:if(!(g<f))return[3,21];i.label=10;case 10:return i.trys.push([10,15,,18]),n.useWxCloud||this.useWxCloud?[4,this.wxCloudCallFunction(t,n)]:[3,12];case 11:return h=i.sent(),[3,14];case 12:return[4,this.baseRequest(t,n)];case 13:h=i.sent(),i.label=14;case 14:if(null==h?void 0:h.code)throw{error:h.code,error_description:h.message,error_uri:new URL(t).pathname};return[3,21];case 15:y=i.sent();try{y.requestId=y.requestId||n.headers[m]||""}catch(e){}return n.withCredentials&&y&&y.error===s.ErrorType.UNAUTHENTICATED?[4,this.setCredentials(null)]:[3,17];case 16:return i.sent(),[2,Promise.reject(y)];case 17:return g!==o&&y&&"unreachable"===y.error?[3,18]:[2,Promise.reject(y)];case 18:return[4,this.sleep(e.retryInterval)];case 19:i.sent(),i.label=20;case 20:return g++,[3,9];case 21:return[2,h]}}))}))},e.prototype.wxCloudCallFunction=function(e,t){var n;return o(this,void 0,Promise,(function(){var o,a,c,u,p;return i(this,(function(i){switch(i.label){case 0:o=null,a=null,i.label=1;case 1:i.trys.push([1,7,,8]),c="",i.label=2;case 2:return i.trys.push([2,4,,5]),[4,wx.getRendererUserAgent()];case 3:return c=i.sent(),[3,5];case 4:return i.sent(),[3,5];case 5:return[4,this.wxCloud.callFunction({name:"httpOverCallFunction",data:{url:e,method:t.method,headers:r({origin:"https://servicewechat.com","User-Agent":c},t.headers),body:t.body}})];case 6:return u=i.sent().result,(null===(n=null==u?void 0:u.body)||void 0===n?void 0:n.error_code)?(a=null==u?void 0:u.body).error_uri=(0,l.getPathName)(e):o=null==u?void 0:u.body,[3,8];case 7:return p=i.sent(),a={error:s.ErrorType.UNREACHABLE,error_description:p.message,error_uri:(0,l.getPathName)(e)},[3,8];case 8:if(a)throw a;return[2,o]}}))}))},e.prototype.getCredentials=function(){return o(this,void 0,Promise,(function(){var e=this;return i(this,(function(t){switch(t.label){case 0:return[4,this.initializePromise];case 1:return t.sent(),[2,this._acquireLock(-1,(function(){return o(e,void 0,void 0,(function(){return i(this,(function(e){return[2,this._getCredentials()]}))}))}))]}}))}))},e.prototype.getCredentialsSync=function(){return this.localCredentials.getStorageCredentialsSync()},e.prototype.getCredentialsAsync=function(){return this.getCredentials()},e.prototype.getScope=function(){var e;return o(this,void 0,Promise,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:return(t=r.sent())?[2,t.scope]:(n="credentials not found",null===(e=this.onCredentialsError)||void 0===e||e.call(this,{msg:n}),[2,this.unAuthenticatedError(n)])}}))}))},e.prototype.getGroups=function(){var e;return o(this,void 0,Promise,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:return(t=r.sent())?[2,t.groups]:(n="credentials not found",null===(e=this.onCredentialsError)||void 0===e||e.call(this,{msg:n}),[2,this.unAuthenticatedError(n)])}}))}))},e.prototype.refreshToken=function(e,t){return o(this,void 0,Promise,(function(){var n=this;return i(this,(function(r){switch(r.label){case 0:return[4,this.initializePromise];case 1:return r.sent(),[2,this._acquireLock(-1,(function(){return o(n,void 0,void 0,(function(){return i(this,(function(n){return[2,this._refreshToken(e,t)]}))}))}))]}}))}))},e.prototype._refreshToken=function(e,t){return o(this,void 0,Promise,(function(){var n=this;return i(this,(function(r){return[2,this.singlePromise.run("_refreshToken",(function(){return o(n,void 0,void 0,(function(){var n,r,o,a,u,l,p;return i(this,(function(i){switch(i.label){case 0:if((null==e?void 0:e.scope)===c.DEFAULT_NODE_ACCESS_SCOPE)return[2,e];if(!e||!e.refresh_token)return o="no refresh token found in credentials",null===(a=this.onCredentialsError)||void 0===a||a.call(this,{msg:o}),[2,this.unAuthenticatedError(o)];i.label=1;case 1:return i.trys.push([1,4,,7]),[4,this.refreshTokenFunc(e.refresh_token,e)];case 2:return n=i.sent(),[4,this.localCredentials.setCredentials(n)];case 3:return i.sent(),null===(u=this.eventBus)||void 0===u||u.fire(c.EVENTS.AUTH_STATE_CHANGED,{event:c.AUTH_STATE_CHANGED_TYPE.TOKEN_REFRESHED}),[2,n];case 4:if(r=i.sent(),null==t?void 0:t.throwError)throw r;return r.error!==s.ErrorType.INVALID_GRANT?[3,6]:[4,this.localCredentials.setCredentials(null)];case 5:return i.sent(),o=r.error_description,null===(l=this.onCredentialsError)||void 0===l||l.call(this,{msg:o}),[2,this.unAuthenticatedError(o)];case 6:return null===(p=this.onCredentialsError)||void 0===p||p.call(this,{msg:r.error_description}),[2,Promise.reject(r)];case 7:return[2]}}))}))}))]}))}))},e.prototype.anonymousLogin=function(e){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,this.singlePromise.run("_anonymousLogin",(function(){return o(t,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return this.anonymousSignInFunc?[4,this.anonymousSignInFunc(e)]:[3,4];case 1:return t=r.sent(),(n=t)?[3,3]:[4,this.localCredentials.getCredentials()];case 2:n=r.sent(),r.label=3;case 3:return e=n,[3,6];case 4:return[4,this.anonymousSignIn(e)];case 5:e=r.sent(),r.label=6;case 6:return[2,e]}}))}))}))]}))}))},e.prototype.checkRetry=function(t){var n=null;if(("number"!=typeof t||t<e.minRetry||t>e.maxRetry)&&(n={error:s.ErrorType.UNREACHABLE,error_description:"wrong options param: retry"}),n)throw n;return t},e.prototype.formatRetry=function(e,t){return void 0===e?t:this.checkRetry(e)},e.prototype.sleep=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,new Promise((function(t){setTimeout((function(){t()}),e)}))]}))}))},e.prototype.anonymousSignIn=function(e){return o(this,void 0,Promise,(function(){var t=this;return i(this,(function(n){return[2,this.singlePromise.run("_anonymous",(function(){return o(t,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:if(!e||"anonymous"!==e.scope)return[2,this.unAuthenticatedError("no anonymous in credentials")];r.label=1;case 1:return r.trys.push([1,4,,7]),[4,this.request(c.ApiUrls.AUTH_SIGN_IN_ANONYMOUSLY_URL,{method:"POST",withBasicAuth:!0,body:{}})];case 2:return t=r.sent(),[4,this.localCredentials.setCredentials(t)];case 3:return r.sent(),[2,t];case 4:return(n=r.sent()).error!==s.ErrorType.INVALID_GRANT?[3,6]:[4,this.localCredentials.setCredentials(null)];case 5:return r.sent(),[2,this.unAuthenticatedError(n.error_description)];case 6:return[2,Promise.reject(n)];case 7:return[2]}}))}))}))]}))}))},e.prototype.defaultRefreshTokenFunc=function(e,t){var n;return o(this,void 0,Promise,(function(){var o,a,s;return i(this,(function(i){switch(i.label){case 0:return void 0===e||""===e?(o="refresh token not found",null===(n=this.onCredentialsError)||void 0===n||n.call(this,{msg:o}),[2,this.unAuthenticatedError(o)]):(a=c.ApiUrls.AUTH_TOKEN_URL,"v2"===(null==t?void 0:t.version)&&(a=c.ApiUrlsV2.AUTH_TOKEN_URL),[4,this.request(a,{method:"POST",body:{client_id:this.clientId,client_secret:this.clientSecret,grant_type:"refresh_token",refresh_token:e}})]);case 1:return s=i.sent(),[2,r(r({},s),{version:(null==t?void 0:t.version)||"v1"})]}}))}))},e.prototype.getDeviceId=function(){return o(this,void 0,Promise,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return this.deviceID?[2,this.deviceID]:[4,this.storage.getItem(g)];case 1:return"string"==typeof(e=t.sent())&&e.length>=16&&e.length<=48?[3,3]:(e=(0,u.uuidv4)(),[4,this.storage.setItem(g,e)]);case 2:t.sent(),t.label=3;case 3:return this.deviceID=e,[2,e]}}))}))},e.prototype.unAuthenticatedError=function(e){var t={error:s.ErrorType.UNAUTHENTICATED,error_description:e};return Promise.reject(t)},e.prototype._debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logDebugMessages&&console.log.apply(console,a(["[OAuth2Client]"],e,!1))},e.prototype._initialize=function(){return o(this,void 0,Promise,(function(){var e,t,n,r,o,a;return i(this,(function(i){switch(i.label){case 0:if(i.trys.push([0,11,12,13]),!this.getInitialSession)return this._debug("#_initialize()","no getInitialSession callback set, skipping"),[2,{error:null}];this._debug("#_initialize()","calling getInitialSession callback"),i.label=1;case 1:return i.trys.push([1,9,,10]),[4,this.getInitialSession()];case 2:return a=i.sent(),e=a.data,t=a.error,(null==e?void 0:e.session)?(this._debug("#_initialize()","session obtained from getInitialSession",e.session),[4,this.localCredentials.setCredentials(null==e?void 0:e.session)]):[3,4];case 3:i.sent(),i.label=4;case 4:if(!this.onInitialSessionObtained)return[3,8];this._debug("#_initialize()","calling onInitialSessionObtained callback"),i.label=5;case 5:return i.trys.push([5,7,,8]),[4,this.onInitialSessionObtained(e,t)];case 6:return i.sent(),[3,8];case 7:return n=i.sent(),this._debug("#_initialize()","error in onInitialSessionObtained",n),[3,8];case 8:return t?(this._debug("#_initialize()","error from getInitialSession",t),[2,{error:t}]):[2,{error:null}];case 9:return r=i.sent(),this._debug("#_initialize()","exception during getInitialSession",r),[2,{error:r instanceof Error?r:new Error(String(r))}];case 10:return[3,13];case 11:return o=i.sent(),this._debug("#_initialize()","unexpected error",o),[2,{error:o instanceof Error?o:new Error(String(o))}];case 12:return this._debug("#_initialize()","end"),[7];case 13:return[2]}}))}))},e.prototype._acquireLock=function(e,t){return o(this,void 0,Promise,(function(){var n,r,s,c,u=this;return i(this,(function(l){switch(l.label){case 0:this._debug("#_acquireLock","begin",e),l.label=1;case 1:if(l.trys.push([1,,10,11]),this.lockAcquired)return n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),r=o(u,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,n];case 1:return e.sent(),[4,t()];case 2:return[2,e.sent()]}}))})),this.pendingInLock.push(o(u,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,r];case 1:case 2:return e.sent(),[3,3];case 3:return[2]}}))}))),[2,r];this._debug("#_acquireLock","acquiring lock for client",this.clientId),l.label=2;case 2:return l.trys.push([2,,8,9]),this.lockAcquired=!0,s=t(),this.pendingInLock.push(o(u,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,s];case 1:case 2:return e.sent(),[3,3];case 3:return[2]}}))}))),[4,s];case 3:l.sent(),l.label=4;case 4:return this.pendingInLock.length?(c=a([],this.pendingInLock,!0),[4,Promise.all(c)]):[3,6];case 5:return l.sent(),this.pendingInLock.splice(0,c.length),[3,4];case 6:return[4,s];case 7:return[2,l.sent()];case 8:return this._debug("#_acquireLock","releasing lock for client",this.clientId),this.lockAcquired=!1,[7];case 9:return[3,11];case 10:return this._debug("#_acquireLock","end"),[7];case 11:return[2]}}))}))},e.prototype._getCredentials=function(){var e,t,n;return o(this,void 0,Promise,(function(){var r,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:if((null==(r=i.sent())?void 0:r.scope)===c.DEFAULT_NODE_ACCESS_SCOPE)return[2,r];if(!r)return a="credentials not found",null===(e=this.onCredentialsError)||void 0===e||e.call(this,{msg:a}),[2,this.unAuthenticatedError(a)];if(!_(r))return[3,12];if(!r.refresh_token)return[3,9];i.label=2;case 2:return i.trys.push([2,4,,8]),[4,this._refreshToken(r)];case 3:return r=i.sent(),[3,8];case 4:return o=i.sent(),"anonymous"!==r.scope?[3,6]:[4,this.anonymousLogin(r)];case 5:return r=i.sent(),[3,7];case 6:return null===(t=this.onCredentialsError)||void 0===t||t.call(this,{msg:o.error_description}),[2,Promise.reject(o)];case 7:return[3,8];case 8:return[3,12];case 9:return"anonymous"!==r.scope?[3,11]:[4,this.anonymousLogin(r)];case 10:return r=i.sent(),[3,12];case 11:return a="no refresh token found in credentials",null===(n=this.onCredentialsError)||void 0===n||n.call(this,{msg:a}),[2,this.unAuthenticatedError(a)];case 12:return[2,r]}}))}))},e.defaultRetry=2,e.minRetry=0,e.maxRetry=5,e.retryInterval=1e3,e}()},2344:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.weAppJwtDecodeAll=t.weappJwtDecode=t.base64_url_decode=t.weAtob=t.weBtoa=void 0;var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;function o(e){var n=e.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw new Error("Illegal base64url string!")}try{return function(e){return decodeURIComponent((0,t.weAtob)(e).replace(/(.)/g,(function(e){var t=e.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0".concat(t)),"%".concat(t)})))}(n)}catch(e){return(0,t.weAtob)(n)}}t.weBtoa=function(e){for(var t,r,o,i,a="",s=0,c=(e=String(e)).length%3;s<e.length;){if((r=e.charCodeAt(s++))>255||(o=e.charCodeAt(s++))>255||(i=e.charCodeAt(s++))>255)throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");a+=n.charAt((t=r<<16|o<<8|i)>>18&63)+n.charAt(t>>12&63)+n.charAt(t>>6&63)+n.charAt(63&t)}return c?a.slice(0,c-3)+"===".substring(c):a},t.weAtob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!r.test(e))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");var t;e+="==".slice(2-(3&e.length));for(var o,i,a="",s=0;s<e.length;)t=n.indexOf(e.charAt(s++))<<18|n.indexOf(e.charAt(s++))<<12|(o=n.indexOf(e.charAt(s++)))<<6|(i=n.indexOf(e.charAt(s++))),a+=64===o?String.fromCharCode(t>>16&255):64===i?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return a},t.base64_url_decode=o,t.weappJwtDecode=function(e,t){if("string"!=typeof e)throw new Error("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(o(e.split(".")[n]))}catch(e){throw new Error("Invalid token specified: ".concat(e)?e.message:0)}},t.weAppJwtDecodeAll=function(e){if("string"!=typeof e)throw new Error("Invalid token specified");try{var t=e.split(".").map((function(e,t){return 2===t?e:JSON.parse(o(e))}));return{claims:t[1],header:t[0],signature:t[2]}}catch(e){throw new Error("Invalid token specified: ".concat(e)?e.message:0)}}},5814:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getEncryptInfo=void 0;var o=r(n(1012)),i=n(2631);t.getEncryptInfo=function(e){var t=void 0===e?{}:e,n=t.publicKey,r=void 0===n?"":n,a=t.payload,s=void 0===a?{}:a;if(!r)return"";try{var c=(0,i.deepClone)(s),u=new o.default;return u.setPublicKey(r),u.encryptLong("object"==typeof c?JSON.stringify(c):c)}catch(e){console.error("encrypt error:",e)}return""}},8547:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.SinglePromise=void 0;var o=new Map,i=function(){function e(e){this.clientId=(null==e?void 0:e.clientId)||"",o=o||new Map}return e.prototype.run=function(e,t){return n(this,void 0,Promise,(function(){var i,a=this;return r(this,(function(s){return e="".concat(this.clientId,"_").concat(e),(i=o.get(e))||(i=new Promise((function(i,s){n(a,void 0,void 0,(function(){var n,a,c;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,4,5]),[4,this.runIdlePromise()];case 1:return r.sent(),n=t(),a=i,[4,n];case 2:return a.apply(void 0,[r.sent()]),[3,5];case 3:return c=r.sent(),s(c),[3,5];case 4:return o.delete(e),[7];case 5:return[2]}}))}))})),o.set(e,i)),[2,i]}))}))},e.prototype.runIdlePromise=function(){return Promise.resolve()},e}();t.SinglePromise=i},2631:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPathName=t.deepClone=void 0,t.deepClone=function(e){var n=function(n){for(var r in e)e.hasOwnProperty(r)&&(n[r]=(0,t.deepClone)(e[r]));return n},r=null==e?"NullOrUndefined":Object.prototype.toString.call(e).slice(8,-1);if(["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"].includes(r))return e.slice();switch(r){case"Object":return n(Object.create(Object.getPrototypeOf(e)));case"Array":return n([]);case"Date":return new Date(e.valueOf());case"RegExp":return new RegExp(e.source,(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.sticky?"y":"")+(e.unicode?"u":""));default:return e}},t.getPathName=function(e){var t=e.match(/^(?:http(s)?:\/\/[^\/]+)?(\/[^\?#]*)/);return t&&t[2]||""}},7425:(e,t)=>{"use strict";function n(){if("undefined"==typeof globalThis)return!1;var e=globalThis.wx;if(void 0===e)return!1;if(void 0===globalThis.Page)return!1;if(!e.getDeviceInfo)return!1;if(!e.getStorageSync)return!1;if(!e.setStorageSync)return!1;if(!e.connectSocket)return!1;if(!e.request)return!1;try{if(!e.getDeviceInfo())return!1;if("qq"===e.getDeviceInfo().platform)return!1}catch(e){return!1}return!0}Object.defineProperty(t,"__esModule",{value:!0}),t.isInMpWebView=t.isMp=void 0,t.isMp=n;var r=!1;function o(){r=r||void 0!==typeof window&&"miniprogram"===window.__wxjs_environment}try{n()||(r=r||!!navigator.userAgent.match(/miniprogram/i)||"miniprogram"===window.__wxjs_environment,window&&window.WeixinJSBridge&&window.WeixinJSBridge.invoke?o():"undefined"!=typeof document&&document.addEventListener("WeixinJSBridgeReady",o,!1))}catch(e){}t.isInMpWebView=function(){return r}},9639:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){if(this.params={},"string"==typeof e)this.parse(e);else if(e&&"object"==typeof e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.append(t,e[t])}return e.prototype.parse=function(e){var t=this;e.split("&").forEach((function(e){var n=e.split("=").map(decodeURIComponent),r=n[0],o=n[1];t.append(r,o)}))},e.prototype.append=function(e,t){this.params[e]?this.params[e]=this.params[e].concat([t]):this.params[e]=[t]},e.prototype.get=function(e){return this.params[e]?this.params[e][0]:null},e.prototype.getAll=function(e){return this.params[e]||[]},e.prototype.delete=function(e){delete this.params[e]},e.prototype.has=function(e){return Object.prototype.hasOwnProperty.call(this.params,e)},e.prototype.set=function(e,t){this.params[e]=[t]},e.prototype.toString=function(){var e=[],t=function(t){Object.prototype.hasOwnProperty.call(n.params,t)&&n.params[t].forEach((function(n){e.push("".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(n)))}))},n=this;for(var r in this.params)t(r);return e.join("&")},e}();t.default=n},873:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uuidv4=void 0,t.uuidv4=function(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}},6511:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setRuntime=t.getRuntime=t.setWsClass=t.getWsClass=void 0;var n=null,r="web";t.getWsClass=function(){return n},t.setWsClass=function(e){n=e},t.getRuntime=function(){return r},t.setRuntime=function(e){r=e}},2917:function(e,t){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ERR_CODE=t.CloudSDKError=t.isCancelledError=t.CancelledError=t.isTimeoutError=t.TimeoutError=t.isRealtimeErrorMessageError=t.RealtimeErrorMessageError=void 0;var o=function(e){function t(t){var n=e.call(this,"Watch Error ".concat(JSON.stringify(t.msgData)," (requestid: ").concat(t.requestId,")"))||this;return n.isRealtimeErrorMessageError=!0,n.payload=t,n}return r(t,e),t}(Error);t.RealtimeErrorMessageError=o,t.isRealtimeErrorMessageError=function(e){return null==e?void 0:e.isRealtimeErrorMessageError};var i=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="timeout",t.payload=null,t.generic=!0,t}return r(t,e),t}(Error);t.TimeoutError=i,t.isTimeoutError=function(e){return"timeout"===e.type};var a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="cancelled",t.payload=null,t.generic=!0,t}return r(t,e),t}(Error);t.CancelledError=a,t.isCancelledError=function(e){return"cancelled"===e.type};var s=function(e){function n(n){var r=e.call(this,n.errMsg)||this;return r.errCode="UNKNOWN_ERROR",Object.defineProperties(r,{message:{get:function(){return"errCode: ".concat(this.errCode," ").concat(t.ERR_CODE[this.errCode]||""," | errMsg: ").concat(this.errMsg)},set:function(e){this.errMsg=e}}}),r.errCode=n.errCode||"UNKNOWN_ERROR",r.errMsg=n.errMsg,r}return r(n,e),Object.defineProperty(n.prototype,"message",{get:function(){return"errCode: ".concat(this.errCode," | errMsg: ").concat(this.errMsg)},set:function(e){this.errMsg=e},enumerable:!1,configurable:!0}),n}(Error);t.CloudSDKError=s,t.ERR_CODE={UNKNOWN_ERROR:"UNKNOWN_ERROR",SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_CLOSE_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_CLOSE_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_SERVER_ERROR_MSG:"SDK_DATABASE_REALTIME_LISTENER_SERVER_ERROR_MSG",SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA:"SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA",SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR:"SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR",SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED:"SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED",SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL:"SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL",SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR:"SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR"}},7209:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerRealtime=void 0;var r=n(2347),o=n(6511),i={target:"database",entity:function(){var e=this.platform,t=e.adapter,n=e.runtime;(0,o.setWsClass)(t.wsClass),(0,o.setRuntime)(n)}},a={name:"realtime",IIFE:!0,entity:function(){this.prototype.wsClientClass=r.RealtimeWebSocketClient}};try{cloudbase.registerComponent(a),cloudbase.registerHook(i)}catch(e){}t.registerRealtime=function(e){try{e.registerComponent(a),e.registerHook(i)}catch(e){console.warn(e)}}},1601:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RealtimeListener=void 0;t.RealtimeListener=function(e){this.close=e.close,this.onChange=e.onChange,this.onError=e.onError,e.debug&&Object.defineProperty(this,"virtualClient",{get:function(){return e.virtualClient}})}},3994:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInitEventMessage=t.genRequestId=void 0,t.genRequestId=function(e){return void 0===e&&(e=""),"".concat(e?"".concat(e,"_"):"").concat(+new Date,"_").concat(Math.random())},t.isInitEventMessage=function(e){return"INIT_EVENT"===e.msgType}},9770:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Snapshot=void 0;t.Snapshot=function(e){var t,n,r=e.id,o=e.docChanges,i=e.docs,a=e.msgType,s=e.type;Object.defineProperties(this,{id:{get:function(){return r},enumerable:!0},docChanges:{get:function(){return t||(t=JSON.parse(JSON.stringify(o))),t},enumerable:!0},docs:{get:function(){return n||(n=JSON.parse(JSON.stringify(i))),n},enumerable:!0},msgType:{get:function(){return a},enumerable:!0},type:{get:function(){return s},enumerable:!0}})}},7589:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sleep=void 0,t.sleep=function(e){return void 0===e&&(e=0),new Promise((function(t){return setTimeout(t,e)}))}},4151:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VirtualWebSocketClient=void 0;var s,c=a(n(6765)),u=a(n(7195)),l=a(n(9850)),p=n(3994),d=n(1601),h=n(9770),f=n(2917),m=n(7589);!function(e){e.LOGGINGIN="LOGGINGIN",e.INITING="INITING",e.REBUILDING="REBUILDING",e.ACTIVE="ACTIVE",e.ERRORED="ERRORED",e.CLOSING="CLOSING",e.CLOSED="CLOSED",e.PAUSED="PAUSED",e.RESUMING="RESUMING"}(s||(s={}));var v=function(){function e(e){var t=this;this.watchStatus=s.INITING,this.wsLogin=function(e,n){return r(t,void 0,Promise,(function(){var t;return o(this,(function(r){switch(r.label){case 0:return this.watchStatus=s.LOGGINGIN,[4,this.login(e,n)];case 1:return t=r.sent(),this.envId||(this.envId=t.envId),[2,t]}}))}))},this.initWatch=function(e){return r(t,void 0,Promise,(function(){var t,n=this;return o(this,(function(i){switch(i.label){case 0:if(null!==this.initWatchPromise&&void 0!==this.initWatchPromise)return[2,this.initWatchPromise];this.initWatchPromise=new Promise((function(t,i){r(n,void 0,void 0,(function(){var n,r,a,c,u,l,d,f,m,v;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),this.watchStatus===s.PAUSED?(console.log("[realtime] initWatch cancelled on pause"),[2,t()]):[4,this.wsLogin(this.envId,e)];case 1:return n=o.sent().envId,this.watchStatus===s.PAUSED?(console.log("[realtime] initWatch cancelled on pause"),[2,t()]):(this.watchStatus=s.INITING,r={watchId:this.watchId,requestId:(0,p.genRequestId)(),msgType:"INIT_WATCH",msgData:{envId:n,collName:this.collectionName,query:this.query,limit:this.limit,orderBy:this.orderBy}},[4,this.send({msg:r,waitResponse:!0,skipOnMessage:!0,timeout:1e4})]);case 2:if(a=o.sent(),c=a.msgData,u=c.events,l=c.currEvent,this.sessionInfo={queryID:a.msgData.queryID,currentEventId:l-1,currentDocs:[]},u.length>0){for(d=0,f=u;d<f.length;d++)f[d].ID=l;this.handleServerEvents(a)}else this.sessionInfo.currentEventId=l,m=new h.Snapshot({id:l,docChanges:[],docs:[],type:"init"}),this.listener.onChange(m),this.scheduleSendACK();return this.onWatchStart(this,this.sessionInfo.queryID),this.watchStatus=s.ACTIVE,this.availableRetries.INIT_WATCH=2,t(),[3,4];case 3:return v=o.sent(),this.handleWatchEstablishmentError(v,{operationName:"INIT_WATCH",resolve:t,reject:i}),[3,4];case 4:return[2]}}))}))})),t=!1,i.label=1;case 1:return i.trys.push([1,,3,4]),[4,this.initWatchPromise];case 2:return i.sent(),t=!0,[3,4];case 3:return this.initWatchPromise=void 0,[7];case 4:return console.log("[realtime] initWatch ".concat(t?"success":"fail")),[2]}}))}))},this.rebuildWatch=function(e){return r(t,void 0,Promise,(function(){var t,n=this;return o(this,(function(i){switch(i.label){case 0:if(null!==this.rebuildWatchPromise&&void 0!==this.rebuildWatchPromise)return[2,this.rebuildWatchPromise];this.rebuildWatchPromise=new Promise((function(t,i){r(n,void 0,void 0,(function(){var n,r,a,c;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),this.watchStatus===s.PAUSED?(console.log("[realtime] rebuildWatch cancelled on pause"),[2,t()]):[4,this.wsLogin(this.envId,e)];case 1:if(n=o.sent().envId,!this.sessionInfo)throw new Error("can not rebuildWatch without a successful initWatch (lack of sessionInfo)");return this.watchStatus===s.PAUSED?(console.log("[realtime] rebuildWatch cancelled on pause"),[2,t()]):(this.watchStatus=s.REBUILDING,r={watchId:this.watchId,requestId:(0,p.genRequestId)(),msgType:"REBUILD_WATCH",msgData:{envId:n,collName:this.collectionName,queryID:this.sessionInfo.queryID,eventID:this.sessionInfo.currentEventId}},[4,this.send({msg:r,waitResponse:!0,skipOnMessage:!1,timeout:1e4})]);case 2:return a=o.sent(),this.handleServerEvents(a),this.watchStatus=s.ACTIVE,this.availableRetries.REBUILD_WATCH=2,t(),[3,4];case 3:return c=o.sent(),this.handleWatchEstablishmentError(c,{operationName:"REBUILD_WATCH",resolve:t,reject:i}),[3,4];case 4:return[2]}}))}))})),t=!1,i.label=1;case 1:return i.trys.push([1,,3,4]),[4,this.rebuildWatchPromise];case 2:return i.sent(),t=!0,[3,4];case 3:return this.rebuildWatchPromise=void 0,[7];case 4:return console.log("[realtime] rebuildWatch ".concat(t?"success":"fail")),[2]}}))}))},this.handleWatchEstablishmentError=function(e,n){return r(t,void 0,void 0,(function(){var t,i,a,c=this;return o(this,(function(u){return t="INIT_WATCH"===n.operationName,i=function(){c.closeWithError(new f.CloudSDKError({errCode:t?f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL,errMsg:e})),n.reject(e)},a=function(e){c.useRetryTicket(n.operationName)?t?(c.initWatchPromise=void 0,n.resolve(c.initWatch(e))):(c.rebuildWatchPromise=void 0,n.resolve(c.rebuildWatch(e))):i()},this.handleCommonError(e,{onSignError:function(){return a(!0)},onTimeoutError:function(){return a(!1)},onNotRetryableError:i,onCancelledError:n.reject,onUnknownError:function(){r(c,void 0,void 0,(function(){var e,t=this;return o(this,(function(i){switch(i.label){case 0:return i.trys.push([0,8,,9]),e=function(){return r(t,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return this.pause(),[4,this.onceWSConnected()];case 1:return e.sent(),a(!0),[2]}}))}))},this.isWSConnected()?[3,2]:[4,e()];case 1:return i.sent(),[3,7];case 2:return[4,(0,m.sleep)(100)];case 3:return i.sent(),this.watchStatus!==s.PAUSED?[3,4]:(n.reject(new f.CancelledError("".concat(n.operationName," cancelled due to pause after unknownError"))),[3,7]);case 4:return this.isWSConnected()?[3,6]:[4,e()];case 5:return i.sent(),[3,7];case 6:a(!1),i.label=7;case 7:return[3,9];case 8:return i.sent(),a(!0),[3,9];case 9:return[2]}}))}))}}),[2]}))}))},this.closeWatch=function(){return r(t,void 0,void 0,(function(){var e,t,n;return o(this,(function(r){switch(r.label){case 0:if(e=this.sessionInfo?this.sessionInfo.queryID:"",this.watchStatus!==s.ACTIVE)return this.watchStatus=s.CLOSED,this.onWatchClose(this,e),[2];r.label=1;case 1:return r.trys.push([1,3,4,5]),this.watchStatus=s.CLOSING,t={watchId:this.watchId,requestId:(0,p.genRequestId)(),msgType:"CLOSE_WATCH",msgData:null},[4,this.send({msg:t})];case 2:return r.sent(),this.sessionInfo=void 0,this.watchStatus=s.CLOSED,[3,5];case 3:return n=r.sent(),this.closeWithError(new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_CLOSE_WATCH_FAIL,errMsg:n})),[3,5];case 4:return this.onWatchClose(this,e),[7];case 5:return[2]}}))}))},this.scheduleSendACK=function(){t.clearACKSchedule(),t.ackTimeoutId=setTimeout((function(){t.waitExpectedTimeoutId?t.scheduleSendACK():t.sendACK()}),1e4)},this.clearACKSchedule=function(){t.ackTimeoutId&&clearTimeout(t.ackTimeoutId)},this.sendACK=function(){return r(t,void 0,Promise,(function(){var e,t,n;return o(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this.watchStatus!==s.ACTIVE?(this.scheduleSendACK(),[2]):this.sessionInfo?(e={watchId:this.watchId,requestId:(0,p.genRequestId)(),msgType:"CHECK_LAST",msgData:{queryID:this.sessionInfo.queryID,eventID:this.sessionInfo.currentEventId}},[4,this.send({msg:e})]):(console.warn("[realtime listener] can not send ack without a successful initWatch (lack of sessionInfo)"),[2]);case 1:return r.sent(),this.scheduleSendACK(),[3,3];case 2:if(t=r.sent(),(0,f.isRealtimeErrorMessageError)(t))switch((n=t.payload).msgData.code){case"CHECK_LOGIN_FAILED":case"SIGN_EXPIRED_ERROR":case"SIGN_INVALID_ERROR":case"SIGN_PARAM_INVALID":return this.rebuildWatch(),[2];case"QUERYID_INVALID_ERROR":case"SYS_ERR":case"INVALIID_ENV":case"COLLECTION_PERMISSION_DENIED":return this.closeWithError(new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL,errMsg:n.msgData.code})),[2]}return this.availableRetries.CHECK_LAST&&this.availableRetries.CHECK_LAST>0?(this.availableRetries.CHECK_LAST-=1,this.scheduleSendACK()):this.closeWithError(new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL,errMsg:t})),[3,3];case 3:return[2]}}))}))},this.handleCommonError=function(e,t){if((0,f.isRealtimeErrorMessageError)(e))switch(e.payload.msgData.code){case"CHECK_LOGIN_FAILED":case"SIGN_EXPIRED_ERROR":case"SIGN_INVALID_ERROR":case"SIGN_PARAM_INVALID":return void t.onSignError(e);default:return void t.onNotRetryableError(e)}else{if((0,f.isTimeoutError)(e))return void t.onTimeoutError(e);if((0,f.isCancelledError)(e))return void t.onCancelledError(e)}t.onUnknownError(e)},this.watchId="watchid_".concat(+new Date,"_").concat(Math.random()),this.envId=e.envId,this.collectionName=e.collectionName,this.query=e.query,this.limit=e.limit,this.orderBy=e.orderBy,this.send=e.send,this.login=e.login,this.isWSConnected=e.isWSConnected,this.onceWSConnected=e.onceWSConnected,this.getWaitExpectedTimeoutLength=e.getWaitExpectedTimeoutLength,this.onWatchStart=e.onWatchStart,this.onWatchClose=e.onWatchClose,this.debug=e.debug,this.availableRetries={INIT_WATCH:2,REBUILD_WATCH:2,CHECK_LAST:2},this.listener=new d.RealtimeListener({close:function(){t.closeWatch()},onChange:e.onChange,onError:e.onError,debug:this.debug,virtualClient:this}),this.initWatch()}return e.prototype.onMessage=function(e){var t=this;switch(this.watchStatus){case s.PAUSED:if("ERROR"!==e.msgType)return;break;case s.LOGGINGIN:case s.INITING:case s.REBUILDING:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received while ".concat(this.watchStatus));case s.CLOSED:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received when the watch has closed");case s.ERRORED:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received when the watch has ended with error")}if(this.sessionInfo)switch(this.scheduleSendACK(),e.msgType){case"NEXT_EVENT":console.warn("nextevent ".concat(e.msgData.currEvent," ignored"),e),this.handleServerEvents(e);break;case"CHECK_EVENT":this.sessionInfo.currentEventId<e.msgData.currEvent&&(this.sessionInfo.expectEventId=e.msgData.currEvent,this.clearWaitExpectedEvent(),this.waitExpectedTimeoutId=setTimeout((function(){t.rebuildWatch()}),this.getWaitExpectedTimeoutLength()),console.log("[realtime] waitExpectedTimeoutLength ".concat(this.getWaitExpectedTimeoutLength())));break;case"ERROR":this.closeWithError(new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_SERVER_ERROR_MSG,errMsg:"".concat(e.msgData.code," - ").concat(e.msgData.message)}));break;default:console.warn("[realtime listener] virtual client receive unexpected msg ".concat(e.msgType,": "),e)}else console.warn("[realtime listener] internal non-fatal error: sessionInfo not found while message is received.")},e.prototype.closeWithError=function(e){var t;this.watchStatus=s.ERRORED,this.clearACKSchedule(),this.listener.onError(e),this.onWatchClose(this,(null===(t=this.sessionInfo)||void 0===t?void 0:t.queryID)||""),console.log("[realtime] client closed (".concat(this.collectionName," ").concat(this.query,") (watchId ").concat(this.watchId,")"))},e.prototype.pause=function(){this.watchStatus=s.PAUSED,console.log("[realtime] client paused (".concat(this.collectionName," ").concat(this.query,") (watchId ").concat(this.watchId,")"))},e.prototype.resume=function(){return r(this,void 0,Promise,(function(){var e;return o(this,(function(t){switch(t.label){case 0:this.watchStatus=s.RESUMING,console.log("[realtime] client resuming with ".concat(this.sessionInfo?"REBUILD_WATCH":"INIT_WATCH"," (").concat(this.collectionName," ").concat(this.query,") (").concat(this.watchId,")")),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.sessionInfo?this.rebuildWatch():this.initWatch()];case 2:return t.sent(),console.log("[realtime] client successfully resumed (".concat(this.collectionName," ").concat(this.query,") (").concat(this.watchId,")")),[3,4];case 3:return e=t.sent(),console.error("[realtime] client resume failed (".concat(this.collectionName," ").concat(this.query,") (").concat(this.watchId,")"),e),[3,4];case 4:return[2]}}))}))},e.prototype.useRetryTicket=function(e){return!!(this.availableRetries[e]&&this.availableRetries[e]>0)&&(this.availableRetries[e]-=1,console.log("[realtime] ".concat(e," use a retry ticket, now only ").concat(this.availableRetries[e]," retry left")),!0)},e.prototype.handleServerEvents=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.scheduleSendACK(),[4,this.handleServerEventsInternel(e)];case 1:return n.sent(),this.postHandleServerEventsValidityCheck(e),[3,3];case 2:throw t=n.sent(),console.error("[realtime listener] internal non-fatal error: handle server events failed with error: ",t),t;case 3:return[2]}}))}))},e.prototype.handleServerEventsInternel=function(e){return r(this,void 0,void 0,(function(){var t,n,r,a,s,p,d,m,v,b,y,_;return o(this,(function(x){switch(x.label){case 0:if(t=e.requestId,n=e.msgData.events,r=e.msgType,!n.length||!this.sessionInfo)return[2];a=this.sessionInfo;try{s=n.map(g)}catch(e){return this.closeWithError(new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA,errMsg:e})),[2]}p=i([],a.currentDocs,!0),d=!1,m=function(n,m){var g,b,y,_,x,w,E,I,S,O,T,A;return o(this,(function(o){switch(o.label){case 0:return g=s[n],a.currentEventId>=g.id?(!s[n-1]||g.id>s[n-1].id?console.warn("[realtime] duplicate event received, cur ".concat(a.currentEventId," but got ").concat(g.id)):console.error("[realtime listener] server non-fatal error: events out of order (the latter event's id is smaller than that of the former) (requestId ".concat(t,")")),[2,"continue"]):[3,1];case 1:if(a.currentEventId!==g.id-1)return[3,2];switch(g.dataType){case"update":if(!g.doc)switch(g.queueType){case"update":case"dequeue":if(b=p.find((function(e){return e._id===g.docId})),b){if(y=(0,l.default)(b),g.updatedFields&&Object.keys(g.updatedFields).forEach((function(e){(0,c.default)(y,e,g.updatedFields[e])})),g.removedFields)for(_=0,x=g.removedFields;_<x.length;_++)w=x[_],(0,u.default)(y,w);g.doc=y}else console.error("[realtime listener] internal non-fatal server error: unexpected update dataType event where no doc is associated.");break;case"enqueue":throw I=new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="update" and queueType="enqueue" (requestId '.concat(e.requestId,")")}),v.closeWithError(I),I}break;case"replace":if(!g.doc)throw I=new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="replace" (requestId '.concat(e.requestId,")")}),v.closeWithError(I),I;break;case"remove":(E=p.find((function(e){return e._id===g.docId})))?g.doc=E:console.error("[realtime listener] internal non-fatal server error: unexpected remove event where no doc is associated.");break;case"limit":if(!g.doc)switch(g.queueType){case"dequeue":(E=p.find((function(e){return e._id===g.docId})))?g.doc=E:console.error("[realtime listener] internal non-fatal server error: unexpected limit dataType event where no doc is associated.");break;case"enqueue":throw I=new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="limit" and queueType="enqueue" (requestId '.concat(e.requestId,")")}),v.closeWithError(I),I}}switch(g.queueType){case"init":d?p.push(g.doc):(d=!0,p=[g.doc]);break;case"enqueue":p.push(g.doc);break;case"dequeue":S=p.findIndex((function(e){return e._id===g.docId})),S>-1?p.splice(S,1):console.error("[realtime listener] internal non-fatal server error: unexpected dequeue event where no doc is associated.");break;case"update":S=p.findIndex((function(e){return e._id===g.docId})),S>-1?p[S]=g.doc:console.error("[realtime listener] internal non-fatal server error: unexpected queueType update event where no doc is associated.")}return(n===m-1||s[n+1]&&s[n+1].id!==g.id)&&(O=i([],p,!0),T=s.slice(0,n+1).filter((function(e){return e.id===g.id})),v.sessionInfo.currentEventId=g.id,v.sessionInfo.currentDocs=p,A=new h.Snapshot({id:g.id,docChanges:T,docs:O,msgType:r}),v.listener.onChange(A)),[3,4];case 2:return console.warn("[realtime listener] event received is out of order, cur ".concat(v.sessionInfo.currentEventId," but got ").concat(g.id)),[4,v.rebuildWatch()];case 3:return o.sent(),[2,{value:void 0}];case 4:return[2]}}))},v=this,b=0,y=s.length,x.label=1;case 1:return b<y?[5,m(b,y)]:[3,4];case 2:if("object"==typeof(_=x.sent()))return[2,_.value];x.label=3;case 3:return b++,[3,1];case 4:return[2]}}))}))},e.prototype.postHandleServerEventsValidityCheck=function(e){this.sessionInfo?(this.sessionInfo.expectEventId&&this.sessionInfo.currentEventId>=this.sessionInfo.expectEventId&&this.clearWaitExpectedEvent(),this.sessionInfo.currentEventId<e.msgData.currEvent&&console.warn("[realtime listener] internal non-fatal error: client eventId does not match with server event id after server event handling")):console.error("[realtime listener] internal non-fatal error: sessionInfo lost after server event handling, this should never occur")},e.prototype.clearWaitExpectedEvent=function(){this.waitExpectedTimeoutId&&(clearTimeout(this.waitExpectedTimeoutId),this.waitExpectedTimeoutId=void 0)},e}();function g(e){var t={id:e.ID,dataType:e.DataType,queueType:e.QueueType,docId:e.DocID,doc:e.Doc&&"{}"!==e.Doc?JSON.parse(e.Doc):void 0};return"update"===e.DataType&&(e.UpdatedFields&&(t.updatedFields=JSON.parse(e.UpdatedFields)),(e.removedFields||e.RemovedFields)&&(t.removedFields=JSON.parse(e.removedFields))),t}t.VirtualWebSocketClient=v},2347:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.RealtimeWebSocketClient=void 0;var a=n(4151),s=n(3994),c=n(636),u=n(2917),l=n(6511),p=n(7589),d=function(){function e(e){var t=this;this.virtualWSClient=new Set,this.queryIdClientMap=new Map,this.watchIdClientMap=new Map,this.pingFailed=0,this.pongMissed=0,this.logins=new Map,this.wsReadySubsribers=[],this.wsResponseWait=new Map,this.rttObserved=[],this.send=function(e){return o(t,void 0,Promise,(function(){var t=this;return i(this,(function(n){return[2,new Promise((function(n,r){o(t,void 0,void 0,(function(){var t,a,s,c,l,d,h,f,m=this;return i(this,(function(v){switch(v.label){case 0:a=!1,s=!1,c=function(e){a=!0,t&&clearTimeout(t),n(e)},l=function(e){s=!0,t&&clearTimeout(t),r(e)},e.timeout&&(t=setTimeout((function(){o(m,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return a&&s?[3,2]:[4,(0,p.sleep)(0)];case 1:e.sent(),a&&s||l(new u.TimeoutError("wsclient.send timedout")),e.label=2;case 2:return[2]}}))}))}),e.timeout)),v.label=1;case 1:return v.trys.push([1,8,,9]),void 0===this.wsInitPromise&&null===this.wsInitPromise?[3,3]:[4,this.wsInitPromise];case 2:v.sent(),v.label=3;case 3:if(!this.ws)return l(new Error("invalid state: ws connection not exists, can not send message")),[2];if(1!==this.ws.readyState)return l(new Error("ws readyState invalid: ".concat(this.ws.readyState,", can not send message"))),[2];e.waitResponse&&(d={resolve:c,reject:l,skipOnMessage:e.skipOnMessage},this.wsResponseWait.set(e.msg.requestId,d)),v.label=4;case 4:return v.trys.push([4,6,,7]),[4,this.ws.send(JSON.stringify(e.msg))];case 5:return v.sent(),e.waitResponse||c(void 0),[3,7];case 6:return(h=v.sent())&&(l(h),e.waitResponse&&this.wsResponseWait.delete(e.msg.requestId)),[3,7];case 7:return[3,9];case 8:return f=v.sent(),l(f),[3,9];case 9:return[2]}}))}))}))]}))}))},this.closeAllClients=function(e){t.virtualWSClient.forEach((function(t){t.closeWithError(e)}))},this.pauseClients=function(e){(e||t.virtualWSClient).forEach((function(e){e.pause()}))},this.resumeClients=function(e){(e||t.virtualWSClient).forEach((function(e){e.resume()}))},this.initWebSocketConnection=function(e,n){return void 0===n&&(n=t.maxReconnect),o(t,void 0,Promise,(function(){var t=this;return i(this,(function(r){switch(r.label){case 0:if(e&&this.reconnectState)return[2];if(e&&(this.reconnectState=!0),void 0!==this.wsInitPromise&&null!==this.wsInitPromise)return[2,this.wsInitPromise];e&&this.pauseClients(),this.close(c.CloseEventCode.ReconnectWebSocket),this.wsInitPromise=new Promise((function(r,a){o(t,void 0,void 0,(function(){var t,o,s=this;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,6,,11]),[4,this.getWsSign()];case 1:return t=i.sent(),[4,new Promise((function(e){var n=t.wsUrl||"wss://tcb-ws.tencentcloudapi.com",r=(0,l.getWsClass)();s.ws=r?new r(n):new WebSocket(n),e(void 0)}))];case 2:return i.sent(),this.ws.connect?[4,this.ws.connect()]:[3,4];case 3:i.sent(),i.label=4;case 4:return[4,this.initWebSocketEvent()];case 5:return i.sent(),r(),e&&(this.resumeClients(),this.reconnectState=!1),[3,11];case 6:return o=i.sent(),console.error("[realtime] initWebSocketConnection connect fail",o),n>0?(this.wsInitPromise=void 0,[4,(0,p.sleep)(this.reconnectInterval)]):[3,9];case 7:i.sent(),e&&(this.reconnectState=!1),i.label=8;case 8:return r(this.initWebSocketConnection(e,n-1)),[3,10];case 9:a(o),e&&this.closeAllClients(new u.CloudSDKError({errCode:u.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL,errMsg:o})),i.label=10;case 10:return[3,11];case 11:return[2]}}))}))})),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,this.wsInitPromise];case 2:return r.sent(),this.wsReadySubsribers.forEach((function(e){return(0,e.resolve)()})),[3,5];case 3:return r.sent(),this.wsReadySubsribers.forEach((function(e){return(0,e.reject)()})),[3,5];case 4:return this.wsInitPromise=void 0,this.wsReadySubsribers=[],[7];case 5:return[2]}}))}))},this.initWebSocketEvent=function(){return new Promise((function(e,n){if(!t.ws)throw new Error("can not initWebSocketEvent, ws not exists");var r=!1;t.ws.onopen=function(t){console.warn("[realtime] ws event: open",t),r=!0,e()},t.ws.onerror=function(e){t.logins=new Map,r?(console.error("[realtime] ws event: error",e),t.clearHeartbeat(),t.virtualWSClient.forEach((function(t){return t.closeWithError(new u.CloudSDKError({errCode:u.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR,errMsg:e}))}))):(console.error("[realtime] ws open failed with ws event: error",e),n(e))},t.ws.onclose=function(e){switch(console.warn("[realtime] ws event: close",e),t.logins=new Map,t.clearHeartbeat(),e.code){case c.CloseEventCode.ReconnectWebSocket:case c.CloseEventCode.NoRealtimeListeners:break;case c.CloseEventCode.HeartbeatPingError:case c.CloseEventCode.HeartbeatPongTimeoutError:case c.CloseEventCode.NormalClosure:case c.CloseEventCode.AbnormalClosure:t.maxReconnect>0?t.initWebSocketConnection(!0,t.maxReconnect):t.closeAllClients((0,c.getWSCloseError)(e.code));break;case c.CloseEventCode.NoAuthentication:t.closeAllClients((0,c.getWSCloseError)(e.code,e.reason));break;default:t.maxReconnect>0?t.initWebSocketConnection(!0,t.maxReconnect):t.closeAllClients((0,c.getWSCloseError)(e.code))}},t.ws.onmessage=function(e){var n,r,o=(null===(n=e.data)||void 0===n?void 0:n.data)||e.data;t.heartbeat();try{r="string"==typeof o?JSON.parse(o):o}catch(e){throw new Error("[realtime] onMessage parse res.data error: ".concat(e))}if("ERROR"===r.msgType){var i=null;t.virtualWSClient.forEach((function(e){e.watchId===r.watchId&&(i=e)})),i&&i.listener.onError(r)}var a=t.wsResponseWait.get(r.requestId);if(a){try{"ERROR"===r.msgType?a.reject(new u.RealtimeErrorMessageError(r)):a.resolve(r)}catch(e){console.error("ws onMessage responseWaitSpec.resolve(msg) errored:",e)}finally{t.wsResponseWait.delete(r.requestId)}if(a.skipOnMessage)return}if("PONG"!==r.msgType){var s=r.watchId&&t.watchIdClientMap.get(r.watchId);if(s)s.onMessage(r);else switch(console.error("[realtime] no realtime listener found responsible for watchId ".concat(r.watchId,": "),r),r.msgType){case"INIT_EVENT":case"NEXT_EVENT":case"CHECK_EVENT":(s=t.queryIdClientMap.get(r.msgData.queryID))&&s.onMessage(r);break;default:for(var c=0,l=Array.from(t.watchIdClientMap.entries());c<l.length;c++){l[c][1].onMessage(r);break}}}else if(t.lastPingSendTS){var p=Date.now()-t.lastPingSendTS;if(p>1e4)return void console.warn("[realtime] untrusted rtt observed: ".concat(p));t.rttObserved.length>=3&&t.rttObserved.splice(0,t.rttObserved.length-3+1),t.rttObserved.push(p)}},t.heartbeat()}))},this.isWSConnected=function(){return Boolean(t.ws&&1===t.ws.readyState)},this.onceWSConnected=function(){return o(t,void 0,Promise,(function(){var e=this;return i(this,(function(t){return this.isWSConnected()?[2]:null!==this.wsInitPromise&&void 0!==this.wsInitPromise?[2,this.wsInitPromise]:[2,new Promise((function(t,n){e.wsReadySubsribers.push({resolve:t,reject:n})}))]}))}))},this.webLogin=function(e,n){return o(t,void 0,Promise,(function(){var t,r,a,c,u,p,d,h,f=this;return i(this,(function(m){switch(m.label){case 0:if(!n)if(e){if(t=this.logins.get(e)){if(t.loggedIn&&t.loginResult)return[2,t.loginResult];if(null!==t.loggingInPromise&&void 0!==t.loggingInPromise)return[2,t.loggingInPromise]}}else if(null!==(null==(r=this.logins.get(""))?void 0:r.loggingInPromise)&&void 0!==(null==r?void 0:r.loggingInPromise))return[2,r.loggingInPromise];a=new Promise((function(e,t){o(f,void 0,void 0,(function(){var n,r,o,a,c;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.getWsSign()];case 1:return n=i.sent(),r={envId:n.envId||"",accessToken:"",referrer:"web",sdkVersion:"",dataVersion:""},o={watchId:void 0,requestId:(0,s.genRequestId)(),msgType:"LOGIN",msgData:r,exMsgData:{runtime:(0,l.getRuntime)(),signStr:n.signStr,secretVersion:n.secretVersion}},[4,this.send({msg:o,waitResponse:!0,skipOnMessage:!0,timeout:5e3})];case 2:return(a=i.sent()).msgData.code?t(new Error("".concat(a.msgData.code," ").concat(a.msgData.message))):e({envId:n.envId}),[3,4];case 3:return c=i.sent(),t(c),[3,4];case 4:return[2]}}))}))})),c=e&&this.logins.get(e),u=Date.now(),c?(c.loggedIn=!1,c.loggingInPromise=a,c.loginStartTS=u):(c={loggedIn:!1,loggingInPromise:a,loginStartTS:u},this.logins.set(e||"",c)),m.label=1;case 1:return m.trys.push([1,3,,4]),[4,a];case 2:if(p=m.sent(),(d=e&&this.logins.get(e))&&d===c&&d.loginStartTS===u)return c.loggedIn=!0,c.loggingInPromise=void 0,c.loginStartTS=void 0,c.loginResult=p,[2,p];if(d){if(d.loggedIn&&d.loginResult)return[2,d.loginResult];if(null!==d.loggingInPromise&&void 0!==d.loggingInPromise)return[2,d.loggingInPromise];throw new Error("ws unexpected login info")}throw new Error("ws login info reset");case 3:throw h=m.sent(),c.loggedIn=!1,c.loggingInPromise=void 0,c.loginStartTS=void 0,c.loginResult=void 0,h;case 4:return[2]}}))}))},this.getWsSign=function(){return o(t,void 0,Promise,(function(){var e,t,n,r,o,a,s;return i(this,(function(i){switch(i.label){case 0:return this.wsSign&&this.wsSign.expiredTs>Date.now()?[2,this.wsSign]:(e=Date.now()+6e4,[4,this.context.appConfig.request.send("auth.wsWebSign",{runtime:(0,l.getRuntime)()})]);case 1:if((t=i.sent()).code)throw new Error("[tcb-js-sdk] 获取实时数据推送登录票据失败: ".concat(t.code));if(t.data)return n=t.data,r=n.signStr,o=n.wsUrl,a=n.secretVersion,s=n.envId,[2,{signStr:r,wsUrl:o,secretVersion:a,envId:s,expiredTs:e}];throw new Error("[tcb-js-sdk] 获取实时数据推送登录票据失败")}}))}))},this.getWaitExpectedTimeoutLength=function(){return t.rttObserved.length?t.rttObserved.reduce((function(e,t){return e+t}))/t.rttObserved.length*1.5:5e3},this.ping=function(){return o(t,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return e={watchId:void 0,requestId:(0,s.genRequestId)(),msgType:"PING",msgData:null},[4,this.send({msg:e})];case 1:return t.sent(),[2]}}))}))},this.onWatchStart=function(e,n){t.queryIdClientMap.set(n,e)},this.onWatchClose=function(e,n){n&&t.queryIdClientMap.delete(n),t.watchIdClientMap.delete(e.watchId),t.virtualWSClient.delete(e),t.virtualWSClient.size||t.close(c.CloseEventCode.NoRealtimeListeners)},this.maxReconnect=e.maxReconnect||5,this.reconnectInterval=e.reconnectInterval||1e4,this.context=e.context}return e.prototype.clearHeartbeat=function(){this.pingTimeoutId&&clearTimeout(this.pingTimeoutId),this.pongTimeoutId&&clearTimeout(this.pongTimeoutId)},e.prototype.close=function(e){this.clearHeartbeat(),this.ws&&(this.ws.close(e,c.CLOSE_EVENT_CODE_INFO[e].name),this.ws=void 0)},e.prototype.watch=function(e){this.ws||void 0!==this.wsInitPromise&&null!==this.wsInitPromise||this.initWebSocketConnection(!1);var t=new a.VirtualWebSocketClient(r(r({},e),{send:this.send,login:this.webLogin,isWSConnected:this.isWSConnected,onceWSConnected:this.onceWSConnected,getWaitExpectedTimeoutLength:this.getWaitExpectedTimeoutLength,onWatchStart:this.onWatchStart,onWatchClose:this.onWatchClose,debug:!0}));return this.virtualWSClient.add(t),this.watchIdClientMap.set(t.watchId,t),t.listener},e.prototype.heartbeat=function(e){var t=this;this.clearHeartbeat(),this.pingTimeoutId=setTimeout((function(){o(t,void 0,void 0,(function(){var e=this;return i(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),this.ws&&1===this.ws.readyState?(this.lastPingSendTS=Date.now(),[4,this.ping()]):[2];case 1:return t.sent(),this.pingFailed=0,this.pongTimeoutId=setTimeout((function(){console.error("pong timed out"),e.pongMissed<2?(e.pongMissed+=1,e.heartbeat(!0)):e.initWebSocketConnection(!0)}),this.context.appConfig.realtimePongWaitTimeout),[3,3];case 2:return t.sent(),this.pingFailed<2?(this.pingFailed+=1,this.heartbeat()):this.close(c.CloseEventCode.HeartbeatPingError),[3,3];case 3:return[2]}}))}))}),e?0:this.context.appConfig.realtimePingInterval)},e}();t.RealtimeWebSocketClient=d},636:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWSCloseError=t.CloseEventCode=t.CLOSE_EVENT_CODE_INFO=void 0;var r,o=n(2917);t.CLOSE_EVENT_CODE_INFO={1e3:{code:1e3,name:"Normal Closure",description:"Normal closure; the connection successfully completed whatever purpose for which it was created."},1001:{code:1001,name:"Going Away",description:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection."},1002:{code:1002,name:"Protocol Error",description:"The endpoint is terminating the connection due to a protocol error."},1003:{code:1003,name:"Unsupported Data",description:"The connection is being terminated because the endpoint received data of a type it cannot accept (for example, a text-only endpoint received binary data)."},1005:{code:1005,name:"No Status Received",description:"Indicates that no status code was provided even though one was expected."},1006:{code:1006,name:"Abnormal Closure",description:"Used to indicate that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},1007:{code:1007,name:"Invalid frame payload data",description:"The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},1008:{code:1008,name:"Policy Violation",description:"The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},1009:{code:1009,name:"Message too big",description:"The endpoint is terminating the connection because a data frame was received that is too large."},1010:{code:1010,name:"Missing Extension",description:"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},1011:{code:1011,name:"Internal Error",description:"The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."},1012:{code:1012,name:"Service Restart",description:"The server is terminating the connection because it is restarting."},1013:{code:1013,name:"Try Again Later",description:"The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients."},1014:{code:1014,name:"Bad Gateway",description:"The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code."},1015:{code:1015,name:"TLS Handshake",description:"Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."},3e3:{code:3e3,name:"Reconnect WebSocket",description:"The client is terminating the connection because it wants to reconnect"},3001:{code:3001,name:"No Realtime Listeners",description:"The client is terminating the connection because no more realtime listeners exist"},3002:{code:3002,name:"Heartbeat Ping Error",description:"The client is terminating the connection due to its failure in sending heartbeat messages"},3003:{code:3003,name:"Heartbeat Pong Timeout Error",description:"The client is terminating the connection because no heartbeat response is received from the server"},3050:{code:3050,name:"Server Close",description:"The client is terminating the connection because no heartbeat response is received from the server"}},(r=t.CloseEventCode||(t.CloseEventCode={}))[r.NormalClosure=1e3]="NormalClosure",r[r.GoingAway=1001]="GoingAway",r[r.ProtocolError=1002]="ProtocolError",r[r.UnsupportedData=1003]="UnsupportedData",r[r.NoStatusReceived=1005]="NoStatusReceived",r[r.AbnormalClosure=1006]="AbnormalClosure",r[r.InvalidFramePayloadData=1007]="InvalidFramePayloadData",r[r.PolicyViolation=1008]="PolicyViolation",r[r.MessageTooBig=1009]="MessageTooBig",r[r.MissingExtension=1010]="MissingExtension",r[r.InternalError=1011]="InternalError",r[r.ServiceRestart=1012]="ServiceRestart",r[r.TryAgainLater=1013]="TryAgainLater",r[r.BadGateway=1014]="BadGateway",r[r.TLSHandshake=1015]="TLSHandshake",r[r.ReconnectWebSocket=3e3]="ReconnectWebSocket",r[r.NoRealtimeListeners=3001]="NoRealtimeListeners",r[r.HeartbeatPingError=3002]="HeartbeatPingError",r[r.HeartbeatPongTimeoutError=3003]="HeartbeatPongTimeoutError",r[r.NoAuthentication=3050]="NoAuthentication",t.getWSCloseError=function(e,n){var r=t.CLOSE_EVENT_CODE_INFO[e],i=r?"".concat(r.name,", code ").concat(e,", reason ").concat(n||r.description):"code ".concat(e);return new o.CloudSDKError({errCode:o.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED,errMsg:i})}},5891:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.CloudbaseStorage=t.COMPONENT_NAME=t.EUploadMethod=void 0;var c,u=n(2877),l=n(7090),p=n(3388);!function(e){e.put="put",e.post="post"}(c=t.EUploadMethod||(t.EUploadMethod={}));var d=u.constants.getSdkName,h=u.constants.ERRORS,f=u.constants.COMMUNITY_SITE_URL,m=u.utils.isArray,v=u.utils.isString,g=u.utils.isPalinObject,b=u.utils.execCallback,y=u.helpers.catchErrorsDecorator;t.COMPONENT_NAME="storage";var _=function(e,t,n){return a(void 0,void 0,void 0,(function(){var o,i,a;return s(this,(function(s){switch(s.label){case 0:return[4,e.gateWay({path:"storages",name:"get-objects-upload-info",data:[r({objectId:t.path},t.signedHeader?{signedHeader:t.signedHeader}:{})]},n)];case 1:return o=s.sent(),i=(null===(a=o.data)||void 0===a?void 0:a[0])||{},[2,r(r({},o),{data:r(r({},i.code?r({},i):{}),{authorization:i.authorization,token:i.token,url:i.uploadUrl,fileId:i.cloudObjectId,cosFileId:i.cloudObjectMeta,download_url:i.downloadUrl})})]}}))}))},x=function(e,t,n){return a(void 0,void 0,void 0,(function(){var o,i;return s(this,(function(a){switch(a.label){case 0:return[4,e.gateWay({path:"storages",name:"get-objects-download-info",data:t.convertedFileList.map((function(e){return{cloudObjectId:e.fileid}}))},n)];case 1:return o=a.sent(),[2,r(r({},o),{data:{download_list:null===(i=o.data)||void 0===i?void 0:i.map((function(e){return{code:e.code||"SUCCESS",message:e.message,fileid:e.cloudObjectId,download_url:e.downloadUrl,fileID:e.cloudObjectId,tempFileURL:e.downloadUrl}}))}})]}}))}))},w=function(e,t,n){return a(void 0,void 0,void 0,(function(){var o,i;return s(this,(function(a){switch(a.label){case 0:return[4,e.gateWay({path:"storages",name:"delete-objects",data:t.fileList.map((function(e){return{cloudObjectId:e}}))},n)];case 1:return o=a.sent(),[2,r(r({},o),{data:{delete_list:null===(i=o.data)||void 0===i?void 0:i.map((function(e){return{code:e.code||"SUCCESS",fileID:e.cloudObjectId,message:e.message}}))}})]}}))}))},E=function(e,t,n){return a(void 0,void 0,void 0,(function(){var o,i;return s(this,(function(a){switch(a.label){case 0:return[4,e.gateWay({path:"storages",name:"copy-objects",data:t.convertedFileList.map((function(e){return{srcPath:e.src_path,dstPath:e.dst_path,overwrite:e.overwrite,removeOriginal:e.remove_original}}))},n)];case 1:return o=a.sent(),[2,r(r({},o),{data:{copy_list:null===(i=o.data)||void 0===i?void 0:i.map((function(e){return{code:e.code||"SUCCESS",fileID:e.cloudObjectId,message:e.message}}))}})]}}))}))},I={txt:"text/plain",json:"application/json",html:"text/html",htm:"text/html",css:"text/css",js:"application/javascript",csv:"text/csv",xml:"application/xml",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",ico:"image/x-icon",pdf:"application/pdf",zip:"application/zip",gz:"application/gzip",mp4:"video/mp4",webm:"video/webm",mp3:"audio/mpeg",wav:"audio/wav"};function S(e,t){if("undefined"!=typeof Blob&&e instanceof Blob&&e.type)return e.type;var n=/\.([a-zA-Z0-9]+)$/.exec(t||""),r=n?n[1].toLowerCase():"";return I[r]||"application/octet-stream"}function O(e,t){var n=t.toLowerCase();return Object.keys(e).some((function(e){return e.toLowerCase()===n}))}function T(e){return Object.keys(e).reduce((function(t,n){var o;return r(r({},t),((o={})[n]=[e[n]],o))}),{})}t.CloudbaseStorage=function(){function e(e){this.context=e}var n,u,I,A,P,C,R,N,k,j,U,D,L,M,q,B;return Object.defineProperty(e.prototype,"config",{get:function(){var e;return null===(e=this.context)||void 0===e?void 0:e.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){var e;return null===(e=this.context)||void 0===e?void 0:e.request},enumerable:!1,configurable:!0}),e.prototype.isGateWay=function(){return"GATEWAY"===(this.config.endPointMode||"CLOUD_API")},e.prototype.uploadFile=function(e,n){return a(this,void 0,Promise,(function(){var o,i,a,u,p,f,m,g,y,_,x,w,E,I,A,P,C,R,N,k,j,U,D,L,M,q,B,F,W,V,G;return s(this,(function(s){switch(s.label){case 0:if(o=e.cloudPath,i=e.filePath,a=e.onUploadProgress,W=e.method,u=void 0===W?"put":W,V=e.headers,p=void 0===V?{}:V,f=e.fileContent,!v(o)||!i&&!f)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".uploadFile] invalid params")}));return m={put:c.put,post:c.post}[u.toLocaleLowerCase()]||c.put,g=this.isGateWay(),y=r({},p),_=Object.keys(p).reduce((function(e,t){return"content-length"!==t.toLowerCase()&&(e[t]=p[t]),e}),{}),m===c.put&&g&&(O(y,"content-length")||(x=function(e,t){var n=null!=e?e:t;if(null!==n){if("undefined"!=typeof Blob&&n instanceof Blob)return n.size;if("undefined"!=typeof ArrayBuffer){if(n instanceof ArrayBuffer)return n.byteLength;if("function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(n))return n.byteLength}if("string"==typeof n){if("undefined"!=typeof Blob)return new Blob([n]).size;var r=(0,l.getStringByteLength)(n);return"number"==typeof r?r:n.length}return"object"==typeof n&&"number"==typeof n.size?n.size:void 0}}(i,f),"number"==typeof x&&(y["content-length"]=String(x))),O(y,"content-type")||(y["content-type"]=S(i,o)),O(_,"content-type")||(_["content-type"]=S(i,o))),[4,this.getUploadMetadata({cloudPath:o,method:m,headers:m!==c.put||g?void 0:_,signedHeader:m===c.put&&g?T(y):void 0,customReqOpts:e.customReqOpts})];case 1:return w=s.sent(),E=w.data,I=w.requestId,(null==(A=E)?void 0:A.code)||!(null==A?void 0:A.url)?(P=(null==A?void 0:A.code)||h.OPERATION_FAIL,C=(null==A?void 0:A.message)||"get upload info failed",[2,b(n,new Error("[".concat(d(),"][").concat(P,"][").concat(t.COMPONENT_NAME,"]:").concat(C)))]):(R=E.url,N=E.authorization,k=E.token,j=E.fileId,U=E.cosFileId,D=E.download_url,M=r(r({},L={url:R,file:i,name:o,onUploadProgress:a,fileContent:f,fileId:j,requestId:I}),{method:c.put,headers:r(r({},_),{authorization:N,"x-cos-meta-fileid":U,"x-cos-security-token":k})}),q=r(r({},L),{method:c.post,data:{key:o,signature:N,"x-cos-meta-fileid":U,success_action_status:"201","x-cos-security-token":k}}),(G={})[c.put]={params:M,isSuccess:function(e){return e>=200&&e<300}},G[c.post]={params:q,isSuccess:function(e){return 201===e}},B=G,[4,this.request.upload(B[m].params)]);case 2:return F=s.sent(),B[m].isSuccess(F.statusCode)?[2,b(n,null,{fileID:j,download_url:D,requestId:I})]:[2,b(n,new Error("[".concat(d(),"][").concat(h.OPERATION_FAIL,"][").concat(t.COMPONENT_NAME,"]:").concat(F.data)))]}}))}))},e.prototype.getUploadMetadata=function(e,n){return a(this,void 0,Promise,(function(){var r,o,i,a,u,l,p,d,f,m;return s(this,(function(s){switch(s.label){case 0:if(r=e.cloudPath,o=e.method,i=e.headers,a=e.signedHeader,!v(r))throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".getUploadMetadata] invalid cloudPath")}));u=this.request,l="storage.getUploadMetadata",s.label=1;case 1:return s.trys.push([1,6,,7]),p=void 0,d={path:r},f=this.isGateWay(),o&&(d.method=o),o===c.put&&(f&&a?d.signedHeader=a:!f&&i&&(d.headers=i)),f?[4,_(u,d,e.customReqOpts)]:[3,3];case 2:return p=s.sent(),[3,5];case 3:return[4,u.send(l,d,e.customReqOpts)];case 4:p=s.sent(),s.label=5;case 5:return[2,b(n,null,p)];case 6:return m=s.sent(),[2,b(n,m)];case 7:return[2]}}))}))},e.prototype.deleteFile=function(e,n){return a(this,void 0,Promise,(function(){var r,o,i,a,c,u,l,p;return s(this,(function(s){switch(s.label){case 0:if(!(r=e.fileList)||!m(r)||0===r.length)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".deleteFile] fileList must not be empty")}));for(o=0,i=r;o<i.length;o++)if(!(a=i[o])||!v(a))throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".deleteFile] fileID must be string")}));return c="storage.batchDeleteFile",u=this.request,l={},this.isGateWay()?[4,w(u,{fileList:r},e.customReqOpts)]:[3,2];case 1:return l=s.sent(),[3,4];case 2:return[4,u.send(c,{fileid_list:r},e.customReqOpts)];case 3:l=s.sent(),s.label=4;case 4:return l.code?[2,b(n,null,l)]:(p={fileList:l.data.delete_list,requestId:l.requestId},[2,b(n,null,p)])}}))}))},e.prototype.getTempFileURL=function(e,n){return a(this,void 0,Promise,(function(){var r,o,i,a,c,u,l,p;return s(this,(function(s){switch(s.label){case 0:if(!(r=e.fileList)||!m(r)||0===r.length)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".getTempFileURL] fileList must not be empty")}));for(o=[],i=0,a=r;i<a.length;i++)if(c=a[i],g(c)){if(!Object.prototype.hasOwnProperty.call(c,"fileID"))throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".getTempFileURL] file info must include fileID")}));o.push({fileid:c.fileID,max_age:c.maxAge||7200})}else{if(!v(c))throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".getTempFileURL] invalid fileList")}));o.push({fileid:c})}return u="storage.batchGetDownloadUrl",l=this.request,p={},this.isGateWay()?[4,x(l,{convertedFileList:o},e.customReqOpts)]:[3,2];case 1:return p=s.sent(),[3,4];case 2:return[4,l.send(u,{file_list:o},e.customReqOpts)];case 3:p=s.sent(),s.label=4;case 4:return p.code?[2,b(n,null,p)]:[2,b(n,null,{fileList:p.data.download_list,requestId:p.requestId})]}}))}))},e.prototype.downloadFile=function(e,n){return a(this,void 0,Promise,(function(){var r,o,i,a,c,u;return s(this,(function(s){switch(s.label){case 0:if(r=e.fileID,!v(r))throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".getTempFileURL] fileID must be string")}));return[4,this.getTempFileURL.call(this,{fileList:[{fileID:r,maxAge:600}],customReqOpts:e.customReqOpts})];case 1:return o=s.sent(),"SUCCESS"!==(i=o.fileList[0]).code?[2,b(n,i)]:(a=this.request,c=encodeURI(i.download_url),[4,a.download({url:c,tempFilePath:e.tempFilePath})]);case 2:return u=s.sent(),[2,b(n,null,u)]}}))}))},e.prototype.copyFile=function(e,n){return a(this,void 0,Promise,(function(){var r,o,i,a,c,u,l,p,d;return s(this,(function(s){switch(s.label){case 0:if(!(r=e.fileList)||!m(r)||0===r.length)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".copyFile] fileList must not be empty")}));for(o=[],i=0,a=r;i<a.length;i++){if(c=a[i],u=c.srcPath,l=c.dstPath,!u||!l||"string"!=typeof u||"string"!=typeof l)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".copyFile] srcPath and dstPath may not be empty")}));if(u===l)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".copyFile] srcPath and dstPath can not be the same")}));o.push({src_path:u,dst_path:l,overwrite:c.overwrite,remove_original:c.removeOriginal})}return p=this.request,d={},this.isGateWay()?[4,E(p,{convertedFileList:o},e.customReqOpts)]:[3,2];case 1:return d=s.sent(),[3,4];case 2:return[4,p.send("storage.batchCopyFile",{file_list:o},e.customReqOpts)];case 3:d=s.sent(),s.label=4;case 4:return d.code?[2,b(n,null,d)]:[2,b(n,null,{fileList:d.data.copy_list,requestId:d.requestId})]}}))}))},e.prototype.getFileInfo=function(e){var t;return a(this,void 0,Promise,(function(){var n,r=this;return s(this,(function(o){switch(o.label){case 0:return[4,this.getTempFileURL(e)];case 1:return(null==(n=o.sent())?void 0:n.fileList)&&(null===(t=null==n?void 0:n.fileList)||void 0===t?void 0:t.length)>0?[4,Promise.all(n.fileList.map((function(e){return a(r,void 0,void 0,(function(){var t,n,r,o,i,a,c;return s(this,(function(s){switch(s.label){case 0:if("SUCCESS"!==e.code)return[2,{code:e.code,fileID:e.fileID,tempFileURL:e.tempFileURL,message:e.message}];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.request.fetch({url:e.tempFileURL,method:"HEAD"})];case 2:return t=s.sent(),n=t.header,"undefined"!=typeof Headers&&n instanceof Headers&&(r={},n.forEach((function(e,t){r[t]=e})),n=r),o=parseInt(n["content-length"])||0,i=n["content-type"]||"",[400,404].includes(Number(t.statusCode))?[2,{code:"FILE_NOT_FOUND",fileID:e.fileID,tempFileURL:e.tempFileURL,message:"file not found"}]:[2,{code:e.code,fileID:e.fileID,tempFileURL:e.tempFileURL,cloudId:e.fileID,fileName:e.fileID.split("/").pop(),contentType:i,mime:i.split(";")[0].trim(),size:o,etag:n.etag||"",lastModified:n["last-modified"]||"",cacheControl:n["cache-control"]||""}];case 3:return a=s.sent(),c="object"==typeof a&&null!==a&&"message"in a?String(a.message):void 0,[2,{code:"FETCH_FILE_INFO_ERROR",fileID:e.fileID,tempFileURL:e.tempFileURL,message:c}];case 4:return[2]}}))}))})))]:[3,3];case 2:return[2,{fileList:o.sent(),requestId:n.requestId}];case 3:return[2,{fileList:[],requestId:n.requestId}]}}))}))},o([y({customInfo:{className:"Cloudbase",methodName:"uploadFile"},title:"上传文件失败",messages:["请确认以下各项:"," 1 - 调用 uploadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(f)]}),i("design:type",Function),i("design:paramtypes",[Object,"function"==typeof(n="undefined"!=typeof Function&&Function)?n:Object]),i("design:returntype","function"==typeof(u="undefined"!=typeof Promise&&Promise)?u:Object)],e.prototype,"uploadFile",null),o([y({customInfo:{className:"Cloudbase",methodName:"getUploadMetadata"},title:"获取上传元信息失败",messages:["请确认以下各项:"," 1 - 调用 getUploadMetadata() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(f)]}),i("design:type",Function),i("design:paramtypes",[Object,"function"==typeof(I="undefined"!=typeof Function&&Function)?I:Object]),i("design:returntype","function"==typeof(A="undefined"!=typeof Promise&&Promise)?A:Object)],e.prototype,"getUploadMetadata",null),o([y({customInfo:{className:"Cloudbase",methodName:"deleteFile"},title:"删除文件失败",messages:["请确认以下各项:"," 1 - 调用 deleteFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(f)]}),i("design:type",Function),i("design:paramtypes",["function"==typeof(P=void 0!==p.ICloudbaseDeleteFileParams&&p.ICloudbaseDeleteFileParams)?P:Object,"function"==typeof(C="undefined"!=typeof Function&&Function)?C:Object]),i("design:returntype","function"==typeof(R="undefined"!=typeof Promise&&Promise)?R:Object)],e.prototype,"deleteFile",null),o([y({customInfo:{className:"Cloudbase",methodName:"getTempFileURL"},title:"获取文件下载链接",messages:["请确认以下各项:"," 1 - 调用 getTempFileURL() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(f)]}),i("design:type",Function),i("design:paramtypes",["function"==typeof(N=void 0!==p.ICloudbaseGetTempFileURLParams&&p.ICloudbaseGetTempFileURLParams)?N:Object,"function"==typeof(k="undefined"!=typeof Function&&Function)?k:Object]),i("design:returntype","function"==typeof(j="undefined"!=typeof Promise&&Promise)?j:Object)],e.prototype,"getTempFileURL",null),o([y({customInfo:{className:"Cloudbase",methodName:"downloadFile"},title:"下载文件失败",messages:["请确认以下各项:"," 1 - 调用 downloadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(f)]}),i("design:type",Function),i("design:paramtypes",["function"==typeof(U=void 0!==p.ICloudbaseDownloadFileParams&&p.ICloudbaseDownloadFileParams)?U:Object,"function"==typeof(D="undefined"!=typeof Function&&Function)?D:Object]),i("design:returntype","function"==typeof(L="undefined"!=typeof Promise&&Promise)?L:Object)],e.prototype,"downloadFile",null),o([y({customInfo:{className:"Cloudbase",methodName:"copyFile"},title:"批量复制文件",messages:["请确认以下各项:"," 1 - 调用 copyFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(f)]}),i("design:type",Function),i("design:paramtypes",["function"==typeof(M=void 0!==p.ICloudbaseCopyFileParams&&p.ICloudbaseCopyFileParams)?M:Object,"function"==typeof(q="undefined"!=typeof Function&&Function)?q:Object]),i("design:returntype","function"==typeof(B="undefined"!=typeof Promise&&Promise)?B:Object)],e.prototype,"copyFile",null),e}()},9656:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.DownloadBuilder=t.StreamDownloadBuilder=void 0;var a=n(7957),s=n(7090);function c(e){return(0,a.isStorageError)(e)?e:new a.StorageError((null==e?void 0:e.message)||String(e))}function u(e){var t={};return void 0!==(null==e?void 0:e.download)&&(t.download=!0===e.download?"":e.download),void 0!==(null==e?void 0:e.cacheNonce)&&(t.cacheNonce=String(e.cacheNonce)),{headers:{},query:t}}var l=function(){function e(e){this.ctx=e}return e.prototype.then=function(e,t){return this.execute().then(e,t)},e.prototype.execute=function(){var e,t;return o(this,void 0,Promise,(function(){var n,o,l,p,d;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),n=u(this.ctx.options),o=n.headers,l=n.query,[4,this.ctx.http.download({path:"/object/".concat(this.ctx.bucketId,"/").concat((0,s.encodeObjectName)(this.ctx.cleanName)),headers:r(r({},this.ctx.headers),o),query:l,signal:null===(e=this.ctx.parameters)||void 0===e?void 0:e.signal,cache:null===(t=this.ctx.parameters)||void 0===t?void 0:t.cache})];case 1:if(!(p=i.sent().response).body)throw new a.StorageApiError("Response body is empty",p.status,"STORAGE_PG_EMPTY_BODY");return[2,{data:p.body,error:null}];case 2:if(d=i.sent(),this.ctx.shouldThrowOnError)throw d;return[2,{data:null,error:c(d)}];case 3:return[2]}}))}))},e}();t.StreamDownloadBuilder=l;var p=function(){function e(e){this.ctx=e}return e.prototype.asStream=function(){return new l(this.ctx)},e.prototype.then=function(e,t){return this.execute().then(e,t)},e.prototype.execute=function(){var e,t;return o(this,void 0,Promise,(function(){var n,o,a,l,p,d;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),n=u(this.ctx.options),o=n.headers,a=n.query,[4,this.ctx.http.download({path:"/object/".concat(this.ctx.bucketId,"/").concat((0,s.encodeObjectName)(this.ctx.cleanName)),headers:r(r({},this.ctx.headers),o),query:a,signal:null===(e=this.ctx.parameters)||void 0===e?void 0:e.signal,cache:null===(t=this.ctx.parameters)||void 0===t?void 0:t.cache})];case 1:return l=i.sent().response,d={},[4,l.blob()];case 2:return[2,(d.data=i.sent(),d.error=null,d)];case 3:if(p=i.sent(),this.ctx.shouldThrowOnError)throw p;return[2,{data:null,error:c(p)}];case 4:return[2]}}))}))},e}();t.DownloadBuilder=p},7090:(e,t)=>{"use strict";function n(){return globalThis.Buffer}Object.defineProperty(t,"__esModule",{value:!0}),t.encodeObjectName=t.toBase64=t.getStringByteLength=void 0,t.getStringByteLength=function(e){var t;return null===(t=n())||void 0===t?void 0:t.byteLength(e)},t.toBase64=function(e){var t=n();return t?t.from(e).toString("base64"):btoa(e)},t.encodeObjectName=function(e){return e.split("/").map((function(e){return encodeURIComponent(e)})).join("/")}},5098:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Http=t.handleOperation=void 0;var a=n(7957),s="/v1/storages";t.handleOperation=function(e,t){return o(this,void 0,Promise,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e()];case 1:return[2,{data:r.sent(),error:null}];case 2:if(n=r.sent(),t)throw n;return(0,a.isStorageError)(n)?[2,{data:null,error:n}]:[2,{data:null,error:new a.StorageError((null==n?void 0:n.message)||String(n))}];case 3:return[2]}}))}))};var c=function(){function e(e){this.ctx=e}return Object.defineProperty(e.prototype,"request",{get:function(){return this.ctx.request},enumerable:!1,configurable:!0}),e.prototype.gatewayOrigin=function(){return this.request.getBaseEndPoint("GATEWAY")},e.prototype.buildUrl=function(e,t){var n="".concat(this.gatewayOrigin()).concat(s).concat(e),r=function(e){if(!e)return"";var t=[];return Object.keys(e).forEach((function(n){var r=e[n];null!=r&&t.push("".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(String(r))))})),t.join("&")}(t);return r&&(n+=(n.includes("?")?"&":"?")+r),n},e.prototype.toFullUrl=function(e){return e?/^https?:\/\//.test(e)||e.startsWith("//")?e:"".concat(this.gatewayOrigin()).concat(s).concat(e.startsWith("/")?"":"/").concat(e):e},e.prototype.send=function(e){return o(this,void 0,Promise,(function(){var t,n,o,a,s,c;return i(this,(function(i){switch(i.label){case 0:return t=this.buildUrl(e.path,e.query),n=e.method.toUpperCase(),o=["GET","HEAD"].includes(n),a=r({},e.headers||{}),o||(void 0!==e.rawBody?s=e.rawBody:void 0!==e.json&&(a["Content-Type"]=a["Content-Type"]||"application/json",s=JSON.stringify(e.json))),[4,this.request.fetch(r(r(r(r({url:t,method:n,headers:a},void 0!==s?{body:s}:{}),{withCredentials:!1!==e.withCredentials,shouldThrowOnError:!1}),e.signal?{signal:e.signal}:{}),e.cache?{cache:e.cache}:{}))];case 1:return c=i.sent(),[2,this.unwrap(c,t)]}}))}))},e.prototype.download=function(e){var t,n;return o(this,void 0,Promise,(function(){var o,s,c,u;return i(this,(function(i){switch(i.label){case 0:return o=this.buildUrl(e.path,e.query),[4,this.request.fetch(r(r({url:o,method:"GET",headers:r({},e.headers||{}),stream:!0,withCredentials:!1!==e.withCredentials,shouldThrowOnError:!1},e.signal?{signal:e.signal}:{}),e.cache?{cache:e.cache}:{}))];case 1:if(s=i.sent(),null===(t=e.signal)||void 0===t?void 0:t.aborted)throw new a.StorageApiError("The download was aborted",0,"STORAGE_PG_ABORTED");if(304===(c=Number(null!==(n=null==s?void 0:s.statusCode)&&void 0!==n?n:200)))throw new a.StorageApiError("Not Modified",c,"STORAGE_PG_NOT_MODIFIED");if(c>=400)throw new a.StorageApiError("Download failed with status ".concat(c),c,"STORAGE_PG_REQUEST_FAIL");if(!(u=null==s?void 0:s.response))throw new a.StorageApiError("Underlying adapter did not expose the raw Response",c,"STORAGE_PG_NO_RESPONSE");return[2,{response:u,status:c,header:null==s?void 0:s.header}]}}))}))},e.prototype.unwrap=function(e,t){var n,r;return o(this,void 0,Promise,(function(){var o,s,c,u;return i(this,(function(i){switch(i.label){case 0:o=Number(null!==(r=null!==(n=null==e?void 0:e.statusCode)&&void 0!==n?n:null==e?void 0:e.status)&&void 0!==r?r:200),s=null==e?void 0:e.data,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,s];case 2:return s=i.sent(),[3,4];case 3:return i.sent(),s=void 0,[3,4];case 4:if(o>=200&&o<300)return[2,s];throw c=(null==s?void 0:s.code)||(null==s?void 0:s.error)||"STORAGE_PG_REQUEST_FAIL",u=(null==s?void 0:s.message)||"Storage request failed with status ".concat(o,": ").concat(t),new a.StorageApiError(u,o,c)}}))}))},e}();t.Http=c},3456:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.registerStorage=t.StorageClient=t.StorageFileApi=t.ClassicStorageFileApi=t.CloudbaseStorage=t.COMPONENT_NAME=void 0;var i=n(1502),a=n(2014),s=n(5504),c=n(5891),u=n(3077),l=n(5891);Object.defineProperty(t,"COMPONENT_NAME",{enumerable:!0,get:function(){return l.COMPONENT_NAME}}),Object.defineProperty(t,"CloudbaseStorage",{enumerable:!0,get:function(){return l.CloudbaseStorage}});var p=n(3077);Object.defineProperty(t,"ClassicStorageFileApi",{enumerable:!0,get:function(){return p.ClassicStorageFileApi}});var d=n(1502);Object.defineProperty(t,"StorageFileApi",{enumerable:!0,get:function(){return d.StorageFileApi}});var h=new c.CloudbaseStorage,f={name:c.COMPONENT_NAME,entity:{uploadFile:h.uploadFile,deleteFile:h.deleteFile,getTempFileURL:h.getTempFileURL,downloadFile:h.downloadFile,getUploadMetadata:h.getUploadMetadata,copyFile:h.copyFile,getFileInfo:h.getFileInfo,isGateWay:h.isGateWay}},m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.from=function(e){return e?((0,s.assertValidBucketId)(e,"from"),new i.StorageFileApi(this.http,e,this.shouldThrowOnError)):new u.ClassicStorageFileApi(this.http.ctx,this.shouldThrowOnError)},t}(a.StorageBucketApi);t.StorageClient=m;var v={name:"".concat(c.COMPONENT_NAME,"/supabase"),IIFE:!0,entity:function(){var e=new WeakMap;Object.defineProperty(this.prototype,"storage",{get:function(){if(e.has(this))return e.get(this);var t=this,n=new Proxy({},{get:function(e,n){return"config"===n?t.config:"request"===n?t.request:void 0}}),r=new m(n);return e.set(this,r),r},configurable:!0,enumerable:!0})}};try{cloudbase.registerComponent(f),cloudbase.registerComponent(v)}catch(e){}function g(e){try{e.registerComponent(f),e.registerComponent(v)}catch(e){console.warn(e)}}t.registerStorage=g;try{window.registerStorage=g}catch(e){}},2014:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.StorageBucketApi=void 0;var i=n(5098),a=n(5504),s=function(){function e(e,t){void 0===t&&(t=!1),this.http=new i.Http(e),this.shouldThrowOnError=t}return e.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},e.prototype.listBuckets=function(e){return r(this,void 0,Promise,(function(){var t=this;return o(this,(function(n){return[2,(0,i.handleOperation)((function(){var n={};return void 0!==(null==e?void 0:e.limit)&&(n.limit=e.limit),void 0!==(null==e?void 0:e.offset)&&(n.offset=e.offset),(null==e?void 0:e.sortColumn)&&(n.sortColumn=e.sortColumn),(null==e?void 0:e.sortOrder)&&(n.sortOrder=e.sortOrder),(null==e?void 0:e.search)&&(n.search=e.search),t.http.send({method:"GET",path:"/bucket/",query:n})}),this.shouldThrowOnError)]}))}))},e.prototype.getBucket=function(e){return r(this,void 0,Promise,(function(){var t=this;return o(this,(function(n){return[2,(0,i.handleOperation)((function(){return(0,a.assertValidBucketId)(e,"getBucket"),t.http.send({method:"GET",path:"/bucket/".concat(e)})}),this.shouldThrowOnError)]}))}))},e.prototype.createBucket=function(e,t){return r(this,void 0,Promise,(function(){var n=this;return o(this,(function(r){return[2,(0,i.handleOperation)((function(){var r;return(0,a.assertValidBucketId)(e,"createBucket"),n.http.send({method:"POST",path:"/bucket/",json:{id:e,name:e,public:null!==(r=null==t?void 0:t.public)&&void 0!==r&&r,type:null==t?void 0:t.type,file_size_limit:null==t?void 0:t.fileSizeLimit,allowed_mime_types:null==t?void 0:t.allowedMimeTypes}})}),this.shouldThrowOnError)]}))}))},e.prototype.updateBucket=function(e,t){return r(this,void 0,Promise,(function(){var n=this;return o(this,(function(r){return[2,(0,i.handleOperation)((function(){return(0,a.assertValidBucketId)(e,"updateBucket"),n.http.send({method:"PUT",path:"/bucket/".concat(e),json:{public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes}})}),this.shouldThrowOnError)]}))}))},e.prototype.deleteBucket=function(e){return r(this,void 0,Promise,(function(){var t=this;return o(this,(function(n){return[2,(0,i.handleOperation)((function(){return(0,a.assertValidBucketId)(e,"deleteBucket"),t.http.send({method:"DELETE",path:"/bucket/".concat(e)})}),this.shouldThrowOnError)]}))}))},e}();t.StorageBucketApi=s},3077:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ClassicStorageFileApi=void 0;var a=n(2877),s=n(7957),c=n(5891),u=n(7090),l=a.constants.ERRORS,p=function(){function e(e,t){void 0===t&&(t=!1),this.shouldThrowOnError=!1,this.bucketId="",this.context=e,this.shouldThrowOnError=t,this.storage=new c.CloudbaseStorage(e)}return Object.defineProperty(e.prototype,"config",{get:function(){var e;return null===(e=this.context)||void 0===e?void 0:e.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){var e;return null===(e=this.context)||void 0===e?void 0:e.request},enumerable:!1,configurable:!0}),e.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},e.prototype.upload=function(e,t,n){return o(this,void 0,Promise,(function(){var o,a,u,p,d,h,f,m,v;return i(this,(function(i){switch(i.label){case 0:o=r({upsert:!0},n),a=o.cacheControl,u=o.contentType,p=o.metadata,i.label=1;case 1:return i.trys.push([1,3,,4]),d=this.getCloudPath(e),h={cloudPath:d,filePath:t},(a||u||p)&&(f={},a&&(f["cache-control"]=a),u&&(f["content-type"]=u),p&&(f["x-cos-metadata-metadata"]=this.toBase64(JSON.stringify(p))),h.headers=f),[4,this.storage.uploadFile(h)];case 2:if(!(m=i.sent()).fileID)throw new Error(JSON.stringify({code:l.OPERATION_FAIL,msg:"[".concat(c.COMPONENT_NAME,".update] no fileID returned")}));return[2,{data:{id:m.fileID,path:e,fullPath:e},error:null}];case 3:if(v=i.sent(),this.shouldThrowOnError)throw v;if((0,s.isStorageError)(v))return[2,{data:null,error:v}];throw v;case 4:return[2]}}))}))},e.prototype.uploadToSignedUrl=function(e,t,n,r){return o(this,void 0,Promise,(function(){return i(this,(function(t){return[2,this.upload(e,n,r)]}))}))},e.prototype.createSignedUploadUrl=function(e){return o(this,void 0,Promise,(function(){var t,n,r;return i(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),t=this.getCloudPath(e),[4,this.storage.getUploadMetadata({cloudPath:t})];case 1:return[2,{data:{signedUrl:(n=o.sent().data).url,token:n.token,path:e,authorization:n.authorization,id:n.fileId,cosFileId:n.cosFileId,downloadUrl:n.download_url},error:null}];case 2:if(r=o.sent(),this.shouldThrowOnError)throw r;return[2,{data:null,error:r instanceof s.StorageError?r:new s.StorageError(r.message)}];case 3:return[2]}}))}))},e.prototype.update=function(e,t,n){return o(this,void 0,Promise,(function(){return i(this,(function(o){return[2,this.upload(e,t,r(r({},n),{upsert:!0}))]}))}))},e.prototype.move=function(e,t){return o(this,void 0,Promise,(function(){var n,r;return i(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.storage.copyFile({fileList:[{srcPath:this.getCloudPath(e),dstPath:this.getCloudPath(t),overwrite:!0,removeOriginal:!0}]})];case 1:if((n=o.sent()).fileList[0].code&&"SUCCESS"!==n.fileList[0].code)throw new s.StorageError(n.fileList[0].message||"Move failed");return[2,{data:{message:"File moved from ".concat(e," to ").concat(t)},error:null}];case 2:if(r=o.sent(),this.shouldThrowOnError)throw r;if((0,s.isStorageError)(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}}))}))},e.prototype.copy=function(e,t){return o(this,void 0,Promise,(function(){var n,r;return i(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.storage.copyFile({fileList:[{srcPath:this.getCloudPath(e),dstPath:this.getCloudPath(t),overwrite:!0,removeOriginal:!1}]})];case 1:if((n=o.sent()).fileList[0].code&&"SUCCESS"!==n.fileList[0].code)throw new s.StorageError(n.fileList[0].message||"Copy failed");return[2,{data:{path:this.getCloudPath(t)},error:null}];case 2:if(r=o.sent(),this.shouldThrowOnError)throw r;if((0,s.isStorageError)(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}}))}))},e.prototype.createSignedUrl=function(e,t,n){return o(this,void 0,Promise,(function(){var r,o,a,c,u,l,p;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r=this.normalizeCloudId(e),[4,this.storage.getTempFileURL({fileList:[{fileID:r,maxAge:t}]})];case 1:if("SUCCESS"!==(o=i.sent()).fileList[0].code)throw new s.StorageError("Failed to create signed URL: [".concat(o.fileList[0].code,"] ").concat(o.fileList[0].fileID));return a=o.fileList[0].download_url,c=[],void 0!==(null==n?void 0:n.download)&&("string"==typeof n.download?c.push("download=".concat(encodeURIComponent(n.download))):!0===n.download&&c.push("download=true")),(null==n?void 0:n.transform)&&(u=this.transformOptsToQueryString(n.transform))&&c.push(u),c.length>0&&(l=a.includes("?")?"&":"?",a="".concat(a).concat(l).concat(c.join("&"))),[2,{data:{signedUrl:a},error:null}];case 2:if(p=i.sent(),this.shouldThrowOnError)throw p;if((0,s.isStorageError)(p))return[2,{data:null,error:p}];throw p;case 3:return[2]}}))}))},e.prototype.createSignedUrls=function(e,t){return o(this,void 0,Promise,(function(){var n,r,o=this;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),n=e.map((function(e){return{fileID:o.normalizeCloudId(e),maxAge:t}})),[4,this.storage.getTempFileURL({fileList:n})];case 1:return[2,{data:i.sent().fileList.map((function(t,n){return{path:e[n],signedUrl:t.tempFileURL||"",error:"SUCCESS"===t.code?null:t.message}})),error:null}];case 2:if(r=i.sent(),this.shouldThrowOnError)throw r;if((0,s.isStorageError)(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}}))}))},e.prototype.download=function(e,t){return o(this,void 0,Promise,(function(){var n,r,a=this;return i(this,(function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),r={},[4,o(a,void 0,void 0,(function(){var n,r,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,this.createSignedUrl(e,600,{transform:t})];case 1:if((n=i.sent()).error)throw n.error;return r=encodeURI(null===(a=n.data)||void 0===a?void 0:a.signedUrl),[4,this.request.reqClass.get({url:r,headers:{},responseType:"blob"})];case 2:if(!(o=i.sent().data))throw new s.StorageError("Download failed: no file content");return[2,new Blob([o])]}}))}))];case 1:return[2,(r.data=c.sent(),r.error=null,r)];case 2:if(n=c.sent(),this.shouldThrowOnError)throw n;if((0,s.isStorageError)(n))return[2,{data:null,error:n}];throw n;case 3:return[2]}}))}))},e.prototype.info=function(e){return o(this,void 0,Promise,(function(){var t,n,r,o,a,c,u,l;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),t=e.startsWith("cloud://"),n=t?this.extractPathFromFileId(e):e,r=t?this.extractBucketFromFileId(e):this.bucketId,[4,this.storage.getFileInfo({fileList:[this.normalizeCloudId(e)]})];case 1:if(o=i.sent(),"SUCCESS"!==(a=o.fileList[0]).code)throw new s.StorageError(a.message);return c=(new Date).toISOString(),u=(a.lastModified?new Date(a.lastModified):new Date).toISOString(),[2,{data:{id:a.fileID,version:"1",name:n,bucketId:r,updatedAt:u,createdAt:u,lastAccessedAt:c,size:a.size,cacheControl:a.cacheControl,contentType:a.contentType,etag:a.etag,lastModified:u,metadata:{}},error:null}];case 2:if(l=i.sent(),this.shouldThrowOnError)throw l;return[2,{data:null,error:l instanceof s.StorageError?l:new s.StorageError(l.message)}];case 3:return[2]}}))}))},e.prototype.exists=function(e){return o(this,void 0,Promise,(function(){var t,n,r;return i(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.storage.getFileInfo({fileList:[this.normalizeCloudId(e)]})];case 1:if(t=o.sent(),"FILE_NOT_FOUND"===(n=t.fileList[0]).code)return[2,{data:!1,error:null}];if("SUCCESS"!==n.code)throw new s.StorageError(n.message);return[2,{data:!0,error:null}];case 2:if(r=o.sent(),this.shouldThrowOnError)throw r;if((0,s.isStorageError)(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}}))}))},e.prototype.getPublicUrl=function(e,t){return o(this,void 0,Promise,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.createSignedUrl(e,600,t)];case 1:return(n=r.sent()).data?[2,{data:{publicUrl:n.data.signedUrl}}]:[2,{data:null,error:n.error}]}}))}))},e.prototype.remove=function(e){return o(this,void 0,Promise,(function(){var t,n,r,o,a,c,u,l,p,d,h=this;return i(this,(function(i){switch(i.label){case 0:for(i.trys.push([0,3,,4]),t=10,n=[],r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return[4,Promise.all(n.map((function(e){return Promise.all(e.map((function(e){return h.info(e)})))})))];case 1:return o=i.sent(),a=new Map,o.forEach((function(n,r){n.forEach((function(n,o){n.data&&a.set(e[r*t+o],n.data)}))})),c=e.map((function(e){return h.normalizeCloudId(e)})),[4,this.storage.deleteFile({fileList:c})];case 2:if(u=i.sent(),(l=u.fileList.filter((function(e){return"SUCCESS"!==e.code}))).length>0)throw new s.StorageError("Delete failed for ".concat(l.length," file(s)"));return p=(new Date).toISOString(),[2,{data:e.map((function(e){var t=a.get(e);return{name:null==t?void 0:t.name,id:null==t?void 0:t.id,bucket_id:null==t?void 0:t.bucketId,owner:void 0,updated_at:(null==t?void 0:t.updatedAt)||p,created_at:null==t?void 0:t.createdAt,last_accessed_at:(null==t?void 0:t.lastAccessedAt)||p,metadata:(null==t?void 0:t.metadata)||{},buckets:{id:null==t?void 0:t.bucketId,name:null==t?void 0:t.bucketId,owner:void 0,public:!1,created_at:"",updated_at:p}}})),error:null}];case 3:if(d=i.sent(),this.shouldThrowOnError)throw d;if((0,s.isStorageError)(d))return[2,{data:null,error:d}];throw d;case 4:return[2]}}))}))},e.prototype.list=function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){throw new s.StorageError("Not implemented")}))}))},e.prototype.getCloudPath=function(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")},e.prototype.normalizeCloudId=function(e){var t;if(/^cloud:\/\//.test(e))return e;var n=this.getCloudPath(e);if(!this.bucketId)throw new s.StorageError("bucketId is not set");var r=(null===(t=this.config)||void 0===t?void 0:t.env)||"";return r?"cloud://".concat(r,".").concat(this.bucketId,"/").concat(n):void 0},e.prototype.toBase64=function(e){return(0,u.toBase64)(e)},e.prototype.transformOptsToQueryString=function(e){var t=["imageMogr2"];if(e.width||e.height){var n=e.width||"",r=e.height||"";"fill"===e.resize?t.push("thumbnail/".concat(n,"x").concat(r,"!")):"contain"===e.resize?t.push("thumbnail/".concat(n,"x").concat(r)):t.push("thumbnail/".concat(n,"x").concat(r,"^"))}if(e.format&&"origin"!==e.format&&t.push("format/".concat(e.format)),void 0!==e.quality){var o=Math.max(1,Math.min(100,e.quality));t.push("quality/".concat(o))}return t.join("/")},e.prototype.extractPathFromFileId=function(e){var t=e.replace(/^cloud:\/\//,"").split("/");return t.length<2?e:t.slice(1).join("/")},e.prototype.extractBucketFromFileId=function(e){var t=e.replace(/^cloud:\/\//,"").split("/");if(t.length<1)return"";var n=t[0],r=n.indexOf(".");return-1===r?n:n.substring(r+1)},e}();t.ClassicStorageFileApi=p},1502:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.StorageFileApi=void 0;var a=n(7957),s=n(7090),c=n(5098),u=n(9656),l="3600",p=function(){function e(e,t,n){void 0===n&&(n=!1),this.headers={},this.http=e,this.bucketId=t,this.shouldThrowOnError=n}return e.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},e.prototype.setHeader=function(e,t){var n;if("string"!=typeof e||""===e.trim())throw new a.StorageError("setHeader requires a non-empty header name");if(/[\r\n]/.test(e)||"string"==typeof t&&/[\r\n]/.test(t))throw new a.StorageError("setHeader does not allow CR/LF characters in header name or value");return this.headers=r(r({},this.headers),((n={})[e]=String(t),n)),this},e.prototype.upload=function(e,t,n){return o(this,void 0,Promise,(function(){return i(this,(function(r){return[2,this.uploadOrUpdate("POST",e,t,n)]}))}))},e.prototype.update=function(e,t,n){return o(this,void 0,Promise,(function(){return i(this,(function(r){return[2,this.uploadOrUpdate("PUT",e,t,n)]}))}))},e.prototype.download=function(e,t,n){return new u.DownloadBuilder({http:this.http,bucketId:this.bucketId,cleanName:this.cleanPath(e),options:t,parameters:n,headers:this.headers,shouldThrowOnError:this.shouldThrowOnError})},e.prototype.list=function(e,t,n){return o(this,void 0,Promise,(function(){var r=this;return i(this,(function(a){return[2,(0,c.handleOperation)((function(){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){return r={prefix:e||""},void 0!==(null==t?void 0:t.limit)&&(r.limit=t.limit),void 0!==(null==t?void 0:t.cursor)&&(r.cursor=t.cursor),void 0!==(null==t?void 0:t.withDelimiter)&&(r.with_delimiter=t.withDelimiter),void 0!==(null==t?void 0:t.sortBy)&&(r.sortBy=t.sortBy),[2,this.send({method:"POST",path:"/object/list/".concat(this.bucketId),json:r,signal:null==n?void 0:n.signal,cache:null==n?void 0:n.cache})]}))}))}),this.shouldThrowOnError)]}))}))},e.prototype.remove=function(e){return o(this,void 0,Promise,(function(){var t=this;return i(this,(function(n){return[2,(0,c.handleOperation)((function(){return o(t,void 0,void 0,(function(){var t,n,r,o,a,s=this;return i(this,(function(i){switch(i.label){case 0:t=e.map((function(e){return s.cleanPath(e)})),n=[],r=0,i.label=1;case 1:return r<t.length?(o=t.slice(r,r+100),[4,this.send({method:"DELETE",path:"/object/".concat(this.bucketId),json:{prefixes:o}})]):[3,4];case 2:a=i.sent(),Array.isArray(a)&&n.push.apply(n,a),i.label=3;case 3:return r+=100,[3,1];case 4:return[2,n]}}))}))}),this.shouldThrowOnError)]}))}))},e.prototype.copy=function(e,t,n){return o(this,void 0,Promise,(function(){var r=this;return i(this,(function(a){return[2,(0,c.handleOperation)((function(){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return r=this.buildCopyMoveHeaders(n),[4,this.send({method:"POST",path:"/object/copy",json:{bucketId:this.bucketId,sourceKey:this.cleanPath(e),destinationKey:this.cleanPath(t),destinationBucket:null==n?void 0:n.destinationBucket,copyMetadata:null==n?void 0:n.copyMetadata,metadata:null==n?void 0:n.metadata},headers:r})];case 1:return[2,{path:o.sent().Key}]}}))}))}),this.shouldThrowOnError)]}))}))},e.prototype.move=function(e,t,n){return o(this,void 0,Promise,(function(){var r=this;return i(this,(function(a){return[2,(0,c.handleOperation)((function(){return o(r,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return[4,this.send({method:"POST",path:"/object/move",json:{bucketId:this.bucketId,sourceKey:this.cleanPath(e),destinationKey:this.cleanPath(t),destinationBucket:null==n?void 0:n.destinationBucket}})];case 1:return[2,{message:r.sent().message||"Successfully moved"}]}}))}))}),this.shouldThrowOnError)]}))}))},e.prototype.info=function(e){return o(this,void 0,Promise,(function(){var t=this;return i(this,(function(n){return[2,(0,c.handleOperation)((function(){return o(t,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return t=this.cleanPath(e),[4,this.send({method:"GET",path:"/object/info/".concat(this.bucketId,"/").concat(this.encodePath(t))})];case 1:return[2,{id:(n=r.sent()).id,name:n.name,version:n.version,bucketId:n.bucket_id,size:n.size,contentType:n.content_type,cacheControl:n.cache_control,etag:n.etag,metadata:n.metadata,lastModified:n.last_modified,createdAt:n.created_at}]}}))}))}),this.shouldThrowOnError)]}))}))},e.prototype.exists=function(e){return o(this,void 0,Promise,(function(){var t,n,r;return i(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),t=this.cleanPath(e),[4,this.send({method:"GET",path:"/object/info/".concat(this.bucketId,"/").concat(this.encodePath(t))})];case 1:return o.sent(),[2,{data:!0,error:null}];case 2:if(n=o.sent(),void 0!==(r=null==n?void 0:n.status)&&[400,404].includes(Number(r)))return[2,{data:!1,error:null}];if(this.shouldThrowOnError)throw n;return[2,{data:null,error:n instanceof a.StorageError?n:new a.StorageError((null==n?void 0:n.message)||String(n))}];case 3:return[2]}}))}))},e.prototype.createSignedUrl=function(e,t,n){return o(this,void 0,Promise,(function(){var r=this;return i(this,(function(a){return[2,(0,c.handleOperation)((function(){return o(r,void 0,void 0,(function(){var r,o,a;return i(this,(function(i){switch(i.label){case 0:return r=this.cleanPath(e),[4,this.send({method:"POST",path:"/object/sign/".concat(this.bucketId,"/").concat(this.encodePath(r)),json:{expiresIn:t}})];case 1:return o=i.sent(),a=o.fullSignedURL||this.http.toFullUrl(o.signedURL||""),[2,{fullSignedURL:this.appendUrlOptions(a,n)}]}}))}))}),this.shouldThrowOnError)]}))}))},e.prototype.createSignedUrls=function(e,t,n){return o(this,void 0,Promise,(function(){var r=this;return i(this,(function(a){return[2,(0,c.handleOperation)((function(){return o(r,void 0,void 0,(function(){var r,o,a,s,c=this;return i(this,(function(i){switch(i.label){case 0:r=e.map((function(e){return c.cleanPath(e)})),o=[],a=0,i.label=1;case 1:return a<r.length?(s=r.slice(a,a+500),[4,this.send({method:"POST",path:"/object/sign/".concat(this.bucketId),json:{expiresIn:t,paths:s}})]):[3,4];case 2:i.sent().forEach((function(e){var t,r=e.fullSignedURL||(e.signedURL?c.http.toFullUrl(e.signedURL):null);o.push({path:e.path,fullSignedURL:r?c.appendUrlOptions(r,n):null,error:null!==(t=e.error)&&void 0!==t?t:null})})),i.label=3;case 3:return a+=500,[3,1];case 4:return[2,o]}}))}))}),this.shouldThrowOnError)]}))}))},e.prototype.createSignedUploadUrl=function(e,t){return o(this,void 0,Promise,(function(){var n=this;return i(this,(function(r){return[2,(0,c.handleOperation)((function(){return o(n,void 0,void 0,(function(){var n,r,o;return i(this,(function(i){switch(i.label){case 0:return n=this.cleanPath(e),r={},(null==t?void 0:t.upsert)&&(r["x-upsert"]="true"),[4,this.send({method:"POST",path:"/object/upload/sign/".concat(this.bucketId,"/").concat(this.encodePath(n)),headers:r})];case 1:return[2,{fullSignedURL:(o=i.sent()).fullURL||this.http.toFullUrl(o.url||""),path:n,token:o.token}]}}))}))}),this.shouldThrowOnError)]}))}))},e.prototype.uploadToSignedUrl=function(e,t,n,r){return o(this,void 0,Promise,(function(){var a=this;return i(this,(function(s){return[2,(0,c.handleOperation)((function(){return o(a,void 0,void 0,(function(){var o,a,s,c,u;return i(this,(function(i){switch(i.label){case 0:return o=this.cleanPath(e),a=this.buildUploadBody(n,r),s=a.body,c=a.headers,[4,this.send({method:"PUT",path:"/object/upload/sign/".concat(this.bucketId,"/").concat(this.encodePath(o)),query:{token:t},rawBody:s,headers:c,withCredentials:!1})];case 1:return u=i.sent(),[2,{path:o,fullPath:u.Key}]}}))}))}),this.shouldThrowOnError)]}))}))},e.prototype.getPublicUrl=function(e,t){var n=this.cleanPath(e),r=this.http.buildUrl("/object/public/".concat(this.bucketId,"/").concat(this.encodePath(n)));return{data:{publicUrl:this.appendUrlOptions(r,t)}}},e.prototype.send=function(e){return this.http.send(r(r({},e),{headers:r(r({},this.headers),e.headers||{})}))},e.prototype.uploadOrUpdate=function(e,t,n,r){return o(this,void 0,Promise,(function(){var a=this;return i(this,(function(s){return[2,(0,c.handleOperation)((function(){return o(a,void 0,void 0,(function(){var o,a,s,c,u;return i(this,(function(i){switch(i.label){case 0:return o=this.cleanPath(t),a=this.buildUploadBody(n,r),s=a.body,c=a.headers,"POST"===e&&(c["x-upsert"]=String(Boolean(null==r?void 0:r.upsert))),[4,this.send({method:e,path:"/object/".concat(this.bucketId,"/").concat(this.encodePath(o)),rawBody:s,headers:c})];case 1:return[2,{id:(u=i.sent()).Id,path:o,fullPath:u.Key}]}}))}))}),this.shouldThrowOnError)]}))}))},e.prototype.cleanPath=function(e){var t=e.replace(/^\/+|\/+$/g,"").replace(/\/+/g,"/");if(t.split("/").some((function(e){return".."===e})))throw new a.StorageError('invalid path: ".." segment is not allowed');return t},e.prototype.encodePath=function(e){return(0,s.encodeObjectName)(e)},e.prototype.buildUploadBody=function(e,t){var n,o,i,a,s,c=r({},(null==t?void 0:t.headers)||{}),u=e,p="undefined"!=typeof FormData&&e instanceof FormData;if("undefined"!=typeof Blob&&e instanceof Blob||p){var d=void 0,h={};if(p){var f=this.extractFromFormData(e);d=f.file,h=f.fields}else d=e;var m=null!==(o=null!==(n=null==t?void 0:t.cacheControl)&&void 0!==n?n:h.cacheControl)&&void 0!==o?o:l,v=null!==(i=null==t?void 0:t.contentType)&&void 0!==i?i:h.contentType,g=void 0!==(null==t?void 0:t.metadata)?JSON.stringify(t.metadata):h.metadata,b=new FormData;void 0!==m&&b.append("cacheControl",String(m)),void 0!==v&&b.append("contentType",v),void 0!==g&&b.append("metadata",g),b.append("",d),u=b}else u=e,m=null!==(a=null==t?void 0:t.cacheControl)&&void 0!==a?a:l,v=null!==(s=null==t?void 0:t.contentType)&&void 0!==s?s:"text/plain;charset=UTF-8",c["cache-control"]="max-age=".concat(m),v&&(c["content-type"]=v),(null==t?void 0:t.metadata)&&(c["x-metadata"]=this.toBase64(JSON.stringify(t.metadata)));return{body:u,headers:c}},e.prototype.extractFromFormData=function(e){var t,n={},r=0,o=[];if(e.forEach((function(e,i){if("undefined"!=typeof Blob&&e instanceof Blob)return t=e,void(r+=1);"cacheControl"!==i&&"contentType"!==i&&"metadata"!==i?o.push(i):n[i]=String(e)})),o.length>0&&console.warn("Ignored unsupported FormData field(s): [".concat(o.join(", "),"]. Only file, cacheControl, contentType and metadata are supported")),0===r||!t)throw new a.StorageError("FormData must contain a file");if(r>1)throw new a.StorageError("FormData must contain exactly one file");return{file:t,fields:n}},e.prototype.buildCopyMoveHeaders=function(e){var t={};return(null==e?void 0:e.upsert)&&(t["x-upsert"]="true"),!1===(null==e?void 0:e.copyMetadata)&&(null==e?void 0:e.metadata)&&(t["x-metadata"]=this.toBase64(JSON.stringify(e.metadata))),t},e.prototype.appendUrlOptions=function(e,t){var n=[];if(void 0!==(null==t?void 0:t.download)){var r=!0===t.download?"":String(t.download);n.push("download=".concat(encodeURIComponent(r)))}if(void 0!==(null==t?void 0:t.cacheNonce)&&n.push("cacheNonce=".concat(encodeURIComponent(String(t.cacheNonce)))),0===n.length)return e;var o=e.includes("?")?"&":"?";return"".concat(e).concat(o).concat(n.join("&"))},e.prototype.toBase64=function(e){return(0,s.toBase64)(e)},e}();t.StorageFileApi=p},7957:function(e,t){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.StorageUnknownError=t.StorageApiError=t.isStorageError=t.StorageError=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.__isStorageError=!0,n.name="StorageError",n}return r(t,e),t}(Error);t.StorageError=o,t.isStorageError=function(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e};var i=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.name="StorageApiError",o.status=n,o.statusCode=r,o}return r(t,e),t.prototype.toJSON=function(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}},t}(o);t.StorageApiError=i;var a=function(e){function t(t,n){var r=e.call(this,t)||this;return r.name="StorageUnknownError",r.originalError=n,r}return r(t,e),t}(o);t.StorageUnknownError=a},5504:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertValidBucketId=t.isValidBucketId=void 0;var r=n(7957),o=/[\x00-\x20\x7f/\\?#%]/;t.isValidBucketId=function(e){return"string"==typeof e&&e.length>0&&e.length<=256&&!o.test(e)},t.assertValidBucketId=function(e,t){if("string"!=typeof e||0===e.length)throw new r.StorageError("[storage.".concat(t,"] bucketId is required"));if(e.length>256)throw new r.StorageError("[storage.".concat(t,"] invalid bucketId: length must be 1-").concat(256));var n=o.exec(e);if(n){var i="[storage.".concat(t,'] invalid bucketId "').concat(e,'": ')+"contains forbidden character ".concat(JSON.stringify(n[0]),"; ")+'must not contain whitespace, control chars, "/", "\\", "?", "#" or "%"';throw new r.StorageError(i)}}},2563:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useDefaultAdapter=t.useAdapters=t.RUNTIME=void 0;var s,c=a(n(92)),u=n(962);!function(e){e.WEB="web",e.WX_MP="wx_mp"}(s=t.RUNTIME||(t.RUNTIME={})),t.useAdapters=function(e,t){for(var n=0,o=(0,u.isArray)(e)?e:[e];n<o.length;n++){var i=o[n],a=i.isMatch,s=i.genAdapter,c=i.runtime;if(a())return{adapter:r({isMatch:a},s(t)),runtime:c}}},t.useDefaultAdapter=function(){return{adapter:r({},c.genAdapter()),runtime:s.WEB}}},92:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.WebRequest=t.genAdapter=void 0;var c=n(2764),u=n(962),l=n(8464),p=function(e){function t(t){var n=e.call(this)||this,r=t.timeout,o=t.timeoutMsg,i=t.restrictedMethods;return n.timeout=r||0,n.timeoutMsg=o||"请求超时",n.restrictedMethods=i||["get","post","upload","download"],n}return o(t,e),t.prototype.get=function(e){return this.request(i(i({},e),{method:"get"}),this.restrictedMethods.includes("get"))},t.prototype.post=function(e){return this.request(i(i({},e),{method:"post"}),this.restrictedMethods.includes("post"))},t.prototype.put=function(e){return this.request(i(i({},e),{method:"put"}))},t.prototype.upload=function(e){var t=e.data,n=e.file,r=e.name,o=e.method,a=e.headers,s=void 0===a?{}:a,c={post:"post",put:"put"}[null==o?void 0:o.toLowerCase()]||"put",u=new FormData;return"post"===c?(Object.keys(t).forEach((function(e){u.append(e,t[e])})),u.append("key",r),u.append("file",n),this.request(i(i({},e),{data:u,method:c}),this.restrictedMethods.includes("upload"))):this.request(i(i({},e),{method:"put",headers:s,body:n}),this.restrictedMethods.includes("upload"))},t.prototype.download=function(e){return a(this,void 0,Promise,(function(){var t,n,r,o;return s(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.get(i(i({},e),{headers:{},responseType:"blob"}))];case 1:return t=a.sent().data,n=window.URL.createObjectURL(new Blob([t])),r=decodeURIComponent(new URL(e.url).pathname.split("/").pop()||""),(o=document.createElement("a")).href=n,o.setAttribute("download",r),o.style.display="none",document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(n),document.body.removeChild(o),[3,3];case 2:return a.sent(),[3,3];case 3:return[2,new Promise((function(t){t({statusCode:200,tempFilePath:e.url})}))]}}))}))},t.prototype.fetch=function(e){var t;return a(this,void 0,Promise,(function(){var n,r,o,c,u,l,p,d,h,f,m,v,g,b=this;return s(this,(function(y){switch(y.label){case 0:return n=new AbortController,r=e.url,o=e.enableAbort,c=void 0!==o&&o,u=e.stream,l=void 0!==u&&u,p=e.signal,d=e.timeout,h=e.shouldThrowOnError,f=void 0===h||h,m=null!=d?d:this.timeout,p&&(p.aborted&&n.abort(),p.addEventListener("abort",(function(){return n.abort()}))),v=null,c&&m&&(v=setTimeout((function(){console.warn(b.timeoutMsg),n.abort(new Error(b.timeoutMsg))}),m)),[4,fetch(r,i(i({},e),{signal:n.signal})).then((function(e){return a(b,void 0,void 0,(function(){var t,n,r;return s(this,(function(o){switch(o.label){case 0:return clearTimeout(v),f?e.ok?(t=e,[3,3]):[3,1]:[3,4];case 1:return r=(n=Promise).reject,[4,e.json()];case 2:t=r.apply(n,[o.sent()]),o.label=3;case 3:return[2,t];case 4:return[2,e]}}))}))})).catch((function(e){return clearTimeout(v),Promise.reject(e)}))];case 1:return g=y.sent(),[2,{data:l?g.body:(null===(t=g.headers.get("content-type"))||void 0===t?void 0:t.includes("application/json"))?g.json():g.text(),statusCode:g.status,header:g.headers,response:g}]}}))}))},t.prototype.request=function(e,t){var n=this;void 0===t&&(t=!1);var r=String(e.method).toLowerCase()||"get";return new Promise((function(o){var i=e.url,a=e.headers,s=void 0===a?{}:a,c=e.data,p=e.responseType,d=e.withCredentials,h=e.body,f=e.onUploadProgress,m=(0,u.formatUrl)((0,l.getProtocol)(),i,"get"===r?c:{}),v=new XMLHttpRequest;v.open(r,m),p&&(v.responseType=p);var g,b,y=e.signal;y&&(y.aborted?v.abort():y.addEventListener("abort",(function(){return v.abort()}),{once:!0})),Object.keys(s).forEach((function(e){v.setRequestHeader(e,s[e])})),f&&v.upload.addEventListener("progress",f),v.onreadystatechange=function(){var e={};if(4===v.readyState){var t=v.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};t.forEach((function(e){var t=e.split(": "),r=t.shift().toLowerCase(),o=t.join(": ");n[r]=o})),e.header=n,e.statusCode=v.status;try{e.data="blob"===p?v.response:JSON.parse(v.responseText)}catch(t){e.data="blob"===p?v.response:v.responseText}clearTimeout(g),o(e)}},t&&n.timeout&&(g=setTimeout((function(){console.warn(n.timeoutMsg),v.abort()}),n.timeout)),b=(0,u.isFormData)(c)?c:"application/x-www-form-urlencoded"===s["content-type"]?(0,u.toQueryString)(c):h||(c?JSON.stringify(c):void 0),d&&(v.withCredentials=!0),v.send(b)}))},t}(c.AbstractSDKRequest);t.WebRequest=p,t.genAdapter=function(){return{type:"default",root:window,reqClass:p,wsClass:WebSocket,localStorage}}},8464:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.COMMUNITY_SITE_URL=t.IS_DEBUG_MODE=t.getProtocol=t.setProtocol=t.getSdkName=t.setSdkName=void 0;var n="@cloudbase/js-sdk";t.setSdkName=function(e){n=e},t.getSdkName=function(){return n};var r="https:";t.setProtocol=function(e){r=e},t.getProtocol=function(){return r},t.IS_DEBUG_MODE=!1,t.COMMUNITY_SITE_URL="https://support.qq.com/products/148793"},3519:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERRORS=void 0,t.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"}},1778:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.OATUH_LOGINTYPE=void 0,o(n(8464),t),o(n(3519),t),t.OATUH_LOGINTYPE="constants"},9517:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.catchErrorsDecorator=void 0;var i=n(962),a=n(1778),s=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(s=-1!==navigator.userAgent.indexOf("Firefox"));var c=s?/(\.js\/)?__decorate(\$\d+)?<@.*\d$/:/(\/\w+\.js\.)?__decorate(\$\d+)?\s*\(.*\)$/,u=/https?:\/\/.+:\d*\/.*\.js:\d+:\d+/;function l(e){var t=e.err,n=e.className,r=e.methodName,o=e.sourceLink;if(!o)return null;var i,a=t.stack.split("\n"),c=s?/^catchErrorsDecorator\/<\/descriptor.value@.*\d$/:new RegExp("".concat(n,"\\.descriptor.value\\s*\\[as\\s").concat(r,"\\]\\s*\\(.*\\)$")),l=s?/^catchErrorsDecorator\/<\/descriptor.value/:new RegExp("".concat(n,"\\.descriptor.value\\s*\\[as\\s").concat(r,"\\]")),p=a.findIndex((function(e){return c.test(e)}));if(-1!==p){var d=a.filter((function(e,t){return t>p}));d.unshift(a[p].replace(l,"".concat(n,".").concat(r)).replace(u,o)),(i=new Error).stack="".concat(s?"@debugger":"Error","\n").concat(d.join("\n"))}return i}t.catchErrorsDecorator=function(e){var t=e.mode,n=void 0===t?"async":t,s=e.customInfo,p=void 0===s?{}:s,d=e.title,h=e.messages,f=void 0===h?[]:h;return function(e,t,s){if(a.IS_DEBUG_MODE){var h=p.className||e.constructor.name,m=p.methodName||t,v=s.value,g=function(){var e="",t=(new Error).stack.split("\n"),n=t.findIndex((function(e){return c.test(e)}));if(-1!==n){var r=u.exec(t[n+1]||"");e=r?r[0]:""}return e}();s.value="sync"===n?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=l({err:new Error,className:h,methodName:m,sourceLink:g});try{return v.apply(this,e)}catch(e){var r=e,o=e.message,a=e.error,s=e.error_description,c={title:d||"".concat(h,".").concat(m," failed"),content:[{type:"error",body:e}]};if(o&&/^\{.*\}$/.test(o)){var u=JSON.parse(o);c.subtitle=o,u.code&&(n?(n.code=u.code,n.msg=u.msg):(e.code=u.code,e.message=u.msg),r=n||e,c.content=f.map((function(e){return{type:"info",body:e}})))}throw a&&s&&(c.subtitle=s,n?(n.code=a,n.msg=s):(e.code=a,e.message=s),r=n||e,c.content=f.map((function(e){return{type:"info",body:e}}))),(0,i.printGroupLog)(c),r}}:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r(this,void 0,void 0,(function(){var t,n,r,a,s,c,u,p;return o(this,(function(o){switch(o.label){case 0:t=l({err:new Error,className:h,methodName:m,sourceLink:g}),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,v.apply(this,e)];case 2:return[2,o.sent()];case 3:throw n=o.sent(),r=n,a=n.message,s=n.error,c=n.error_description,u={title:d||"".concat(h,".").concat(m," failed"),content:[{type:"error",body:n}]},a&&/^\{.*\}$/.test(a)&&(p=JSON.parse(a),u.subtitle=p,p.code&&(t?(t.code=p.code,t.message=p.msg):(n.code=p.code,n.message=p.msg),r=t||n,u.content=f.map((function(e){return{type:"info",body:e}})))),s&&c&&(u.subtitle=c,t?(t.code=s,t.msg=c):(n.code=s,n.message=c),r=t||n,u.content=f.map((function(e){return{type:"info",body:e}}))),(0,i.printGroupLog)(u),r;case 4:return[2]}}))}))}}}}},3260:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(9517),t)},2877:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.langEvent=t.AbortController=t.jwt=t.helpers=t.utils=t.events=t.cache=t.adapters=t.constants=void 0;var s=i(n(1778));t.constants=s;var c=i(n(2563));t.adapters=c;var u=i(n(6865));t.cache=u;var l=i(n(6940));t.events=l;var p=i(n(3991));t.langEvent=p;var d=i(n(962));t.utils=d;var h=i(n(3260));t.helpers=h;var f=a(n(829));t.AbortController=f.default;var m={decode:a(n(3107)).default};t.jwt=m},829:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){var e=this;this.listeners=[],this.signal={aborted:!1,addEventListener:function(t,n){"abort"===t&&e.listeners.push(n)}}}return e.prototype.abort=function(){this.signal.aborted||(this.signal.aborted=!0,this.listeners.forEach((function(e){return e()})))},e}();t.default=n},6865:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.CloudbaseCache=void 0;var s=n(2764),c=n(962),u=n(1778),l=function(e){function t(t){var n=e.call(this)||this;return n.root=t,t.tcbCacheObject||(t.tcbCacheObject={}),n}return o(t,e),t.prototype.setItem=function(e,t){this.root.tcbCacheObject[e]=t},t.prototype.getItem=function(e){return this.root.tcbCacheObject[e]},t.prototype.removeItem=function(e){delete this.root.tcbCacheObject[e]},t.prototype.clear=function(){delete this.root.tcbCacheObject},t}(s.AbstractStorage),p=function(){function e(e){this.keys={};var t=e.persistence,n=e.platformInfo,r=void 0===n?{}:n,o=e.keys,i=void 0===o?{}:o;this.platformInfo=r,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||t,this.storage=function(e,t){switch(e){case"local":default:return t.localStorage?t.localStorage:((0,c.printWarn)(u.ERRORS.INVALID_PARAMS,"localStorage is not supported on current platform"),new l(t.root));case"none":return new l(t.root)}}(this.persistenceTag,this.platformInfo.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.persistenceTag},enumerable:!1,configurable:!0}),e.prototype.setStore=function(e,t,n){if("async"!==this.mode){if(this.storage)try{var r={version:n||"localCachev1",content:t};this.storage.setItem(e,JSON.stringify(r))}catch(e){throw new Error(JSON.stringify({code:u.ERRORS.OPERATION_FAIL,msg:"[".concat((0,u.getSdkName)(),"][").concat(u.ERRORS.OPERATION_FAIL,"]setStore failed"),info:e}))}}else(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},e.prototype.setStoreAsync=function(e,t,n){return i(this,void 0,void 0,(function(){var r;return a(this,(function(o){switch(o.label){case 0:if(!this.storage)return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),r={version:n||"localCachev1",content:t},[4,this.storage.setItem(e,JSON.stringify(r))];case 2:return o.sent(),[3,4];case 3:return o.sent(),[2];case 4:return[2]}}))}))},e.prototype.getStore=function(e,t){var n;if("async"!==this.mode){try{if("undefined"!=typeof process&&(null===(n={IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0})||void 0===n?void 0:n.tcb_token))return{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token;if(!this.storage)return""}catch(e){return""}t=t||"localCachev1";var r=this.storage.getItem(e);return r&&r.indexOf(t)>=0?JSON.parse(r).content:""}(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},e.prototype.getStoreAsync=function(e,t){var n;return i(this,void 0,void 0,(function(){var r;return a(this,(function(o){switch(o.label){case 0:try{if("undefined"!=typeof process&&(null===(n={IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0})||void 0===n?void 0:n.tcb_token))return[2,{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token];if(!this.storage)return[2,""]}catch(e){return[2,""]}return t=t||"localCachev1",[4,this.storage.getItem(e)];case 1:return(r=o.sent())&&r.indexOf(t)>=0?[2,JSON.parse(r).content]:[2,""]}}))}))},e.prototype.removeStore=function(e){"async"!==this.mode?this.storage.removeItem(e):(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},e.prototype.removeStoreAsync=function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.storage.removeItem(e)];case 1:return t.sent(),[2]}}))}))},e}();t.CloudbaseCache=p},6940:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.removeEventListener=t.activateEvent=t.addEventListener=t.CloudbaseEventEmitter=t.IErrorEvent=t.CloudbaseEvent=void 0;var a=n(962),s=function(e,t){this.data=t||null,this.name=e};t.CloudbaseEvent=s;var c=function(e){function t(t,n){var r=e.call(this,"error",{error:t,data:n})||this;return r.error=t,r}return o(t,e),t}(s);t.IErrorEvent=c;var u=function(){function e(){this.listeners={}}return e.prototype.on=function(e,t){return function(e,t,n){n[e]=n[e]||[],n[e].push(t)}(e,t,this.listeners),this},e.prototype.off=function(e,t){return function(e,t,n){if(null==n?void 0:n[e]){var r=n[e].indexOf(t);-1!==r&&n[e].splice(r,1)}}(e,t,this.listeners),this},e.prototype.fire=function(e,t){if((0,a.isInstanceOf)(e,c))return console.error(e.error),this;var n=(0,a.isString)(e)?new s(e,t||{}):e,r=n.name;if(this.listens(r)){n.target=this;for(var o=0,u=this.listeners[r]?i([],this.listeners[r],!0):[];o<u.length;o++)u[o].call(this,n)}return this},e.prototype.listens=function(e){return this.listeners[e]&&this.listeners[e].length>0},e}();t.CloudbaseEventEmitter=u;var l=new u;t.addEventListener=function(e,t){l.on(e,t)},t.activateEvent=function(e,t){void 0===t&&(t={}),l.fire(e,t)},t.removeEventListener=function(e,t){l.off(e,t)}},3991:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LANG_CHANGE_EVENT=t.bus=void 0;var r=n(6940);t.bus=new r.CloudbaseEventEmitter,t.LANG_CHANGE_EVENT="lang_change"},962:function(e,t,n){"use strict";var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.parseCaptcha=t.parseQueryString=t.transformPhone=t.sleep=t.printGroupLog=t.throwError=t.printInfo=t.printError=t.printWarn=t.execCallback=t.createPromiseCallback=t.removeParam=t.getHash=t.getQuery=t.toQueryString=t.formatUrl=t.generateRequestId=t.genSeqId=t.isFormData=t.isInstanceOf=t.isNull=t.isPalinObject=t.isUndefined=t.isString=t.isArray=void 0;var o=n(1778);t.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},t.isString=function(e){return"string"==typeof e},t.isUndefined=function(e){return void 0===e},t.isPalinObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},t.isNull=function(e){return"[object Null]"===Object.prototype.toString.call(e)},t.isInstanceOf=function(e,t){return e instanceof t},t.isFormData=function(e){return"[object FormData]"===Object.prototype.toString.call(e)},t.genSeqId=function(){return Math.random().toString(16).slice(2)},t.generateRequestId=function(){var e=(new Date).getTime(),t=(null===Date||void 0===Date?void 0:Date.now)&&1e3*Date.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(n){var r=16*Math.random();return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),("x"===n?r:7&r|8).toString(16)}))},t.formatUrl=function(e,t,n){void 0===n&&(n={});var r=/\?/.test(t),o="";return Object.keys(n).forEach((function(e){""===o?!r&&(t+="?"):o+="&",o+="".concat(e,"=").concat(encodeURIComponent(n[e]))})),/^http(s)?:\/\//.test(t+=o)?t:"".concat(e).concat(t)},t.toQueryString=function(e){void 0===e&&(e={});var t=[];return Object.keys(e).forEach((function(n){t.push("".concat(n,"=").concat(encodeURIComponent(e[n])))})),t.join("&")},t.getQuery=function(e,t){if("undefined"==typeof window)return!1;var n=t||decodeURIComponent(window.location.search),r=new RegExp("(^|&)".concat(e,"=([^&]*)(&|$)")),o=n.substr(n.indexOf("?")+1).match(r);return null!=o?o[2]:""},t.getHash=function(e){if("undefined"==typeof window)return"";var t=window.location.hash.match(new RegExp("[#?&/]".concat(e,"=([^&#]*)")));return t?t[1]:""},t.removeParam=function(e,t){var n=t.split("?")[0],r=[],o=-1!==t.indexOf("?")?t.split("?")[1]:"";if(""!==o){for(var i=(r=o.split("&")).length-1;i>=0;i-=1)r[i].split("=")[0]===e&&r.splice(i,1);n="".concat(n,"?").concat(r.join("&"))}return n},t.createPromiseCallback=function(){var e={};if(!Promise){(e=function(){}).promise={};var t=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}var n=new Promise((function(t,n){e=function(e,r){return e?n(e):t(r)}}));return e.promise=n,e},t.execCallback=function(e,t,n){if(void 0===n&&(n=null),e&&"function"==typeof e)return e(t,n);if(t)throw t;return n},t.printWarn=function(e,t){console.warn("[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t))},t.printError=function(e,t){console.error({code:e,msg:"[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t)})},t.printInfo=function(e,t){console.log("[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t))},t.throwError=function(e,t){throw new Error(JSON.stringify({code:e,msg:"[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t)}))},t.printGroupLog=function(e){var t,n=e.title,r=e.subtitle,o=void 0===r?"":r,i=e.content,a=void 0===i?[]:i,s=e.printTrace,c=void 0!==s&&s,u=e.collapsed;void 0!==u&&u?(console.groupCollapsed||console.error)(n,o):(console.group||console.error)(n,o);for(var l=0,p=a;l<p.length;l++){var d=p[l],h=d.type,f=d.body;switch(h){case"info":console.log(f);break;case"warn":console.warn(f);break;case"error":console.error(f)}}c&&(console.trace||console.log)("stack trace:"),null===(t=console.groupEnd)||void 0===t||t.call(console)},t.sleep=function(e){return void 0===e&&(e=0),new Promise((function(t){return setTimeout(t,e)}))},t.transformPhone=function(e){return"+86".concat(e)},t.parseQueryString=function(e){e=e.replace(/^\?/,"");var t={};return e.split("&").forEach((function(e){var n=e.split("="),r=n[0],o=n[1];r=decodeURIComponent(r),o=decodeURIComponent(o),r&&(t[r]?Array.isArray(t[r])?t[r].push(o):t[r]=[t[r],o]:t[r]=o)})),t},t.parseCaptcha=function(e){var n={},o=e.match(/^(data:.*?)(\?[^#\s]*)?$/);if(o){e=o[1];var i=o[2];i&&(n=(0,t.parseQueryString)(i))}var a=n.token,s=r(n,["token"]);return/^data:/.test(e)&&!a?{error:"invalid_argument",error_description:"invalid captcha data: ".concat(e)}:a?{state:s.state,token:a,captchaData:e}:{error:"unimplemented",error_description:"need to impl captcha data"}}},543:(e,t,n)=>{"use strict";n.r(t),n.d(t,{CollectionReference:()=>He,Db:()=>vt,DocumentReference:()=>De,Query:()=>Be});var r,o,i={};n.r(i),n.d(i,{LineString:()=>G,MultiLineString:()=>J,MultiPoint:()=>K,MultiPolygon:()=>$,Point:()=>oe,Polygon:()=>z}),function(e){e.DocIDError="文档ID不合法",e.CollNameError="集合名称不合法",e.OpStrError="操作符不合法",e.DirectionError="排序字符不合法",e.IntergerError="must be integer",e.QueryParamTypeError="查询参数必须为对象",e.QueryParamValueError="查询参数对象值不能均为undefined"}(o||(o={}));var a,s,c="Object",u="GeoPoint",l="GeoLineString",p="GeoPolygon",d="GeoMultiPoint",h="GeoMultiLineString",f="GeoMultiPolygon",m="Date",v="ServerDate",g=["desc","asc"],b=["<","<=","==",">=",">"];!function(e){e.lt="<",e.gt=">",e.lte="<=",e.gte=">=",e.eq="=="}(a||(a={})),(r={})[a.eq]="$eq",r[a.lt]="$lt",r[a.lte]="$lte",r[a.gt]="$gt",r[a.gte]="$gte",function(e){e.WHERE="WHERE",e.DOC="DOC"}(s||(s={}));var y,_=(y=function(e,t){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},y(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}y(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),x=[],w={},E=function(e){function t(t,n){if(n!==w)throw new TypeError("InternalSymbol cannot be constructed with new operator");return e.call(this,t)||this}return _(t,e),t.for=function(e){for(var n=0,r=x.length;n<r;n++)if(x[n].target===e)return x[n].instance;var o=new t(e,w);return x.push({target:e,instance:o}),o},t}((function(e){Object.defineProperties(this,{target:{enumerable:!1,writable:!1,configurable:!1,value:e}})}));const I=E;var S=I.for("UNSET_FIELD_NAME"),O=I.for("UPDATE_COMMAND"),T=I.for("QUERY_COMMAND"),A=I.for("LOGIC_COMMAND"),P=I.for("GEO_POINT"),C=I.for("SYMBOL_GEO_LINE_STRING"),R=I.for("SYMBOL_GEO_POLYGON"),N=I.for("SYMBOL_GEO_MULTI_POINT"),k=I.for("SYMBOL_GEO_MULTI_LINE_STRING"),j=I.for("SYMBOL_GEO_MULTI_POLYGON"),U=I.for("SERVER_DATE"),D=I.for("REGEXP"),L=function(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()},M=function(e){return"object"===L(e)},q=function(e){return"number"===L(e)},B=function(e){return Array.isArray(e)},F=function(e){return"date"===L(e)},W=function(e){return"regexp"===L(e)},V=function(e){return e&&e._internalType instanceof E},G=function(){function e(e){if(!B(e))throw new TypeError('"points" must be of type Point[]. Received type '.concat(typeof e));if(e.length<2)throw new Error('"points" must contain 2 points at least');e.forEach((function(e){if(!(e instanceof oe))throw new TypeError('"points" must be of type Point[]. Received type '.concat(typeof e,"[]"))})),this.points=e}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"LineString",coordinates:this.points.map((function(e){return e.toJSON().coordinates}))},t},e.prototype.toJSON=function(){return{type:"LineString",coordinates:this.points.map((function(e){return e.toJSON().coordinates}))}},e.validate=function(e){var t,n;if("LineString"!==e.type||!B(e.coordinates))return!1;try{for(var r=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(e.coordinates),o=r.next();!o.done;o=r.next()){var i=o.value;if(!q(i[0])||!q(i[1]))return!1}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!0},e.isClosed=function(e){var t=e.points[0],n=e.points[e.points.length-1];if(t.latitude===n.latitude&&t.longitude===n.longitude)return!0},Object.defineProperty(e.prototype,"_internalType",{get:function(){return C},enumerable:!1,configurable:!0}),e}(),H=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},z=function(){function e(e){if(!B(e))throw new TypeError('"lines" must be of type LineString[]. Received type '.concat(typeof e));if(0===e.length)throw new Error("Polygon must contain 1 linestring at least");e.forEach((function(e){if(!(e instanceof G))throw new TypeError('"lines" must be of type LineString[]. Received type '.concat(typeof e,"[]"));if(!G.isClosed(e))throw new Error("LineString ".concat(e.points.map((function(e){return e.toReadableString()}))," is not a closed cycle"))})),this.lines=e}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"Polygon",coordinates:this.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))},t},e.prototype.toJSON=function(){return{type:"Polygon",coordinates:this.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))}},e.validate=function(e){var t,n,r,o;if("Polygon"!==e.type||!B(e.coordinates))return!1;try{for(var i=H(e.coordinates),a=i.next();!a.done;a=i.next()){var s=a.value;if(!this.isCloseLineString(s))return!1;try{for(var c=(r=void 0,H(s)),u=c.next();!u.done;u=c.next()){var l=u.value;if(!q(l[0])||!q(l[1]))return!1}}catch(e){r={error:e}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return!0},e.isCloseLineString=function(e){var t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]},Object.defineProperty(e.prototype,"_internalType",{get:function(){return j},enumerable:!1,configurable:!0}),e}(),K=function(){function e(e){if(!B(e))throw new TypeError('"points" must be of type Point[]. Received type '.concat(typeof e));if(0===e.length)throw new Error('"points" must contain 1 point at least');e.forEach((function(e){if(!(e instanceof oe))throw new TypeError('"points" must be of type Point[]. Received type '.concat(typeof e,"[]"))})),this.points=e}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"MultiPoint",coordinates:this.points.map((function(e){return e.toJSON().coordinates}))},t},e.prototype.toJSON=function(){return{type:"MultiPoint",coordinates:this.points.map((function(e){return e.toJSON().coordinates}))}},e.validate=function(e){var t,n;if("MultiPoint"!==e.type||!B(e.coordinates))return!1;try{for(var r=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(e.coordinates),o=r.next();!o.done;o=r.next()){var i=o.value;if(!q(i[0])||!q(i[1]))return!1}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!0},Object.defineProperty(e.prototype,"_internalType",{get:function(){return N},enumerable:!1,configurable:!0}),e}(),Y=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},J=function(){function e(e){if(!B(e))throw new TypeError('"lines" must be of type LineString[]. Received type '.concat(typeof e));if(0===e.length)throw new Error("Polygon must contain 1 linestring at least");e.forEach((function(e){if(!(e instanceof G))throw new TypeError('"lines" must be of type LineString[]. Received type '.concat(typeof e,"[]"))})),this.lines=e}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"MultiLineString",coordinates:this.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))},t},e.prototype.toJSON=function(){return{type:"MultiLineString",coordinates:this.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))}},e.validate=function(e){var t,n,r,o;if("MultiLineString"!==e.type||!B(e.coordinates))return!1;try{for(var i=Y(e.coordinates),a=i.next();!a.done;a=i.next()){var s=a.value;try{for(var c=(r=void 0,Y(s)),u=c.next();!u.done;u=c.next()){var l=u.value;if(!q(l[0])||!q(l[1]))return!1}}catch(e){r={error:e}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return!0},Object.defineProperty(e.prototype,"_internalType",{get:function(){return k},enumerable:!1,configurable:!0}),e}(),Q=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},$=function(){function e(e){var t,n;if(!B(e))throw new TypeError('"polygons" must be of type Polygon[]. Received type '.concat(typeof e));if(0===e.length)throw new Error("MultiPolygon must contain 1 polygon at least");try{for(var r=Q(e),o=r.next();!o.done;o=r.next()){var i=o.value;if(!(i instanceof z))throw new TypeError('"polygon" must be of type Polygon[]. Received type '.concat(typeof i,"[]"))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}this.polygons=e}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"MultiPolygon",coordinates:this.polygons.map((function(e){return e.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))}))},t},e.prototype.toJSON=function(){return{type:"MultiPolygon",coordinates:this.polygons.map((function(e){return e.lines.map((function(e){return e.points.map((function(e){return[e.longitude,e.latitude]}))}))}))}},e.validate=function(e){var t,n,r,o,i,a;if("MultiPolygon"!==e.type||!B(e.coordinates))return!1;try{for(var s=Q(e.coordinates),c=s.next();!c.done;c=s.next()){var u=c.value;try{for(var l=(r=void 0,Q(u)),p=l.next();!p.done;p=l.next()){var d=p.value;try{for(var h=(i=void 0,Q(d)),f=h.next();!f.done;f=h.next()){var m=f.value;if(!q(m[0])||!q(m[1]))return!1}}catch(e){i={error:e}}finally{try{f&&!f.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{p&&!p.done&&(o=l.return)&&o.call(l)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return!0},Object.defineProperty(e.prototype,"_internalType",{get:function(){return R},enumerable:!1,configurable:!0}),e}(),X=function(){function e(e){var t=(void 0===e?{}:e).offset,n=void 0===t?0:t;this.offset=n}return Object.defineProperty(e.prototype,"_internalType",{get:function(){return U},enumerable:!1,configurable:!0}),e.prototype.parse=function(){return{$date:{offset:this.offset}}},e}();function Z(e){return new X(e)}var ee,te=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},ne=function(){function e(){}return e.formatResDocumentData=function(t){return t.map((function(t){return e.formatField(t)}))},e.formatField=function(t){var n=Object.keys(t),r={};return Array.isArray(t)&&(r=[]),n.forEach((function(n){var o,i=t[n];switch(e.whichType(i)){case u:o=new oe(i.coordinates[0],i.coordinates[1]);break;case l:o=new G(i.coordinates.map((function(e){return new oe(e[0],e[1])})));break;case p:o=new z(i.coordinates.map((function(e){return new G(e.map((function(e){var t=te(e,2),n=t[0],r=t[1];return new oe(n,r)})))})));break;case d:o=new K(i.coordinates.map((function(e){return new oe(e[0],e[1])})));break;case h:o=new J(i.coordinates.map((function(e){return new G(e.map((function(e){var t=te(e,2),n=t[0],r=t[1];return new oe(n,r)})))})));break;case f:o=new $(i.coordinates.map((function(e){return new z(e.map((function(e){return new G(e.map((function(e){var t=te(e,2),n=t[0],r=t[1];return new oe(n,r)})))})))})));break;case m:o=new Date(1e3*i.$timestamp);break;case c:case"Array":o=e.formatField(i);break;case v:o=new Date(i.$date);break;default:o=i}Array.isArray(r)?r.push(o):r[n]=o})),r},e.whichType=function(e){var t=Object.prototype.toString.call(e).slice(8,-1);if(t===m)return"BsonDate";if(t===c){if(e instanceof oe)return u;if(e instanceof Date)return m;if(e instanceof X)return v;e.$timestamp?t=m:e.$date?t=v:oe.validate(e)?t=u:G.validate(e)?t=l:z.validate(e)?t=p:K.validate(e)?t=d:J.validate(e)?t=h:$.validate(e)&&(t=f)}return t},e.generateDocId=function(){for(var e="",t=0;t<24;t++)e+="ABCDEFabcdef0123456789".charAt(Math.floor(22*Math.random()));return e},e}(),re=function(){function e(){}return e.isGeopoint=function(e,t){if("Number"!==ne.whichType(t))throw new Error("Geo Point must be number type");var n=Math.abs(t);if("latitude"===e&&n>90)throw new Error("latitude should be a number ranges from -90 to 90");if("longitude"===e&&n>180)throw new Error("longitude should be a number ranges from -180 to 180");return!0},e.isInteger=function(e,t){if(!Number.isInteger(t))throw new Error(e+o.IntergerError);return!0},e.isFieldOrder=function(e){if(-1===g.indexOf(e))throw new Error(o.DirectionError);return!0},e.isFieldPath=function(e){if(!/^[a-zA-Z0-9-_\.]/.test(e))throw new Error;return!0},e.isOperator=function(e){if(-1===b.indexOf(e))throw new Error(o.OpStrError);return!0},e.isCollName=function(e){if(!/^[a-zA-Z0-9]([a-zA-Z0-9-_]){1,32}$/.test(e))throw new Error(o.CollNameError);return!0},e.isDocID=function(e){if(!/^([a-fA-F0-9]){24}$/.test(e))throw new Error(o.DocIDError);return!0},e}(),oe=function(){function e(e,t){re.isGeopoint("longitude",e),re.isGeopoint("latitude",t),this.longitude=e,this.latitude=t}return e.prototype.parse=function(e){var t;return(t={})[e]={type:"Point",coordinates:[this.longitude,this.latitude]},t},e.prototype.toJSON=function(){return{type:"Point",coordinates:[this.longitude,this.latitude]}},e.prototype.toReadableString=function(){return"[".concat(this.longitude,",").concat(this.latitude,"]")},e.validate=function(e){return"Point"===e.type&&B(e.coordinates)&&re.isGeopoint("longitude",e.coordinates[0])&&re.isGeopoint("latitude",e.coordinates[1])},Object.defineProperty(e.prototype,"_internalType",{get:function(){return P},enumerable:!1,configurable:!0}),e}(),ie=function(){var e=function(){};if(!Promise){e.promise={};var t=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}var n=new Promise((function(t,n){e=function(e,r){return e?n(e):t(r)}}));return e.promise=n,e};!function(e){e.SET="set",e.REMOVE="remove",e.INC="inc",e.MUL="mul",e.PUSH="push",e.PULL="pull",e.PULL_ALL="pullAll",e.POP="pop",e.SHIFT="shift",e.UNSHIFT="unshift",e.ADD_TO_SET="addToSet",e.BIT="bit",e.RENAME="rename",e.MAX="max",e.MIN="min"}(ee||(ee={}));var ae,se=function(){function e(e,t,n){this._internalType=O,Object.defineProperties(this,{_internalType:{enumerable:!1,configurable:!1}}),this.operator=e,this.operands=t,this.fieldName=n||S}return e.prototype._setFieldName=function(t){return new e(this.operator,this.operands,t)},e}();function ce(e){return e&&e instanceof se&&e._internalType===O}!function(e){e.AND="and",e.OR="or",e.NOT="not",e.NOR="nor"}(ae||(ae={}));var ue=function(){function e(e,t,n){if(this._internalType=A,Object.defineProperties(this,{_internalType:{enumerable:!1,configurable:!1}}),this.operator=e,this.operands=t,this.fieldName=n||S,this.fieldName!==S)if(Array.isArray(t)){t=t.slice(),this.operands=t;for(var r=0,o=t.length;r<o;r++)(le(i=t[r])||fe(i))&&(t[r]=i._setFieldName(this.fieldName))}else{var i;(le(i=t)||fe(i))&&(t=i._setFieldName(this.fieldName))}}return e.prototype._setFieldName=function(t){var n=this.operands.map((function(n){return n instanceof e?n._setFieldName(t):n}));return new e(this.operator,n,t)},e.prototype.and=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=Array.isArray(arguments[0])?arguments[0]:Array.from(arguments);return r.unshift(this),new e(ae.AND,r,this.fieldName)},e.prototype.or=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=Array.isArray(arguments[0])?arguments[0]:Array.from(arguments);return r.unshift(this),new e(ae.OR,r,this.fieldName)},e}();function le(e){return e&&e instanceof ue&&e._internalType===A}var pe,de=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){e.EQ="eq",e.NEQ="neq",e.GT="gt",e.GTE="gte",e.LT="lt",e.LTE="lte",e.IN="in",e.NIN="nin",e.ALL="all",e.ELEM_MATCH="elemMatch",e.EXISTS="exists",e.SIZE="size",e.MOD="mod",e.GEO_NEAR="geoNear",e.GEO_WITHIN="geoWithin",e.GEO_INTERSECTS="geoIntersects"}(pe||(pe={}));var he=function(e){function t(t,n,r){var o=e.call(this,t,n,r)||this;return o.operator=t,o._internalType=T,o}return de(t,e),t.prototype.toJSON=function(){var e,t;switch(this.operator){case pe.IN:case pe.NIN:return(e={})["$"+this.operator]=this.operands,e;default:return(t={})["$"+this.operator]=this.operands[0],t}},t.prototype._setFieldName=function(e){return new t(this.operator,this.operands,e)},t.prototype.eq=function(e){var n=new t(pe.EQ,[e],this.fieldName);return this.and(n)},t.prototype.neq=function(e){var n=new t(pe.NEQ,[e],this.fieldName);return this.and(n)},t.prototype.gt=function(e){var n=new t(pe.GT,[e],this.fieldName);return this.and(n)},t.prototype.gte=function(e){var n=new t(pe.GTE,[e],this.fieldName);return this.and(n)},t.prototype.lt=function(e){var n=new t(pe.LT,[e],this.fieldName);return this.and(n)},t.prototype.lte=function(e){var n=new t(pe.LTE,[e],this.fieldName);return this.and(n)},t.prototype.in=function(e){var n=new t(pe.IN,e,this.fieldName);return this.and(n)},t.prototype.nin=function(e){var n=new t(pe.NIN,e,this.fieldName);return this.and(n)},t.prototype.geoNear=function(e){if(!(e.geometry instanceof oe))throw new TypeError('"geometry" must be of type Point. Received type '.concat(typeof e.geometry));if(void 0!==e.maxDistance&&!q(e.maxDistance))throw new TypeError('"maxDistance" must be of type Number. Received type '.concat(typeof e.maxDistance));if(void 0!==e.minDistance&&!q(e.minDistance))throw new TypeError('"minDistance" must be of type Number. Received type '.concat(typeof e.minDistance));var n=new t(pe.GEO_NEAR,[e],this.fieldName);return this.and(n)},t.prototype.geoWithin=function(e){if(!(e.geometry instanceof $||e.geometry instanceof z))throw new TypeError('"geometry" must be of type Polygon or MultiPolygon. Received type '.concat(typeof e.geometry));var n=new t(pe.GEO_WITHIN,[e],this.fieldName);return this.and(n)},t.prototype.geoIntersects=function(e){if(!(e.geometry instanceof oe||e.geometry instanceof G||e.geometry instanceof z||e.geometry instanceof K||e.geometry instanceof J||e.geometry instanceof $))throw new TypeError('"geometry" must be of type Point, LineString, Polygon, MultiPoint, MultiLineString or MultiPolygon. Received type '.concat(typeof e.geometry));var n=new t(pe.GEO_INTERSECTS,[e],this.fieldName);return this.and(n)},t}(ue);function fe(e){return e&&e instanceof he&&e._internalType===T}function me(e){return fe(e)}var ve={};for(var ge in pe)ve[ge]="$"+ge;for(var ge in ae)ve[ge]="$"+ge;for(var ge in ee)ve[ge]="$"+ge;function be(e){return ve[e]||"$"+e}ve[pe.NEQ]="$ne",ve[ee.REMOVE]="$unset",ve[ee.SHIFT]="$pop",ve[ee.UNSHIFT]="$push";var ye=function(){return ye=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ye.apply(this,arguments)},_e=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},xe=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function we(e){return Ee(e,[e])}function Ee(e,t){if(!V(e)){if(F(e))return{$date:+e};if(W(e))return{$regex:e.source,$options:e.flags};if(B(e))return e.map((function(e){if(t.indexOf(e)>-1)throw new Error("Cannot convert circular structure to JSON");return Ee(e,xe(xe([],_e(t),!1),[e],!1))}));if(M(e)){var n=ye({},e);for(var r in n){if(t.indexOf(n[r])>-1)throw new Error("Cannot convert circular structure to JSON");n[r]=Ee(n[r],xe(xe([],_e(t),!1),[n[r]],!1))}return n}return e}switch(e._internalType){case P:return e.toJSON();case U:case D:return e.parse();default:return e.toJSON?e.toJSON():e}}var Ie=function(){return Ie=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ie.apply(this,arguments)},Se=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Oe=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function Te(e,t,n,r){var o=Ie({},e);for(var i in e)if(!/^\$/.test(i)){var a=e[i];if(a&&M(a)&&!t(a)){if(r.indexOf(a)>-1)throw new Error("Cannot convert circular structure to JSON");var s=Te(a,t,Oe(Oe([],Se(n),!1),[i],!1),Oe(Oe([],Se(r),!1),[a],!1));o[i]=s;var c=!1;for(var u in s)/^\$/.test(u)?c=!0:(o["".concat(i,".").concat(u)]=s[u],delete o[i][u]);c||delete o[i]}}return o}function Ae(e){return Te(e,Ce,[],[e])}function Pe(e,t,n){for(var r in t[n]||delete e[n],t)e[r]?B(e[r])?e[r].push(t[r]):M(e[r])?M(t[r])?Object.assign(e[r],t[r]):(console.warn("unmergable condition, query is object but condition is ".concat(L(t),", can only overwrite"),t,n),e[r]=t[r]):(console.warn("to-merge query is of type ".concat(L(e),", can only overwrite"),e,t,n),e[r]=t[r]):e[r]=t[r]}function Ce(e){return V(e)||F(e)||W(e)}function Re(e){return we(e)}var Ne=function(){function e(){}return e.encode=function(t){return(new e).encodeUpdate(t)},e.prototype.encodeUpdate=function(e){return ce(e)?this.encodeUpdateCommand(e):"object"===L(e)?this.encodeUpdateObject(e):e},e.prototype.encodeUpdateCommand=function(e){if(e.fieldName===S)throw new Error("Cannot encode a comparison command with unset field name");switch(e.operator){case ee.PUSH:case ee.PULL:case ee.PULL_ALL:case ee.POP:case ee.SHIFT:case ee.UNSHIFT:case ee.ADD_TO_SET:return this.encodeArrayUpdateCommand(e);default:return this.encodeFieldUpdateCommand(e)}},e.prototype.encodeFieldUpdateCommand=function(e){var t,n,r,o,i=be(e.operator);return e.operator===ee.REMOVE?((t={})[i]=((n={})[e.fieldName]="",n),t):((r={})[i]=((o={})[e.fieldName]=e.operands[0],o),r)},e.prototype.encodeArrayUpdateCommand=function(e){var t,n,r,o,i,a,s,c,u,l,p=be(e.operator);switch(e.operator){case ee.PUSH:var d=void 0;return d=B(e.operands)?{$each:e.operands.map(Re)}:e.operands,(t={})[p]=((n={})[e.fieldName]=d,n),t;case ee.UNSHIFT:return d={$each:e.operands.map(Re),$position:0},(r={})[p]=((o={})[e.fieldName]=d,o),r;case ee.POP:return(i={})[p]=((a={})[e.fieldName]=1,a),i;case ee.SHIFT:return(s={})[p]=((c={})[e.fieldName]=-1,c),s;default:return(u={})[p]=((l={})[e.fieldName]=Re(e.operands),l),u}},e.prototype.encodeUpdateObject=function(e){var t=Ae(e);for(var n in t)if(!/^\$/.test(n)){var r=t[n];if(ce(r))t[n]=r._setFieldName(n),Pe(t,this.encodeUpdateCommand(t[n]),n);else{t[n]=r=Re(r);var o=new se(ee.SET,[r],n);Pe(t,this.encodeUpdateCommand(o),n)}}return t},e}(),ke={};function je(e){if(!vt.wsClientClass)throw new Error("to use realtime you must import realtime module first");var t=e.config.env;return ke[t]||(ke[t]=new vt.wsClientClass({context:{appConfig:{docSizeLimit:1e3,realtimePingInterval:1e4,realtimePongWaitTimeout:5e3,request:vt.createRequest(e.config)}}})),ke[t]}var Ue=function(){return Ue=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ue.apply(this,arguments)},De=function(){function e(e,t,n,r){void 0===r&&(r={});var o=this;this.watch=function(e){return je(o._db).watch(Ue(Ue({},e),{envId:o._db.config.env,collectionName:o._coll,query:JSON.stringify({_id:o.id})}))},this._db=e,this._coll=t,this.id=n,this.request=vt.createRequest(this._db.config),this.projection=r}return e.prototype.create=function(e,t){t=t||ie();var n=Array.isArray(e),r={collectionName:this._coll,data:n?e.map((function(e){return we(e)})):we(e)};return!n&&this.id&&(r._id=this.id),this.request.send("database.addDocument",r).then((function(e){var r;e.code?t(0,e):t(0,n?{ids:(null===(r=e.data)||void 0===r?void 0:r.insertedIds)||[],requestId:e.requestId}:{id:e.data._id,requestId:e.requestId})})).catch((function(e){t(e)})),t.promise},e.prototype.set=function(e,t){if(t=t||ie(),!this.id)return Promise.resolve({code:"INVALID_PARAM",message:"docId不能为空"});if(!e||"object"!=typeof e)return Promise.resolve({code:"INVALID_PARAM",message:"参数必需是非空对象"});if(e.hasOwnProperty("_id"))return Promise.resolve({code:"INVALID_PARAM",message:"不能更新_id的值"});var n=!1,r=function(e){if("object"==typeof e)for(var t in e)e[t]instanceof se?n=!0:"object"==typeof e[t]&&r(e[t])};if(r(e),n)return Promise.resolve({code:"DATABASE_REQUEST_FAILED",message:"update operator complicit"});var o={collectionName:this._coll,queryType:s.DOC,data:we(e),multi:!1,merge:!1,upsert:!0};return this.id&&(o.query={_id:this.id}),this.request.send("database.updateDocument",o).then((function(e){e.code?t(0,e):t(0,{updated:e.data.updated,upsertedId:e.data.upserted_id,requestId:e.requestId})})).catch((function(e){t(e)})),t.promise},e.prototype.update=function(e,t){if(t=t||ie(),!e||"object"!=typeof e)return Promise.resolve({code:"INVALID_PARAM",message:"参数必需是非空对象"});if(e.hasOwnProperty("_id"))return Promise.resolve({code:"INVALID_PARAM",message:"不能更新_id的值"});var n={_id:this.id},r={collectionName:this._coll,data:Ne.encode(e),query:n,queryType:s.DOC,multi:!1,merge:!0,upsert:!1};return this.request.send("database.updateDocument",r).then((function(e){e.code?t(0,e):t(0,{updated:e.data.updated,upsertedId:e.data.upserted_id,requestId:e.requestId})})).catch((function(e){t(e)})),t.promise},e.prototype.remove=function(e){e=e||ie();var t={_id:this.id},n={collectionName:this._coll,query:t,queryType:s.DOC,multi:!1};return this.request.send("database.deleteDocument",n).then((function(t){t.code?e(0,t):e(0,{deleted:t.data.deleted,requestId:t.requestId})})).catch((function(t){e(t)})),e.promise},e.prototype.get=function(e){e=e||ie();var t={_id:this.id},n={collectionName:this._coll,query:t,queryType:s.DOC,multi:!1,projection:this.projection};return this.request.send("database.queryDocument",n).then((function(t){if(t.code)e(0,t);else{var n=ne.formatResDocumentData(t.data.list);e(0,{data:n,requestId:t.requestId})}})).catch((function(t){e(t)})),e.promise},e.prototype.field=function(t){for(var n in t)t[n]?t[n]=1:t[n]=0;return new e(this._db,this._coll,this.id,t)},e}(),Le=function(){function e(){}return e.encode=function(e){return(new Me).encodeQuery(e)},e}(),Me=function(){function e(){}return e.prototype.encodeQuery=function(e,t){var n;return Ce(e)?le(e)?this.encodeLogicCommand(e):fe(e)?this.encodeQueryCommand(e):((n={})[t]=this.encodeQueryObject(e),n):M(e)?this.encodeQueryObject(e):e},e.prototype.encodeRegExp=function(e){return{$regex:e.source,$options:e.flags}},e.prototype.encodeLogicCommand=function(e){var t,n,r,o,i,a,s,c=this;switch(e.operator){case ae.NOR:case ae.AND:case ae.OR:var u=be(e.operator),l=e.operands.map((function(t){return c.encodeQuery(t,e.fieldName)}));return(t={})[u]=l,t;case ae.NOT:u=be(e.operator);var p=e.operands[0];return W(p)?((n={})[e.fieldName]=((r={})[u]=this.encodeRegExp(p),r),n):(l=this.encodeQuery(p)[e.fieldName],(o={})[e.fieldName]=((i={})[u]=l,i),o);default:if(u=be(e.operator),1===e.operands.length){var d=this.encodeQuery(e.operands[0]);return(a={})[u]=d,a}return l=e.operands.map(this.encodeQuery.bind(this)),(s={})[u]=l,s}},e.prototype.encodeQueryCommand=function(e){return me(e),this.encodeComparisonCommand(e)},e.prototype.encodeComparisonCommand=function(e){var t,n,r,o,i,a,s,c,u;if(e.fieldName===S)throw new Error("Cannot encode a comparison command with unset field name");var l=be(e.operator);switch(e.operator){case pe.EQ:case pe.NEQ:case pe.LT:case pe.LTE:case pe.GT:case pe.GTE:case pe.ELEM_MATCH:case pe.EXISTS:case pe.SIZE:case pe.MOD:return(t={})[e.fieldName]=((n={})[l]=Re(e.operands[0]),n),t;case pe.IN:case pe.NIN:case pe.ALL:return(r={})[e.fieldName]=((o={})[l]=Re(e.operands),o),r;case pe.GEO_NEAR:var p=e.operands[0];return(i={})[e.fieldName]={$nearSphere:{$geometry:p.geometry.toJSON(),$maxDistance:p.maxDistance,$minDistance:p.minDistance}},i;case pe.GEO_WITHIN:return p=e.operands[0],(a={})[e.fieldName]={$geoWithin:{$geometry:p.geometry.toJSON()}},a;case pe.GEO_INTERSECTS:return p=e.operands[0],(s={})[e.fieldName]={$geoIntersects:{$geometry:p.geometry.toJSON()}},s;default:return(c={})[e.fieldName]=((u={})[l]=Re(e.operands[0]),u),c}},e.prototype.encodeQueryObject=function(e){var t=Ae(e);for(var n in t){var r=t[n];if(le(r)){t[n]=r._setFieldName(n);var o=this.encodeLogicCommand(t[n]);this.mergeConditionAfterEncode(t,o,n)}else me(r)?(t[n]=r._setFieldName(n),o=this.encodeComparisonCommand(t[n]),this.mergeConditionAfterEncode(t,o,n)):Ce(r)&&(t[n]=Re(r))}return t},e.prototype.mergeConditionAfterEncode=function(e,t,n){for(var r in t[n]||delete e[n],t)e[r]?B(e[r])?e[r]=e[r].concat(t[r]):M(e[r])?M(t[r])?Object.assign(e,t):(console.warn("unmergable condition, query is object but condition is ".concat(L(t),", can only overwrite"),t,n),e[r]=t[r]):(console.warn("to-merge query is of type ".concat(L(e),", can only overwrite"),e,t,n),e[r]=t[r]):e[r]=t[r]},e}(),qe=function(){return qe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},qe.apply(this,arguments)},Be=function(){function e(e,t,n,r,o){var i=this;this.watch=function(e){return je(i._db).watch(qe(qe({},e),{envId:i._db.config.env,collectionName:i._coll,query:JSON.stringify(i._fieldFilters||{}),limit:i._queryOptions.limit,orderBy:i._fieldOrders?i._fieldOrders.reduce((function(e,t){return e[t.field]=t.direction,e}),{}):void 0}))},this._db=e,this._coll=t,this._fieldFilters=n,this._fieldOrders=r||[],this._queryOptions=o||{},this._request=vt.createRequest(this._db.config)}return e.prototype.get=function(e){e=e||ie();var t=[];this._fieldOrders&&this._fieldOrders.forEach((function(e){t.push(e)}));var n={collectionName:this._coll,queryType:s.WHERE};return this._fieldFilters&&(n.query=this._fieldFilters),t.length>0&&(n.order=t),this._queryOptions.offset&&(n.offset=this._queryOptions.offset),this._queryOptions.limit?n.limit=this._queryOptions.limit<1e3?this._queryOptions.limit:1e3:n.limit=100,this._queryOptions.projection&&(n.projection=this._queryOptions.projection),this._request.send("database.queryDocument",n).then((function(t){if(t.code)e(0,t);else{var n={data:ne.formatResDocumentData(t.data.list),requestId:t.requestId};void 0!==t.total&&(n.total=t.total),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.offset&&(n.offset=t.offset),e(0,n)}})).catch((function(t){e(t)})),e.promise},e.prototype.count=function(e){e=e||ie();var t={collectionName:this._coll,queryType:s.WHERE};return this._fieldFilters&&(t.query=this._fieldFilters),this._request.send("database.countDocument",t).then((function(t){t.code?e(0,t):e(0,{requestId:t.requestId,total:t.data.total})})).catch((function(t){e(t)})),e.promise},e.prototype.where=function(t){if("Object"!==Object.prototype.toString.call(t).slice(8,-1))throw Error(o.QueryParamTypeError);var n=Object.keys(t),r=n.some((function(e){return void 0!==t[e]}));if(n.length&&!r)throw Error(o.QueryParamValueError);return new e(this._db,this._coll,Le.encode(t),this._fieldOrders,this._queryOptions)},e.prototype.orderBy=function(t,n){re.isFieldPath(t),re.isFieldOrder(n);var r={field:t,direction:n},o=this._fieldOrders.concat(r);return new e(this._db,this._coll,this._fieldFilters,o,this._queryOptions)},e.prototype.limit=function(t){re.isInteger("limit",t);var n=qe({},this._queryOptions);return n.limit=t,new e(this._db,this._coll,this._fieldFilters,this._fieldOrders,n)},e.prototype.skip=function(t){re.isInteger("offset",t);var n=qe({},this._queryOptions);return n.offset=t,new e(this._db,this._coll,this._fieldFilters,this._fieldOrders,n)},e.prototype.update=function(e,t){if(t=t||ie(),!e||"object"!=typeof e)return Promise.resolve({code:"INVALID_PARAM",message:"参数必需是非空对象"});if(e.hasOwnProperty("_id"))return Promise.resolve({code:"INVALID_PARAM",message:"不能更新_id的值"});var n={collectionName:this._coll,query:this._fieldFilters,queryType:s.WHERE,multi:!0,merge:!0,upsert:!1,data:Ne.encode(e)};return this._request.send("database.updateDocument",n).then((function(e){e.code?t(0,e):t(0,{requestId:e.requestId,updated:e.data.updated,upsertId:e.data.upsert_id})})).catch((function(e){t(e)})),t.promise},e.prototype.field=function(t){for(var n in t)t[n]?"object"!=typeof t[n]&&(t[n]=1):t[n]=0;var r=qe({},this._queryOptions);return r.projection=t,new e(this._db,this._coll,this._fieldFilters,this._fieldOrders,r)},e.prototype.remove=function(e){e=e||ie(),Object.keys(this._queryOptions).length>0&&console.warn("`offset`, `limit` and `projection` are not supported in remove() operation"),this._fieldOrders.length>0&&console.warn("`orderBy` is not supported in remove() operation");var t={collectionName:this._coll,query:Le.encode(this._fieldFilters),queryType:s.WHERE,multi:!0};return this._request.send("database.deleteDocument",t).then((function(t){t.code?e(0,t):e(0,{requestId:t.requestId,deleted:t.data.deleted})})).catch((function(t){e(t)})),e.promise},e}(),Fe=n(2701),We=function(){function e(e,t){this._stages=[],e&&t&&(this._db=e,this._request=vt.createRequest(this._db.config),this._collectionName=t)}return e.prototype.end=function(){return e=this,t=void 0,r=function(){var e;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}(this,(function(t){switch(t.label){case 0:if(!this._collectionName||!this._db)throw new Error("Aggregation pipeline cannot send request");return[4,this._request.send("database.aggregate",{collectionName:this._collectionName,stages:this._stages})];case 1:return(e=t.sent())&&e.data&&e.data.list?[2,{requestId:e.requestId,data:JSON.parse(e.data.list).map(Fe.EJSON.parse)}]:[2,e]}}))},new((n=void 0)||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}));var e,t,n,r},e.prototype.unwrap=function(){return this._stages},e.prototype.done=function(){return this._stages.map((function(e){var t,n=e.stageKey,r=e.stageValue;return(t={})[n]=JSON.parse(r),t}))},e.prototype._pipe=function(e,t){return this._stages.push({stageKey:"$".concat(e),stageValue:JSON.stringify(t)}),this},e.prototype.addFields=function(e){return this._pipe("addFields",e)},e.prototype.bucket=function(e){return this._pipe("bucket",e)},e.prototype.bucketAuto=function(e){return this._pipe("bucketAuto",e)},e.prototype.count=function(e){return this._pipe("count",e)},e.prototype.geoNear=function(e){return e.query&&(e.query=Le.encode(e.query)),e.distanceMultiplier&&"number"==typeof e.distanceMultiplier&&(e.distanceMultiplier=e.distanceMultiplier),e.near&&(e.near=new oe(e.near.longitude,e.near.latitude).toJSON()),this._pipe("geoNear",e)},e.prototype.group=function(e){return this._pipe("group",e)},e.prototype.limit=function(e){return this._pipe("limit",e)},e.prototype.match=function(e){return this._pipe("match",Le.encode(e))},e.prototype.project=function(e){return this._pipe("project",e)},e.prototype.lookup=function(e){return this._pipe("lookup",e)},e.prototype.replaceRoot=function(e){return this._pipe("replaceRoot",e)},e.prototype.sample=function(e){return this._pipe("sample",e)},e.prototype.skip=function(e){return this._pipe("skip",e)},e.prototype.sort=function(e){return this._pipe("sort",e)},e.prototype.sortByCount=function(e){return this._pipe("sortByCount",e)},e.prototype.unwind=function(e){return this._pipe("unwind",e)},e}();const Ve=We;var Ge=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),He=function(e){function t(t,n){return e.call(this,t,n)||this}return Ge(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return this._coll},enumerable:!1,configurable:!0}),t.prototype.doc=function(e){if("string"!=typeof e&&"number"!=typeof e)throw new Error("docId必须为字符串或数字");return new De(this._db,this._coll,e)},t.prototype.add=function(e,t){return new De(this._db,this._coll,void 0).create(e,t)},t.prototype.aggregate=function(){return new Ve(this._db,this._coll)},t}(Be),ze={eq:function(e){return new he(pe.EQ,[e])},neq:function(e){return new he(pe.NEQ,[e])},lt:function(e){return new he(pe.LT,[e])},lte:function(e){return new he(pe.LTE,[e])},gt:function(e){return new he(pe.GT,[e])},gte:function(e){return new he(pe.GTE,[e])},in:function(e){return new he(pe.IN,e)},nin:function(e){return new he(pe.NIN,e)},all:function(e){return new he(pe.ALL,e)},elemMatch:function(e){return new he(pe.ELEM_MATCH,[e])},exists:function(e){return new he(pe.EXISTS,[e])},size:function(e){return new he(pe.SIZE,[e])},mod:function(e){return new he(pe.MOD,[e])},geoNear:function(e){return new he(pe.GEO_NEAR,[e])},geoWithin:function(e){return new he(pe.GEO_WITHIN,[e])},geoIntersects:function(e){return new he(pe.GEO_INTERSECTS,[e])},and:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=B(arguments[0])?arguments[0]:Array.from(arguments);return new ue(ae.AND,n)},nor:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=B(arguments[0])?arguments[0]:Array.from(arguments);return new ue(ae.NOR,n)},or:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=B(arguments[0])?arguments[0]:Array.from(arguments);return new ue(ae.OR,n)},not:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=B(arguments[0])?arguments[0]:Array.from(arguments);return new ue(ae.NOT,n)},set:function(e){return new se(ee.SET,[e])},remove:function(){return new se(ee.REMOVE,[])},inc:function(e){return new se(ee.INC,[e])},mul:function(e){return new se(ee.MUL,[e])},push:function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(M(t[0])&&t[0].hasOwnProperty("each")){var r=t[0];e={$each:r.each,$position:r.position,$sort:r.sort,$slice:r.slice}}else e=B(t[0])?t[0]:Array.from(t);return new se(ee.PUSH,e)},pull:function(e){return new se(ee.PULL,e)},pullAll:function(e){return new se(ee.PULL_ALL,e)},pop:function(){return new se(ee.POP,[])},shift:function(){return new se(ee.SHIFT,[])},unshift:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=B(arguments[0])?arguments[0]:Array.from(arguments);return new se(ee.UNSHIFT,n)},addToSet:function(e){return new se(ee.ADD_TO_SET,e)},rename:function(e){return new se(ee.RENAME,[e])},bit:function(e){return new se(ee.BIT,[e])},max:function(e){return new se(ee.MAX,[e])},min:function(e){return new se(ee.MIN,[e])},expr:function(e){return{$expr:e}},jsonSchema:function(e){return{$jsonSchema:e}},text:function(e){return"string"===L(e)?{$search:e.search}:{$search:e.search,$language:e.language,$caseSensitive:e.caseSensitive,$diacriticSensitive:e.diacriticSensitive}},aggregate:{pipeline:function(){return new Ve},abs:function(e){return new Ke("abs",e)},add:function(e){return new Ke("add",e)},ceil:function(e){return new Ke("ceil",e)},divide:function(e){return new Ke("divide",e)},exp:function(e){return new Ke("exp",e)},floor:function(e){return new Ke("floor",e)},ln:function(e){return new Ke("ln",e)},log:function(e){return new Ke("log",e)},log10:function(e){return new Ke("log10",e)},mod:function(e){return new Ke("mod",e)},multiply:function(e){return new Ke("multiply",e)},pow:function(e){return new Ke("pow",e)},sqrt:function(e){return new Ke("sqrt",e)},subtract:function(e){return new Ke("subtract",e)},trunc:function(e){return new Ke("trunc",e)},arrayElemAt:function(e){return new Ke("arrayElemAt",e)},arrayToObject:function(e){return new Ke("arrayToObject",e)},concatArrays:function(e){return new Ke("concatArrays",e)},filter:function(e){return new Ke("filter",e)},in:function(e){return new Ke("in",e)},indexOfArray:function(e){return new Ke("indexOfArray",e)},isArray:function(e){return new Ke("isArray",e)},map:function(e){return new Ke("map",e)},range:function(e){return new Ke("range",e)},reduce:function(e){return new Ke("reduce",e)},reverseArray:function(e){return new Ke("reverseArray",e)},size:function(e){return new Ke("size",e)},slice:function(e){return new Ke("slice",e)},zip:function(e){return new Ke("zip",e)},and:function(e){return new Ke("and",e)},not:function(e){return new Ke("not",e)},or:function(e){return new Ke("or",e)},cmp:function(e){return new Ke("cmp",e)},eq:function(e){return new Ke("eq",e)},gt:function(e){return new Ke("gt",e)},gte:function(e){return new Ke("gte",e)},lt:function(e){return new Ke("lt",e)},lte:function(e){return new Ke("lte",e)},neq:function(e){return new Ke("ne",e)},cond:function(e){return new Ke("cond",e)},ifNull:function(e){return new Ke("ifNull",e)},switch:function(e){return new Ke("switch",e)},dateFromParts:function(e){return new Ke("dateFromParts",e)},dateFromString:function(e){return new Ke("dateFromString",e)},dayOfMonth:function(e){return new Ke("dayOfMonth",e)},dayOfWeek:function(e){return new Ke("dayOfWeek",e)},dayOfYear:function(e){return new Ke("dayOfYear",e)},isoDayOfWeek:function(e){return new Ke("isoDayOfWeek",e)},isoWeek:function(e){return new Ke("isoWeek",e)},isoWeekYear:function(e){return new Ke("isoWeekYear",e)},millisecond:function(e){return new Ke("millisecond",e)},minute:function(e){return new Ke("minute",e)},month:function(e){return new Ke("month",e)},second:function(e){return new Ke("second",e)},hour:function(e){return new Ke("hour",e)},week:function(e){return new Ke("week",e)},year:function(e){return new Ke("year",e)},literal:function(e){return new Ke("literal",e)},mergeObjects:function(e){return new Ke("mergeObjects",e)},objectToArray:function(e){return new Ke("objectToArray",e)},allElementsTrue:function(e){return new Ke("allElementsTrue",e)},anyElementTrue:function(e){return new Ke("anyElementTrue",e)},setDifference:function(e){return new Ke("setDifference",e)},setEquals:function(e){return new Ke("setEquals",e)},setIntersection:function(e){return new Ke("setIntersection",e)},setIsSubset:function(e){return new Ke("setIsSubset",e)},setUnion:function(e){return new Ke("setUnion",e)},concat:function(e){return new Ke("concat",e)},dateToString:function(e){return new Ke("dateToString",e)},indexOfBytes:function(e){return new Ke("indexOfBytes",e)},indexOfCP:function(e){return new Ke("indexOfCP",e)},split:function(e){return new Ke("split",e)},strLenBytes:function(e){return new Ke("strLenBytes",e)},strLenCP:function(e){return new Ke("strLenCP",e)},strcasecmp:function(e){return new Ke("strcasecmp",e)},substr:function(e){return new Ke("substr",e)},substrBytes:function(e){return new Ke("substrBytes",e)},substrCP:function(e){return new Ke("substrCP",e)},toLower:function(e){return new Ke("toLower",e)},toUpper:function(e){return new Ke("toUpper",e)},meta:function(e){return new Ke("meta",e)},addToSet:function(e){return new Ke("addToSet",e)},avg:function(e){return new Ke("avg",e)},first:function(e){return new Ke("first",e)},last:function(e){return new Ke("last",e)},max:function(e){return new Ke("max",e)},min:function(e){return new Ke("min",e)},push:function(e){return new Ke("push",e)},stdDevPop:function(e){return new Ke("stdDevPop",e)},stdDevSamp:function(e){return new Ke("stdDevSamp",e)},sum:function(e){return new Ke("sum",e)},let:function(e){return new Ke("let",e)}},project:{slice:function(e){return new Ye("slice",e)},elemMatch:function(e){return new Ye("elemMatch",e)}}},Ke=function(e,t){this["$"+e]=t},Ye=function(e,t){this["$"+e]=t},Je=function(){function e(e){var t=e.regexp,n=e.options;if(!t)throw new TypeError("regexp must be a string");this.$regex=t,this.$options=n}return e.prototype.parse=function(){return{$regex:this.$regex,$options:this.$options}},Object.defineProperty(e.prototype,"_internalType",{get:function(){return D},enumerable:!1,configurable:!0}),e}();function Qe(e){return new Je(e)}var $e="insert document failed",Xe="DATABASE_TRANSACTION_CONFLICT",Ze=function(){return Ze=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ze.apply(this,arguments)},et=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},tt=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},nt="database.updateDocInTransaction",rt=function(){function e(e,t,n){this._coll=t,this.id=n,this._transaction=e,this._request=this._transaction.getRequestMethod(),this._transactionId=this._transaction.getTransactionId()}return e.prototype.create=function(e){return et(this,void 0,void 0,(function(){var t,n,r,o;return tt(this,(function(i){switch(i.label){case 0:return t={collectionName:this._coll,transactionId:this._transactionId,data:Fe.EJSON.stringify(we(e),{relaxed:!1})},this.id&&(t._id=this.id),[4,this._request.send("database.insertDocInTransaction",t)];case 1:if((n=i.sent()).code)throw n;if(r=Fe.EJSON.parse(n.inserted),1==(o=Fe.EJSON.parse(n.ok))&&1==r)return[2,Ze(Ze({},n),{ok:o,inserted:r})];throw new Error($e)}}))}))},e.prototype.get=function(){return et(this,void 0,void 0,(function(){var e,t;return tt(this,(function(n){switch(n.label){case 0:return e={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}}},[4,this._request.send("database.getInTransaction",e)];case 1:if((t=n.sent()).code)throw t;return[2,{data:"null"!==t.data?ne.formatField(Fe.EJSON.parse(t.data)):Fe.EJSON.parse(t.data),requestId:t.requestId}]}}))}))},e.prototype.set=function(e){return et(this,void 0,void 0,(function(){var t,n;return tt(this,(function(r){switch(r.label){case 0:return t={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}},data:Fe.EJSON.stringify(we(e),{relaxed:!1}),upsert:!0},[4,this._request.send(nt,t)];case 1:if((n=r.sent()).code)throw n;return[2,Ze(Ze({},n),{updated:Fe.EJSON.parse(n.updated),upserted:n.upserted?JSON.parse(n.upserted):null})]}}))}))},e.prototype.update=function(e){return et(this,void 0,void 0,(function(){var t,n;return tt(this,(function(r){switch(r.label){case 0:return t={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}},data:Fe.EJSON.stringify(Ne.encode(e),{relaxed:!1})},[4,this._request.send(nt,t)];case 1:if((n=r.sent()).code)throw n;return[2,Ze(Ze({},n),{updated:Fe.EJSON.parse(n.updated)})]}}))}))},e.prototype.delete=function(){return et(this,void 0,void 0,(function(){var e,t;return tt(this,(function(n){switch(n.label){case 0:return e={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}}},[4,this._request.send("database.deleteDocInTransaction",e)];case 1:if((t=n.sent()).code)throw t;return[2,Ze(Ze({},t),{deleted:Fe.EJSON.parse(t.deleted)})]}}))}))},e}(),ot=function(){return ot=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ot.apply(this,arguments)},it=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},at=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},st="database.getInTransaction",ct=function(){function e(e,t,n,r,o){this._coll=t,this._transaction=e,this._fieldFilters=n,this._fieldOrders=r||[],this._queryOptions=o||{},this._request=this._transaction.getRequestMethod(),this._transactionId=this._transaction.getTransactionId()}return e.prototype.where=function(t){if("Object"!==Object.prototype.toString.call(t).slice(8,-1))throw Error(o.QueryParamTypeError);var n=Object.keys(t),r=n.some((function(e){return void 0!==t[e]}));if(n.length&&!r)throw Error(o.QueryParamValueError);return new e(this._transaction,this._coll,Le.encode(t),this._fieldOrders,this._queryOptions)},e.prototype.orderBy=function(t,n){re.isFieldPath(t),re.isFieldOrder(n);var r={field:t,direction:n},o=this._fieldOrders.concat(r);return new e(this._transaction,this._coll,this._fieldFilters,o,this._queryOptions)},e.prototype.limit=function(t){re.isInteger("limit",t);var n=ot({},this._queryOptions);return n.limit=t,new e(this._transaction,this._coll,this._fieldFilters,this._fieldOrders,n)},e.prototype.skip=function(t){re.isInteger("offset",t);var n=ot({},this._queryOptions);return n.offset=t,new e(this._transaction,this._coll,this._fieldFilters,this._fieldOrders,n)},e.prototype.field=function(t){for(var n in t)t[n]?"object"!=typeof t[n]&&(t[n]=1):t[n]=0;var r=ot({},this._queryOptions);return r.projection=t,new e(this._transaction,this._coll,this._fieldFilters,this._fieldOrders,r)},e.prototype.get=function(){return it(this,void 0,void 0,(function(){var e,t,n,r,o,i;return at(this,(function(a){switch(a.label){case 0:return e=[],this._fieldOrders&&this._fieldOrders.forEach((function(t){e.push(t)})),t={collectionName:this._coll,transactionId:this._transactionId},this._fieldFilters&&(t.query=this._fieldFilters),e.length>0&&(t.order=e),this._queryOptions.offset&&(t.offset=this._queryOptions.offset),this._queryOptions.limit?t.limit=this._queryOptions.limit<1e3?this._queryOptions.limit:1e3:t.limit=100,this._queryOptions.projection&&(t.projection=this._queryOptions.projection),[4,this._request.send(st,t)];case 1:if((n=a.sent()).code)throw n;return r="null"!==n.data?Fe.EJSON.parse(n.data):null,o=r?Array.isArray(r)?ne.formatResDocumentData(r):[ne.formatField(r)]:[],i={data:o,requestId:n.requestId},void 0!==n.total&&(i.total=n.total),void 0!==n.limit&&(i.limit=n.limit),void 0!==n.offset&&(i.offset=n.offset),[2,i]}}))}))},e.prototype.count=function(){return it(this,void 0,void 0,(function(){var e,t,n,r;return at(this,(function(o){switch(o.label){case 0:return e={collectionName:this._coll,transactionId:this._transactionId},this._fieldFilters&&(e.query=this._fieldFilters),[4,this._request.send(st,e)];case 1:if((t=o.sent()).code)throw t;return n="null"!==t.data?Fe.EJSON.parse(t.data):null,r=Array.isArray(n)?n.length:n?1:0,[2,{requestId:t.requestId,total:void 0!==t.total?t.total:r}]}}))}))},e.prototype.update=function(e){return it(this,void 0,void 0,(function(){var t,n;return at(this,(function(r){switch(r.label){case 0:if(!e||"object"!=typeof e)throw new Error("参数必需是非空对象");if(e.hasOwnProperty("_id"))throw new Error("不能更新_id的值");return t={collectionName:this._coll,transactionId:this._transactionId,query:this._fieldFilters,data:Fe.EJSON.stringify(Ne.encode(e),{relaxed:!1})},[4,this._request.send("database.updateDocInTransaction",t)];case 1:if((n=r.sent()).code)throw n;return[2,ot(ot({},n),{updated:Fe.EJSON.parse(n.updated)})]}}))}))},e.prototype.remove=function(){return it(this,void 0,void 0,(function(){var e,t;return at(this,(function(n){switch(n.label){case 0:return Object.keys(this._queryOptions).length>0&&console.warn("`offset`, `limit` and `projection` are not supported in remove() operation"),this._fieldOrders.length>0&&console.warn("`orderBy` is not supported in remove() operation"),e={collectionName:this._coll,transactionId:this._transactionId,query:this._fieldFilters},[4,this._request.send("database.deleteDocInTransaction",e)];case 1:if((t=n.sent()).code)throw t;return[2,ot(ot({},t),{deleted:Fe.EJSON.parse(t.deleted)})]}}))}))},e}(),ut=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),lt=function(e){function t(t,n){return e.call(this,t,n)||this}return ut(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return this._coll},enumerable:!1,configurable:!0}),t.prototype.doc=function(e){if("string"!=typeof e&&"number"!=typeof e)throw new Error("docId必须为字符串或数字");return new rt(this._transaction,this._coll,e)},t.prototype.add=function(e){var t;return void 0!==e._id&&(t=e._id),new rt(this._transaction,this._coll,t).create(e)},t}(ct),pt=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},dt=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},ht=function(){function e(e){this._db=e,this._request=vt.createRequest(this._db.config),this.aborted=!1,this.commited=!1,this.inited=!1}return e.prototype.init=function(){return pt(this,void 0,void 0,(function(){var e;return dt(this,(function(t){switch(t.label){case 0:return[4,this._request.send("database.startTransaction")];case 1:if((e=t.sent()).code)throw e;return this.inited=!0,this._id=e.transactionId,[2]}}))}))},e.prototype.collection=function(e){if(!e)throw new Error("Collection name is required");return new lt(this,e)},e.prototype.getTransactionId=function(){return this._id},e.prototype.getRequestMethod=function(){return this._request},e.prototype.commit=function(){return pt(this,void 0,void 0,(function(){var e,t;return dt(this,(function(n){switch(n.label){case 0:return e={transactionId:this._id},[4,this._request.send("database.commitTransaction",e)];case 1:if((t=n.sent()).code)throw t;return this.commited=!0,[2,t]}}))}))},e.prototype.rollback=function(e){return pt(this,void 0,void 0,(function(){var t,n;return dt(this,(function(r){switch(r.label){case 0:return t={transactionId:this._id},[4,this._request.send("database.abortTransaction",t)];case 1:if((n=r.sent()).code)throw n;return this.aborted=!0,this.abortReason=e,[2,n]}}))}))},e}();function ft(){return pt(this,void 0,void 0,(function(){var e;return dt(this,(function(t){switch(t.label){case 0:return[4,(e=new ht(this)).init()];case 1:return t.sent(),[2,e]}}))}))}function mt(e,t){return void 0===t&&(t=3),pt(this,void 0,void 0,(function(){var n,r,o,i,a=this;return dt(this,(function(s){switch(s.label){case 0:return s.trys.push([0,4,,10]),[4,(n=new ht(this)).init()];case 1:return s.sent(),[4,e(n)];case 2:if(r=s.sent(),!0===n.aborted)throw n.abortReason;return[4,n.commit()];case 3:return s.sent(),[2,r];case 4:if(o=s.sent(),!1===n.inited)throw o;return i=function(e){return pt(a,void 0,void 0,(function(){return dt(this,(function(t){switch(t.label){case 0:if(n.aborted||n.commited)return[3,5];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,n.rollback()];case 2:case 3:return t.sent(),[3,4];case 4:throw e;case 5:if(!0===n.aborted)throw n.abortReason;throw e}}))}))},t<=0?[4,i(o)]:[3,6];case 5:s.sent(),s.label=6;case 6:return o&&o.code===Xe?[4,mt.bind(this)(e,--t)]:[3,8];case 7:return[2,s.sent()];case 8:return[4,i(o)];case 9:return s.sent(),[3,10];case 10:return[2]}}))}))}var vt=function(){function e(e){this.config=e,this.Geo=i,this.serverDate=Z,this.command=ze,this.RegExp=Qe,this.startTransaction=ft,this.runTransaction=mt,this.logicCommand=ue,this.updateCommand=se,this.queryCommand=he}return e.createRequest=function(t){var n=new e.reqClass(t),r=n.send;return n.send=function(e,n){return t.instance&&(n.instance=t.instance),t.database&&(n.database=t.database),r.call(this,e,n)},n},e.prototype.collection=function(e){if(!e)throw new Error("Collection name is required");return new He(this,e)},e.prototype.createCollection=function(t){var n={collectionName:t};return e.createRequest(this.config).send("database.addCollection",n)},e}()},3388:e=>{e.exports={}},1012:(e,t,n)=>{"use strict";var r;if(n.r(t),n.d(t,{default:()=>L}),!globalThis.IS_MP_BUILD){var o="undefined"!=typeof globalThis?globalThis.navigator:window.globalThis,i="0123456789abcdefghijklmnopqrstuvwxyz";function M(e){return i.charAt(e)}function q(e,t){return e&t}function B(e,t){return e|t}function F(e,t){return e^t}function W(e,t){return e&~t}function V(e){if(0==e)return-1;var t=0;return 65535&e||(e>>=16,t+=16),255&e||(e>>=8,t+=8),15&e||(e>>=4,t+=4),3&e||(e>>=2,t+=2),1&e||++t,t}function G(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function H(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=a.charAt(n>>6)+a.charAt(63&n);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=a.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=a.charAt(n>>2)+a.charAt((3&n)<<4));(3&r.length)>0;)r+="=";return r}function z(e){var t,n="",r=0,o=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t){var i=a.indexOf(e.charAt(t));i<0||(0==r?(n+=M(i>>2),o=3&i,r=1):1==r?(n+=M(o<<2|i>>4),o=15&i,r=2):2==r?(n+=M(o),n+=M(i>>2),o=3&i,r=3):(n+=M(o<<2|i>>4),n+=M(15&i),r=0))}return 1==r&&(n+=M(o<<2)),n}var s,c,u={decode:function(e){var t;if(void 0===s){var n="0123456789ABCDEF";for(s={},t=0;t<16;++t)s[n.charAt(t)]=t;for(n=n.toLowerCase(),t=10;t<16;++t)s[n.charAt(t)]=t;for(t=0;t<8;++t)s[" \f\n\r\t \u2028\u2029".charAt(t)]=-1}var r=[],o=0,i=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if("="==a)break;if(-1!=(a=s[a])){if(void 0===a)throw new Error("Illegal character at offset "+t);o|=a,++i>=2?(r[r.length]=o,o=0,i=0):o<<=4}}if(i)throw new Error("Hex encoding incomplete: 4 bits missing");return r}},l={decode:function(e){var t;if(void 0===c){for(c=Object.create(null),t=0;t<64;++t)c["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(t=0;t<9;++t)c["= \f\n\r\t \u2028\u2029".charAt(t)]=-1}var n=[],r=0,o=0;for(t=0;t<e.length;++t){var i=e.charAt(t);if("="==i)break;if(-1!=(i=c[i])){if(void 0===i)throw new Error("Illegal character at offset "+t);r|=i,++o>=4?(n[n.length]=r>>16,n[n.length]=r>>8&255,n[n.length]=255&r,r=0,o=0):r<<=6}}switch(o){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=r>>10;break;case 3:n[n.length]=r>>16,n[n.length]=r>>8&255}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(e){var t=l.re.exec(e);if(t)if(t[1])e=t[1];else{if(!t[2])throw new Error("RegExp out of sync");e=t[2]}return l.decode(e)}},p=1e13;class K{constructor(e){this.buf=[+e||0]}mulAdd(e,t){var n,r,o=this.buf,i=o.length;for(n=0;n<i;++n)(r=o[n]*e+t)<p?t=0:r-=(t=0|r/p)*p,o[n]=r;t>0&&(o[n]=t)}sub(e){var t,n,r=this.buf,o=r.length;for(t=0;t<o;++t)(n=r[t]-e)<0?(n+=p,e=1):e=0,r[t]=n;for(;0===r[r.length-1];)r.pop()}toString(e){if(10!=(e||10))throw new Error("only base 10 is supported");for(var t=this.buf,n=t[t.length-1].toString(),r=t.length-2;r>=0;--r)n+=(p+t[r]).toString().substring(1);return n}valueOf(){for(var e=this.buf,t=0,n=e.length-1;n>=0;--n)t=t*p+e[n];return t}simplify(){var e=this.buf;return 1==e.length?e[0]:this}}var d,h=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,f=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function Y(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}class J{constructor(e,t){this.hexDigits="0123456789ABCDEF",e instanceof J?(this.enc=e.enc,this.pos=e.pos):(this.enc=e,this.pos=t)}get(e){if(void 0===e&&(e=this.pos++),e>=this.enc.length)throw new Error("Requesting byte offset "+e+" on a stream of length "+this.enc.length);return"string"==typeof this.enc?this.enc.charCodeAt(e):this.enc[e]}hexByte(e){return this.hexDigits.charAt(e>>4&15)+this.hexDigits.charAt(15&e)}hexDump(e,t,n){for(var r="",o=e;o<t;++o)if(r+=this.hexByte(this.get(o)),!0!==n)switch(15&o){case 7:r+=" ";break;case 15:r+="\n";break;default:r+=" "}return r}isASCII(e,t){for(var n=e;n<t;++n){var r=this.get(n);if(r<32||r>176)return!1}return!0}parseStringISO(e,t){for(var n="",r=e;r<t;++r)n+=String.fromCharCode(this.get(r));return n}parseStringUTF(e,t){for(var n="",r=e;r<t;){var o=this.get(r++);n+=o<128?String.fromCharCode(o):o>191&&o<224?String.fromCharCode((31&o)<<6|63&this.get(r++)):String.fromCharCode((15&o)<<12|(63&this.get(r++))<<6|63&this.get(r++))}return n}parseStringBMP(e,t){for(var n,r,o="",i=e;i<t;)n=this.get(i++),r=this.get(i++),o+=String.fromCharCode(n<<8|r);return o}parseTime(e,t,n){var r=this.parseStringISO(e,t),o=(n?h:f).exec(r);return o?(n&&(o[1]=+o[1],o[1]+=+o[1]<70?2e3:1900),r=o[1]+"-"+o[2]+"-"+o[3]+" "+o[4],o[5]&&(r+=":"+o[5],o[6]&&(r+=":"+o[6],o[7]&&(r+="."+o[7]))),o[8]&&(r+=" UTC","Z"!=o[8]&&(r+=o[8],o[9]&&(r+=":"+o[9]))),r):"Unrecognized time: "+r}parseInteger(e,t){for(var n,r=this.get(e),o=r>127,i=o?255:0,a="";r==i&&++e<t;)r=this.get(e);if(0==(n=t-e))return o?-1:0;if(n>4){for(a=r,n<<=3;!(128&(+a^i));)a=+a<<1,--n;a="("+n+" bit)\n"}o&&(r-=256);for(var s=new K(r),c=e+1;c<t;++c)s.mulAdd(256,this.get(c));return a+s.toString()}parseBitString(e,t,n){for(var r=this.get(e),o="("+((t-e-1<<3)-r)+" bit)\n",i="",a=e+1;a<t;++a){for(var s=this.get(a),c=a==t-1?r:0,u=7;u>=c;--u)i+=s>>u&1?"1":"0";if(i.length>n)return o+Y(i,n)}return o+i}parseOctetString(e,t,n){if(this.isASCII(e,t))return Y(this.parseStringISO(e,t),n);var r=t-e,o="("+r+" byte)\n";r>(n/=2)&&(t=e+n);for(var i=e;i<t;++i)o+=this.hexByte(this.get(i));return r>n&&(o+="…"),o}parseOID(e,t,n){for(var r="",o=new K,i=0,a=e;a<t;++a){var s=this.get(a);if(o.mulAdd(128,127&s),i+=7,!(128&s)){if(""===r)if((o=o.simplify())instanceof K)o.sub(80),r="2."+o.toString();else{var c=o<80?o<40?0:1:2;r=c+"."+(o-40*c)}else r+="."+o.toString();if(r.length>n)return Y(r,n);o=new K,i=0}}return i>0&&(r+=".incomplete"),r}}class Q{constructor(e,t,n,r,o){if(!(r instanceof $))throw new Error("Invalid tag value.");this.stream=e,this.header=t,this.length=n,this.tag=r,this.sub=o}typeName(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}}content(e){if(void 0===this.tag)return null;void 0===e&&(e=1/0);var t=this.posContent(),n=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+n,e);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(t)?"false":"true";case 2:return this.stream.parseInteger(t,t+n);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(t,t+n,e);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+n,e);case 6:return this.stream.parseOID(t,t+n,e);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return Y(this.stream.parseStringUTF(t,t+n),e);case 18:case 19:case 20:case 21:case 22:case 26:return Y(this.stream.parseStringISO(t,t+n),e);case 30:return Y(this.stream.parseStringBMP(t,t+n),e);case 23:case 24:return this.stream.parseTime(t,t+n,23==this.tag.tagNumber)}return null}toString(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"}toPrettyString(e){void 0===e&&(e="");var t=e+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(t+="+"),t+=this.length,this.tag.tagConstructed?t+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(t+=" (encapsulates)"),t+="\n",null!==this.sub){e+=" ";for(var n=0,r=this.sub.length;n<r;++n)t+=this.sub[n].toPrettyString(e)}return t}posStart(){return this.stream.pos}posContent(){return this.stream.pos+this.header}posEnd(){return this.stream.pos+this.header+Math.abs(this.length)}toHexString(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)}static decodeLength(e){var t=e.get(),n=127&t;if(n==t)return n;if(n>6)throw new Error("Length over 48 bits not supported at position "+(e.pos-1));if(0===n)return null;t=0;for(var r=0;r<n;++r)t=256*t+e.get();return t}getHexStringValue(){var e=this.toHexString(),t=2*this.header,n=2*this.length;return e.substr(t,n)}static decode(e){var t;t=e instanceof J?e:new J(e,0);var n=new J(t),r=new $(t),o=Q.decodeLength(t),i=t.pos,a=i-n.pos,s=null,c=function(){var e=[];if(null!==o){for(var n=i+o;t.pos<n;)e[e.length]=Q.decode(t);if(t.pos!=n)throw new Error("Content size is not correct for container starting at offset "+i)}else try{for(;;){var r=Q.decode(t);if(r.tag.isEOC())break;e[e.length]=r}o=i-t.pos}catch(e){throw new Error("Exception while decoding undefined length content: "+e)}return e};if(r.tagConstructed)s=c();else if(r.isUniversal()&&(3==r.tagNumber||4==r.tagNumber))try{if(3==r.tagNumber&&0!=t.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");s=c();for(var u=0;u<s.length;++u)if(s[u].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(e){s=null}if(null===s){if(null===o)throw new Error("We can't skip over an invalid tag with undefined length at offset "+i);t.pos=i+Math.abs(o)}return new Q(n,a,o,r,s)}}class ${constructor(e){var t=e.get();if(this.tagClass=t>>6,this.tagConstructed=!!(32&t),this.tagNumber=31&t,31==this.tagNumber){var n=new K;do{t=e.get(),n.mulAdd(128,127&t)}while(128&t);this.tagNumber=n.simplify()}}isUniversal(){return 0===this.tagClass}isEOC(){return 0===this.tagClass&&0===this.tagNumber}}var m=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],v=(1<<26)/m[m.length-1];class X{constructor(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}toString(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var n,r=(1<<t)-1,o=!1,i="",a=this.t,s=this.DB-a*this.DB%t;if(a-- >0)for(s<this.DB&&(n=this[a]>>s)>0&&(o=!0,i=M(n));a>=0;)s<t?(n=(this[a]&(1<<s)-1)<<t-s,n|=this[--a]>>(s+=this.DB-t)):(n=this[a]>>(s-=t)&r,s<=0&&(s+=this.DB,--a)),n>0&&(o=!0),o&&(i+=M(n));return o?i:"0"}negate(){var e=Z();return X.ZERO.subTo(this,e),e}abs(){return this.s<0?this.negate():this}compareTo(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0}bitLength(){return this.t<=0?0:this.DB*(this.t-1)+ae(this[this.t-1]^this.s&this.DM)}mod(e){var t=Z();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(X.ZERO)>0&&e.subTo(t,t),t}modPowInt(e,t){var n;return n=e<256||t.isEven()?new b(t):new y(t),this.exp(e,n)}clone(){var e=Z();return this.copyTo(e),e}intValue(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}byteValue(){return 0==this.t?this.s:this[0]<<24>>24}shortValue(){return 0==this.t?this.s:this[0]<<16>>16}signum(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}toByteArray(){var e=this.t,t=[];t[0]=this.s;var n,r=this.DB-e*this.DB%8,o=0;if(e-- >0)for(r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[o++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),128&n&&(n|=-256),0==o&&(128&this.s)!=(128&n)&&++o,(o>0||n!=this.s)&&(t[o++]=n);return t}equals(e){return 0==this.compareTo(e)}min(e){return this.compareTo(e)<0?this:e}max(e){return this.compareTo(e)>0?this:e}and(e){var t=Z();return this.bitwiseTo(e,q,t),t}or(e){var t=Z();return this.bitwiseTo(e,B,t),t}xor(e){var t=Z();return this.bitwiseTo(e,F,t),t}andNot(e){var t=Z();return this.bitwiseTo(e,W,t),t}not(){for(var e=Z(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e}shiftLeft(e){var t=Z();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}shiftRight(e){var t=Z();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}getLowestSetBit(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+V(this[e]);return this.s<0?this.t*this.DB:-1}bitCount(){for(var e=0,t=this.s&this.DM,n=0;n<this.t;++n)e+=G(this[n]^t);return e}testBit(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:!!(this[t]&1<<e%this.DB)}setBit(e){return this.changeBit(e,B)}clearBit(e){return this.changeBit(e,W)}flipBit(e){return this.changeBit(e,F)}add(e){var t=Z();return this.addTo(e,t),t}subtract(e){var t=Z();return this.subTo(e,t),t}multiply(e){var t=Z();return this.multiplyTo(e,t),t}divide(e){var t=Z();return this.divRemTo(e,t,null),t}remainder(e){var t=Z();return this.divRemTo(e,null,t),t}divideAndRemainder(e){var t=Z(),n=Z();return this.divRemTo(e,t,n),[t,n]}modPow(e,t){var n,r,o=e.bitLength(),i=ie(1);if(o<=0)return i;n=o<18?1:o<48?3:o<144?4:o<768?5:6,r=o<8?new b(t):t.isEven()?new _(t):new y(t);var a=[],s=3,c=n-1,u=(1<<n)-1;if(a[1]=r.convert(this),n>1){var l=Z();for(r.sqrTo(a[1],l);s<=u;)a[s]=Z(),r.mulTo(l,a[s-2],a[s]),s+=2}var p,d,h=e.t-1,f=!0,m=Z();for(o=ae(e[h])-1;h>=0;){for(o>=c?p=e[h]>>o-c&u:(p=(e[h]&(1<<o+1)-1)<<c-o,h>0&&(p|=e[h-1]>>this.DB+o-c)),s=n;!(1&p);)p>>=1,--s;if((o-=s)<0&&(o+=this.DB,--h),f)a[p].copyTo(i),f=!1;else{for(;s>1;)r.sqrTo(i,m),r.sqrTo(m,i),s-=2;s>0?r.sqrTo(i,m):(d=i,i=m,m=d),r.mulTo(m,a[p],i)}for(;h>=0&&!(e[h]&1<<o);)r.sqrTo(i,m),d=i,i=m,m=d,--o<0&&(o=this.DB-1,--h)}return r.revert(i)}modInverse(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return X.ZERO;for(var n=e.clone(),r=this.clone(),o=ie(1),i=ie(0),a=ie(0),s=ie(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),t?(o.isEven()&&i.isEven()||(o.addTo(this,o),i.subTo(e,i)),o.rShiftTo(1,o)):i.isEven()||i.subTo(e,i),i.rShiftTo(1,i);for(;r.isEven();)r.rShiftTo(1,r),t?(a.isEven()&&s.isEven()||(a.addTo(this,a),s.subTo(e,s)),a.rShiftTo(1,a)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);n.compareTo(r)>=0?(n.subTo(r,n),t&&o.subTo(a,o),i.subTo(s,i)):(r.subTo(n,r),t&&a.subTo(o,a),s.subTo(i,s))}return 0!=r.compareTo(X.ONE)?X.ZERO:s.compareTo(e)>=0?s.subtract(e):s.signum()<0?(s.addTo(e,s),s.signum()<0?s.add(e):s):s}pow(e){return this.exp(e,new g)}gcd(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var o=t.getLowestSetBit(),i=n.getLowestSetBit();if(i<0)return t;for(o<i&&(i=o),i>0&&(t.rShiftTo(i,t),n.rShiftTo(i,n));t.signum()>0;)(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return i>0&&n.lShiftTo(i,n),n}isProbablePrime(e){var t,n=this.abs();if(1==n.t&&n[0]<=m[m.length-1]){for(t=0;t<m.length;++t)if(n[0]==m[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<m.length;){for(var r=m[t],o=t+1;o<m.length&&r<v;)r*=m[o++];for(r=n.modInt(r);t<o;)if(r%m[t++]==0)return!1}return n.millerRabin(e)}copyTo(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}fromInt(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}fromString(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(256==t)n=8;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)return void this.fromRadix(e,t);n=2}this.t=0,this.s=0;for(var r=e.length,o=!1,i=0;--r>=0;){var a=8==n?255&+e[r]:oe(e,r);a<0?"-"==e.charAt(r)&&(o=!0):(o=!1,0==i?this[this.t++]=a:i+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-i)-1)<<i,this[this.t++]=a>>this.DB-i):this[this.t-1]|=a<<i,(i+=n)>=this.DB&&(i-=this.DB))}8==n&&128&+e[0]&&(this.s=-1,i>0&&(this[this.t-1]|=(1<<this.DB-i)-1<<i)),this.clamp(),o&&X.ZERO.subTo(this,this)}clamp(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}dlShiftTo(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s}drShiftTo(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s}lShiftTo(e,t){for(var n=e%this.DB,r=this.DB-n,o=(1<<r)-1,i=Math.floor(e/this.DB),a=this.s<<n&this.DM,s=this.t-1;s>=0;--s)t[s+i+1]=this[s]>>r|a,a=(this[s]&o)<<n;for(s=i-1;s>=0;--s)t[s]=0;t[i]=a,t.t=this.t+i+1,t.s=this.s,t.clamp()}rShiftTo(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,o=this.DB-r,i=(1<<r)-1;t[0]=this[n]>>r;for(var a=n+1;a<this.t;++a)t[a-n-1]|=(this[a]&i)<<o,t[a-n]=this[a]>>r;r>0&&(t[this.t-n-1]|=(this.s&i)<<o),t.t=this.t-n,t.clamp()}}subTo(e,t){for(var n=0,r=0,o=Math.min(e.t,this.t);n<o;)r+=this[n]-e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e[n],t[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()}multiplyTo(e,t){var n=this.abs(),r=e.abs(),o=n.t;for(t.t=o+r.t;--o>=0;)t[o]=0;for(o=0;o<r.t;++o)t[o+n.t]=n.am(0,r[o],t,o,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&X.ZERO.subTo(t,t)}squareTo(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()}divRemTo(e,t,n){var r=e.abs();if(!(r.t<=0)){var o=this.abs();if(o.t<r.t)return null!=t&&t.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=Z());var i=Z(),a=this.s,s=e.s,c=this.DB-ae(r[r.t-1]);c>0?(r.lShiftTo(c,i),o.lShiftTo(c,n)):(r.copyTo(i),o.copyTo(n));var u=i.t,l=i[u-1];if(0!=l){var p=l*(1<<this.F1)+(u>1?i[u-2]>>this.F2:0),d=this.FV/p,h=(1<<this.F1)/p,f=1<<this.F2,m=n.t,v=m-u,g=null==t?Z():t;for(i.dlShiftTo(v,g),n.compareTo(g)>=0&&(n[n.t++]=1,n.subTo(g,n)),X.ONE.dlShiftTo(u,g),g.subTo(i,i);i.t<u;)i[i.t++]=0;for(;--v>=0;){var b=n[--m]==l?this.DM:Math.floor(n[m]*d+(n[m-1]+f)*h);if((n[m]+=i.am(0,b,n,v,0,u))<b)for(i.dlShiftTo(v,g),n.subTo(g,n);n[m]<--b;)n.subTo(g,n)}null!=t&&(n.drShiftTo(u,t),a!=s&&X.ZERO.subTo(t,t)),n.t=u,n.clamp(),c>0&&n.rShiftTo(c,n),a<0&&X.ZERO.subTo(n,n)}}}invDigit(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t}isEven(){return 0==(this.t>0?1&this[0]:this.s)}exp(e,t){if(e>4294967295||e<1)return X.ONE;var n=Z(),r=Z(),o=t.convert(this),i=ae(e)-1;for(o.copyTo(n);--i>=0;)if(t.sqrTo(n,r),(e&1<<i)>0)t.mulTo(r,o,n);else{var a=n;n=r,r=a}return t.revert(n)}chunkSize(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}toRadix(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),r=ie(n),o=Z(),i=Z(),a="";for(this.divRemTo(r,o,i);o.signum()>0;)a=(n+i.intValue()).toString(e).substr(1)+a,o.divRemTo(r,o,i);return i.intValue().toString(e)+a}fromRadix(e,t){this.fromInt(0),null==t&&(t=10);for(var n=this.chunkSize(t),r=Math.pow(t,n),o=!1,i=0,a=0,s=0;s<e.length;++s){var c=oe(e,s);c<0?"-"==e.charAt(s)&&0==this.signum()&&(o=!0):(a=t*a+c,++i>=n&&(this.dMultiply(r),this.dAddOffset(a,0),i=0,a=0))}i>0&&(this.dMultiply(Math.pow(t,i)),this.dAddOffset(a,0)),o&&X.ZERO.subTo(this,this)}fromNumber(e,t,n){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(X.ONE.shiftLeft(e-1),B,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(X.ONE.shiftLeft(e-1),this);else{var r=[],o=7&e;r.length=1+(e>>3),t.nextBytes(r),o>0?r[0]&=(1<<o)-1:r[0]=0,this.fromString(r,256)}}bitwiseTo(e,t,n){var r,o,i=Math.min(e.t,this.t);for(r=0;r<i;++r)n[r]=t(this[r],e[r]);if(e.t<this.t){for(o=e.s&this.DM,r=i;r<this.t;++r)n[r]=t(this[r],o);n.t=this.t}else{for(o=this.s&this.DM,r=i;r<e.t;++r)n[r]=t(o,e[r]);n.t=e.t}n.s=t(this.s,e.s),n.clamp()}changeBit(e,t){var n=X.ONE.shiftLeft(e);return this.bitwiseTo(n,t,n),n}addTo(e,t){for(var n=0,r=0,o=Math.min(e.t,this.t);n<o;)r+=this[n]+e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e[n],t[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()}dMultiply(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}dAddOffset(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}multiplyLowerTo(e,t,n){var r=Math.min(this.t+e.t,t);for(n.s=0,n.t=r;r>0;)n[--r]=0;for(var o=n.t-this.t;r<o;++r)n[r+this.t]=this.am(0,e[r],n,r,0,this.t);for(o=Math.min(e.t,t);r<o;++r)this.am(0,e[r],n,r,0,t-r);n.clamp()}multiplyUpperTo(e,t,n){--t;var r=n.t=this.t+e.t-t;for(n.s=0;--r>=0;)n[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)n[this.t+r-t]=this.am(t-r,e[r],n,0,0,this.t+r-t);n.clamp(),n.drShiftTo(1,n)}modInt(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(0==t)n=this[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this[r])%e;return n}millerRabin(e){var t=this.subtract(X.ONE),n=t.getLowestSetBit();if(n<=0)return!1;var r=t.shiftRight(n);(e=e+1>>1)>m.length&&(e=m.length);for(var o=Z(),i=0;i<e;++i){o.fromInt(m[Math.floor(Math.random()*m.length)]);var a=o.modPow(r,this);if(0!=a.compareTo(X.ONE)&&0!=a.compareTo(t)){for(var s=1;s++<n&&0!=a.compareTo(t);)if(0==(a=a.modPowInt(2,this)).compareTo(X.ONE))return!1;if(0!=a.compareTo(t))return!1}}return!0}square(){var e=Z();return this.squareTo(e),e}gcda(e,t){var n=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(n.compareTo(r)<0){var o=n;n=r,r=o}var i=n.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)t(n);else{i<a&&(a=i),a>0&&(n.rShiftTo(a,n),r.rShiftTo(a,r));var s=()=>{(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),n.compareTo(r)>=0?(n.subTo(r,n),n.rShiftTo(1,n)):(r.subTo(n,r),r.rShiftTo(1,r)),n.signum()>0?setTimeout(s,0):(a>0&&r.lShiftTo(a,r),setTimeout((function(){t(r)}),0))};setTimeout(s,10)}}fromNumberAsync(e,t,n,r){if("number"==typeof t)if(e<2)this.fromInt(1);else{this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(X.ONE.shiftLeft(e-1),B,this),this.isEven()&&this.dAddOffset(1,0);var o=this,i=function(){o.dAddOffset(2,0),o.bitLength()>e&&o.subTo(X.ONE.shiftLeft(e-1),o),o.isProbablePrime(t)?setTimeout((function(){r()}),0):setTimeout(i,0)};setTimeout(i,0)}else{var a=[],s=7&e;a.length=1+(e>>3),t.nextBytes(a),s>0?a[0]&=(1<<s)-1:a[0]=0,this.fromString(a,256)}}}var g=function(){function e(){}return e.prototype.convert=function(e){return e},e.prototype.revert=function(e){return e},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n)},e.prototype.sqrTo=function(e,t){e.squareTo(t)},e}(),b=function(){function e(e){this.m=e}return e.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),y=function(){function e(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}return e.prototype.convert=function(e){var t=Z();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(X.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=Z();return e.copyTo(t),this.reduce(t),t},e.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=32767&e[t],r=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[n=t+this.m.t]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),_=function(){function e(e){this.m=e,this.r2=Z(),this.q3=Z(),X.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e)}return e.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=Z();return e.copyTo(t),this.reduce(t),t},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}();function Z(){return new X(null)}function ee(e,t){return new X(e,t)}function te(e,t,n,r,o,i){for(;--i>=0;){var a=t*this[e++]+n[r]+o;o=Math.floor(a/67108864),n[r++]=67108863&a}return o}function ne(e,t,n,r,o,i){for(var a=32767&t,s=t>>15;--i>=0;){var c=32767&this[e],u=this[e++]>>15,l=s*c+u*a;o=((c=a*c+((32767&l)<<15)+n[r]+(1073741823&o))>>>30)+(l>>>15)+s*u+(o>>>30),n[r++]=1073741823&c}return o}function re(e,t,n,r,o,i){for(var a=16383&t,s=t>>14;--i>=0;){var c=16383&this[e],u=this[e++]>>14,l=s*c+u*a;o=((c=a*c+((16383&l)<<14)+n[r]+o)>>28)+(l>>14)+s*u,n[r++]=268435455&c}return o}void 0!==o&&"Microsoft Internet Explorer"==(null==o?void 0:o.appName)?(X.prototype.am=ne,d=30):"Netscape"!=(null==o?void 0:o.appName)?(X.prototype.am=te,d=26):(X.prototype.am=re,d=28),X.prototype.DB=d,X.prototype.DM=(1<<d)-1,X.prototype.DV=1<<d,X.prototype.FV=Math.pow(2,52),X.prototype.F1=52-d,X.prototype.F2=2*d-52;var x,w,E=[];for(x="0".charCodeAt(0),w=0;w<=9;++w)E[x++]=w;for(x="a".charCodeAt(0),w=10;w<36;++w)E[x++]=w;for(x="A".charCodeAt(0),w=10;w<36;++w)E[x++]=w;function oe(e,t){var n=E[e.charCodeAt(t)];return null==n?-1:n}function ie(e){var t=Z();return t.fromInt(e),t}function ae(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}X.ZERO=ie(0),X.ONE=ie(1);class se{constructor(){this.i=0,this.j=0,this.S=[]}init(e){var t,n,r;for(t=0;t<256;++t)this.S[t]=t;for(n=0,t=0;t<256;++t)n=n+this.S[t]+e[t%e.length]&255,r=this.S[t],this.S[t]=this.S[n],this.S[n]=r;this.i=0,this.j=0}next(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]}}var I,S,O=null;if(null==O){O=[],S=0;var T,A,P=void 0;if("undefined"!=typeof window&&null!==(T=window)&&void 0!==T&&T.crypto&&null!==(A=window)&&void 0!==A&&A.crypto.getRandomValues){var C,R=new Uint32Array(256);for(null===(C=window)||void 0===C||C.crypto.getRandomValues(R),P=0;P<R.length;++P)O[S++]=255&R[P]}var N,k,j,U=function(e){var t,n,r;if(this.count=this.count||0,this.count>=256||S>=256){if("undefined"!=typeof window)if(null!==(t=window)&&void 0!==t&&t.removeEventListener)null===(r=window)||void 0===r||r.removeEventListener("mousemove",U,!1);else if(null!==(n=window)&&void 0!==n&&n.detachEvent){var o;null===(o=window)||void 0===o||o.detachEvent("onmousemove",U)}}else try{var i=e.x+e.y;O[S++]=255&i,this.count+=1}catch(e){}};if("undefined"!=typeof window)if(null!==(N=window)&&void 0!==N&&N.addEventListener)null===(j=window)||void 0===j||j.addEventListener("mousemove",U,!1);else if(null!==(k=window)&&void 0!==k&&k.attachEvent){var D;null===(D=window)||void 0===D||D.attachEvent("onmousemove",U)}}function ce(){if(null==I){for(I=new se;S<256;){var e=Math.floor(65536*Math.random());O[S++]=255&e}for(I.init(O),S=0;S<O.length;++S)O[S]=0;S=0}return I.next()}class ue{constructor(){}nextBytes(e){for(var t=0;t<e.length;++t)e[t]=ce()}}function le(e,t){if(t<e.length+11)return console.error("Message too long for RSA"),null;for(var n=[],r=e.length-1;r>=0&&t>0;){var o=e.charCodeAt(r--);o<128?n[--t]=o:o>127&&o<2048?(n[--t]=63&o|128,n[--t]=o>>6|192):(n[--t]=63&o|128,n[--t]=o>>6&63|128,n[--t]=o>>12|224)}n[--t]=0;for(var i=new ue,a=[];t>2;){for(a[0]=0;0==a[0];)i.nextBytes(a);n[--t]=a[0]}return n[--t]=2,n[--t]=0,new X(n)}class pe{constructor(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}doPublic(e){return e.modPowInt(this.e,this.n)}doPrivate(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),n=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(n)<0;)t=t.add(this.p);return t.subtract(n).multiply(this.coeff).mod(this.p).multiply(this.q).add(n)}setPublic(e,t){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=ee(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")}encrypt(e){var t=le(e,this.n.bitLength()+7>>3);if(null==t)return null;var n=this.doPublic(t);if(null==n)return null;var r=n.toString(16);return 1&r.length?"0"+r:r}encryptLong(e){var t=this,n=(this.n.bitLength()+7>>3)-11;try{var r="";return e.length>n?(e.match(/.{1,117}/g).forEach((function(e){var n=t.encrypt(e);r+=n})),H(r)):H(this.encrypt(e))}catch(e){return!1}}decryptLong(e){var t=this,n=this.n.bitLength()+7>>3;e=z(e);try{if(e.length>n){var r="";return e.match(/.{1,256}/g).forEach((function(e){var n=t.decrypt(e);r+=n})),r}return this.decrypt(e)}catch(e){return!1}}setPrivate(e,t,n){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=ee(e,16),this.e=parseInt(t,16),this.d=ee(n,16)):console.error("Invalid RSA private key")}setPrivateEx(e,t,n,r,o,i,a,s){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=ee(e,16),this.e=parseInt(t,16),this.d=ee(n,16),this.p=ee(r,16),this.q=ee(o,16),this.dmp1=ee(i,16),this.dmq1=ee(a,16),this.coeff=ee(s,16)):console.error("Invalid RSA private key")}generate(e,t){var n=new ue,r=e>>1;this.e=parseInt(t,16);for(var o=new X(t,16);;){for(;this.p=new X(e-r,1,n),0!=this.p.subtract(X.ONE).gcd(o).compareTo(X.ONE)||!this.p.isProbablePrime(10););for(;this.q=new X(r,1,n),0!=this.q.subtract(X.ONE).gcd(o).compareTo(X.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var i=this.p;this.p=this.q,this.q=i}var a=this.p.subtract(X.ONE),s=this.q.subtract(X.ONE),c=a.multiply(s);if(0==c.gcd(o).compareTo(X.ONE)){this.n=this.p.multiply(this.q),this.d=o.modInverse(c),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(s),this.coeff=this.q.modInverse(this.p);break}}}decrypt(e){var t=ee(e,16),n=this.doPrivate(t);return null==n?null:de(n,this.n.bitLength()+7>>3)}generateAsync(e,t,n){var r=new ue,o=e>>1;this.e=parseInt(t,16);var i=new X(t,16),a=this,s=()=>{var t=()=>{if(a.p.compareTo(a.q)<=0){var e=a.p;a.p=a.q,a.q=e}var t=a.p.subtract(X.ONE),r=a.q.subtract(X.ONE),o=t.multiply(r);0==o.gcd(i).compareTo(X.ONE)?(a.n=a.p.multiply(a.q),a.d=i.modInverse(o),a.dmp1=a.d.mod(t),a.dmq1=a.d.mod(r),a.coeff=a.q.modInverse(a.p),setTimeout((function(){n()}),0)):setTimeout(s,0)},c=()=>{a.q=Z(),a.q.fromNumberAsync(o,1,r,(function(){a.q.subtract(X.ONE).gcda(i,(function(e){0==e.compareTo(X.ONE)&&a.q.isProbablePrime(10)?setTimeout(t,0):setTimeout(c,0)}))}))},u=()=>{a.p=Z(),a.p.fromNumberAsync(e-o,1,r,(function(){a.p.subtract(X.ONE).gcda(i,(function(e){0==e.compareTo(X.ONE)&&a.p.isProbablePrime(10)?setTimeout(c,0):setTimeout(u,0)}))}))};setTimeout(u,0)};setTimeout(s,0)}}function de(e,t){for(var n=e.toByteArray(),r=0;r<n.length&&0==n[r];)++r;if(n.length-r!=t-1||2!=n[r])return null;for(++r;0!=n[r];)if(++r>=n.length)return null;for(var o="";++r<n.length;){var i=255&n[r];i<128?o+=String.fromCharCode(i):i>191&&i<224?(o+=String.fromCharCode((31&i)<<6|63&n[r+1]),++r):(o+=String.fromCharCode((15&i)<<12|(63&n[r+1])<<6|63&n[r+2]),r+=2)}return o}class he extends pe{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";super(),e&&("string"==typeof e?this.parseKey(e):(this.hasPrivateKeyProperty(e)||this.hasPublicKeyProperty(e))&&this.parsePropertiesFrom(e))}parseKey(e){try{var t=0,n=0,r=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(e)?u.decode(e):l.unarmor(e),o=Q.decode(r);if(3===o.sub.length&&(o=o.sub[2].sub[0]),9===o.sub.length){t=o.sub[1].getHexStringValue(),this.n=ee(t,16),n=o.sub[2].getHexStringValue(),this.e=parseInt(n,16);var i=o.sub[3].getHexStringValue();this.d=ee(i,16);var a=o.sub[4].getHexStringValue();this.p=ee(a,16);var s=o.sub[5].getHexStringValue();this.q=ee(s,16);var c=o.sub[6].getHexStringValue();this.dmp1=ee(c,16);var p=o.sub[7].getHexStringValue();this.dmq1=ee(p,16);var d=o.sub[8].getHexStringValue();this.coeff=ee(d,16)}else{if(2!==o.sub.length)return!1;var h=o.sub[1].sub[0];t=h.sub[0].getHexStringValue(),this.n=ee(t,16),n=h.sub[1].getHexStringValue(),this.e=parseInt(n,16)}return!0}catch(e){return!1}}hasPublicKeyProperty(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")}hasPrivateKeyProperty(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")&&e.hasOwnProperty("d")&&e.hasOwnProperty("p")&&e.hasOwnProperty("q")&&e.hasOwnProperty("dmp1")&&e.hasOwnProperty("dmq1")&&e.hasOwnProperty("coeff")}parsePropertiesFrom(e){this.n=e.n,this.e=e.e,e.hasOwnProperty("d")&&(this.d=e.d,this.p=e.p,this.q=e.q,this.dmp1=e.dmp1,this.dmq1=e.dmq1,this.coeff=e.coeff)}}(r=function(e){e=e||{},this.default_key_size=parseInt(e.default_key_size,10)||1024,this.default_public_exponent=e.default_public_exponent||"010001",this.log=e.log||!1,this.key=null}).prototype.setKey=function(e){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new he(e)},r.prototype.setPrivateKey=function(e){this.setKey(e)},r.prototype.setPublicKey=function(e){this.setKey(e)},r.prototype.decrypt=function(e){try{return this.getKey().decrypt(z(e))}catch(e){return!1}},r.prototype.encrypt=function(e){try{return H(this.getKey().encrypt(e))}catch(e){return!1}},r.prototype.encryptLong=function(e){try{for(var t=this.getKey().encryptLong(e)||"",n=this.getKey().decryptLong(t)||"",r=0,o=/null$/g;o.test(n)&&(r++,t=this.getKey().encryptLong(e)||"",n=this.getKey().decryptLong(t)||"",!(r>10)););return t}catch(e){return!1}},r.prototype.getKey=function(e){if(!this.key){if(this.key=new he,e&&"[object Function]"==={}.toString.call(e))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,e);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},r.version="3.1.4"}const L=r},8182:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useDefaultAdapter=t.useAdapters=t.RUNTIME=void 0;var s,c=a(n(4274)),u=n(3616);!function(e){e.WEB="web",e.WX_MP="wx_mp"}(s=t.RUNTIME||(t.RUNTIME={})),t.useAdapters=function(e,t){for(var n=0,o=(0,u.isArray)(e)?e:[e];n<o.length;n++){var i=o[n],a=i.isMatch,s=i.genAdapter,c=i.runtime;if(a())return{adapter:r({isMatch:a},s(t)),runtime:c}}},t.useDefaultAdapter=function(){return{adapter:r({},c.genAdapter()),runtime:s.WEB}}},4274:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.WebRequest=t.genAdapter=void 0;var c=n(2764),u=n(3616),l=n(2946),p=function(e){function t(t){var n=e.call(this)||this,r=t.timeout,o=t.timeoutMsg,i=t.restrictedMethods;return n.timeout=r||0,n.timeoutMsg=o||"请求超时",n.restrictedMethods=i||["get","post","upload","download"],n}return o(t,e),t.prototype.get=function(e){return this.request(i(i({},e),{method:"get"}),this.restrictedMethods.includes("get"))},t.prototype.post=function(e){return this.request(i(i({},e),{method:"post"}),this.restrictedMethods.includes("post"))},t.prototype.put=function(e){return this.request(i(i({},e),{method:"put"}))},t.prototype.upload=function(e){var t=e.data,n=e.file,r=e.name,o=e.method,a=e.headers,s=void 0===a?{}:a,c={post:"post",put:"put"}[null==o?void 0:o.toLowerCase()]||"put",u=new FormData;return"post"===c?(Object.keys(t).forEach((function(e){u.append(e,t[e])})),u.append("key",r),u.append("file",n),this.request(i(i({},e),{data:u,method:c}),this.restrictedMethods.includes("upload"))):this.request(i(i({},e),{method:"put",headers:s,body:n}),this.restrictedMethods.includes("upload"))},t.prototype.download=function(e){return a(this,void 0,void 0,(function(){var t,n,r,o;return s(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.get(i(i({},e),{headers:{},responseType:"blob"}))];case 1:return t=a.sent().data,n=window.URL.createObjectURL(new Blob([t])),r=decodeURIComponent(new URL(e.url).pathname.split("/").pop()||""),(o=document.createElement("a")).href=n,o.setAttribute("download",r),o.style.display="none",document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(n),document.body.removeChild(o),[3,3];case 2:return a.sent(),[3,3];case 3:return[2,new Promise((function(t){t({statusCode:200,tempFilePath:e.url})}))]}}))}))},t.prototype.fetch=function(e){var t;return a(this,void 0,void 0,(function(){var n,r,o,c,u,l,p,d,h,f,m,v,g,b=this;return s(this,(function(y){switch(y.label){case 0:return n=new AbortController,r=e.url,o=e.enableAbort,c=void 0!==o&&o,u=e.stream,l=void 0!==u&&u,p=e.signal,d=e.timeout,h=e.shouldThrowOnError,f=void 0===h||h,m=null!=d?d:this.timeout,p&&(p.aborted&&n.abort(),p.addEventListener("abort",(function(){return n.abort()}))),v=null,c&&m&&(v=setTimeout((function(){console.warn(b.timeoutMsg),n.abort(new Error(b.timeoutMsg))}),m)),[4,fetch(r,i(i({},e),{signal:n.signal})).then((function(e){return a(b,void 0,void 0,(function(){var t,n,r;return s(this,(function(o){switch(o.label){case 0:return clearTimeout(v),f?e.ok?(t=e,[3,3]):[3,1]:[3,4];case 1:return r=(n=Promise).reject,[4,e.json()];case 2:t=r.apply(n,[o.sent()]),o.label=3;case 3:return[2,t];case 4:return[2,e]}}))}))})).catch((function(e){return clearTimeout(v),Promise.reject(e)}))];case 1:return g=y.sent(),[2,{data:l?g.body:(null===(t=g.headers.get("content-type"))||void 0===t?void 0:t.includes("application/json"))?g.json():g.text(),statusCode:g.status,header:g.headers,response:g}]}}))}))},t.prototype.request=function(e,t){var n=this;void 0===t&&(t=!1);var r=String(e.method).toLowerCase()||"get";return new Promise((function(o){var i=e.url,a=e.headers,s=void 0===a?{}:a,c=e.data,p=e.responseType,d=e.withCredentials,h=e.body,f=e.onUploadProgress,m=(0,u.formatUrl)((0,l.getProtocol)(),i,"get"===r?c:{}),v=new XMLHttpRequest;v.open(r,m),p&&(v.responseType=p);var g,b,y=e.signal;y&&(y.aborted?v.abort():y.addEventListener("abort",(function(){return v.abort()}),{once:!0})),Object.keys(s).forEach((function(e){v.setRequestHeader(e,s[e])})),f&&v.upload.addEventListener("progress",f),v.onreadystatechange=function(){var e={};if(4===v.readyState){var t=v.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};t.forEach((function(e){var t=e.split(": "),r=t.shift().toLowerCase(),o=t.join(": ");n[r]=o})),e.header=n,e.statusCode=v.status;try{e.data="blob"===p?v.response:JSON.parse(v.responseText)}catch(t){e.data="blob"===p?v.response:v.responseText}clearTimeout(g),o(e)}},t&&n.timeout&&(g=setTimeout((function(){console.warn(n.timeoutMsg),v.abort()}),n.timeout)),b=(0,u.isFormData)(c)?c:"application/x-www-form-urlencoded"===s["content-type"]?(0,u.toQueryString)(c):h||(c?JSON.stringify(c):void 0),d&&(v.withCredentials=!0),v.send(b)}))},t}(c.AbstractSDKRequest);t.WebRequest=p,t.genAdapter=function(){return{type:"default",root:window,reqClass:p,wsClass:WebSocket,localStorage}}},2946:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.COMMUNITY_SITE_URL=t.IS_DEBUG_MODE=t.getProtocol=t.setProtocol=t.getSdkName=t.setSdkName=void 0;var n="@cloudbase/js-sdk";t.setSdkName=function(e){n=e},t.getSdkName=function(){return n};var r="https:";t.setProtocol=function(e){r=e},t.getProtocol=function(){return r},t.IS_DEBUG_MODE=!1,t.COMMUNITY_SITE_URL="https://support.qq.com/products/148793"},6205:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERRORS=void 0,t.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"}},794:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.OATUH_LOGINTYPE=void 0,o(n(2946),t),o(n(6205),t),t.OATUH_LOGINTYPE="constants"},7718:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.catchErrorsDecorator=void 0;var i=n(3616),a=n(794),s=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(s=-1!==navigator.userAgent.indexOf("Firefox"));var c=s?/(\.js\/)?__decorate(\$\d+)?<@.*\d$/:/(\/\w+\.js\.)?__decorate(\$\d+)?\s*\(.*\)$/,u=/https?:\/\/.+:\d*\/.*\.js:\d+:\d+/;function l(e){var t=e.err,n=e.className,r=e.methodName,o=e.sourceLink;if(!o)return null;var i,a=t.stack.split("\n"),c=s?/^catchErrorsDecorator\/<\/descriptor.value@.*\d$/:new RegExp("".concat(n,"\\.descriptor.value\\s*\\[as\\s").concat(r,"\\]\\s*\\(.*\\)$")),l=s?/^catchErrorsDecorator\/<\/descriptor.value/:new RegExp("".concat(n,"\\.descriptor.value\\s*\\[as\\s").concat(r,"\\]")),p=a.findIndex((function(e){return c.test(e)}));if(-1!==p){var d=a.filter((function(e,t){return t>p}));d.unshift(a[p].replace(l,"".concat(n,".").concat(r)).replace(u,o)),(i=new Error).stack="".concat(s?"@debugger":"Error","\n").concat(d.join("\n"))}return i}t.catchErrorsDecorator=function(e){var t=e.mode,n=void 0===t?"async":t,s=e.customInfo,p=void 0===s?{}:s,d=e.title,h=e.messages,f=void 0===h?[]:h;return function(e,t,s){if(a.IS_DEBUG_MODE){var h=p.className||e.constructor.name,m=p.methodName||t,v=s.value,g=function(){var e="",t=(new Error).stack.split("\n"),n=t.findIndex((function(e){return c.test(e)}));if(-1!==n){var r=u.exec(t[n+1]||"");e=r?r[0]:""}return e}();s.value="sync"===n?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=l({err:new Error,className:h,methodName:m,sourceLink:g});try{return v.apply(this,e)}catch(e){var r=e,o=e.message,a=e.error,s=e.error_description,c={title:d||"".concat(h,".").concat(m," failed"),content:[{type:"error",body:e}]};if(o&&/^\{.*\}$/.test(o)){var u=JSON.parse(o);c.subtitle=o,u.code&&(n?(n.code=u.code,n.msg=u.msg):(e.code=u.code,e.message=u.msg),r=n||e,c.content=f.map((function(e){return{type:"info",body:e}})))}throw a&&s&&(c.subtitle=s,n?(n.code=a,n.msg=s):(e.code=a,e.message=s),r=n||e,c.content=f.map((function(e){return{type:"info",body:e}}))),(0,i.printGroupLog)(c),r}}:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r(this,void 0,void 0,(function(){var t,n,r,a,s,c,u,p;return o(this,(function(o){switch(o.label){case 0:t=l({err:new Error,className:h,methodName:m,sourceLink:g}),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,v.apply(this,e)];case 2:return[2,o.sent()];case 3:throw n=o.sent(),r=n,a=n.message,s=n.error,c=n.error_description,u={title:d||"".concat(h,".").concat(m," failed"),content:[{type:"error",body:n}]},a&&/^\{.*\}$/.test(a)&&(p=JSON.parse(a),u.subtitle=p,p.code&&(t?(t.code=p.code,t.message=p.msg):(n.code=p.code,n.message=p.msg),r=t||n,u.content=f.map((function(e){return{type:"info",body:e}})))),s&&c&&(u.subtitle=c,t?(t.code=s,t.msg=c):(n.code=s,n.message=c),r=t||n,u.content=f.map((function(e){return{type:"info",body:e}}))),(0,i.printGroupLog)(u),r;case 4:return[2]}}))}))}}}}},141:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(7718),t)},6197:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.CloudbaseCache=void 0;var s=n(2764),c=n(3616),u=n(794),l=function(e){function t(t){var n=e.call(this)||this;return n.root=t,t.tcbCacheObject||(t.tcbCacheObject={}),n}return o(t,e),t.prototype.setItem=function(e,t){this.root.tcbCacheObject[e]=t},t.prototype.getItem=function(e){return this.root.tcbCacheObject[e]},t.prototype.removeItem=function(e){delete this.root.tcbCacheObject[e]},t.prototype.clear=function(){delete this.root.tcbCacheObject},t}(s.AbstractStorage),p=function(){function e(e){this.keys={};var t=e.persistence,n=e.platformInfo,r=void 0===n?{}:n,o=e.keys,i=void 0===o?{}:o;this.platformInfo=r,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||t,this.storage=function(e,t){switch(e){case"local":default:return t.localStorage?t.localStorage:((0,c.printWarn)(u.ERRORS.INVALID_PARAMS,"localStorage is not supported on current platform"),new l(t.root));case"none":return new l(t.root)}}(this.persistenceTag,this.platformInfo.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.persistenceTag},enumerable:!1,configurable:!0}),e.prototype.setStore=function(e,t,n){if("async"!==this.mode){if(this.storage)try{var r={version:n||"localCachev1",content:t};this.storage.setItem(e,JSON.stringify(r))}catch(e){throw new Error(JSON.stringify({code:u.ERRORS.OPERATION_FAIL,msg:"[".concat((0,u.getSdkName)(),"][").concat(u.ERRORS.OPERATION_FAIL,"]setStore failed"),info:e}))}}else(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},e.prototype.setStoreAsync=function(e,t,n){return i(this,void 0,void 0,(function(){var r;return a(this,(function(o){switch(o.label){case 0:if(!this.storage)return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),r={version:n||"localCachev1",content:t},[4,this.storage.setItem(e,JSON.stringify(r))];case 2:return o.sent(),[3,4];case 3:return o.sent(),[2];case 4:return[2]}}))}))},e.prototype.getStore=function(e,t){var n;if("async"!==this.mode){try{if("undefined"!=typeof process&&(null===(n={IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0})||void 0===n?void 0:n.tcb_token))return{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token;if(!this.storage)return""}catch(e){return""}t=t||"localCachev1";var r=this.storage.getItem(e);return r&&r.indexOf(t)>=0?JSON.parse(r).content:""}(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},e.prototype.getStoreAsync=function(e,t){var n;return i(this,void 0,void 0,(function(){var r;return a(this,(function(o){switch(o.label){case 0:try{if("undefined"!=typeof process&&(null===(n={IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0})||void 0===n?void 0:n.tcb_token))return[2,{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token];if(!this.storage)return[2,""]}catch(e){return[2,""]}return t=t||"localCachev1",[4,this.storage.getItem(e)];case 1:return(r=o.sent())&&r.indexOf(t)>=0?[2,JSON.parse(r).content]:[2,""]}}))}))},e.prototype.removeStore=function(e){"async"!==this.mode?this.storage.removeItem(e):(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},e.prototype.removeStoreAsync=function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.storage.removeItem(e)];case 1:return t.sent(),[2]}}))}))},e}();t.CloudbaseCache=p},9689:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.removeEventListener=t.activateEvent=t.addEventListener=t.CloudbaseEventEmitter=t.IErrorEvent=t.CloudbaseEvent=void 0;var a=n(3616),s=function(e,t){this.data=t||null,this.name=e};t.CloudbaseEvent=s;var c=function(e){function t(t,n){var r=e.call(this,"error",{error:t,data:n})||this;return r.error=t,r}return o(t,e),t}(s);t.IErrorEvent=c;var u=function(){function e(){this.listeners={}}return e.prototype.on=function(e,t){return function(e,t,n){n[e]=n[e]||[],n[e].push(t)}(e,t,this.listeners),this},e.prototype.off=function(e,t){return function(e,t,n){if(null==n?void 0:n[e]){var r=n[e].indexOf(t);-1!==r&&n[e].splice(r,1)}}(e,t,this.listeners),this},e.prototype.fire=function(e,t){if((0,a.isInstanceOf)(e,c))return console.error(e.error),this;var n=(0,a.isString)(e)?new s(e,t||{}):e,r=n.name;if(this.listens(r)){n.target=this;for(var o=0,u=this.listeners[r]?i([],this.listeners[r],!0):[];o<u.length;o++)u[o].call(this,n)}return this},e.prototype.listens=function(e){return this.listeners[e]&&this.listeners[e].length>0},e}();t.CloudbaseEventEmitter=u;var l=new u;t.addEventListener=function(e,t){l.on(e,t)},t.activateEvent=function(e,t){void 0===t&&(t={}),l.fire(e,t)},t.removeEventListener=function(e,t){l.off(e,t)}},3616:function(e,t,n){"use strict";var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.parseCaptcha=t.parseQueryString=t.transformPhone=t.sleep=t.printGroupLog=t.throwError=t.printInfo=t.printError=t.printWarn=t.execCallback=t.createPromiseCallback=t.removeParam=t.getHash=t.getQuery=t.toQueryString=t.formatUrl=t.generateRequestId=t.genSeqId=t.isFormData=t.isInstanceOf=t.isNull=t.isPalinObject=t.isUndefined=t.isString=t.isArray=void 0;var o=n(794);t.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},t.isString=function(e){return"string"==typeof e},t.isUndefined=function(e){return void 0===e},t.isPalinObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},t.isNull=function(e){return"[object Null]"===Object.prototype.toString.call(e)},t.isInstanceOf=function(e,t){return e instanceof t},t.isFormData=function(e){return"[object FormData]"===Object.prototype.toString.call(e)},t.genSeqId=function(){return Math.random().toString(16).slice(2)},t.generateRequestId=function(){var e=(new Date).getTime(),t=(null===Date||void 0===Date?void 0:Date.now)&&1e3*Date.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(n){var r=16*Math.random();return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),("x"===n?r:7&r|8).toString(16)}))},t.formatUrl=function(e,t,n){void 0===n&&(n={});var r=/\?/.test(t),o="";return Object.keys(n).forEach((function(e){""===o?!r&&(t+="?"):o+="&",o+="".concat(e,"=").concat(encodeURIComponent(n[e]))})),/^http(s)?:\/\//.test(t+=o)?t:"".concat(e).concat(t)},t.toQueryString=function(e){void 0===e&&(e={});var t=[];return Object.keys(e).forEach((function(n){t.push("".concat(n,"=").concat(encodeURIComponent(e[n])))})),t.join("&")},t.getQuery=function(e,t){if("undefined"==typeof window)return!1;var n=t||decodeURIComponent(window.location.search),r=new RegExp("(^|&)".concat(e,"=([^&]*)(&|$)")),o=n.substr(n.indexOf("?")+1).match(r);return null!=o?o[2]:""},t.getHash=function(e){if("undefined"==typeof window)return"";var t=window.location.hash.match(new RegExp("[#?&/]".concat(e,"=([^&#]*)")));return t?t[1]:""},t.removeParam=function(e,t){var n=t.split("?")[0],r=[],o=-1!==t.indexOf("?")?t.split("?")[1]:"";if(""!==o){for(var i=(r=o.split("&")).length-1;i>=0;i-=1)r[i].split("=")[0]===e&&r.splice(i,1);n="".concat(n,"?").concat(r.join("&"))}return n},t.createPromiseCallback=function(){var e={};if(!Promise){(e=function(){}).promise={};var t=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}var n=new Promise((function(t,n){e=function(e,r){return e?n(e):t(r)}}));return e.promise=n,e},t.execCallback=function(e,t,n){if(void 0===n&&(n=null),e&&"function"==typeof e)return e(t,n);if(t)throw t;return n},t.printWarn=function(e,t){console.warn("[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t))},t.printError=function(e,t){console.error({code:e,msg:"[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t)})},t.printInfo=function(e,t){console.log("[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t))},t.throwError=function(e,t){throw new Error(JSON.stringify({code:e,msg:"[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t)}))},t.printGroupLog=function(e){var t,n=e.title,r=e.subtitle,o=void 0===r?"":r,i=e.content,a=void 0===i?[]:i,s=e.printTrace,c=void 0!==s&&s,u=e.collapsed;void 0!==u&&u?(console.groupCollapsed||console.error)(n,o):(console.group||console.error)(n,o);for(var l=0,p=a;l<p.length;l++){var d=p[l],h=d.type,f=d.body;switch(h){case"info":console.log(f);break;case"warn":console.warn(f);break;case"error":console.error(f)}}c&&(console.trace||console.log)("stack trace:"),null===(t=console.groupEnd)||void 0===t||t.call(console)},t.sleep=function(e){return void 0===e&&(e=0),new Promise((function(t){return setTimeout(t,e)}))},t.transformPhone=function(e){return"+86".concat(e)},t.parseQueryString=function(e){e=e.replace(/^\?/,"");var t={};return e.split("&").forEach((function(e){var n=e.split("="),r=n[0],o=n[1];r=decodeURIComponent(r),o=decodeURIComponent(o),r&&(t[r]?Array.isArray(t[r])?t[r].push(o):t[r]=[t[r],o]:t[r]=o)})),t},t.parseCaptcha=function(e){var n={},o=e.match(/^(data:.*?)(\?[^#\s]*)?$/);if(o){e=o[1];var i=o[2];i&&(n=(0,t.parseQueryString)(i))}var a=n.token,s=r(n,["token"]);return/^data:/.test(e)&&!a?{error:"invalid_argument",error_description:"invalid captcha data: ".concat(e)}:a?{state:s.state,token:a,captchaData:e}:{error:"unimplemented",error_description:"need to impl captcha data"}}},6160:(e,t,n)=>{var r=n(3837),o=n(2781).Stream,i=n(8178);function a(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}e.exports=a,r.inherits(a,o),a.create=function(e){var t=new this;for(var n in e=e||{})t[n]=e[n];return t},a.isStreamLike=function(e){return"function"!=typeof e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&!Buffer.isBuffer(e)},a.prototype.append=function(e){if(a.isStreamLike(e)){if(!(e instanceof i)){var t=i.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=t}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this},a.prototype.pipe=function(e,t){return o.prototype.pipe.call(this,e,t),this.resume(),e},a.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop)this._pendingNext=!0;else{this._insideLoop=!0;try{do{this._pendingNext=!1,this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=!1}}},a.prototype._realGetNext=function(){var e=this._streams.shift();void 0!==e?"function"==typeof e?e(function(e){a.isStreamLike(e)&&(e.on("data",this._checkDataSize.bind(this)),this._handleErrors(e)),this._pipeNext(e)}.bind(this)):this._pipeNext(e):this.end()},a.prototype._pipeNext=function(e){if(this._currentStream=e,a.isStreamLike(e))return e.on("end",this._getNext.bind(this)),void e.pipe(this,{end:!1});var t=e;this.write(t),this._getNext()},a.prototype._handleErrors=function(e){var t=this;e.on("error",(function(e){t._emitError(e)}))},a.prototype.write=function(e){this.emit("data",e)},a.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.pause&&this._currentStream.pause(),this.emit("pause"))},a.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.resume&&this._currentStream.resume(),this.emit("resume")},a.prototype.end=function(){this._reset(),this.emit("end")},a.prototype.destroy=function(){this._reset(),this.emit("close")},a.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null},a.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}},a.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach((function(t){t.dataSize&&(e.dataSize+=t.dataSize)})),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)},a.prototype._emitError=function(e){this._reset(),this.emit("error",e)}},8178:(e,t,n)=>{var r=n(2781).Stream,o=n(3837);function i(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}e.exports=i,o.inherits(i,r),i.create=function(e,t){var n=new this;for(var r in t=t||{})n[r]=t[r];n.source=e;var o=e.emit;return e.emit=function(){return n._handleEmit(arguments),o.apply(e,arguments)},e.on("error",(function(){})),n.pauseStream&&e.pause(),n},Object.defineProperty(i.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),i.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},i.prototype.resume=function(){this._released||this.release(),this.source.resume()},i.prototype.pause=function(){this.source.pause()},i.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]},i.prototype.pipe=function(){var e=r.prototype.pipe.apply(this,arguments);return this.resume(),e},i.prototype._handleEmit=function(e){this._released?this.emit.apply(this,e):("data"===e[0]&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e))},i.prototype._checkIfMaxDataSizeExceeded=function(){if(!(this._maxDataSizeExceeded||this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}},1191:(e,t,n)=>{var r=n(6160),o=n(3837),i=n(1017),a=n(3685),s=n(5687),c=n(7310).parse,u=n(7147),l=n(2781).Stream,p=n(6856),d=n(9954),h=n(5488);function f(e){if(!(this instanceof f))return new f(e);for(var t in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],r.call(this),e=e||{})this[t]=e[t]}e.exports=f,o.inherits(f,r),f.LINE_BREAK="\r\n",f.DEFAULT_CONTENT_TYPE="application/octet-stream",f.prototype.append=function(e,t,n){"string"==typeof(n=n||{})&&(n={filename:n});var i=r.prototype.append.bind(this);if("number"==typeof t&&(t=""+t),o.isArray(t))this._error(new Error("Arrays are not supported."));else{var a=this._multiPartHeader(e,t,n),s=this._multiPartFooter();i(a),i(t),i(s),this._trackLength(a,t,n)}},f.prototype._trackLength=function(e,t,n){var r=0;null!=n.knownLength?r+=+n.knownLength:Buffer.isBuffer(t)?r=t.length:"string"==typeof t&&(r=Buffer.byteLength(t)),this._valueLength+=r,this._overheadLength+=Buffer.byteLength(e)+f.LINE_BREAK.length,t&&(t.path||t.readable&&t.hasOwnProperty("httpVersion")||t instanceof l)&&(n.knownLength||this._valuesToMeasure.push(t))},f.prototype._lengthRetriever=function(e,t){e.hasOwnProperty("fd")?null!=e.end&&e.end!=1/0&&null!=e.start?t(null,e.end+1-(e.start?e.start:0)):u.stat(e.path,(function(n,r){var o;n?t(n):(o=r.size-(e.start?e.start:0),t(null,o))})):e.hasOwnProperty("httpVersion")?t(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",(function(n){e.pause(),t(null,+n.headers["content-length"])})),e.resume()):t("Unknown stream")},f.prototype._multiPartHeader=function(e,t,n){if("string"==typeof n.header)return n.header;var r,o=this._getContentDisposition(t,n),i=this._getContentType(t,n),a="",s={"Content-Disposition":["form-data",'name="'+e+'"'].concat(o||[]),"Content-Type":[].concat(i||[])};for(var c in"object"==typeof n.header&&h(s,n.header),s)s.hasOwnProperty(c)&&null!=(r=s[c])&&(Array.isArray(r)||(r=[r]),r.length&&(a+=c+": "+r.join("; ")+f.LINE_BREAK));return"--"+this.getBoundary()+f.LINE_BREAK+a+f.LINE_BREAK},f.prototype._getContentDisposition=function(e,t){var n,r;return"string"==typeof t.filepath?n=i.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e.name||e.path?n=i.basename(t.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(n=i.basename(e.client._httpMessage.path||"")),n&&(r='filename="'+n+'"'),r},f.prototype._getContentType=function(e,t){var n=t.contentType;return!n&&e.name&&(n=p.lookup(e.name)),!n&&e.path&&(n=p.lookup(e.path)),!n&&e.readable&&e.hasOwnProperty("httpVersion")&&(n=e.headers["content-type"]),n||!t.filepath&&!t.filename||(n=p.lookup(t.filepath||t.filename)),n||"object"!=typeof e||(n=f.DEFAULT_CONTENT_TYPE),n},f.prototype._multiPartFooter=function(){return function(e){var t=f.LINE_BREAK;0===this._streams.length&&(t+=this._lastBoundary()),e(t)}.bind(this)},f.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+f.LINE_BREAK},f.prototype.getHeaders=function(e){var t,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)e.hasOwnProperty(t)&&(n[t.toLowerCase()]=e[t]);return n},f.prototype.setBoundary=function(e){this._boundary=e},f.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},f.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),n=0,r=this._streams.length;n<r;n++)"function"!=typeof this._streams[n]&&(e=Buffer.isBuffer(this._streams[n])?Buffer.concat([e,this._streams[n]]):Buffer.concat([e,Buffer.from(this._streams[n])]),"string"==typeof this._streams[n]&&this._streams[n].substring(2,t.length+2)===t||(e=Buffer.concat([e,Buffer.from(f.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},f.prototype._generateBoundary=function(){for(var e="--------------------------",t=0;t<24;t++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},f.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},f.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},f.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;this._streams.length&&(t+=this._lastBoundary().length),this._valuesToMeasure.length?d.parallel(this._valuesToMeasure,this._lengthRetriever,(function(n,r){n?e(n):(r.forEach((function(e){t+=e})),e(null,t))})):process.nextTick(e.bind(this,null,t))},f.prototype.submit=function(e,t){var n,r,o={method:"post"};return"string"==typeof e?(e=c(e),r=h({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(r=h(e,o)).port||(r.port="https:"==r.protocol?443:80),r.headers=this.getHeaders(e.headers),n="https:"==r.protocol?s.request(r):a.request(r),this.getLength(function(e,r){if(e&&"Unknown stream"!==e)this._error(e);else if(r&&n.setHeader("Content-Length",r),this.pipe(n),t){var o,i=function(e,r){return n.removeListener("error",i),n.removeListener("response",o),t.call(this,e,r)};o=i.bind(this,null),n.on("error",i),n.on("response",o)}}.bind(this)),n},f.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},f.prototype.toString=function(){return"[object FormData]"}},5488:e=>{e.exports=function(e,t){return Object.keys(t).forEach((function(n){e[n]=e[n]||t[n]})),e}},9515:(e,t,n)=>{var r=n(8761)(n(7772),"DataView");e.exports=r},9612:(e,t,n)=>{var r=n(2118),o=n(6909),i=n(8138),a=n(4174),s=n(7942);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},235:(e,t,n)=>{var r=n(3945),o=n(1846),i=n(8028),a=n(6018),s=n(4769);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},326:(e,t,n)=>{var r=n(8761)(n(7772),"Map");e.exports=r},6738:(e,t,n)=>{var r=n(2411),o=n(6417),i=n(6928),a=n(9493),s=n(4150);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},2760:(e,t,n)=>{var r=n(8761)(n(7772),"Promise");e.exports=r},2143:(e,t,n)=>{var r=n(8761)(n(7772),"Set");e.exports=r},6571:(e,t,n)=>{var r=n(235),o=n(5243),i=n(2858),a=n(4417),s=n(8605),c=n(1418);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=o,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=s,u.prototype.set=c,e.exports=u},857:(e,t,n)=>{var r=n(7772).Symbol;e.exports=r},9162:(e,t,n)=>{var r=n(7772).Uint8Array;e.exports=r},3215:(e,t,n)=>{var r=n(8761)(n(7772),"WeakMap");e.exports=r},2517:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},7552:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}},1634:(e,t,n)=>{var r=n(6473),o=n(9631),i=n(6152),a=n(3226),s=n(9045),c=n(7598),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),l=!n&&o(e),p=!n&&!l&&a(e),d=!n&&!l&&!p&&c(e),h=n||l||p||d,f=h?r(e.length,String):[],m=f.length;for(var v in e)!t&&!u.call(e,v)||h&&("length"==v||p&&("offset"==v||"parent"==v)||d&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,m))||f.push(v);return f}},343:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},5067:e=>{e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},91:(e,t,n)=>{var r=n(3940),o=n(1225),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];i.call(e,t)&&o(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},2218:(e,t,n)=>{var r=n(1225);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},7993:(e,t,n)=>{var r=n(752),o=n(249);e.exports=function(e,t){return e&&r(t,o(t),e)}},5906:(e,t,n)=>{var r=n(752),o=n(8582);e.exports=function(e,t){return e&&r(t,o(t),e)}},3940:(e,t,n)=>{var r=n(3043);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},8874:(e,t,n)=>{var r=n(6571),o=n(2517),i=n(91),a=n(7993),s=n(5906),c=n(2175),u=n(1522),l=n(7680),p=n(9987),d=n(3483),h=n(6939),f=n(940),m=n(9917),v=n(8222),g=n(8725),b=n(6152),y=n(3226),_=n(4714),x=n(9259),w=n(3679),E=n(249),I=n(8582),S="[object Arguments]",O="[object Function]",T="[object Object]",A={};A[S]=A["[object Array]"]=A["[object ArrayBuffer]"]=A["[object DataView]"]=A["[object Boolean]"]=A["[object Date]"]=A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Map]"]=A["[object Number]"]=A[T]=A["[object RegExp]"]=A["[object Set]"]=A["[object String]"]=A["[object Symbol]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A["[object Error]"]=A[O]=A["[object WeakMap]"]=!1,e.exports=function e(t,n,P,C,R,N){var k,j=1&n,U=2&n,D=4&n;if(P&&(k=R?P(t,C,R,N):P(t)),void 0!==k)return k;if(!x(t))return t;var L=b(t);if(L){if(k=m(t),!j)return u(t,k)}else{var M=f(t),q=M==O||"[object GeneratorFunction]"==M;if(y(t))return c(t,j);if(M==T||M==S||q&&!R){if(k=U||q?{}:g(t),!j)return U?p(t,s(k,t)):l(t,a(k,t))}else{if(!A[M])return R?t:{};k=v(t,M,j)}}N||(N=new r);var B=N.get(t);if(B)return B;N.set(t,k),w(t)?t.forEach((function(r){k.add(e(r,n,P,r,t,N))})):_(t)&&t.forEach((function(r,o){k.set(o,e(r,n,P,o,t,N))}));var F=L?void 0:(D?U?h:d:U?I:E)(t);return o(F||t,(function(r,o){F&&(r=t[o=r]),i(k,o,e(r,n,P,o,t,N))})),k}},9413:(e,t,n)=>{var r=n(9259),o=Object.create,i=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=i},3324:(e,t,n)=>{var r=n(7297),o=n(3812);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n<i;)e=e[o(t[n++])];return n&&n==i?e:void 0}},1897:(e,t,n)=>{var r=n(5067),o=n(6152);e.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}},3366:(e,t,n)=>{var r=n(857),o=n(2107),i=n(7157),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},5183:(e,t,n)=>{var r=n(3366),o=n(5125);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},4511:(e,t,n)=>{var r=n(940),o=n(5125);e.exports=function(e){return o(e)&&"[object Map]"==r(e)}},6840:(e,t,n)=>{var r=n(1049),o=n(7394),i=n(9259),a=n(7035),s=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,l=c.toString,p=u.hasOwnProperty,d=RegExp("^"+l.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?d:s).test(a(e))}},8436:(e,t,n)=>{var r=n(940),o=n(5125);e.exports=function(e){return o(e)&&"[object Set]"==r(e)}},5522:(e,t,n)=>{var r=n(3366),o=n(1158),i=n(5125),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[r(e)]}},6411:(e,t,n)=>{var r=n(6001),o=n(4248),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},8390:(e,t,n)=>{var r=n(9259),o=n(6001),i=n(2966),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=o(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},2857:(e,t,n)=>{var r=n(91),o=n(7297),i=n(9045),a=n(9259),s=n(3812);e.exports=function(e,t,n,c){if(!a(e))return e;for(var u=-1,l=(t=o(t,e)).length,p=l-1,d=e;null!=d&&++u<l;){var h=s(t[u]),f=n;if("__proto__"===h||"constructor"===h||"prototype"===h)return e;if(u!=p){var m=d[h];void 0===(f=c?c(m,h,d):void 0)&&(f=a(m)?m:i(t[u+1])?[]:{})}r(d,h,f),d=d[h]}return e}},9872:e=>{e.exports=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}},6473:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},1054:(e,t,n)=>{var r=n(857),o=n(343),i=n(6152),a=n(4795),s=r?r.prototype:void 0,c=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(a(t))return c?c.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},7826:e=>{e.exports=function(e){return function(t){return e(t)}}},9078:(e,t,n)=>{var r=n(7297),o=n(6974),i=n(2721),a=n(3812);e.exports=function(e,t){return t=r(t,e),null==(e=i(e,t))||delete e[a(o(t))]}},7297:(e,t,n)=>{var r=n(6152),o=n(1401),i=n(4452),a=n(6188);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:i(a(e))}},9882:(e,t,n)=>{var r=n(9162);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},2175:(e,t,n)=>{e=n.nmd(e);var r=n(7772),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},4727:(e,t,n)=>{var r=n(9882);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},6058:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},169:(e,t,n)=>{var r=n(857),o=r?r.prototype:void 0,i=o?o.valueOf:void 0;e.exports=function(e){return i?Object(i.call(e)):{}}},6190:(e,t,n)=>{var r=n(9882);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},1522:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},752:(e,t,n)=>{var r=n(91),o=n(3940);e.exports=function(e,t,n,i){var a=!n;n||(n={});for(var s=-1,c=t.length;++s<c;){var u=t[s],l=i?i(n[u],e[u],u,n,e):void 0;void 0===l&&(l=e[u]),a?o(n,u,l):r(n,u,l)}return n}},7680:(e,t,n)=>{var r=n(752),o=n(633);e.exports=function(e,t){return r(e,o(e),t)}},9987:(e,t,n)=>{var r=n(752),o=n(2680);e.exports=function(e,t){return r(e,o(e),t)}},4019:(e,t,n)=>{var r=n(7772)["__core-js_shared__"];e.exports=r},3043:(e,t,n)=>{var r=n(8761),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},1242:e=>{var t="object"==typeof global&&global&&global.Object===Object&&global;e.exports=t},3483:(e,t,n)=>{var r=n(1897),o=n(633),i=n(249);e.exports=function(e){return r(e,i,o)}},6939:(e,t,n)=>{var r=n(1897),o=n(2680),i=n(8582);e.exports=function(e){return r(e,i,o)}},7937:(e,t,n)=>{var r=n(8304);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},8761:(e,t,n)=>{var r=n(6840),o=n(8109);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},7353:(e,t,n)=>{var r=n(241)(Object.getPrototypeOf,Object);e.exports=r},2107:(e,t,n)=>{var r=n(857),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[s]=n:delete e[s]),o}},633:(e,t,n)=>{var r=n(7552),o=n(981),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return i.call(e,t)})))}:o;e.exports=s},2680:(e,t,n)=>{var r=n(5067),o=n(7353),i=n(633),a=n(981),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:a;e.exports=s},940:(e,t,n)=>{var r=n(9515),o=n(326),i=n(2760),a=n(2143),s=n(3215),c=n(3366),u=n(7035),l="[object Map]",p="[object Promise]",d="[object Set]",h="[object WeakMap]",f="[object DataView]",m=u(r),v=u(o),g=u(i),b=u(a),y=u(s),_=c;(r&&_(new r(new ArrayBuffer(1)))!=f||o&&_(new o)!=l||i&&_(i.resolve())!=p||a&&_(new a)!=d||s&&_(new s)!=h)&&(_=function(e){var t=c(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case m:return f;case v:return l;case g:return p;case b:return d;case y:return h}return t}),e.exports=_},8109:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},2118:(e,t,n)=>{var r=n(9191);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},6909:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},8138:(e,t,n)=>{var r=n(9191),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},4174:(e,t,n)=>{var r=n(9191),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},7942:(e,t,n)=>{var r=n(9191);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},9917:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},8222:(e,t,n)=>{var r=n(9882),o=n(4727),i=n(6058),a=n(169),s=n(6190);e.exports=function(e,t,n){var c=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return o(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return i(e);case"[object Symbol]":return a(e)}}},8725:(e,t,n)=>{var r=n(9413),o=n(7353),i=n(6001);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:r(o(e))}},9045:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},1401:(e,t,n)=>{var r=n(6152),o=n(4795),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||a.test(e)||!i.test(e)||null!=t&&e in Object(t)}},8304:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7394:(e,t,n)=>{var r,o=n(4019),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},6001:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},3945:e=>{e.exports=function(){this.__data__=[],this.size=0}},1846:(e,t,n)=>{var r=n(2218),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}},8028:(e,t,n)=>{var r=n(2218);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},6018:(e,t,n)=>{var r=n(2218);e.exports=function(e){return r(this.__data__,e)>-1}},4769:(e,t,n)=>{var r=n(2218);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},2411:(e,t,n)=>{var r=n(9612),o=n(235),i=n(326);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},6417:(e,t,n)=>{var r=n(7937);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},6928:(e,t,n)=>{var r=n(7937);e.exports=function(e){return r(this,e).get(e)}},9493:(e,t,n)=>{var r=n(7937);e.exports=function(e){return r(this,e).has(e)}},4150:(e,t,n)=>{var r=n(7937);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},7777:(e,t,n)=>{var r=n(733);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},9191:(e,t,n)=>{var r=n(8761)(Object,"create");e.exports=r},4248:(e,t,n)=>{var r=n(241)(Object.keys,Object);e.exports=r},2966:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},4146:(e,t,n)=>{e=n.nmd(e);var r=n(1242),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,s=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},7157:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},241:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},2721:(e,t,n)=>{var r=n(3324),o=n(9872);e.exports=function(e,t){return t.length<2?e:r(e,o(t,0,-1))}},7772:(e,t,n)=>{var r=n(1242),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},5243:(e,t,n)=>{var r=n(235);e.exports=function(){this.__data__=new r,this.size=0}},2858:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},4417:e=>{e.exports=function(e){return this.__data__.get(e)}},8605:e=>{e.exports=function(e){return this.__data__.has(e)}},1418:(e,t,n)=>{var r=n(235),o=n(326),i=n(6738);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},4452:(e,t,n)=>{var r=n(7777),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,n,r,o){t.push(r?o.replace(i,"$1"):n||e)})),t}));e.exports=a},3812:(e,t,n)=>{var r=n(4795);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7035:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},9850:(e,t,n)=>{var r=n(8874);e.exports=function(e){return r(e,5)}},1225:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},9631:(e,t,n)=>{var r=n(5183),o=n(5125),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=c},6152:e=>{var t=Array.isArray;e.exports=t},7878:(e,t,n)=>{var r=n(1049),o=n(1158);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},3226:(e,t,n)=>{e=n.nmd(e);var r=n(7772),o=n(6330),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,s=a&&a.exports===i?r.Buffer:void 0,c=(s?s.isBuffer:void 0)||o;e.exports=c},1049:(e,t,n)=>{var r=n(3366),o=n(9259);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1158:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},4714:(e,t,n)=>{var r=n(4511),o=n(7826),i=n(4146),a=i&&i.isMap,s=a?o(a):r;e.exports=s},9259:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5125:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},3679:(e,t,n)=>{var r=n(8436),o=n(7826),i=n(4146),a=i&&i.isSet,s=a?o(a):r;e.exports=s},4795:(e,t,n)=>{var r=n(3366),o=n(5125);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},7598:(e,t,n)=>{var r=n(5522),o=n(7826),i=n(4146),a=i&&i.isTypedArray,s=a?o(a):r;e.exports=s},249:(e,t,n)=>{var r=n(1634),o=n(6411),i=n(7878);e.exports=function(e){return i(e)?r(e):o(e)}},8582:(e,t,n)=>{var r=n(1634),o=n(8390),i=n(7878);e.exports=function(e){return i(e)?r(e,!0):o(e)}},6974:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},733:(e,t,n)=>{var r=n(6738);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},6765:(e,t,n)=>{var r=n(2857);e.exports=function(e,t,n){return null==e?e:r(e,t,n)}},981:e=>{e.exports=function(){return[]}},6330:e=>{e.exports=function(){return!1}},6188:(e,t,n)=>{var r=n(1054);e.exports=function(e){return null==e?"":r(e)}},7195:(e,t,n)=>{var r=n(9078);e.exports=function(e,t){return null==e||r(e,t)}},9474:(e,t,n)=>{e.exports=n(7104)},6856:(e,t,n)=>{"use strict";var r,o,i,a=n(9474),s=n(1017).extname,c=/^\s*([^;\s]*)(?:;|\s|$)/,u=/^text\//i;function l(e){if(!e||"string"!=typeof e)return!1;var t=c.exec(e),n=t&&a[t[1].toLowerCase()];return n&&n.charset?n.charset:!(!t||!u.test(t[1]))&&"UTF-8"}t.charset=l,t.charsets={lookup:l},t.contentType=function(e){if(!e||"string"!=typeof e)return!1;var n=-1===e.indexOf("/")?t.lookup(e):e;if(!n)return!1;if(-1===n.indexOf("charset")){var r=t.charset(n);r&&(n+="; charset="+r.toLowerCase())}return n},t.extension=function(e){if(!e||"string"!=typeof e)return!1;var n=c.exec(e),r=n&&t.extensions[n[1].toLowerCase()];return!(!r||!r.length)&&r[0]},t.extensions=Object.create(null),t.lookup=function(e){if(!e||"string"!=typeof e)return!1;var n=s("x."+e).toLowerCase().substr(1);return n&&t.types[n]||!1},t.types=Object.create(null),r=t.extensions,o=t.types,i=["nginx","apache",void 0,"iana"],Object.keys(a).forEach((function(e){var t=a[e],n=t.extensions;if(n&&n.length){r[e]=n;for(var s=0;s<n.length;s++){var c=n[s];if(o[c]){var u=i.indexOf(a[o[c]].source),l=i.indexOf(t.source);if("application/octet-stream"!==o[c]&&(u>l||u===l&&"application/"===o[c].substr(0,12)))continue}o[c]=e}}}))},2764:e=>{"use strict";e.exports=require("@cloudbase/adapter-interface")},7917:e=>{"use strict";e.exports=require("@cloudbase/adapter-wx_mp")},8899:e=>{"use strict";e.exports=require("@cloudbase/signature-nodejs")},8630:e=>{"use strict";e.exports=require("@cloudbase/wx-cloud-client-sdk")},766:e=>{"use strict";e.exports=require("@mattiasbuelens/web-streams-adapter")},2701:e=>{"use strict";e.exports=require("bson")},156:e=>{"use strict";e.exports=require("jsonwebtoken")},3107:e=>{"use strict";e.exports=require("jwt-decode")},6282:e=>{"use strict";e.exports=require("text-encoding-shim")},8775:e=>{"use strict";e.exports=require("web-streams-polyfill")},6850:e=>{"use strict";e.exports=require("ws")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},5687:e=>{"use strict";e.exports=require("https")},1017:e=>{"use strict";e.exports=require("path")},2781:e=>{"use strict";e.exports=require("stream")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")},7104:e=>{"use strict";e.exports=JSON.parse('{"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/3gpphal+json":{"source":"iana","compressible":true},"application/3gpphalforms+json":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/ace+cbor":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/alto-updatestreamcontrol+json":{"source":"iana","compressible":true},"application/alto-updatestreamparams+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/at+jwt":{"source":"iana"},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true,"extensions":["atomdeleted"]},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atsc-dwd+xml":{"source":"iana","compressible":true,"extensions":["dwd"]},"application/atsc-dynamic-event-message":{"source":"iana"},"application/atsc-held+xml":{"source":"iana","compressible":true,"extensions":["held"]},"application/atsc-rdt+json":{"source":"iana","compressible":true},"application/atsc-rsat+xml":{"source":"iana","compressible":true,"extensions":["rsat"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true,"extensions":["xcs"]},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/captive+json":{"source":"iana","compressible":true},"application/cbor":{"source":"iana"},"application/cbor-seq":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cdfx+xml":{"source":"iana","compressible":true,"extensions":["cdfx"]},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/cea":{"source":"iana"},"application/cea-2018+xml":{"source":"iana","compressible":true},"application/cellml+xml":{"source":"iana","compressible":true},"application/cfw":{"source":"iana"},"application/city+json":{"source":"iana","compressible":true},"application/clr":{"source":"iana"},"application/clue+xml":{"source":"iana","compressible":true},"application/clue_info+xml":{"source":"iana","compressible":true},"application/cms":{"source":"iana"},"application/cnrp+xml":{"source":"iana","compressible":true},"application/coap-group+json":{"source":"iana","compressible":true},"application/coap-payload":{"source":"iana"},"application/commonground":{"source":"iana"},"application/conference-info+xml":{"source":"iana","compressible":true},"application/cose":{"source":"iana"},"application/cose-key":{"source":"iana"},"application/cose-key-set":{"source":"iana"},"application/cpl+xml":{"source":"iana","compressible":true,"extensions":["cpl"]},"application/csrattrs":{"source":"iana"},"application/csta+xml":{"source":"iana","compressible":true},"application/cstadata+xml":{"source":"iana","compressible":true},"application/csvm+json":{"source":"iana","compressible":true},"application/cu-seeme":{"source":"apache","extensions":["cu"]},"application/cwt":{"source":"iana"},"application/cybercash":{"source":"iana"},"application/dart":{"compressible":true},"application/dash+xml":{"source":"iana","compressible":true,"extensions":["mpd"]},"application/dash-patch+xml":{"source":"iana","compressible":true,"extensions":["mpp"]},"application/dashdelta":{"source":"iana"},"application/davmount+xml":{"source":"iana","compressible":true,"extensions":["davmount"]},"application/dca-rft":{"source":"iana"},"application/dcd":{"source":"iana"},"application/dec-dx":{"source":"iana"},"application/dialog-info+xml":{"source":"iana","compressible":true},"application/dicom":{"source":"iana"},"application/dicom+json":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/dns-message":{"source":"iana"},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dots+cbor":{"source":"iana"},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/ecmascript":{"source":"iana","compressible":true,"extensions":["es","ecma"]},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/elm+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/elm+xml":{"source":"iana","compressible":true},"application/emergencycalldata.cap+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true,"extensions":["emotionml"]},"application/encaprtp":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/expect-ct-report+json":{"source":"iana","compressible":true},"application/express":{"source":"iana","extensions":["exp"]},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdt+xml":{"source":"iana","compressible":true,"extensions":["fdt"]},"application/fhir+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/fhir+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/flexfec":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geopackage+sqlite3":{"source":"iana"},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true,"extensions":["its"]},"application/java-archive":{"source":"apache","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/jscalendar+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true,"extensions":["lgr"]},"application/link-format":{"source":"iana"},"application/load-control+xml":{"source":"iana","compressible":true},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lpf+zip":{"source":"iana","compressible":false},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true,"extensions":["mpf"]},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mipc":{"source":"iana"},"application/missing-blocks+cbor-seq":{"source":"iana"},"application/mmt-aei+xml":{"source":"iana","compressible":true,"extensions":["maei"]},"application/mmt-usd+xml":{"source":"iana","compressible":true,"extensions":["musd"]},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true},"application/mrb-publish+xml":{"source":"iana","compressible":true},"application/msc-ivr+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msc-mixer+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/multipart-core":{"source":"iana"},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana","extensions":["nq"]},"application/n-triples":{"source":"iana","extensions":["nt"]},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana","charset":"US-ASCII"},"application/news-groupinfo":{"source":"iana","charset":"US-ASCII"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana","extensions":["cjs"]},"application/nss":{"source":"iana"},"application/oauth-authz-req+jwt":{"source":"iana"},"application/oblivious-dns-message":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":false,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odm+xml":{"source":"iana","compressible":true},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{"source":"iana","compressible":true},"application/oscore":{"source":"iana"},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p21":{"source":"iana"},"application/p21+zip":{"source":"iana","compressible":false},"application/p2p-overlay+xml":{"source":"iana","compressible":true,"extensions":["relo"]},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pem-certificate-chain":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana","extensions":["asc"]},"application/pgp-signature":{"source":"iana","extensions":["asc","sig"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pidf-diff+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true,"extensions":["provx"]},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.cyn":{"source":"iana","charset":"7-BIT"},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/pvd+json":{"source":"iana","compressible":true},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"iana"},"application/reputon+json":{"source":"iana","compressible":true},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true,"extensions":["rapd"]},"application/route-s-tsid+xml":{"source":"iana","compressible":true,"extensions":["sls"]},"application/route-usd+xml":{"source":"iana","compressible":true,"extensions":["rusd"]},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sarif+json":{"source":"iana","compressible":true},"application/sarif-external-properties+json":{"source":"iana","compressible":true},"application/sbe":{"source":"iana"},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true,"extensions":["senmlx"]},"application/senml-etch+cbor":{"source":"iana"},"application/senml-etch+json":{"source":"iana","compressible":true},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true,"extensions":["sensmlx"]},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana","extensions":["siv","sieve"]},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/sipc":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"iana"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spdx+json":{"source":"iana","compressible":true},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana"},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/stix+json":{"source":"iana","compressible":true},"application/swid+xml":{"source":"iana","compressible":true,"extensions":["swidtag"]},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/td+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/tetra_isi":{"source":"iana"},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/token-introspection+jwt":{"source":"iana"},"application/toml":{"compressible":true,"extensions":["toml"]},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana","extensions":["trig"]},"application/ttml+xml":{"source":"iana","compressible":true,"extensions":["ttml"]},"application/tve-trigger":{"source":"iana"},"application/tzif":{"source":"iana"},"application/tzif-leap":{"source":"iana"},"application/ubjson":{"compressible":false,"extensions":["ubj"]},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true,"extensions":["rsheet"]},"application/urc-targetdesc+xml":{"source":"iana","compressible":true,"extensions":["td"]},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true,"extensions":["1km"]},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.5gnas":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gtpc":{"source":"iana"},"application/vnd.3gpp.interworking-data":{"source":"iana"},"application/vnd.3gpp.lpp":{"source":"iana"},"application/vnd.3gpp.mc-signalling-ear":{"source":"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-init-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-transmission-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ngap":{"source":"iana"},"application/vnd.3gpp.pfcp":{"source":"iana"},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.s1ap":{"source":"iana"},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"iana","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.afplinedata-pagedef":{"source":"iana"},"application/vnd.afpc.cmoca-cmresource":{"source":"iana"},"application/vnd.afpc.foca-charset":{"source":"iana"},"application/vnd.afpc.foca-codedfont":{"source":"iana"},"application/vnd.afpc.foca-codepage":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.afpc.modca-cmtable":{"source":"iana"},"application/vnd.afpc.modca-formdef":{"source":"iana"},"application/vnd.afpc.modca-mediummap":{"source":"iana"},"application/vnd.afpc.modca-objectcontainer":{"source":"iana"},"application/vnd.afpc.modca-overlay":{"source":"iana"},"application/vnd.afpc.modca-pagesegment":{"source":"iana"},"application/vnd.age":{"source":"iana","extensions":["age"]},"application/vnd.ah-barcode":{"source":"iana"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.ota":{"source":"iana"},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.arrow.file":{"source":"iana"},"application/vnd.apache.arrow.stream":{"source":"iana"},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.aplextor.warrp+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.keynote":{"source":"iana","extensions":["key"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.numbers":{"source":"iana","extensions":["numbers"]},"application/vnd.apple.pages":{"source":"iana","extensions":["pages"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"iana"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true,"extensions":["bmml"]},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.error":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.bpf":{"source":"iana"},"application/vnd.bpf3":{"source":"iana"},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.ciedi":{"source":"iana"},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.cryptii.pipe+json":{"source":"iana","compressible":true},"application/vnd.crypto-shade-file":{"source":"iana"},"application/vnd.cryptomator.encrypted":{"source":"iana"},"application/vnd.cryptomator.vault":{"source":"iana"},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.cyclonedx+json":{"source":"iana","compressible":true},"application/vnd.cyclonedx+xml":{"source":"iana","compressible":true},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.d3m-dataset":{"source":"iana"},"application/vnd.d3m-problem":{"source":"iana"},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.dbf":{"source":"iana","extensions":["dbf"]},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume.movie":{"source":"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbisl+xml":{"source":"iana","compressible":true},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.eclipse.ditto+json":{"source":"iana","compressible":true},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eu.kasparian.car+json":{"source":"iana","compressible":true},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.exstream-empower+zip":{"source":"iana","compressible":false},"application/vnd.exstream-package":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.familysearch.gedcom+zip":{"source":"iana","compressible":false},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"iana","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.ffsns":{"source":"iana"},"application/vnd.ficlab.flb+zip":{"source":"iana","compressible":false},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{"source":"iana","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"iana","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujifilm.fb.docuworks":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.container":{"source":"iana"},"application/vnd.fujifilm.fb.jfi+xml":{"source":"iana","compressible":true},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.futoin+cbor":{"source":"iana"},"application/vnd.futoin+json":{"source":"iana","compressible":true},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.gentics.grd+json":{"source":"iana","compressible":true},"application/vnd.geo+json":{"source":"iana","compressible":true},"application/vnd.geocube+xml":{"source":"iana","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.slides":{"source":"iana"},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"iana","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hl7cda+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.hl7v2+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"iana"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"iana","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"iana"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.iso11783-10+zip":{"source":"iana","compressible":false},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las":{"source":"iana"},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.laszip":{"source":"iana"},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.logipipe.circuit+zip":{"source":"iana","compressible":false},"application/vnd.loom":{"source":"iana"},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana","extensions":["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxar.archive.3tz+zip":{"source":"iana","compressible":false},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.nacamar.ybrid+json":{"source":"iana","compressible":true},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nebumind.line":{"source":"iana"},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true,"extensions":["ac"]},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"iana","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"iana","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oci.image.manifest.v1+json":{"source":"iana","compressible":true},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+cbor":{"source":"iana"},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true,"extensions":["obgx"]},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true,"extensions":["osm"]},"application/vnd.opentimestamps.ots":{"source":"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos.xml":{"source":"iana"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.patientecommsdoc":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana","extensions":["rar"]},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.resilient.logic":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sar":{"source":"iana"},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.seis+json":{"source":"iana","compressible":true},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shade-save-file":{"source":"iana"},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.shopkick+json":{"source":"iana","compressible":true},"application/vnd.shp":{"source":"iana"},"application/vnd.shx":{"source":"iana"},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.snesdev-page-table":{"source":"iana"},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true,"extensions":["fo"]},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.sycle+xml":{"source":"iana","compressible":true},"application/vnd.syft+json":{"source":"iana","compressible":true},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","charset":"UTF-8","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.veritone.aion+json":{"source":"iana","compressible":true},"application/vnd.veryant.thin":{"source":"iana"},"application/vnd.ves.encrypted":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","charset":"UTF-8","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.dpp":{"source":"iana"},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.youtube.yt":{"source":"iana"},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"source":"iana","compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true,"extensions":["wif"]},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-iwork-keynote-sffkey":{"extensions":["key"]},"application/x-iwork-numbers-sffnumbers":{"extensions":["numbers"]},"application/x-iwork-pages-sffpages":{"extensions":["pages"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-keepass2":{"extensions":["kdbx"]},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-pki-message":{"source":"iana"},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"iana","extensions":["der","crt","pem"]},"application/x-x509-ca-ra-cert":{"source":"iana"},"application/x-x509-next-ca-cert":{"source":"iana"},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true,"extensions":["xav"]},"application/xcap-caps+xml":{"source":"iana","compressible":true,"extensions":["xca"]},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true,"extensions":["xel"]},"application/xcap-error+xml":{"source":"iana","compressible":true},"application/xcap-ns+xml":{"source":"iana","compressible":true,"extensions":["xns"]},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true,"extensions":["xlf"]},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xsl","xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zlib":{"source":"iana"},"application/zstd":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana"},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana","extensions":["amr"]},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/flexfec":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/mhas":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/mobile-xmf":{"source":"iana","extensions":["mxmf"]},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx","opus"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/scip":{"source":"iana"},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sofa":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tetra_acelp":{"source":"iana"},"audio/tetra_acelp_bb":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/tsvcis":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dts.uhd":{"source":"iana"},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"iana"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","compressible":true,"extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana","extensions":["exr"]},"image/apng":{"compressible":false,"extensions":["apng"]},"image/avci":{"source":"iana","extensions":["avci"]},"image/avcs":{"source":"iana","extensions":["avcs"]},"image/avif":{"source":"iana","compressible":false,"extensions":["avif"]},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana","extensions":["drle"]},"image/emf":{"source":"iana","extensions":["emf"]},"image/fits":{"source":"iana","extensions":["fits"]},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/heic":{"source":"iana","extensions":["heic"]},"image/heic-sequence":{"source":"iana","extensions":["heics"]},"image/heif":{"source":"iana","extensions":["heif"]},"image/heif-sequence":{"source":"iana","extensions":["heifs"]},"image/hej2k":{"source":"iana","extensions":["hej2"]},"image/hsj2":{"source":"iana","extensions":["hsj2"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/jls":{"source":"iana","extensions":["jls"]},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpeg","jpg","jpe"]},"image/jph":{"source":"iana","extensions":["jph"]},"image/jphc":{"source":"iana","extensions":["jhc"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/jxr":{"source":"iana","extensions":["jxr"]},"image/jxra":{"source":"iana","extensions":["jxra"]},"image/jxrs":{"source":"iana","extensions":["jxrs"]},"image/jxs":{"source":"iana","extensions":["jxs"]},"image/jxsc":{"source":"iana","extensions":["jxsc"]},"image/jxsi":{"source":"iana","extensions":["jxsi"]},"image/jxss":{"source":"iana","extensions":["jxss"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/ktx2":{"source":"iana","extensions":["ktx2"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif"]},"image/prs.pti":{"source":"iana","extensions":["pti"]},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana","extensions":["t38"]},"image/tiff":{"source":"iana","compressible":false,"extensions":["tif","tiff"]},"image/tiff-fx":{"source":"iana","extensions":["tfx"]},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana","extensions":["azv"]},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana","compressible":true,"extensions":["ico"]},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-dds":{"compressible":true,"extensions":["dds"]},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.pco.b16":{"source":"iana","extensions":["b16"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana","extensions":["tap"]},"image/vnd.valve.source.texture":{"source":"iana","extensions":["vtf"]},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana","extensions":["pcx"]},"image/webp":{"source":"apache","extensions":["webp"]},"image/wmf":{"source":"iana","extensions":["wmf"]},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/news":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime"]},"message/s-http":{"source":"iana"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"iana"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana","extensions":["3mf"]},"model/e57":{"source":"iana"},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/mtl":{"source":"iana","extensions":["mtl"]},"model/obj":{"source":"iana","extensions":["obj"]},"model/step":{"source":"iana"},"model/step+xml":{"source":"iana","compressible":true,"extensions":["stpx"]},"model/step+zip":{"source":"iana","compressible":false,"extensions":["stpz"]},"model/step-xml+zip":{"source":"iana","compressible":false,"extensions":["stpxz"]},"model/stl":{"source":"iana","extensions":["stl"]},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana","extensions":["ogex"]},"model/vnd.parasolid.transmit.binary":{"source":"iana","extensions":["x_b"]},"model/vnd.parasolid.transmit.text":{"source":"iana","extensions":["x_t"]},"model/vnd.pytha.pyox":{"source":"iana"},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.sap.vds":{"source":"iana","extensions":["vds"]},"model/vnd.usdz+zip":{"source":"iana","compressible":false,"extensions":["usdz"]},"model/vnd.valve.source.compiled-map":{"source":"iana","extensions":["bsp"]},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana","extensions":["x3db"]},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana","extensions":["x3dv"]},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana"},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/cql":{"source":"iana"},"text/cql-expression":{"source":"iana"},"text/cql-identifier":{"source":"iana"},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"iana"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/fhirpath":{"source":"iana"},"text/flexfec":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/gff3":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","compressible":true},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"compressible":true,"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["markdown","md"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mdx":{"compressible":true,"extensions":["mdx"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana","charset":"UTF-8"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana","charset":"UTF-8"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shaclc":{"source":"iana"},"text/shex":{"source":"iana","extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/spdx":{"source":"iana","extensions":["spdx"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana","charset":"UTF-8"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana","charset":"UTF-8"},"text/vnd.familysearch.gedcom":{"source":"iana","extensions":["ged"]},"text/vnd.ficlab.flt":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hans":{"source":"iana"},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.senx.warpscript":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"iana"},"text/vnd.sosi":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","charset":"UTF-8","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana","charset":"UTF-8"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vtt":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"compressible":true,"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/av1":{"source":"iana"},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/ffv1":{"source":"iana"},"video/flexfec":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/iso.segment":{"source":"iana","extensions":["m4s"]},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/jxsv":{"source":"iana"},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/scip":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vc2":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"iana"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vnd.youtube.yt":{"source":"iana"},"video/vp8":{"source":"iana"},"video/vp9":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}}')}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,o),i.loaded=!0,i.exports}t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);o.r(i);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&n;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((e=>a[e]=()=>n[e]));return a.default=()=>n,o.d(i,a),i},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var i=o(4144);module.exports=i})();
|
|
3
3
|
//# sourceMappingURL=index.node.cjs.js.map
|