@cloudbase/js-sdk 3.9.3 → 3.9.5-alpha.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/app/dist/index.esm.js +1 -1
- package/app/dist/index.esm.js.map +1 -1
- package/app/dist/index.js +1 -1
- package/app/dist/index.js.map +1 -1
- package/app/dist/index.node.esm.js +1 -1
- package/app/dist/index.node.esm.js.map +1 -1
- package/app/dist/index.node.js +1 -1
- package/app/dist/index.node.js.map +1 -1
- package/auth/dist/index.esm.js +1 -1
- package/auth/dist/index.esm.js.map +1 -1
- package/auth/dist/index.js +1 -1
- package/auth/dist/index.js.map +1 -1
- package/core.d.ts +29 -4
- 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/auth/index.js +1 -1
- package/miniprogram_dist/index.js +1 -1
- package/miniprogram_dist/storage/index.js +1 -1
- package/package.json +2 -2
- package/storage/dist/index.esm.js +1 -1
- package/storage/dist/index.esm.js.map +1 -1
- package/storage/dist/index.js +1 -1
- package/storage/dist/index.js.map +1 -1
- package/storage/dist/storage-file-api-classic.d.ts +2 -2
- package/types/index.d.ts +8 -1
- package/types/package.json +1 -1
- package/types/storage.d.ts +4 -0
- package/utilities/package.json +1 -1
package/dist/index.node.esm.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see index.node.esm.js.LICENSE.txt */
|
|
2
|
-
import*as __WEBPACK_EXTERNAL_MODULE_jwt_decode_b659f100__ from"jwt-decode";import*as __WEBPACK_EXTERNAL_MODULE__cloudbase_adapter_interface_74717cc6__ from"@cloudbase/adapter-interface";import*as __WEBPACK_EXTERNAL_MODULE_node_crypto_803ecaf5__ from"node:crypto";import*as __WEBPACK_EXTERNAL_MODULE_node_fs_75ed2103__ from"node:fs";import*as __WEBPACK_EXTERNAL_MODULE_node_http_b674be28__ from"node:http";import*as __WEBPACK_EXTERNAL_MODULE_node_https_b78f5be9__ from"node:https";import*as __WEBPACK_EXTERNAL_MODULE_node_path_02319fef__ from"node:path";import*as __WEBPACK_EXTERNAL_MODULE_node_stream_62980834__ from"node:stream";import*as __WEBPACK_EXTERNAL_MODULE_node_url_da953c0c__ from"node:url";import*as __WEBPACK_EXTERNAL_MODULE_node_util_1f093676__ from"node:util";import*as __WEBPACK_EXTERNAL_MODULE_web_streams_polyfill_c4c9f3ad__ from"web-streams-polyfill";import*as __WEBPACK_EXTERNAL_MODULE__cloudbase_adapter_wx_mp_8d967865__ from"@cloudbase/adapter-wx_mp";import*as __WEBPACK_EXTERNAL_MODULE__cloudbase_wx_cloud_client_sdk_7708af81__ from"@cloudbase/wx-cloud-client-sdk";import*as __WEBPACK_EXTERNAL_MODULE__mattiasbuelens_web_streams_adapter_7d231298__ from"@mattiasbuelens/web-streams-adapter";import*as __WEBPACK_EXTERNAL_MODULE_text_encoding_shim_6f8fb6d2__ from"text-encoding-shim";import*as __WEBPACK_EXTERNAL_MODULE_bson__ from"bson";var __webpack_modules__={635:e=>{const t=async function(){}.constructor;e.exports=()=>t},7350:e=>{const t=async function*(){}.constructor;e.exports=()=>t},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)}},7922:(e,t,n)=>{n.d(t,{$R:()=>x,Bh:()=>y,Fy:()=>b,M4:()=>E,R1:()=>_,eX:()=>d,mI:()=>l,n0:()=>h,po:()=>u,tC:()=>p,vS:()=>w});var r=n(2976),o=function(){return o=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},o.apply(this,arguments)},i=r._G.tC,a=r._G.pM,s="",c="@cloudbase/js-sdk";function u(e){s=e}function l(){return s}function p(e){c=e,i(e)}function d(){return c}var f,h="2020-01-10",m=[],v=["env","endPointKey","region"],y="https:";function g(e){return m.find(function(t){return v.filter(function(t){return null!=e[t]}).every(function(n){return t[n]===e[n]})})}function b(e){var t,n;e.protocol&&!/:$/.test(e.protocol)&&(e.protocol="".concat(e.protocol,":"));var r=g(e);r?(null!=e.baseUrl&&(r.baseUrl=e.baseUrl),null!=e.protocol&&(r.protocol=e.protocol)):m.push(o(o({},e),{protocol:null!==(t=e.protocol)&&void 0!==t?t:y})),"CLOUD_API"===e.endPointKey&&a(null!==(n=e.protocol)&&void 0!==n?n:y)}function w(e,t,n){return g({env:e,endPointKey:t,region:n})}function x(e,t,n){var r="//".concat(e,".api.tcloudbasegateway.com/v1");n&&(r="//".concat(e,".api.intl.tcloudbasegateway.com/v1")),b({endPointKey:"GATEWAY",env:e,baseUrl:r,protocol:t})}function _(e,t,n){b({env:e,region:t,baseUrl:"//".concat(e,".").concat(t||"ap-shanghai",".tcb-api.tencentcloudapi.com/web"),protocol:n,endPointKey:"CLOUD_API"})}function E(e,t){void 0===t&&(t="CLOUD_API");var n=w(e,t||"CLOUD_API"),r=n.protocol,o=n.baseUrl;return"".concat(r).concat(o).match(/(http(s)?:)?\/\/([^/?#]*)/)[0]}!function(e){e.NULL="NULL",e.ANONYMOUS="ANONYMOUS",e.WECHAT="WECHAT",e.WECHAT_PUBLIC="WECHAT-PUBLIC",e.WECHAT_OPEN="WECHAT-OPEN",e.CUSTOM="CUSTOM",e.EMAIL="EMAIL",e.USERNAME="USERNAME",e.PHONE="PHONE"}(f||(f={}))},2332:(e,t,n)=>{n.r(t),n.d(t,{E:()=>q,NodeRequest:()=>de,SYMBOL_CURRENT_ENV:()=>K,SYMBOL_DEFAULT_ENV:()=>J,TcbError:()=>D,buildAdminUrl:()=>Se,callCompatibleWxOpenApi:()=>ke,callWxOpenApi:()=>Ce,callWxPayApi:()=>Ue,createWebStreamFromNodeReadableStream:()=>L,default:()=>$e,filterUndefined:()=>F,filterValue:()=>M,getCloudbaseContext:()=>X,getGatewayUrl:()=>ee,getSecretInfo:()=>re,getServerInjectUrl:()=>Z,getTcbContextConfig:()=>Q,getWxCloudToken:()=>Ee,getWxOptions:()=>Re,isPageModuleName:()=>V,isValidEnvFormat:()=>z,parseContext:()=>$,parseQueryString:()=>j,processReturn:()=>G,sendWxFormDataRequest:()=>Te,sendWxRequest:()=>Ae,setThrowOnCode:()=>W,wxCallContainerApi:()=>je});var r,o=n(7149),i=n(2539),a=n(6794),s={INVALID_PARAM:{code:"INVALID_PARAM",message:"invalid param"},SYS_ERR:{code:"SYS_ERR",message:"system error"},REQUEST_TIMEOUT:{code:"REQUEST_TIMEOUT",message:"request timeout"},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参数"}},c="/admin",u="/auth/v1/token/clientCredential",l=/^[a-zA-Z0-9_\-#@~=*(){}[\]:.,<>+]{4,32}$/;!function(e){e.SECRET="SECRET",e.SESSION_SECRET="SESSION_SECRET"}(r||(r={}));var p,d=n(2976),f=n(3408),h=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())})},m=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 v(e,t){return void 0===t&&(t={}),h(this,void 0,Promise,function(){var n,r,o,i;return m(this,function(a){switch(a.label){case 0:n="".concat("http://metadata.tencentyun.com","/").concat(p.latest,"/").concat(e),r=new AbortController,t.timeout&&(o=setTimeout(function(){return r.abort()},t.timeout)),a.label=1;case 1:return a.trys.push([1,,5,6]),[4,fetch(n,{signal:r.signal})];case 2:return 200!==(i=a.sent()).status?[3,4]:[4,i.text()];case 3:return[2,a.sent()];case 4:throw new Error("[ERROR] GET ".concat(n," status: ").concat(i.status));case 5:return o&&clearTimeout(o),[7];case 6:return[2]}})})}!function(e){e.v20170919="2017-09-19",e["v1.0"]="1.0",e.latest="latest"}(p||(p={}));var y={appId:void 0};function g(){return h(this,void 0,Promise,function(){var e;return m(this,function(t){switch(t.label){case 0:if(void 0!==y.appId)return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,v("meta-data/app-id",{timeout:30})];case 2:return e=t.sent(),/^[1-9][0-9]{4,64}$/gim.test(e)?y.appId=e:y.appId="",[3,4];case 3:return t.sent(),[3,4];case 4:return[2,y.appId||""]}})})}var b,w,x=n(3809),_=(b=function(e,t){return b=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])},b(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}b(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),E=function(){return E=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},E.apply(this,arguments)},I=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=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])}}},O=(w=d.P6).isFormData,A=w.toQueryString;function T(e){return"undefined"!=typeof process&&process.env?void 0!==e?process.env[e]:process.env:void 0!==e?void 0:{}}var P=function(){return"SCF"===T("TENCENTCLOUD_RUNENV")||!!T("TCB_CONTEXT_CNFG")},R=new Set(["formal","pre","test"]);function C(){return I(this,void 0,Promise,function(){var e;return S(this,function(t){switch(t.label){case 0:return"true"===T("TENCENTCLOUD")?[2,!0]:[4,g()];case 1:return[2,"string"==typeof(e=t.sent())&&""!==e]}})})}var N=function(e){if("string"!=typeof e)throw E(E({},s.INVALID_PARAM),{message:"uid must be a string"});if(!l.test(e))throw E(E({},s.INVALID_PARAM),{message:'Invalid uid: "'.concat(e,'"')})};function k(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}}function U(e){return Object.entries(e).reduce(function(e,t){var n=t[0],r=t[1];return e[n]=String(r),e},{})}function j(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}function L(e){var t=e[Symbol.asyncIterator]();return new f.ReadableStream({pull:function(e){return I(this,void 0,void 0,function(){var n;return S(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 D=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 _(t,e),t}(Error);function q(e){return new D(e)}function M(e,t){for(var n in e)e[n]===t&&delete e[n]}function F(e){M(e,void 0)}var B=!0;function W(e){B=e,(0,x.e)(e)}function G(e){if(!B)return e;throw q(E({},e))}function V(e){return void 0===e&&(e=""),"string"==typeof e&&e.startsWith("$:")}var H=/^[a-z0-9_-]{1,40}$/;function z(e){return void 0===e&&(e=""),"string"==typeof e&&H.test(e)}var K=Symbol.for("SYMBOL_CURRENT_ENV"),J=Symbol.for("SYMBOL_DEFAULT_ENV"),Y=function(){return Y=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},Y.apply(this,arguments)};function $(e){if("object"!=typeof e)throw Y(Y({},s.INVALID_CONTEXT),{message:"context 必须为对象类型"});var t={},n=e.memory_limit_in_mb,r=e.time_limit_in_ms,o=e.request_id,i=e.function_version,a=e.namespace,c=e.function_name,u=e.environ,l=e.environment;try{if(t.memoryLimitInMb=n,t.timeLimitIns=r,t.requestId=o,t.functionVersion=i,t.namespace=a,t.functionName=c,l)t.environment=JSON.parse(l);else{var p=null==u?void 0:u.split(";"),d={};for(var f in p)if(p[f].includes("=")){var h=p[f].indexOf("="),m=p[f].slice(0,h),v=p[f].slice(h+1);v.indexOf(",")>=0&&(v=v.split(",")),d[m]=v}t.environ=d}}catch(e){throw Y({},s.INVALID_CONTEXT)}return t}var X=function(e){P()&&(T("TENCENTCLOUD_REGION")||console.error("[TCB][ERROR] missing `TENCENTCLOUD_REGION` environment"),T("SCF_NAMESPACE")||console.error("[TCB][ERROR] missing `SCF_NAMESPACE` environment"));var t=T(),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,CLOUDBASE_APIKEY:t.CLOUDBASE_APIKEY},r={};if(e){var o=$(e),i=o.environment,a=o.environ;r=i||a||{}}for(var s=0,c=[r.TCB_CONTEXT_KEYS||t.TCB_CONTEXT_KEYS,r.WX_CONTEXT_KEYS||t.WX_CONTEXT_KEYS];s<c.length;s++){var u=c[s];if(u)try{for(var l=0,p=u.split(",");l<p.length;l++){var d=p[l];n[d]=r[d]||T(d)}}catch(e){}}var f=Y(Y({},n),r);return Object.fromEntries(Object.entries(f).filter(function(e){return void 0!==e[1]}))};function Q(){try{var e=X().TCB_CONTEXT_CNFG;return e?JSON.parse(e):{}}catch(e){return console.error("[TCB][ERROR] parse context error: ",e),{}}}function Z(){return Q().URL||""}function ee(){return Q().GATEWAY_URL||""}var te,ne={},re=function(e){var t,n,o,i,a,s,c;e&&(ne=JSON.parse(JSON.stringify(e)));var u=Y({},e||ne),l=X(),p=l.TCB_ENV,d=l.SCF_NAMESPACE,f=l.TENCENTCLOUD_RUNENV,h=l.TENCENTCLOUD_SECRETID,m=l.TENCENTCLOUD_SECRETKEY,v=l.TENCENTCLOUD_SESSIONTOKEN,y=l.CLOUDBASE_APIKEY,g="";"local"===(g="symbol"!=typeof(null==e?void 0:e.env)&&(null==e?void 0:e.env)?e.env:p||d||"")&&"WX_LOCAL_SCF"===f&&(g="");var b={env:g,secretId:"",secretKey:"",sessionToken:"",accessKey:"",secretType:"",credentials:void 0,context:void 0};if((null==u?void 0:u.context)&&(b.context=u.context),((null==u?void 0:u.credentials)||(null===(t=null==e?void 0:e.auth)||void 0===t?void 0:t.credentials))&&(b.credentials=(null==u?void 0:u.credentials)||(null===(n=null==e?void 0:e.auth)||void 0===n?void 0:n.credentials)),(null==e?void 0:e.accessKey)||(null==u?void 0:u.accessKey))return b.accessKey=(null==e?void 0:e.accessKey)||(null==u?void 0:u.accessKey),b;if((null==u?void 0:u.secretId)&&(null==u?void 0:u.secretKey))return Y(Y({},b),{secretId:u.secretId,secretKey:u.secretKey,sessionToken:u.sessionToken||"",secretType:u.sessionToken?r.SESSION_SECRET:r.SECRET});if((null===(o=null==e?void 0:e.auth)||void 0===o?void 0:o.secretId)&&(null===(i=null==e?void 0:e.auth)||void 0===i?void 0:i.secretKey))return Y(Y({},b),{secretId:e.auth.secretId,secretKey:e.auth.secretKey,sessionToken:e.auth.sessionToken||"",secretType:e.auth.secretType||r.SECRET});if(y)return Y(Y({},b),{accessKey:y});if(h&&m)return Y(Y({},b),{secretId:h,secretKey:m,sessionToken:v||"",secretType:v?r.SESSION_SECRET:r.SECRET});var w=(null==u?void 0:u.context)||(null==e?void 0:e.context);if(null==w?void 0:w.extendedContext){var x=w.extendedContext;return g||(g=x.envId||""),Y(Y({},b),{env:g,secretId:(null===(a=null==x?void 0:x.tmpSecret)||void 0===a?void 0:a.secretId)||"",secretKey:(null===(s=null==x?void 0:x.tmpSecret)||void 0===s?void 0:s.secretKey)||"",sessionToken:(null===(c=null==x?void 0:x.tmpSecret)||void 0===c?void 0:c.token)||""})}return Y({},b)},oe=n(7922),ie=n(881),ae=function(){return ae=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},ae.apply(this,arguments)},se=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())})},ce=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])}}},ue=null;function le(){return se(this,void 0,void 0,function(){var e;return ce(this,function(t){return ue||(e=(0,ie.a)(["@cloudbase","/","signature-nodejs"],"缺少依赖 @cloudbase/signature-nodejs,请执行以下命令安装:\n\n npm install @cloudbase/signature-nodejs\n\n该依赖用于 Node 环境下的请求签名。"),ue=(null==e?void 0:e.sign)||null),[2,ue]})})}function pe(){if(void 0===te){var e=(0,ie.a)(["node","-fetch"]);te=(e&&e.default?e.default:e)||null}return te}var de=function(){function e(e){var t=this;this.getReqOptions=function(e,n){return se(t,void 0,void 0,function(){var t,r,o,i,a,s,l,p,d,f,h,m,v,y,g,b,w,x,_,E,O,A,N,U,j,L,D,q,M,F,B,W,G,V,H,z,K,J,Y,$,Q,Z,ee,te,ne;return ce(this,function(ie){switch(ie.label){case 0:return t=new URL(e),r=t.hostname,o=/^(\d{1,3}\.){3}\d{1,3}$/.test(r),i=(null===(H=re(this.config))||void 0===H?void 0:H.env)||this.config.env||T("SCF_NAMESPACE")||T("TCB_ENV")||"",a=o?"".concat(i,".api.tcloudbasegateway.com"):t.host,s=o?"".concat(t.protocol,"//").concat(a).concat(t.pathname).concat(t.search):e,l=X().TCB_SOURCE,f=(d="".concat((null===(K=null===(z=this.config.context)||void 0===z?void 0:z.extendedContext)||void 0===K?void 0:K.source)||l||"",",")).concat,[4,I(void 0,void 0,Promise,function(){return S(this,function(e){switch(e.label){case 0:return P()?[2,"scf"]:T("CBR_ENV_ID")?[2,"cbr"]:R.has(T("SUMERU_ENV")||"")?[2,"sumeru"]:[4,C()];case 1:return e.sent()?[2,"tencentcloud"]:[2,"unknown"]}})})];case 1:return p=f.apply(d,[ie.sent()]),n.headers=ae(ae({},n.headers),{"User-Agent":"adapter-node/".concat((null===(J=n.headers)||void 0===J?void 0:J["X-SDK-Version"])||"@cloudbase/js-sdk/".concat((0,oe.mI)())),"X-TCB-Source":p,"X-Client-Timestamp":(new Date).valueOf(),"X-TCB-Region":this.config.region||T("TENCENTCLOUD_REGION")||"",Host:a}),!1===n.withCredentials?[2,n]:(h=null!==($=null===(Y=n.headers)||void 0===Y?void 0:Y.Authorization)&&void 0!==$?$:null===(Q=n.headers)||void 0===Q?void 0:Q.authorization,(null===(Z=null==h?void 0:h.replace("Bearer",""))||void 0===Z?void 0:Z.trim())||t.pathname.startsWith("/auth/")&&t.pathname!==u?[2,n]:(m=re(this.config)).accessKey?(n.headers.Authorization="Bearer ".concat(m.accessKey),[2,n]):(v=t.pathname===c,["/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 y=ie.sent(),n.headers.Authorization="Bearer ".concat(y),[2,n];case 3:return g=ae(ae({},this.config),null===(ee=this.config)||void 0===ee?void 0:ee.auth),b=g.secretId,w=g.secretKey,x=g.sessionToken,_=ae(ae({},this.config),null===(te=this.config)||void 0===te?void 0:te.auth).secretType,E=n.method,O=n.body,A=JSON.parse(JSON.stringify(n.headers)),N=this.isNpmFormData(O),(U=N?O.__plainObj?ae({},O.__plainObj):{}:"object"==typeof O?O:k(O)||{}).envName=(null==U?void 0:U.env)||this.config.env||(null===(ne=re(this.config))||void 0===ne?void 0:ne.env)||"",U.access_token?[2,n]:("get"===E.toLowerCase()&&(U=void 0),b&&w&&"SESSION_SECRET"!==_||(j=re(this.config),b=j.secretId,w=j.secretKey,x=j.sessionToken),b&&w?(delete A.Authorization,A["content-type"]?A["content-type"]=A["content-type"].toLowerCase():A["Content-Type"]&&(A["Content-Type"]=A["Content-Type"].toLowerCase()),v&&x&&(U.sessionToken=x),L={secretId:b,secretKey:w,method:E,url:s,params:U,headers:A,withSignedParams:v,timestamp:Math.floor((new Date).getTime()/1e3)-1,isCloudApi:!v},A["content-type"]||A["Content-Type"]?[4,le()]:[2,n]):[2,n]);case 4:return(D=ie.sent())?(q=D(L),M=q.authorization,F=q.timestamp,"string"==typeof x&&""!==x?v?(A.Authorization="".concat(M),A["X-Timestamp"]=F,A["X-Signature-Expires"]=600):A.Authorization="".concat(M,", Timestamp=").concat(F,", Token=").concat(x):(A.Authorization="".concat(M,", Timestamp=").concat(F),v&&(A["X-Timestamp"]=F,A["X-Signature-Expires"]=600)),N?(B=O,W=new Set(Object.keys(B.__plainObj||{})),U.envName&&!W.has("envName")&&B.append("envName",U.envName),U.sessionToken&&!W.has("sessionToken")&&B.append("sessionToken",U.sessionToken),G=B.getBuffer(),V=B.getHeaders(),[2,ae(ae({},n),{headers:ae(ae(ae({},A),V),{"content-length":String(G.length)}),body:G})]):[2,ae(ae({},n),{headers:A,body:"object"==typeof U?JSON.stringify(U):U})]):[2,n]}})})},this.get=function(e){return t.request(ae(ae({},e),{method:"get"}),t.restrictedMethods.includes("get"))},this.post=function(e){return t.request(ae(ae({},e),{method:"post"}),t.restrictedMethods.includes("post"))},this.put=function(e){return t.request(ae(ae({},e),{method:"put"}))},this.upload=function(e){var n,r=e,o=r.data,i=r.file,a=r.fileContent,s=r.name,c=r.method,u=r.headers,l=void 0===u?{}:u,p=null!=i?i:a;if(void 0===p||void 0===s)throw new Error("file and name is required");var d=U(null!=o?o:{}),f=null==c?void 0:c.toLowerCase(),h=null!==(n=["post","put"].find(function(e){return e===f}))&&void 0!==n?n:"put",m=new FormData;return"post"===h?(Object.keys(d).forEach(function(e){m.append(e,d[e])}),m.append("key",s),m.append("file",p instanceof Blob?p:new Blob([p])),t.request(ae(ae({},e),{data:m,method:h}),t.restrictedMethods.includes("upload"))):t.request(ae(ae({},e),{method:"put",headers:l,body:p}),t.restrictedMethods.includes("upload"))},this.download=function(e){return se(t,void 0,Promise,function(){var t,n,r,o,s;return ce(this,function(c){switch(c.label){case 0:return[4,this.getFetchFn()(e.url,{headers:{},signal:this.timeout?AbortSignal.timeout(this.timeout):void 0})];case 1:if(!(t=c.sent()).ok)throw new Error("Download failed with status ".concat(t.status));return[4,t.arrayBuffer()];case 2:return n=c.sent(),r=Buffer.from(n),(o=e.tempFilePath)?(s=a.dirname(o),i.existsSync(s)||i.mkdirSync(s,{recursive:!0}),i.writeFileSync(o,r),[2,{statusCode:200,tempFilePath:o}]):[2,{statusCode:200,tempFilePath:e.url,fileContent:r}]}})})},this.fetch=function(e){return se(t,void 0,Promise,function(){var t,n,r,o,i,a,s,c,u,l,p,d,f,h,m,v;return ce(this,function(y){switch(y.label){case 0:return t=e.enableAbort,n=void 0!==t&&t,r=e.stream,o=void 0!==r&&r,i=e.signal,a=e.customReqOpts,s=this.getRealUrl(e.url,e.headers||{},e.body),c=(null==a?void 0:a.timeout)||this.timeout,u=this.createAbortController(c,n,i),l=u[0],p=u[1],d=e.headers?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}(e.headers):void 0,[4,this.getReqOptions(s,ae(ae({},e),{headers:d,body:e.body,signal:l.signal}))];case 1:f=y.sent(),this.applyDuplexIfNeeded(f),y.label=2;case 2:return y.trys.push([2,,8,9]),[4,this.getFetchFn()(s,f)];case 3:return h=y.sent(),m=void 0,204!==+h.status?[3,4]:(m="",[3,7]);case 4:return o?(m=h.body,[3,7]):[3,5];case 5:return v=k,[4,h.text()];case 6:m=v.apply(void 0,[y.sent()]),y.label=7;case 7:return[2,{data:m,statusCode:h.status,header:h.headers,response:h}];case 8:return p(),[7];case 9:return[2]}})})},this.request=function(e,n){return void 0===n&&(n=!1),se(t,void 0,Promise,function(){var t,r,i,a,s,c,u,l,p,d,f,h,m,v,y,g,b,w,x,_,E,I,S,T,P,R,C,N,j,L,D,q,M;return ce(this,function(F){switch(F.label){case 0:return t=e.url,r=e.headers,i=void 0===r?{}:r,a=e.data,s=e.responseType,c=e.withCredentials,u=e.body,l=e.method,p=e.customReqOpts,d=U(i),f=String(l).toLowerCase()||"get",h=(null==p?void 0:p.timeout)||this.timeout,m=e.signal,v=this.createAbortController(h,n,m),y=v[0],g=v[1],b=O(a)?a:"application/x-www-form-urlencoded"===d["content-type"]?A(null!=a?a:{}):u||(a?JSON.stringify(a):void 0),w=this.getRealUrl((0,o.formatUrl)("https",null!=t?t:"","get"===f?a:{}),e.headers||{},b),[4,this.getReqOptions(w,{method:f,headers:d,body:b,credentials:c?"include":"same-origin",signal:y.signal})];case 1:x=F.sent(),this.applyDuplexIfNeeded(x),F.label=2;case 2:return F.trys.push([2,,19,20]),[4,this.getFetchFn()(w,x)];case 3:_=F.sent(),E={header:{},statusCode:_.status},F.label=4;case 4:return F.trys.push([4,11,,18]),"blob"!==s?[3,6]:(I=E,[4,_.blob()]);case 5:return I.data=F.sent(),[3,10];case 6:return"buffer"!==s?[3,8]:(S=E,P=(T=Buffer).from,[4,_.arrayBuffer()]);case 7:return S.data=P.apply(T,[F.sent()]),[3,10];case 8:return R=E,C=k,[4,_.text()];case 9:R.data=C.apply(void 0,[F.sent()]),F.label=10;case 10:return[3,18];case 11:return N=F.sent(),console.log("catch an error",N),"blob"!==s?[3,13]:(j=E,[4,_.blob()]);case 12:return j.data=F.sent(),[3,17];case 13:return"buffer"!==s?[3,15]:(L=E,q=(D=Buffer).from,[4,_.arrayBuffer()]);case 14:return L.data=q.apply(D,[F.sent()]),[3,17];case 15:return M=E,[4,_.text()];case 16:M.data=F.sent(),F.label=17;case 17:return[3,18];case 18:return _.headers.forEach(function(e,t){return E.header[t.toLowerCase()]=e}),[2,E];case 19:return g(),[7];case 20:return[2]}})})};var n=e.timeout,r=e.restrictedMethods;this.timeout=n,this.restrictedMethods=r||["get","post","upload","download"],this.config=e}return e.prototype.getClientCredential=function(e){var t;return se(this,void 0,Promise,function(){var n;return ce(this,function(r){switch(r.label){case 0:return[4,this.fetch({url:"".concat(e.origin).concat(u),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;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:k(n)||"").access_token)return e;var i=new URL(e),a=re(this.config);return"/web"===i.pathname&&a.secretId&&a.secretKey&&(i.pathname=c),i.toString()},e.prototype.getFetchFn=function(){return(Z()||ee())&&pe()?pe():function(e,t){return fetch(e,t)}},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})),e&&(r=setTimeout(function(){var t="请求在".concat(e/1e3,"s内未完成,已中断");console.warn(t),o.abort(q({code:s.REQUEST_TIMEOUT.code,message: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}(),fe=function(){return fe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},fe.apply(this,arguments)},he=function(){function e(){var e=X()._SCF_TCB_LOG;this.isSupportClsReport=!0,"1"!=="".concat(e)?this.isSupportClsReport=!1:console.__baseLog__||(this.isSupportClsReport=!1),this.isSupportClsReport}return e.prototype.transformMsg=function(e){var t={};return e&&"object"==typeof e&&!Array.isArray(e)?fe(fe({},t),e):{msg:e}},e.prototype.baseLog=function(e,t){"Object"!==Object.prototype.toString.call(e).slice(8,-1)&&(e={msg:e});var n=this.transformMsg(e);if(this.isSupportClsReport)console.__baseLog__(n,t);else{var r=console[t];"function"==typeof r?r(n):console.log(n)}},e.prototype.log=function(e){this.baseLog(e,"log")},e.prototype.info=function(e){this.baseLog(e,"info")},e.prototype.error=function(e){this.baseLog(e,"error")},e.prototype.warn=function(e){this.baseLog(e,"warn")},e}(),me=null;function ve(){return me||(me=new he),me}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)},ge=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())})},be=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])}}},we="/.tencentcloudbase/wx/cloudbase_access_token",xe=6e5,_e={token:"",timestamp:0};function Ee(){var e=X(),t=e.TRIGGER_SRC,n=e.WX_TRIGGER_API_TOKEN_V0,r=e.WX_API_TOKEN,o=e.WX_CLOUDBASE_ACCESSTOKEN,a=void 0===o?"":o,s={};return s.wxCloudApiToken="timer"===t?n||r||"":r||"",s.wxCloudApiToken||(s.wxCloudbaseAccesstoken=a||function(){if(_e.token&&Date.now()-_e.timestamp<xe)return _e.token;try{if(("WX_LOCAL_SCF"===process.env.TENCENTCLOUD_RUNENV||"SCF"===process.env.TENCENTCLOUD_RUNENV)&&i.existsSync(we))return _e.token=i.readFileSync(we).toString(),_e.timestamp=Date.now(),_e.token}catch(e){console.warn("[TCB][ERROR]: loadWxCloudbaseAccesstoken error: ",e)}return""}()),s}var Ie=0;function Se(e,t,n){var r="symbol"==typeof e.env?process.env.TCB_ENV||process.env.SCF_NAMESPACE||"":e.env||"",o=e.region||process.env.TENCENTCLOUD_REGION||"",i=function(){Ie+=1;var e="".concat(Date.now().toString(16),"_").concat(Ie.toString(16)),t=X().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,l=t?"env=".concat(r,"&seqId=").concat(i,"&scfRequestId=").concat(t.requestId):"env=".concat(r,"&seqId=").concat(i);return u.includes("?")?"".concat(u).concat(l):"".concat(u,"?").concat(l)}function Oe(e){var t=X(),n=Ee(),r=n.wxCloudApiToken,o=n.wxCloudbaseAccesstoken;e.wxCloudApiToken=r,o&&(e.wxCloudbaseAccesstoken=o),e.tcb_sessionToken=t.TCB_SESSIONTOKEN||""}function Ae(e,t,n,r){return ge(this,void 0,void 0,function(){return be(this,function(o){return Oe(n),[2,e.requestInstance.send(t,n,{pathname:"web",endPointMode:"GATEWAY"},r?{timeout:r.timeout}:void 0)]})})}function Te(e,t,r,o){return ge(this,void 0,Promise,function(){var i,a,s,c,u,l,p,d;return be(this,function(f){switch(f.label){case 0:Oe(r);try{i=n(1191)}catch(e){throw new Error("缺少依赖 form-data,请执行 npm install form-data")}for((a=new i).append("action",t),s=0,c=Object.keys(r);s<c.length;s++)u=c[s],void 0!==r[u]&&a.append(u,r[u]);return l=ye({action:t},r),a.__plainObj=l,p=Se(e.config,e.scfContext,e.serviceUrl),[4,e.requestInstance.post({url:p,body:a,headers:a.getHeaders(),responseType:"buffer"},o?{timeout:o.timeout}:void 0)];case 1:return(d=f.sent()).data?[2,d.data]:[2,d]}})})}function Pe(e,t){if(void 0===t&&(t={}),t.getCrossAccountInfo||e.getCrossAccountInfo)throw q(ye(ye({},s.INVALID_PARAM),{message:"invalid config: getCrossAccountInfo"}))}function Re(e,t,n,r){return{requestInstance:r,config:e,scfContext:t,serviceUrl:n}}function Ce(e,t,n){var r=t.apiName,o=t.apiOptions,i=t.cgiName,a=t.requestData;return ge(this,void 0,void 0,function(){var t,c,u;return be(this,function(l){switch(l.label){case 0:try{t=a?JSON.stringify(a):""}catch(e){throw q(ye(ye({},e),{code:s.INVALID_PARAM.code,message:"对象出现了循环引用"}))}return Pe(e.config,n),[4,Ae(e,"wx.api",{apiName:r,apiOptions:o,cgiName:i,requestData:t},n)];case 1:if((c=l.sent()).code)return[2,c];try{u=JSON.parse(c.responseData)}catch(e){u=c.responseData}return[2,{result:u,requestId:c.requestId}]}})})}function Ne(e,t,n,r){var o=n.apiName,i=n.apiOptions,a=n.cgiName,s=n.requestData;return ge(this,void 0,void 0,function(){return be(this,function(n){return Pe(t.config,r),[2,Te(t,e,{apiName:o,apiOptions:i,cgiName:a,requestData:s},r)]})})}var ke=function(e,t,n){return Ne("wx.openApi",e,t,n)},Ue=function(e,t,n){return Ne("wx.wxPayApi",e,t,n)},je=function(e,t,n){return Ne("wx.wxCallContainerApi",e,t,n)},Le=function(){return Le=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},Le.apply(this,arguments)},De=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())})},qe=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])}}},Me=null;function Fe(){var e;return De(this,void 0,void 0,function(){var t;return qe(this,function(n){return Me||(t=(0,ie.a)(["json","webtoken"],"缺少依赖 jsonwebtoken,请执行以下命令安装:\n\n npm install jsonwebtoken\n\n该依赖用于 Node 环境下的自定义登录票据生成。"),Me=(null===(e=null==t?void 0:t.default)||void 0===e?void 0:e.sign)||(null==t?void 0:t.sign)||null),[2,Me]})})}function Be(){var e=X();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 We(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 Ge,Ve=null,He=function(e,t){var n=t;"boolean"!=typeof n.throw&&(n.throw=!0),n.errorFactory=function(e){return new D({code:"INVALID_PARAMS"===e.code?"INVALID_PARAM":e.code,message:e.msg||e.message||"",requestId:e.requestId})},"function"!=typeof e.logger&&(e.logger=ve);var r=n.serviceUrl||ee()||"";if(r){var o=function(e){try{var t=new URL(e);t.pathname="/v1",t.search="",t.hash="";var n=t.protocol.replace(/:$/,"");return{baseUrl:"//".concat(t.host).concat(t.pathname),protocol:n}}catch(e){return null}}(r);o&&(0,oe.Fy)(Le({endPointKey:"GATEWAY",env:t.env},o))}if(e.parseContext=function(e){var t=$(e);return Ve=t,t},e.getCloudbaseContext=function(e){return X(e)},e.auth){var i={getUserInfo:function(){return Be()},getEndUserInfo:function(n){return De(this,void 0,Promise,function(){var r;return qe(this,function(o){return r=Be(),void 0===n?[2,{userInfo:r}]:(N(n),[2,We(e,{uuid:n,envName:t.env}).then(function(e){return e.code?e:{userInfo:Le(Le({},r),e.data),requestId:e.requestId}})])})})},createTicket:function(e,n){return void 0===n&&(n={}),De(this,void 0,Promise,function(){var r,o,i,a,c,u,l,p,d;return qe(this,function(f){switch(f.label){case 0:if(N(e),r=(new Date).getTime(),o=(t.auth||{}).credentials,!(i=t.env))throw Le(Le({},s.INVALID_PARAM),{message:"no env in config"});if(!(null==o?void 0:o.env_id))throw Le(Le({},s.INVALID_PARAM),{message:"当前私钥未包含env_id 信息, 请前往腾讯云云开发控制台,获取自定义登录最新私钥"});if(o.env_id!==i)throw Le(Le({},s.INVALID_PARAM),{message:"当前私钥所属环境与 init 指定环境不一致!"});return a=n.refresh,c=void 0===a?36e5:a,u=n.expire,l=void 0===u?r+6048e5:u,[4,Fe()];case 1:return p=f.sent(),d=p({alg:"RS256",env:i,iat:r,exp:r+6e5,uid:e,refresh:c,expire:l},o.private_key,{allowInsecureKeySizes:!0,algorithm:"RS256"}),[2,"".concat(o.private_key_id,"/@@/").concat(d)]}})})},queryUserInfo:function(n){return De(this,void 0,Promise,function(){var r,o,i;return qe(this,function(a){return r=n.uid,o=n.platform,i=n.platformId,[2,We(e,{uuid:r,platform:o,platformId:i,envName:t.env}).then(function(e){return e.code?e:{userInfo:Le({},e.data),requestId:e.requestId}})]})})},getClientIP:function(){return X().TCB_SOURCE_IP||""},getAuthContext:function(e){var t=X(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(n){return De(this,void 0,void 0,function(){var r,o;return qe(this,function(i){switch(i.label){case 0:return(r=re(t)).accessKey?[2,r.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"}},n?{timeout:n.timeout}:void 0)]);case 1:return[2,i.sent().data]}})})}},a=e.auth;Object.keys(i).forEach(function(e){a[e]=i[e]}),e.auth=new Proxy(a,{apply:function(e,t,n){var r=Reflect.apply(e,t,n);return r&&"object"==typeof r&&Object.keys(i).forEach(function(e){Object.prototype.hasOwnProperty.call(r,e)||(r[e]=i[e])}),r}})}function c(){var t=n.serviceUrl||Z()||void 0;return Re(n,Ve,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 Ce(c(),e,t)},e.callWxPayApi=function(e,t){return Ue(c(),e,t)},e.wxCallContainerApi=function(e,t){return je(c(),e,t)},e.callCompatibleWxOpenApi=function(e,t){return ke(c(),e,t)},e.getFileAuthority=function(t,n){var r=t.fileList;return De(void 0,void 0,void 0,function(){var t,o,i,a,c,u;return qe(this,function(l){switch(l.label){case 0:if(t=X().LOGINTYPE,!Array.isArray(r))throw q(Le(Le({},s.INVALID_PARAM),{message:"[js-sdk] getCosFileAuthority fileList must be a array"}));if(r.some(function(e){return!(null==e?void 0:e.path)||!["READ","WRITE","READWRITE"].includes(e.type)}))throw q(Le(Le({},s.INVALID_PARAM),{message:"[js-sdk] getCosFileAuthority fileList param error"}));return[4,e.auth.getEndUserInfo()];case 1:if(o=l.sent().userInfo,i=o.openId,a=o.uid,!i&&!a)throw q(Le(Le({},s.INVALID_PARAM),{message:"[js-sdk] admin do not need getCosFileAuthority."}));return c={openId:i,uid:a,loginType:t,fileList:r},[4,e.request.send("storage.getFileAuthority",c,{pathname:"web",endPointMode:"GATEWAY"},n?{timeout:n.timeout}:void 0)];case 2:if((u=l.sent()).code)throw q(Le(Le({},u),{message:"[js-sdk] getCosFileAuthority failed: ".concat(u.code)}));return[2,u]}})})},e.callApis=function(t,n){return De(void 0,void 0,void 0,function(){var r,o,i,a,s,c,u,l,p,d,f,h;return qe(this,function(m){if(e.apis)return r=t.name,o=t.path,i=void 0===o?"":o,a=t.method,s=void 0===a?"POST":a,c=t.header,u=void 0===c?{}:c,l=t.body,p=t.token,d=(s||"POST").toLowerCase(),[2,null===(h=null===(f=e.apis[r])||void 0===f?void 0:f[d])||void 0===h?void 0:h.call(f,{path:i,method:s,headers:u,body:l,token:p},n)];throw new Error("callApis is not supported in current configuration")})})}},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)},Ke=null,Je=!1,Ye=(Ge=new Map,{mode:"sync",setItem:function(e,t){Ge.set(e,t)},getItem:function(e){return Ge.get(e)},removeItem:function(e){Ge.delete(e)},clear:function(){Ge.clear()}});const $e={genAdapter:function(e){return{nodeTool:He,getSecretInfo:re,root:{globalThis:{}},reqClass:de,get wsClass(){return Ke||Je||(Je=!0,Ke=(0,ie.a)(["w","s"],"缺少依赖 ws,请执行以下命令安装:\n\n npm install ws\n\n该依赖用于 Node 环境下的 WebSocket 连接。")),Ke},sessionStorage:Ye,localStorage:Ye,primaryStorage:o.StorageType.session,captchaOptions:{openURIWithCallback:function(t){var n=e.EventBus,r={},o=t,i=t.match(/^(data:.*?)(\?[^#\s]*)?$/);if(i){o=i[1];var a=i[2];a&&(r=j(a))}var s=r.token,c=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}(r,["token"]);return/^data:/.test(o)&&!s?Promise.reject({error:"invalid_argument",error_description:"invalie captcha data: ".concat(t)}):s?new Promise(function(e){n.$emit("CAPTCHA_DATA_CHANGE",ze(ze({},c),{token:s,url:o})),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"}},881:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{function isNodeRuntime(){return"undefined"!=typeof process&&!!process.versions&&null!=process.versions.node}function getRuntimeRequire(){try{var req=eval('typeof require !== "undefined" ? require : null');if("function"==typeof req)return req}catch(e){}try{var builtinModuleName=["mod","ule"].join(""),proc="undefined"!=typeof process?process:null,getBuiltin=proc&&"function"==typeof proc.getBuiltinModule?proc.getBuiltinModule.bind(proc):null,mod=getBuiltin?getBuiltin(builtinModuleName):null;if(mod&&"function"==typeof mod.createRequire){var base=void 0;try{var metaUrl=eval('typeof import.meta !== "undefined" ? import.meta.url : ""');base=metaUrl||"".concat(process.cwd(),"/")}catch(e){base="".concat(process.cwd(),"/")}return mod.createRequire(base)}}catch(e){}return null}function optionalRequire(e,t){if(!isNodeRuntime())return null;var n=e.join(""),r=getRuntimeRequire();if(!r)return null;try{return r(n)}catch(e){return t&&console.error(t),null}}__webpack_require__.d(__webpack_exports__,{a:()=>optionalRequire})},3809:(e,t,n)=>{n.d(t,{F:()=>o,e:()=>i});var r=new Set;function o(e){e&&"object"==typeof e&&r.add(e)}function i(e){r.forEach(function(t){t.throw=e})}},3171:(e,t,n)=>{var r;if(n.r(t),n.d(t,{getEncryptInfo:()=>q}),!globalThis.IS_MP_BUILD){var o="undefined"!=typeof globalThis?globalThis.navigator:window.globalThis;function M(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function F(e,t){return e&t}function B(e,t){return e|t}function W(e,t){return e^t}function G(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 H(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function z(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=i.charAt(n>>6)+i.charAt(63&n);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=i.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=i.charAt(n>>2)+i.charAt((3&n)<<4));(3&r.length)>0;)r+="=";return r}function K(e){var t,n="",r=0,o=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t){var a=i.indexOf(e.charAt(t));a<0||(0==r?(n+=M(a>>2),o=3&a,r=1):1==r?(n+=M(o<<2|a>>4),o=15&a,r=2):2==r?(n+=M(o),n+=M(a>>2),o=3&a,r=3):(n+=M(o<<2|a>>4),n+=M(15&a),r=0))}return 1==r&&(n+=M(o<<2)),n}var a,s,c={decode:function(e){var t;if(void 0===a){var n="0123456789ABCDEF";for(a={},t=0;t<16;++t)a[n.charAt(t)]=t;for(n=n.toLowerCase(),t=10;t<16;++t)a[n.charAt(t)]=t;for(t=0;t<8;++t)a[" \f\n\r\t \u2028\u2029".charAt(t)]=-1}var r=[],o=0,i=0;for(t=0;t<e.length;++t){var s=e.charAt(t);if("="==s)break;if(-1!=(s=a[s])){if(void 0===s)throw new Error("Illegal character at offset "+t);o|=s,++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}},u={decode:function(e){var t;if(void 0===s){for(s=Object.create(null),t=0;t<64;++t)s["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(t=0;t<9;++t)s["= \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=s[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=u.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 u.decode(e)}},l=1e13;class J{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)<l?t=0:r-=(t=0|r/l)*l,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+=l,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+=(l+t[r]).toString().substring(1);return n}valueOf(){for(var e=this.buf,t=0,n=e.length-1;n>=0;--n)t=t*l+e[n];return t}simplify(){var e=this.buf;return 1==e.length?e[0]:this}}var p,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)?)?$/,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 ${constructor(e,t){this.hexDigits="0123456789ABCDEF",e instanceof $?(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?d: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 J(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 J,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 J)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 J,i=0}}return i>0&&(r+=".incomplete"),r}}class X{constructor(e,t,n,r,o){if(!(r instanceof Q))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 $?e:new $(e,0);var n=new $(t),r=new Q(t),o=X.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]=X.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=X.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 X(n,a,o,r,s)}}class Q{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 J;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 h=[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],m=(1<<26)/h[h.length-1];class Z{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=ee();return Z.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)+se(this[this.t-1]^this.s&this.DM)}mod(e){var t=ee();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(Z.ZERO)>0&&e.subTo(t,t),t}modPowInt(e,t){var n;return n=e<256||t.isEven()?new y(t):new g(t),this.exp(e,n)}clone(){var e=ee();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=ee();return this.bitwiseTo(e,F,t),t}or(e){var t=ee();return this.bitwiseTo(e,B,t),t}xor(e){var t=ee();return this.bitwiseTo(e,W,t),t}andNot(e){var t=ee();return this.bitwiseTo(e,G,t),t}not(){for(var e=ee(),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=ee();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}shiftRight(e){var t=ee();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+=H(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,G)}flipBit(e){return this.changeBit(e,W)}add(e){var t=ee();return this.addTo(e,t),t}subtract(e){var t=ee();return this.subTo(e,t),t}multiply(e){var t=ee();return this.multiplyTo(e,t),t}divide(e){var t=ee();return this.divRemTo(e,t,null),t}remainder(e){var t=ee();return this.divRemTo(e,null,t),t}divideAndRemainder(e){var t=ee(),n=ee();return this.divRemTo(e,t,n),[t,n]}modPow(e,t){var n,r,o=e.bitLength(),i=ae(1);if(o<=0)return i;n=o<18?1:o<48?3:o<144?4:o<768?5:6,r=o<8?new y(t):t.isEven()?new b(t):new g(t);var a=[],s=3,c=n-1,u=(1<<n)-1;if(a[1]=r.convert(this),n>1){var l=ee();for(r.sqrTo(a[1],l);s<=u;)a[s]=ee(),r.mulTo(l,a[s-2],a[s]),s+=2}var p,d,f=e.t-1,h=!0,m=ee();for(o=se(e[f])-1;f>=0;){for(o>=c?p=e[f]>>o-c&u:(p=(e[f]&(1<<o+1)-1)<<c-o,f>0&&(p|=e[f-1]>>this.DB+o-c)),s=n;!(1&p);)p>>=1,--s;if((o-=s)<0&&(o+=this.DB,--f),h)a[p].copyTo(i),h=!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(;f>=0&&!(e[f]&1<<o);)r.sqrTo(i,m),d=i,i=m,m=d,--o<0&&(o=this.DB-1,--f)}return r.revert(i)}modInverse(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return Z.ZERO;for(var n=e.clone(),r=this.clone(),o=ae(1),i=ae(0),a=ae(0),s=ae(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(Z.ONE)?Z.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 v)}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]<=h[h.length-1]){for(t=0;t<h.length;++t)if(n[0]==h[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<h.length;){for(var r=h[t],o=t+1;o<h.length&&r<m;)r*=h[o++];for(r=n.modInt(r);t<o;)if(r%h[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]:ie(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&&Z.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&&Z.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=ee());var i=ee(),a=this.s,s=e.s,c=this.DB-se(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,f=(1<<this.F1)/p,h=1<<this.F2,m=n.t,v=m-u,y=t??ee();for(i.dlShiftTo(v,y),n.compareTo(y)>=0&&(n[n.t++]=1,n.subTo(y,n)),Z.ONE.dlShiftTo(u,y),y.subTo(i,i);i.t<u;)i[i.t++]=0;for(;--v>=0;){var g=n[--m]==l?this.DM:Math.floor(n[m]*d+(n[m-1]+h)*f);if((n[m]+=i.am(0,g,n,v,0,u))<g)for(i.dlShiftTo(v,y),n.subTo(y,n);n[m]<--g;)n.subTo(y,n)}null!=t&&(n.drShiftTo(u,t),a!=s&&Z.ZERO.subTo(t,t)),n.t=u,n.clamp(),c>0&&n.rShiftTo(c,n),a<0&&Z.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 Z.ONE;var n=ee(),r=ee(),o=t.convert(this),i=se(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=ae(n),o=ee(),i=ee(),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=ie(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&&Z.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(Z.ONE.shiftLeft(e-1),B,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(Z.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=Z.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(Z.ONE),n=t.getLowestSetBit();if(n<=0)return!1;var r=t.shiftRight(n);(e=e+1>>1)>h.length&&(e=h.length);for(var o=ee(),i=0;i<e;++i){o.fromInt(h[Math.floor(Math.random()*h.length)]);var a=o.modPow(r,this);if(0!=a.compareTo(Z.ONE)&&0!=a.compareTo(t)){for(var s=1;s++<n&&0!=a.compareTo(t);)if(0==(a=a.modPowInt(2,this)).compareTo(Z.ONE))return!1;if(0!=a.compareTo(t))return!1}}return!0}square(){var e=ee();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(Z.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(Z.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 v=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}(),y=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}(),g=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=ee();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(Z.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=ee();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}(),b=function(){function e(e){this.m=e,this.r2=ee(),this.q3=ee(),Z.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=ee();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 ee(){return new Z(null)}function te(e,t){return new Z(e,t)}function ne(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 re(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 oe(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)?(Z.prototype.am=re,p=30):"Netscape"!=(null==o?void 0:o.appName)?(Z.prototype.am=ne,p=26):(Z.prototype.am=oe,p=28),Z.prototype.DB=p,Z.prototype.DM=(1<<p)-1,Z.prototype.DV=1<<p,Z.prototype.FV=Math.pow(2,52),Z.prototype.F1=52-p,Z.prototype.F2=2*p-52;var w,x,_=[];for(w="0".charCodeAt(0),x=0;x<=9;++x)_[w++]=x;for(w="a".charCodeAt(0),x=10;x<36;++x)_[w++]=x;for(w="A".charCodeAt(0),x=10;x<36;++x)_[w++]=x;function ie(e,t){return _[e.charCodeAt(t)]??-1}function ae(e){var t=ee();return t.fromInt(e),t}function se(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}Z.ZERO=ae(0),Z.ONE=ae(1);class ce{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 E,I,S=null;if(null==S){S=[],I=0;var O,A,T=void 0;if("undefined"!=typeof window&&null!==(O=window)&&void 0!==O&&O.crypto&&null!==(A=window)&&void 0!==A&&A.crypto.getRandomValues){var P,R=new Uint32Array(256);for(null===(P=window)||void 0===P||P.crypto.getRandomValues(R),T=0;T<R.length;++T)S[I++]=255&R[T]}var C,N,k,U=function(e){var t,n,r;if(this.count=this.count||0,this.count>=256||I>=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;S[I++]=255&i,this.count+=1}catch(e){}};if("undefined"!=typeof window)if(null!==(C=window)&&void 0!==C&&C.addEventListener)null===(k=window)||void 0===k||k.addEventListener("mousemove",U,!1);else if(null!==(N=window)&&void 0!==N&&N.attachEvent){var j;null===(j=window)||void 0===j||j.attachEvent("onmousemove",U)}}function ue(){if(null==E){for(E=new ce;I<256;){var e=Math.floor(65536*Math.random());S[I++]=255&e}for(E.init(S),I=0;I<S.length;++I)S[I]=0;I=0}return E.next()}class le{constructor(){}nextBytes(e){for(var t=0;t<e.length;++t)e[t]=ue()}}function pe(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 le,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 Z(n)}class de{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=te(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")}encrypt(e){var t=pe(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}),z(r)):z(this.encrypt(e))}catch(e){return!1}}decryptLong(e){var t=this,n=this.n.bitLength()+7>>3;e=K(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=te(e,16),this.e=parseInt(t,16),this.d=te(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=te(e,16),this.e=parseInt(t,16),this.d=te(n,16),this.p=te(r,16),this.q=te(o,16),this.dmp1=te(i,16),this.dmq1=te(a,16),this.coeff=te(s,16)):console.error("Invalid RSA private key")}generate(e,t){var n=new le,r=e>>1;this.e=parseInt(t,16);for(var o=new Z(t,16);;){for(;this.p=new Z(e-r,1,n),0!=this.p.subtract(Z.ONE).gcd(o).compareTo(Z.ONE)||!this.p.isProbablePrime(10););for(;this.q=new Z(r,1,n),0!=this.q.subtract(Z.ONE).gcd(o).compareTo(Z.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(Z.ONE),s=this.q.subtract(Z.ONE),c=a.multiply(s);if(0==c.gcd(o).compareTo(Z.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=te(e,16),n=this.doPrivate(t);return null==n?null:fe(n,this.n.bitLength()+7>>3)}generateAsync(e,t,n){var r=new le,o=e>>1;this.e=parseInt(t,16);var i=new Z(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(Z.ONE),r=a.q.subtract(Z.ONE),o=t.multiply(r);0==o.gcd(i).compareTo(Z.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=ee(),a.q.fromNumberAsync(o,1,r,function(){a.q.subtract(Z.ONE).gcda(i,function(e){0==e.compareTo(Z.ONE)&&a.q.isProbablePrime(10)?setTimeout(t,0):setTimeout(c,0)})})},u=()=>{a.p=ee(),a.p.fromNumberAsync(e-o,1,r,function(){a.p.subtract(Z.ONE).gcda(i,function(e){0==e.compareTo(Z.ONE)&&a.p.isProbablePrime(10)?setTimeout(c,0):setTimeout(u,0)})})};setTimeout(u,0)};setTimeout(s,0)}}function fe(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 de{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)?c.decode(e):u.unarmor(e),o=X.decode(r);if(3===o.sub.length&&(o=o.sub[2].sub[0]),9===o.sub.length){t=o.sub[1].getHexStringValue(),this.n=te(t,16),n=o.sub[2].getHexStringValue(),this.e=parseInt(n,16);var i=o.sub[3].getHexStringValue();this.d=te(i,16);var a=o.sub[4].getHexStringValue();this.p=te(a,16);var s=o.sub[5].getHexStringValue();this.q=te(s,16);var l=o.sub[6].getHexStringValue();this.dmp1=te(l,16);var p=o.sub[7].getHexStringValue();this.dmq1=te(p,16);var d=o.sub[8].getHexStringValue();this.coeff=te(d,16)}else{if(2!==o.sub.length)return!1;var f=o.sub[1].sub[0];t=f.sub[0].getHexStringValue(),this.n=te(t,16),n=f.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(K(e))}catch(e){return!1}},r.prototype.encrypt=function(e){try{return z(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;var D=n(2631),q=function(e){var t=void 0===e?{}:e,n=t.publicKey,r=void 0===n?"":n,o=t.payload,i=void 0===o?{}:o;if(!r)return"";try{var a=(0,D.I)(i),s=new L;return s.setPublicKey(r),s.encryptLong("object"==typeof a?JSON.stringify(a):a)}catch(e){console.error("encrypt error:",e)}return""}},2631:(e,t,n)=>{n.d(t,{I:()=>r,y:()=>o});var r=function(e){var t=function(t){for(var n in e)e.hasOwnProperty(n)&&(t[n]=r(e[n]));return t},n=null==e?"NullOrUndefined":Object.prototype.toString.call(e).slice(8,-1);if(["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"].includes(n))return e.slice();switch(n){case"Object":return t(Object.create(Object.getPrototypeOf(e)));case"Array":return t([]);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}},o=function(e){var t=e.match(/^(?:http(s)?:\/\/[^\/]+)?(\/[^\?#]*)/);return t&&t[2]||""}},2976:(e,t,n)=>{n.d(t,{j$:()=>i,Fs:()=>a,_G:()=>r,U3:()=>s,BM:()=>u,RR:()=>c,P6:()=>o});var r={};n.r(r),n.d(r,{vM:()=>y,Sg:()=>g,Fk:()=>v,eX:()=>d,pM:()=>h,tC:()=>p});var o={};n.r(o),n.d(o,{CloudbaseError:()=>G,createCloudbaseError:()=>H,createPromiseCallback:()=>D,errorToResult:()=>Y,execCallback:()=>q,formatUrl:()=>N,genSeqId:()=>R,generateRequestId:()=>C,getHash:()=>j,getQuery:()=>U,isArray:()=>E,isFormData:()=>P,isInstanceOf:()=>T,isNull:()=>A,isPalinObject:()=>O,isString:()=>I,isUndefined:()=>S,maybeThrow:()=>K,parseCaptcha:()=>ee,parseQueryString:()=>Z,printError:()=>F,printGroupLog:()=>$,printInfo:()=>B,printWarn:()=>M,promoteGatewayError:()=>J,removeParam:()=>L,resolveThrow:()=>z,sleep:()=>X,throwError:()=>W,toQueryString:()=>k,transformPhone:()=>Q});var i={};n.r(i),n.d(i,{Fk:()=>ce,xY:()=>ue});var a={};n.r(a),n.d(a,{q:()=>he});var s={};n.r(s),n.d(s,{yE:()=>ge});var c={};n.r(c),n.d(c,{P:()=>we,$:()=>be});var u={};n.r(u),n.d(u,{D:()=>Oe});var l="@cloudbase/js-sdk";function p(e){l=e}function d(){return l}var f="https:";function h(e){f=e}var m,v=("undefined"==typeof process||process.env,!1),y="https://support.qq.com/products/148793",g={INVALID_PARAMS:"INVALID_PARAMS",INVALID_SYNTAX:"INVALID_SYNTAX",INVALID_OPERATION:"INVALID_OPERATION",OPERATION_FAIL:"OPERATION_FAIL",NETWORK_ERROR:"NETWORK_ERROR",UNKOWN_ERROR:"UNKOWN_ERROR"},b=n(7149),w=(m=function(e,t){return m=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])},m(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}m(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),x=function(){return x=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},x.apply(this,arguments)},_=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};function E(e){return"[object Array]"===Object.prototype.toString.call(e)}function I(e){return"string"==typeof e}function S(e){return void 0===e}function O(e){return"[object Object]"===Object.prototype.toString.call(e)}function A(e){return"[object Null]"===Object.prototype.toString.call(e)}function T(e,t){return e instanceof t}function P(e){return"[object FormData]"===Object.prototype.toString.call(e)}function R(){return Math.random().toString(16).slice(2)}function C(){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)})}function N(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)}function k(e){void 0===e&&(e={});var t=[];return Object.keys(e).forEach(function(n){t.push("".concat(n,"=").concat(encodeURIComponent(e[n])))}),t.join("&")}function U(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]:""}var j=function(e){if("undefined"==typeof window)return"";var t=window.location.hash.match(new RegExp("[#?&/]".concat(e,"=([^&#]*)")));return t?t[1]:""};function L(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}function D(){var e={};if(!Promise){(e=function(){}).promise={};var t=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}var n=new Promise(function(t,n){e=function(e,r){return e?n(e):t(r)}});return e.promise=n,e}function q(e,t,n){if(void 0===n&&(n=null),e&&"function"==typeof e)return e(t,n);if(t)throw t;return n}function M(e,t){console.warn("[".concat(d(),"][").concat(e,"]:").concat(t))}function F(e,t){console.error({code:e,msg:"[".concat(d(),"][").concat(e,"]:").concat(t)})}function B(e,t){console.log("[".concat(d(),"][").concat(e,"]:").concat(t))}function W(e,t){var n=new Error(JSON.stringify({code:e,msg:"[".concat(d(),"][").concat(e,"]:").concat(t)}));throw n.code=e,n}var G=function(e){function t(t){var n=e.call(this,t.msg||t.message||"")||this;return n.code=t.code||"",n.requestId=t.requestId||"",Object.defineProperty(n,"message",{value:t.msg||t.message||"",enumerable:!0,writable:!0,configurable:!0}),n}return w(t,e),t}(Error),V=function(e){return new G(e)};function H(e,t){return(t||V)(e)}function z(e){return!e||"boolean"!=typeof e.throw||e.throw}function K(e,t){if(z(e))throw H(t,null==e?void 0:e.errorFactory);return x({code:t.code,message:t.msg},t.requestId?{requestId:t.requestId}:{})}function J(e){if(e&&"object"==typeof e&&e.data&&"object"==typeof e.data){var t=e.data,n=t.code,r=t.message;if(!e.code&&n||!e.message&&r)return x(x(x({},e),!e.code&&n?{code:n}:{}),!e.message&&r?{message:r}:{})}return e}function Y(e){if(e instanceof Error&&"string"==typeof e.message)try{var t=JSON.parse(e.message);if(t&&"string"==typeof t.code)return{code:t.code,message:t.msg||t.message||"",requestId:t.requestId}}catch(e){}return e&&"string"==typeof e.code?{code:e.code,message:e.message||"",requestId:e.requestId}:{code:"UNKNOWN_ERROR",message:String((null==e?void 0:e.message)||e||"")}}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],f=d.type,h=d.body;switch(f){case"info":console.log(h);break;case"warn":console.warn(h);break;case"error":console.error(h)}}c&&(console.trace||console.log)("stack trace:"),null===(t=console.groupEnd)||void 0===t||t.call(console)}var X=function(e){return void 0===e&&(e=0),new Promise(function(t){return setTimeout(t,e)})};function Q(e){return"+86".concat(e)}var Z=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};function ee(e){var t={},n=e.match(/^(data:.*?)(\?[^#\s]*)?$/);if(n){e=n[1];var r=n[2];r&&(t=Z(r))}var o=t.token,i=_(t,["token"]);return/^data:/.test(e)&&!o?{error:"invalid_argument",error_description:"invalid captcha data: ".concat(e)}:o?{state:i.state,token:o,captchaData:e}:{error:"unimplemented",error_description:"need to impl captcha data"}}var te,ne=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)}}(),re=function(){return re=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},re.apply(this,arguments)},oe=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())})},ie=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])}}},ae=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 ne(t,e),t.prototype.get=function(e){return this.request(re(re({},e),{method:"get"}),this.restrictedMethods.includes("get"))},t.prototype.post=function(e){return this.request(re(re({},e),{method:"post"}),this.restrictedMethods.includes("post"))},t.prototype.put=function(e){return this.request(re(re({},e),{method:"put"}))},t.prototype.upload=function(e){var t=e.data,n=e.file,r=e.name,o=e.method,i=e.headers,a=void 0===i?{}:i,s={post:"post",put:"put"}[null==o?void 0:o.toLowerCase()]||"put",c=new FormData;return"post"===s?(Object.keys(t).forEach(function(e){c.append(e,t[e])}),c.append("key",r),c.append("file",n),this.request(re(re({},e),{data:c,method:s}),this.restrictedMethods.includes("upload"))):this.request(re(re({},e),{method:"put",headers:a,body:n}),this.restrictedMethods.includes("upload"))},t.prototype.download=function(e){return oe(this,void 0,Promise,function(){var t,n,r,o;return ie(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.get(re(re({},e),{headers:{},responseType:"blob"}))];case 1:return t=i.sent().data,n=window.URL.createObjectURL(new Blob([t])),r=decodeURIComponent(new URL(e.url).pathname.split("/").pop()||""),(o=document.createElement("a")).href=n,o.setAttribute("download",r),o.style.display="none",document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(n),document.body.removeChild(o),[3,3];case 2:return i.sent(),[3,3];case 3:return[2,new Promise(function(t){t({statusCode:200,tempFilePath:e.url})})]}})})},t.prototype.fetch=function(e){var t;return oe(this,void 0,Promise,function(){var n,r,o,i,a,s,c,u,l,p,d,f,h,m=this;return ie(this,function(v){switch(v.label){case 0:return n=new AbortController,r=e.url,o=e.enableAbort,i=void 0!==o&&o,a=e.stream,s=void 0!==a&&a,c=e.signal,u=e.timeout,l=e.shouldThrowOnError,p=void 0===l||l,d=null!=u?u:this.timeout,c&&(c.aborted&&n.abort(),c.addEventListener("abort",function(){return n.abort()})),f=null,i&&d&&(f=setTimeout(function(){console.warn(m.timeoutMsg),n.abort(new Error(m.timeoutMsg))},d)),[4,fetch(r,re(re({},e),{signal:n.signal})).then(function(e){return oe(m,void 0,void 0,function(){var t,n,r;return ie(this,function(o){switch(o.label){case 0:return clearTimeout(f),p?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(f),Promise.reject(e)})];case 1:return h=v.sent(),[2,{data:s?h.body:(null===(t=h.headers.get("content-type"))||void 0===t?void 0:t.includes("application/json"))?h.json():h.text(),statusCode:h.status,header:h.headers,response:h}]}})})},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,u=e.responseType,l=e.withCredentials,p=e.body,d=e.onUploadProgress,h=N(f,i,"get"===r?c:{}),m=new XMLHttpRequest;m.open(r,h),u&&(m.responseType=u);var v,y,g=e.signal;g&&(g.aborted?m.abort():g.addEventListener("abort",function(){return m.abort()},{once:!0})),Object.keys(s).forEach(function(e){m.setRequestHeader(e,s[e])}),d&&m.upload.addEventListener("progress",d),m.onreadystatechange=function(){var e={};if(4===m.readyState){var t=m.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=m.status;try{e.data="blob"===u?m.response:JSON.parse(m.responseText)}catch(t){e.data="blob"===u?m.response:m.responseText}clearTimeout(v),o(e)}},t&&n.timeout&&(v=setTimeout(function(){console.warn(n.timeoutMsg),m.abort()},n.timeout)),y=P(c)?c:"application/x-www-form-urlencoded"===s["content-type"]?k(c):p||(c?JSON.stringify(c):void 0),l&&(m.withCredentials=!0),m.send(y)})},t}(b.AbstractSDKRequest),se=function(){return se=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},se.apply(this,arguments)};function ce(e,t){for(var n=0,r=E(e)?e:[e];n<r.length;n++){var o=r[n],i=o.isMatch,a=o.genAdapter,s=o.runtime;if(i())return{adapter:se({isMatch:i},a(t)),runtime:s}}}function ue(){return{adapter:se({},{type:"default",root:window,reqClass:ae,wsClass:WebSocket,localStorage}),runtime:te.WEB}}!function(e){e.WEB="web",e.WX_MP="wx_mp"}(te||(te={}));var le=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)}}(),pe=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())})},de=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])}}},fe=function(e){function t(t){var n=e.call(this)||this;return n.root=t,t.tcbCacheObject||(t.tcbCacheObject={}),n}return le(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}(b.AbstractStorage),he=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:(M(g.INVALID_PARAMS,"localStorage is not supported on current platform"),new fe(t.root));case"none":return new fe(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:g.OPERATION_FAIL,msg:"[".concat(d(),"][").concat(g.OPERATION_FAIL,"]setStore failed"),info:e}))}}else M(g.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},e.prototype.setStoreAsync=function(e,t,n){return pe(this,void 0,void 0,function(){var r;return de(this,function(o){switch(o.label){case 0:if(!this.storage)return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),r={version:n||"localCachev1",content:t},[4,this.storage.setItem(e,JSON.stringify(r))];case 2:return o.sent(),[3,4];case 3:return o.sent(),[2];case 4:return[2]}})})},e.prototype.getStore=function(e,t){var n;if("async"!==this.mode){try{if("undefined"!=typeof process&&(null===(n=process.env)||void 0===n?void 0:n.tcb_token))return process.env.tcb_token;if(!this.storage)return""}catch(e){return""}t=t||"localCachev1";var r=this.storage.getItem(e);return r&&r.indexOf(t)>=0?JSON.parse(r).content:""}M(g.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},e.prototype.getStoreAsync=function(e,t){var n;return pe(this,void 0,void 0,function(){var r;return de(this,function(o){switch(o.label){case 0:try{if("undefined"!=typeof process&&(null===(n=process.env)||void 0===n?void 0:n.tcb_token))return[2,process.env.tcb_token];if(!this.storage)return[2,""]}catch(e){return[2,""]}return t=t||"localCachev1",[4,this.storage.getItem(e)];case 1:return(r=o.sent())&&r.indexOf(t)>=0?[2,JSON.parse(r).content]:[2,""]}})})},e.prototype.removeStore=function(e){"async"!==this.mode?this.storage.removeItem(e):M(g.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},e.prototype.removeStoreAsync=function(e){return pe(this,void 0,void 0,function(){return de(this,function(t){switch(t.label){case 0:return[4,this.storage.removeItem(e)];case 1:return t.sent(),[2]}})})},e}(),me=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)}}(),ve=function(e,t){this.data=t||null,this.name=e},ye=function(e){function t(t,n){var r=e.call(this,"error",{error:t,data:n})||this;return r.error=t,r}return me(t,e),t}(ve),ge=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(T(e,ye))return console.error(e.error),this;var n=I(e)?new ve(e,t||{}):e,r=n.name;if(this.listens(r)){n.target=this;for(var o=0,i=this.listeners[r]?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))}([],this.listeners[r],!0):[];o<i.length;o++)i[o].call(this,n)}return this},e.prototype.listens=function(e){return this.listeners[e]&&this.listeners[e].length>0},e}();new ge;var be=new ge,we="lang_change",xe=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())})},_e=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])}}},Ee=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(Ee=-1!==navigator.userAgent.indexOf("Firefox"));var Ie=Ee?/(\.js\/)?__decorate(\$\d+)?<@.*\d$/:/(\/\w+\.js\.)?__decorate(\$\d+)?\s*\(.*\)$/,Se=/https?:\/\/.+:\d*\/.*\.js:\d+:\d+/;function Oe(e){var t=e.mode,n=void 0===t?"async":t,r=e.customInfo,o=void 0===r?{}:r,i=e.title,a=e.messages,s=void 0===a?[]:a;return function(e,t,r){if(v){var a=o.className||e.constructor.name,c=o.methodName||t,u=r.value,l=function(){var e="",t=(new Error).stack.split("\n"),n=t.findIndex(function(e){return Ie.test(e)});if(-1!==n){var r=Se.exec(t[n+1]||"");e=r?r[0]:""}return e}();r.value="sync"===n?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Ae({err:new Error,className:a,methodName:c,sourceLink:l});try{return u.apply(this,e)}catch(e){var r=e,o=e.message,p=e.error,d=e.error_description,f={title:i||"".concat(a,".").concat(c," failed"),content:[{type:"error",body:e}]};if(o&&/^\{.*\}$/.test(o)){var h=JSON.parse(o);f.subtitle=o,h.code&&(n?(n.code=h.code,n.msg=h.msg):(e.code=h.code,e.message=h.msg),r=n||e,f.content=s.map(function(e){return{type:"info",body:e}}))}throw p&&d&&(f.subtitle=d,n?(n.code=p,n.msg=d):(e.code=p,e.message=d),r=n||e,f.content=s.map(function(e){return{type:"info",body:e}})),$(f),r}}:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return xe(this,void 0,void 0,function(){var t,n,r,o,p,d,f,h;return _e(this,function(m){switch(m.label){case 0:t=Ae({err:new Error,className:a,methodName:c,sourceLink:l}),m.label=1;case 1:return m.trys.push([1,3,,4]),[4,u.apply(this,e)];case 2:return[2,m.sent()];case 3:throw n=m.sent(),r=n,o=n.message,p=n.error,d=n.error_description,f={title:i||"".concat(a,".").concat(c," failed"),content:[{type:"error",body:n}]},o&&/^\{.*\}$/.test(o)&&(h=JSON.parse(o),f.subtitle=h,h.code&&(t?(t.code=h.code,t.message=h.msg):(n.code=h.code,n.message=h.msg),r=t||n,f.content=s.map(function(e){return{type:"info",body:e}}))),p&&d&&(f.subtitle=d,t?(t.code=p,t.msg=d):(n.code=p,n.message=d),r=t||n,f.content=s.map(function(e){return{type:"info",body:e}})),$(f),r;case 4:return[2]}})})}}}}function Ae(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"),s=Ee?/^catchErrorsDecorator\/<\/descriptor.value@.*\d$/:new RegExp("".concat(n,"\\.descriptor.value\\s*\\[as\\s").concat(r,"\\]\\s*\\(.*\\)$")),c=Ee?/^catchErrorsDecorator\/<\/descriptor.value/:new RegExp("".concat(n,"\\.descriptor.value\\s*\\[as\\s").concat(r,"\\]")),u=a.findIndex(function(e){return s.test(e)});if(-1!==u){var l=a.filter(function(e,t){return t>u});l.unshift(a[u].replace(c,"".concat(n,".").concat(r)).replace(Se,o)),(i=new Error).stack="".concat(Ee?"@debugger":"Error","\n").concat(l.join("\n"))}return i}Te={default:()=>__WEBPACK_EXTERNAL_MODULE_jwt_decode_b659f100__.default},Pe={},n.d(Pe,Te);var Te,Pe},3388:e=>{e.exports={}},8182:function(e,t,n){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){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(7149),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,f,h,m,v,y,g=this;return s(this,function(b){switch(b.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,f=e.shouldThrowOnError,h=void 0===f||f,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(g.timeoutMsg),n.abort(new Error(g.timeoutMsg))},m)),[4,fetch(r,i(i({},e),{signal:n.signal})).then(function(e){return a(g,void 0,void 0,function(){var t,n,r;return s(this,function(o){switch(o.label){case 0:return clearTimeout(v),h?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 y=b.sent(),[2,{data:l?y.body:(null===(t=y.headers.get("content-type"))||void 0===t?void 0:t.includes("application/json"))?y.json():y.text(),statusCode:y.status,header:y.headers,response:y}]}})})},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,f=e.body,h=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 y,g,b=e.signal;b&&(b.aborted?v.abort():b.addEventListener("abort",function(){return v.abort()},{once:!0})),Object.keys(s).forEach(function(e){v.setRequestHeader(e,s[e])}),h&&v.upload.addEventListener("progress",h),v.onreadystatechange=function(){var e={};if(4===v.readyState){var t=v.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};t.forEach(function(e){var t=e.split(": "),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(y),o(e)}},t&&n.timeout&&(y=setTimeout(function(){console.warn(n.timeoutMsg),v.abort()},n.timeout)),g=(0,u.isFormData)(c)?c:"application/x-www-form-urlencoded"===s["content-type"]?(0,u.toQueryString)(c):f||(c?JSON.stringify(c):void 0),d&&(v.withCredentials=!0),v.send(g)})},t}(c.AbstractSDKRequest);t.WebRequest=p,t.genAdapter=function(){return{type:"default",root:window,reqClass:p,wsClass:WebSocket,localStorage}}},2946:(e,t)=>{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=("undefined"==typeof process||process.env,!1),t.COMMUNITY_SITE_URL="https://support.qq.com/products/148793"},6205:(e,t)=>{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){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){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,f=e.messages,h=void 0===f?[]:f;return function(e,t,s){if(a.IS_DEBUG_MODE){var f=p.className||e.constructor.name,m=p.methodName||t,v=s.value,y=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:f,methodName:m,sourceLink:y});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(f,".").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=h.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=h.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:f,methodName:m,sourceLink:y}),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(f,".").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=h.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=h.map(function(e){return{type:"info",body:e}})),(0,i.printGroupLog)(u),r;case 4:return[2]}})})}}}}},141:function(e,t,n){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){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(7149),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=process.env)||void 0===n?void 0:n.tcb_token))return process.env.tcb_token;if(!this.storage)return""}catch(e){return""}t=t||"localCachev1";var r=this.storage.getItem(e);return r&&r.indexOf(t)>=0?JSON.parse(r).content:""}(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=process.env)||void 0===n?void 0:n.tcb_token))return[2,process.env.tcb_token];if(!this.storage)return[2,""]}catch(e){return[2,""]}return t=t||"localCachev1",[4,this.storage.getItem(e)];case 1:return(r=o.sent())&&r.indexOf(t)>=0?[2,JSON.parse(r).content]:[2,""]}})})},e.prototype.removeStore=function(e){"async"!==this.mode?this.storage.removeItem(e):(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){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){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.__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.errorToResult=t.promoteGatewayError=t.maybeThrow=t.resolveThrow=t.createCloudbaseError=t.CloudbaseError=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 s=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,s.getSdkName)(),"][").concat(e,"]:").concat(t))},t.printError=function(e,t){console.error({code:e,msg:"[".concat((0,s.getSdkName)(),"][").concat(e,"]:").concat(t)})},t.printInfo=function(e,t){console.log("[".concat((0,s.getSdkName)(),"][").concat(e,"]:").concat(t))},t.throwError=function(e,t){var n=new Error(JSON.stringify({code:e,msg:"[".concat((0,s.getSdkName)(),"][").concat(e,"]:").concat(t)}));throw n.code=e,n};var c=function(e){function t(t){var n=e.call(this,t.msg||t.message||"")||this;return n.code=t.code||"",n.requestId=t.requestId||"",Object.defineProperty(n,"message",{value:t.msg||t.message||"",enumerable:!0,writable:!0,configurable:!0}),n}return o(t,e),t}(Error);t.CloudbaseError=c;var u=function(e){return new c(e)};function l(e,t){return(t||u)(e)}function p(e){return!e||"boolean"!=typeof e.throw||e.throw}t.createCloudbaseError=l,t.resolveThrow=p,t.maybeThrow=function(e,t){if(p(e))throw l(t,null==e?void 0:e.errorFactory);return i({code:t.code,message:t.msg},t.requestId?{requestId:t.requestId}:{})},t.promoteGatewayError=function(e){if(e&&"object"==typeof e&&e.data&&"object"==typeof e.data){var t=e.data,n=t.code,r=t.message;if(!e.code&&n||!e.message&&r)return i(i(i({},e),!e.code&&n?{code:n}:{}),!e.message&&r?{message:r}:{})}return e},t.errorToResult=function(e){if(e instanceof Error&&"string"==typeof e.message)try{var t=JSON.parse(e.message);if(t&&"string"==typeof t.code)return{code:t.code,message:t.msg||t.message||"",requestId:t.requestId}}catch(e){}return e&&"string"==typeof e.code?{code:e.code,message:e.message||"",requestId:e.requestId}:{code:"UNKNOWN_ERROR",message:String((null==e?void 0:e.message)||e||"")}},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],f=d.type,h=d.body;switch(f){case"info":console.log(h);break;case"warn":console.warn(h);break;case"error":console.error(h)}}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={},r=e.match(/^(data:.*?)(\?[^#\s]*)?$/);if(r){e=r[1];var o=r[2];o&&(n=(0,t.parseQueryString)(o))}var i=n.token,s=a(n,["token"]);return/^data:/.test(e)&&!i?{error:"invalid_argument",error_description:"invalid captcha data: ".concat(e)}:i?{state:s.state,token:i,captchaData:e}:{error:"unimplemented",error_description:"need to impl captcha data"}}},9919:(e,t,n)=>{var r=n(4090),o=n(9638),i=n(8418),a=n(6476);e.exports=a||r.call(i,o)},9638:e=>{e.exports=Function.prototype.apply},8418:e=>{e.exports=Function.prototype.call},8381:(e,t,n)=>{var r=n(4090),o=n(5408),i=n(8418),a=n(9919);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new o("a function is required");return a(r,i,e)}},6476:e=>{e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},6160:(e,t,n)=>{var r=n(921),o=n(8331).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(8331).Stream,o=n(921);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))}}},5141:(e,t,n)=>{var r,o=n(8381),i=n(9873);try{r=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var a=!!r&&i&&i(Object.prototype,"__proto__"),s=Object,c=s.getPrototypeOf;e.exports=a&&"function"==typeof a.get?o([a.get]):"function"==typeof c&&function(e){return c(null==e?e:s(e))}},999:e=>{var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},9654:e=>{e.exports=EvalError},2321:e=>{e.exports=Error},8205:e=>{e.exports=RangeError},9209:e=>{e.exports=ReferenceError},8342:e=>{e.exports=SyntaxError},5408:e=>{e.exports=TypeError},2885:e=>{e.exports=URIError},4546:e=>{e.exports=Object},8677:(e,t,n)=>{var r=n(7286)("%Object.defineProperty%",!0),o=n(7226)(),i=n(2196),a=n(5408),s=o?Symbol.toStringTag:null;e.exports=function(e,t){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(void 0!==n&&"boolean"!=typeof n||void 0!==o&&"boolean"!=typeof o)throw new a("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");!s||!n&&i(e,s)||(r?r(e,s,{configurable:!o,enumerable:!1,value:t,writable:!1}):e[s]=t)}},1191:(e,t,n)=>{var r=n(6160),o=n(921),i=n(6794),a=n(8100),s=n(6662),c=n(9657).parse,u=n(2539),l=n(8331).Stream,p=n(1047),d=n(6856),f=n(9954),h=n(8677),m=n(2196),v=n(5488);function y(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}function g(e){if(!(this instanceof g))return new g(e);for(var t in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],r.call(this),e=e||{})this[t]=e[t]}o.inherits(g,r),g.LINE_BREAK="\r\n",g.DEFAULT_CONTENT_TYPE="application/octet-stream",g.prototype.append=function(e,t,n){"string"==typeof(n=n||{})&&(n={filename:n});var o=r.prototype.append.bind(this);if("number"!=typeof t&&null!=t||(t=String(t)),Array.isArray(t))this._error(new Error("Arrays are not supported."));else{var i=this._multiPartHeader(e,t,n),a=this._multiPartFooter();o(i),o(t),o(a),this._trackLength(i,t,n)}},g.prototype._trackLength=function(e,t,n){var r=0;null!=n.knownLength?r+=Number(n.knownLength):Buffer.isBuffer(t)?r=t.length:"string"==typeof t&&(r=Buffer.byteLength(t)),this._valueLength+=r,this._overheadLength+=Buffer.byteLength(e)+g.LINE_BREAK.length,t&&(t.path||t.readable&&m(t,"httpVersion")||t instanceof l)&&(n.knownLength||this._valuesToMeasure.push(t))},g.prototype._lengthRetriever=function(e,t){m(e,"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){if(n)t(n);else{var o=r.size-(e.start?e.start:0);t(null,o)}}):m(e,"httpVersion")?t(null,Number(e.headers["content-length"])):m(e,"httpModule")?(e.on("response",function(n){e.pause(),t(null,Number(n.headers["content-length"]))}),e.resume()):t("Unknown stream")},g.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="'+y(e)+'"'].concat(o||[]),"Content-Type":[].concat(i||[])};for(var c in"object"==typeof n.header&&v(s,n.header),s)if(m(s,c)){if(null==(r=s[c]))continue;Array.isArray(r)||(r=[r]),r.length&&(a+=c+": "+r.join("; ")+g.LINE_BREAK)}return"--"+this.getBoundary()+g.LINE_BREAK+a+g.LINE_BREAK},g.prototype._getContentDisposition=function(e,t){var n;if("string"==typeof t.filepath?n=i.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?n=i.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&m(e,"httpVersion")&&(n=i.basename(e.client._httpMessage.path||"")),n)return'filename="'+y(n)+'"'},g.prototype._getContentType=function(e,t){var n=t.contentType;return!n&&e&&e.name&&(n=d.lookup(e.name)),!n&&e&&e.path&&(n=d.lookup(e.path)),!n&&e&&e.readable&&m(e,"httpVersion")&&(n=e.headers["content-type"]),n||!t.filepath&&!t.filename||(n=d.lookup(t.filepath||t.filename)),!n&&e&&"object"==typeof e&&(n=g.DEFAULT_CONTENT_TYPE),n},g.prototype._multiPartFooter=function(){return function(e){var t=g.LINE_BREAK;0===this._streams.length&&(t+=this._lastBoundary()),e(t)}.bind(this)},g.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+g.LINE_BREAK},g.prototype.getHeaders=function(e){var t,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)m(e,t)&&(n[t.toLowerCase()]=e[t]);return n},g.prototype.setBoundary=function(e){if("string"!=typeof e)throw new TypeError("FormData boundary must be a string");this._boundary=e},g.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},g.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(g.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},g.prototype._generateBoundary=function(){this._boundary="--------------------------"+p.randomBytes(12).toString("hex")},g.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},g.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},g.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;this._streams.length&&(t+=this._lastBoundary().length),this._valuesToMeasure.length?f.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))},g.prototype.submit=function(e,t){var n,r,o={method:"post"};return"string"==typeof e?(e=c(e),r=v({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(r=v(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},g.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},g.prototype.toString=function(){return"[object FormData]"},h(g.prototype,"FormData"),e.exports=g},5488:e=>{e.exports=function(e,t){return Object.keys(t).forEach(function(n){e[n]=e[n]||t[n]}),e}},7795:e=>{var t=Object.prototype.toString,n=Math.max,r=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var o=0;o<t.length;o+=1)n[o+e.length]=t[o];return n};e.exports=function(e){var o=this;if("function"!=typeof o||"[object Function]"!==t.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var i,a=function(e){for(var t=[],n=1,r=0;n<e.length;n+=1,r+=1)t[r]=e[n];return t}(arguments),s=n(0,o.length-a.length),c=[],u=0;u<s;u++)c[u]="$"+u;if(i=Function("binder","return function ("+function(e){for(var t="",n=0;n<e.length;n+=1)t+=e[n],n+1<e.length&&(t+=",");return t}(c)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var t=o.apply(this,r(a,arguments));return Object(t)===t?t:this}return o.apply(e,r(a,arguments))}),o.prototype){var l=function(){};l.prototype=o.prototype,i.prototype=new l,l.prototype=null}return i}},4090:(e,t,n)=>{var r=n(7795);e.exports=Function.prototype.bind||r},5462:e=>{const t=function*(){}.constructor;e.exports=()=>t},7286:(e,t,n)=>{var r,o=n(4546),i=n(2321),a=n(9654),s=n(8205),c=n(9209),u=n(8342),l=n(5408),p=n(2885),d=n(4383),f=n(5736),h=n(7130),m=n(2400),v=n(3654),y=n(6890),g=n(2026),b=n(9873),w=n(999),x=function(){throw new l},_=b?function(){try{return x}catch(e){try{return b(arguments,"callee").get}catch(e){return x}}}():x,E=n(2636)(),I=n(1750),S=n(2938),O=n(8354),A=n(9638),T=n(8418),P={},R="undefined"!=typeof Uint8Array&&I?I(Uint8Array):r,C={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":E&&I?I([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":P,"%AsyncGenerator%":P,"%AsyncGeneratorFunction%":P,"%AsyncIteratorPrototype%":P,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":"undefined"==typeof Float16Array?r:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":Function,"%GeneratorFunction%":P,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&I?I(I([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&E&&I?I((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":s,"%ReferenceError%":c,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&E&&I?I((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&I?I(""[Symbol.iterator]()):r,"%Symbol%":E?Symbol:r,"%SyntaxError%":u,"%ThrowTypeError%":_,"%TypedArray%":R,"%TypeError%":l,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":p,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet,"%Function.prototype.call%":T,"%Function.prototype.apply%":A,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":S,"%Math.abs%":d,"%Math.floor%":f,"%Math.max%":h,"%Math.min%":m,"%Math.pow%":v,"%Math.round%":y,"%Math.sign%":g,"%Reflect.getPrototypeOf%":O};if(I)try{null.error}catch(e){var N=I(I(e));C["%Error.prototype%"]=N}var k=n(635),U=n(5462),j=n(7350),L=function e(t){var n;if("%AsyncFunction%"===t)n=k()||void 0;else if("%GeneratorFunction%"===t)n=U()||void 0;else if("%AsyncGeneratorFunction%"===t)n=j()||void 0;else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&I&&(n=I(o.prototype))}return C[t]=n,n},D={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},q=n(4090),M=n(2196),F=q.call(T,Array.prototype.concat),B=q.call(A,Array.prototype.splice),W=q.call(T,String.prototype.replace),G=q.call(T,String.prototype.slice),V=q.call(T,RegExp.prototype.exec),H=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,z=/\\(\\)?/g,K=function(e,t){var n,r=e;if(M(D,r)&&(r="%"+(n=D[r])[0]+"%"),M(C,r)){var o=C[r];if(o===P&&(o=L(r)),void 0===o&&!t)throw new l("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new u("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new l('"allowMissing" argument must be a boolean');if(null===V(/^%?[^%]*%?$/,e))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=G(e,0,1),n=G(e,-1);if("%"===t&&"%"!==n)throw new u("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new u("invalid intrinsic syntax, expected opening `%`");var r=[];return W(e,H,function(e,t,n,o){r[r.length]=n?W(o,z,"$1"):t||e}),r}(e),r=n.length>0?n[0]:"",o=K("%"+r+"%",t),i=o.name,a=o.value,s=!1,c=o.alias;c&&(r=c[0],B(n,F([0,1],c)));for(var p=1,d=!0;p<n.length;p+=1){var f=n[p],h=G(f,0,1),m=G(f,-1);if(('"'===h||"'"===h||"`"===h||'"'===m||"'"===m||"`"===m)&&h!==m)throw new u("property names with quotes must have matching quotes");if("constructor"!==f&&d||(s=!0),M(C,i="%"+(r+="."+f)+"%"))a=C[i];else if(null!=a){if(!(f in a)){if(!t)throw new l("base intrinsic for "+e+" exists, but the property is not available.");return}if(b&&p+1>=n.length){var v=b(a,f);a=(d=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:a[f]}else d=M(a,f),a=a[f];d&&!s&&(C[i]=a)}}return a}},2938:(e,t,n)=>{var r=n(4546);e.exports=r.getPrototypeOf||null},8354:e=>{e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},1750:(e,t,n)=>{var r=n(8354),o=n(2938),i=n(5141);e.exports=r?function(e){return r(e)}:o?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return o(e)}:i?function(e){return i(e)}:null},3165:e=>{e.exports=Object.getOwnPropertyDescriptor},9873:(e,t,n)=>{var r=n(3165);if(r)try{r([],"length")}catch(e){r=null}e.exports=r},2636:(e,t,n)=>{var r="undefined"!=typeof Symbol&&Symbol,o=n(6679);e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&o()}},6679:e=>{e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(var r in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},7226:(e,t,n)=>{var r=n(6679);e.exports=function(){return r()&&!!Symbol.toStringTag}},2196:(e,t,n)=>{var r=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=n(4090);e.exports=i.call(r,o)},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(2344),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),f=n||l||p||d,h=f?r(e.length,String):[],m=h.length;for(var v in e)!t&&!u.call(e,v)||f&&("length"==v||p&&("offset"==v||"parent"==v)||d&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,m))||h.push(v);return h}},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),f=n(6939),h=n(940),m=n(9917),v=n(8222),y=n(8725),g=n(6152),b=n(3226),w=n(4714),x=n(9259),_=n(3679),E=n(249),I=n(8582),S="[object Arguments]",O="[object Function]",A="[object Object]",T={};T[S]=T["[object Array]"]=T["[object ArrayBuffer]"]=T["[object DataView]"]=T["[object Boolean]"]=T["[object Date]"]=T["[object Float32Array]"]=T["[object Float64Array]"]=T["[object Int8Array]"]=T["[object Int16Array]"]=T["[object Int32Array]"]=T["[object Map]"]=T["[object Number]"]=T[A]=T["[object RegExp]"]=T["[object Set]"]=T["[object String]"]=T["[object Symbol]"]=T["[object Uint8Array]"]=T["[object Uint8ClampedArray]"]=T["[object Uint16Array]"]=T["[object Uint32Array]"]=!0,T["[object Error]"]=T[O]=T["[object WeakMap]"]=!1,e.exports=function e(t,n,P,R,C,N){var k,U=1&n,j=2&n,L=4&n;if(P&&(k=C?P(t,R,C,N):P(t)),void 0!==k)return k;if(!x(t))return t;var D=g(t);if(D){if(k=m(t),!U)return u(t,k)}else{var q=h(t),M=q==O||"[object GeneratorFunction]"==q;if(b(t))return c(t,U);if(q==A||q==S||M&&!C){if(k=j||M?{}:y(t),!U)return j?p(t,s(k,t)):l(t,a(k,t))}else{if(!T[q])return C?t:{};k=v(t,q,U)}}N||(N=new r);var F=N.get(t);if(F)return F;N.set(t,k),_(t)?t.forEach(function(r){k.add(e(r,n,P,r,t,N))}):w(t)&&t.forEach(function(r,o){k.set(o,e(r,n,P,o,t,N))});var B=D?void 0:(L?j?f:d:j?I:E)(t);return o(B||t,function(r,o){B&&(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 f=s(t[u]),h=n;if("__proto__"===f||"constructor"===f||"prototype"===f)return e;if(u!=p){var m=d[f];void 0===(h=c?c(m,f,d):void 0)&&(h=a(m)?m:i(t[u+1])?[]:{})}r(d,f,h),d=d[f]}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),s=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=-1,c=(t=r(t,e)).length;if(!c)return!0;for(;++n<c;){var u=a(t[n]);if("__proto__"===u&&!s.call(e,"__proto__"))return!1;if(("constructor"===u||"prototype"===u)&&n<c-1)return!1}var l=i(e,t);return null==l||delete l[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]",f="[object WeakMap]",h="[object DataView]",m=u(r),v=u(o),y=u(i),g=u(a),b=u(s),w=c;(r&&w(new r(new ArrayBuffer(1)))!=h||o&&w(new o)!=l||i&&w(i.resolve())!=p||a&&w(new a)!=d||s&&w(new s)!=f)&&(w=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 h;case v:return l;case y:return p;case g:return d;case b:return f}return t}),e.exports=w},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=n??9007199254740991)&&("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]}},2344:(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)}},4383:e=>{e.exports=Math.abs},5736:e=>{e.exports=Math.floor},8806:e=>{e.exports=Number.isNaN||function(e){return e!=e}},7130:e=>{e.exports=Math.max},2400:e=>{e.exports=Math.min},3654:e=>{e.exports=Math.pow},6890:e=>{e.exports=Math.round},2026:(e,t,n)=>{var r=n(8806);e.exports=function(e){return r(e)||0===e?e:e<0?-1:1}},9474:(e,t,n)=>{e.exports=n(7104)},6856:(e,t,n)=>{var r,o,i,a=n(9474),s=n(6794).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}}})},7149:e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__cloudbase_adapter_interface_74717cc6__},1047:e=>{e.exports=__WEBPACK_EXTERNAL_MODULE_node_crypto_803ecaf5__},2539:e=>{e.exports=__WEBPACK_EXTERNAL_MODULE_node_fs_75ed2103__},8100:e=>{e.exports=__WEBPACK_EXTERNAL_MODULE_node_http_b674be28__},6662:e=>{e.exports=__WEBPACK_EXTERNAL_MODULE_node_https_b78f5be9__},6794:e=>{e.exports=__WEBPACK_EXTERNAL_MODULE_node_path_02319fef__},8331:(e,t,n)=>{var r,o;e.exports=(r={Stream:()=>__WEBPACK_EXTERNAL_MODULE_node_stream_62980834__.Stream},o={},n.d(o,r),o)},9657:(e,t,n)=>{var r,o;e.exports=(r={parse:()=>__WEBPACK_EXTERNAL_MODULE_node_url_da953c0c__.parse},o={},n.d(o,r),o)},921:e=>{e.exports=__WEBPACK_EXTERNAL_MODULE_node_util_1f093676__},3408:(e,t,n)=>{var r,o;e.exports=(r={ReadableStream:()=>__WEBPACK_EXTERNAL_MODULE_web_streams_polyfill_c4c9f3ad__.ReadableStream,TransformStream:()=>__WEBPACK_EXTERNAL_MODULE_web_streams_polyfill_c4c9f3ad__.TransformStream},o={},n.d(o,r),o)},7104:e=>{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}}')}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};(()=>{__webpack_require__.d(__webpack_exports__,{Z:()=>Pu});var e={};__webpack_require__.r(e);var t={};__webpack_require__.r(t),__webpack_require__.d(t,{ArkSimpleModel:()=>ki,DSSimpleModel:()=>qi,DefaultImageModel:()=>fa,DefaultSimpleModel:()=>la,HunYuanBetaSimpleModel:()=>Ii,HunYuanExpSimpleModel:()=>Qi,HunYuanOpenSimpleModel:()=>na,HunYuanSimpleModel:()=>Ti,MODELS:()=>Oa,MoonshotSimpleModel:()=>Ji,ReactModel:()=>ba,YiSimpleModel:()=>Gi,ZhiPuSimpleModel:()=>yi,toolMap:()=>_a});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{LineString:()=>Ms,MultiLineString:()=>Vs,MultiPoint:()=>Ws,MultiPolygon:()=>zs,Point:()=>vc,Polygon:()=>Bs});var r=__webpack_require__(2976),o=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))},i=r._G.Sg,a={};function s(e,t){var n=t.name,r=t.namespace,s=t.entity,u=t.injectEvents,l=t.IIFE,p=void 0!==l&&l;if(a[n]||r&&e[r])throw new Error(JSON.stringify({code:i.INVALID_OPERATION,msg:"Duplicate component ".concat(n)}));if(p){if(!s||"function"!=typeof s)throw new Error(JSON.stringify({code:i.INVALID_PARAMS,msg:"IIFE component's entity must be a function"}));s.call(e)}if(a[n]=t,r?e.prototype[r]=s:c(e.prototype,s),u){var d=u.bus,f=u.events;if(!d||!f||0===f.length)return;var h=e.prototype.fire||function(){};e.prototype.events||(e.prototype.events={}),(e.prototype.events||{})[n]?e.prototype.events[n].events=o(o([],e.prototype.events[n].events,!0),f,!0):e.prototype.events[n]={bus:d,events:f},e.prototype.fire=function(e,t){h(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}}}}}function c(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]=c(e[o],t[o]))}return e}const u=(l={WxMpWebSocket:()=>__WEBPACK_EXTERNAL_MODULE__cloudbase_adapter_wx_mp_8d967865__.WxMpWebSocket,WxRequest:()=>__WEBPACK_EXTERNAL_MODULE__cloudbase_adapter_wx_mp_8d967865__.WxRequest,default:()=>__WEBPACK_EXTERNAL_MODULE__cloudbase_adapter_wx_mp_8d967865__.default,parseQueryString:()=>__WEBPACK_EXTERNAL_MODULE__cloudbase_adapter_wx_mp_8d967865__.parseQueryString,wxMpStorage:()=>__WEBPACK_EXTERNAL_MODULE__cloudbase_adapter_wx_mp_8d967865__.wxMpStorage},p={},__webpack_require__.d(p,l),p);var l,p,d=__webpack_require__(7149),f=function(){return f=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},f.apply(this,arguments)},h={},m=function(){return m=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},m.apply(this,arguments)},v=r.Fs.q,y={},g={};function b(e){var t=e.env,n=e.platformInfo,r={userInfoKey:"".concat("user_info","_").concat(t)};y[t]=y[t]||new v(m(m({},e),{keys:r,platformInfo:n})),g[t]=g[t]||new v(m(m({},e),{keys:r,platformInfo:n,persistence:"local"}))}function w(e){return g[e]}var x=__webpack_require__(7922),_=function(){return _=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},_.apply(this,arguments)},E=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=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])}}},S=r._G.Sg,O=r.P6.genSeqId,A=r.P6.isFormData,T=r.P6.formatUrl,P=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"];function R(e,t,n){var r=e[t];e[t]=function(t){var o={},i={};n.forEach(function(n){var r=n.call(e,t),a=r.data,s=r.headers;Object.assign(o,a),Object.assign(i,s)});var a=t.data;return a&&(A(a)?Object.keys(o).forEach(function(e){a.append(e,o[e])}):t.data=_(_({},a),o)),t.headers=_(_({},t.headers||{}),i),r.call(e,t)}}function C(){var e=O();return{data:{seqId:e},headers:{"X-SDK-Version":"@cloudbase/js-sdk/".concat((0,x.mI)()),"x-seqid":e}}}var N,k,U=function(){function e(e){var t=this;this.config=e;var n={env:this.config.env,region:this.config.region,accessKey:this.config.accessKey,context:this.config.context,auth:this.config.auth,timeout:this.config.timeout,timeoutMsg:"[@cloudbase/js-sdk] 请求在".concat(this.config.timeout/1e3,"s内未完成,已中断"),restrictedMethods:["post","put"]};this.reqClass=new h.adapter.reqClass(n),this.localCache=w(this.config.env),"GATEWAY"!==this.config.endPointMode&&(R(this.reqClass,"post",[C]),R(this.reqClass,"upload",[C]),R(this.reqClass,"download",[C])),r.RR.$.on(r.RR.P,function(e){var n;t.config.i18n=(null===(n=e.data)||void 0===n?void 0:n.i18n)||t.config.i18n})}return Object.defineProperty(e.prototype,"throwWhenRequestFail",{get:function(){var e,t,n,r,o=null===(n=null===(t=null===(e=this.config)||void 0===e?void 0:e._fromApp)||void 0===t?void 0:t.config)||void 0===n?void 0:n.throw;return"boolean"==typeof o?o:!1!==(null===(r=this.config)||void 0===r?void 0:r.throw)},enumerable:!1,configurable:!0}),e.prototype.getAccessToken=function(e){return void 0===e&&(e=null),E(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,x.mI)()),e},e.prototype.post=function(e,t){return E(this,void 0,Promise,function(){return I(this,function(n){switch(n.label){case 0:return[4,this.reqClass.post(_(_({},e),{headers:_(_({},e.headers),this.getDefaultHeaders()),customReqOpts:t}))];case 1:return[2,n.sent()]}})})},e.prototype.upload=function(e){return E(this,void 0,Promise,function(){return I(this,function(t){switch(t.label){case 0:return[4,this.reqClass.upload(_(_({},e),{headers:_(_({},e.headers),this.getDefaultHeaders())}))];case 1:return[2,t.sent()]}})})},e.prototype.download=function(e){return E(this,void 0,Promise,function(){return I(this,function(t){switch(t.label){case 0:return[4,this.reqClass.download(_(_({},e),{headers:_(_({},e.headers),this.getDefaultHeaders())}))];case 1:return[2,t.sent()]}})})},e.prototype.getBaseEndPoint=function(e){return void 0===e&&(e="CLOUD_API"),(0,x.M4)(this.config.env,e)},e.prototype.getOauthAccessTokenV2=function(e){return E(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,r){var o,i;return E(this,void 0,Promise,function(){var a,s,c,u,l,p,d,f,h,m,v,y,g,b,w,E,S,O,A,R,C,N,k;return I(this,function(I){switch(I.label){case 0:if(I.trys.push([0,4,,5]),a="x-tcb-trace_".concat(this.config.env),s="application/x-www-form-urlencoded",c=_({action:e,dataVersion:x.n0,env:this.config.env},t),-1!==P.indexOf(e))return[3,2];if(!(u=this.config._fromApp).oauthInstance)throw new Error("you can't request without auth");return l=u.oauthInstance,p=l.oauth2client,d=c,[4,this.getOauthAccessTokenV2(p)];case 1:d.access_token=I.sent().accessToken,I.label=2;case 2:return"storage.uploadFile"===e?(f=new FormData,Object.keys(f).forEach(function(e){Object.prototype.hasOwnProperty.call(f,e)&&void 0!==f[e]&&f.append(e,c[e])}),s="multipart/form-data"):(s="application/json;charset=UTF-8",f={},Object.keys(c).forEach(function(e){void 0!==c[e]&&(f[e]=c[e])})),h={headers:_(_({"content-type":s},this.getDefaultHeaders()),null==n?void 0:n.headers)},(null==n?void 0:n.onUploadProgress)&&(h.onUploadProgress=n.onUploadProgress),this.config.region&&(h.headers["X-TCB-Region"]=this.config.region),(m=this.localCache.getStore(a))&&(h.headers["X-TCB-Trace"]=m),v=void 0!==(null==n?void 0:n.parse)?n.parse:t.parse,y=void 0!==(null==n?void 0:n.inQuery)?n.inQuery:t.inQuery,g=void 0!==(null==n?void 0:n.search)?n.search:t.search,b=_(_({},(null==n?void 0:n.defaultQuery)||{}),{env:this.config.env}),v&&(b.parse=!0),y&&(b=_(_({},y),b)),w=(null==n?void 0:n.endPointMode)||this.config.endPointMode||"CLOUD_API",E=(0,x.vS)(this.config.env,w),S=E.baseUrl,O=E.protocol,"GATEWAY"===w&&/^((database)\.)|(auth\.wsWebSign)/.test(e)&&(A=(0,x.vS)(this.config.env,"CLOUD_API"),S="".concat(A.baseUrl.match(/\/\/([^/?#]*)/)[0],"/web")),R=void 0,R=n.pathname?T(O,"".concat(null===(o=(0,x.M4)(this.config.env,w))||void 0===o?void 0:o.replace(/^https?:/,""),"/").concat(n.pathname),b):T(O,S,b),g&&(R+=g),[4,this.post(_({url:R,data:f},h),r)];case 3:if(C=I.sent(),(N=null===(i=C.header)||void 0===i?void 0:i["x-tcb-trace"])&&this.localCache.setStore(a,N),200!==Number(C.status)&&200!==Number(C.statusCode)||!C.data)throw new Error("network request error");return[2,C];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,r,o,i,a,s,c;return E(this,void 0,Promise,function(){var u,l,p,d,f,h,m,v,y=this;return I(this,function(g){switch(g.label){case 0:u=e.token,l=e.headers,p=void 0===l?{}:l,d=e.withCredentials,f=void 0===d||d,h=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}(e,["token","headers","withCredentials"]),m=function(){return E(y,void 0,void 0,function(){var e,t,n,r;return I(this,function(o){switch(o.label){case 0:if(e={},!f)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.getAccessToken(u)];case 2:return(t=o.sent())&&(e.Authorization="Bearer ".concat(t)),[3,4];case 3:if(n=o.sent(),"undefined"==typeof process||null==process.versions||null==process.versions.node)throw n;return[3,4];case 4:return r=_({headers:_(_(_({"X-SDK-Version":"@cloudbase/js-sdk/".concat((0,x.mI)())},e),this.getDefaultHeaders()),p),withCredentials:f},h),[2,this.reqClass.fetch(r)]}})})},g.label=1;case 1:return g.trys.push([1,3,,6]),[4,m()];case 2:return[2,g.sent()];case 3:v=g.sent();try{v.requestId=v.requestId||p["x-request-id"]||p["X-Request-Id"]||""}catch(e){}if("ACCESS_TOKEN_EXPIRED"!==(null==v?void 0:v.code))return[3,5];if("function"!=typeof(null===(o=null===(r=null===(n=null===(t=this.config)||void 0===t?void 0:t._fromApp)||void 0===n?void 0:n.oauthInstance)||void 0===r?void 0:r.authApi)||void 0===o?void 0:o.refreshTokenForce))throw v;return[4,null===(c=null===(s=null===(a=null===(i=this.config)||void 0===i?void 0:i._fromApp)||void 0===a?void 0:a.oauthInstance)||void 0===s?void 0:s.authApi)||void 0===c?void 0:c.refreshTokenForce()];case 4:return g.sent(),[2,m()];case 5:throw v;case 6:return[2]}})})},e.prototype.send=function(e,t,n,r){return void 0===t&&(t={}),void 0===n&&(n={}),E(this,void 0,Promise,function(){var o;return I(this,function(i){switch(i.label){case 0:return[4,this.request(e,t,_(_({},n),{onUploadProgress:t.onUploadProgress}),r)];case 1:if((o=i.sent()).data.code&&this.throwWhenRequestFail)throw new Error(JSON.stringify({code:S.OPERATION_FAIL,msg:"[".concat(o.data.code,"] ").concat(o.data.message)}));return[2,o.data]}})})},e.prototype.gateWay=function(e,t){var n;return E(this,void 0,void 0,function(){var o,i,a,s,c,u,l,p,d,f,h,m,v,y,g,b,w,E,O;return I(this,function(I){switch(I.label){case 0:if(o=e.url,i=e.name,a=e.data,s=e.path,c=void 0===s?"":s,u=e.method,l=e.header,p=void 0===l?{}:l,!(i&&c||o))throw new Error(JSON.stringify({code:S.INVALID_PARAMS,msg:"[gateWay] invalid function name or path or url"}));try{d=a?JSON.stringify(a):""}catch(e){throw new Error(JSON.stringify({code:S.INVALID_PARAMS,msg:"[gateWay] invalid data"}))}if(f=r.P6.generateRequestId(),h=(0,x.vS)(this.config.env,"GATEWAY"),m=h.baseUrl,v=h.protocol,y="".concat(v).concat(m).concat(o||"/".concat(c,"/").concat(i)),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||{}}y="".concat(y).concat(y.includes("?")?"&":"?").concat(Object.keys(b).map(function(e){return"".concat(e,"=").concat(b[e])}).join("&"))}catch(e){}return[4,this.fetch(_(_({method:u||"POST",headers:_({"Content-Type":"application/json; charset=utf-8","X-Request-Id":f},p)},g?{}:{body:d}),{url:y,customReqOpts:t,shouldThrowOnError:this.throwWhenRequestFail}))];case 1:return w=I.sent(),E=[_({requestId:f},w)],O={},[4,w.data];case 2:return[2,_.apply(void 0,E.concat([(O.data=I.sent(),O)]))]}})})},e}(),j={};!function(e){e.ZH="zh-CN",e.EN="en-US"}(k||(k={}));var L=((N={})[k.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"},N),D=function(e,t){var n;return(null===(n=L[t])||void 0===n?void 0:n[e])||e},q=function(e,t){var n,o,i=function(e){return"lang_".concat(e.clientId||e.env)}(t),a=(e.adapter||{}).localStorage,s=t.lang||(null===(n=null==a?void 0:a.getItem)||void 0===n?void 0:n.call(a,i))||k.ZH;return null===(o=null==a?void 0:a.setItem)||void 0===o||o.call(a,i,s),new Proxy({t:function(e){return D(e,s)},LANG_HEADER_KEY:"Accept-Language",lang:s},{get:function(e,t){var n;return"lang"===t&&(null===(n=null==a?void 0:a.getItem)||void 0===n?void 0:n.call(a,i))||e[t]},set:function(e,t,n){var o;return"lang"===t&&n!==e[t]&&(e[t]=n,e.t=function(e){return D(e,n)},null===(o=null==a?void 0:a.setItem)||void 0===o||o.call(a,i,n),r.RR.$.fire(r.RR.P,{i18n:e})),e[t]=n,!0}})},M=__webpack_require__(3809),F=function(){return F=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},F.apply(this,arguments)},B=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},W=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},G=r.j$.Fk,V=r.j$.xY,H=r._G.Sg,z=r._G.vM,K=r.P6.printWarn,J=r.BM.D,Y={persistence:"local"},$=6e5,X={},Q=function(){function e(e){this.cloudbaseConfig=e||this.cloudbaseConfig,this.authInstance=null,this.oauthInstance=null,this.requestInstance=null,this.version=(0,x.mI)()}return Object.defineProperty(e.prototype,"config",{get:function(){return this.cloudbaseConfig},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"platform",{get:function(){return h},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cache",{get:function(){return e=this.cloudbaseConfig.env,y[e];var e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localCache",{get:function(){return w(this.cloudbaseConfig.env)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){return this.requestInstance||(e=this.cloudbaseConfig.env,j[e]);var e},enumerable:!1,configurable:!0}),e.prototype.init=function(t){var n,r,o,i,a;if(void 0===t&&(t={env:""}),t.endPointMode=t.endPointMode||"GATEWAY",h.adapter||this.useDefaultAdapter(),(t=this.dealNodeAdapterConfig(t)).throw=null===(r=null!==(n=t.throw)&&void 0!==n?n:t.throwOnCode)||void 0===r||r,delete t.throwOnCode,!t.env)throw new Error(JSON.stringify({code:H.INVALID_PARAMS,msg:"env must not be specified"}));this.isInitialized(t);var s=this.isNodeEnv()?void 0:15e3,c=t.timeout||s,u={env:t.env,region:t.region,accessKey:t.accessKey,context:t.context,auth:t.auth,timeout:c,timeoutMsg:c?"[".concat((0,x.eX)(),"][REQUEST TIMEOUT] request had been abort since didn't finished within").concat(c/1e3,"s"):void 0};this.requestClient=new h.adapter.reqClass(u),this.cloudbaseConfig=F(F(F({},Y),t),{timeout:c,i18n:q(h,t)}),(0,M.F)(this.cloudbaseConfig),delete this.cloudbaseConfig.lang,this.cloudbaseConfig.timeout=this.formatTimeout(this.cloudbaseConfig.timeout);var l=this.cloudbaseConfig,p=l.env,d=l.persistence,f=l.debug,m=l.timeout,v=l.oauthClient,y=l.i18n;b({env:p,persistence:d,debug:f,platformInfo:this.platform}),(0,x.R1)(p,t.region||""),(0,x.$R)(p,x.Bh,t.intl);var g=new e(this.cloudbaseConfig);return g.requestInstance=function(e){var t=new U(_(_({},e),{throw:e.throw}));return j[e.env]=t,t}({env:p,region:t.region||"",timeout:m,oauthClient:v,_fromApp:g,i18n:y,endPointMode:t.endPointMode,auth:t.auth,context:t.context,accessKey:t.accessKey,throw:t.throw}),g.requestClient=this.requestClient,null===(o=null==this?void 0:this.fire)||void 0===o||o.call(this,"cloudbase_init",g),this.try2InitAuth(g),(null===(i=h.adapter)||void 0===i?void 0:i.nodeTool)&&(null===(a=h.adapter)||void 0===a||a.nodeTool(g,this.cloudbaseConfig)),g},e.prototype.updateConfig=function(e){var t=e.persistence,n=e.debug;this.cloudbaseConfig.persistence=t,this.cloudbaseConfig.debug=n,b({env:this.cloudbaseConfig.env,persistence:t,debug:n,platformInfo:this.platform})},e.prototype.setThrowOnCode=function(e){this.cloudbaseConfig.throw=e},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){X[e.name]=e},e.prototype.invokeExtension=function(e,t){return n=this,r=void 0,i=function(){var n;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(r){switch(r.label){case 0:if(!(n=X[e]))throw new Error(JSON.stringify({code:H.INVALID_PARAMS,msg:"extension:".concat(e," must be registered before invoke")}));return[4,n.invoke(t,this)];case 1:return[2,r.sent()]}})},new((o=void 0)||(o=Promise))(function(e,t){function a(e){try{c(i.next(e))}catch(e){t(e)}}function s(e){try{c(i.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o(function(e){e(n)})).then(a,s)}c((i=i.apply(n,r||[])).next())});var n,r,o,i},e.prototype.useAdapters=function(e,t){var n=G(e,t)||{},r=n.adapter,o=n.runtime;r&&(h.adapter=r),o&&(h.runtime=o)},e.prototype.registerHook=function(t){!function(e,t){var n=t.entity,r=t.target;if(Object.prototype.hasOwnProperty.call(e,r))throw new Error(JSON.stringify({code:i.INVALID_OPERATION,msg:"target:".concat(r," is not exist")}));var a=e.prototype[r];if("function"!=typeof a)throw new Error(JSON.stringify({code:i.INVALID_OPERATION,msg:"target:".concat(r," is not a function which is the only type supports hook")}));e.prototype[r]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.call.apply(n,o([this],e,!1)),a.call.apply(a,o([this],e,!1))}}(e,t)},e.prototype.registerComponent=function(t){s(e,t)},e.prototype.registerVersion=function(e){(0,x.po)(e),this.version=e},e.prototype.registerSdkName=function(e){(0,x.tC)(e)},e.prototype.isInitialized=function(e){return void 0===e&&(e=this.cloudbaseConfig),"string"==typeof e.env&&["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()})&&K(H.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,x.Fy)({baseUrl:e,protocol:t,env:this.config.env,endPointKey:"CLOUD_API"})},e.prototype.registerEndPointWithKey=function(e){(0,x.Fy)({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,x.Fy)({baseUrl:"".concat(r,"/web"),protocol:t,env:this.config.env,endPointKey:"CLOUD_API"}),(0,x.Fy)({baseUrl:"".concat(r,"/v1"),protocol:t,env:this.config.env,endPointKey:"GATEWAY"})},e.prototype.getEndPointWithKey=function(e){var t=(0,x.vS)(this.config.env,e);return{BASE_URL:t.baseUrl,PROTOCOL:t.protocol}},e.prototype.parseCaptcha=function(e){return r.P6.parseCaptcha(e)},e.prototype.useDefaultAdapter=function(){var e=V.bind(this)(),t=e.adapter,n=e.runtime;h.adapter=t,h.runtime=n},e.prototype.isNodeEnv=function(){var e;return"undefined"!=typeof process&&void 0!==process.env&&!!(null===(e=h.adapter)||void 0===e?void 0:e.getSecretInfo)},e.prototype.formatTimeout=function(e){if(null==e)return e;switch(!0){case e>$:return K(H.INVALID_PARAMS,"timeout is greater than maximum value[10min]"),$;case e<100:return K(H.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,r,o,i;if(this.isNodeEnv()){var a=null===(t=h.adapter)||void 0===t?void 0:t.getSecretInfo(e);e.env&&"symbol"!=typeof e.env||(e.env=a.env),a.credentials&&(e.auth=F(F({},e.auth),{credentials:a.credentials}));var s=e,c=s.secretId||(null===(n=e.auth)||void 0===n?void 0:n.secretId),u=s.secretKey||(null===(r=e.auth)||void 0===r?void 0:r.secretKey);if(c&&u){var l=s.sessionToken||(null===(o=e.auth)||void 0===o?void 0:o.sessionToken)||"";e.auth=F(F({},e.auth),{secretId:c,secretKey:u,sessionToken:l,secretType:(null===(i=e.auth)||void 0===i?void 0:i.secretType)||(l?"SESSION_SECRET":"SECRET")})}}return e},B([J({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(z)]}),W("design:type",Function),W("design:paramtypes",[Object]),W("design:returntype",e)],e.prototype,"init",null),B([J({title:"调用扩展能力失败",messages:["请确认以下各项:"," 1 - 调用 invokeExtension() 的语法或参数是否正确"," 2 - 被调用的扩展能力是否已经安装并通过 registerExtension() 注册","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(z)]}),W("design:type",Function),W("design:paramtypes",[String,Object]),W("design:returntype",Promise)],e.prototype,"invokeExtension",null),e}(),Z=new Q,ee=void 0===u.WxRequest?null:(u.WxRequest.prototype.upload=function(e){var t=this,n=this;return new Promise(function(r){var o=e.url,i=e.file,a=e.data,s=e.headers,c=wx.getFileSystemManager(),u=wx.request({url:o,method:e.method,header:f({"content-type":" "},s),data:c.readFileSync(i),timeout:t._timeout,success:function(e){var t={statusCode:e.statusCode,data:e.data||{}};200===e.statusCode&&(null==a?void 0:a.success_action_status)&&(t.statusCode=parseInt(a.success_action_status,10)),r(t)},fail:function(e){r(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{u.abort()}catch(e){}}}})})},u.default.genAdapter=function(e){return{root:{globalThis:{}},reqClass:u.WxRequest,wsClass:u.WxMpWebSocket,captchaOptions:{openURIWithCallback:function(t){var n=e.EventBus,r={},o=t;console.log("openURIWithCallback",t);var i=t.match(/^(data:.*?)(\?[^#\s]*)?$/);if(i){o=i[1],console.log("openURIWithCallback url",o);var a=i[2];a&&(r=(0,u.parseQueryString)(a))}console.log("openURIWithCallback queryObj",r);var s=r.token,c=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}(r,["token"]);return/^data:/.test(o)&&!s?Promise.reject({error:"invalid_argument",error_description:"invalie captcha data: ".concat(t)}):s?new Promise(function(e){console.log("wait for captcha..."),n.$emit("CAPTCHA_DATA_CHANGE",f(f({},c),{token:s,url:o})),n.$once("RESOLVE_CAPTCHA_DATA",function(t){e(t)})}):Promise.reject({error:"unimplemented",error_description:"need to impl captcha data"})}},localStorage:u.wxMpStorage,primaryStorage:d.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:""}}},u.default);ee&&Z.useAdapters(ee);const te=Z;var ne,re,oe,ie,ae,se,ce="/auth";!function(e){e.AUTH_SIGN_UP_URL="/v1/signup",e.AUTH_TOKEN_URL="/v1/token",e.AUTH_REVOKE_URL="/v1/revoke",e.WEDA_USER_URL="/v1/plugin/weda/userinfo",e.AUTH_RESET_PASSWORD="/v1/reset",e.AUTH_GET_DEVICE_CODE="/v1/device/code",e.CHECK_USERNAME="/v1/checkUsername",e.CHECK_IF_USER_EXIST="/v1/checkIfUserExist",e.GET_PROVIDER_TYPE="/v1/mgr/provider/providerSubType",e.AUTH_SIGN_IN_URL="/v1/signin",e.AUTH_SIGN_IN_ANONYMOUSLY_URL="/v1/signin/anonymously",e.AUTH_SIGN_IN_WITH_PROVIDER_URL="/v1/signin/with/provider",e.AUTH_SIGN_IN_WITH_WECHAT_URL="/v1/signin/wechat/noauth",e.AUTH_SIGN_IN_CUSTOM="/v1/signin/custom",e.PROVIDER_TOKEN_URL="/v1/provider/token",e.PROVIDER_URI_URL="/v1/provider/uri",e.USER_ME_URL="/v1/user/me",e.AUTH_SIGNOUT_URL="/v1/user/signout",e.USER_QUERY_URL="/v1/user/query",e.USER_PRIFILE_URL="/v1/user/profile",e.USER_BASIC_EDIT_URL="/v1/user/basic/edit",e.USER_TRANS_BY_PROVIDER_URL="/v1/user/trans/by/provider",e.PROVIDER_LIST="/v1/user/provider",e.PROVIDER_BIND_URL="/v1/user/provider/bind",e.PROVIDER_UNBIND_URL="/v1/user/provider",e.CHECK_PWD_URL="/v1/user/sudo",e.SUDO_URL="/v1/user/sudo",e.BIND_CONTACT_URL="/v1/user/contact",e.AUTH_SET_PASSWORD="/v1/user/password",e.AUTHORIZE_DEVICE_URL="/v1/user/device/authorize",e.AUTHORIZE_URL="/v1/user/authorize",e.AUTHORIZE_INFO_URL="/v1/user/authorize/info",e.AUTHORIZED_DEVICES_DELETE_URL="/v1/user/authorized/devices/",e.AUTH_REVOKE_ALL_URL="/v1/user/revoke/all",e.GET_USER_BEHAVIOR_LOG="/v1/user/security/history",e.VERIFICATION_URL="/v1/verification",e.VERIFY_URL="/v1/verification/verify",e.CAPTCHA_DATA_URL="/v1/captcha/data",e.VERIFY_CAPTCHA_DATA_URL="/v1/captcha/data/verify",e.GET_CAPTCHA_URL="/v1/captcha/init",e.GET_MINIPROGRAM_QRCODE="/v1/qrcode/generate",e.GET_MINIPROGRAM_QRCODE_STATUS="/v1/qrcode/get/status"}(ne||(ne={})),function(e){e.AUTH_SIGN_IN_URL="/v2/signin/username",e.AUTH_TOKEN_URL="/v2/token",e.USER_ME_URL="/v2/user/me",e.VERIFY_URL="/v2/signin/verificationcode",e.AUTH_SIGN_IN_WITH_PROVIDER_URL="/v2/signin/with/provider",e.AUTH_PUBLIC_KEY="/v2/signin/publichkey",e.AUTH_RESET_PASSWORD="/v2/signin/password/update"}(re||(re={})),function(e){e.REGISTER="REGISTER",e.SIGN_IN="SIGN_IN",e.PASSWORD_RESET="PASSWORD_RESET",e.EMAIL_ADDRESS_CHANGE="EMAIL_ADDRESS_CHANGE",e.PHONE_NUMBER_CHANGE="PHONE_NUMBER_CHANGE"}(oe||(oe={})),(se=ie||(ie={})).UNREACHABLE="unreachable",se.LOCAL="local",se.CANCELLED="cancelled",se.UNKNOWN="unknown",se.UNAUTHENTICATED="unauthenticated",se.RESOURCE_EXHAUSTED="resource_exhausted",se.FAILED_PRECONDITION="failed_precondition",se.INVALID_ARGUMENT="invalid_argument",se.DEADLINE_EXCEEDED="deadline_exceeded",se.NOT_FOUND="not_found",se.ALREADY_EXISTS="already_exists",se.PERMISSION_DENIED="permission_denied",se.ABORTED="aborted",se.OUT_OF_RANGE="out_of_range",se.UNIMPLEMENTED="unimplemented",se.INTERNAL="internal",se.UNAVAILABLE="unavailable",se.DATA_LOSS="data_loss",se.INVALID_PASSWORD="invalid_password",se.PASSWORD_NOT_SET="password_not_set",se.INVALID_STATUS="invalid_status",se.USER_PENDING="user_pending",se.USER_BLOCKED="user_blocked",se.INVALID_VERIFICATION_CODE="invalid_verification_code",se.TWO_FACTOR_REQUIRED="two_factor_required",se.INVALID_TWO_FACTOR="invalid_two_factor",se.INVALID_TWO_FACTOR_RECOVERY="invalid_two_factor_recovery",se.UNDER_REVIEW="under_review",se.INVALID_REQUEST="invalid_request",se.UNAUTHORIZED_CLIENT="unauthorized_client",se.ACCESS_DENIED="access_denied",se.UNSUPPORTED_RESPONSE_TYPE="unsupported_response_type",se.INVALID_SCOPE="invalid_scope",se.INVALID_GRANT="invalid_grant",se.SERVER_ERROR="server_error",se.TEMPORARILY_UNAVAILABLE="temporarily_unavailable",se.INTERACTION_REQUIRED="interaction_required",se.LOGIN_REQUIRED="login_required",se.ACCOUNT_SELECTION_REQUIRED="account_selection_required",se.CONSENT_REQUIRED="consent_required",se.INVALID_REQUEST_URI="invalid_request_uri",se.INVALID_REQUEST_OBJECT="invalid_request_object",se.REQUEST_NOT_SUPPORTED="request_not_supported",se.REQUEST_URI_NOT_SUPPORTED="request_uri_not_supported",se.REGISTRATION_NOT_SUPPORTED="registration_not_supported",se.CAPTCHA_REQUIRED="captcha_required",se.CAPTCHA_INVALID="captcha_invalid",se.PROVIDER_NOT_ENABLED="provider_not_enabled",se.LOGIN_METHOD_DISABLED="login_method_disabled",se.INVALID_USERNAME_OR_PASSWORD="invalid_username_or_password",se.INVALID_CREDENTIALS="invalid_credentials",se.WRONG_PASSWORD="wrong_password",se.USER_NOT_FOUND="user_not_found",se.MFA_PHONE_REQUIRED="mfa_phone_required",se.LOGIN_TYPE_DISABLED="login_type_disabled",se.PROVIDER_ERROR="provider_error",se.MISSING_REQUIRED_PARAM="missing_required_param",function(e){e[e.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",e[e.NOT_FOUND=5]="NOT_FOUND",e[e.PERMISSION_DENIED=7]="PERMISSION_DENIED",e[e.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",e[e.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",e[e.ABORTED=10]="ABORTED",e[e.UNIMPLEMENTED=12]="UNIMPLEMENTED",e[e.INTERNAL=13]="INTERNAL",e[e.UNAVAILABLE=14]="UNAVAILABLE",e[e.UNAUTHENTICATED=16]="UNAUTHENTICATED",e[e.MISSING_REQUIRED_PARAM=4e3]="MISSING_REQUIRED_PARAM",e[e.CAPTCHA_REQUIRED=4001]="CAPTCHA_REQUIRED",e[e.CAPTCHA_INVALID=4002]="CAPTCHA_INVALID",e[e.PROVIDER_ERROR=4019]="PROVIDER_ERROR",e[e.UNAUTHORIZED_CLIENT=4022]="UNAUTHORIZED_CLIENT",e[e.MFA_PHONE_REQUIRED=4042]="MFA_PHONE_REQUIRED",e[e.LOGIN_TYPE_DISABLED=4045]="LOGIN_TYPE_DISABLED"}(ae||(ae={}));var ue,le,pe="credentials_error",de="SIGNED_OUT",fe="SIGNED_IN",he="INITIAL_SESSION",me="TOKEN_REFRESHED",ve="USER_UPDATED",ye="BIND_IDENTITY",ge="loginStateChanged",be="authStateChanged",we="sign_in",xe="bind_identity",_e="node-sdk-scope";function Ee(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}!function(e){e.EMAIL="email",e.RECOVERY="recovery",e.REAUTHENTICATION="reauthentication"}(ue||(ue={})),function(e){e.CLIENT_ID="client_id",e.CLIENT_SECRET="client_secret",e.RESPONSE_TYPE="response_type",e.SCOPE="scope",e.STATE="state",e.REDIRECT_URI="redirect_uri",e.ERROR="error",e.ERROR_DESCRIPTION="error_description",e.ERROR_URI="error_uri",e.GRANT_TYPE="grant_type",e.CODE="code",e.ACCESS_TOKEN="access_token",e.TOKEN_TYPE="token_type",e.EXPIRES_IN="expires_in",e.USERNAME="username",e.PASSWORD="password",e.REFRESH_TOKEN="refresh_token"}(le||(le={}));var Ie=__webpack_require__(2631),Se=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())})},Oe=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])}}},Ae=new Map,Te=function(){function e(e){this.clientId=(null==e?void 0:e.clientId)||"",this.getScope=null==e?void 0:e.getScope,Ae=Ae||new Map}return e.prototype.run=function(e,t){return Se(this,void 0,Promise,function(){var n,r,o=this;return Oe(this,function(i){return n=this.getScope?this.getScope():this.clientId,e="".concat(n,"_").concat(e),(r=Ae.get(e))||(r=new Promise(function(n,r){Se(o,void 0,void 0,function(){var o,i,a;return Oe(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,4,5]),[4,this.runIdlePromise()];case 1:return s.sent(),o=t(),i=n,[4,o];case 2:return i.apply(void 0,[s.sent()]),[3,5];case 3:return a=s.sent(),r(a),[3,5];case 4:return Ae.delete(e),[7];case 5:return[2]}})})}),Ae.set(e,r)),[2,r]})})},e.prototype.runIdlePromise=function(){return Promise.resolve()},e}(),Pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Re=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/,Ce=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!Re.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 n,r,o="",i=0;i<e.length;)t=Pe.indexOf(e.charAt(i++))<<18|Pe.indexOf(e.charAt(i++))<<12|(n=Pe.indexOf(e.charAt(i++)))<<6|(r=Pe.indexOf(e.charAt(i++))),o+=64===n?String.fromCharCode(t>>16&255):64===r?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o};function Ne(){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}var ke=!1;function Ue(){ke=ke||void 0!==typeof window&&"miniprogram"===window.__wxjs_environment}try{Ne()||(ke=ke||!!navigator.userAgent.match(/miniprogram/i)||"miniprogram"===window.__wxjs_environment,window&&window.WeixinJSBridge&&window.WeixinJSBridge.invoke?Ue():"undefined"!=typeof document&&document.addEventListener("WeixinJSBridgeReady",Ue,!1))}catch(e){}var je=function(){return je=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},je.apply(this,arguments)},Le=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())})},De=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])}}},qe=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))},Me="x-request-id",Fe="x-device-id",Be="device_id",We=function(e,t){return Le(this,void 0,Promise,function(){var n,r,o,i,a;return De(this,function(s){switch(s.label){case 0:n=null,r=null,s.label=1;case 1:return s.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,s.sent().json()];case 3:return(null==(i=s.sent())?void 0:i.error)?(r=i).error_uri=new URL(e).pathname:n=i,[3,5];case 4:return a=s.sent(),r={error:ie.UNREACHABLE,error_description:a.message,error_uri:new URL(e).pathname},[3,5];case 5:if(r)throw r;return[2,n]}})})},Ge=function(){function e(e){this._env=(null==e?void 0:e.env)||""}return e.prototype.getItem=function(e){return Le(this,void 0,Promise,function(){return De(this,function(t){return[2,window.localStorage.getItem("".concat(e).concat(this._env))]})})},e.prototype.removeItem=function(e){return Le(this,void 0,Promise,function(){return De(this,function(t){return window.localStorage.removeItem("".concat(e).concat(this._env)),[2]})})},e.prototype.setItem=function(e,t){return Le(this,void 0,Promise,function(){return De(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}(),Ve=new Ge,He=function(){function e(e){var t=this;this.credentials=null,this.accessKeyCredentials=null,this.singlePromise=null,this.tokenSectionName=e.tokenSectionName,this.storage=e.storage,this.clientId=e.clientId,this.singlePromise=new Te({clientId:this.clientId,getScope:function(){var e;return(null===(e=t.accessKeyCredentials)||void 0===e?void 0:e.access_token)?"".concat(t.clientId,"_").concat(t.accessKeyCredentials.access_token):t.clientId}}),this.credentials=e.credentials||null,this.onCredentialsChange=e.onCredentialsChange}return e.prototype.syncMemoryCredentials=function(e){this.credentials=e},e.prototype.getMemoryCredentials=function(){return this.credentials},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,t){var n;return Le(this,void 0,Promise,function(){var r,o;return De(this,function(i){switch(i.label){case 0:return r=!(!this.credentials||!this.credentials.access_token),(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?(o=JSON.stringify(e),[4,this.storage.setItem(this.tokenSectionName,o)]):[3,2]):[3,3];case 1:i.sent(),i.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:i.sent(),i.label=5;case 5:this.credentials=null,i.label=6;case 6:return this.onCredentialsChange&&this.onCredentialsChange(e||null,{isInit:null!==(n=null==t?void 0:t.isInit)&&void 0!==n&&n,hadCredentials:r}),[2]}})})},e.prototype.setAccessKeyCredentials=function(e){this.accessKeyCredentials=e,e.scope===_e&&(this.credentials=e)},e.prototype.getCredentials=function(){return Le(this,void 0,Promise,function(){var e=this;return De(this,function(t){return[2,this.singlePromise.run("getCredentials",function(){return Le(e,void 0,void 0,function(){var e,t;return De(this,function(n){switch(n.label){case 0:return[4,this.getStorageCredentials()];case 1:return e=n.sent(),t=e.credentials,e.isAccessKeyCredentials?[2,t]:(this.credentials=t,[2,this.credentials])}})})})]})})},e.prototype.getStorageCredentials=function(){return Le(this,void 0,Promise,function(){var e=this;return De(this,function(t){return[2,this.singlePromise.run("_getStorageCredentials",function(){return Le(e,void 0,void 0,function(){var e,t,n;return De(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}(),ze=function(){function e(t){var n,o=this;this.initializePromise=null,this.lockAcquired=!1,this.pendingInLock=[],this.singlePromise=null,this._initSessionEmitted=!1,t.clientSecret||(t.clientSecret=""),!t.clientId&&t.env&&(t.clientId=t.env),this.apiOrigin=t.apiOrigin,this.getApiOriginFunc=t.getApiOrigin,this.apiPath=t.apiPath||ce,this.clientId=t.clientId,this.i18n=t.i18n,this.eventBus=t.eventBus,this.singlePromise=new Te({clientId:this.clientId}),this.retry=this.formatRetry(t.retry,e.defaultRetry),t.baseRequest?this.baseRequest=t.baseRequest:this.baseRequest=We,this.tokenInURL=t.tokenInURL,this.headers=t.headers,this.storage=t.storage||Ve,this.localCredentials=new He({tokenSectionName:"credentials_".concat(t.clientId),storage:this.storage,clientId:t.clientId,onCredentialsChange:this._handleCredentialsChange.bind(this)}),this.clientSecret=t.clientSecret,t.clientId&&(this.basicAuth="Basic ".concat(function(e){for(var t,n,r,o,i="",a=0,s=(e=String(e)).length%3;a<e.length;){if((n=e.charCodeAt(a++))>255||(r=e.charCodeAt(a++))>255||(o=e.charCodeAt(a++))>255)throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");i+=Pe.charAt((t=n<<16|r<<8|o)>>18&63)+Pe.charAt(t>>12&63)+Pe.charAt(t>>6&63)+Pe.charAt(63&t)}return s?i.slice(0,s-3)+"===".substring(s):i}("".concat(t.clientId,":").concat(this.clientSecret)))),this.wxCloud=t.wxCloud;try{Ne()&&(this.useWxCloud=t.useWxCloud,void 0===this.wxCloud&&t.env&&(wx.cloud.init({env:t.env}),this.wxCloud=wx.cloud))}catch(e){}this.refreshTokenFunc=t.refreshTokenFunc||this.defaultRefreshTokenFunc,this.anonymousSignInFunc=t.anonymousSignInFunc,this.onCredentialsError=t.onCredentialsError,this.getInitialSession=t.getInitialSession,this.onInitialSessionObtained=t.onInitialSessionObtained,this.logDebugMessages=null!==(n=t.debug)&&void 0!==n&&n,r.RR.$.on(r.RR.P,function(e){var t;o.i18n=(null===(t=e.data)||void 0===t?void 0:t.i18n)||o.i18n}),this._initBroadcastChannel(),this._initVisibilityListener()}return e.prototype.setGetInitialSession=function(e){this.getInitialSession=e},e.prototype.setOnInitialSessionObtained=function(e){this.onInitialSessionObtained=e},e.prototype.initialize=function(e){return Le(this,void 0,Promise,function(){var t=this;return De(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=Le(t,void 0,void 0,function(){var e=this;return De(this,function(t){switch(t.label){case 0:return[4,this._acquireLock(-1,function(){return Le(e,void 0,void 0,function(){return De(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 Le(this,void 0,Promise,function(){var t=this;return De(this,function(n){switch(n.label){case 0:return[4,this.initializePromise];case 1:return n.sent(),[2,this._acquireLock(-1,function(){return Le(t,void 0,void 0,function(){return De(this,function(t){return[2,this.localCredentials.setCredentials(e)]})})})]}})})},Object.defineProperty(e.prototype,"initSessionEmitted",{get:function(){return this._initSessionEmitted},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){try{this.broadcastChannel&&"function"==typeof this.broadcastChannel.close&&this.broadcastChannel.close()}catch(e){this._debug("#destroy","close BroadcastChannel error",e)}finally{this.broadcastChannel=null}try{var e=this.visibilityEventHandler;this.visibilityEventHandler=void 0,e&&"undefined"!=typeof window&&"undefined"!=typeof document&&"function"==typeof window.removeEventListener&&window.removeEventListener("visibilitychange",e)}catch(e){this._debug("#destroy","remove visibility listener error",e)}},e.prototype.setAccessKeyCredentials=function(e){return this.localCredentials.setAccessKeyCredentials(e)},e.prototype.getAccessToken=function(){return Le(this,void 0,Promise,function(){var e,t;return De(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)===_e||(null==e?void 0:e.access_token)?[2,Promise.resolve(e.access_token)]:(t={error:ie.UNAUTHENTICATED},[2,Promise.reject(t)])}})})},e.prototype.request=function(t,n){var r,o;return Le(this,void 0,Promise,function(){var i,a,s,c,u,l,p,d,f,h;return De(this,function(m){switch(m.label){case 0:return n||(n={}),i=this.formatRetry(n.retry,this.retry),n.headers=je(je({},n.headers),((h={})[null===(r=this.i18n)||void 0===r?void 0:r.LANG_HEADER_KEY]=null===(o=this.i18n)||void 0===o?void 0:o.lang,h)),this.headers&&(n.headers=je(je({},this.headers),n.headers)),n.headers[Me]||(n.headers[Me]=Ee()),n.headers[Fe]?[3,2]:[4,this.getDeviceId()];case 1:a=m.sent(),n.headers[Fe]=a,m.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 c=m.sent(),[3,6];case 4:return[4,this.getCredentials()];case 5:c=m.sent(),m.label=6;case 6:return(s=c)&&(this.tokenInURL?(t.indexOf("?")<0&&(t+="?"),t+="access_token=".concat(s.access_token)):n.headers.Authorization="".concat(s.token_type," ").concat(s.access_token)),[3,8];case 7:this.clientId&&t.indexOf("client_id")<0&&(t+=t.indexOf("?")<0?"?":"&",t+="client_id=".concat(this.clientId)),m.label=8;case 8:t.startsWith("/")&&(u=this.getApiOriginFunc?this.getApiOriginFunc():this.apiOrigin,t="".concat(u).concat(this.apiPath).concat(t)),l=null,p=i+1,d=0,m.label=9;case 9:if(!(d<p))return[3,21];m.label=10;case 10:return m.trys.push([10,15,,18]),n.useWxCloud||this.useWxCloud?[4,this.wxCloudCallFunction(t,n)]:[3,12];case 11:return l=m.sent(),[3,14];case 12:return[4,this.baseRequest(t,n)];case 13:l=m.sent(),m.label=14;case 14:if(null==l?void 0:l.code)throw{error:l.code,error_description:l.message,error_uri:new URL(t).pathname};return[3,21];case 15:f=m.sent();try{f.requestId=f.requestId||n.headers[Me]||""}catch(e){}return n.withCredentials&&f&&f.error===ie.UNAUTHENTICATED?[4,this.setCredentials(null)]:[3,17];case 16:return m.sent(),[2,Promise.reject(f)];case 17:return d!==i&&f&&"unreachable"===f.error?[3,18]:[2,Promise.reject(f)];case 18:return[4,this.sleep(e.retryInterval)];case 19:m.sent(),m.label=20;case 20:return d++,[3,9];case 21:return[2,l]}})})},e.prototype.wxCloudCallFunction=function(e,t){var n;return Le(this,void 0,Promise,function(){var r,o,i,a,s;return De(this,function(c){switch(c.label){case 0:r=null,o=null,c.label=1;case 1:c.trys.push([1,7,,8]),i="",c.label=2;case 2:return c.trys.push([2,4,,5]),[4,wx.getRendererUserAgent()];case 3:return i=c.sent(),[3,5];case 4:return c.sent(),[3,5];case 5:return[4,this.wxCloud.callFunction({name:"httpOverCallFunction",data:{url:e,method:t.method,headers:je({origin:"https://servicewechat.com","User-Agent":i},t.headers),body:t.body}})];case 6:return a=c.sent().result,(null===(n=null==a?void 0:a.body)||void 0===n?void 0:n.error_code)?(o=null==a?void 0:a.body).error_uri=(0,Ie.y)(e):r=null==a?void 0:a.body,[3,8];case 7:return s=c.sent(),o={error:ie.UNREACHABLE,error_description:s.message,error_uri:(0,Ie.y)(e)},[3,8];case 8:if(o)throw o;return[2,r]}})})},e.prototype.getCredentials=function(){return Le(this,void 0,Promise,function(){var e=this;return De(this,function(t){switch(t.label){case 0:return[4,this.initializePromise];case 1:return t.sent(),[2,this._acquireLock(-1,function(){return Le(e,void 0,void 0,function(){return De(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 Le(this,void 0,Promise,function(){var t,n;return De(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 Le(this,void 0,Promise,function(){var t,n;return De(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 Le(this,void 0,Promise,function(){var n=this;return De(this,function(r){switch(r.label){case 0:return[4,this.initializePromise];case 1:return r.sent(),[2,this._acquireLock(-1,function(){return Le(n,void 0,void 0,function(){return De(this,function(n){return[2,this._refreshToken(e,t)]})})})]}})})},e.prototype._refreshToken=function(e,t){return Le(this,void 0,Promise,function(){var n=this;return De(this,function(r){return[2,this.singlePromise.run("_refreshToken",function(){return Le(n,void 0,void 0,function(){var n,r,o,i,a,s;return De(this,function(c){switch(c.label){case 0:if((null==e?void 0:e.scope)===_e)return[2,e];if(!e||!e.refresh_token)return o="no refresh token found in credentials",null===(i=this.onCredentialsError)||void 0===i||i.call(this,{msg:o}),[2,this.unAuthenticatedError(o)];c.label=1;case 1:return c.trys.push([1,4,,7]),[4,this.refreshTokenFunc(e.refresh_token,e)];case 2:return n=c.sent(),[4,this.localCredentials.setCredentials(n)];case 3:return c.sent(),[2,n];case 4:if(r=c.sent(),null==t?void 0:t.throwError)throw r;return r.error!==ie.INVALID_GRANT?[3,6]:[4,this.localCredentials.setCredentials(null)];case 5:return c.sent(),o=r.error_description,null===(a=this.onCredentialsError)||void 0===a||a.call(this,{msg:o}),[2,this.unAuthenticatedError(o)];case 6:return null===(s=this.onCredentialsError)||void 0===s||s.call(this,{msg:r.error_description}),[2,Promise.reject(r)];case 7:return[2]}})})})]})})},e.prototype.anonymousLogin=function(e){return Le(this,void 0,void 0,function(){var t=this;return De(this,function(n){return[2,this.singlePromise.run("_anonymousLogin",function(){return Le(t,void 0,void 0,function(){var t,n;return De(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:ie.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 Le(this,void 0,Promise,function(){return De(this,function(t){return[2,new Promise(function(t){setTimeout(function(){t()},e)})]})})},e.prototype.anonymousSignIn=function(e){return Le(this,void 0,Promise,function(){var t=this;return De(this,function(n){return[2,this.singlePromise.run("_anonymous",function(){return Le(t,void 0,void 0,function(){var t,n;return De(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(ne.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!==ie.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 Le(this,void 0,Promise,function(){var r,o,i;return De(this,function(a){switch(a.label){case 0:return void 0===e||""===e?(r="refresh token not found",null===(n=this.onCredentialsError)||void 0===n||n.call(this,{msg:r}),[2,this.unAuthenticatedError(r)]):(o=ne.AUTH_TOKEN_URL,"v2"===(null==t?void 0:t.version)&&(o=re.AUTH_TOKEN_URL),[4,this.request(o,{method:"POST",body:{client_id:this.clientId,client_secret:this.clientSecret,grant_type:"refresh_token",refresh_token:e}})]);case 1:return i=a.sent(),[2,je(je({},i),{version:(null==t?void 0:t.version)||"v1"})]}})})},e.prototype.getDeviceId=function(){return Le(this,void 0,Promise,function(){var e;return De(this,function(t){switch(t.label){case 0:return this.deviceID?[2,this.deviceID]:[4,this.storage.getItem(Be)];case 1:return"string"==typeof(e=t.sent())&&e.length>=16&&e.length<=48?[3,3]:(e=Ee(),[4,this.storage.setItem(Be,e)]);case 2:t.sent(),t.label=3;case 3:return this.deviceID=e,[2,e]}})})},e.prototype.unAuthenticatedError=function(e){var t={error:ie.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,qe(["[OAuth2Client]"],e,!1))},e.prototype._initialize=function(){return Le(this,void 0,Promise,function(){var e,t,n,r,o,i;return De(this,function(a){switch(a.label){case 0:if(a.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"),a.label=1;case 1:return a.trys.push([1,9,,10]),[4,this.getInitialSession()];case 2:return i=a.sent(),e=i.data,t=i.error,(null==e?void 0:e.session)?(this._debug("#_initialize()","session obtained from getInitialSession",e.session),this._initSessionEmitted=!0,[4,this.localCredentials.setCredentials(null==e?void 0:e.session,{isInit:!0})]):[3,4];case 3:a.sent(),a.label=4;case 4:if(!this.onInitialSessionObtained)return[3,8];this._debug("#_initialize()","calling onInitialSessionObtained callback"),a.label=5;case 5:return a.trys.push([5,7,,8]),[4,this.onInitialSessionObtained(e,t)];case 6:return a.sent(),[3,8];case 7:return n=a.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=a.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=a.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 Le(this,void 0,Promise,function(){var n,r,o,i,a=this;return De(this,function(s){switch(s.label){case 0:this._debug("#_acquireLock","begin",e),s.label=1;case 1:if(s.trys.push([1,,10,11]),this.lockAcquired)return n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),r=Le(a,void 0,void 0,function(){return De(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(Le(a,void 0,void 0,function(){return De(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),s.label=2;case 2:return s.trys.push([2,,8,9]),this.lockAcquired=!0,o=t(),this.pendingInLock.push(Le(a,void 0,void 0,function(){return De(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,o];case 1:case 2:return e.sent(),[3,3];case 3:return[2]}})})),[4,o];case 3:s.sent(),s.label=4;case 4:return this.pendingInLock.length?(i=qe([],this.pendingInLock,!0),[4,Promise.all(i)]):[3,6];case 5:return s.sent(),this.pendingInLock.splice(0,i.length),[3,4];case 6:return[4,o];case 7:return[2,s.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 Le(this,void 0,Promise,function(){var r,o,i;return De(this,function(a){switch(a.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:if((null==(r=a.sent())?void 0:r.scope)===_e)return[2,r];if(!r)return i="credentials not found",null===(e=this.onCredentialsError)||void 0===e||e.call(this,{msg:i}),[2,this.unAuthenticatedError(i)];if(!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}(r))return[3,12];if(!r.refresh_token)return[3,9];a.label=2;case 2:return a.trys.push([2,4,,8]),[4,this._refreshToken(r)];case 3:return r=a.sent(),[3,8];case 4:return o=a.sent(),"anonymous"!==r.scope?[3,6]:[4,this.anonymousLogin(r)];case 5:return r=a.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=a.sent(),[3,12];case 11:return i="no refresh token found in credentials",null===(n=this.onCredentialsError)||void 0===n||n.call(this,{msg:i}),[2,this.unAuthenticatedError(i)];case 12:return[2,r]}})})},e.prototype._isUserCredentials=function(e){return!!(null==e?void 0:e.access_token)&&"accessKey"!==e.scope&&e.scope!==_e},e.prototype._fireCredentialsEvents=function(e,t,n){var r,o,i,a,s,c;this._isUserCredentials(e)?t?null===(i=this.eventBus)||void 0===i||i.fire(be,{event:he}):n?null===(a=this.eventBus)||void 0===a||a.fire(be,{event:me}):(null===(s=this.eventBus)||void 0===s||s.fire(be,{event:fe}),null===(c=this.eventBus)||void 0===c||c.fire(ge,{eventType:"sign_in"})):n&&(null===(r=this.eventBus)||void 0===r||r.fire(be,{event:de}),null===(o=this.eventBus)||void 0===o||o.fire(ge,{eventType:"sign_out"}))},e.prototype._handleCredentialsChange=function(e,t){this._fireCredentialsEvents(e,t.isInit,t.hadCredentials),this._broadcastCredentials(e,t)},e.prototype._initBroadcastChannel=function(){var e=this;if(void 0===this.broadcastChannel)try{"undefined"!=typeof BroadcastChannel&&(this.broadcastChannelName="credentials_".concat(this.clientId),this.broadcastChannel=new BroadcastChannel(this.broadcastChannelName),this.broadcastChannel.addEventListener("message",function(t){e._handleBroadcastMessage(t.data)}),this._debug("#_initBroadcastChannel","channel created: ".concat(this.broadcastChannelName)))}catch(e){this.broadcastChannel=null,this._debug("#_initBroadcastChannel","BroadcastChannel not available, skip",e)}},e.prototype._broadcastCredentials=function(e,t){if(this.broadcastChannel)try{this.broadcastChannel.postMessage({type:"credentials_changed",credentials:e,context:t})}catch(e){this._debug("#_broadcastCredentials","postMessage error",e)}},e.prototype._handleBroadcastMessage=function(e){var t,n;try{if(!e||"credentials_changed"!==e.type)return;var r=e.context,o=e.credentials;if((null==o?void 0:o.expires_at)&&"string"==typeof o.expires_at&&(o=je(je({},o),{expires_at:new Date(o.expires_at)})),(null==o?void 0:o.access_token)===(null===(t=this.localCredentials.getMemoryCredentials())||void 0===t?void 0:t.access_token))return;var i=!!(null===(n=this.localCredentials.getMemoryCredentials())||void 0===n?void 0:n.access_token);this.localCredentials.syncMemoryCredentials(o),this._fireCredentialsEvents(o,r.isInit,i)}catch(e){this._debug("#_handleBroadcastMessage","error",e)}},e.prototype._initVisibilityListener=function(){var e=this;try{if("undefined"==typeof window||"undefined"==typeof document||"function"!=typeof window.addEventListener)return;this.visibilityEventHandler=function(){return Le(e,void 0,void 0,function(){var e;return De(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this._onVisibilityChanged()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),this._debug("#visibilityChangedCallback","error",e),[3,3];case 3:return[2]}})})},window.addEventListener("visibilitychange",this.visibilityEventHandler)}catch(e){this._debug("#_initVisibilityListener",e)}},e.prototype._onVisibilityChanged=function(){return Le(this,void 0,Promise,function(){var e=this;return De(this,function(t){return"visible"!==document.visibilityState||this._acquireLock(-1,function(){return Le(e,void 0,void 0,function(){var e,t,n,r,o,i;return De(this,function(a){switch(a.label){case 0:if("visible"!==document.visibilityState)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),e=this.localCredentials.getMemoryCredentials(),[4,this.localCredentials.getCredentials()];case 2:return t=a.sent(),n=null==e?void 0:e.access_token,r=null==t?void 0:t.access_token,n===r?[2]:(o=!!n,this._fireCredentialsEvents(t,!1,o),[3,4]);case 3:return i=a.sent(),this._debug("#_onVisibilityChanged","reload credentials error",i),[3,4];case 4:return[2]}})})}),[2]})})},e.defaultRetry=2,e.minRetry=0,e.maxRetry=5,e.retryInterval=1e3,e}(),Ke=__webpack_require__(9689),Je=__webpack_require__(3616),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,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())})},Xe=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])}}},Qe=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)}},Ze=new Ke.CloudbaseEventEmitter,et="resolveCaptchaData",tt="padding:10px 8px;background:#007bff;color:#fff;border:none;border-radius:4px;cursor:pointer;flex:1;white-space:nowrap;margin-left:10px",nt="width:100%;padding:10px;background:#007bff;color:#fff;border:none;border-radius:4px;cursor:pointer",rt="background:#6c757d;cursor:not-allowed",ot=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())})},it=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])}}},at=function(){function e(e){e.openURIWithCallback||(e.openURIWithCallback=this.getDefaultOpenURIWithCallback()),e.storage||(e.storage=Ve),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))||Ne()},e.prototype.request=function(e,t){return ot(this,void 0,Promise,function(){var n,r,o,i;return it(this,function(a){switch(a.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=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,7]),[4,this.config.request(r,t)];case 3:return o=a.sent(),[3,7];case 4:return(i=a.sent()).error!==ie.CAPTCHA_REQUIRED&&i.error!==ie.CAPTCHA_INVALID?[3,6]:[4,this.appendCaptchaTokenToURL(e,n,i.error===ie.CAPTCHA_INVALID)];case 5:return e=a.sent(),[2,this.config.request(e,t)];case 6:return[2,Promise.reject(i)];case 7:return[2,o]}})})},e.prototype.getDefaultOpenURIWithCallback=function(){var e=this;return function(t){return function(e,t){return $e(void 0,void 0,Promise,function(){var n,r,o,i;return Xe(this,function(a){return n=(0,Je.parseCaptcha)(e),r=n.captchaData,o=n.state,i=n.token,function(e){var t=e.oauthInstance,n=e.captchaState,r="captcha-image",o=function(){return $e(void 0,void 0,void 0,function(){var e,o;return Xe(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=Ye(Ye({},n),{captchaData:e.data,token:e.token}),document.getElementById(r).src=e.data,[3,3];case 2:return o=i.sent(),console.error("刷新图形验证码失败",o),[3,3];case 3:return[2]}})})},i=function(e,t,n){var r=document.createElement(e);return t&&(r.style.cssText=t),n&&(r.textContent=n),r},a=i("div","position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.5);z-index:999"),s=i("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");s.appendChild(i("p","margin-bottom:15px","请输入你看到的字符:"));var c=i("div","display:flex;align-items:center;justify-content:space-between;margin-bottom:15px"),u=i("img","width:100%;height:auto;border:1px solid #eee");u.id=r,u.src=n.captchaData,c.appendChild(u);var l=i("button",tt,"刷新");l.onclick=Qe(function(){return $e(void 0,void 0,void 0,function(){return Xe(this,function(e){switch(e.label){case 0:l.textContent="加载中...",l.disabled=!0,l.style.cssText="".concat(tt,";").concat(rt),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,o()];case 2:return e.sent(),[3,4];case 3:return l.textContent="刷新",l.disabled=!1,l.style.cssText=tt,[7];case 4:return[2]}})})},500),c.appendChild(l),s.appendChild(c);var p=i("input","width:100%;padding:14px 16px;margin-bottom:15px;box-sizing:border-box;border:2px solid #e8ecf4;border-radius:10px;font-size:15px");p.type="text",p.placeholder="输入字符",p.maxLength=4,s.appendChild(p);var d=i("div","color:#dc3545;font-size:12px;margin-bottom:10px;display:none;padding:8px;background:#f8d7da;border:1px solid #f5c6cb;border-radius:4px");s.appendChild(d);var f=function(e){d.textContent=e,d.style.display="block"},h=i("button",nt,"确定");h.onclick=Qe(function(){return $e(void 0,void 0,void 0,function(){var e,r,i,c;return Xe(this,function(u){switch(u.label){case 0:if(!(e=p.value.trim()))return f("请输入字符"),[2];d.style.display="none",h.textContent="验证中...",h.disabled=!0,h.style.cssText="".concat(nt,";").concat(rt),u.label=1;case 1:return u.trys.push([1,3,5,6]),[4,t.verifyCaptchaData({token:n.token,key:e})];case 2:return r=u.sent(),Ze.fire(et,r),console.log("图形验证码校验成功"),document.body.removeChild(a),document.body.removeChild(s),[3,6];case 3:return i=u.sent(),console.error("图形验证码校验失败",i),c=i.error_description||"图形验证码校验失败",f(c),p.value="",p.focus(),[4,o()];case 4:return u.sent(),[3,6];case 5:return h.textContent="确定",h.disabled=!1,h.style.cssText=nt,[7];case 6:return[2]}})})},500),s.appendChild(h),document.body.appendChild(a),document.body.appendChild(s)}({oauthInstance:t,captchaState:{captchaData:r,state:o,token:i}}),[2,new Promise(function(e){console.log("等待图形验证码校验结果..."),Ze.on(et,function(t){e(null==t?void 0:t.data)})})]})})}(t,e.config.oauthInstance)}},e.prototype.getCaptchaToken=function(e,t){return ot(this,void 0,Promise,function(){var n,r,o,i;return it(this,function(a){switch(a.label){case 0:return e?[3,2]:[4,this.findCaptchaToken()];case 1:if(n=a.sent())return[2,n];a.label=2;case 2:return[4,this.config.request(ne.CAPTCHA_DATA_URL,{method:"POST",body:{state:t,redirect_uri:""},withCredentials:!1})];case 3:return r=a.sent(),o="".concat(r.data,"?state=").concat(encodeURIComponent(t),"&token=").concat(encodeURIComponent(r.token)),[4,this.config.openURIWithCallback(o)];case 4:return i=a.sent(),this.saveCaptchaToken(i),[2,i.captcha_token]}})})},e.prototype.appendCaptchaTokenToURL=function(e,t,n){return ot(this,void 0,Promise,function(){var r;return it(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 ot(this,void 0,void 0,function(){var t;return it(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 ot(this,void 0,Promise,function(){var e,t;return it(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}(),st=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}();const ct=st;var ut,lt,pt=(ut=function(e,t){return ut=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])},ut(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}ut(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});!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"}(lt||(lt={}));var dt="https://tcb.cloud.tencent.com/dev?envId=#/identity/login-manage",ft="https://docs.cloudbase.net/api-reference/webv3/initialization";function ht(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 lt.PROVIDER_NOT_ENABLED:return"[CloudBase Auth] 登录方式未开启\n\n"+" 当前调用的 ".concat(n,"() 所需的登录方式尚未在云开发控制台启用。\n")+" 需要开启的登录方式:".concat(r,"\n")+"\n 请按以下步骤开启:\n"+" 1. 打开云开发控制台:".concat(dt,"\n")+" 2. 选择对应的云开发环境\n 3. 进入「登录授权」页面,在「登录方式」或「身份源列表」中开启所需的登录方式\n\n 各登录方法与所需登录方式的对应关系:\n - signInWithPassword → 「用户名密码登录」\n - signInAnonymously → 「匿名登录」\n - signInWithOtp/signUp → 「短信验证码登录」或「邮箱验证码登录」\n - signInWithOAuth/signInWithIdToken → 对应的第三方身份源\n\n 如使用 CLI/MCP 工具,可通过 auth 工具查询和配置身份源状态。\n"+" 更多帮助请参考文档:".concat(ft);case lt.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 lt.USER_NOT_FOUND:return"[CloudBase Auth] 用户不存在\n\n 请检查以下项目:\n 1. 确认用户名/邮箱/手机号是否正确\n 2. 确认是在正确的云开发环境(envId)下操作\n 3. 如果是新用户,请先通过 auth.signUp() 注册\n"+" 4. 也可在云开发控制台手动创建用户:".concat(dt,"\n")+"\n 提示:不同环境(开发/测试/生产)的用户库是隔离的,请确认 envId 正确。";case lt.USER_STATUS_ABNORMAL:return"[CloudBase Auth] 用户状态异常\n\n 当前用户账号可能处于以下状态之一:\n - 账号已被封禁\n - 账号正在审核中\n - 账号已被锁定(多次密码错误)\n\n"+" 请联系管理员在云开发控制台检查用户状态:".concat(dt);case lt.SERVICE_ERROR:return"[CloudBase Auth] 服务异常\n\n 请检查以下项目:\n 1. 网络连接是否正常\n 2. 云开发环境是否正常运行\n 3. 稍后重试,如持续失败请联系技术支持\n\n 提示:如果是超时错误,请检查网络环境和请求频率。\n 常见服务端错误:smtp 未配置、短信服务未配置、wedaapis 未设置等。";case lt.INVALID_PARAMS:if((null==t?void 0:t.errorCode)===ae.MISSING_REQUIRED_PARAM||(null==t?void 0:t.code)===ie.MISSING_REQUIRED_PARAM){var o=["verifyOtp","signInWithOtp","signUp"].includes(n)?"\n 若在校验验证码阶段缺参:\n - 独立调用 auth.verifyOtp() 时 messageId 为必填,请补上 params.messageId。\n - 推荐改用发码接口返回的回调(SDK 会自动携带 messageId):\n const { data } = await auth.signInWithOtp({ phone })\n await data.verifyOtp({ token })\n // 或 auth.signUp({ phone }) 返回的 data.verifyOtp\n":"";return"[CloudBase Auth] 缺少必填参数\n\n"+" 调用 auth.".concat(n,"() 时缺少必填参数。\n")+" 这是客户端入参问题,不是控制台通道配置问题。\n\n 修复方式:\n"+" 1. 查看 error.message 中的参数路径,补上缺失字段。\n".concat(o,"\n 参考 API 文档确认各参数的格式和约束:").concat(ft)}return"[CloudBase Auth] 参数错误\n\n 请检查传入的参数是否符合要求:\n - 不能同时输入手机号和邮箱\n - 手机号格式需正确(如 +86 开头)\n - 必须提供手机号或邮箱\n\n"+" 参考 API 文档确认各参数的格式和约束:".concat(ft);case lt.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(dt);case lt.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 lt.CAPTCHA_REQUIRED:return"[CloudBase Auth] 需要滑块验证码\n\n 当前操作触发了风控策略,需要完成滑块验证。\n\n 处理方式:\n 1. 调用滑块验证码 SDK 展示验证组件\n 2. 用户完成验证后,将 captcha_token 附带到请求中重新发送\n 3. 可通过 getVerification 的 options.withCaptcha 参数自动携带验证码";case lt.CAPTCHA_INVALID:return"[CloudBase Auth] 滑块验证码校验失败\n\n 提交的验证码 token 校验未通过(可能已过期或 client_id 不匹配)。\n\n 处理方式:\n 1. 刷新滑块验证码,让用户重新验证\n 2. 确认 captcha 组件初始化的 client_id 与认证配置一致";case lt.MFA_REQUIRED:return"[CloudBase Auth] 需要 MFA 验证\n\n 当前操作要求用户绑定手机号进行多因素认证 (MFA)。\n\n 处理方式:\n 1. 引导用户进入手机号绑定流程\n 2. 绑定完成后重新执行原操作\n 3. error 中可能包含 MFA 详情信息";case lt.PRECONDITION_FAILED:return"[CloudBase Auth] 前置条件不满足\n\n 当前操作的前置条件不满足,常见原因:\n - 该手机号/邮箱已被其他账号绑定\n - 目标用户不存在或已存在(与 target 参数冲突)\n - 当前邮箱/手机号未注册用户\n\n 请根据 error.message 中的具体描述处理。";case lt.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(dt,"\n")+" 2. 到官方问答社区提问:https://cnb.cool/tencent/cloud/cloudbase/community/-/issues\n"+" 3. 查阅文档:".concat(ft)}}function mt(e){return e&&{signInWithPassword:"当前使用「用户名密码登录」,需确保:\n ✓ 控制台已开启「用户名密码登录」\n ✓ 用户已注册且凭据正确\n 如果不需要用户系统,建议改用 auth.signInAnonymously()",signInAnonymously:"当前使用「匿名登录」,需确保:\n ✓ 控制台已开启「匿名登录」\n 注意:匿名用户无需用户名密码,适用于快速体验或临时访问场景",signInWithOtp:"当前使用「OTP 验证码登录」,需确保:\n ✓ 控制台已开启「短信验证码登录」或「邮箱验证码登录」",signInWithOAuth:"当前使用「第三方 OAuth 登录」,需确保:\n ✓ 控制台已配置并开启对应的第三方身份源"}[e]||""}var vt=function(e){function t(t,n){var r=this,o=function(e){return"object"==typeof e&&null!==e&&"__isAuthError"in e}(t);return(r=e.call(this,o?t.message:t.error_description||t.message)||this).__isAuthError=!0,r.name="AuthError",o?(r.status=t.status,r.code=t.code,r.errorCode=t.errorCode,r.requestId=t.requestId,r.category=t.category,r.retryAfter=t.retryAfter,r.helpMessage=ht(r.category,{method:null==n?void 0:n.method,errorCode:r.errorCode,code:r.code}),r.loginMethodHint=mt(null==n?void 0:n.method),r):(r.status=t.error,r.code=String(t.error||t.error_code||"unknown").toLowerCase(),r.errorCode="number"==typeof t.error_code?t.error_code:"string"==typeof t.error_code&&parseInt(t.error_code,10)||void 0,r.requestId=t.requestId,r.category=function(e,t,n){if(!e&&!t&&!n)return lt.UNKNOWN;try{var r=(e||"").toLowerCase(),o="string"==typeof n?parseInt(n,10):n;return o===ae.MISSING_REQUIRED_PARAM||t===ie.MISSING_REQUIRED_PARAM?lt.INVALID_PARAMS:o===ae.CAPTCHA_REQUIRED||t===ie.CAPTCHA_REQUIRED?lt.CAPTCHA_REQUIRED:o===ae.CAPTCHA_INVALID||t===ie.CAPTCHA_INVALID?lt.CAPTCHA_INVALID:o===ae.MFA_PHONE_REQUIRED||t===ie.MFA_PHONE_REQUIRED?lt.MFA_REQUIRED:o===ae.LOGIN_TYPE_DISABLED||t===ie.LOGIN_TYPE_DISABLED?lt.PROVIDER_NOT_ENABLED:o===ae.RESOURCE_EXHAUSTED||t===ie.RESOURCE_EXHAUSTED?lt.RATE_LIMITED:o===ae.INTERNAL||o===ae.UNAVAILABLE||o===ae.UNIMPLEMENTED||o===ae.ABORTED?lt.SERVICE_ERROR:o===ae.NOT_FOUND?lt.USER_NOT_FOUND:o===ae.UNAUTHENTICATED?lt.INVALID_CREDENTIALS:o===ae.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("过期"))?lt.VERIFICATION_FAILED:t===ie.PROVIDER_NOT_ENABLED||t===ie.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("匿名登录未开启")?lt.PROVIDER_NOT_ENABLED:t===ie.FAILED_PRECONDITION||o===ae.FAILED_PRECONDITION&&!r.includes("请联系开发者")?r.includes("不存在")||r.includes("not found")||r.includes("未注册")?lt.USER_NOT_FOUND:lt.PRECONDITION_FAILED:t===ie.INVALID_PASSWORD||t===ie.INVALID_GRANT||t===ie.INVALID_VERIFICATION_CODE||t===ie.INVALID_USERNAME_OR_PASSWORD||t===ie.INVALID_CREDENTIALS||t===ie.WRONG_PASSWORD||t===ie.UNAUTHENTICATED||t===ie.INVALID_TWO_FACTOR||t===ie.INVALID_TWO_FACTOR_RECOVERY||t===ie.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")?lt.INVALID_CREDENTIALS:t===ie.NOT_FOUND||t===ie.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")?lt.USER_NOT_FOUND:t===ie.USER_BLOCKED||t===ie.USER_PENDING||t===ie.UNDER_REVIEW||t===ie.INVALID_STATUS||r.includes("被封禁")||r.includes("blocked")||r.includes("pending")||r.includes("审核")||r.includes("review")||r.includes("locked")||r.includes("已锁定")?lt.USER_STATUS_ABNORMAL:t===ie.SERVER_ERROR||t===ie.UNAVAILABLE||t===ie.TEMPORARILY_UNAVAILABLE||t===ie.INTERNAL||t===ie.UNREACHABLE||t===ie.DEADLINE_EXCEEDED||t===ie.DATA_LOSS||t===ie.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")?lt.SERVICE_ERROR:t===ie.INVALID_ARGUMENT||t===ie.INVALID_REQUEST||t===ie.INVALID_SCOPE||t===ie.INVALID_REQUEST_URI||t===ie.INVALID_REQUEST_OBJECT||o===ae.INVALID_ARGUMENT?lt.INVALID_PARAMS:t===ie.PERMISSION_DENIED||t===ie.ACCESS_DENIED||t===ie.UNAUTHORIZED_CLIENT?lt.PROVIDER_NOT_ENABLED:lt.UNKNOWN}catch(e){return t}}(r.message,r.status,r.errorCode),r.helpMessage=ht(r.category,{method:null==n?void 0:n.method,errorCode:r.errorCode,code:r.code}),r.loginMethodHint=mt(null==n?void 0:n.method),r.category===lt.RATE_LIMITED&&(r.retryAfter=t.retry_after||t.retryAfter||void 0),r)}return pt(t,e),t.prototype.toJSON=function(){return{name:this.name,message:this.message,code:this.code,errorCode:this.errorCode,status:this.status,requestId:this.requestId,category:this.category,retryAfter:this.retryAfter}},t}(Error),yt=function(){return yt=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},yt.apply(this,arguments)},gt=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())})},bt=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 wt(e,t){var n;return gt(this,void 0,void 0,function(){var r,o=this;return bt(this,function(i){r=function(){return gt(o,void 0,void 0,function(){return bt(this,function(e){switch(e.label){case 0:return e.trys.push([0,1,,6]),[2,__webpack_require__(3171)];case 1:e.sent(),e.label=2;case 2:return e.trys.push([2,4,,5]),[4,Promise.resolve().then(__webpack_require__.bind(__webpack_require__,3171))];case 3:return[2,e.sent()];case 4:return e.sent(),[2];case 5:return[3,6];case 6:return[2]}})})};try{if(((null===(n=null==t?void 0:t.root)||void 0===n?void 0:n.globalThis)||globalThis).IS_MP_BUILD)return[2];if(e)return[2,r()]}catch(t){if(e)return[2,r()]}return[2]})})}var xt=function(){function e(e){var t=e.request,n=e.credentialsClient;if(!n){var r={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 ze(r)}if(!t){var o=n.request.bind(n),i=new at(yt({env:e.env,clientId:e.clientId,request:o,storage:e.storage,adapter:e.adapter,oauthInstance:this},e.captchaOptions));t=i.request.bind(i)}this.config={env:e.env,apiOrigin:e.apiOrigin,apiPath:e.apiPath,clientId:e.clientId,request:t,credentialsClient:n,storage:e.storage||Ve,adapter:e.adapter}}return e.parseParamsToSearch=function(e){return Object.keys(e).forEach(function(t){e[t]||delete e[t]}),new ct(e).toString()},e.prototype.getParamsByVersion=function(e,t){var n,r=(0,Ie.I)(e),o=(null===(n={v2:re}[null==r?void 0:r.version])||void 0===n?void 0:n[t])||ne[t];return r&&delete r.version,{params:r,url:o}},e.prototype.signIn=function(e){return gt(this,void 0,Promise,function(){var t,n,r,o;return bt(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 r=i.sent(),[4,this.config.request(n.url,{method:"POST",body:r})];case 2:return o=i.sent(),[4,this.config.credentialsClient.setCredentials(yt(yt({},o),{version:t}))];case 3:return i.sent(),[2,Promise.resolve(o)]}})})},e.prototype.signInAnonymously=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=!1),gt(this,void 0,Promise,function(){var n;return bt(this,function(r){switch(r.label){case 0:return[4,this.config.request(ne.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 gt(this,void 0,Promise,function(){var t;return bt(this,function(n){switch(n.label){case 0:return[4,this.config.request(ne.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 gt(this,void 0,Promise,function(){var t,n,r,o;return bt(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(ne.AUTH_SIGNOUT_URL,{method:"POST",withCredentials:!0,body:e})];case 2:return t=i.sent(),[3,4];case 3:return(n=i.sent()).error!==ie.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(ne.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 gt(this,void 0,Promise,function(){return bt(this,function(e){switch(e.label){case 0:return[4,this.config.request(ne.AUTH_REVOKE_ALL_URL,{method:"DELETE",withCredentials:!0})];case 1:return e.sent(),[2]}})})},e.prototype.revokeDevice=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){switch(t.label){case 0:return[4,this.config.request(ne.AUTHORIZED_DEVICES_DELETE_URL+e.device_id,{method:"DELETE",withCredentials:!0})];case 1:return t.sent(),[2]}})})},e.prototype.getVerification=function(e,t){return gt(this,void 0,Promise,function(){var n,r;return bt(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,Ie.I)(e)).phone_number&&!/^\+\d{1,3}\s+\d+/.test(r.phone_number)&&(r.phone_number="+86 ".concat(r.phone_number)),[2,this.config.request(ne.VERIFICATION_URL,{method:"POST",body:r,withCaptcha:(null==t?void 0:t.withCaptcha)||!1,withCredentials:n})]}})})},e.prototype.verify=function(e){return gt(this,void 0,Promise,function(){var t,n;return bt(this,function(r){switch(r.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=r.sent(),"v2"!==(null==e?void 0:e.version)?[3,3]:[4,this.config.credentialsClient.setCredentials(yt(yt({},n),{version:"v2"}))];case 2:r.sent(),r.label=3;case 3:return[2,n]}})})},e.prototype.genProviderRedirectUri=function(t){return gt(this,void 0,Promise,function(){var n,r,o,i,a;return bt(this,function(s){return n=t.provider_redirect_uri,r=t.other_params,o=void 0===r?{}:r,i=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}(t,["provider_redirect_uri","other_params"]),n&&!i.redirect_uri&&(i.redirect_uri=n),a="".concat(ne.PROVIDER_URI_URL,"?").concat(e.parseParamsToSearch(i)),Object.keys(o).forEach(function(e){var t=o[e];("sign_out_uri"!==e||(null==t?void 0:t.length)>0)&&(a+="&other_params[".concat(e,"]=").concat(encodeURIComponent(t)))}),[2,this.config.request(a,{method:"GET"})]})})},e.prototype.grantProviderToken=function(e,t){return void 0===t&&(t=!1),gt(this,void 0,Promise,function(){return bt(this,function(n){return[2,this.config.request(ne.PROVIDER_TOKEN_URL,{method:"POST",body:e,useWxCloud:t})]})})},e.prototype.patchProviderToken=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.PROVIDER_TOKEN_URL,{method:"PATCH",body:e})]})})},e.prototype.signInWithProvider=function(e,t){return void 0===t&&(t=!1),gt(this,void 0,Promise,function(){var n,r;return bt(this,function(o){switch(o.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 r=o.sent(),[4,this.config.credentialsClient.setCredentials(yt(yt({},r),{version:(null==e?void 0:e.version)||"v1"}))];case 2:return o.sent(),[2,Promise.resolve(r)]}})})},e.prototype.toBindIdentity=function(e){var t,n;return gt(this,void 0,void 0,function(){var r,o,i,a;return bt(this,function(s){switch(s.label){case 0:return(o=e.credentials)?[3,2]:[4,this.config.credentialsClient.localCredentials.getCredentials()];case 1:o=s.sent(),s.label=2;case 2:r=o,s.label=3;case 3:return s.trys.push([3,5,,6]),[4,this.bindWithProvider({provider_token:e.provider_token},r)];case 4:return s.sent(),i={data:{type:xe,provider:e.provider},error:null},[3,6];case 5:return a=s.sent(),i={data:{type:xe},error:new vt(a)},[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,be,{event:ye,info:i})),[2,i]}})})},e.prototype.getInitialSession=function(){return gt(this,void 0,Promise,function(){var e,t,n,r,o,i,a,s,c,u,l,p,d,f,h;return bt(this,function(m){switch(m.label){case 0:e={},m.label=1;case 1:if(m.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"),r=t.get("state"),!n||!r)return[2,{data:null,error:null}];o=null;try{o=JSON.parse(sessionStorage.getItem(r)||"null")}catch(e){}return e={type:null==o?void 0:o.type},i=t.get("error"),a=t.get("error_description"),i||a?[2,{data:e,error:new vt({message:a||i||"Unknown error from OAuth provider"})}]:(s=(null==o?void 0:o.provider)||t.get("provider"))?(c=location.origin+location.pathname,[4,this.grantProviderToken({provider_id:s,provider_redirect_uri:c,provider_code:n})]):[2,{data:e,error:new vt({message:"Provider is required for OAuth verification"})}];case 2:return u=m.sent().provider_token,l=void 0,p=null,d=void 0,o.type!==xe?[3,5]:[4,this.config.credentialsClient.localCredentials.getCredentials()];case 3:return l=m.sent(),[4,this.toBindIdentity({provider:s,provider_token:u,credentials:l})];case 4:return d=m.sent(),[3,11];case 5:return o.type!==we?[3,11]:(d=this.getParamsByVersion({provider:s},"AUTH_SIGN_IN_WITH_PROVIDER_URL"),[4,this.config.request(d.url,{method:"POST",body:{provider_token:u}})]);case 6:l=m.sent(),m.label=7;case 7:return m.trys.push([7,9,,10]),[4,this.getUserInfo({credentials:l})];case 8:return p=m.sent(),[3,10];case 9:return f=m.sent(),console.error("get user info error",f),[3,10];case 10:d={data:yt(yt({},e),{session:l,user:p}),error:null},m.label=11;case 11:t.delete("code"),t.delete("state"),t.delete("provider"),this.restoreUrlState(void 0===(null==o?void 0:o.search)?"?".concat(t.toString()):o.search,(null==o?void 0:o.hash)||location.hash);try{sessionStorage.removeItem(r)}catch(e){}return[2,d];case 12:return h=m.sent(),[2,{data:e,error:new vt(h)}];case 13:return[2]}})})},e.prototype.signInCustom=function(e){return gt(this,void 0,Promise,function(){var t;return bt(this,function(n){switch(n.label){case 0:return[4,this.config.request(ne.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={}),gt(this,void 0,Promise,function(){var t;return bt(this,function(n){switch(n.label){case 0:return[4,this.config.request(ne.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 gt(this,void 0,Promise,function(){return bt(this,function(n){return[2,this.config.request(ne.PROVIDER_BIND_URL,{method:"POST",body:e,withCredentials:!0,getCredentials:t?function(){return t}:void 0})]})})},e.prototype.getUserProfile=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.getUserInfo(e)]})})},e.prototype.getUserInfo=function(e){var t,n,r;return void 0===e&&(e={}),gt(this,void 0,Promise,function(){var o,i,a,s,c;return bt(this,function(u){switch(u.label){case 0:return o=this.getParamsByVersion(e,"USER_ME_URL"),(null===(t=o.params)||void 0===t?void 0:t.query)&&(i=new ct(o.params.query),o.url+="?".concat(i.toString())),[4,this.config.request(o.url,{method:"GET",withCredentials:!0,getCredentials:e.credentials?function(){return e.credentials}:void 0})];case 1:if((a=u.sent()).sub&&(a.uid=a.sub),null===(n=a.providers)||void 0===n?void 0:n.length)try{"undefined"!=typeof wx&&wx.getAccountInfoSync&&(s=null===(r=wx.getAccountInfoSync().miniProgram)||void 0===r?void 0:r.appId,(null==(c=a.providers.find(function(e){return e.id===s}))?void 0:c.provider_user_id)&&(a.open_id=c.provider_user_id))}catch(e){}return[2,a]}})})},e.prototype.getWedaUserInfo=function(){return gt(this,void 0,Promise,function(){return bt(this,function(e){switch(e.label){case 0:return[4,this.config.request(ne.WEDA_USER_URL,{method:"GET",withCredentials:!0})];case 1:return[2,e.sent()]}})})},e.prototype.deleteMe=function(t){return gt(this,void 0,Promise,function(){var n,r;return bt(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 gt(this,void 0,Promise,function(){return bt(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 gt(this,void 0,Promise,function(){return bt(this,function(e){return[2,this.config.credentialsClient.getCredentialsAsync()]})})},e.prototype.transByProvider=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.USER_TRANS_BY_PROVIDER_URL,{method:"PATCH",body:e,withCredentials:!0})]})})},e.prototype.grantToken=function(e){return gt(this,void 0,Promise,function(){var t;return bt(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 gt(this,void 0,Promise,function(){return bt(this,function(e){return[2,this.config.request(ne.PROVIDER_LIST,{method:"GET",withCredentials:!0})]})})},e.prototype.unbindProvider=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request("".concat(ne.PROVIDER_UNBIND_URL,"/").concat(e.provider_id),{method:"DELETE",withCredentials:!0})]})})},e.prototype.checkPassword=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request("".concat(ne.CHECK_PWD_URL),{method:"POST",withCredentials:!0,body:e})]})})},e.prototype.editContact=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request("".concat(ne.BIND_CONTACT_URL),{method:"PATCH",withCredentials:!0,body:e})]})})},e.prototype.setPassword=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request("".concat(ne.AUTH_SET_PASSWORD),{method:"PATCH",withCredentials:!0,body:e})]})})},e.prototype.updatePasswordByOld=function(e){return gt(this,void 0,Promise,function(){var t;return bt(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 gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request("".concat(ne.SUDO_URL),{method:"POST",withCredentials:!0,body:e})]})})},e.prototype.sendVerificationCodeToCurrentUser=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return e.target="CUR_USER",[2,this.config.request(ne.VERIFICATION_URL,{method:"POST",body:e,withCredentials:!0,withCaptcha:!0})]})})},e.prototype.changeBoundProvider=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request("".concat(ne.PROVIDER_LIST,"/").concat(e.provider_id,"/trans"),{method:"POST",body:{provider_trans_token:e.trans_token},withCredentials:!0})]})})},e.prototype.setUserProfile=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.USER_PRIFILE_URL,{method:"PATCH",body:e,withCredentials:!0})]})})},e.prototype.updateUserBasicInfo=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.USER_BASIC_EDIT_URL,{method:"POST",withCredentials:!0,body:e})]})})},e.prototype.queryUserProfile=function(e){return gt(this,void 0,Promise,function(){var t;return bt(this,function(n){return t=new ct(e),[2,this.config.request("".concat(ne.USER_QUERY_URL,"?").concat(t.toString()),{method:"GET",withCredentials:!0})]})})},e.prototype.setCustomSignFunc=function(e){this.getCustomSignTicketFn=e},e.prototype.signInWithCustomTicket=function(){return gt(this,void 0,Promise,function(){var e,t;return bt(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 gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.AUTH_RESET_PASSWORD,{method:"POST",body:e})]})})},e.prototype.authorize=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.AUTHORIZE_URL,{method:"POST",withCredentials:!0,body:e})]})})},e.prototype.authorizeDevice=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.AUTHORIZE_DEVICE_URL,{method:"POST",withCredentials:!0,body:e})]})})},e.prototype.deviceAuthorize=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.AUTH_GET_DEVICE_CODE,{method:"POST",body:e})]})})},e.prototype.authorizeInfo=function(t){return gt(this,void 0,Promise,function(){var n,r,o;return bt(this,function(i){switch(i.label){case 0:return n="".concat(ne.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 gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.CHECK_USERNAME,{method:"GET",body:e,withCredentials:!0})]})})},e.prototype.checkIfUserExist=function(e){return gt(this,void 0,Promise,function(){var t;return bt(this,function(n){return t=new ct(e),[2,this.config.request("".concat(ne.CHECK_IF_USER_EXIST,"?").concat(t.toString()),{method:"GET"})]})})},e.prototype.loginScope=function(){return gt(this,void 0,Promise,function(){return bt(this,function(e){return[2,this.config.credentialsClient.getScope()]})})},e.prototype.loginGroups=function(){return gt(this,void 0,Promise,function(){return bt(this,function(e){return[2,this.config.credentialsClient.getGroups()]})})},e.prototype.refreshTokenForce=function(e){return gt(this,void 0,void 0,function(){var t;return bt(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(yt(yt({},t),{version:(null==e?void 0:e.version)||"v1"}))];case 2:return[2,n.sent()]}})})},e.prototype.getCredentials=function(){return gt(this,void 0,void 0,function(){return bt(this,function(e){return[2,this.config.credentialsClient.getCredentials()]})})},e.prototype.getPublicKey=function(){return gt(this,void 0,Promise,function(){return bt(this,function(e){return[2,this.config.request(re.AUTH_PUBLIC_KEY,{method:"POST",body:{}})]})})},e.prototype.getEncryptParams=function(e){return gt(this,void 0,Promise,function(){var t,n,r,o,i,a;return bt(this,function(s){switch(s.label){case 0:return t=e.isEncrypt,delete e.isEncrypt,n=(0,Ie.I)(e),[4,wt(t,this.config.adapter)];case 1:if(!(r=s.sent()))return[2,e];o="",i="",s.label=2;case 2:return s.trys.push([2,4,,5]),[4,this.getPublicKey()];case 3:if(a=s.sent(),o=a.public_key,i=a.public_key_thumbprint,!o||!i)throw a;return[3,5];case 4:throw s.sent();case 5:return[2,{params:r.getEncryptInfo({publicKey:o,payload:n}),public_key_thumbprint:i}]}})})},e.prototype.getProviderSubType=function(){return gt(this,void 0,Promise,function(){return bt(this,function(e){return[2,this.config.request(ne.GET_PROVIDER_TYPE,{method:"POST",body:{provider_id:"weda"}})]})})},e.prototype.verifyCaptchaData=function(e){var t=e.token,n=e.key;return gt(this,void 0,void 0,function(){return bt(this,function(e){return[2,this.config.request(ne.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 gt(this,void 0,void 0,function(){return bt(this,function(e){return[2,this.config.request(ne.CAPTCHA_DATA_URL,{method:"POST",body:{state:t,redirect_uri:r},withCredentials:!1})]})})},e.prototype.getMiniProgramCode=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.GET_MINIPROGRAM_QRCODE,{method:"POST",body:e})]})})},e.prototype.getMiniProgramQrCodeStatus=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.GET_MINIPROGRAM_QRCODE_STATUS,{method:"POST",body:e})]})})},e.prototype.getUserBehaviorLog=function(e){return gt(this,void 0,Promise,function(){var t,n;return bt(this,function(r){return t={LOGIN:"query[action]=USER_LOGIN",MODIFY:"ne_query[action]=USER_LOGIN"},n="".concat(ne.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 gt(this,void 0,Promise,function(){var t,n,r,o,i,a;return bt(this,function(s){switch(s.label){case 0:return t="",n="",[4,wt(!0,this.config.adapter)];case 1:if(!(r=s.sent()))throw new Error("do not support encrypt, a encrypt util required.");s.label=2;case 2:return s.trys.push([2,4,,5]),[4,this.getPublicKey()];case 3:if(o=s.sent(),t=o.public_key,n=o.public_key_thumbprint,!t||!n)throw o;return[3,5];case 4:throw s.sent();case 5:return i=e.password?r.getEncryptInfo({publicKey:t,payload:e.password}):"",a=r.getEncryptInfo({publicKey:t,payload:e.new_password}),[2,this.config.request(ne.USER_BASIC_EDIT_URL,{method:"POST",withCredentials:!0,body:{user_id:e.user_id,encrypt_password:i,encrypt_new_password:a,public_key_thumbprint:n}})]}})})},e.prototype.modifyPasswordWithoutLogin=function(e){return gt(this,void 0,Promise,function(){var t,n,r,o,i,a;return bt(this,function(s){switch(s.label){case 0:return t="",n="",[4,wt(!0,this.config.adapter)];case 1:if(!(r=s.sent()))throw new Error("do not support encrypt, a encrypt util required.");s.label=2;case 2:return s.trys.push([2,4,,5]),[4,this.getPublicKey()];case 3:if(o=s.sent(),t=o.public_key,n=o.public_key_thumbprint,!t||!n)throw o;return[3,5];case 4:throw s.sent();case 5:return i=e.password?r.getEncryptInfo({publicKey:t,payload:e.password}):"",a=r.getEncryptInfo({publicKey:t,payload:e.new_password}),[2,this.config.request(re.AUTH_RESET_PASSWORD,{method:"POST",body:{username:e.username,password:i,new_password:a,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=function(){return _t=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},_t.apply(this,arguments)},Et=function(){function e(e){var t=e.apiOrigin,n=e.getApiOrigin,r=e.apiPath,o=void 0===r?ce:r,i=e.clientId,a=e.env,s=e.storage,c=e.request,u=e.baseRequest,l=e.anonymousSignInFunc,p=e.wxCloud,d=e.adapter,f=e.onCredentialsError,h=e.headers,m=e.i18n,v=e.useWxCloud,y=e.eventBus,g=e.detectSessionInUrl,b=e.debug;if(this.detectSessionInUrl=null!=g&&g,this.oauth2client=new ze({apiOrigin:t,getApiOrigin:n,apiPath:o,clientId:i,env:a,storage:s,baseRequest:u||c,anonymousSignInFunc:l,wxCloud:p,onCredentialsError:f,headers:h||{},i18n:m,useWxCloud:v,eventBus:y,debug:b}),this.authApi=new xt(_t(_t({credentialsClient:this.oauth2client},e),{request:c?this.oauth2client.request.bind(this.oauth2client):void 0,adapter:d})),g)this.oauth2client.setGetInitialSession(this.authApi.getInitialSession.bind(this.authApi));else try{var w=new URL(window.location.href),x=w.searchParams.get("code"),_=w.searchParams.get("state"),E=JSON.parse(sessionStorage.getItem(_)||"null");x&&_&&(null==E?void 0:E.hash)&&(w.hash=E.hash,window.history.replaceState(null,"",w.toString()),window.location.replace(w.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}(),It=__webpack_require__(794),St=__webpack_require__(141),Ot=__webpack_require__(6197),At=__webpack_require__(8182),Tt=function(){return Tt=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},Tt.apply(this,arguments)},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())})},Rt=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])}}},Ct=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 Pt(this,void 0,Promise,function(){return Rt(this,function(t){return[2,this.localStorage.getItem(e)]})})},e.prototype.removeItem=function(e){return Pt(this,void 0,void 0,function(){return Rt(this,function(t){return this.localStorage.removeItem(e),[2]})})},e.prototype.setItem=function(e,t){return Pt(this,void 0,Promise,function(){return Rt(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}(),Nt=/^[^:]+:\/\/[^/]+(\/[^?#]+)/,kt=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,Nt.test(i)?RegExp.$1:i),e):(null==e?void 0:e.data)||{}},Ut=function(e){return e.adapter&&"default"!==e.adapter.type?function(e,t){var n=Tt({},e);try{if(!(null==e?void 0:e.storage)&&(null==t?void 0:t.localStorage)&&(n.storage=new Ct({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 r={timeout:1e4,restrictedMethods:["get","post","upload","download","request"],auth:e.auth},o=new t.reqClass(r);n.baseRequest=function(e,t){var n,r,i,a,s;return Pt(this,void 0,void 0,function(){var c,u,l,p;return Rt(this,function(d){switch(d.label){case 0:if(c={},u=(null===(n=t.method)||void 0===n?void 0:n.toLocaleLowerCase())||"post","function"!=typeof(l=null===(i=null===(r=null==o?void 0:o[u])||void 0===r?void 0:r.bind)||void 0===i?void 0:i.call(r,o)))throw new Error("invalid 【".concat(u,"】 request method"));d.label=1;case 1:return d.trys.push([1,3,,4]),(null===(a=t.headers)||void 0===a?void 0:a["content-type"])&&!(null===(s=t.headers)||void 0===s?void 0:s["content-type"].includes("application/json"))||["string","undefined"].includes(typeof t.body)||(t.data=t.data||t.body,t.body=JSON.stringify(t.body)),[4,l(Tt({url:e},t))];case 2:return c=d.sent(),c=kt(c,Tt(Tt({},t),{url:e})),[3,4];case 3:throw p=d.sent(),c=Tt(Tt({},null==p?void 0:p.data),p);case 4:if(null==c?void 0:c.error)throw c;return[2,c]}})})}}}catch(e){console.error("user adapter generate fail:",e)}return n}(e,e.adapter):function(e,t){var n=Tt({},e),r={};if((null==t?void 0:t.captchaOptions)&&(n.captchaOptions=t.captchaOptions),!u.default.isMatch()||e.storage&&e.baseRequest)return n;try{var o=u.default.genAdapter({}),i=o.localStorage,a=o.reqClass;if(i&&(r.storage=new Ct({localStorage:i,adapter:t})),a){var s=new a({timeout:1e4,restrictedMethods:["get","post","upload","download","request"]});r.request=function(e){return function(t,n){return Pt(this,void 0,void 0,function(){return Rt(this,function(r){return[2,new Promise(function(r,o){var i=Object.assign({},n);i.body&&"string"!=typeof i.body&&(i.body=JSON.stringify(i.body));var a=wx.request({url:t,data:i.body,timeout:e._timeout,method:i.method||"GET",header:i.headers,success:function(e){(e=kt(e,Tt(Tt({},n),{url:t}))).error&&o(e),r(e)},fail:function(e){o({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{a.abort()}catch(e){}}}})})]})})}}(s)}return n.captchaOptions&&(r.baseRequest=r.request,r.request=void 0),Tt(Tt({},n),r)}catch(e){console.error("adapter generate fail:",e)}return n}(e,e.adapter)},jt=function(){return jt=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},jt.apply(this,arguments)},Lt=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])}}},qt=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 Lt(this,void 0,Promise,function(){return Dt(this,function(e){throw new Error("[v1 兼容] WeixinAuthProvider.getRedirectResult() 在当前版本中无法实现。 建议使用 auth.verifyOAuth({ code, state, provider }) 替代。")})})},e.prototype.getLinkRedirectResult=function(e){return Lt(this,void 0,Promise,function(){return Dt(this,function(e){throw new Error("[v1 兼容] WeixinAuthProvider.getLinkRedirectResult() 在当前版本中无法实现。 建议使用 auth.linkIdentity({ provider: 'providerId' }) 替代。")})})},e}(),Mt=function(){function e(e){this.authInstance=e.authInstance}return e.prototype.signIn=function(e){return Lt(this,void 0,Promise,function(){return Dt(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}(),Ft=function(){function e(e){this.authInstance=e.authInstance}return e.prototype.signIn=function(){return Lt(this,void 0,Promise,function(){return Dt(this,function(e){switch(e.label){case 0:return[4,this.authInstance.signInAnonymously({})];case 1:return e.sent(),[2]}})})},e}(),Bt=function(){function e(){}return e.prototype.weixinAuthProvider=function(e){return new qt({authInstance:this,appid:e.appid,scope:e.scope})},e.prototype.customAuthProvider=function(){return new Mt({authInstance:this})},e.prototype.anonymousAuthProvider=function(){return new Ft({authInstance:this})},e.prototype.signUpWithEmailAndPassword=function(e,t){return Lt(this,void 0,Promise,function(){return Dt(this,function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"email must be a string"),"string"!=typeof t&&(0,Je.throwError)(It.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 Lt(this,void 0,Promise,function(){return Dt(this,function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"email must be a string"),"string"!=typeof t&&(0,Je.throwError)(It.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 Lt(this,void 0,Promise,function(){return Dt(this,function(t){switch(t.label){case 0:return"string"!=typeof e&&(0,Je.throwError)(It.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 Lt(this,void 0,Promise,function(){return Dt(this,function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"username must be a string"),"string"!=typeof t&&(0,Je.throwError)(It.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 Lt(this,void 0,Promise,function(){var t;return Dt(this,function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,Je.throwError)(It.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 Lt(this,void 0,Promise,function(){var r;return Dt(this,function(o){switch(o.label){case 0:return"string"!=typeof e&&(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"phoneNumber must be a string"),"string"!=typeof t&&(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"phoneCode must be a string"),r=this.formatPhone(e),[4,this.signUp(jt({phone_number:r,verification_code:t},n?{password:n}:{}))];case 1:return o.sent(),[2,this.createLoginState()]}})})},e.prototype.signInWithPhoneCodeOrPassword=function(e){return Lt(this,void 0,Promise,function(){var t,n,r,o;return Dt(this,function(i){switch(i.label){case 0:return t=e.phoneNumber,n=e.phoneCode,r=e.password,"string"!=typeof t&&(0,Je.throwError)(It.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,Je.throwError)(It.ERRORS.INVALID_PARAMS,"phoneCode or password must be provided"),i.label=5;case 5:return[2,this.createLoginState()]}})})},e.prototype.forceResetPwdByPhoneCode=function(e){return Lt(this,void 0,Promise,function(){var t,n,r,o;return Dt(this,function(i){switch(i.label){case 0:return t=e.phoneNumber,n=e.phoneCode,r=e.password,"string"!=typeof t&&(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"phoneNumber must be a string"),"string"!=typeof n&&(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"phoneCode must be a string"),"string"!=typeof r&&(0,Je.throwError)(It.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)===pe&&e.call(t)})},e.prototype.onAccessTokenRefreshed=function(e){var t=this;this.onAuthStateChange(function(n){n===me&&e.call(t)})},e.prototype.onAnonymousConverted=function(e){var t=this;this.onAuthStateChange(function(n){n===fe&&e.call(t)})},e.prototype.onLoginTypeChanged=function(e){var t=this;this.onAuthStateChange(function(n){n!==fe&&n!==de||e.call(t)})},e}(),Wt=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)}}(),Gt=function(){return Gt=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},Gt.apply(this,arguments)},Vt=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},Ht=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},zt=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())})},Kt=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])}}},Jt=function(){return"undefined"!=typeof window&&"undefined"!=typeof document},Yt=function(e){return function(t){e.fire(ge,Gt(Gt({},t),{eventType:pe}))}},$t=["avatar_url","avatarUrl"],Xt=/^\s*data:/i,Qt=/;base64,/i,Zt=/^(?:[A-Za-z0-9+/]{4}){16,}(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})?$/;function en(e){return"undefined"!=typeof TextEncoder?(new TextEncoder).encode(e).length:e.length}function tn(e){var t=e.trim();return!(!Xt.test(t)&&!Qt.test(t))||Zt.test(t)}function nn(e,t){if(e)for(var n=0,r=$t;n<r.length;n++){var o=r[n],i=e[o];if(null!=i&&""!==i){var a=String(i);if(tn(a))throw new vt({error:"invalid_argument",error_code:ae.INVALID_ARGUMENT,error_description:"auth.".concat(t,'(params): "').concat(o,'" 不支持 base64 / data URI,请先上传图片后传入 URL')},{method:t});var s=en(a);if(s>204800)throw new vt({error:"invalid_argument",error_code:ae.INVALID_ARGUMENT,error_description:"auth.".concat(t,'(params): "').concat(o,'" 超过 200KB 限制(当前 ').concat(s," 字节),请传入图片 URL 而非文件内容")},{method:t})}}}var rn,on=function(){function t(e){var t=e.cache,n=e.oauthInstance;this.cache=t,this.oauthInstance=n,this.setUserInfo()}var n,r,o;return t.prototype.checkLocalInfo=function(){return zt(this,void 0,void 0,function(){return Kt(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]})})},t.prototype.checkLocalInfoAsync=function(){return zt(this,void 0,void 0,function(){var e,t,n,r;return Kt(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]}})})},t.prototype.update=function(e){return zt(this,void 0,Promise,function(){var t;return Kt(this,function(n){switch(n.label){case 0:return nn(e,"update"),[4,this.oauthInstance.authApi.setUserProfile(Gt({},e))];case 1:return t=n.sent(),this.setLocalUserInfo(t),[2]}})})},t.prototype.updateUserBasicInfo=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){switch(t.label){case 0:return nn(e,"updateUserBasicInfo"),[4,this.oauthInstance.authApi.updateUserBasicInfo(Gt({},e))];case 1:return t.sent(),[4,this.refresh()];case 2:return t.sent(),[2]}})})},t.prototype.updatePassword=function(e,t){return this.oauthInstance.authApi.updatePasswordByOld({old_password:t,new_password:e})},t.prototype.updateUsername=function(e){return"string"!=typeof e&&(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"username must be a string"),this.update({username:e})},t.prototype.refresh=function(e){return zt(this,void 0,Promise,function(){var t;return Kt(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]}})})},t.prototype.getLocalUserInfo=function(e){var t=this.cache.keys.userInfoKey,n=this.cache.getStore(t);return e?n[e]:n||{}},t.prototype.setLocalUserInfo=function(e){var t=this.cache.keys.userInfoKey;this.cache.setStore(t,e),this.setUserInfo()},t.prototype.getLocalUserInfoAsync=function(e){return zt(this,void 0,Promise,function(){var t;return Kt(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]]}})})},t.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]})},Vt([(0,St.catchErrorsDecorator)({title:"更新用户信息失败",messages:["请确认以下各项:"," 1 - 调用 User.update() 的语法或参数是否正确"," 2 - 用户信息中是否包含非法值","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",["function"==typeof(n=e.UserProfile)?n:Object]),Ht("design:returntype","function"==typeof(r="undefined"!=typeof Promise&&Promise)?r:Object)],t.prototype,"update",null),Vt([(0,St.catchErrorsDecorator)({title:"更新密码失败",messages:["请确认以下各项:"," 1 - 调用 User.updatePassword() 的语法或参数是否正确"," 3 - 新密码中是否包含非法字符","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[String,String]),Ht("design:returntype",void 0)],t.prototype,"updatePassword",null),Vt([(0,St.catchErrorsDecorator)({title:"更新用户名失败",messages:["请确认以下各项:"," 1 - 调用 User.updateUsername() 的语法或参数是否正确"," 2 - 当前环境是否开通了用户名密码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[String]),Ht("design:returntype",void 0)],t.prototype,"updateUsername",null),Vt([(0,St.catchErrorsDecorator)({title:"刷新本地用户信息失败",messages:["请确认以下各项:"," 1 - 调用 User.refresh() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[Object]),Ht("design:returntype","function"==typeof(o="undefined"!=typeof Promise&&Promise)?o:Object)],t.prototype,"refresh",null),t}();(rn=on).prototype.linkWithTicket=function(e){return Lt(this,void 0,Promise,function(){return Dt(this,function(e){throw new Error("[v1 兼容] User.linkWithTicket() 在当前版本中无法实现。 建议使用 auth.signInWithCustomTicket(() => Promise.resolve(ticket)) 替代。")})})},rn.prototype.linkWithRedirect=function(e){throw new Error("[v1 兼容] User.linkWithRedirect() 在当前版本中无法实现。 建议使用 auth.linkIdentity({ provider: 'providerId' }) 替代。")},rn.prototype.updateEmail=function(e,t){return Lt(this,void 0,Promise,function(){return Dt(this,function(t){switch(t.label){case 0:return"string"!=typeof e&&(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"newEmail must be a string"),[4,this.updateUserBasicInfo({email:e})];case 1:return t.sent(),[2]}})})},rn.prototype.linkWithPhoneNumber=function(e,t){return Lt(this,void 0,Promise,function(){return Dt(this,function(e){throw new Error("[v1 兼容] User.linkWithPhoneNumber() 在当前版本中无法实现。 建议使用 auth.bindPhoneNumber({ phone_number, verification_token, sudo_token }) 替代。")})})},rn.prototype.updatePhoneNumber=function(e,t){return Lt(this,void 0,Promise,function(){return Dt(this,function(e){throw new Error("[v1 兼容] User.updatePhoneNumber() 在当前版本中无法实现。 建议使用 auth.updateUser({ phone: newPhoneNumber }) 替代。")})})},rn.prototype.unlink=function(e){return Lt(this,void 0,Promise,function(){return Dt(this,function(e){throw new Error("[v1 兼容] User.unlink() 在当前版本中无法实现。 建议使用 auth.unlinkIdentity({ provider: loginType }) 替代。")})})};var an=function(){function e(e){var t=e.envId,n=e.cache,r=e.oauthInstance;t||(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"envId is not defined"),this.cache=n,this.oauthInstance=r,this.user=new on({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 zt(this,void 0,void 0,function(){return Kt(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}(),sn=function(t){function n(e){var n=t.call(this)||this;return n.listeners=new Map,n.hasListenerSetUp=!1,n.config=e,n.oauthInstance=e.oauthInstance,n.cache=e.cache,n.init(),n.setAccessKey(),n}var o,i,a,s,c,l,p,d,f,h,m,v,y,g,b,w,x,_,E,I,S;return Wt(n,t),n.prototype.signInAnonymously=function(e){return zt(this,void 0,Promise,function(){var t,n,r,o,i;return Kt(this,function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,this.oauthInstance.authApi.signInAnonymously(e)];case 1:return a.sent(),[4,this.createLoginState()];case 2:return t=a.sent(),[4,this.getSession()];case 3:return n=a.sent().data,r=(void 0===n?{}:n).session,[2,Gt(Gt({},t),{data:{user:r.user,session:r},error:null})];case 4:return o=a.sent(),(i=new vt(o,{method:"signInAnonymously"})).category===lt.PROVIDER_NOT_ENABLED?(console.error(i.helpMessage),console.error("[CloudBase Auth] 提示:匿名登录需要在控制台开启「匿名登录」。\n 如果您需要使用用户名密码登录,请改用 auth.signInWithPassword({ username, password })。\n 不要在匿名登录失败后自动回退到密码登录,这两种方式的使用场景不同。")):(console.warn("[CloudBase Auth] signInAnonymously 失败 [".concat(i.category,"]: ").concat(i.message)),i.loginMethodHint&&console.warn(i.loginMethodHint)),[2,{data:{user:null,session:null},error:i}];case 5:return[2]}})})},n.prototype.signUp=function(e){return zt(this,void 0,Promise,function(){var t,n,r=this;return Kt(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"]],"signUp"),[4,this.getVerification(e.email?{email:e.email,usage:ue.EMAIL}:{phone_number:this.formatPhone(e.phone)})];case 3:return t=o.sent(),[2,{data:{verifyOtp:function(n){var o=n.token,i=n.messageId,a=void 0===i?t.verification_id:i;return zt(r,void 0,Promise,function(){var n,r,i,s,c;return Kt(this,function(u){switch(u.label){case 0:return u.trys.push([0,8,,9]),[4,this.verify({verification_id:a||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(Gt(Gt(Gt({},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 i=u.sent().data,[2,{data:{user:(s=(void 0===i?{}:i).session).user,session:s},error:null}];case 8:return c=u.sent(),[2,{data:{user:null,session:null},error:new vt(c,{method:"signUp"})}];case 9:return[2]}})})}},error:null}];case 4:return n=o.sent(),[2,{data:{user:null,session:null},error:new vt(n,{method:"signUp"})}];case 5:return[2]}})})},n.prototype.signOut=function(e){return zt(this,void 0,Promise,function(){var t,n,r;return Kt(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),t=this.cache.keys.userInfoKey,[4,this.oauthInstance.authApi.signOut(e)];case 1:return n=o.sent(),[4,this.cache.removeStoreAsync(t)];case 2:return o.sent(),this.setAccessKey(),[2,Gt(Gt({},n),{data:{},error:null})];case 3:return r=o.sent(),[2,{data:{},error:new vt(r,{method:"signOut"})}];case 4:return[2]}})})},n.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))}}}}},n.prototype.signInWithPassword=function(e){var t,n;return zt(this,void 0,Promise,function(){var r,o,i,a,s,c,u,l;return Kt(this,function(p){switch(p.label){case 0:return p.trys.push([0,3,,4]),this.validateAtLeastOne(e,[["username"],["email"],["phone"]],"signInWithPassword"),this.validateParams(e,{password:{required:!0,message:"Password is required"}},"signInWithPassword"),r="username"in e?e.username:void 0,o="email"in e?e.email:void 0,i="phone"in e?e.phone:void 0,a=null!==(n=null===(t=e.options)||void 0===t?void 0:t.is_encrypt)&&void 0!==n?n:e.is_encrypt,[4,this.signIn(Gt({username:r||o||this.formatPhone(i),password:e.password},a?{isEncrypt:!0,version:"v2"}:{}))];case 1:return p.sent(),[4,this.getSession()];case 2:return s=p.sent().data,[2,{data:{user:(c=(void 0===s?{}:s).session).user,session:c},error:null}];case 3:return u=p.sent(),(l=new vt(u,{method:"signInWithPassword"})).category===lt.PROVIDER_NOT_ENABLED?console.error(l.helpMessage):l.category===lt.INVALID_CREDENTIALS||l.category===lt.USER_NOT_FOUND?console.warn(l.helpMessage):console.warn("[CloudBase Auth] signInWithPassword 失败 [".concat(l.category,"]: ").concat(l.message)),l.loginMethodHint&&console.info(l.loginMethodHint),[2,{data:{user:null,session:null},error:l}];case 4:return[2]}})})},n.prototype.signInWithIdToken=function(e){return zt(this,void 0,Promise,function(){var t,n,r;return Kt(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"}},"signInWithIdToken"),[4,this.signInWithProvider({provider_id:e.provider,provider_id_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 vt(r,{method:"signInWithIdToken"})}];case 4:return[2]}})})},n.prototype.signInWithOtp=function(e){return zt(this,void 0,Promise,function(){var t,n,r,o,i,a=this;return Kt(this,function(s){switch(s.label){case 0:if(t=e.options,n="email"in e?e.email:void 0,r="phone"in e?e.phone:void 0,!(null==t?void 0:t.emailRedirectTo)&&(void 0===(null==t?void 0:t.shouldCreateUser)||(null==t?void 0:t.shouldCreateUser)))return[2,this.signUp(n?{email:n}:{phone:r})];s.label=1;case 1:return s.trys.push([1,3,,4]),this.validateAtLeastOne(e,[["email"],["phone"]],"signInWithOtp"),[4,this.getVerification(Gt(Gt({email_redirect_to:null==t?void 0:t.emailRedirectTo},n?{email:n,usage:ue.EMAIL}:{phone_number:this.formatPhone(r)}),{target:(null==t?void 0:t.emailRedirectTo)&&(null==t?void 0:t.shouldCreateUser)?"ANY":"USER"}))];case 2:return o=s.sent(),[2,{data:{user:null,session:null,verifyOtp:function(e){var t=e.token,i=e.messageId,s=void 0===i?o.verification_id:i;return zt(a,void 0,Promise,function(){return Kt(this,function(e){return[2,this.verifyOtp(n?{email:n,token:String(t),messageId:s||""}:{phone:r,token:String(t),messageId:s||""})]})})}},error:null}];case 3:return i=s.sent(),[2,{data:{user:null,session:null},error:new vt(i,{method:"signInWithOtp"})}];case 4:return[2]}})})},n.prototype.verifyOAuth=function(e){return zt(this,void 0,Promise,function(){var t,n,o,i,a,s,c,u,l;return Kt(this,function(p){switch(p.label){case 0:t={},p.label=1;case 1:return p.trys.push([1,7,,8]),n=(null==e?void 0:e.code)||r.P6.getQuery("code"),o=(null==e?void 0:e.state)||r.P6.getQuery("state"),n?o?(i=function(e){try{return JSON.parse(sessionStorage.getItem(e))}catch(e){return console.error("Failed to get browser session:",e),null}}(o),t.type=null==i?void 0:i.type,(a=(null==e?void 0:e.provider)||(null==i?void 0:i.provider)||r.P6.getQuery("provider"))?[4,this.grantProviderToken({provider_id:a,provider_redirect_uri:location.origin+location.pathname,provider_code:n})]:[2,{data:Gt(Gt({},t),{user:null,session:null,redirectUrl:null}),error:this.missingRequiredParam("verifyOAuth","provider")}]):[2,{data:{user:null,session:null,redirectUrl:null},error:this.missingRequiredParam("verifyOAuth","state")}]:[2,{data:{user:null,session:null,redirectUrl:null},error:this.missingRequiredParam("verifyOAuth","code")}];case 2:return s=p.sent().provider_token,c=void 0,i.type!==xe?[3,4]:[4,this.oauthInstance.authApi.toBindIdentity({provider_token:s,provider:a,fireEvent:!0})];case 3:return c=p.sent(),[3,6];case 4:return[4,this.signInWithIdToken({token:s})];case 5:(c=p.sent()).data=Gt(Gt({},t),c.data),p.label=6;case 6:return(u=new URLSearchParams(null===location||void 0===location?void 0:location.search)).delete("code"),u.delete("state"),c.data.redirectUrl=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}}(void 0===(null==i?void 0:i.search)?"?".concat(u.toString()):null==i?void 0:i.search,(null==i?void 0:i.hash)||location.hash),function(e){try{return sessionStorage.removeItem(e),!0}catch(e){return console.error("Failed to remove browser session:",e),null}}(o),[2,c];case 7:return l=p.sent(),[2,{data:Gt(Gt({},t),{user:null,session:null,redirectUrl:null}),error:new vt(l,{method:"verifyOAuth"})}];case 8:return[2]}})})},n.prototype.signInWithOAuth=function(e){var t,n,r,o,i;return zt(this,void 0,Promise,function(){var a,s,c,u,l,p,d,f,h;return Kt(this,function(m){switch(m.label){case 0:return m.trys.push([0,2,,3]),this.validateParams(e,{provider:{required:!0,message:"Provider is required"}},"signInWithOAuth"),a=(null===(t=e.options)||void 0===t?void 0:t.redirectTo)||location.href,s=new URL(a),c=s.origin+s.pathname,u=(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:u})];case 1:return l=m.sent().uri,p=decodeURIComponent(l),d=p,(null===(r=e.options)||void 0===r?void 0:r.queryParams)&&(f=new URL(p),Object.entries(e.options.queryParams).forEach(function(e){var t=e[0],n=e[1];f.searchParams.set(t,n)}),d=f.toString()),function(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){console.error("Failed to save to browser session:",e)}}(u,{provider:e.provider,search:s.search,hash:s.hash,type:(null===(o=e.options)||void 0===o?void 0:o.type)||we}),Jt()&&!(null===(i=e.options)||void 0===i?void 0:i.skipBrowserRedirect)&&window.location.assign(d),[2,{data:{url:d,provider:e.provider},error:null}];case 2:return h=m.sent(),[2,{data:{url:null,provider:null},error:new vt(h,{method:"signInWithOAuth"})}];case 3:return[2]}})})},n.prototype.getClaims=function(){return zt(this,void 0,Promise,function(){var e;return Kt(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.getAccessToken()];case 1:return[2,{data: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(function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Illegal base64url string!")}try{return function(e){return decodeURIComponent(Ce(e).replace(/(.)/g,function(e){var t=e.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0".concat(t)),"%".concat(t)}))}(t)}catch(e){return Ce(t)}}(e))});return{claims:t[1],header:t[0],signature:t[2]}}catch(e){throw new Error("Invalid token specified: ".concat(e)?e.message:0)}}(t.sent().accessToken),error:null}];case 2:return e=t.sent(),[2,{data:{claims:null,header:null,signature:null},error:new vt(e,{method:"getClaims"})}];case 3:return[2]}})})},n.prototype.resetPasswordForEmail=function(e,t){return zt(this,void 0,Promise,function(){var n,r,o,i,a,s,c=this;return Kt(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),this.validateParams({emailOrPhone:e},{emailOrPhone:{required:!0,message:"Email or phone is required"}},"resetPasswordForEmail"),n=(t||{}).redirectTo,r=e.includes("@"),o=void 0,r?o={email:e,usage:ue.RECOVERY}:(i=this.formatPhone(e),o={phone_number:i}),[4,this.getVerification(Gt(Gt({},o),{target:"USER"}))];case 1:return a=u.sent(),[2,{data:{updateUser:function(t){return zt(c,void 0,Promise,function(){var o,i,s,c;return Kt(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"}},"resetPasswordForEmail"),u.label=1;case 1:return u.trys.push([1,5,,6]),[4,this.verify({verification_id:a.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(be,{event:"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&&Jt()&&window.location.assign(n),[2,i];case 5:return s=u.sent(),[2,{data:{user:null,session:null},error:new vt(s,{method:"resetPasswordForEmail"})}];case 6:return[2]}})})}},error:null}];case 2:return s=u.sent(),[2,{data:{updateUser:null},error:new vt(s,{method:"resetPasswordForEmail"})}];case 3:return[2]}})})},n.prototype.resetPasswordForOld=function(e){return zt(this,void 0,Promise,function(){var t,n,r;return Kt(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 vt(r,{method:"resetPasswordForOld"})}];case 4:return[2]}})})},n.prototype.verifyOtp=function(e){return zt(this,void 0,Promise,function(){var t,n,r,o,i,a,s;return Kt(this,function(c){switch(c.label){case 0:return c.trys.push([0,6,,7]),t=e.type,n=String(e.token),r="email"in e?e.email:void 0,o="phone"in e?e.phone:void 0,this.validateParams(e,{token:{required:!0,message:"Token is required"},messageId:{required:!0,message:"messageId is required"}},"verifyOtp"),["phone_change","email_change"].includes(t)?[4,this.verify({verification_id:e.messageId,verification_code:n})]:[3,2];case 1:return c.sent(),[3,4];case 2:return[4,this.signInWithUsername({verificationInfo:{verification_id:e.messageId,is_user:!0},verificationCode:n,username:r||this.formatPhone(o)||"",loginType:r?"email":"phone"})];case 3:c.sent(),c.label=4;case 4:return[4,this.getSession()];case 5:return i=c.sent().data,[2,{data:{user:(a=(void 0===i?{}:i).session).user,session:a},error:null}];case 6:return s=c.sent(),[2,{data:{user:null,session:null},error:new vt(s,{method:"verifyOtp"})}];case 7:return[2]}})})},n.prototype.getSession=function(){return zt(this,void 0,Promise,function(){var e,t,n,r;return Kt(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:Gt(Gt({},e),{user:n}),user:n},error:null}];case 3:return r=o.sent(),[2,{data:{session:null,user:null},error:new vt(r,{method:"getSession"})}];case 4:return[2]}})})},n.prototype.refreshSession=function(e){return zt(this,void 0,Promise,function(){var t,n,r,o,i;return Kt(this,function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,this.oauthInstance.oauth2client.localCredentials.getCredentials()];case 1:return(t=a.sent()).refresh_token=e||t.refresh_token,[4,this.oauthInstance.oauth2client.refreshToken(t)];case 2:return n=a.sent(),[4,this.getUser(!1)];case 3:return r=a.sent().data,[2,{data:{user:o=(void 0===r?{}:r).user,session:Gt(Gt({},n),{user:o})},error:null}];case 4:return i=a.sent(),[2,{data:{user:null,session:null},error:new vt(i,{method:"refreshSession"})}];case 5:return[2]}})})},n.prototype.getUser=function(e){return void 0===e&&(e=!0),zt(this,void 0,Promise,function(){var t,n,r;return Kt(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 vt(r,{method:"getUser"})}];case 4:return[2]}})})},n.prototype.refreshUser=function(){return zt(this,void 0,Promise,function(){var e,t,n;return Kt(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 vt(n,{method:"refreshUser"})}];case 4:return[2]}})})},n.prototype.updateUser=function(e){var t;return zt(this,void 0,Promise,function(){var n,r,o,i,a,s,c,u,l,p,d,f,h,m,v=this;return Kt(this,function(y){switch(y.label){case 0:if(y.trys.push([0,8,,9]),nn(e,"updateUser"),n=["password","new_password"].find(function(t){var n=e[t];return null!=n&&""!==n}),n)throw new vt({message:'updateUser 不支持更新密码,检测到传入了 "'.concat(n,'" 参数。如需修改密码请使用 resetPasswordForOld(旧密码修改)、resetPasswordForEmail(验证码重置)或 reauthenticate(重新认证后改密)')});if(r=Object.keys(e).some(function(t){return void 0!==e[t]&&null!==e[t]&&""!==e[t]}),!r)throw this.missingRequiredParam("updateUser","(at least one field)");return o=e.email,i=e.phone,a=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}(e,["email","phone"]),c=void 0!==i,u={},(s=void 0!==o)||c?(l=void 0,s?(l={email:e.email,usage:ue.REAUTHENTICATION},p="email_change"):(d=this.formatPhone(e.phone),l={phone_number:d},p="phone_change"),[4,this.getVerification(Gt({},l))]):[3,4];case 1:return f=y.sent(),Object.keys(a).length>0?[4,this.updateUserBasicInfo(a)]:[3,3];case 2:y.sent(),y.label=3;case 3:return u={messageId:f.verification_id,verifyOtp:function(t){return zt(v,void 0,Promise,function(){var n,r,o,i;return Kt(this,function(a){switch(a.label){case 0:return a.trys.push([0,11,,12]),t.email&&e.email===t.email?[4,this.verifyOtp({type:"email_change",email:e.email,token:t.token,messageId:f.verification_id||""})]:[3,3];case 1:return(n=a.sent()).error?[2,n]:[4,this.updateUserBasicInfo({email:e.email})];case 2:return a.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:f.verification_id||""})]:[3,6];case 4:return(n=a.sent()).error?[2,n]:[4,this.updateUserBasicInfo({phone:this.formatPhone(e.phone)})];case 5:return a.sent(),[3,9];case 6:return[4,this.verifyOtp(s?{type:p,email:e.email,token:t.token,messageId:f.verification_id||""}:{type:p,phone:e.phone,token:t.token,messageId:f.verification_id||""})];case 7:return(n=a.sent()).error?[2,n]:[4,this.updateUserBasicInfo(e)];case 8:a.sent(),a.label=9;case 9:return[4,this.getUser(!1)];case 10:return r=a.sent().data.user,null===(i=this.config.eventBus)||void 0===i||i.fire(be,{event:ve}),[2,{data:{user:r},error:null}];case 11:return o=a.sent(),[2,{data:{user:null},error:new vt(o,{method:"updateUser"})}];case 12:return[2]}})})}},[3,6];case 4:return[4,this.updateUserBasicInfo(e)];case 5:y.sent(),y.label=6;case 6:return[4,this.getUser(!1)];case 7:return h=y.sent().data.user,Object.keys(a).length>0&&(null===(t=this.config.eventBus)||void 0===t||t.fire(be,{event:ve})),[2,{data:Gt({user:h},u),error:null}];case 8:return m=y.sent(),[2,{data:{user:null},error:new vt(m,{method:"updateUser"})}];case 9:return[2]}})})},n.prototype.getUserIdentities=function(){var e;return zt(this,void 0,Promise,function(){var t,n;return Kt(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 vt(n,{method:"getUserIdentities"})}];case 3:return[2]}})})},n.prototype.linkIdentity=function(e){return zt(this,void 0,Promise,function(){var t;return Kt(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"}},"linkIdentity"),[4,this.signInWithOAuth({provider:e.provider,options:{type:xe}})];case 1:return n.sent(),[2,{data:{provider:e.provider},error:null}];case 2:return t=n.sent(),[2,{data:{provider:null},error:new vt(t,{method:"linkIdentity"})}];case 3:return[2]}})})},n.prototype.unlinkIdentity=function(e){return zt(this,void 0,Promise,function(){var t;return Kt(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"}},"unlinkIdentity"),[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 vt(t,{method:"unlinkIdentity"})}];case 3:return[2]}})})},n.prototype.reauthenticate=function(){return zt(this,void 0,Promise,function(){var e,t,n,r,o=this;return Kt(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.getUser(!1)];case 1:return e=i.sent().data.user,this.validateAtLeastOne(e,[["email","phone"]],"reauthenticate"),t=e.email?{email:e.email,usage:ue.REAUTHENTICATION}:{phone_number:this.formatPhone(e.phone)},[4,this.getVerification(t)];case 2:return n=i.sent(),[2,{data:{updateUser:function(e){return zt(o,void 0,Promise,function(){var r,o,i,a,s;return Kt(this,function(c){switch(c.label){case 0:this.validateParams(e,{nonce:{required:!0,message:"Nonce is required"}},"reauthenticate"),c.label=1;case 1:return c.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=c.sent(),[4,this.oauthInstance.authApi.sudo({verification_token:r.verification_token})];case 3:return o=c.sent(),[4,this.oauthInstance.authApi.setPassword({new_password:e.password,sudo_token:o.sudo_token})];case 4:return c.sent(),[3,7];case 5:return[4,this.signInWithUsername(Gt(Gt({verificationInfo:n,verificationCode:e.nonce},t),{loginType:t.email?"email":"phone"}))];case 6:c.sent(),c.label=7;case 7:return[4,this.getSession()];case 8:return i=c.sent().data,[2,{data:{user:(a=(void 0===i?{}:i).session).user,session:a},error:null}];case 9:return s=c.sent(),[2,{data:{user:null,session:null},error:new vt(s,{method:"reauthenticate"})}];case 10:return[2]}})})}},error:null}];case 3:return r=i.sent(),[2,{data:{updateUser:null},error:new vt(r,{method:"reauthenticate"})}];case 4:return[2]}})})},n.prototype.resend=function(e){return zt(this,void 0,Promise,function(){var t,n,r;return Kt(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.validateAtLeastOne(e,[["email"],["phone"]],"resend"),t="signup"===e.type?"ANY":"USER",n={target:t},"email"in e&&(n.email=e.email,n.usage=ue.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 vt(r,{method:"resend"})}];case 3:return[2]}})})},n.prototype.setSession=function(e){return zt(this,void 0,Promise,function(){var t,n,r;return Kt(this,function(o){switch(o.label){case 0:return o.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"}},"setSession"),[4,this.oauthInstance.oauth2client.refreshToken(e,{throwError:!0})];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 vt(r,{method:"setSession"})}];case 4:return[2]}})})},n.prototype.exchangeCodeForSession=function(){return zt(this,void 0,void 0,function(){return Kt(this,function(e){return[2]})})},n.prototype.deleteUser=function(e){return zt(this,void 0,Promise,function(){var t,n;return Kt(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"}},"deleteUser"),[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 vt(n,{method:"deleteUser"})}];case 4:return[2]}})})},n.prototype.toDefaultLoginPage=function(e){return void 0===e&&(e={}),zt(this,void 0,Promise,function(){var t,n,r,o,i;return Kt(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("&"),u.default.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 vt(e,{method:"toDefaultLoginPage"})}]}return[2]})})},n.prototype.signInWithCustomTicket=function(e){return zt(this,void 0,Promise,function(){var t,n,r,o;return Kt(this,function(i){switch(i.label){case 0:e&&this.setCustomSignFunc(e),i.label=1;case 1:return i.trys.push([1,5,,6]),[4,this.oauthInstance.authApi.signInWithCustomTicket()];case 2:return i.sent(),[4,this.createLoginState()];case 3:return t=i.sent(),[4,this.getSession()];case 4:return n=i.sent().data,r=(void 0===n?{}:n).session,[2,Gt(Gt({},t),{data:{user:r.user,session:r},error:null})];case 5:return o=i.sent(),[2,{data:{user:null,session:null},error:new vt(o,{method:"signInWithCustomTicket"})}];case 6:return[2]}})})},n.prototype.signInWithOpenId=function(e){var t=(void 0===e?{}:e).useWxCloud,n=void 0===t||t;return zt(this,void 0,Promise,function(){var e,t,r,o,i,a,s=this;return Kt(this,function(c){switch(c.label){case 0:if(!u.default.isMatch())throw Error("wx api undefined");e=wx.getAccountInfoSync().miniProgram,t=function(t){return zt(s,void 0,void 0,function(){var r,o;return Kt(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]}})})},c.label=1;case 1:return c.trys.push([1,5,,6]),[4,new Promise(function(e,n){wx.login({success:function(r){return zt(s,void 0,void 0,function(){var o;return Kt(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 c.sent(),[4,this.createLoginState()];case 3:return r=c.sent(),[4,this.getSession()];case 4:return o=c.sent().data,i=(void 0===o?{}:o).session,[2,Gt(Gt({},r),{data:{user:i.user,session:i},error:null})];case 5:return a=c.sent(),[2,{data:{user:null,session:null},error:new vt(a,{method:"signInWithOpenId"})}];case 6:return[2]}})})},n.prototype.signInWithPhoneAuth=function(e){var t=e.phoneCode,n=void 0===t?"":t,r=e.useWxCloud,o=void 0!==r&&r;return zt(this,void 0,Promise,function(){var e,t,r,i,a,s,c,l,p;return Kt(this,function(d){switch(d.label){case 0:return u.default.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 vt({message:"wx api undefined"})}];case 1:r=d.sent().code,t.provider_code=r,d.label=2;case 2:return d.trys.push([2,5,,6]),[4,this.oauthInstance.authApi.grantProviderToken(t,o)];case 3:if((i=d.sent()).error_code)throw i;return[4,this.oauthInstance.authApi.signInWithProvider({provider_token:i.provider_token},o)];case 4:if(null==(a=d.sent())?void 0:a.error_code)throw a;return[3,6];case 5:return s=d.sent(),[2,{data:{user:null,session:null},error:new vt(s,{method:"signInWithPhoneAuth"})}];case 6:return[4,this.createLoginState()];case 7:return c=d.sent(),[4,this.getSession()];case 8:return l=d.sent().data,p=(void 0===l?{}:l).session,[2,Gt(Gt({},c),{data:{user:p.user,session:p},error:null})]}})})},n.prototype.bindPhoneNumber=function(e){return zt(this,void 0,void 0,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.editContact(e)]})})},n.prototype.unbindProvider=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.unbindProvider(e)]})})},n.prototype.bindEmail=function(e){return this.oauthInstance.authApi.editContact(e)},n.prototype.verify=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.verify(e)]})})},n.prototype.getVerification=function(e,t){return zt(this,void 0,Promise,function(){return Kt(this,function(n){return e.phone_number&&(e.phone_number=this.formatPhone(e.phone_number)),[2,this.oauthInstance.authApi.getVerification(e,t)]})})},Object.defineProperty(n.prototype,"currentUser",{get:function(){if("async"!==this.cache.mode){var e=this.hasLoginState();return e&&e.user||null}(0,Je.printWarn)(It.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getCurrentUser instead")},enumerable:!1,configurable:!0}),n.prototype.getCurrentUser=function(e){return void 0===e&&(e=!0),zt(this,void 0,Promise,function(){var t,n,r;return Kt(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,Gt(Gt({},n.user),r)];case 8:return[2,null]}})})},n.prototype.signInAnonymouslyInWx=function(e){var t=(void 0===e?{}:e).useWxCloud;return zt(this,void 0,Promise,function(){var e,n,r=this;return Kt(this,function(o){switch(o.label){case 0:if(!u.default.isMatch())throw Error("wx api undefined");return e=wx.getAccountInfoSync().miniProgram,n=function(n){return zt(r,void 0,void 0,function(){var r,o;return Kt(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 zt(r,void 0,void 0,function(){var r;return Kt(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})]}})})},n.prototype.bindOpenId=function(){return zt(this,void 0,Promise,function(){var e,t,n=this;return Kt(this,function(r){switch(r.label){case 0:if(!u.default.isMatch())throw Error("wx api undefined");return e=wx.getAccountInfoSync().miniProgram,t=function(t){return zt(n,void 0,void 0,function(){var n;return Kt(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 zt(n,void 0,void 0,function(){var n;return Kt(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]}})})},n.prototype.signInWithUnionId=function(){return zt(this,void 0,Promise,function(){var e=this;return Kt(this,function(t){switch(t.label){case 0:if(!u.default.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 zt(e,void 0,void 0,function(){var e,i,a,s,c;return Kt(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()]}})})},n.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,c=void 0===s?void 0:s;return zt(this,void 0,Promise,function(){return Kt(this,function(e){try{return[2,this.signInWithUsername({verificationInfo:n,verificationCode:o,bindInfo:c,username:a,loginType:"sms"})]}catch(e){throw e}return[2]})})},n.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,c=void 0===s?"":s;return zt(this,void 0,Promise,function(){return Kt(this,function(e){try{return[2,this.signInWithUsername({verificationInfo:n,verificationCode:o,bindInfo:a,username:c,loginType:"email"})]}catch(e){throw e}return[2]})})},n.prototype.setCustomSignFunc=function(e){this.oauthInstance.authApi.setCustomSignFunc(e)},n.prototype.signIn=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.signIn(e)];case 1:return t.sent(),[2,this.createLoginState(e)]}})})},n.prototype.setPassword=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.setPassword(e)]})})},n.prototype.isUsernameRegistered=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){switch(t.label){case 0:return"string"!=typeof e&&(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"username must be a string"),[4,this.oauthInstance.authApi.checkIfUserExist({username:e})];case 1:return[2,t.sent().exist]}})})},n.prototype.hasLoginState=function(){var e;if("async"!==this.cache.mode)return(null===(e=this.oauthInstance)||void 0===e?void 0:e.authApi.hasLoginStateSync())?new an({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance}):null;(0,Je.printWarn)(It.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getLoginState instead")},n.prototype.getLoginState=function(){return zt(this,void 0,Promise,function(){var e;return Kt(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 an({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance})]:[2,null]}})})},n.prototype.getUserInfo=function(){return zt(this,void 0,Promise,function(){return Kt(this,function(e){return[2,this.getCurrentUser()]})})},n.prototype.getWedaUserInfo=function(){return zt(this,void 0,Promise,function(){return Kt(this,function(e){return[2,this.oauthInstance.authApi.getWedaUserInfo()]})})},n.prototype.updateUserBasicInfo=function(e){return zt(this,void 0,void 0,function(){var t;return Kt(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]}})})},n.prototype.getAuthHeader=function(){return console.error("Auth.getAuthHeader API 已废弃"),{}},n.prototype.bindWithProvider=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.bindWithProvider(e)]})})},n.prototype.queryUser=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.queryUserProfile(e)]})})},n.prototype.getAccessToken=function(){return zt(this,void 0,Promise,function(){return Kt(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}]}})})},n.prototype.grantProviderToken=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.grantProviderToken(e)]})})},n.prototype.patchProviderToken=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.patchProviderToken(e)]})})},n.prototype.signInWithProvider=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.signInWithProvider(e)];case 1:return t.sent(),[2,this.createLoginState(e)]}})})},n.prototype.signInWithWechat=function(e){return void 0===e&&(e={}),zt(this,void 0,void 0,function(){return Kt(this,function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.signInWithWechat(e)];case 1:return t.sent(),[2,this.createLoginState(e)]}})})},n.prototype.grantToken=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.grantToken(e)];case 1:return t.sent(),[2,this.createLoginState()]}})})},n.prototype.genProviderRedirectUri=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.genProviderRedirectUri(e)]})})},n.prototype.resetPassword=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.resetPassword(e)]})})},n.prototype.deviceAuthorize=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.deviceAuthorize(e)]})})},n.prototype.sudo=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.sudo(e)]})})},n.prototype.deleteMe=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.deleteMe(e)]})})},n.prototype.getProviders=function(){return zt(this,void 0,Promise,function(){return Kt(this,function(e){return[2,this.oauthInstance.authApi.getProviders()]})})},n.prototype.loginScope=function(){return zt(this,void 0,Promise,function(){return Kt(this,function(e){return[2,this.oauthInstance.authApi.loginScope()]})})},n.prototype.loginGroups=function(){return zt(this,void 0,Promise,function(){return Kt(this,function(e){return[2,this.oauthInstance.authApi.loginGroups()]})})},n.prototype.onLoginStateChanged=function(e){var t;return zt(this,void 0,void 0,function(){var n,r=this;return Kt(this,function(o){switch(o.label){case 0:return null===(t=this.config.eventBus)||void 0===t||t.on(ge,function(t){return zt(r,void 0,void 0,function(){var n,r,o;return Kt(this,function(i){switch(i.label){case 0:return(null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.eventType)===pe?[3,2]:[4,this.getLoginState()];case 1:return r=i.sent(),[3,3];case 2:r={},i.label=3;case 3:return n=r,e.call(this,Gt(Gt({},t),n)),[2]}})})}),[4,this.getLoginState()];case 1:return n=o.sent(),e.call(this,n),[2]}})})},n.prototype.refreshTokenForce=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.refreshTokenForce(e)]})})},n.prototype.getCredentials=function(){return zt(this,void 0,Promise,function(){return Kt(this,function(e){return[2,this.oauthInstance.authApi.getCredentials()]})})},n.prototype.setCredentials=function(e){return zt(this,void 0,void 0,function(){return Kt(this,function(t){switch(t.label){case 0:return[4,this.oauthInstance.oauth2client.setCredentials(e)];case 1:return t.sent(),[2]}})})},n.prototype.getProviderSubType=function(){return zt(this,void 0,Promise,function(){return Kt(this,function(e){return[2,this.oauthInstance.authApi.getProviderSubType()]})})},n.prototype.createCaptchaData=function(e){return zt(this,void 0,void 0,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.createCaptchaData(e)]})})},n.prototype.verifyCaptchaData=function(e){return zt(this,void 0,void 0,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.verifyCaptchaData(e)]})})},n.prototype.getMiniProgramQrCode=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.getMiniProgramCode(e)]})})},n.prototype.getMiniProgramQrCodeStatus=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.getMiniProgramQrCodeStatus(e)]})})},n.prototype.modifyPassword=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.modifyPassword(e)]})})},n.prototype.modifyPasswordWithoutLogin=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.modifyPasswordWithoutLogin(e)]})})},n.prototype.getUserBehaviorLog=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.getUserBehaviorLog(e)]})})},n.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,i=e.username,a=void 0===i?"":i,s=e.bindInfo,c=void 0===s?void 0:s,u=e.loginType,l=void 0===u?"":u;return zt(this,void 0,Promise,function(){var e,t,r,i,s,u,p;return Kt(this,function(d){switch(d.label){case 0:return d.trys.push([0,8,,9]),[4,this.oauthInstance.authApi.verify({verification_id:n.verification_id,verification_code:o})];case 1:if(null==(e=d.sent())?void 0:e.error_code)throw e;return t=e.verification_token,r=this.formatPhone(a),i={phone_number:r},"email"===l&&(i={email:r=a}),n.is_user?[4,this.oauthInstance.authApi.signIn({username:r,verification_token:t})]:[3,5];case 2:if(null==(s=d.sent())?void 0:s.error_code)throw s;return c?[4,this.oauthInstance.authApi.bindWithProvider({provider_token:null==c?void 0:c.providerToken})]:[3,4];case 3:if(null==(u=d.sent())?void 0:u.error_code)throw u;d.label=4;case 4:return[3,7];case 5:return[4,this.oauthInstance.authApi.signUp(Gt(Gt({},i),{verification_token:t,provider_token:null==c?void 0:c.providerId}))];case 6:if(null==(p=d.sent())?void 0:p.error_code)throw p;d.label=7;case 7:return[2,this.createLoginState()];case 8:throw d.sent();case 9:return[2]}})})},n.prototype.createLoginState=function(e,t){return zt(this,void 0,Promise,function(){var n;return Kt(this,function(r){switch(r.label){case 0:return[4,(n=new an({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance})).checkLocalStateAsync()];case 1:return r.sent(),(null==t?void 0:t.userInfo)?(n.user.setLocalUserInfo(t.userInfo),[3,5]):[3,2];case 2:return(null==t?void 0:t.asyncRefreshUser)?(n.user.refresh(e),[3,5]):[3,3];case 3:return[4,n.user.refresh(e)];case 4:r.sent(),r.label=5;case 5:return[2,n]}})})},n.prototype.setAccessKey=function(){var e,t;return zt(this,void 0,void 0,function(){var n,r;return Kt(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=_e),!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]})})},n.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)},n.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)}})})},n.prototype.setupListeners=function(){var e,t=this;null===(e=this.config.eventBus)||void 0===e||e.on(be,function(e){return zt(t,void 0,void 0,function(){var t,n,r,o,i,a,s;return Kt(this,function(c){switch(c.label){case 0:return t=null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.event,n=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.info,t!==fe||n?[3,2]:[4,this.getUser(!0)];case 1:r=c.sent().data,(o=(void 0===r?{}:r).user)&&(n={user:o}),c.label=2;case 2:return[4,this.getSession()];case 3:return i=c.sent().data.session,this.notifyListeners(t,i,n),[2]}})})})},n.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}},n.prototype.missingRequiredParam=function(e,t){return new vt({error:"missing_required_param",error_code:4e3,error_description:"auth.".concat(e,"(params): missing required param '").concat(t,"'")},{method:e})},n.prototype.validateParams=function(e,t,n){for(var r=0,o=Object.entries(t);r<o.length;r++){var i=o[r],a=i[0];if(i[1].required&&(void 0===(null==e?void 0:e[a])||null===(null==e?void 0:e[a])||""===(null==e?void 0:e[a])))throw this.missingRequiredParam(n,a)}},n.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 this.missingRequiredParam(n,t.map(function(e){return e.join("|")}).join("|"))},n.prototype.init=function(){var e;return zt(this,void 0,Promise,function(){return Kt(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()&&!this.oauthInstance.oauth2client.initSessionEmitted&&(null===(e=this.config.eventBus)||void 0===e||e.fire(be,{event:he})),[3,3];case 2:return t.sent(),[3,3];case 3:return[2,{error:null}]}})})},Vt([(0,St.catchErrorsDecorator)({title:"绑定手机号失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindPhoneNumber() 的语法或参数是否正确"," 2 - 当前环境是否开通了短信验证码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",["function"==typeof(o=e.BindPhoneRequest)?o:Object]),Ht("design:returntype",Promise)],n.prototype,"bindPhoneNumber",null),Vt([(0,St.catchErrorsDecorator)({title:"解除三方绑定失败",messages:["请确认以下各项:"," 1 - 调用 auth().unbindProvider() 的语法或参数是否正确"," 2 - 当前账户是否已经与此登录方式解绑","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",["function"==typeof(i=e.UnbindProviderRequest)?i:Object]),Ht("design:returntype","function"==typeof(a="undefined"!=typeof Promise&&Promise)?a:Object)],n.prototype,"unbindProvider",null),Vt([(0,St.catchErrorsDecorator)({title:"绑定邮箱地址失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindEmail() 的语法或参数是否正确"," 2 - 当前环境是否开通了邮箱密码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",["function"==typeof(s=e.BindEmailRequest)?s:Object]),Ht("design:returntype",void 0)],n.prototype,"bindEmail",null),Vt([(0,St.catchErrorsDecorator)({title:"验证码验证失败",messages:["请确认以下各项:"," 1 - 调用 auth().verify() 的语法或参数是否正确"," 2 - 当前环境是否开通了手机验证码/邮箱登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",["function"==typeof(c=e.VerifyRequest)?c:Object]),Ht("design:returntype","function"==typeof(l="undefined"!=typeof Promise&&Promise)?l:Object)],n.prototype,"verify",null),Vt([(0,St.catchErrorsDecorator)({title:"获取验证码失败",messages:["请确认以下各项:"," 1 - 调用 auth().getVerification() 的语法或参数是否正确"," 2 - 当前环境是否开通了手机验证码/邮箱登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",["function"==typeof(p=e.GetVerificationRequest)?p:Object,Object]),Ht("design:returntype","function"==typeof(d="undefined"!=typeof Promise&&Promise)?d:Object)],n.prototype,"getVerification",null),Vt([(0,St.catchErrorsDecorator)({title:"获取用户信息失败",messages:["请确认以下各项:"," 1 - 调用 auth().getCurrentUser() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[Object]),Ht("design:returntype","function"==typeof(f="undefined"!=typeof Promise&&Promise)?f:Object)],n.prototype,"getCurrentUser",null),Vt([(0,St.catchErrorsDecorator)({title:"小程序匿名登录失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了匿名登录"," 2 - 调用 auth().signInAnonymouslyInWx() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[Object]),Ht("design:returntype","function"==typeof(h="undefined"!=typeof Promise&&Promise)?h:Object)],n.prototype,"signInAnonymouslyInWx",null),Vt([(0,St.catchErrorsDecorator)({title:"小程序绑定OpenID失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序openId静默登录"," 2 - 调用 auth().bindOpenId() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[]),Ht("design:returntype","function"==typeof(m="undefined"!=typeof Promise&&Promise)?m:Object)],n.prototype,"bindOpenId",null),Vt([(0,St.catchErrorsDecorator)({title:"小程序unionId静默登录失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序unionId静默登录"," 2 - 调用 auth().signInWithUnionId() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[]),Ht("design:returntype","function"==typeof(v="undefined"!=typeof Promise&&Promise)?v:Object)],n.prototype,"signInWithUnionId",null),Vt([(0,St.catchErrorsDecorator)({title:"短信验证码登陆",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序短信验证码登陆"," 2 - 调用 auth().signInWithSms() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[Object]),Ht("design:returntype","function"==typeof(y="undefined"!=typeof Promise&&Promise)?y:Object)],n.prototype,"signInWithSms",null),Vt([(0,St.catchErrorsDecorator)({title:"邮箱验证码登陆",messages:["请确认以下各项:"," 1 - 当前环境是否开启了邮箱登陆"," 2 - 调用 auth().signInWithEmail() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[Object]),Ht("design:returntype","function"==typeof(g="undefined"!=typeof Promise&&Promise)?g:Object)],n.prototype,"signInWithEmail",null),Vt([(0,St.catchErrorsDecorator)({title:"获取用户是否被占用失败",messages:["请确认以下各项:"," 1 - 调用 auth().isUsernameRegistered() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[String]),Ht("design:returntype","function"==typeof(b="undefined"!=typeof Promise&&Promise)?b:Object)],n.prototype,"isUsernameRegistered",null),Vt([(0,St.catchErrorsDecorator)({title:"获取本地登录态失败",messages:["请确认以下各项:"," 1 - 调用 auth().getLoginState() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[]),Ht("design:returntype","function"==typeof(w="undefined"!=typeof Promise&&Promise)?w:Object)],n.prototype,"getLoginState",null),Vt([(0,St.catchErrorsDecorator)({title:"获取用户信息失败",messages:["请确认以下各项:"," 1 - 是否已登录"," 2 - 调用 auth().getUserInfo() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[]),Ht("design:returntype","function"==typeof(x="undefined"!=typeof Promise&&Promise)?x:Object)],n.prototype,"getUserInfo",null),Vt([(0,St.catchErrorsDecorator)({title:"获取微搭插件用户信息失败",messages:["请确认以下各项:"," 1 - 是否已登录"," 2 - 调用 auth().getWedaUserInfo() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[]),Ht("design:returntype","function"==typeof(_="undefined"!=typeof Promise&&Promise)?_:Object)],n.prototype,"getWedaUserInfo",null),Vt([(0,St.catchErrorsDecorator)({title:"绑定第三方登录方式失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindWithProvider() 的语法或参数是否正确"," 2 - 此账户是否已经绑定此第三方","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",["function"==typeof(E=e.BindWithProviderRequest)?E:Object]),Ht("design:returntype","function"==typeof(I="undefined"!=typeof Promise&&Promise)?I:Object)],n.prototype,"bindWithProvider",null),Vt([(0,St.catchErrorsDecorator)({title:"获取身份源类型",messages:["请确认以下各项:"," 1 - 调用 auth().getProviderSubType() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[]),Ht("design:returntype","function"==typeof(S="undefined"!=typeof Promise&&Promise)?S:Object)],n.prototype,"getProviderSubType",null),n}(Bt),cn="auth";function un(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 ln={name:"auth",namespace:cn,entity:function(e){var t=function(e){var t,n=this;if(this.authInstance&&!e)return this.authInstance;e=e||{region:"",persistence:"local",apiPath:ce};var r=this.platform.adapter,o=e.persistence||r.primaryStorage;o&&o!==this.config.persistence&&this.updateConfig({persistence:o});var i=function(e,t){var n,r,o,i,a=this,s=e.region,c=void 0===s?"ap-shanghai":s,u=e.i18n,l=e.accessKey,p=e.useWxCloud,d=(null==t?void 0:t.platform)||At.useDefaultAdapter.bind(t)(),f=d.runtime,h=d.adapter,m=t||{},v=m.env,y=m.clientId,g=m.debug,b=m.cache,w=m.app,x=m.getApiOrigin,_=(t||{}).apiOrigin;_||(_="https://".concat(v,".").concat(c,".tcb-api.tencentcloudapi.com"));var E={env:v,clientId:y,i18n:u,accessKey:l,useWxCloud:p,eventBus:new Ke.CloudbaseEventEmitter},I=new Et(Ut(Gt(Gt({},E),{apiOrigin:_,getApiOrigin:x,apiPath:(null==e?void 0:e.apiPath)||ce,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:h,onCredentialsError:Yt(E.eventBus),headers:Gt({"X-SDK-Version":"@cloudbase/js-sdk/".concat(e.sdkVersion)},e.headers||{}),detectSessionInUrl:e.detectSessionInUrl,debug:g,auth:null===(r=null===(n=t.app)||void 0===n?void 0:n.config)||void 0===r?void 0:r.auth}))),S=new sn(Gt(Gt({},E),{region:c,persistence:e.persistence,debug:g,cache:b||new Ot.CloudbaseCache({persistence:e.persistence,keys:{userInfoKey:"user_info_".concat(v)},platformInfo:d}),runtime:f||"web",_fromApp:w,oauthInstance:I,auth:null===(i=null===(o=t.app)||void 0===o?void 0:o.config)||void 0===i?void 0:i.auth}));return I.initializeSession(function(e,t){return zt(a,void 0,void 0,function(){return Kt(this,function(n){return e?(e.type===we?t?E.eventBus.fire(be,{event:fe,info:Gt(Gt({},e),{error:t})}):e.user&&S.createLoginState({},{userInfo:e.user}):e.type===xe&&E.eventBus.fire(be,{event:ye,info:Gt(Gt({},e),{error:t})}),[2]):[2]})})}),{authInstance:S,oauthInstance:I}}(Gt(Gt({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}),a=i.authInstance,s=i.oauthInstance;return this.oauthInstance=s,this.authInstance=a,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=un(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[cn]=r,r}};try{cloudbase.registerComponent(ln)}catch(e){}var pn=__webpack_require__(3388),dn=function(){return dn=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},dn.apply(this,arguments)},fn=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())})},hn=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])}}},mn=r._G.Sg,vn="cloudrun",yn=function(){function e(){}return e.prototype.callContainer=function(e,t){return fn(this,void 0,void 0,function(){var n,r,o;return hn(this,function(i){switch(i.label){case 0:if(n=e.name,r=e.data,!n)throw new Error(JSON.stringify({code:mn.INVALID_PARAMS,msg:"[".concat(vn,".callContainer] invalid name")}));try{o=r?JSON.stringify(r):""}catch(e){throw new Error(JSON.stringify({code:mn.INVALID_PARAMS,msg:"[".concat(vn,".callContainer] invalid data")}))}return[4,gn.call(this,dn(dn({},e),{data:o}),t)];case 1:return[2,i.sent()]}})})},e}();function gn(e,t){var n;return fn(this,void 0,void 0,function(){var r,o,i,a,s,c,u,l,p,d,f,h,m,v,y;return hn(this,function(g){switch(g.label){case 0:if(r=e.name,o=e.data,i=e.path,a=void 0===i?"":i,s=e.method,c=e.header,u=void 0===c?{}:c,l=this.getEndPointWithKey("GATEWAY"),p=l.BASE_URL,d=l.PROTOCOL,f="".concat(d).concat(p,"/cloudrun/").concat(r),h=a.startsWith("/")?a:"/".concat(a),m=["GET","HEAD"].includes(null===(n=null==s?void 0:s.toUpperCase)||void 0===n?void 0:n.call(s)))try{v={};try{v=JSON.parse(o)}catch(e){v=o||{}}h="".concat(h).concat(h.includes("?")?"&":"?").concat(Object.keys(v).map(function(e){return"".concat(e,"=").concat(v[e])}).join("&"))}catch(e){}return[4,this.request.fetch(dn(dn({method:s||"POST",headers:Object.assign({},{"Content-Type":"application/json; charset=utf-8"},u)},m?{}:{body:o}),{url:"".concat(f).concat(h),customReqOpts:t}))];case 1:return y=g.sent(),"node-sdk"===(null==t?void 0:t.from)?[2,y]:[4,y.data];case 2:return[2,g.sent()]}})})}var bn=new yn,wn={name:vn,entity:{callContainer:bn.callContainer}};try{cloudbase.registerComponent(wn)}catch(e){}function xn(e){try{e.registerComponent(wn)}catch(e){console.warn(e)}}try{window.registerCloudrun=xn}catch(e){}var _n=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)},En=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},In=r._G.eX,Sn=r._G.Sg,On=r._G.vM,An=r.P6.execCallback,Tn=r.P6.createCloudbaseError,Pn=r.P6.resolveThrow,Rn=r.P6.maybeThrow,Cn=r.BM.D,Nn="functions",kn=function(){function e(){}var t,n,o;return e.prototype.callFunction=function(e,t,n){var o,i,a,s,c,u,l;return s=this,c=void 0,l=function(){var s,c,u,l,p,d,f,h,m,v,y,g,b,w,x,_,E,I,S,O,A,T,P,R;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(C){switch(C.label){case 0:if(s=e.name,c=e.data,u=e.query,l=e.parse,p=e.search,d=e.type,f=e.path,h=void 0===f?"":f,m=e.method,v=e.header,y=void 0===v?{}:v,b=(g=this).request,w=g.config,!s)return[2,Rn(w,{code:Sn.INVALID_PARAMS,msg:"[".concat(Nn,".callFunction] invalid function name")})];try{x=c?JSON.stringify(c):""}catch(e){return[2,Rn(w,{code:Sn.INVALID_PARAMS,msg:"[".concat(Nn,".callFunction] invalid data")})]}return"cloudrun"!==d?[3,2]:(_=r.P6.generateRequestId(),[4,gn.call(this,{name:s,data:x,path:h,method:m,header:_n(_n({},y),{"X-Request-Id":_})})]);case 1:return[2,{result:P=C.sent(),requestId:_}];case 2:E="functions.invokeFunction",I={inQuery:u,parse:l,search:p,function_name:s,request_data:x},S={},O=!("GATEWAY"!==w.endPointMode||(N=s,"lcap-common-service"===N||"lcap-datasource-test"===N||N.startsWith("lcap-data")||N.startsWith("lowcode-datasource")||"cloudbase_module"===N)||function(e){return"lowcode-wx-datasource"===e}(s)),C.label=3;case 3:return C.trys.push([3,8,,9]),O?[4,b.gateWay(_n(_n({},e),{path:"functions"}),n)]:[3,5];case 4:return A=C.sent(),S=_n({requestId:A.requestId},(null===(o=A.data)||void 0===o?void 0:o.code)?A.data:{data:{response_data:A.data}}),[3,7];case 5:return[4,b.send(E,I,{endPointMode:"CLOUD_API",defaultQuery:(null===(i=null==c?void 0:c.params)||void 0===i?void 0:i.action)?{action:null===(a=null==c?void 0:c.params)||void 0===a?void 0:a.action}:{}},n)];case 6:S=C.sent(),C.label=7;case 7:if(S.code){if(T=S.message||S.msg||"",function(e){return Pn(e)}(w))throw Tn({code:S.code,msg:T,requestId:S.requestId},null==w?void 0:w.errorFactory);return[2,An(t,null,{code:S.code,message:T,requestId:S.requestId})]}if(P=S.data.response_data,l||O)return[2,An(t,null,{result:P,requestId:S.requestId})];try{return P=JSON.parse(S.data.response_data),[2,An(t,null,{result:P,requestId:S.requestId})]}catch(e){An(t,new Error("[".concat(In(),"][").concat(Sn.INVALID_PARAMS,"][").concat(Nn,".callFunction] response data must be json")))}return[3,9];case 8:return R=C.sent(),An(t,R),[3,9];case 9:return[2]}var N})},new((u=void 0)||(u=Promise))(function(e,t){function n(e){try{o(l.next(e))}catch(e){t(e)}}function r(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){var o;t.done?e(t.value):(o=t.value,o instanceof u?o:new u(function(e){e(o)})).then(n,r)}o((l=l.apply(s,c||[])).next())})},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);i>3&&a&&Object.defineProperty(t,n,a)}([Cn({customInfo:{className:"Cloudbase",methodName:"callFunction"},title:"函数调用失败",messages:["请确认以下各项:"," 1 - 调用 callFunction() 的语法或参数是否正确"," 2 - 当前环境下是否存在此函数"," 3 - 函数安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(On)]}),En("design:type",Function),En("design:paramtypes",["function"==typeof(t=void 0!==pn.ICallFunctionOptions&&pn.ICallFunctionOptions)?t:Object,"function"==typeof(n="undefined"!=typeof Function&&Function)?n:Object,"function"==typeof(o=void 0!==pn.ICustomReqOpts&&pn.ICustomReqOpts)?o:Object]),En("design:returntype",Promise)],e.prototype,"callFunction",null),e}(),Un=new kn,jn={name:Nn,entity:{callFunction:Un.callFunction}};try{cloudbase.registerComponent(jn)}catch(e){}var Ln=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)}}(),Dn=function(e){function t(t){var n=e.call(this,t)||this;return n.__isStorageError=!0,n.name="StorageError",n}return Ln(t,e),t}(Error);function qn(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}var Mn,Fn=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 Ln(t,e),t.prototype.toJSON=function(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}},t}(Dn);function Bn(){return globalThis.Buffer}function Wn(e){var t=Bn();return t?t.from(e).toString("base64"):btoa(e)}function Gn(e){return e.split("/").map(function(e){return encodeURIComponent(e)}).join("/")}Ln(function(e,t){var n=Mn.call(this,e)||this;return n.name="StorageUnknownError",n.originalError=t,n},Mn=Dn);var Vn=function(){return Vn=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},Vn.apply(this,arguments)},Hn=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())})},zn=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])}}},Kn="/v1/storages";function Jn(e,t){return Hn(this,void 0,Promise,function(){var n;return zn(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 qn(n)?[2,{data:null,error:n}]:[2,{data:null,error:new Dn((null==n?void 0:n.message)||String(n))}];case 3:return[2]}})})}var Yn=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(Kn).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(Kn).concat(e.startsWith("/")?"":"/").concat(e):e},e.prototype.send=function(e){return Hn(this,void 0,Promise,function(){var t,n,r,o,i,a;return zn(this,function(s){switch(s.label){case 0:return t=this.buildUrl(e.path,e.query),n=e.method.toUpperCase(),r=["GET","HEAD"].includes(n),o=Vn({},e.headers||{}),r||(void 0!==e.rawBody?i=e.rawBody:void 0!==e.json&&(o["Content-Type"]=o["Content-Type"]||"application/json",i=JSON.stringify(e.json))),[4,this.request.fetch(Vn(Vn(Vn(Vn({url:t,method:n,headers:o},void 0!==i?{body:i}:{}),{withCredentials:!1!==e.withCredentials,shouldThrowOnError:!1}),e.signal?{signal:e.signal}:{}),e.cache?{cache:e.cache}:{}))];case 1:return a=s.sent(),[2,this.unwrap(a,t)]}})})},e.prototype.download=function(e){var t,n;return Hn(this,void 0,Promise,function(){var r,o,i,a;return zn(this,function(s){switch(s.label){case 0:return r=this.buildUrl(e.path,e.query),[4,this.request.fetch(Vn(Vn({url:r,method:"GET",headers:Vn({},e.headers||{}),stream:!0,withCredentials:!1!==e.withCredentials,shouldThrowOnError:!1},e.signal?{signal:e.signal}:{}),e.cache?{cache:e.cache}:{}))];case 1:if(o=s.sent(),null===(t=e.signal)||void 0===t?void 0:t.aborted)throw new Fn("The download was aborted",0,"STORAGE_PG_ABORTED");if(304===(i=Number(null!==(n=null==o?void 0:o.statusCode)&&void 0!==n?n:200)))throw new Fn("Not Modified",i,"STORAGE_PG_NOT_MODIFIED");if(i>=400)throw new Fn("Download failed with status ".concat(i),i,"STORAGE_PG_REQUEST_FAIL");if(!(a=null==o?void 0:o.response))throw new Fn("Underlying adapter did not expose the raw Response",i,"STORAGE_PG_NO_RESPONSE");return[2,{response:a,status:i,header:null==o?void 0:o.header}]}})})},e.prototype.unwrap=function(e,t){var n,r;return Hn(this,void 0,Promise,function(){var o,i,a,s;return zn(this,function(c){switch(c.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),i=null==e?void 0:e.data,c.label=1;case 1:return c.trys.push([1,3,,4]),[4,i];case 2:return i=c.sent(),[3,4];case 3:return c.sent(),i=void 0,[3,4];case 4:if(o>=200&&o<300)return[2,i];throw a=(null==i?void 0:i.code)||(null==i?void 0:i.error)||"STORAGE_PG_REQUEST_FAIL",s=(null==i?void 0:i.message)||"Storage request failed with status ".concat(o,": ").concat(t),new Fn(s,o,a)}})})},e}(),$n=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)},Xn=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())})},Qn=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 Zn(e){return qn(e)?e:new Dn((null==e?void 0:e.message)||String(e))}function er(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 tr=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 Xn(this,void 0,Promise,function(){var n,r,o,i,a;return Qn(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),n=er(this.ctx.options),r=n.headers,o=n.query,[4,this.ctx.http.download({path:"/object/".concat(this.ctx.bucketId,"/").concat(Gn(this.ctx.cleanName)),headers:$n($n({},this.ctx.headers),r),query:o,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(!(i=s.sent().response).body)throw new Fn("Response body is empty",i.status,"STORAGE_PG_EMPTY_BODY");return[2,{data:i.body,error:null}];case 2:if(a=s.sent(),this.ctx.shouldThrowOnError)throw a;return[2,{data:null,error:Zn(a)}];case 3:return[2]}})})},e}(),nr=function(){function e(e){this.ctx=e}return e.prototype.asStream=function(){return new tr(this.ctx)},e.prototype.then=function(e,t){return this.execute().then(e,t)},e.prototype.execute=function(){var e,t;return Xn(this,void 0,Promise,function(){var n,r,o,i,a,s;return Qn(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),n=er(this.ctx.options),r=n.headers,o=n.query,[4,this.ctx.http.download({path:"/object/".concat(this.ctx.bucketId,"/").concat(Gn(this.ctx.cleanName)),headers:$n($n({},this.ctx.headers),r),query:o,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 i=c.sent().response,s={},[4,i.blob()];case 2:return[2,(s.data=c.sent(),s.error=null,s)];case 3:if(a=c.sent(),this.ctx.shouldThrowOnError)throw a;return[2,{data:null,error:Zn(a)}];case 4:return[2]}})})},e}(),rr=function(){return rr=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},rr.apply(this,arguments)},or=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())})},ir=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])}}},ar="3600",sr=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 Dn("setHeader requires a non-empty header name");if(/[\r\n]/.test(e)||"string"==typeof t&&/[\r\n]/.test(t))throw new Dn("setHeader does not allow CR/LF characters in header name or value");return this.headers=rr(rr({},this.headers),((n={})[e]=String(t),n)),this},e.prototype.upload=function(e,t,n){return or(this,void 0,Promise,function(){return ir(this,function(r){return[2,this.uploadOrUpdate("POST",e,t,n)]})})},e.prototype.update=function(e,t,n){return or(this,void 0,Promise,function(){return ir(this,function(r){return[2,this.uploadOrUpdate("PUT",e,t,n)]})})},e.prototype.download=function(e,t,n){return new nr({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 or(this,void 0,Promise,function(){var r=this;return ir(this,function(o){return[2,Jn(function(){return or(r,void 0,void 0,function(){var r;return ir(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 or(this,void 0,Promise,function(){var t=this;return ir(this,function(n){return[2,Jn(function(){return or(t,void 0,void 0,function(){var t,n,r,o,i,a=this;return ir(this,function(s){switch(s.label){case 0:t=e.map(function(e){return a.cleanPath(e)}),n=[],r=0,s.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:i=s.sent(),Array.isArray(i)&&n.push.apply(n,i),s.label=3;case 3:return r+=100,[3,1];case 4:return[2,n]}})})},this.shouldThrowOnError)]})})},e.prototype.copy=function(e,t,n){return or(this,void 0,Promise,function(){var r=this;return ir(this,function(o){return[2,Jn(function(){return or(r,void 0,void 0,function(){var r;return ir(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 or(this,void 0,Promise,function(){var r=this;return ir(this,function(o){return[2,Jn(function(){return or(r,void 0,void 0,function(){return ir(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 or(this,void 0,Promise,function(){var t=this;return ir(this,function(n){return[2,Jn(function(){return or(t,void 0,void 0,function(){var t,n;return ir(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 or(this,void 0,Promise,function(){var t,n,r;return ir(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 Dn?n:new Dn((null==n?void 0:n.message)||String(n))}];case 3:return[2]}})})},e.prototype.createSignedUrl=function(e,t,n){return or(this,void 0,Promise,function(){var r=this;return ir(this,function(o){return[2,Jn(function(){return or(r,void 0,void 0,function(){var r,o,i;return ir(this,function(a){switch(a.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=a.sent(),i=o.fullSignedURL||this.http.toFullUrl(o.signedURL||""),[2,{fullSignedURL:this.appendUrlOptions(i,n)}]}})})},this.shouldThrowOnError)]})})},e.prototype.createSignedUrls=function(e,t,n){return or(this,void 0,Promise,function(){var r=this;return ir(this,function(o){return[2,Jn(function(){return or(r,void 0,void 0,function(){var r,o,i,a,s=this;return ir(this,function(c){switch(c.label){case 0:r=e.map(function(e){return s.cleanPath(e)}),o=[],i=0,c.label=1;case 1:return i<r.length?(a=r.slice(i,i+500),[4,this.send({method:"POST",path:"/object/sign/".concat(this.bucketId),json:{expiresIn:t,paths:a}})]):[3,4];case 2:c.sent().forEach(function(e){var t,r=e.fullSignedURL||(e.signedURL?s.http.toFullUrl(e.signedURL):null);o.push({path:e.path,fullSignedURL:r?s.appendUrlOptions(r,n):null,error:null!==(t=e.error)&&void 0!==t?t:null})}),c.label=3;case 3:return i+=500,[3,1];case 4:return[2,o]}})})},this.shouldThrowOnError)]})})},e.prototype.createSignedUploadUrl=function(e,t){return or(this,void 0,Promise,function(){var n=this;return ir(this,function(r){return[2,Jn(function(){return or(n,void 0,void 0,function(){var n,r,o;return ir(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 or(this,void 0,Promise,function(){var o=this;return ir(this,function(i){return[2,Jn(function(){return or(o,void 0,void 0,function(){var o,i,a,s,c;return ir(this,function(u){switch(u.label){case 0:return o=this.cleanPath(e),i=this.buildUploadBody(n,r),a=i.body,s=i.headers,[4,this.send({method:"PUT",path:"/object/upload/sign/".concat(this.bucketId,"/").concat(this.encodePath(o)),query:{token:t},rawBody:a,headers:s,withCredentials:!1})];case 1:return c=u.sent(),[2,{path:o,fullPath:c.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(rr(rr({},e),{headers:rr(rr({},this.headers),e.headers||{})}))},e.prototype.uploadOrUpdate=function(e,t,n,r){return or(this,void 0,Promise,function(){var o=this;return ir(this,function(i){return[2,Jn(function(){return or(o,void 0,void 0,function(){var o,i,a,s,c;return ir(this,function(u){switch(u.label){case 0:return o=this.cleanPath(t),i=this.buildUploadBody(n,r),a=i.body,s=i.headers,"POST"===e&&(s["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:a,headers:s})];case 1:return[2,{id:(c=u.sent()).Id,path:o,fullPath:c.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 Dn('invalid path: ".." segment is not allowed');return t},e.prototype.encodePath=function(e){return Gn(e)},e.prototype.buildUploadBody=function(e,t){var n,r,o,i,a,s=rr({},(null==t?void 0:t.headers)||{}),c=e,u="undefined"!=typeof FormData&&e instanceof FormData;if("undefined"!=typeof Blob&&e instanceof Blob||u){var l=void 0,p={};if(u){var d=this.extractFromFormData(e);l=d.file,p=d.fields}else l=e;var f=null!==(r=null!==(n=null==t?void 0:t.cacheControl)&&void 0!==n?n:p.cacheControl)&&void 0!==r?r:ar,h=null!==(o=null==t?void 0:t.contentType)&&void 0!==o?o:p.contentType,m=void 0!==(null==t?void 0:t.metadata)?JSON.stringify(t.metadata):p.metadata,v=new FormData;void 0!==f&&v.append("cacheControl",String(f)),void 0!==h&&v.append("contentType",h),void 0!==m&&v.append("metadata",m),v.append("",l),c=v}else c=e,f=null!==(i=null==t?void 0:t.cacheControl)&&void 0!==i?i:ar,h=null!==(a=null==t?void 0:t.contentType)&&void 0!==a?a:"text/plain;charset=UTF-8",s["cache-control"]="max-age=".concat(f),h&&(s["content-type"]=h),(null==t?void 0:t.metadata)&&(s["x-metadata"]=this.toBase64(JSON.stringify(t.metadata)));return{body:c,headers:s}},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 Dn("FormData must contain a file");if(r>1)throw new Dn("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 Wn(e)},e}(),cr=/[\x00-\x20\x7f/\\?#%]/;function ur(e,t){if("string"!=typeof e||0===e.length)throw new Dn("[storage.".concat(t,"] bucketId is required"));if(e.length>256)throw new Dn("[storage.".concat(t,"] invalid bucketId: length must be 1-").concat(256));var n=cr.exec(e);if(n){var r="[storage.".concat(t,'] invalid bucketId "').concat(e,'": ')+"contains forbidden character ".concat(JSON.stringify(n[0]),"; ")+'must not contain whitespace, control chars, "/", "\\", "?", "#" or "%"';throw new Dn(r)}}var lr,pr=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())})},dr=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])}}},fr=function(){function e(e,t){void 0===t&&(t=!1),this.http=new Yn(e),this.shouldThrowOnError=t}return e.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},e.prototype.listBuckets=function(e){return pr(this,void 0,Promise,function(){var t=this;return dr(this,function(n){return[2,Jn(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 pr(this,void 0,Promise,function(){var t=this;return dr(this,function(n){return[2,Jn(function(){return ur(e,"getBucket"),t.http.send({method:"GET",path:"/bucket/".concat(e)})},this.shouldThrowOnError)]})})},e.prototype.createBucket=function(e,t){return pr(this,void 0,Promise,function(){var n=this;return dr(this,function(r){return[2,Jn(function(){var r;return ur(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 pr(this,void 0,Promise,function(){var n=this;return dr(this,function(r){return[2,Jn(function(){return ur(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 pr(this,void 0,Promise,function(){var t=this;return dr(this,function(n){return[2,Jn(function(){return ur(e,"deleteBucket"),t.http.send({method:"DELETE",path:"/bucket/".concat(e)})},this.shouldThrowOnError)]})})},e}(),hr=function(){return hr=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},hr.apply(this,arguments)},mr=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},vr=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},yr=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())})},gr=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(e){e.put="put",e.post="post"}(lr||(lr={}));var br=r._G.eX,wr=r._G.Sg,xr=r._G.vM,_r=r.P6.isArray,Er=r.P6.isString,Ir=r.P6.isPalinObject,Sr=r.P6.execCallback,Or=r.P6.maybeThrow,Ar=r.BM.D,Tr="storage";function Pr(e,t){return t&&"function"!=typeof t?[hr(hr({},e),{customReqOpts:t}),void 0]:[e,t]}var Rr=function(e,t,n){return yr(void 0,void 0,void 0,function(){var o,i,a;return gr(this,function(s){switch(s.label){case 0:return[4,e.gateWay({path:"storages",name:"get-objects-upload-info",data:[hr({objectId:t.path},t.signedHeader?{signedHeader:t.signedHeader}:{})]},n)];case 1:return o=s.sent(),o=r.P6.promoteGatewayError(o),i=(null===(a=o.data)||void 0===a?void 0:a[0])||{},[2,hr(hr({},o),{data:hr(hr({},i.code?hr({},i):{}),{authorization:i.authorization,token:i.token,url:i.uploadUrl,fileId:i.cloudObjectId,cosFileId:i.cloudObjectMeta,download_url:i.downloadUrl})})]}})})},Cr=function(e,t,n){return yr(void 0,void 0,void 0,function(){var o;return gr(this,function(i){switch(i.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=i.sent(),o=r.P6.promoteGatewayError(o),[2,hr(hr({},o),{data:{download_list:Array.isArray(o.data)?o.data.map(function(e){return{code:e.code||"SUCCESS",message:e.message,fileid:e.cloudObjectId,download_url:e.downloadUrl,fileID:e.cloudObjectId,tempFileURL:e.downloadUrl,mime_type:e.contentType||jr(null,e.cloudObjectId||"")}}):[]}})]}})})},Nr=function(e,t,n){return yr(void 0,void 0,void 0,function(){var o;return gr(this,function(i){switch(i.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=i.sent(),o=r.P6.promoteGatewayError(o),[2,hr(hr({},o),{data:{delete_list:Array.isArray(o.data)?o.data.map(function(e){return{code:e.code||"SUCCESS",fileID:e.cloudObjectId,message:e.message}}):[]}})]}})})},kr=function(e,t,n){return yr(void 0,void 0,void 0,function(){var o;return gr(this,function(i){switch(i.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=i.sent(),o=r.P6.promoteGatewayError(o),[2,hr(hr({},o),{data:{copy_list:Array.isArray(o.data)?o.data.map(function(e){return{code:e.code||"SUCCESS",fileID:e.cloudObjectId,fileId:e.cloudObjectId,message:e.message}}):[]}})]}})})},Ur={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 jr(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 Ur[r]||"application/octet-stream"}function Lr(e,t){var n=t.toLowerCase();return Object.keys(e).some(function(e){return e.toLowerCase()===n})}function Dr(e){return Object.keys(e).reduce(function(t,n){var r;return hr(hr({},t),((r={})[n]=[e[n]],r))},{})}var qr=function(){function e(e){this.context=e}var t,n,r,o,i,a,s,c,u,l,p,d,f,h,m,v;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,t){return yr(this,void 0,Promise,function(){var n,r,o,i,a,s,c,u,l,p,d,f,h,m,v,y,g,b,w,x,_,E,I,S,O,A,T,P,R,C,N,k;return gr(this,function(U){switch(U.label){case 0:return R=Pr(e,t),e=R[0],t=R[1],n=e.cloudPath,r=e.filePath,o=e.onUploadProgress,C=e.method,i=void 0===C?"put":C,N=e.headers,a=void 0===N?{}:N,s=e.fileContent,Er(n)&&(r||s)?(c={put:lr.put,post:lr.post}[i.toLocaleLowerCase()]||lr.put,u=this.isGateWay(),l=hr({},a),p=Object.keys(a).reduce(function(e,t){return"content-length"!==t.toLowerCase()&&(e[t]=a[t]),e},{}),c===lr.put&&u&&(Lr(l,"content-length")||"number"==typeof(d=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=function(e){var t;return null===(t=Bn())||void 0===t?void 0:t.byteLength(e)}(n);return"number"==typeof r?r:n.length}return"object"==typeof n&&"number"==typeof n.size?n.size:void 0}}(r,s))&&(l["content-length"]=String(d)),Lr(l,"content-type")||(l["content-type"]=jr(r,n)),Lr(p,"content-type")||(p["content-type"]=jr(r,n))),[4,this.getUploadMetadata({cloudPath:n,method:c,headers:c!==lr.put||u?void 0:p,signedHeader:c===lr.put&&u?Dr(l):void 0,customReqOpts:e.customReqOpts})]):[2,Or(this.config,{code:wr.INVALID_PARAMS,msg:"[".concat(Tr,".uploadFile] invalid params")})];case 1:return f=U.sent(),h=f.data,m=f.requestId,(null==(v=h)?void 0:v.code)||!(null==v?void 0:v.url)?(y=(null==v?void 0:v.code)||wr.OPERATION_FAIL,g=(null==v?void 0:v.message)||"get upload info failed",[2,Sr(t,new Error("[".concat(br(),"][").concat(y,"][").concat(Tr,"]:").concat(g)))]):(b=h.url,w=h.authorization,x=h.token,_=h.fileId,E=h.cosFileId,I=h.download_url,O=hr(hr({},S={url:b,file:r,name:n,onUploadProgress:o,fileContent:s,fileId:_,requestId:m}),{method:lr.put,headers:hr(hr({},p),{authorization:w,"x-cos-meta-fileid":E,"x-cos-security-token":x})}),A=hr(hr({},S),{method:lr.post,data:{key:n,signature:w,"x-cos-meta-fileid":E,success_action_status:"201","x-cos-security-token":x}}),(k={})[lr.put]={params:O,isSuccess:function(e){return e>=200&&e<300}},k[lr.post]={params:A,isSuccess:function(e){return 201===e}},T=k,[4,this.request.upload(T[c].params)]);case 2:return P=U.sent(),T[c].isSuccess(P.statusCode)?[2,Sr(t,null,{fileID:_,download_url:I,requestId:m})]:[2,Sr(t,new Error("[".concat(br(),"][").concat(wr.OPERATION_FAIL,"][").concat(Tr,"]:").concat(P.data)))]}})})},e.prototype.getUploadMetadata=function(e,t){return yr(this,void 0,Promise,function(){var n,r,o,i,a,s,c,u,l,p;return gr(this,function(d){switch(d.label){case 0:if(n=e.cloudPath,r=e.method,o=e.headers,i=e.signedHeader,!Er(n))return[2,Or(this.config,{code:wr.INVALID_PARAMS,msg:"[".concat(Tr,".getUploadMetadata] invalid cloudPath")})];a=this.request,s="storage.getUploadMetadata",d.label=1;case 1:return d.trys.push([1,6,,7]),c=void 0,u={path:n},l=this.isGateWay(),r&&(u.method=r),r===lr.put&&(l&&i?u.signedHeader=i:!l&&o&&(u.headers=o)),r!==lr.post&&l?[3,3]:[4,a.send(s,u,{endPointMode:"CLOUD_API"},e.customReqOpts)];case 2:return c=d.sent(),[3,5];case 3:return[4,Rr(a,u,e.customReqOpts)];case 4:c=d.sent(),d.label=5;case 5:return[2,Sr(t,null,c)];case 6:return p=d.sent(),[2,Sr(t,p)];case 7:return[2]}})})},e.prototype.deleteFile=function(e,t){return yr(this,void 0,Promise,function(){var n,r,o,i,a,s,c,u,l;return gr(this,function(p){switch(p.label){case 0:if(l=Pr(e,t),e=l[0],t=l[1],!(n=e.fileList)||!_r(n)||0===n.length)return[2,Or(this.config,{code:wr.INVALID_PARAMS,msg:"[".concat(Tr,".deleteFile] fileList must not be empty")})];for(r=0,o=n;r<o.length;r++)if(!(i=o[r])||!Er(i))return[2,Or(this.config,{code:wr.INVALID_PARAMS,msg:"[".concat(Tr,".deleteFile] fileID must be string")})];return a="storage.batchDeleteFile",s=this.request,c={},this.isGateWay()?[4,Nr(s,{fileList:n},e.customReqOpts)]:[3,2];case 1:return c=p.sent(),[3,4];case 2:return[4,s.send(a,{fileid_list:n},e.customReqOpts)];case 3:c=p.sent(),p.label=4;case 4:return c.code?[2,Sr(t,null,c)]:(u={fileList:c.data.delete_list,requestId:c.requestId},[2,Sr(t,null,u)])}})})},e.prototype.getTempFileURL=function(e,t){var n;return yr(this,void 0,Promise,function(){var r,o,i,a,s,c,u,l,p;return gr(this,function(d){switch(d.label){case 0:if(p=Pr(e,t),e=p[0],t=p[1],!(r=e.fileList)||!_r(r)||0===r.length)return[2,Or(this.config,{code:wr.INVALID_PARAMS,msg:"[".concat(Tr,".getTempFileURL] fileList must not be empty")})];for(o=[],i=0,a=r;i<a.length;i++)if(s=a[i],Ir(s)){if(!Object.prototype.hasOwnProperty.call(s,"fileID"))return[2,Or(this.config,{code:wr.INVALID_PARAMS,msg:"[".concat(Tr,".getTempFileURL] file info must include fileID")})];o.push({fileid:s.fileID,max_age:s.maxAge||7200})}else{if(!Er(s))return[2,Or(this.config,{code:wr.INVALID_PARAMS,msg:"[".concat(Tr,".getTempFileURL] invalid fileList")})];o.push({fileid:s})}return c="storage.batchGetDownloadUrl",u=this.request,l={},this.isGateWay()?[4,Cr(u,{convertedFileList:o},e.customReqOpts)]:[3,2];case 1:return l=d.sent(),[3,4];case 2:return[4,u.send(c,{file_list:o},e.customReqOpts)];case 3:l=d.sent(),d.label=4;case 4:return l.code?[2,Sr(t,null,l)]:[2,Sr(t,null,{fileList:Array.isArray(null===(n=l.data)||void 0===n?void 0:n.download_list)?l.data.download_list:[],requestId:l.requestId})]}})})},e.prototype.downloadFile=function(e,t){return yr(this,void 0,Promise,function(){var n,r,o,i,a,s,c;return gr(this,function(u){switch(u.label){case 0:return c=Pr(e,t),e=c[0],t=c[1],n=e.fileID,Er(n)?[4,this.getTempFileURL.call(this,{fileList:[{fileID:n,maxAge:600}],customReqOpts:e.customReqOpts})]:[2,Or(this.config,{code:wr.INVALID_PARAMS,msg:"[".concat(Tr,".getTempFileURL] fileID must be string")})];case 1:return r=u.sent(),"SUCCESS"!==(o=r.fileList[0]).code?[2,Sr(t,o)]:(i=this.request,a=encodeURI(o.download_url),[4,i.download({url:a,tempFilePath:e.tempFilePath})]);case 2:return s=u.sent(),[2,Sr(t,null,s)]}})})},e.prototype.copyFile=function(e,t){return yr(this,void 0,Promise,function(){var n,r,o,i,a,s,c,u,l,p;return gr(this,function(d){switch(d.label){case 0:if(p=Pr(e,t),e=p[0],t=p[1],!(n=e.fileList)||!_r(n)||0===n.length)return[2,Or(this.config,{code:wr.INVALID_PARAMS,msg:"[".concat(Tr,".copyFile] fileList must not be empty")})];for(r=[],o=0,i=n;o<i.length;o++){if(a=i[o],s=a.srcPath,c=a.dstPath,!s||!c||"string"!=typeof s||"string"!=typeof c)return[2,Or(this.config,{code:wr.INVALID_PARAMS,msg:"[".concat(Tr,".copyFile] srcPath and dstPath may not be empty")})];if(s===c)return[2,Or(this.config,{code:wr.INVALID_PARAMS,msg:"[".concat(Tr,".copyFile] srcPath and dstPath can not be the same")})];r.push({src_path:s,dst_path:c,overwrite:a.overwrite,remove_original:a.removeOriginal})}return u=this.request,l={},this.isGateWay()?[4,kr(u,{convertedFileList:r},e.customReqOpts)]:[3,2];case 1:return l=d.sent(),[3,4];case 2:return[4,u.send("storage.batchCopyFile",{file_list:r},e.customReqOpts)];case 3:l=d.sent(),d.label=4;case 4:return l.code?[2,Sr(t,null,l)]:[2,Sr(t,null,{fileList:l.data.copy_list,requestId:l.requestId})]}})})},e.prototype.getFileInfo=function(e){var t;return yr(this,void 0,Promise,function(){var n,r=this;return gr(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 yr(r,void 0,void 0,function(){var t,n,r,o,i,a,s;return gr(this,function(c){switch(c.label){case 0:if("SUCCESS"!==e.code)return[2,{code:e.code,fileID:e.fileID,tempFileURL:e.tempFileURL,message:e.message}];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,this.request.fetch({url:e.tempFileURL,method:"HEAD"})];case 2:return t=c.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=c.sent(),s="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:s}];case 4:return[2]}})})}))]:[3,3];case 2:return[2,{fileList:o.sent(),requestId:n.requestId}];case 3:return[2,{fileList:[],requestId:n.requestId}]}})})},mr([Ar({customInfo:{className:"Cloudbase",methodName:"uploadFile"},title:"上传文件失败",messages:["请确认以下各项:"," 1 - 调用 uploadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(xr)]}),vr("design:type",Function),vr("design:paramtypes",[Object,"function"==typeof(t="undefined"!=typeof Function&&Function)?t:Object]),vr("design:returntype","function"==typeof(n="undefined"!=typeof Promise&&Promise)?n:Object)],e.prototype,"uploadFile",null),mr([Ar({customInfo:{className:"Cloudbase",methodName:"getUploadMetadata"},title:"获取上传元信息失败",messages:["请确认以下各项:"," 1 - 调用 getUploadMetadata() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(xr)]}),vr("design:type",Function),vr("design:paramtypes",[Object,"function"==typeof(r="undefined"!=typeof Function&&Function)?r:Object]),vr("design:returntype","function"==typeof(o="undefined"!=typeof Promise&&Promise)?o:Object)],e.prototype,"getUploadMetadata",null),mr([Ar({customInfo:{className:"Cloudbase",methodName:"deleteFile"},title:"删除文件失败",messages:["请确认以下各项:"," 1 - 调用 deleteFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(xr)]}),vr("design:type",Function),vr("design:paramtypes",["function"==typeof(i=void 0!==pn.ICloudbaseDeleteFileParams&&pn.ICloudbaseDeleteFileParams)?i:Object,"function"==typeof(a="undefined"!=typeof Function&&Function)?a:Object]),vr("design:returntype","function"==typeof(s="undefined"!=typeof Promise&&Promise)?s:Object)],e.prototype,"deleteFile",null),mr([Ar({customInfo:{className:"Cloudbase",methodName:"getTempFileURL"},title:"获取文件下载链接",messages:["请确认以下各项:"," 1 - 调用 getTempFileURL() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(xr)]}),vr("design:type",Function),vr("design:paramtypes",["function"==typeof(c=void 0!==pn.ICloudbaseGetTempFileURLParams&&pn.ICloudbaseGetTempFileURLParams)?c:Object,"function"==typeof(u="undefined"!=typeof Function&&Function)?u:Object]),vr("design:returntype","function"==typeof(l="undefined"!=typeof Promise&&Promise)?l:Object)],e.prototype,"getTempFileURL",null),mr([Ar({customInfo:{className:"Cloudbase",methodName:"downloadFile"},title:"下载文件失败",messages:["请确认以下各项:"," 1 - 调用 downloadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(xr)]}),vr("design:type",Function),vr("design:paramtypes",["function"==typeof(p=void 0!==pn.ICloudbaseDownloadFileParams&&pn.ICloudbaseDownloadFileParams)?p:Object,"function"==typeof(d="undefined"!=typeof Function&&Function)?d:Object]),vr("design:returntype","function"==typeof(f="undefined"!=typeof Promise&&Promise)?f:Object)],e.prototype,"downloadFile",null),mr([Ar({customInfo:{className:"Cloudbase",methodName:"copyFile"},title:"批量复制文件",messages:["请确认以下各项:"," 1 - 调用 copyFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(xr)]}),vr("design:type",Function),vr("design:paramtypes",["function"==typeof(h=void 0!==pn.ICloudbaseCopyFileParams&&pn.ICloudbaseCopyFileParams)?h:Object,"function"==typeof(m="undefined"!=typeof Function&&Function)?m:Object]),vr("design:returntype","function"==typeof(v="undefined"!=typeof Promise&&Promise)?v:Object)],e.prototype,"copyFile",null),e}(),Mr=function(){return Mr=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},Mr.apply(this,arguments)},Fr=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())})},Br=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])}}},Wr=r._G.Sg,Gr=function(){function e(e,t){void 0===t&&(t=!1),this.shouldThrowOnError=!1,this.bucketId="",this.context=e,this.shouldThrowOnError=t,this.storage=new qr(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 Fr(this,void 0,Promise,function(){var r,o,i,a,s,c,u,l,p;return Br(this,function(d){switch(d.label){case 0:r=Mr({upsert:!0},n),o=r.cacheControl,i=r.contentType,a=r.metadata,d.label=1;case 1:return d.trys.push([1,3,,4]),s=this.getCloudPath(e),c={cloudPath:s,filePath:t},(o||i||a)&&(u={},o&&(u["cache-control"]=o),i&&(u["content-type"]=i),a&&(u["x-cos-metadata-metadata"]=this.toBase64(JSON.stringify(a))),c.headers=u),[4,this.storage.uploadFile(c)];case 2:if(!(l=d.sent()).fileID)throw new Error(JSON.stringify({code:Wr.OPERATION_FAIL,msg:"[".concat(Tr,".update] no fileID returned")}));return[2,{data:{id:l.fileID,path:e,fullPath:e},error:null}];case 3:if(p=d.sent(),this.shouldThrowOnError)throw p;if(qn(p))return[2,{data:null,error:p}];throw p;case 4:return[2]}})})},e.prototype.uploadToSignedUrl=function(e,t,n,r){return Fr(this,void 0,Promise,function(){return Br(this,function(t){return[2,this.upload(e,n,r)]})})},e.prototype.createSignedUploadUrl=function(e){return Fr(this,void 0,Promise,function(){var t,n,r;return Br(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 Dn?r:new Dn(r.message)}];case 3:return[2]}})})},e.prototype.update=function(e,t,n){return Fr(this,void 0,Promise,function(){return Br(this,function(r){return[2,this.upload(e,t,Mr(Mr({},n),{upsert:!0}))]})})},e.prototype.move=function(e,t){return Fr(this,void 0,Promise,function(){var n,r;return Br(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 Dn(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(qn(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}})})},e.prototype.copy=function(e,t){return Fr(this,void 0,Promise,function(){var n,r;return Br(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 Dn(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(qn(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}})})},e.prototype.createSignedUrl=function(e,t,n){return Fr(this,void 0,Promise,function(){var r,o,i,a,s,c,u;return Br(this,function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),r=this.normalizeCloudId(e),[4,this.storage.getTempFileURL({fileList:[{fileID:r,maxAge:t}]})];case 1:if("SUCCESS"!==(o=l.sent()).fileList[0].code)throw new Dn("Failed to create signed URL: [".concat(o.fileList[0].code,"] ").concat(o.fileList[0].fileID));return i=o.fileList[0].download_url,a=[],void 0!==(null==n?void 0:n.download)&&("string"==typeof n.download?a.push("download=".concat(encodeURIComponent(n.download))):!0===n.download&&a.push("download=true")),(null==n?void 0:n.transform)&&(s=this.transformOptsToQueryString(n.transform))&&a.push(s),a.length>0&&(c=i.includes("?")?"&":"?",i="".concat(i).concat(c).concat(a.join("&"))),[2,{data:{signedUrl:i},error:null}];case 2:if(u=l.sent(),this.shouldThrowOnError)throw u;if(qn(u))return[2,{data:null,error:u}];throw u;case 3:return[2]}})})},e.prototype.createSignedUrls=function(e,t){return Fr(this,void 0,Promise,function(){var n,r,o=this;return Br(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(qn(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}})})},e.prototype.download=function(e,t){return Fr(this,void 0,Promise,function(){var n,r,o=this;return Br(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r={},[4,Fr(o,void 0,void 0,function(){var n,r,o,i;return Br(this,function(a){switch(a.label){case 0:return[4,this.createSignedUrl(e,600,{transform:t})];case 1:if((n=a.sent()).error)throw n.error;return r=encodeURI(null===(i=n.data)||void 0===i?void 0:i.signedUrl),[4,this.request.reqClass.get({url:r,headers:{},responseType:"blob"})];case 2:if(!(o=a.sent().data))throw new Dn("Download failed: no file content");return[2,new Blob([o])]}})})];case 1:return[2,(r.data=i.sent(),r.error=null,r)];case 2:if(n=i.sent(),this.shouldThrowOnError)throw n;if(qn(n))return[2,{data:null,error:n}];throw n;case 3:return[2]}})})},e.prototype.info=function(e){return Fr(this,void 0,Promise,function(){var t,n,r,o,i,a,s,c;return Br(this,function(u){switch(u.label){case 0:return u.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=u.sent(),"SUCCESS"!==(i=o.fileList[0]).code)throw new Dn(i.message);return a=(new Date).toISOString(),s=(i.lastModified?new Date(i.lastModified):new Date).toISOString(),[2,{data:{id:i.fileID,version:"1",name:n,bucketId:r,updatedAt:s,createdAt:s,lastAccessedAt:a,size:i.size,cacheControl:i.cacheControl,contentType:i.contentType,etag:i.etag,lastModified:s,metadata:{}},error:null}];case 2:if(c=u.sent(),this.shouldThrowOnError)throw c;return[2,{data:null,error:c instanceof Dn?c:new Dn(c.message)}];case 3:return[2]}})})},e.prototype.exists=function(e){return Fr(this,void 0,Promise,function(){var t,n,r;return Br(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 Dn(n.message);return[2,{data:!0,error:null}];case 2:if(r=o.sent(),this.shouldThrowOnError)throw r;if(qn(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}})})},e.prototype.getPublicUrl=function(e,t){return Fr(this,void 0,Promise,function(){var n;return Br(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 Fr(this,void 0,Promise,function(){var t,n,r,o,i,a,s,c,u,l,p=this;return Br(this,function(d){switch(d.label){case 0:for(d.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 p.info(e)}))}))];case 1:return o=d.sent(),i=new Map,o.forEach(function(n,r){n.forEach(function(n,o){n.data&&i.set(e[r*t+o],n.data)})}),a=e.map(function(e){return p.normalizeCloudId(e)}),[4,this.storage.deleteFile({fileList:a})];case 2:if(s=d.sent(),(c=s.fileList.filter(function(e){return"SUCCESS"!==e.code})).length>0)throw new Dn("Delete failed for ".concat(c.length," file(s)"));return u=(new Date).toISOString(),[2,{data:e.map(function(e){var t=i.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)||u,created_at:null==t?void 0:t.createdAt,last_accessed_at:(null==t?void 0:t.lastAccessedAt)||u,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:u}}}),error:null}];case 3:if(l=d.sent(),this.shouldThrowOnError)throw l;if(qn(l))return[2,{data:null,error:l}];throw l;case 4:return[2]}})})},e.prototype.list=function(){return Fr(this,void 0,void 0,function(){return Br(this,function(e){throw new Dn("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 Dn("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 Wn(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}(),Vr=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)}}(),Hr=new qr,zr={name:Tr,entity:{uploadFile:Hr.uploadFile,deleteFile:Hr.deleteFile,getTempFileURL:Hr.getTempFileURL,downloadFile:Hr.downloadFile,getUploadMetadata:Hr.getUploadMetadata,copyFile:Hr.copyFile,getFileInfo:Hr.getFileInfo,isGateWay:Hr.isGateWay}},Kr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Vr(t,e),t.prototype.from=function(e){return e?(ur(e,"from"),new sr(this.http,e,this.shouldThrowOnError)):new Gr(this.http.ctx,this.shouldThrowOnError)},t}(fr),Jr={name:"".concat(Tr,"/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 Kr(n);return e.set(this,r),r},configurable:!0,enumerable:!0})}};try{cloudbase.registerComponent(zr),cloudbase.registerComponent(Jr)}catch(e){}function Yr(e){try{e.registerComponent(zr),e.registerComponent(Jr)}catch(e){console.warn(e)}}try{window.registerStorage=Yr}catch(e){}var $r=__webpack_require__(6765),Xr=__webpack_require__.n($r),Qr=__webpack_require__(7195),Zr=__webpack_require__.n(Qr),eo=__webpack_require__(9850),to=__webpack_require__.n(eo);function no(e){return void 0===e&&(e=""),"".concat(e?"".concat(e,"_"):"").concat(+new Date,"_").concat(Math.random())}var ro,oo=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}})},io=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}})},ao=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)}}(),so=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 ao(t,e),t}(Error),co=function(e){return null==e?void 0:e.isRealtimeErrorMessageError},uo=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 ao(t,e),t}(Error),lo=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 ao(t,e),t}(Error),po=function(e){function t(t){var n=e.call(this,t.errMsg)||this;return n.errCode="UNKNOWN_ERROR",Object.defineProperties(n,{message:{get:function(){return"errCode: ".concat(this.errCode," ").concat(fo[this.errCode]||""," | errMsg: ").concat(this.errMsg)},set:function(e){this.errMsg=e}}}),n.errCode=t.errCode||"UNKNOWN_ERROR",n.errMsg=t.errMsg,n}return ao(t,e),Object.defineProperty(t.prototype,"message",{get:function(){return"errCode: ".concat(this.errCode," | errMsg: ").concat(this.errMsg)},set:function(e){this.errMsg=e},enumerable:!1,configurable:!0}),t}(Error),fo={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"},ho=function(e){return void 0===e&&(e=0),new Promise(function(t){return setTimeout(t,e)})},mo=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())})},vo=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])}}},yo=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(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"}(ro||(ro={}));var go=function(){function e(e){var t=this;this.watchStatus=ro.INITING,this.wsLogin=function(e,n){return mo(t,void 0,Promise,function(){var t;return vo(this,function(r){switch(r.label){case 0:return this.watchStatus=ro.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 mo(t,void 0,Promise,function(){var t,n=this;return vo(this,function(r){switch(r.label){case 0:if(null!==this.initWatchPromise&&void 0!==this.initWatchPromise)return[2,this.initWatchPromise];this.initWatchPromise=new Promise(function(t,r){mo(n,void 0,void 0,function(){var n,o,i,a,s,c,u,l,p,d;return vo(this,function(f){switch(f.label){case 0:return f.trys.push([0,3,,4]),this.watchStatus===ro.PAUSED?(console.log("[realtime] initWatch cancelled on pause"),[2,t()]):[4,this.wsLogin(this.envId,e)];case 1:return n=f.sent().envId,this.watchStatus===ro.PAUSED?(console.log("[realtime] initWatch cancelled on pause"),[2,t()]):(this.watchStatus=ro.INITING,o={watchId:this.watchId,requestId:no(),msgType:"INIT_WATCH",msgData:{envId:n,collName:this.collectionName,query:this.query,limit:this.limit,orderBy:this.orderBy}},[4,this.send({msg:o,waitResponse:!0,skipOnMessage:!0,timeout:1e4})]);case 2:if(i=f.sent(),a=i.msgData,s=a.events,c=a.currEvent,this.sessionInfo={queryID:i.msgData.queryID,currentEventId:c-1,currentDocs:[]},s.length>0){for(u=0,l=s;u<l.length;u++)l[u].ID=c;this.handleServerEvents(i)}else this.sessionInfo.currentEventId=c,p=new io({id:c,docChanges:[],docs:[],type:"init"}),this.listener.onChange(p),this.scheduleSendACK();return this.onWatchStart(this,this.sessionInfo.queryID),this.watchStatus=ro.ACTIVE,this.availableRetries.INIT_WATCH=2,t(),[3,4];case 3:return d=f.sent(),this.handleWatchEstablishmentError(d,{operationName:"INIT_WATCH",resolve:t,reject:r}),[3,4];case 4:return[2]}})})}),t=!1,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this.initWatchPromise];case 2:return r.sent(),t=!0,[3,4];case 3:return this.initWatchPromise=void 0,[7];case 4:return console.log("[realtime] initWatch ".concat(t?"success":"fail")),[2]}})})},this.rebuildWatch=function(e){return mo(t,void 0,Promise,function(){var t,n=this;return vo(this,function(r){switch(r.label){case 0:if(null!==this.rebuildWatchPromise&&void 0!==this.rebuildWatchPromise)return[2,this.rebuildWatchPromise];this.rebuildWatchPromise=new Promise(function(t,r){mo(n,void 0,void 0,function(){var n,o,i,a;return vo(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),this.watchStatus===ro.PAUSED?(console.log("[realtime] rebuildWatch cancelled on pause"),[2,t()]):[4,this.wsLogin(this.envId,e)];case 1:if(n=s.sent().envId,!this.sessionInfo)throw new Error("can not rebuildWatch without a successful initWatch (lack of sessionInfo)");return this.watchStatus===ro.PAUSED?(console.log("[realtime] rebuildWatch cancelled on pause"),[2,t()]):(this.watchStatus=ro.REBUILDING,o={watchId:this.watchId,requestId:no(),msgType:"REBUILD_WATCH",msgData:{envId:n,collName:this.collectionName,queryID:this.sessionInfo.queryID,eventID:this.sessionInfo.currentEventId}},[4,this.send({msg:o,waitResponse:!0,skipOnMessage:!1,timeout:1e4})]);case 2:return i=s.sent(),this.handleServerEvents(i),this.watchStatus=ro.ACTIVE,this.availableRetries.REBUILD_WATCH=2,t(),[3,4];case 3:return a=s.sent(),this.handleWatchEstablishmentError(a,{operationName:"REBUILD_WATCH",resolve:t,reject:r}),[3,4];case 4:return[2]}})})}),t=!1,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this.rebuildWatchPromise];case 2:return r.sent(),t=!0,[3,4];case 3:return this.rebuildWatchPromise=void 0,[7];case 4:return console.log("[realtime] rebuildWatch ".concat(t?"success":"fail")),[2]}})})},this.handleWatchEstablishmentError=function(e,n){return mo(t,void 0,void 0,function(){var t,r,o,i=this;return vo(this,function(a){return t="INIT_WATCH"===n.operationName,r=function(){i.closeWithError(new po({errCode:t?fo.SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL:fo.SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL,errMsg:e})),n.reject(e)},o=function(e){i.useRetryTicket(n.operationName)?t?(i.initWatchPromise=void 0,n.resolve(i.initWatch(e))):(i.rebuildWatchPromise=void 0,n.resolve(i.rebuildWatch(e))):r()},this.handleCommonError(e,{onSignError:function(){return o(!0)},onTimeoutError:function(){return o(!1)},onNotRetryableError:r,onCancelledError:n.reject,onUnknownError:function(){mo(i,void 0,void 0,function(){var e,t=this;return vo(this,function(r){switch(r.label){case 0:return r.trys.push([0,8,,9]),e=function(){return mo(t,void 0,void 0,function(){return vo(this,function(e){switch(e.label){case 0:return this.pause(),[4,this.onceWSConnected()];case 1:return e.sent(),o(!0),[2]}})})},this.isWSConnected()?[3,2]:[4,e()];case 1:return r.sent(),[3,7];case 2:return[4,ho(100)];case 3:return r.sent(),this.watchStatus!==ro.PAUSED?[3,4]:(n.reject(new lo("".concat(n.operationName," cancelled due to pause after unknownError"))),[3,7]);case 4:return this.isWSConnected()?[3,6]:[4,e()];case 5:return r.sent(),[3,7];case 6:o(!1),r.label=7;case 7:return[3,9];case 8:return r.sent(),o(!0),[3,9];case 9:return[2]}})})}}),[2]})})},this.closeWatch=function(){return mo(t,void 0,void 0,function(){var e,t,n;return vo(this,function(r){switch(r.label){case 0:if(e=this.sessionInfo?this.sessionInfo.queryID:"",this.watchStatus!==ro.ACTIVE)return this.watchStatus=ro.CLOSED,this.onWatchClose(this,e),[2];r.label=1;case 1:return r.trys.push([1,3,4,5]),this.watchStatus=ro.CLOSING,t={watchId:this.watchId,requestId:no(),msgType:"CLOSE_WATCH",msgData:null},[4,this.send({msg:t})];case 2:return r.sent(),this.sessionInfo=void 0,this.watchStatus=ro.CLOSED,[3,5];case 3:return n=r.sent(),this.closeWithError(new po({errCode:fo.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 mo(t,void 0,Promise,function(){var e,t,n;return vo(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this.watchStatus!==ro.ACTIVE?(this.scheduleSendACK(),[2]):this.sessionInfo?(e={watchId:this.watchId,requestId:no(),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(),co(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 po({errCode:fo.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 po({errCode:fo.SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL,errMsg:t})),[3,3];case 3:return[2]}})})},this.handleCommonError=function(e,t){if(co(e))switch(e.payload.msgData.code){case"CHECK_LOGIN_FAILED":case"SIGN_EXPIRED_ERROR":case"SIGN_INVALID_ERROR":case"SIGN_PARAM_INVALID":return void t.onSignError(e);default:return void t.onNotRetryableError(e)}else{if(function(e){return"timeout"===e.type}(e))return void t.onTimeoutError(e);if(function(e){return"cancelled"===e.type}(e))return void t.onCancelledError(e)}t.onUnknownError(e)},this.watchId="watchid_".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 oo({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 ro.PAUSED:if("ERROR"!==e.msgType)return;break;case ro.LOGGINGIN:case ro.INITING:case ro.REBUILDING:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received while ".concat(this.watchStatus));case ro.CLOSED:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received when the watch has closed");case ro.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 po({errCode:fo.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=ro.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=ro.PAUSED,console.log("[realtime] client paused (".concat(this.collectionName," ").concat(this.query,") (watchId ").concat(this.watchId,")"))},e.prototype.resume=function(){return mo(this,void 0,Promise,function(){var e;return vo(this,function(t){switch(t.label){case 0:this.watchStatus=ro.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 mo(this,void 0,void 0,function(){var t;return vo(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 mo(this,void 0,void 0,function(){var t,n,r,o,i,a,s,c,u,l,p,d;return vo(this,function(f){switch(f.label){case 0:if(t=e.requestId,n=e.msgData.events,r=e.msgType,!n.length||!this.sessionInfo)return[2];o=this.sessionInfo;try{i=n.map(bo)}catch(e){return this.closeWithError(new po({errCode:fo.SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA,errMsg:e})),[2]}a=yo([],o.currentDocs,!0),s=!1,c=function(n,c){var l,p,d,f,h,m,v,y,g,b,w,x;return vo(this,function(_){switch(_.label){case 0:return l=i[n],o.currentEventId>=l.id?(!i[n-1]||l.id>i[n-1].id?console.warn("[realtime] duplicate event received, cur ".concat(o.currentEventId," but got ").concat(l.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(o.currentEventId!==l.id-1)return[3,2];switch(l.dataType){case"update":if(!l.doc)switch(l.queueType){case"update":case"dequeue":if(p=a.find(function(e){return e._id===l.docId}),p){if(d=to()(p),l.updatedFields&&Object.keys(l.updatedFields).forEach(function(e){Xr()(d,e,l.updatedFields[e])}),l.removedFields)for(f=0,h=l.removedFields;f<h.length;f++)m=h[f],Zr()(d,m);l.doc=d}else console.error("[realtime listener] internal non-fatal server error: unexpected update dataType event where no doc is associated.");break;case"enqueue":throw y=new po({errCode:fo.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="update" and queueType="enqueue" (requestId '.concat(e.requestId,")")}),u.closeWithError(y),y}break;case"replace":if(!l.doc)throw y=new po({errCode:fo.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="replace" (requestId '.concat(e.requestId,")")}),u.closeWithError(y),y;break;case"remove":(v=a.find(function(e){return e._id===l.docId}))?l.doc=v:console.error("[realtime listener] internal non-fatal server error: unexpected remove event where no doc is associated.");break;case"limit":if(!l.doc)switch(l.queueType){case"dequeue":(v=a.find(function(e){return e._id===l.docId}))?l.doc=v:console.error("[realtime listener] internal non-fatal server error: unexpected limit dataType event where no doc is associated.");break;case"enqueue":throw y=new po({errCode:fo.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="limit" and queueType="enqueue" (requestId '.concat(e.requestId,")")}),u.closeWithError(y),y}}switch(l.queueType){case"init":s?a.push(l.doc):(s=!0,a=[l.doc]);break;case"enqueue":a.push(l.doc);break;case"dequeue":g=a.findIndex(function(e){return e._id===l.docId}),g>-1?a.splice(g,1):console.error("[realtime listener] internal non-fatal server error: unexpected dequeue event where no doc is associated.");break;case"update":g=a.findIndex(function(e){return e._id===l.docId}),g>-1?a[g]=l.doc:console.error("[realtime listener] internal non-fatal server error: unexpected queueType update event where no doc is associated.")}return(n===c-1||i[n+1]&&i[n+1].id!==l.id)&&(b=yo([],a,!0),w=i.slice(0,n+1).filter(function(e){return e.id===l.id}),u.sessionInfo.currentEventId=l.id,u.sessionInfo.currentDocs=a,x=new io({id:l.id,docChanges:w,docs:b,msgType:r}),u.listener.onChange(x)),[3,4];case 2:return console.warn("[realtime listener] event received is out of order, cur ".concat(u.sessionInfo.currentEventId," but got ").concat(l.id)),[4,u.rebuildWatch()];case 3:return _.sent(),[2,{value:void 0}];case 4:return[2]}})},u=this,l=0,p=i.length,f.label=1;case 1:return l<p?[5,c(l,p)]:[3,4];case 2:if("object"==typeof(d=f.sent()))return[2,d.value];f.label=3;case 3:return l++,[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 bo(e){var t={id:e.ID,dataType:e.DataType,queueType:e.QueueType,docId:e.DocID,doc:e.Doc&&"{}"!==e.Doc?JSON.parse(e.Doc):void 0};return"update"===e.DataType&&(e.UpdatedFields&&(t.updatedFields=JSON.parse(e.UpdatedFields)),(e.removedFields||e.RemovedFields)&&(t.removedFields=JSON.parse(e.removedFields))),t}var wo,xo={1e3:{code:1e3,name:"Normal Closure",description:"Normal closure; the connection successfully completed whatever purpose for which it was created."},1001:{code:1001,name:"Going Away",description:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection."},1002:{code:1002,name:"Protocol Error",description:"The endpoint is terminating the connection due to a protocol error."},1003:{code:1003,name:"Unsupported Data",description:"The connection is being terminated because the endpoint received data of a type it cannot accept (for example, a text-only endpoint received binary data)."},1005:{code:1005,name:"No Status Received",description:"Indicates that no status code was provided even though one was expected."},1006:{code:1006,name:"Abnormal Closure",description:"Used to indicate that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},1007:{code:1007,name:"Invalid frame payload data",description:"The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},1008:{code:1008,name:"Policy Violation",description:"The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},1009:{code:1009,name:"Message too big",description:"The endpoint is terminating the connection because a data frame was received that is too large."},1010:{code:1010,name:"Missing Extension",description:"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},1011:{code:1011,name:"Internal Error",description:"The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."},1012:{code:1012,name:"Service Restart",description:"The server is terminating the connection because it is restarting."},1013:{code:1013,name:"Try Again Later",description:"The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients."},1014:{code:1014,name:"Bad Gateway",description:"The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code."},1015:{code:1015,name:"TLS Handshake",description:"Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."},3e3:{code:3e3,name:"Reconnect WebSocket",description:"The client is terminating the connection because it wants to reconnect"},3001:{code:3001,name:"No Realtime Listeners",description:"The client is terminating the connection because no more realtime listeners exist"},3002:{code:3002,name:"Heartbeat Ping Error",description:"The client is terminating the connection due to its failure in sending heartbeat messages"},3003:{code:3003,name:"Heartbeat Pong Timeout Error",description:"The client is terminating the connection because no heartbeat response is received from the server"},3050:{code:3050,name:"Server Close",description:"The client is terminating the connection because no heartbeat response is received from the server"}};!function(e){e[e.NormalClosure=1e3]="NormalClosure",e[e.GoingAway=1001]="GoingAway",e[e.ProtocolError=1002]="ProtocolError",e[e.UnsupportedData=1003]="UnsupportedData",e[e.NoStatusReceived=1005]="NoStatusReceived",e[e.AbnormalClosure=1006]="AbnormalClosure",e[e.InvalidFramePayloadData=1007]="InvalidFramePayloadData",e[e.PolicyViolation=1008]="PolicyViolation",e[e.MessageTooBig=1009]="MessageTooBig",e[e.MissingExtension=1010]="MissingExtension",e[e.InternalError=1011]="InternalError",e[e.ServiceRestart=1012]="ServiceRestart",e[e.TryAgainLater=1013]="TryAgainLater",e[e.BadGateway=1014]="BadGateway",e[e.TLSHandshake=1015]="TLSHandshake",e[e.ReconnectWebSocket=3e3]="ReconnectWebSocket",e[e.NoRealtimeListeners=3001]="NoRealtimeListeners",e[e.HeartbeatPingError=3002]="HeartbeatPingError",e[e.HeartbeatPongTimeoutError=3003]="HeartbeatPongTimeoutError",e[e.NoAuthentication=3050]="NoAuthentication"}(wo||(wo={}));var _o=function(e,t){var n=xo[e],r=n?"".concat(n.name,", code ").concat(e,", reason ").concat(t||n.description):"code ".concat(e);return new po({errCode:fo.SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED,errMsg:r})},Eo=null,Io="web";function So(){return Eo}function Oo(){return Io}function Ao(e){Io=e}var To=function(){return To=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},To.apply(this,arguments)},Po=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())})},Ro=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])}}},Co=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 Po(t,void 0,Promise,function(){var t=this;return Ro(this,function(n){return[2,new Promise(function(n,r){Po(t,void 0,void 0,function(){var t,o,i,a,s,c,u,l,p=this;return Ro(this,function(d){switch(d.label){case 0:o=!1,i=!1,a=function(e){o=!0,t&&clearTimeout(t),n(e)},s=function(e){i=!0,t&&clearTimeout(t),r(e)},e.timeout&&(t=setTimeout(function(){Po(p,void 0,void 0,function(){return Ro(this,function(e){switch(e.label){case 0:return o&&i?[3,2]:[4,ho(0)];case 1:e.sent(),o&&i||s(new uo("wsclient.send timedout")),e.label=2;case 2:return[2]}})})},e.timeout)),d.label=1;case 1:return d.trys.push([1,8,,9]),void 0===this.wsInitPromise&&null===this.wsInitPromise?[3,3]:[4,this.wsInitPromise];case 2:d.sent(),d.label=3;case 3:if(!this.ws)return s(new Error("invalid state: ws connection not exists, can not send message")),[2];if(1!==this.ws.readyState)return s(new Error("ws readyState invalid: ".concat(this.ws.readyState,", can not send message"))),[2];e.waitResponse&&(c={resolve:a,reject:s,skipOnMessage:e.skipOnMessage},this.wsResponseWait.set(e.msg.requestId,c)),d.label=4;case 4:return d.trys.push([4,6,,7]),[4,this.ws.send(JSON.stringify(e.msg))];case 5:return d.sent(),e.waitResponse||a(void 0),[3,7];case 6:return(u=d.sent())&&(s(u),e.waitResponse&&this.wsResponseWait.delete(e.msg.requestId)),[3,7];case 7:return[3,9];case 8:return l=d.sent(),s(l),[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),Po(t,void 0,Promise,function(){var t=this;return Ro(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(wo.ReconnectWebSocket),this.wsInitPromise=new Promise(function(r,o){Po(t,void 0,void 0,function(){var t,i,a=this;return Ro(this,function(s){switch(s.label){case 0:return s.trys.push([0,6,,11]),[4,this.getWsSign()];case 1:return t=s.sent(),[4,new Promise(function(e){var n=t.wsUrl||"wss://tcb-ws.tencentcloudapi.com",r=So();a.ws=r?new r(n):new WebSocket(n),e(void 0)})];case 2:return s.sent(),this.ws.connect?[4,this.ws.connect()]:[3,4];case 3:s.sent(),s.label=4;case 4:return[4,this.initWebSocketEvent()];case 5:return s.sent(),r(),e&&(this.resumeClients(),this.reconnectState=!1),[3,11];case 6:return i=s.sent(),console.error("[realtime] initWebSocketConnection connect fail",i),n>0?(this.wsInitPromise=void 0,[4,ho(this.reconnectInterval)]):[3,9];case 7:s.sent(),e&&(this.reconnectState=!1),s.label=8;case 8:return r(this.initWebSocketConnection(e,n-1)),[3,10];case 9:o(i),e&&this.closeAllClients(new po({errCode:fo.SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL,errMsg:i})),s.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 po({errCode:fo.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 wo.ReconnectWebSocket:case wo.NoRealtimeListeners:break;case wo.HeartbeatPingError:case wo.HeartbeatPongTimeoutError:case wo.NormalClosure:case wo.AbnormalClosure:t.maxReconnect>0?t.initWebSocketConnection(!0,t.maxReconnect):t.closeAllClients(_o(e.code));break;case wo.NoAuthentication:t.closeAllClients(_o(e.code,e.reason));break;default:t.maxReconnect>0?t.initWebSocketConnection(!0,t.maxReconnect):t.closeAllClients(_o(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 so(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,u=Array.from(t.watchIdClientMap.entries());c<u.length;c++){u[c][1].onMessage(r);break}}}else if(t.lastPingSendTS){var l=Date.now()-t.lastPingSendTS;if(l>1e4)return void console.warn("[realtime] untrusted rtt observed: ".concat(l));t.rttObserved.length>=3&&t.rttObserved.splice(0,t.rttObserved.length-3+1),t.rttObserved.push(l)}},t.heartbeat()})},this.isWSConnected=function(){return Boolean(t.ws&&1===t.ws.readyState)},this.onceWSConnected=function(){return Po(t,void 0,Promise,function(){var e=this;return Ro(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 Po(t,void 0,Promise,function(){var t,r,o,i,a,s,c,u,l=this;return Ro(this,function(p){switch(p.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];o=new Promise(function(e,t){Po(l,void 0,void 0,function(){var n,r,o,i,a;return Ro(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),[4,this.getWsSign()];case 1:return n=s.sent(),r={envId:n.envId||"",accessToken:"",referrer:"web",sdkVersion:"",dataVersion:""},o={watchId:void 0,requestId:no(),msgType:"LOGIN",msgData:r,exMsgData:{runtime:Oo(),signStr:n.signStr,secretVersion:n.secretVersion}},[4,this.send({msg:o,waitResponse:!0,skipOnMessage:!0,timeout:5e3})];case 2:return(i=s.sent()).msgData.code?t(new Error("".concat(i.msgData.code," ").concat(i.msgData.message))):e({envId:n.envId}),[3,4];case 3:return a=s.sent(),t(a),[3,4];case 4:return[2]}})})}),i=e&&this.logins.get(e),a=Date.now(),i?(i.loggedIn=!1,i.loggingInPromise=o,i.loginStartTS=a):(i={loggedIn:!1,loggingInPromise:o,loginStartTS:a},this.logins.set(e||"",i)),p.label=1;case 1:return p.trys.push([1,3,,4]),[4,o];case 2:if(s=p.sent(),(c=e&&this.logins.get(e))&&c===i&&c.loginStartTS===a)return i.loggedIn=!0,i.loggingInPromise=void 0,i.loginStartTS=void 0,i.loginResult=s,[2,s];if(c){if(c.loggedIn&&c.loginResult)return[2,c.loginResult];if(null!==c.loggingInPromise&&void 0!==c.loggingInPromise)return[2,c.loggingInPromise];throw new Error("ws unexpected login info")}throw new Error("ws login info reset");case 3:throw u=p.sent(),i.loggedIn=!1,i.loggingInPromise=void 0,i.loginStartTS=void 0,i.loginResult=void 0,u;case 4:return[2]}})})},this.getWsSign=function(){return Po(t,void 0,Promise,function(){var e,t,n,r,o,i,a;return Ro(this,function(s){switch(s.label){case 0:return this.wsSign&&this.wsSign.expiredTs>Date.now()?[2,this.wsSign]:(e=Date.now()+6e4,[4,this.context.appConfig.request.send("auth.wsWebSign",{runtime:Oo()})]);case 1:if((t=s.sent()).code)throw new Error("[tcb-js-sdk] 获取实时数据推送登录票据失败: ".concat(t.code));if(t.data)return n=t.data,r=n.signStr,o=n.wsUrl,i=n.secretVersion,a=n.envId,[2,{signStr:r,wsUrl:o,secretVersion:i,envId:a,expiredTs:e}];throw new Error("[tcb-js-sdk] 获取实时数据推送登录票据失败")}})})},this.getWaitExpectedTimeoutLength=function(){return t.rttObserved.length?t.rttObserved.reduce(function(e,t){return e+t})/t.rttObserved.length*1.5:5e3},this.ping=function(){return Po(t,void 0,void 0,function(){var e;return Ro(this,function(t){switch(t.label){case 0:return e={watchId:void 0,requestId:no(),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(wo.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,xo[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 go(To(To({},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(){Po(t,void 0,void 0,function(){var e=this;return Ro(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(wo.HeartbeatPingError),[3,3];case 3:return[2]}})})},e?0:this.context.appConfig.realtimePingInterval)},e}(),No={target:"database",entity:function(){var e,t=this.platform,n=t.adapter,r=t.runtime;e=n.wsClass,Eo=e,Ao(r)}},ko={name:"realtime",IIFE:!0,entity:function(){this.prototype.wsClientClass=Co}};try{cloudbase.registerComponent(ko),cloudbase.registerHook(No)}catch(e){}const Uo=(e=>{var t={};return __webpack_require__.d(t,e),t})({generateHTTPClient:()=>__WEBPACK_EXTERNAL_MODULE__cloudbase_wx_cloud_client_sdk_7708af81__.generateHTTPClient,generateMySQLClient:()=>__WEBPACK_EXTERNAL_MODULE__cloudbase_wx_cloud_client_sdk_7708af81__.generateMySQLClient,generatePGClient:()=>__WEBPACK_EXTERNAL_MODULE__cloudbase_wx_cloud_client_sdk_7708af81__.generatePGClient});var jo=function(){return jo=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},jo.apply(this,arguments)},Lo=r.U3.yE,Do="models",qo=new WeakMap;function Mo(e){return new Proxy({},{get:function(t,n){var r=e.getEndPointWithKey("GATEWAY"),o=r.BASE_URL,i=r.PROTOCOL,a=jo(jo({},e),{BASE_URL:o,PROTOCOL:i}),s=qo.get(a);return s||(s=function(e){var t=this,n=e.callFunction.bind(e),r=e.request.fetch.bind(e.request),o=e.getEndPointWithKey("GATEWAY"),i=o.BASE_URL,a=o.PROTOCOL,s="".concat(a).concat(i,"/model"),c="".concat(a).concat(i,"/sql"),u=(0,Uo.generateHTTPClient)(n,function(e){return n=t,o=void 0,a=function(){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:return[4,r(jo(jo({},e),{headers:jo({"Content-Type":"application/json"},e.headers)}))];case 1:return[4,t.sent().data];case 2:return[2,t.sent()]}})},new((i=void 0)||(i=Promise))(function(e,t){function r(e){try{c(a.next(e))}catch(e){t(e)}}function s(e){try{c(a.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i(function(e){e(n)})).then(r,s)}c((a=a.apply(n,o||[])).next())});var n,o,i,a},s,{sqlBaseUrl:c});return u}(e),qo.set(a,s)),s[n]}})}var Fo="cloudbase_init",Bo=new Lo;Bo.on(Fo,function(e){var t=e.data;Object.assign(t,{models:Mo(t)})});var Wo={name:Do,namespace:Do,entity:new Proxy({},{get:function(e,t){console.warn("【deprecated】Accessing Cloudbase.prototype.models.".concat(t,"."))}}),injectEvents:{bus:Bo,events:[Fo]}};try{cloudbase.registerComponent(Wo)}catch(e){}function Go(e){try{e.registerComponent(Wo)}catch(e){console.warn(e)}}try{window.registerModel=Go}catch(e){}var Vo=__webpack_require__(3408);const Ho=(e=>{var t={};return __webpack_require__.d(t,e),t})({createReadableStreamWrapper:()=>__WEBPACK_EXTERNAL_MODULE__mattiasbuelens_web_streams_adapter_7d231298__.createReadableStreamWrapper});var zo=[239,187,191];const Ko=(e=>{var t={};return __webpack_require__.d(t,e),t})({TextDecoder:()=>__WEBPACK_EXTERNAL_MODULE_text_encoding_shim_6f8fb6d2__.TextDecoder});var Jo=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())})},Yo=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])}}},$o="function"==typeof globalThis.ReadableStream&&"function"==typeof globalThis.TransformStream&&"function"==typeof globalThis.ReadableStream.prototype.pipeThrough,Xo=$o?globalThis.ReadableStream:Vo.ReadableStream,Qo=$o?globalThis.TransformStream:Vo.TransformStream,Zo=function(){var e;return new Qo({start:function(t){e=function(e){var t,n,r,o,i,a,s;return c(),{feed:function(e){n=n?n+e:e,t&&function(e){return zo.every(function(t,n){return e.charCodeAt(n)===t})}(n)&&(n=n.slice(zo.length)),t=!1;for(var i=n.length,a=0,s=!1;a<i;){s&&("\n"===n[a]&&(a+=1),s=!1);for(var c=-1,l=o,p=void 0,d=r;c<0&&d<i;d++)":"===(p=n[d])&&l<0?l=d-a:"\r"===p?(s=!0,c=d-a):"\n"===p&&(c=d-a);if(c<0){r=i-a,o=l;break}r=0,o=-1,u(n,a,l,c),a+=c+1}a===i?n="":a>0&&(n=n.slice(a))},reset:c};function c(){t=!0,n="",r=0,o=-1,i=void 0,a=void 0,s=""}function u(t,n,r,o){if(0===o)return s.length>0&&(e({type:"event",id:i,event:a||void 0,data:s.slice(0,-1)}),s="",i=void 0),void(a=void 0);var c,u=r<0,l=t.slice(n,n+(u?o:r)),p=n+(c=u?o:" "===t[n+r+1]?r+2:r+1),d=o-c,f=t.slice(p,p+d).toString();if("data"===l)s+=f?"".concat(f,"\n"):"\n";else if("event"===l)a=f;else if("id"!==l||f.includes("\0")){if("retry"===l){var h=parseInt(f,10);Number.isNaN(h)||e({type:"reconnect-interval",value:h})}}else i=f}}(function(e){"event"===e.type&&t.enqueue(e)})},transform:function(t){e.feed(t)}})},ei=$o?function(e){return e}:(0,Ho.createReadableStreamWrapper)(Xo),ti=function(){function e(e,t){void 0===e&&(e="utf-8"),void 0===t&&(t={});var n=this;this.transform=new Qo({transform:function(e,t){var r=n.handle.decode(new Uint8Array(e),{stream:!0});r&&t.enqueue(r)},flush:function(e){var t=n.handle.decode();t&&e.enqueue(t),e.terminate()}}),this.handle=new Ko.TextDecoder(e,t)}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 ni(e){var t=e;return t[Symbol.asyncIterator]=function(){var t=e.getReader();return{next:function(){return Jo(this,void 0,Promise,function(){var e,n,r;return Yo(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 ri(e){return ni(e.pipeThrough(new ti).pipeThrough(Zo()).pipeThrough(new Qo({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()}}})))}function oi(e){var t,n,r,o;return Jo(this,void 0,void 0,function(){var i,a,s,c,u,l;return Yo(this,function(p){switch(p.label){case 0:i=function(e){return ni(ei(e).pipeThrough(new ti))}(e),a="",p.label=1;case 1:p.trys.push([1,6,7,12]),s=!0,c=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)})}}}(i),p.label=2;case 2:return[4,c.next()];case 3:if(u=p.sent(),t=u.done)return[3,5];o=u.value,s=!1;try{a+=o}finally{s=!0}p.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return l=p.sent(),n={error:l},[3,12];case 7:return p.trys.push([7,,10,11]),s||t||!(r=c.return)?[3,9]:[4,r.call(c)];case 8:p.sent(),p.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(a)]}})})}function ii(){var e,t;return{promise:new Promise(function(n,r){e=n,t=r}),res:e,rej:t}}function ai(e){var t;return"assistant"===e.role&&"tool_calls"in e&&null!=(null===(t=e.tool_calls)||void 0===t?void 0:t[0])}var si=function(){return si=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},si.apply(this,arguments)},ci=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())})},ui=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])}}},li=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},pi=function(){function e(e,t){this.baseUrl=t;var n=arguments[2];this.req="string"==typeof n?function(t){var r=t.headers,o=void 0===r?{}:r,i=li(t,["headers"]);return e(si(si({},i),{headers:si(si({},o),{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 ci(this,void 0,void 0,function(){return ui(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=li(e,["botId"]);return ci(this,void 0,void 0,function(){return ui(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,r=void 0===n?10:n,o=e.pageNumber,i=void 0===o?1:o,a=e.botId,s=li(e,["pageSize","pageNumber","botId"]);return ci(this,void 0,void 0,function(){var e,n;return ui(this,function(o){if(i<1)throw new Error("pageNumber must be greater than 0");return e=r*(i-1),n=r,[2,this.req({method:"get",url:this.join("bots/".concat(a,"/conversation")),data:si(si({},s),{offset:e,limit:n}),timeout:null==t?void 0:t.timeout})]})})},e.prototype.deleteConversation=function(e,t){var n=e.botId,r=e.conversationId,o=li(e,["botId","conversationId"]);return ci(this,void 0,void 0,function(){return ui(this,function(e){return[2,this.req({method:"delete",url:this.join("bots/".concat(n,"/conversation/").concat(r)),data:o,timeout:null==t?void 0:t.timeout})]})})},e.prototype.speechToText=function(e,t){return ci(this,void 0,void 0,function(){return ui(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 ci(this,void 0,void 0,function(){return ui(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 ci(this,void 0,void 0,function(){return ui(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 ci(this,void 0,void 0,function(){var n;return ui(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 di(n)]}})})},e.prototype.generateBot=function(e,t){return ci(this,void 0,void 0,function(){var n;return ui(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 di(n)]}})})},e.prototype.getPreview=function(e,t){return ci(this,void 0,void 0,function(){var n;return ui(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 di(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 ci(this,void 0,void 0,function(){var n;return ui(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 di(n)]}})})},e.prototype.join=function(e){return"".concat(this.baseUrl,"/").concat(e)},e}(),di=function(){function e(e){var t=ei(e);this._eventSourceStream=t.pipeThrough(new ti).pipeThrough(Zo())}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 ni(this.teeedStream)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataStream",{get:function(){return ni(this.eventSourceStream.pipeThrough(new Qo({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 ni(this.dataStream.pipeThrough(new Qo({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}(),fi=function(){return fi=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},fi.apply(this,arguments)},hi=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())})},mi=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 vi(e){var t=e.messages,n=e.model,r=e.temperature,o=e.tool_choice,i=e.tools,a=e.top_p;return fi(fi({},e),{messages:t,model:n,temperature:r,tool_choice:(o&&"auto"!==o&&console.warn("`tool_choice` is not 'auto'"),o),tools:i,top_p:a})}var yi=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 hi(this,void 0,Promise,function(){var n,r;return mi(this,function(o){switch(o.label){case 0:return n=vi(e),[4,this.req({url:this.url,data:fi(fi({},n),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return r=o.sent(),[2,fi(fi({},r),{rawResponse:r})]}})})},e.prototype.doStream=function(e,t){return hi(this,void 0,Promise,function(){var n,r,o,i;return mi(this,function(a){switch(a.label){case 0:return n=vi(e),r=null,[4,this.req({url:this.url,data:fi(fi({},n),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return o=a.sent(),i=ei(o),[2,ni(ri(i).pipeThrough(new Qo({transform:function(e,t){var n=e.choices.map(function(e){var t=e.delta;return null==r&&(r=ai(t)),r?fi(fi({},e),{finish_reason:"tool_calls",delta:t}):e}),o=fi(fi({},e),{choices:n});t.enqueue(fi(fi({},o),{rawResponse:e}))}})))]}})})},e}(),gi=function(){return gi=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},gi.apply(this,arguments)};function bi(e){var t=e.messages,n=e.model,r=e.temperature,o=e.tool_choice,i=e.tools,a=e.top_p;return gi(gi({},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:n,tools:function(){if(i)return i.forEach(function(e){"function"!==e.type&&console.warn("`type` in tool is not 'function'",e)}),i}(),top_p:a,tool_choice:o,temperature:r})}function wi(e){return"object"!=typeof e||null==e?e:Array.isArray(e)?e.map(function(e){return wi(e)}):Object.entries(e).reduce(function(e,t){var n,r=t[0],o=t[1];return e["_"===(n=r.replace(/[A-Z]/g,function(e){return"_".concat(e.toLowerCase())})).charAt(0)?n.slice(1):n]="object"==typeof o?wi(o):o,e},{})}var xi=function(){return xi=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},xi.apply(this,arguments)},_i=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())})},Ei=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])}}},Ii=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 _i(this,void 0,Promise,function(){var n;return Ei(this,function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:xi(xi({},bi(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,xi(xi({},n),{rawResponse:n})]}})})},e.prototype.doStream=function(e,t){return _i(this,void 0,Promise,function(){var n,r,o;return Ei(this,function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:xi(xi({},bi(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=ei(r),[2,ni(ri(o).pipeThrough(new Qo({transform:function(e,t){var r=e.choices.map(function(e){var t=e.delta;return null==n&&(n=ai(t)),n?xi(xi({},e),{finish_reason:"tool_calls",delta:t}):e}),o=xi(xi({},e),{choices:r});t.enqueue(xi(xi({},o),{rawResponse:e}))}})))]}})})},e}(),Si=function(){return Si=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},Si.apply(this,arguments)},Oi=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())})},Ai=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])}}},Ti=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 Oi(this,void 0,Promise,function(){var n,r;return Ai(this,function(o){switch(o.label){case 0:return[4,this.req({url:this.url,headers:{"X-Tc-Action":"ChatCompletions"},data:Si(Si({},bi(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=o.sent(),r=wi(n.Response),[2,Si(Si({},r),{rawResponse:n})]}})})},e.prototype.doStream=function(e,t){return Oi(this,void 0,Promise,function(){var n,r,o;return Ai(this,function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,headers:{"X-Tc-Action":"ChatCompletions"},data:Si(Si({},e),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=ei(r),[2,ni(ri(o).pipeThrough(new Qo({transform:function(e,t){var r=wi(e),o=r.choices.map(function(e){var t=e.delta;return null==n&&(n=ai(t)),n?Si(Si({},e),{finish_reason:"tool_calls",delta:t}):e}),i=Si(Si({},r),{choices:o});t.enqueue(Si(Si({},i),{rawResponse:e}))}})))]}})})},e}(),Pi=function(){return Pi=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},Pi.apply(this,arguments)},Ri=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())})},Ci=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 Ni(e){var t=e.messages,n=e.model,r=e.temperature,o=e.tools,i=e.top_p;return Pi(Pi({},e),{messages:t,model:n,tools:o,top_p:i,temperature:r})}var ki=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 Ri(this,void 0,Promise,function(){var n;return Ci(this,function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:Pi(Pi({},Ni(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,Pi(Pi({},n),{rawResponse:n})]}})})},e.prototype.doStream=function(e,t){return Ri(this,void 0,Promise,function(){var n,r,o;return Ci(this,function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:Pi(Pi({},Ni(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=ei(r),[2,ni(ri(o).pipeThrough(new Qo({transform:function(e,t){var r=e.choices.map(function(e){var t=e.delta;return null==n&&(n=ai(t)),n?Pi(Pi({},e),{finish_reason:"tool_calls",delta:t}):e}),o=Pi(Pi({},e),{choices:r});t.enqueue(Pi(Pi({},o),{rawResponse:e}))}})))]}})})},e}(),Ui=function(){return Ui=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},Ui.apply(this,arguments)},ji=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())})},Li=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 Di(e){var t=e.messages,n=e.model,r=e.temperature,o=e.tools,i=e.top_p;return Ui(Ui({},e),{messages:t,model:n,tools:o,top_p:i,temperature:r})}var qi=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 ji(this,void 0,Promise,function(){var n;return Li(this,function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:Ui(Ui({},Di(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,Ui(Ui({},n),{rawResponse:n})]}})})},e.prototype.doStream=function(e,t){return ji(this,void 0,Promise,function(){var n,r,o;return Li(this,function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:Ui(Ui({},Di(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=ei(r),[2,ni(ri(o).pipeThrough(new Qo({transform:function(e,t){var r=e.choices.map(function(e){var t=Object.assign(e.delta,{role:"assistant"});return null==n&&(n=ai(t)),Ui(Ui({},e),n?{finish_reason:"tool_calls",delta:t}:{delta:t})}),o=Ui(Ui({},e),{choices:r});t.enqueue(Ui(Ui({},o),{rawResponse:e}))}})))]}})})},e}(),Mi=function(){return Mi=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},Mi.apply(this,arguments)},Fi=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())})},Bi=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 Wi(e){var t=e.messages,n=e.model,r=e.temperature,o=e.tools,i=e.top_p;return Mi(Mi({},e),{messages:t,model:n,tools:o,top_p:i,temperature:r})}var Gi=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 Fi(this,void 0,Promise,function(){var n;return Bi(this,function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:Mi(Mi({},Wi(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,Mi(Mi({},n),{rawResponse:n})]}})})},e.prototype.doStream=function(e,t){return Fi(this,void 0,Promise,function(){var n,r,o,i,a;return Bi(this,function(s){switch(s.label){case 0:return n=null,[4,this.req({url:this.url,data:Mi(Mi({},Wi(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=s.sent(),o=ei(r),i=ri(o),a=i.pipeThrough(new Qo({transform:function(e,t){var r,o,i,a,s,c;if((null===(i=null===(o=null===(r=null==e?void 0:e.choices)||void 0===r?void 0:r[0])||void 0===o?void 0:o.delta)||void 0===i?void 0:i.content)||(null===(c=null===(s=null===(a=null==e?void 0:e.choices)||void 0===a?void 0:a[0])||void 0===s?void 0:s.delta)||void 0===c?void 0:c.tool_calls)){var u=e.choices.map(function(e){var t=Object.assign(e.delta,{role:"assistant"});return null==n&&(n=ai(t)),Mi(Mi({},e),n?{finish_reason:"tool_calls",delta:t}:{delta:t})}),l=Mi(Mi({},e),{choices:u});t.enqueue(Mi(Mi({},l),{rawResponse:e}))}}})),[2,ni(a)]}})})},e}(),Vi=function(){return Vi=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},Vi.apply(this,arguments)},Hi=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())})},zi=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 Ki(e){var t=e.messages,n=e.model,r=e.temperature,o=e.tools,i=e.top_p;return Vi(Vi({},e),{messages:t,model:n,tools:o,top_p:i,temperature:r})}var Ji=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 Hi(this,void 0,Promise,function(){var n;return zi(this,function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:Vi(Vi({},Ki(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,Vi(Vi({},n),{rawResponse:n})]}})})},e.prototype.doStream=function(e,t){return Hi(this,void 0,Promise,function(){var n,r,o;return zi(this,function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:Vi(Vi({},Ki(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=ei(r),[2,ni(ri(o).pipeThrough(new Qo({transform:function(e,t){var r=e.choices.map(function(e){var t=e.delta;return null==n&&(n=ai(t)),n?Vi(Vi({},e),{finish_reason:"tool_calls",delta:t}):e}),o=Vi(Vi({},e),{choices:r});t.enqueue(Vi(Vi({},o),{rawResponse:e}))}})))]}})})},e}(),Yi=function(){return Yi=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},Yi.apply(this,arguments)},$i=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())})},Xi=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])}}},Qi=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 $i(this,void 0,Promise,function(){var t;return Xi(this,function(n){switch(n.label){case 0:return[4,this.req({url:this.url,data:Yi(Yi({},bi(e)),{stream:!1}),stream:!1})];case 1:return t=n.sent(),[2,Yi(Yi({},t),{rawResponse:t})]}})})},e.prototype.doStream=function(e){return $i(this,void 0,Promise,function(){var t,n,r;return Xi(this,function(o){switch(o.label){case 0:return t=null,[4,this.req({url:this.url,data:Yi(Yi({},bi(e)),{stream:!0}),stream:!0})];case 1:return n=o.sent(),r=ei(n),[2,ni(ri(r).pipeThrough(new Qo({transform:function(e,n){var r=e.choices.map(function(e){var n=e.delta;return null==t&&(t=ai(n)),t?Yi(Yi({},e),{finish_reason:"tool_calls",delta:n}):e}),o=Yi(Yi({},e),{choices:r});n.enqueue(Yi(Yi({},o),{rawResponse:e}))}})))]}})})},e}(),Zi=function(){return Zi=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},Zi.apply(this,arguments)},ea=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())})},ta=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])}}},na=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 ea(this,void 0,Promise,function(){var n;return ta(this,function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:Zi(Zi({},bi(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,Zi(Zi({},n),{rawResponse:n})]}})})},e.prototype.doStream=function(e,t){return ea(this,void 0,Promise,function(){var n,r,o;return ta(this,function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:Zi(Zi({},bi(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=ei(r),[2,ni(ri(o).pipeThrough(new Qo({transform:function(e,t){var r=e.choices.map(function(e){var t=e.delta;return null==n&&(n=ai(t)),n?Zi(Zi({},e),{finish_reason:"tool_calls",delta:t}):e}),o=Zi(Zi({},e),{choices:r});t.enqueue(Zi(Zi({},o),{rawResponse:e}))}})))]}})})},e}(),ra=function(){return ra=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},ra.apply(this,arguments)},oa=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())})},ia=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])}}},aa=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 oa(this,void 0,Promise,function(){var n;return ia(this,function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:ra(ra({},e),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,ra(ra({},n),{rawResponse:n})]}})})},e.prototype.doStream=function(e,t){return oa(this,void 0,Promise,function(){var n,r,o;return ia(this,function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:ra(ra({},e),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=ei(r),[2,ni(ri(o).pipeThrough(new Qo({transform:function(e,t){var r=e.choices.map(function(e){var t=e.delta;return null==n&&(n=ai(t)),n?ra(ra({},e),{finish_reason:"tool_calls",delta:t}):e}),o=ra(ra({},e),{choices:r});t.enqueue(ra(ra({},o),{rawResponse:e}))}})))]}})})},e}(),sa=function(){return sa=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},sa.apply(this,arguments)},ca=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())})},ua=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])}}},la=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 ca(this,void 0,Promise,function(){var t;return ua(this,function(n){switch(n.label){case 0:return[4,this.req({url:this.url,data:sa(sa({},e),{stream:!1}),stream:!1})];case 1:return t=n.sent(),[2,sa(sa({},t),{rawResponse:t})]}})})},e.prototype.doStream=function(e){return ca(this,void 0,Promise,function(){var t,n,r;return ua(this,function(o){switch(o.label){case 0:return t=null,[4,this.req({url:this.url,data:sa(sa({},e),{stream:!0}),stream:!0})];case 1:return n=o.sent(),r=ei(n),[2,ni(ri(r).pipeThrough(new Qo({transform:function(e,n){var r=e.choices.map(function(e){var n=e.delta;return null==t&&(t=ai(n)),t?sa(sa({},e),{finish_reason:"tool_calls",delta:n}):e}),o=sa(sa({},e),{choices:r});n.enqueue(sa(sa({},o),{rawResponse:e}))}})))]}})})},e}(),pa=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)}}(),da=function(e){function t(t,n){var r=e.call(this,t)||this;return r.name="InvalidParamsError",r.code="INVALID_PARAMS",r.field=n,r}return pa(t,e),t.prototype.toJSON=function(){return{code:this.code,message:this.message,field:this.field}},t}(Error),fa=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 t=this,n=void 0,o=function(){var t,n,r,o,i;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(a){switch(a.label){case 0:if("object"==typeof e&&e&&"model"in e&&"HY-Image-v3.0-I2I-ToB-v1.0.1"===e.model&&(""===this.provider||"hunyuan-image"===this.provider)){if(n=(t=e).image_urls,r=t.images,n&&n.length>1)throw new da("当模型为 HY-Image-v3.0-I2I-ToB-v1.0.1 时,image_urls 最多只能有 1 个元素","image_urls");if(r&&r.length>1)throw new da("当模型为 HY-Image-v3.0-I2I-ToB-v1.0.1 时,images 最多只能有 1 个元素","images")}return o=this.defaultGenerateImageSubUrl,"object"==typeof e&&e&&"model"in e&&"string"==typeof e.model&&(i=this.getGenerateImageSubUrl(this.provider,e.model))&&(o=i),[4,this.req({url:this.getGenerateUrl(o),data:e,stream:!1})];case 1:return[2,a.sent()]}})},new((r=Promise)||(r=Promise))(function(e,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r(function(e){e(n)})).then(a,s)}c((o=o.apply(t,n||[])).next())});var t,n,r,o},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}(),ha=function(){return ha=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},ha.apply(this,arguments)},ma=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())})},va=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])}}},ya=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 ga(e){var t,n=e.onStepFinish,r=e.abortSignal,o=e.maxSteps,i=e.topP,a=e.toolChoice,s=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}(e,["onStepFinish","abortSignal","maxSteps","topP","toolChoice"]);if(null!=o&&o<1)throw new Error("`maxSteps` muse be greater than 0.");return[{onStepFinish:n,abortSignal:r,maxSteps:o},ha(ha({},s),{tools:null===(t=s.tools)||void 0===t?void 0:t.map(function(e){return"fn"in e?function(e){return{type:"function",function:{description:e.description,name:e.name,parameters:e.parameters}}}(e):e}),top_p:null!=i?i:s.top_p,tool_choice:null!=a?a:s.tool_choice})]}var ba=function(){function e(e){this.model=e}return e.prototype.generateText=function(e,t){var n,r;return ma(this,void 0,Promise,function(){var o,i,a,s,c,u,l,p,d,f,h,m,v,y,g,b,w,x,_,E,I,S=this;return va(this,function(O){switch(O.label){case 0:return o=[],i={completion_tokens:0,prompt_tokens:0,total_tokens:0},a=ga(e),s=a[0],c=s.onStepFinish,u=s.maxSteps,l=void 0===u?10:u,p=a[1],[4,(d=function(){return S.model.doGenerate(p,t)})()];case 1:f=O.sent(),h=1,f.rawResponse&&o.push(f.rawResponse),m=null,O.label=2;case 2:if(!(h<l&&null!=(m=wa(f))))return[3,9];v=Ia(f.usage),Sa(i,v),O.label=3;case 3:return O.trys.push([3,7,,8]),[4,Ea(m)];case 4:return y=O.sent(),g=f.choices[0],[4,null==c?void 0:c({finishReason:g.finish_reason,messages:p.messages.slice(),text:g.message.content,toolCall:m,toolResult:y,stepUsage:v,totalUsage:Object.assign({},i)})];case 5:return O.sent(),xa(p.messages,g.message,y),[4,d()];case 6:return(f=O.sent()).rawResponse&&o.push(f.rawResponse),h+=1,[3,8];case 7:return b=O.sent(),[2,{text:"",messages:p.messages,usage:i,error:b,rawResponses:o}];case 8:return[3,2];case 9:return w=null===(n=null==f?void 0:f.choices)||void 0===n?void 0:n[0],x=null==w?void 0:w.message,_=null!==(r=null==x?void 0:x.content)&&void 0!==r?r:"",E=x?ya(ya([],p.messages,!0),[x],!1):p.messages,I=Ia(f.usage),Sa(i,I),[4,null==c?void 0:c({finishReason:w.finish_reason,messages:E.slice(),text:_,toolCall:wa(f),toolResult:null,stepUsage:I,totalUsage:Object.assign({},i)})];case 10:return O.sent(),[2,{text:_,messages:E,usage:i,rawResponses:o}]}})})},e.prototype.streamText=function(e,t){var n;return ma(this,void 0,Promise,function(){var r,o,i,a,s,c,u,l,p,d,f,h,m,v,y,g,b,w,x,_,E,I,S,O,A,T,P,R,C,N,k,U,j,L,D,q,M=this;return va(this,function(F){switch(F.label){case 0:return r={completion_tokens:0,prompt_tokens:0,total_tokens:0},o=ga(e),i=o[0],a=i.onStepFinish,s=i.maxSteps,c=void 0===s?10:s,u=o[1],[4,(l=function(){return M.model.doStream(u,t)})()];case 1:p=F.sent(),d=1,f=null,h=function(){var e=p.tee(),t=e[0],n=e[1];return p=ni(t),function(e){var t,n,r,o,i,a,s,c,u,l;return ma(this,void 0,Promise,function(){var p,d,f,h,m,v,y,g,b,w,x,_,E;return va(this,function(I){switch(I.label){case 0:p={completion_tokens:0,prompt_tokens:0,total_tokens:0},d=ni(e),h={role:"assistant",content:"",tool_calls:[f={id:"",function:{name:"",arguments:""},type:""}]},I.label=1;case 1:I.trys.push([1,6,7,12]),m=!0,v=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)})}}}(d),I.label=2;case 2:return[4,v.next()];case 3:if(y=I.sent(),t=y.done)return[3,5];o=y.value,m=!1;try{if(!(b=null==(g=o)?void 0:g.choices[0]))return[2,null];if(w=b.finish_reason,x=b.delta,"tool_calls"!==w)return[2,null];if(!x)return[3,4];if(x.content&&(h.content+=x.content),!("tool_calls"in x))return[3,4];(null==(_=null===(i=null==x?void 0:x.tool_calls)||void 0===i?void 0:i[0])?void 0:_.id)&&(f.id=_.id),(null==_?void 0:_.type)&&(f.type=_.type),(null===(a=null==_?void 0:_.function)||void 0===a?void 0:a.name)&&(f.function.name=_.function.name),(null===(s=null==_?void 0:_.function)||void 0===s?void 0:s.arguments)&&(f.function.arguments+=_.function.arguments),(null===(c=null==g?void 0:g.usage)||void 0===c?void 0:c.completion_tokens)&&(p.completion_tokens=g.usage.completion_tokens),(null===(u=null==g?void 0:g.usage)||void 0===u?void 0:u.prompt_tokens)&&(p.prompt_tokens=g.usage.prompt_tokens),(null===(l=null==g?void 0:g.usage)||void 0===l?void 0:l.total_tokens)&&(p.total_tokens=g.usage.total_tokens)}finally{m=!0}I.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return E=I.sent(),n={error:E},[3,12];case 7:return I.trys.push([7,,10,11]),m||t||!(r=v.return)?[3,9]:[4,r.call(v)];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:h,usage:p}]}})})}(n)},F.label=2;case 2:return(m=d<c)?[4,h()]:[3,4];case 3:m=null!=(f=F.sent()),F.label=4;case 4:if(!m)return[3,11];v=f.message,y=f.usage,Sa(r,y),g=null===(n=v.tool_calls)||void 0===n?void 0:n[0],F.label=5;case 5:return F.trys.push([5,9,,10]),[4,Ea(g)];case 6:return b=F.sent(),[4,null==a?void 0:a({finishReason:"tool_calls",messages:u.messages.slice(),text:v.content,toolCall:g,toolResult:b,stepUsage:y,totalUsage:Object.assign({},r)})];case 7:return F.sent(),xa(u.messages,v,b),[4,l()];case 8:return p=F.sent(),[3,10];case 9:return w=F.sent(),x=p.tee(),_=x[0],E=x[1],[2,{messages:Promise.resolve(u.messages),dataStream:ni(_),textStream:ni(E.pipeThrough(new Qo({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:w}];case 10:return[3,2];case 11:return[4,h()];case 12:return(f=F.sent())?(I=f.message,S=f.usage,Sa(r,S),O=ya(ya([],u.messages,!0),[I],!1),a({messages:O.slice(),finishReason:"tool_call",stepUsage:S,text:I.content,toolCall:I.tool_calls[0],totalUsage:Object.assign({},r)}),A=p.tee(),T=A[0],P=A[1],[2,{messages:Promise.resolve(ya(ya([],u.messages,!0),[I],!1)),dataStream:ni(T),textStream:ni(P.pipeThrough(new Qo({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)}]):(R=ii(),C=ii(),N={role:"assistant",content:""},k="",U={completion_tokens:0,prompt_tokens:0,total_tokens:0},j=p.pipeThrough(new Qo({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&&(N.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&&(k=p),(null===(s=null==e?void 0:e.usage)||void 0===s?void 0:s.completion_tokens)&&(U.completion_tokens=e.usage.completion_tokens),(null===(c=null==e?void 0:e.usage)||void 0===c?void 0:c.prompt_tokens)&&(U.prompt_tokens=e.usage.prompt_tokens),(null===(u=null==e?void 0:e.usage)||void 0===u?void 0:u.total_tokens)&&(U.total_tokens=e.usage.total_tokens),t.enqueue(e)},flush:function(){R.res(ya(ya([],u.messages,!0),[N],!1)),Sa(r,U),C.res(Object.assign({},r)),null==a||a({messages:ya(ya([],u.messages,!0),[N],!1),finishReason:k,text:N.content,stepUsage:U,totalUsage:Object.assign({},r)})}})),L=j.tee(),D=L[0],q=L[1],[2,{messages:R.promise,dataStream:ni(D),textStream:ni(q.pipeThrough(new Qo({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:C.promise}])}})})},e}();function wa(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&&ai(o)?o.tool_calls[0]:null}function xa(e,t,n){e.push(t,{role:"tool",tool_call_id:t.tool_calls[0].id,content:JSON.stringify(n)})}var _a=new Map;function Ea(e){return _a.get(e.function.name)(JSON.parse(e.function.arguments))}function Ia(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 Sa(e,t){e.completion_tokens+=t.completion_tokens,e.prompt_tokens+=t.prompt_tokens,e.total_tokens+=t.total_tokens}var Oa={hunyuan:Ti,"hunyuan-beta":Ii,ark:ki,dashscope:qi,"01-ai":Gi,moonshot:Ji,zhipu:yi,"hunyuan-exp":Qi,"hunyuan-open":na,deepseek:aa},Aa=function(){return Aa=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},Aa.apply(this,arguments)},Ta=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())})},Pa=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])}}},Ra=Oa,Ca=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,r=e.headers,o=e.stream,a=e.timeout;return Ta(i,void 0,void 0,function(){var e,i,s,c,u,l,p;return Pa(this,function(d){switch(d.label){case 0:return e={"Content-Type":"application/json"},o&&Object.assign(e,{Accept:"text/event-stream"}),[4,this.req.fetch({method:"post",headers:Aa(Aa((u={},u[null===(l=this.i18n)||void 0===l?void 0:l.LANG_HEADER_KEY]=null===(p=this.i18n)||void 0===p?void 0:p.lang,u),e),r),body:JSON.stringify(n),url:this.resolveUrl(t),stream:o,timeout:a})];case 1:return i=d.sent(),s=i.data,c=i.header,[2,this.handleResponseData(s,c)]}})})},this.botRequest=function(e){var t=e.method,n=e.url,r=e.data,o=void 0===r?{}:r,a=e.headers,s=e.stream,c=e.timeout;return Ta(i,void 0,void 0,function(){var e,r,i,u,l,p,d,f,h;return Pa(this,function(m){switch(m.label){case 0:return e=this.resolveUrl(n),"get"!==t?[3,2]:(r=this.handleResponseData,[4,this.req.fetch({url:"".concat(e,"?").concat((v=o,Object.entries(v).map(function(e){var t=e[0],n=e[1];return"".concat(t,"=").concat(n)}).join("&"))),method:t,headers:a,stream:s,timeout:c})]);case 1:return[2,r.apply(this,[m.sent().data])];case 2:return i={"Content-Type":"application/json"},s&&Object.assign(i,{Accept:"text/event-stream"}),[4,this.req.fetch({url:e,body:JSON.stringify(o),headers:Aa(Aa((d={},d[null===(f=this.i18n)||void 0===f?void 0:f.LANG_HEADER_KEY]=null===(h=this.i18n)||void 0===h?void 0:h.lang,d),i),a),stream:s,method:t,timeout:c})];case 3:return u=m.sent(),l=u.data,p=u.header,[2,this.handleResponseData(l,p)]}var v})})},this._getBaseUrl=o,this.bot=new pi(this.botRequest,this.aiBotBaseUrl),this.i18n=n,r.RR.$.on(r.RR.P,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 Ta(this,void 0,void 0,function(){var o,i,a,s,c=this;return Pa(this,function(u){switch(u.label){case 0:return o="".concat(this.i18n.t("请检查调用方式,或前往云开发 AI+ 首页查看文档"),":https://tcb.cloud.tencent.com/dev#/ai"),i=function(e){if("object"==typeof e&&e&&"code"in e&&"NORMAL"!==e.code)throw new Error("".concat(c.i18n.t("AI+ 请求出错,错误码"),":").concat(e.code,",").concat(c.i18n.t("错误信息"),":").concat(e.message,"\n").concat(o,"\n").concat(JSON.stringify(e,null,2)))},"object"==typeof e&&e&&"function"!=typeof e.getReader?"then"in e?[4,e]:[3,2]:[3,4];case 1:return a=u.sent(),[3,3];case 2:a=e,u.label=3;case 3:return i(s=a),[2,e];case 4:if("function"!=typeof(null==e?void 0:e.getReader)){if("object"==typeof(s=e)&&s&&"code"in s&&"NORMAL"!==s.code)throw new Error("".concat(this.i18n.t("AI+ 请求出错,错误码"),":").concat(s.code,",").concat(this.i18n.t("错误信息"),":").concat(s.message,"\n").concat(o,"\n").concat(JSON.stringify(s,null,2)));return[2,e]}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,oi(e)]:[3,6];case 5:s=u.sent(),i(s),u.label=6;case 6:return[2,e]}})})},e.prototype.createModel=function(e,t){var n,r=Ra[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 la(this.modelRequest,this.aiBaseUrl,"".concat(e).concat(o))}return new ba(n)},e.prototype.registerModel=function(e,t){null==Ra[e]?Ra[e]=t:console.warn("AI model ".concat(e," already exists!"))},e.prototype.createImageModel=function(e){return new fa(this.modelRequest,this.aiBaseUrl,e)},e.prototype.registerFunctionTool=function(e){_a.has(e.name)&&console.warn("AI function tool ".concat(e.name," already exists and will be overwritten!")),_a.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}(),Na=function(){return Na=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},Na.apply(this,arguments)},ka=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};function Ua(e){var t=e.env,n=e.baseUrl,r=e.getBaseUrl,o=e.req,i=e.getAccessToken,a=e.handleReqInstance,s=e.i18n;return new Ca(function(){if(null==a){if(null==i)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 r=void 0,o=void 0,a=function(){var r,o,i,a,s;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(c){switch(c.label){case 0:if("function"!=typeof n.fetch)throw new Error("req.fetch is not a function");return r=e.token,o=e.headers,i=void 0===o?{}:o,a=ka(e,["token","headers"]),null==r?[3,1]:(s=r,[3,3]);case 1:return[4,t()];case 2:s=c.sent().accessToken,c.label=3;case 3:return[2,n.fetch(Na({headers:Na({Authorization:"Bearer ".concat(s)},i)},a))]}})},new((i=void 0)||(i=Promise))(function(e,t){function n(e){try{c(a.next(e))}catch(e){t(e)}}function s(e){try{c(a.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i(function(e){e(r)})).then(n,s)}c((a=a.apply(r,o||[])).next())});var r,o,i,a}}}({req:o,getAccessToken:i})}return a({req:o})}(),function(){if(null!=r)return r();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")}(),s,r)}ka(t,["MODELS"]);var ja={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)?Ua({req:n,baseUrl:e.baseUrl,handleReqInstance:function(e){return e.req},i18n:this.config.i18n}):Ua({req:n,baseUrl:r(),getBaseUrl:r,handleReqInstance:function(e){return e.req},i18n:this.config.i18n})}}};function La(e){try{e.registerComponent(ja)}catch(e){console.warn(e)}}try{window.registerAi=La}catch(e){}var Da=function(){return Da=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},Da.apply(this,arguments)};function qa(e){if(!e)return{get:function(){return null},forEach:function(){}};if("function"==typeof e.get)return e;var t={};return Object.keys(e).forEach(function(n){t[n.toLowerCase()]=e[n]}),{get:function(e){var n;return null!==(n=t[e.toLowerCase()])&&void 0!==n?n:null},forEach:function(e){Object.entries(t).forEach(function(t){var n=t[0],r=t[1];return e(r,n)})}}}function Ma(e,t,n){var r=this,o=e.request.fetch.bind(e.request),i=t||{},a=i.instance,s=void 0===a?n?void 0:"default":a,c=i.database,u=void 0===c?n?void 0:e.config.env:c,l=e.getEndPointWithKey("GATEWAY"),p=l.BASE_URL,d=l.PROTOCOL,f="".concat(d).concat(p),h=function(t,n){return i=r,a=void 0,l=function(){var r,i,a,c,l,p,d,h,m,v;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(y){switch(y.label){case 0:return r={},n.headers instanceof Headers?n.headers.forEach(function(e,t){r[t]=e}):n.headers&&Object.assign(r,n.headers),[["X-Db-Instance",s],["Accept-Profile",u],["Content-Profile",u]].forEach(function(e){var t=e[0],n=e[1];r[t]||r[t.toLocaleLowerCase()]||!n||(r[t]=n)}),i=t.toString(),a=e.getEndPointWithKey("GATEWAY"),c=a.BASE_URL,l=a.PROTOCOL,(p="".concat(l).concat(c))!==f&&i.startsWith(f)&&(i=i.replace(f,p)),[4,o(Da(Da({url:i},n),{headers:Da({"Content-Type":"application/json"},r),shouldThrowOnError:!1}))];case 1:d=y.sent(),h={},y.label=2;case 2:return y.trys.push([2,4,,5]),[4,d.data];case 3:return h=y.sent(),[3,5];case 4:if(m=y.sent(),!(null===(v=null==m?void 0:m.message)||void 0===v?void 0:v.includes("Unexpected end of JSON input")))throw m;return[3,5];case 5:return[2,{ok:(null==d?void 0:d.statusCode)>=200&&(null==d?void 0:d.statusCode)<300,status:(null==d?void 0:d.statusCode)||200,statusText:(null==d?void 0:d.statusMessage)||"OK",json:function(){return Promise.resolve(h||{})},text:function(){return Promise.resolve("string"==typeof h?h:JSON.stringify(h||{}))},headers:qa(null==d?void 0:d.header)}]}})},new((c=void 0)||(c=Promise))(function(e,t){function n(e){try{o(l.next(e))}catch(e){t(e)}}function r(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){var o;t.done?e(t.value):(o=t.value,o instanceof c?o:new c(function(e){e(o)})).then(n,r)}o((l=l.apply(i,a||[])).next())});var i,a,c,l},m="".concat(d).concat(p,"/rdb/rest");return n?(0,Uo.generatePGClient)(e,{pgBaseUrl:m,fetch:h}):(0,Uo.generateMySQLClient)(e,{mysqlBaseUrl:m,fetch:h})}var Fa={name:"mysql",entity:{mysql:function(e){return Ma(this,e,!1)(e)}}},Ba={name:"rdb",entity:{rdb:function(e){return Ma(this,e,!0)(e)}}};try{cloudbase.registerComponent(Fa),cloudbase.registerComponent(Ba)}catch(e){}function Wa(e){try{e.registerComponent(Fa),e.registerComponent(Ba)}catch(e){console.warn(e)}}try{window.registerMySQL=Wa}catch(e){}var Ga=function(){return Ga=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},Ga.apply(this,arguments)},Va=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())})},Ha=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 za(e,t){var n,r,o,i;return Va(this,void 0,Promise,function(){var a,s,c,u,l,p,d,f,h,m,v,y,g,b,w,x,_,E,I,S,O,A,T;return Ha(this,function(P){switch(P.label){case 0:s=(a=e||{}).name,c=a.body,u=a.path,l=void 0===u?"":u,p=a.method,d=void 0===p?"POST":p,f=a.headers,h=void 0===f?{}:f,m=(e||{}).token,v={};try{v=JSON.parse(c)}catch(e){v=c||{}}if(!s)throw new Error(JSON.stringify({code:It.ERRORS.INVALID_PARAMS,msg:"[apis] invalid api name"}));return y="",b=(g=this).gatewayOrigin,w=g.getAccessToken,x=g.env,b?y="".concat(b,"/v1"):this.getEndPointWithKey?(_=this.getEndPointWithKey("GATEWAY"),E=_.BASE_URL,I=_.PROTOCOL,y="".concat(I).concat(E)):y="https://".concat(x,".api.tcloudbasegateway.com/v1"),S="".concat(y,"/apis/").concat(s),O=l.startsWith("/")?l:"/".concat(l),w?[4,w()]:[3,2];case 1:A=P.sent().accessToken,h.Authorization="Bearer ".concat(A),P.label=2;case 2:if(T=["GET","HEAD"].includes(null===(n=null==d?void 0:d.toUpperCase)||void 0===n?void 0:n.call(d)))try{O="".concat(O).concat(O.includes("?")?"&":"?").concat(Object.keys(v).map(function(e){return"".concat(e,"=").concat(v[e])}).join("&"))}catch(e){}return[4,this.request.fetch(Ga(Ga(Ga({url:"".concat(S).concat(O),method:d||"POST",headers:Ga({"Content-Type":"application/json; charset=utf-8"},h)},T?{}:{body:JSON.stringify(v)}),{token:(null===(r=null==m?void 0:m.trim)||void 0===r?void 0:r.call(m))||(null===(i=null===(o=h.Authorization)||void 0===o?void 0:o.replace)||void 0===i?void 0:i.call(o,/^Bearer /,""))||null}),t))];case 3:return[4,P.sent().data];case 4:return[2,P.sent()]}})})}var Ka=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH","REQUEST"];function Ja(e){var t=this;return new Proxy({},{get:function(n,r){if("string"!=typeof r)throw new Error("[apis] method must be string");var o=r.toLocaleUpperCase();if(!Ka.includes(o))throw new Error("[apis] invalid method: ".concat(r));return function(n,r){return Va(t,void 0,void 0,function(){return Ha(this,function(t){switch(t.label){case 0:return[4,za.call(this,Ga({name:e,method:("REQUEST"===o?n.method:o)||"POST"},n),r)];case 1:return[2,t.sent()]}})})}}})}function Ya(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 Ja.call(t,n)}})}var $a,Xa,Qa="apis",Za={name:Qa,IIFE:!0,entity:function(){Object.defineProperty(this.prototype,Qa,{get:function(){return Ya.call(this)},configurable:!0,enumerable:!0})}};function es(e){try{e.registerComponent(Za)}catch(e){console.warn(e)}}try{cloudbase.registerComponent(Za)}catch(e){}try{window.registerApis=es}catch(e){}!function(e){e.DocIDError="文档ID不合法",e.CollNameError="集合名称不合法",e.OpStrError="操作符不合法",e.DirectionError="排序字符不合法",e.IntergerError="must be integer",e.BooleanError="must be boolean",e.ArrayError="must be array",e.QueryParamTypeError="查询参数必须为对象",e.QueryParamValueError="查询参数对象值不能均为undefined",e.CentersPhereError="centersPhere结构不合法"}(Xa||(Xa={}));var ts,ns,rs="Object",os="GeoPoint",is="GeoLineString",as="GeoPolygon",ss="GeoMultiPoint",cs="GeoMultiLineString",us="GeoMultiPolygon",ls="Date",ps="ServerDate",ds=["desc","asc"],fs=["<","<=","==",">=",">"];!function(e){e.lt="<",e.gt=">",e.lte="<=",e.gte=">=",e.eq="=="}(ts||(ts={})),($a={})[ts.eq]="$eq",$a[ts.lt]="$lt",$a[ts.lte]="$lte",$a[ts.gt]="$gt",$a[ts.gte]="$gte",function(e){e.WHERE="WHERE",e.DOC="DOC"}(ns||(ns={}));var hs=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)}}(),ms=[],vs={},ys=function(e){function t(t,n){if(n!==vs)throw new TypeError("InternalSymbol cannot be constructed with new operator");return e.call(this,t)||this}return hs(t,e),t.for=function(e){for(var n=0,r=ms.length;n<r;n++)if(ms[n].target===e)return ms[n].instance;var o=new t(e,vs);return ms.push({target:e,instance:o}),o},t}(function(e){Object.defineProperties(this,{target:{enumerable:!1,writable:!1,configurable:!1,value:e}})});const gs=ys;var bs=gs.for("UNSET_FIELD_NAME"),ws=gs.for("UPDATE_COMMAND"),xs=gs.for("QUERY_COMMAND"),_s=gs.for("LOGIC_COMMAND"),Es=gs.for("GEO_POINT"),Is=gs.for("SYMBOL_GEO_LINE_STRING"),Ss=gs.for("SYMBOL_GEO_POLYGON"),Os=gs.for("SYMBOL_GEO_MULTI_POINT"),As=gs.for("SYMBOL_GEO_MULTI_LINE_STRING"),Ts=gs.for("SYMBOL_GEO_MULTI_POLYGON"),Ps=gs.for("SERVER_DATE"),Rs=gs.for("REGEXP"),Cs=gs.for("OBJECTID"),Ns=function(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()},ks=function(e){return"object"===Ns(e)},Us=function(e){return"number"===Ns(e)},js=function(e){return Array.isArray(e)},Ls=function(e){return"date"===Ns(e)},Ds=function(e){return"regexp"===Ns(e)},qs=function(e){return e&&e._internalType instanceof ys},Ms=function(){function e(e){if(!js(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 vc))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||!js(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(!Us(i[0])||!Us(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 Is},enumerable:!1,configurable:!0}),e}(),Fs=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.")},Bs=function(){function e(e){if(!js(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 Ms))throw new TypeError('"lines" must be of type LineString[]. Received type '.concat(typeof e,"[]"));if(!Ms.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||!js(e.coordinates))return!1;try{for(var i=Fs(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,Fs(s)),u=c.next();!u.done;u=c.next()){var l=u.value;if(!Us(l[0])||!Us(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 Ss},enumerable:!1,configurable:!0}),e}(),Ws=function(){function e(e){if(!js(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 vc))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||!js(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(!Us(i[0])||!Us(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 Os},enumerable:!1,configurable:!0}),e}(),Gs=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.")},Vs=function(){function e(e){if(!js(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 Ms))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||!js(e.coordinates))return!1;try{for(var i=Gs(e.coordinates),a=i.next();!a.done;a=i.next()){var s=a.value;try{for(var c=(r=void 0,Gs(s)),u=c.next();!u.done;u=c.next()){var l=u.value;if(!Us(l[0])||!Us(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 As},enumerable:!1,configurable:!0}),e}(),Hs=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.")},zs=function(){function e(e){var t,n;if(!js(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=Hs(e),o=r.next();!o.done;o=r.next()){var i=o.value;if(!(i instanceof Bs))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||!js(e.coordinates))return!1;try{for(var s=Hs(e.coordinates),c=s.next();!c.done;c=s.next()){var u=c.value;try{for(var l=(r=void 0,Hs(u)),p=l.next();!p.done;p=l.next()){var d=p.value;try{for(var f=(i=void 0,Hs(d)),h=f.next();!h.done;h=f.next()){var m=h.value;if(!Us(m[0])||!Us(m[1]))return!1}}catch(e){i={error:e}}finally{try{h&&!h.done&&(a=f.return)&&a.call(f)}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 Ts},enumerable:!1,configurable:!0}),e}(),Ks=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},Js=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 os:o=new vc(i.coordinates[0],i.coordinates[1]);break;case is:o=new Ms(i.coordinates.map(function(e){return new vc(e[0],e[1])}));break;case as:o=new Bs(i.coordinates.map(function(e){return new Ms(e.map(function(e){var t=Ks(e,2),n=t[0],r=t[1];return new vc(n,r)}))}));break;case ss:o=new Ws(i.coordinates.map(function(e){return new vc(e[0],e[1])}));break;case cs:o=new Vs(i.coordinates.map(function(e){return new Ms(e.map(function(e){var t=Ks(e,2),n=t[0],r=t[1];return new vc(n,r)}))}));break;case us:o=new zs(i.coordinates.map(function(e){return new Bs(e.map(function(e){return new Ms(e.map(function(e){var t=Ks(e,2),n=t[0],r=t[1];return new vc(n,r)}))}))}));break;case ls:o=i;break;case rs:case"Array":o=e.formatField(i);break;case ps: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);return t===ls?ls:(t===rs&&(e.$date?t=ps:vc.validate(e)?t=os:Ms.validate(e)?t=is:Bs.validate(e)?t=as:Ws.validate(e)?t=ss:Vs.validate(e)?t=cs:zs.validate(e)&&(t=us)),t)},e.generateDocId=function(){for(var e="",t=0;t<24;t++)e+="ABCDEFabcdef0123456789".charAt(Math.floor(22*Math.random()));return e},e}(),Ys={code:"INVALID_PARAM",message:"Invalid request param"},$s="DATABASE_TRANSACTION_CONFLICT",Xs={code:"DATABASE_REQUEST_FAILED",message:"database request failed"};const Qs=(e=>{var t={};return __webpack_require__.d(t,e),t})({EJSON:()=>__WEBPACK_EXTERNAL_MODULE_bson__.EJSON});var Zs=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)}}(),ec=function(){return ec=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},ec.apply(this,arguments)};function tc(e,t){if("function"!=typeof t)return e;e.then(function(e){return t(0,e)},function(e){return t(e)})}var nc={};function rc(e){if(!gu.wsClientClass)throw new Error("to use realtime you must import realtime module first");var t=e.config.env;return nc[t]||(nc[t]=new gu.wsClientClass({context:{appConfig:{docSizeLimit:1e3,realtimePingInterval:1e4,realtimePongWaitTimeout:5e3,request:gu.createRequest(e.config)}}})),nc[t]}var oc=function(e){return void 0!==e.timeout?{timeout:e.timeout}:{}},ic=function(e){if(!ks(e))return e;for(var t in e)void 0===e[t]?delete e[t]:ks(e[t])&&(e[t]=ic(e[t]));return e},ac=function(e){return e=ic(e),Qs.EJSON.stringify(e,{relaxed:!1})},sc=function(e){var t,n;if(e instanceof Date)return{$date:+e};if(e instanceof RegExp)return{$regex:e.source,$options:e.flags};if(e&&"object"==typeof e){if("ObjectId"===e._bsontype)return{$oid:e.toHexString()};if("BSONRegExp"===e._bsontype)return{$regex:e.pattern,$options:e.options};if(Array.isArray(e))return e.map(sc);var r={};try{for(var o=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.")}(Object.keys(e)),i=o.next();!i.done;i=o.next()){var a=i.value;r[a]=sc(e[a])}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}return e},cc=function(e){if(!e)return"{}";try{var t=Qs.EJSON.parse(e);return JSON.stringify(sc(t))}catch(t){return e}},uc=function(e){function t(t){var n=e.call(this,t.message)||this;return n.code=t.code,n.message=t.message,n}return Zs(t,e),t}(Error),lc=function(e){return new uc(e)};function pc(e,t){if(!1===e)return t;throw lc(ec({},t))}var dc,fc=function(){return fc=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},fc.apply(this,arguments)},hc=["limit","offset","projection","order","multiple","timeout","raw"],mc=function(){function e(){}return e.isGeopoint=function(e,t){if("Number"!==Js.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+Xa.IntergerError);return!0},e.mustBeBoolean=function(e,t){if("boolean"!=typeof t)throw new Error(e+Xa.BooleanError);return!0},e.isProjection=function(e,t){if("object"!==Ns(t))throw lc(fc(fc({},Ys),{message:"".concat(e," projection must be an object")}));for(var n in t){var r=t[n];if("number"===Ns(r)){if(0!==r&&1!==r)throw lc(fc(fc({},Ys),{message:"if the value in projection is of number, it must be 0 or 1"}))}else if("object"!==Ns(r))throw lc(fc(fc({},Ys),{message:"invalid projection"}))}return!0},e.isOrder=function(e,t){if("object"!==Ns(t))throw lc(fc(fc({},Ys),{message:"".concat(e," order must be an object")}));for(var n in t){var r=t[n];if(1!==r&&-1!==r)throw lc(fc(fc({},Ys),{message:"order value must be 1 or -1"}))}return!0},e.isFieldOrder=function(e){if(-1===ds.indexOf(e))throw new Error(Xa.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===fs.indexOf(e))throw new Error(Xa.OpStrError);return!0},e.isCollName=function(e){if(!/^[a-zA-Z0-9]([a-zA-Z0-9-_]){1,32}$/.test(e))throw new Error(Xa.CollNameError);return!0},e.isDocID=function(e){if(!/^([a-fA-F0-9]){24}$/.test(e))throw new Error(Xa.DocIDError);return!0},e.isValidOptions=function(t){if(void 0===t&&(t={}),"object"!==Ns(t))throw lc(fc(fc({},Ys),{message:"options must be an object"}));var n=Object.keys(t);for(var r in n)if(hc.indexOf(n[r])<0)throw lc(fc(fc({},Ys),{message:"".concat(n[r]," is invalid options key")}));var o=t,i=o.limit,a=o.offset,s=o.projection,c=o.order,u=t.multiple;return void 0!==i&&e.isInteger("limit",i),void 0!==a&&e.isInteger("offset",a),void 0!==s&&e.isProjection("projection",s),void 0!==c&&e.isOrder("order",c),void 0!==u&&e.mustBeBoolean("multiple",u),void 0!==t.timeout&&e.isInteger("timeout",t.timeout),!0},e.isValidAggregation=function(e){if(1!==Object.keys(e).length)throw lc(fc(fc({},Ys),{message:"aggregation stage must have one key"}));return!0},e.isCentersPhere=function(t){if(Array.isArray(t)&&2===t.length){if("object"===Ns(t[0])&&t[0]._internalType===Es&&"number"==typeof t[1])return!0;if(Array.isArray(t[0])&&2===t[0].length){var n=t[0][0],r=t[0][1];if(e.isGeopoint("longitude",n),e.isGeopoint("latitude",r),"number"==typeof t[1])return!0}}throw new Error("".concat(Xa.CentersPhereError))},e}(),vc=function(){function e(e,t){mc.isGeopoint("longitude",e),mc.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&&js(e.coordinates)&&mc.isGeopoint("longitude",e.coordinates[0])&&mc.isGeopoint("latitude",e.coordinates[1])},Object.defineProperty(e.prototype,"_internalType",{get:function(){return Es},enumerable:!1,configurable:!0}),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"}(dc||(dc={}));var yc,gc=function(){function e(e,t,n){this._internalType=ws,Object.defineProperties(this,{_internalType:{enumerable:!1,configurable:!1}}),this.operator=e,this.operands=t,this.fieldName=n||bs}return e.prototype._setFieldName=function(t){return new e(this.operator,this.operands,t)},e}();function bc(e){return e&&e instanceof gc&&e._internalType===ws}!function(e){e.AND="and",e.OR="or",e.NOT="not",e.NOR="nor"}(yc||(yc={}));var wc=function(){function e(e,t,n){if(this._internalType=_s,Object.defineProperties(this,{_internalType:{enumerable:!1,configurable:!1}}),this.operator=e,this.operands=t,this.fieldName=n||bs,this.fieldName!==bs)if(Array.isArray(t)){t=t.slice(),this.operands=t;for(var r=0,o=t.length;r<o;r++)(xc(i=t[r])||Sc(i))&&(t[r]=i._setFieldName(this.fieldName))}else{var i;(xc(i=t)||Sc(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(yc.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(yc.OR,r,this.fieldName)},e}();function xc(e){return e&&e instanceof wc&&e._internalType===_s}var _c,Ec=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"}(_c||(_c={}));var Ic=function(e){function t(t,n,r){var o=e.call(this,t,n,r)||this;return o.operator=t,o._internalType=xs,o}return Ec(t,e),t.prototype.toJSON=function(){var e,t,n;switch(this.operator){case _c.IN:case _c.NIN:return(e={})["$"+this.operator]=this.operands,e;case _c.NEQ:return(t={}).$ne=this.operands[0],t;default:return(n={})["$"+this.operator]=this.operands[0],n}},t.prototype._setFieldName=function(e){return new t(this.operator,this.operands,e)},t.prototype.eq=function(e){var n=new t(_c.EQ,[e],this.fieldName);return this.and(n)},t.prototype.neq=function(e){var n=new t(_c.NEQ,[e],this.fieldName);return this.and(n)},t.prototype.gt=function(e){var n=new t(_c.GT,[e],this.fieldName);return this.and(n)},t.prototype.gte=function(e){var n=new t(_c.GTE,[e],this.fieldName);return this.and(n)},t.prototype.lt=function(e){var n=new t(_c.LT,[e],this.fieldName);return this.and(n)},t.prototype.lte=function(e){var n=new t(_c.LTE,[e],this.fieldName);return this.and(n)},t.prototype.in=function(e){var n=new t(_c.IN,e,this.fieldName);return this.and(n)},t.prototype.nin=function(e){var n=new t(_c.NIN,e,this.fieldName);return this.and(n)},t.prototype.geoNear=function(e){if(!(e.geometry instanceof vc))throw new TypeError('"geometry" must be of type Point. Received type '.concat(typeof e.geometry));if(void 0!==e.maxDistance&&!Us(e.maxDistance))throw new TypeError('"maxDistance" must be of type Number. Received type '.concat(typeof e.maxDistance));if(void 0!==e.minDistance&&!Us(e.minDistance))throw new TypeError('"minDistance" must be of type Number. Received type '.concat(typeof e.minDistance));var n=new t(_c.GEO_NEAR,[e],this.fieldName);return this.and(n)},t.prototype.geoWithin=function(e){if(!(e.geometry instanceof zs||e.geometry instanceof Bs||mc.isCentersPhere(e.centerSphere)))throw new TypeError('"geometry" must be of type Polygon or MultiPolygon. Received type '.concat(typeof e.geometry));var n=new t(_c.GEO_WITHIN,[e],this.fieldName);return this.and(n)},t.prototype.geoIntersects=function(e){if(!(e.geometry instanceof vc||e.geometry instanceof Ms||e.geometry instanceof Bs||e.geometry instanceof Ws||e.geometry instanceof Vs||e.geometry instanceof zs))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(_c.GEO_INTERSECTS,[e],this.fieldName);return this.and(n)},t}(wc);function Sc(e){return e&&e instanceof Ic&&e._internalType===xs}function Oc(e){return Sc(e)}var Ac={};for(var Tc in _c)Ac[Tc]="$"+Tc;for(var Tc in yc)Ac[Tc]="$"+Tc;for(var Tc in dc)Ac[Tc]="$"+Tc;function Pc(e){return Ac[e]||"$"+e}Ac[_c.NEQ]="$ne",Ac[dc.REMOVE]="$unset",Ac[dc.SHIFT]="$pop",Ac[dc.UNSHIFT]="$push";var Rc=function(){return Rc=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},Rc.apply(this,arguments)},Cc=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},Nc=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 kc(e){return Uc(e,[e])}function Uc(e,t){if(!qs(e)){if(Ls(e))return e;if(Ds(e))return{$regularExpression:{pattern:e.source,options:e.flags}};if(js(e))return e.map(function(e){if(t.indexOf(e)>-1)throw new Error("Cannot convert circular structure to JSON");return Uc(e,Nc(Nc([],Cc(t),!1),[e],!1))});if(ks(e)){var n=Rc({},e),r={};for(var o in n){if(t.indexOf(n[o])>-1)throw new Error("Cannot convert circular structure to JSON");void 0!==n[o]&&(r[o]=Uc(n[o],Nc(Nc([],Cc(t),!1),[n[o]],!1)))}return r}return e}switch(e._internalType){case Es:return e.toJSON();case Ps:case Rs:case Cs:return e.parse();default:return e.toJSON?e.toJSON():e}}var jc=function(){return jc=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},jc.apply(this,arguments)},Lc=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},Dc=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 qc(e,t,n,r){var o=jc({},e);for(var i in e)if(!/^\$/.test(i)){var a=e[i];if(void 0!==a){if(a&&ks(a)&&!t(a)){if(r.indexOf(a)>-1)throw new Error("Cannot convert circular structure to JSON");var s=qc(a,t,Dc(Dc([],Lc(n),!1),[i],!1),Dc(Dc([],Lc(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]}}else delete o[i]}return o}function Mc(e){return qc(e,Bc,[],[e])}function Fc(e,t,n){for(var r in t[n]||delete e[n],t)e[r]?js(e[r])?e[r].push(t[r]):ks(e[r])?ks(t[r])?Object.assign(e[r],t[r]):(console.warn("unmergable condition, query is object but condition is ".concat(Ns(t),", can only overwrite"),t,n),e[r]=t[r]):(console.warn("to-merge query is of type ".concat(Ns(e),", can only overwrite"),e,t,n),e[r]=t[r]):e[r]=t[r]}function Bc(e){return qs(e)||Ls(e)||Ds(e)}function Wc(e){return kc(e)}var Gc=function(){function e(){}return e.encode=function(t){return(new e).encodeUpdate(t)},e.encodeEJSON=function(t,n){var r=new e;return ac(n?t:r.encodeUpdate(t))},e.prototype.encodeUpdate=function(e){return bc(e)?this.encodeUpdateCommand(e):"object"===Ns(e)?this.encodeUpdateObject(e):e},e.prototype.encodeUpdateCommand=function(e){if(e.fieldName===bs)throw new Error("Cannot encode a comparison command with unset field name");switch(e.operator){case dc.PUSH:case dc.PULL:case dc.PULL_ALL:case dc.POP:case dc.SHIFT:case dc.UNSHIFT:case dc.ADD_TO_SET:return this.encodeArrayUpdateCommand(e);default:return this.encodeFieldUpdateCommand(e)}},e.prototype.encodeFieldUpdateCommand=function(e){var t,n,r,o,i=Pc(e.operator);return e.operator===dc.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=Pc(e.operator);switch(e.operator){case dc.PUSH:var d=void 0;return d=js(e.operands)?{$each:e.operands.map(Wc)}:e.operands,(t={})[p]=((n={})[e.fieldName]=d,n),t;case dc.UNSHIFT:return d={$each:e.operands.map(Wc),$position:0},(r={})[p]=((o={})[e.fieldName]=d,o),r;case dc.POP:return(i={})[p]=((a={})[e.fieldName]=1,a),i;case dc.SHIFT:return(s={})[p]=((c={})[e.fieldName]=-1,c),s;default:return(u={})[p]=((l={})[e.fieldName]=Wc(e.operands),l),u}},e.prototype.encodeUpdateObject=function(e){var t=Mc(e);for(var n in t)if(!/^\$/.test(n)){var r=t[n];if(bc(r))t[n]=r._setFieldName(n),Fc(t,this.encodeUpdateCommand(t[n]),n);else{t[n]=r=Wc(r);var o=new gc(dc.SET,[r],n);Fc(t,this.encodeUpdateCommand(o),n)}}return t},e}(),Vc=function(){return Vc=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},Vc.apply(this,arguments)},Hc=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())})},zc=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])}}},Kc=function(){function e(e,t,n,r,o){var i=this;this.watch=function(e){return rc(i._db).watch(Vc(Vc({},e),{envId:i._db.config.env,collectionName:i._coll,query:JSON.stringify({_id:i.id})}))},this._db=e,this._coll=t,this.id=r,this._transactionId=o,this.request=gu.createRequest(this._db.config),this._apiOptions=n}return e.prototype.create=function(e,t){return tc(this._create(e),t)},e.prototype._create=function(e){return Hc(this,void 0,void 0,function(){var t,n,r;return zc(this,function(o){switch(o.label){case 0:return!(t=Array.isArray(e))&&this.id&&(e._id=this.id),n={collectionName:this._coll,data:t?e.map(function(e){return ac(kc(e))}):[ac(kc(e))],transactionId:this._transactionId},[4,this.request.send("database.insertDocument",n,oc(this._apiOptions))];case 1:return(r=o.sent()).code?[2,r]:this._transactionId?[2,{inserted:1,ok:1,id:r.data.insertedIds[0],requestId:r.requestId}]:t?[2,{ids:r.data&&r.data.insertedIds||[],requestId:r.requestId}]:[2,{id:r.data.insertedIds[0],requestId:r.requestId}]}})})},e.prototype.set=function(e,t){return tc(this._set(e),t)},e.prototype._set=function(e){return Hc(this,void 0,void 0,function(){var t,n,r,o;return zc(this,function(i){switch(i.label){case 0:return this.id?e&&"object"==typeof e?e.hasOwnProperty("_id")?[2,pc(this._db.config.throwOnCode,Vc(Vc({},Ys),{message:"不能更新_id的值"}))]:(t=!1,n=function(e){if("object"==typeof e)for(var r in e)e[r]instanceof gc?t=!0:"object"==typeof e[r]&&n(e[r])},n(e),t?[2,pc(this._db.config.throwOnCode,Vc(Vc({},Xs),{message:"update operator complicit"}))]:(r={collectionName:this._coll,queryType:ns.DOC,data:ac(kc(e)),transactionId:this._transactionId,multi:!1,merge:!1,upsert:!0},this.id&&(r.query=ac({_id:this.id})),[4,this.request.send("database.modifyDocument",r,oc(this._apiOptions))])):[2,pc(this._db.config.throwOnCode,Vc(Vc({},Ys),{message:"参数必需是非空对象"}))]:[2,pc(this._db.config.throwOnCode,Vc(Vc({},Ys),{message:"docId不能为空"}))];case 1:return(o=i.sent()).code?[2,o]:this._transactionId?[2,{updated:o.data.updated,upserted:[{_id:o.data.upsert_id}],requestId:o.requestId}]:[2,{updated:o.data.updated,upsertedId:o.data.upsert_id,requestId:o.requestId}]}})})},e.prototype.update=function(e,t){return tc(this._update(e),t)},e.prototype._update=function(e){return Hc(this,void 0,void 0,function(){var t,n,r;return zc(this,function(o){switch(o.label){case 0:return e&&"object"==typeof e?e.hasOwnProperty("_id")?[2,pc(this._db.config.throwOnCode,Vc(Vc({},Ys),{message:"不能更新_id的值"}))]:(t=ac({_id:this.id}),n={collectionName:this._coll,transactionId:this._transactionId,data:Gc.encodeEJSON(e,this._apiOptions.raw||!1),query:t,queryType:ns.DOC,multi:!1,merge:!0,upsert:!1},[4,this.request.send("database.modifyDocument",n,oc(this._apiOptions))]):[2,pc(this._db.config.throwOnCode,Vc(Vc({},Ys),{message:"参数必需是非空对象"}))];case 1:return(r=o.sent()).code?[2,r]:[2,{updated:r.data.updated,requestId:r.requestId}]}})})},e.prototype.delete=function(e){return this.remove(e)},e.prototype.remove=function(e){return tc(this._remove(),e)},e.prototype._remove=function(){return Hc(this,void 0,void 0,function(){var e,t,n;return zc(this,function(r){switch(r.label){case 0:return e=ac({_id:this.id}),t={collectionName:this._coll,transactionId:this._transactionId,query:e,queryType:ns.DOC,multi:!1},[4,this.request.send("database.removeDocument",t,oc(this._apiOptions))];case 1:return(n=r.sent()).code?[2,n]:[2,{deleted:n.data.deleted,requestId:n.requestId}]}})})},e.prototype.get=function(e){return tc(this._get(),e)},e.prototype._get=function(){return Hc(this,void 0,void 0,function(){var e,t,n,r,o,i;return zc(this,function(a){switch(a.label){case 0:return e=ac({_id:this.id}),t=this._apiOptions.projection,n={collectionName:this._coll,query:e,transactionId:this._transactionId,queryType:ns.DOC,multi:!1},t&&(n.projection=ac(t)),[4,this.request.send("database.getDocument",n,oc(this._apiOptions))];case 1:return(r=a.sent()).code?[2,r]:(o=r.data.list.map(function(e){return Qs.EJSON.parse(e)}),i=Js.formatResDocumentData(o),this._transactionId?[2,{data:i[0]||null,requestId:r.requestId}]:[2,{data:i,requestId:r.requestId}])}})})},e.prototype.field=function(t){var n={};for(var r in t)"boolean"==typeof t[r]&&(n[r]=!0===t[r]?1:0),"number"==typeof t[r]&&(n[r]=t[r]>0?1:0),"object"==typeof t[r]&&(n[r]=t[r]);var o=Vc({},this._apiOptions);return o.projection=n,new e(this._db,this._coll,o,this.id,this._transactionId)},e}(),Jc=function(){function e(){}return e.encode=function(e){return(new Yc).encodeQuery(e)},e.encodeEJSON=function(e,t){var n=new Yc;return ac(t?e:n.encodeQuery(e))},e}(),Yc=function(){function e(){}return e.prototype.encodeQuery=function(e,t){var n,r,o;return Bc(e)?xc(e)?this.encodeLogicCommand(e):Sc(e)?this.encodeQueryCommand(e):Ds(e)?((n={})[t]=this.encodeRegExp(e),n):Ls(e)?((r={})[t]=Wc(e),r):((o={})[t]=this.encodeQueryObject(e),o):ks(e)?this.encodeQueryObject(e):e},e.prototype.encodeRegExp=function(e){return{$regularExpression:{pattern:e.source,options:e.flags}}},e.prototype.encodeLogicCommand=function(e){var t,n,r,o,i,a,s,c=this;switch(e.operator){case yc.NOR:case yc.AND:case yc.OR:var u=Pc(e.operator),l=e.operands.map(function(t){return c.encodeQuery(t,e.fieldName)});return(t={})[u]=l,t;case yc.NOT:u=Pc(e.operator);var p=e.operands[0];return Ds(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=Pc(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 Oc(e),this.encodeComparisonCommand(e)},e.prototype.encodeComparisonCommand=function(e){var t,n,r,o,i,a,s,c,u,l,p;if(e.fieldName===bs)throw new Error("Cannot encode a comparison command with unset field name");var d=Pc(e.operator);switch(e.operator){case _c.EQ:case _c.NEQ:case _c.LT:case _c.LTE:case _c.GT:case _c.GTE:case _c.ELEM_MATCH:case _c.EXISTS:case _c.SIZE:case _c.MOD:return(t={})[e.fieldName]=((n={})[d]=Wc(e.operands[0]),n),t;case _c.IN:case _c.NIN:case _c.ALL:return(r={})[e.fieldName]=((o={})[d]=Wc(e.operands),o),r;case _c.GEO_NEAR:var f=e.operands[0];return(i={})[e.fieldName]={$nearSphere:{$geometry:f.geometry.toJSON(),$maxDistance:f.maxDistance,$minDistance:f.minDistance}},i;case _c.GEO_WITHIN:if((f=e.operands[0]).centerSphere){mc.isCentersPhere(f.centerSphere);var h=f.centerSphere;return h[0]._internalType===Es?((a={})[e.fieldName]={$geoWithin:{$centerSphere:[h[0].toJSON().coordinates,h[1]]}},a):((s={})[e.fieldName]={$geoWithin:{$centerSphere:f.centerSphere}},s)}return(c={})[e.fieldName]={$geoWithin:{$geometry:f.geometry.toJSON()}},c;case _c.GEO_INTERSECTS:return f=e.operands[0],(u={})[e.fieldName]={$geoIntersects:{$geometry:f.geometry.toJSON()}},u;default:return(l={})[e.fieldName]=((p={})[d]=Wc(e.operands[0]),p),l}},e.prototype.encodeQueryObject=function(e){var t=Mc(e);for(var n in t){var r=t[n];if(xc(r)){t[n]=r._setFieldName(n);var o=this.encodeLogicCommand(t[n]);this.mergeConditionAfterEncode(t,o,n)}else Oc(r)?(t[n]=r._setFieldName(n),o=this.encodeComparisonCommand(t[n]),this.mergeConditionAfterEncode(t,o,n)):Bc(r)&&(t[n]=Wc(r))}return t},e.prototype.mergeConditionAfterEncode=function(e,t,n){for(var r in t[n]||delete e[n],t)e[r]?js(e[r])?e[r]=e[r].concat(t[r]):ks(e[r])?ks(t[r])?Object.assign(e,t):(console.warn("unmergable condition, query is object but condition is ".concat(Ns(t),", can only overwrite"),t,n),e[r]=t[r]):(console.warn("to-merge query is of type ".concat(Ns(e),", can only overwrite"),e,t,n),e[r]=t[r]):e[r]=t[r]},e}(),$c=function(){return $c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},$c.apply(this,arguments)},Xc=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())})},Qc=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])}}},Zc=function(){function e(e,t,n,r,o){var i=this;this.watch=function(e){var t=rc(i._db),n=i._apiOptions,r=n.limit,o=n.order,a=o?Object.entries(o).reduce(function(e,t){var n=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}(t,2),r=n[0],o=n[1];return e[r]=-1===o?"desc":"asc",e},{}):void 0;return t.watch($c($c({},e),{envId:i._db.config.env,collectionName:i._coll,query:cc(i._fieldFilters),limit:r,orderBy:a}))},this._db=e,this._coll=t,this._fieldFilters=n,this._apiOptions=r||{},this._request=gu.createRequest(this._db.config),this._transactionId=o}return e.prototype.get=function(e){return tc(this._get(),e)},e.prototype._get=function(){return Xc(this,void 0,void 0,function(){var e,t,n,r,o,i,a,s,c;return Qc(this,function(u){switch(u.label){case 0:return e=this._apiOptions.order,t={collectionName:this._coll,queryType:ns.WHERE,transactionId:this._transactionId},this._fieldFilters&&(t.query=this._fieldFilters),e&&(t.order=ac(e)),(n=this._apiOptions.offset)&&(t.offset=n),r=this._apiOptions.limit,t.limit=r?r<1e3?r:1e3:100,(o=this._apiOptions.projection)&&(t.projection=ac(o)),[4,this._request.send("database.getDocument",t,oc(this._apiOptions))];case 1:return(i=u.sent()).code?[2,i]:(a=i.data.list.map(function(e){return Qs.EJSON.parse(e)}),s=Js.formatResDocumentData(a),c={data:s,requestId:i.requestId},i.total&&(c.total=i.total),i.limit&&(c.limit=i.limit),i.offset&&(c.offset=i.offset),[2,c])}})})},e.prototype.count=function(e){return tc(this._count(),e)},e.prototype._count=function(){return Xc(this,void 0,void 0,function(){var e,t;return Qc(this,function(n){switch(n.label){case 0:return e={collectionName:this._coll,queryType:ns.WHERE},this._fieldFilters&&(e.query=this._fieldFilters),[4,this._request.send("database.calculateDocument",e,oc(this._apiOptions))];case 1:return(t=n.sent()).code?[2,t]:[2,{requestId:t.requestId,total:t.data.total}]}})})},e.prototype.where=function(t){if("Object"!==Object.prototype.toString.call(t).slice(8,-1))throw Error(Xa.QueryParamTypeError);var n=Object.keys(t),r=n.some(function(e){return void 0!==t[e]});if(n.length&&!r)throw Error(Xa.QueryParamValueError);return new e(this._db,this._coll,Jc.encodeEJSON(t,this._apiOptions.raw||!1),this._apiOptions,this._transactionId)},e.prototype.options=function(t){return mc.isValidOptions(t),new e(this._db,this._coll,this._fieldFilters,t,this._transactionId)},e.prototype.orderBy=function(t,n){var r;mc.isFieldPath(t),mc.isFieldOrder(n);var o=((r={})[t]="desc"===n?-1:1,r),i=this._apiOptions.order||{},a=Object.assign({},this._apiOptions,{order:Object.assign({},i,o)});return new e(this._db,this._coll,this._fieldFilters,a,this._transactionId)},e.prototype.limit=function(t){mc.isInteger("limit",t);var n=$c({},this._apiOptions);return n.limit=t,new e(this._db,this._coll,this._fieldFilters,n,this._transactionId)},e.prototype.skip=function(t){mc.isInteger("offset",t);var n=$c({},this._apiOptions);return n.offset=t,new e(this._db,this._coll,this._fieldFilters,n,this._transactionId)},e.prototype.update=function(e,t){return tc(this._update(e),t)},e.prototype._update=function(e){return Xc(this,void 0,void 0,function(){var t,n,r,o;return Qc(this,function(i){switch(i.label){case 0:return e&&"object"==typeof e?e.hasOwnProperty("_id")?[2,pc(this._db.config.throwOnCode,$c($c({},Ys),{message:"不能更新_id的值"}))]:(t=this._apiOptions.multiple,n=void 0===t||t,r={collectionName:this._coll,queryType:ns.WHERE,multi:n,merge:!0,upsert:!1,data:Gc.encodeEJSON(e,this._apiOptions.raw||!1)},this._transactionId&&(r.transactionId=this._transactionId),this._fieldFilters&&(r.query=this._fieldFilters),[4,this._request.send("database.modifyDocument",r,oc(this._apiOptions))]):[2,pc(this._db.config.throwOnCode,$c($c({},Ys),{message:"参数必需是非空对象"}))];case 1:return(o=i.sent()).code?[2,o]:[2,{requestId:o.requestId,updated:o.data.updated,upsertId:o.data.upsert_id}]}})})},e.prototype.field=function(t){var n={};for(var r in t)"boolean"==typeof t[r]&&(n[r]=!0===t[r]?1:0),"number"==typeof t[r]&&(n[r]=t[r]>0?1:0),"object"==typeof t[r]&&(n[r]=t[r]);var o=$c({},this._apiOptions);return o.projection=n,new e(this._db,this._coll,this._fieldFilters,o,this._transactionId)},e.prototype.remove=function(e){return tc(this._remove(),e)},e.prototype._remove=function(){return Xc(this,void 0,void 0,function(){var e,t,n,r,o,i,a,s,c;return Qc(this,function(u){switch(u.label){case 0:return e=this._apiOptions,t=e.offset,n=e.limit,r=e.projection,o=e.order,void 0===t&&void 0===n&&void 0===r&&void 0===o||console.warn("`offset`, `limit`, `projection`, `orderBy` are not supported in remove() operation"),i=this._apiOptions.multiple,a=void 0===i||i,s={collectionName:this._coll,query:this._fieldFilters,queryType:ns.WHERE,multi:a},this._transactionId&&(s.transactionId=this._transactionId),[4,this._request.send("database.removeDocument",s,oc(this._apiOptions))];case 1:return(c=u.sent()).code?[2,c]:[2,{requestId:c.requestId,deleted:c.data.deleted}]}})})},e.prototype.updateAndReturn=function(e){return Xc(this,void 0,void 0,function(){var t,n;return Qc(this,function(r){switch(r.label){case 0:return e&&"object"==typeof e?e.hasOwnProperty("_id")?[2,pc(this._db.config.throwOnCode,$c($c({},Ys),{message:"不能更新_id的值"}))]:(t={collectionName:this._coll,queryType:ns.WHERE,data:Gc.encodeEJSON(e,!1)},this._transactionId&&(t.transactionId=this._transactionId),this._fieldFilters&&(t.query=this._fieldFilters),[4,this._request.send("database.modifyAndReturnDoc",t,oc(this._apiOptions))]):[2,pc(this._db.config.throwOnCode,$c($c({},Ys),{message:"参数必需是非空对象"}))];case 1:return(n=r.sent()).code?[2,n]:[2,{requestId:n.requestId,updated:n.data.updated,doc:n.data.doc&&Qs.EJSON.parse(n.data.doc)}]}})})},e}(),eu=function(){function e(e,t,n){var r=this;this._stages=[],e&&t&&(this._db=e,this._request=gu.createRequest(this._db.config),this._collectionName=t,n&&n.length>0&&n.forEach(function(e){mc.isValidAggregation(e);var t=Object.keys(e)[0];r._pipe(t,e[t],!0)}))}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.aggregateDocuments",{collectionName:this._collectionName,stages:this._stages})];case 1:return(e=t.sent())&&e.data&&e.data.list?[2,{requestId:e.requestId,data:e.data.list.map(Qs.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,n){void 0===n&&(n=!1);var r;return r="object"===Ns(t)?ac(t):JSON.stringify(t),this._stages.push({stageKey:n?e:"$".concat(e),stageValue:r}),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=Jc.encode(e.query)),e.distanceMultiplier&&"number"==typeof e.distanceMultiplier&&(e.distanceMultiplier=e.distanceMultiplier),e.near&&(e.near=new vc(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",Jc.encode(e))},e.prototype.project=function(e){return this._pipe("project",e)},e.prototype.lookup=function(e){return this._pipe("lookup",e)},e.prototype.replaceRoot=function(e){return this._pipe("replaceRoot",e)},e.prototype.sample=function(e){return this._pipe("sample",e)},e.prototype.skip=function(e){return this._pipe("skip",e)},e.prototype.sort=function(e){return this._pipe("sort",e)},e.prototype.sortByCount=function(e){return this._pipe("sortByCount",e)},e.prototype.unwind=function(e){return this._pipe("unwind",e)},e}();const tu=eu;var nu=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)}}(),ru=function(e){function t(t,n,r,o){var i=e.call(this,t,n,"",r,o)||this;return o&&(i._transactionId=o),i}return nu(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 Kc(this._db,this._coll,this._apiOptions,e,this._transactionId)},t.prototype.add=function(e,t){return tc(this._add(e),t)},t.prototype._add=function(e){return t=this,n=void 0,o=function(){var t,n,r;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(o){switch(o.label){case 0:return t=e,js(e)||(t=[e]),t=t.map(function(e){return ac(kc(e))}),n={collectionName:this._coll,data:t},this._transactionId&&(n.transactionId=this._transactionId),[4,this._request.send("database.insertDocument",n,oc(this._apiOptions))];case 1:return(r=o.sent()).code?[2,r]:js(e)?[2,{ids:r.data.insertedIds,requestId:r.requestId}]:this._transactionId?[2,{inserted:1,ok:1,id:r.data.insertedIds[0],requestId:r.requestId}]:[2,{id:r.data.insertedIds[0],requestId:r.requestId}]}})},new((r=void 0)||(r=Promise))(function(e,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r(function(e){e(n)})).then(a,s)}c((o=o.apply(t,n||[])).next())});var t,n,r,o},t.prototype.aggregate=function(e){return void 0===e&&(e=[]),new tu(this._db,this._coll,this._apiOptions.raw?e:[])},t.prototype.options=function(e){return mc.isValidOptions(e),new t(this._db,this._coll,e,this._transactionId)},t}(Zc),ou={eq:function(e){return new Ic(_c.EQ,[e])},neq:function(e){return new Ic(_c.NEQ,[e])},lt:function(e){return new Ic(_c.LT,[e])},lte:function(e){return new Ic(_c.LTE,[e])},gt:function(e){return new Ic(_c.GT,[e])},gte:function(e){return new Ic(_c.GTE,[e])},in:function(e){return new Ic(_c.IN,e)},nin:function(e){return new Ic(_c.NIN,e)},all:function(e){return new Ic(_c.ALL,e)},elemMatch:function(e){return new Ic(_c.ELEM_MATCH,[e])},exists:function(e){return new Ic(_c.EXISTS,[e])},size:function(e){return new Ic(_c.SIZE,[e])},mod:function(){return new Ic(_c.MOD,1==arguments.length?[arguments[0]]:2==arguments.length?[[arguments[0],arguments[1]]]:arguments)},geoNear:function(e){return new Ic(_c.GEO_NEAR,[e])},geoWithin:function(e){return new Ic(_c.GEO_WITHIN,[e])},geoIntersects:function(e){return new Ic(_c.GEO_INTERSECTS,[e])},and:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=js(arguments[0])?arguments[0]:Array.from(arguments);return new wc(yc.AND,n)},nor:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=js(arguments[0])?arguments[0]:Array.from(arguments);return new wc(yc.NOR,n)},or:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=js(arguments[0])?arguments[0]:Array.from(arguments);return new wc(yc.OR,n)},not:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=js(arguments[0])?arguments[0]:Array.from(arguments);return new wc(yc.NOT,n)},set:function(e){return new gc(dc.SET,[e])},remove:function(){return new gc(dc.REMOVE,[])},inc:function(e){return new gc(dc.INC,[e])},mul:function(e){return new gc(dc.MUL,[e])},push:function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(ks(t[0])&&t[0].hasOwnProperty("each")){e={};var r=t[0];void 0!==r.each&&(e.$each=r.each),void 0!==r.position&&(e.$position=r.position),void 0!==r.sort&&(e.$sort=r.sort),void 0!==r.slice&&(e.$slice=r.slice)}else e=js(t[0])?t[0]:Array.from(t);return new gc(dc.PUSH,e)},pull:function(e){return new gc(dc.PULL,e)},pullAll:function(e){return new gc(dc.PULL_ALL,e)},pop:function(){return new gc(dc.POP,[])},shift:function(){return new gc(dc.SHIFT,[])},unshift:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=js(arguments[0])?arguments[0]:Array.from(arguments);return new gc(dc.UNSHIFT,n)},addToSet:function(e){return new gc(dc.ADD_TO_SET,e)},rename:function(e){return new gc(dc.RENAME,[e])},bit:function(e){return new gc(dc.BIT,[e])},max:function(e){return new gc(dc.MAX,[e])},min:function(e){return new gc(dc.MIN,[e])},expr:function(e){return{$expr:e}},jsonSchema:function(e){return{$jsonSchema:e}},text:function(e){return function(e){return"string"===Ns(e)}(e)?{$search:e.search}:{$search:e.search,$language:e.language,$caseSensitive:e.caseSensitive,$diacriticSensitive:e.diacriticSensitive}},aggregate:{pipeline:function(){return new tu},abs:function(e){return new iu("abs",e)},add:function(e){return new iu("add",e)},ceil:function(e){return new iu("ceil",e)},divide:function(e){return new iu("divide",e)},exp:function(e){return new iu("exp",e)},floor:function(e){return new iu("floor",e)},ln:function(e){return new iu("ln",e)},log:function(e){return new iu("log",e)},log10:function(e){return new iu("log10",e)},mod:function(e){return new iu("mod",e)},multiply:function(e){return new iu("multiply",e)},pow:function(e){return new iu("pow",e)},sqrt:function(e){return new iu("sqrt",e)},subtract:function(e){return new iu("subtract",e)},trunc:function(e){return new iu("trunc",e)},arrayElemAt:function(e){return new iu("arrayElemAt",e)},arrayToObject:function(e){return new iu("arrayToObject",e)},concatArrays:function(e){return new iu("concatArrays",e)},filter:function(e){return new iu("filter",e)},in:function(e){return new iu("in",e)},indexOfArray:function(e){return new iu("indexOfArray",e)},isArray:function(e){return new iu("isArray",e)},map:function(e){return new iu("map",e)},range:function(e){return new iu("range",e)},reduce:function(e){return new iu("reduce",e)},reverseArray:function(e){return new iu("reverseArray",e)},size:function(e){return new iu("size",e)},slice:function(e){return new iu("slice",e)},zip:function(e){return new iu("zip",e)},and:function(e){return new iu("and",e)},not:function(e){return new iu("not",e)},or:function(e){return new iu("or",e)},cmp:function(e){return new iu("cmp",e)},eq:function(e){return new iu("eq",e)},gt:function(e){return new iu("gt",e)},gte:function(e){return new iu("gte",e)},lt:function(e){return new iu("lt",e)},lte:function(e){return new iu("lte",e)},neq:function(e){return new iu("ne",e)},cond:function(e){return new iu("cond",e)},ifNull:function(e){return new iu("ifNull",e)},switch:function(e){return new iu("switch",e)},dateFromParts:function(e){return new iu("dateFromParts",e)},dateFromString:function(e){return new iu("dateFromString",e)},dayOfMonth:function(e){return new iu("dayOfMonth",e)},dayOfWeek:function(e){return new iu("dayOfWeek",e)},dayOfYear:function(e){return new iu("dayOfYear",e)},isoDayOfWeek:function(e){return new iu("isoDayOfWeek",e)},isoWeek:function(e){return new iu("isoWeek",e)},isoWeekYear:function(e){return new iu("isoWeekYear",e)},millisecond:function(e){return new iu("millisecond",e)},minute:function(e){return new iu("minute",e)},month:function(e){return new iu("month",e)},second:function(e){return new iu("second",e)},hour:function(e){return new iu("hour",e)},week:function(e){return new iu("week",e)},year:function(e){return new iu("year",e)},literal:function(e){return new iu("literal",e)},mergeObjects:function(e){return new iu("mergeObjects",e)},objectToArray:function(e){return new iu("objectToArray",e)},allElementsTrue:function(e){return new iu("allElementsTrue",e)},anyElementTrue:function(e){return new iu("anyElementTrue",e)},setDifference:function(e){return new iu("setDifference",e)},setEquals:function(e){return new iu("setEquals",e)},setIntersection:function(e){return new iu("setIntersection",e)},setIsSubset:function(e){return new iu("setIsSubset",e)},setUnion:function(e){return new iu("setUnion",e)},concat:function(e){return new iu("concat",e)},dateToString:function(e){return new iu("dateToString",e)},indexOfBytes:function(e){return new iu("indexOfBytes",e)},indexOfCP:function(e){return new iu("indexOfCP",e)},split:function(e){return new iu("split",e)},strLenBytes:function(e){return new iu("strLenBytes",e)},strLenCP:function(e){return new iu("strLenCP",e)},strcasecmp:function(e){return new iu("strcasecmp",e)},substr:function(e){return new iu("substr",e)},substrBytes:function(e){return new iu("substrBytes",e)},substrCP:function(e){return new iu("substrCP",e)},toLower:function(e){return new iu("toLower",e)},toUpper:function(e){return new iu("toUpper",e)},meta:function(e){return new iu("meta",e)},addToSet:function(e){return new iu("addToSet",e)},avg:function(e){return new iu("avg",e)},first:function(e){return new iu("first",e)},last:function(e){return new iu("last",e)},max:function(e){return new iu("max",e)},min:function(e){return new iu("min",e)},push:function(e){return new iu("push",e)},stdDevPop:function(e){return new iu("stdDevPop",e)},stdDevSamp:function(e){return new iu("stdDevSamp",e)},sum:function(e){return new iu("sum",e)},let:function(e){return new iu("let",e)}},project:{slice:function(e){return new au("slice",e)},elemMatch:function(e){return new au("elemMatch",e)}}},iu=function(e,t){this["$"+e]=t},au=function(e,t){this["$"+e]=t},su=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 Ps},enumerable:!1,configurable:!0}),e.prototype.parse=function(){return{$tcb_server_date:{offset:this.offset}}},e}();function cu(e){return new su(e)}var uu=function(){function e(e){var t=e.regexp,n=e.options;if(!t)throw new TypeError("regexp must be a string");this.$regularExpression={pattern:t||"",options:n||""}}return e.prototype.parse=function(){return{$regularExpression:{pattern:this.$regularExpression.pattern,options:this.$regularExpression.options}}},Object.defineProperty(e.prototype,"_internalType",{get:function(){return Rs},enumerable:!1,configurable:!0}),e}();function lu(e){return new uu(e)}var pu=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())})},du=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])}}},fu=function(){function e(e){this._db=e,this._request=gu.createRequest(this._db.config),this.aborted=!1,this.commited=!1,this.inited=!1}return e.prototype.init=function(){return pu(this,void 0,void 0,function(){var e;return du(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 ru(this._db,e,{},this._id)},e.prototype.getTransactionId=function(){return this._id},e.prototype.getRequestMethod=function(){return this._request},e.prototype.commit=function(){return pu(this,void 0,void 0,function(){var e,t;return du(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 pu(this,void 0,void 0,function(){var t,n;return du(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 hu(){return pu(this,void 0,void 0,function(){var e;return du(this,function(t){switch(t.label){case 0:return[4,(e=new fu(this)).init()];case 1:return t.sent(),[2,e]}})})}function mu(e,t){return void 0===t&&(t=3),pu(this,void 0,void 0,function(){var n,r,o,i,a=this;return du(this,function(s){switch(s.label){case 0:return s.trys.push([0,4,,10]),[4,(n=new fu(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 pu(a,void 0,void 0,function(){return du(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===$s?[4,mu.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 vu=function(){function e(e){var t=(void 0===e?{}:e).id,n=void 0===t?"":t;this.id=n}return Object.defineProperty(e.prototype,"_internalType",{get:function(){return Cs},enumerable:!1,configurable:!0}),e.prototype.parse=function(){return{$oid:this.id}},e}();function yu(e){return new vu(e)}var gu=function(){function e(e){this.config=e,this.Geo=n,this.serverDate=cu,this.command=ou,this.RegExp=lu,this.ObjectId=yu,this.startTransaction=hu,this.runTransaction=mu,this.logicCommand=wc,this.updateCommand=gc,this.queryCommand=Ic}return e.createRequest=function(t){var n=new e.reqClass(t),r=n.send;return n.send=function(e,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];return n&&(t.instance&&(n.instance=t.instance),t.database&&(n.database=t.database)),r.call.apply(r,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))}([this,e,n],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}(o),!1))},n},e.prototype.collection=function(e){if(!e)throw new Error("Collection name is required");return new ru(this,e)},e.prototype.createCollection=function(t){var n={collectionName:t};return e.createRequest(this.config).send("database.addCollection",n)},e}(),bu=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)}}(),wu=function(){return wu=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},wu.apply(this,arguments)},xu=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=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])}}},Eu={filterRes:function(e){return delete(e=r.P6.promoteGatewayError(e)).header,delete e.statusCode,e},flattenResData:function(e){if("object"==typeof e.data&&null!==e.data){var t=wu(wu({},e),e.data);return delete t.data,t}return e},safeParseEJSON:function(e){if("string"!=typeof e)return e;try{return Qs.EJSON.parse(e)}catch(t){return e}},parseEJSONParam:function(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}},parseEJSONValue:function(e){if("string"!=typeof e)return e;try{return Qs.EJSON.parse(e)}catch(t){return Eu.parseEJSONParam(e)}},normalizeOrderParam:function(e){if(null!=e&&""!==e){for(var t=Eu.parseEJSONValue(e),n=function(e){var t=e&&"object"==typeof e?Number(e):e;if("number"==typeof t&&!isNaN(t))return t<0?"desc":"asc";if("string"==typeof t){var n=t.toLowerCase();if("desc"===n||"-1"===n)return"desc";if("asc"===n||"1"===n)return"asc"}},r=[],o=0,i=Array.isArray(t)?t:[t];o<i.length;o++){var a=i[o];if(a&&"object"==typeof a)if(void 0!==a.field)(u=n(a.direction))&&r.push({field:a.field,direction:u});else for(var s=0,c=Object.entries(a);s<c.length;s++){var u,l=c[s],p=l[0];(u=n(l[1]))&&r.push({field:p,direction:u})}}return r.length?r:void 0}},extractDocId:function(e){if(e&&"object"==typeof e&&!Array.isArray(e)&&1===Object.keys(e).length&&"_id"in e){var t=e._id;if("string"==typeof t||"number"==typeof t)return String(t);if(t&&"object"==typeof t){if("string"==typeof t.$oid)return t.$oid;var n=t.$eq;if("string"==typeof n||"number"==typeof n)return String(n);if(n&&"object"==typeof n&&"string"==typeof n.$oid)return n.$oid}}},toLegacyRegExp:function(e){if(!e||"object"!=typeof e)return e;if(e.$regularExpression&&"object"==typeof e.$regularExpression){var t=e.$regularExpression;return{$regex:t.pattern,$options:t.options}}if(Array.isArray(e))return e.map(function(e){return Eu.toLegacyRegExp(e)});var n={};for(var r in e)n[r]=Eu.toLegacyRegExp(e[r]);return n},parseWriteParam:function(e){return Eu.toLegacyRegExp(Eu.parseEJSONParam(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,t){var n,r,o,i;return xu(this,void 0,Promise,function(){var a,s,c,u,l,p,d;return _u(this,function(f){switch(f.label){case 0:return a=Eu.parseEJSONParam(e.query),s=Eu.parseEJSONValue(e.projection),c=Eu.extractDocId(a),u=void 0!==c,l=Eu.buildQueryParams(wu({projection:s,transactionId:e.transactionId},u?{}:{offset:null!==(n=e.offset)&&void 0!==n?n:0,limit:null!==(r=e.limit)&&void 0!==r?r:100,order:Eu.normalizeOrderParam(e.order),query:a?Qs.EJSON.stringify(a,{relaxed:!1}):void 0})),p="".concat(Eu.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents?").concat(l),u&&(p="".concat(Eu.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents/").concat(c,"?").concat(l)),[4,this.gateWay({url:p,method:"GET"},t)];case 1:return(d=f.sent()).data=Eu.safeParseEJSON(JSON.stringify(d.data)),!u||d.code||(null===(o=d.data)||void 0===o?void 0:o.code)?(d.code||(null===(i=d.data)||void 0===i?void 0:i.code)?d=wu(wu({},d),{data:wu(wu({},d.data),{list:[]})}):Array.isArray(d.data)?d=wu(wu({},d),{data:{list:d.data}}):d.data&&!Array.isArray(d.data.list)&&(d=wu(wu({},d),{data:wu(wu({},d.data),{list:[]})})),[2,Eu.filterRes(d)]):[2,wu(wu({},d),{data:{list:[d.data]}})]}})})},"database.addDocument":function(e,t){var n,r,o;return xu(this,void 0,Promise,function(){var i,a;return _u(this,function(s){switch(s.label){case 0:return i=(Array.isArray(e.data)?e.data:[e.data]).map(function(e){return Eu.parseWriteParam(e)}),[4,this.gateWay({url:"".concat(Eu.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents"),method:"POST",data:wu({data:i},e.transactionId&&{transactionId:e.transactionId})},t)];case 1:return a=s.sent(),Array.isArray(e.data)?a=wu(wu({},a),{data:wu({ids:(null===(n=a.data)||void 0===n?void 0:n.insertedIds)||[]},a.data)}):(null===(o=null===(r=a.data)||void 0===r?void 0:r.insertedIds)||void 0===o?void 0:o[0])&&(a=wu(wu({},a),{data:wu({_id:a.data.insertedIds[0]},a.data)})),[2,Eu.filterRes(a)]}})})},"database.updateDocument":function(e,t){var n;return xu(this,void 0,Promise,function(){var r;return _u(this,function(o){switch(o.label){case 0:return[4,this.gateWay({url:"".concat(Eu.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents"),method:"PATCH",data:wu({query:Eu.parseEJSONParam(e.query),data:Eu.parseEJSONParam(e.data),multi:!!e.multi,upsert:!!e.upsert,replaceMode:null!==(n=e.replaceMode)&&void 0!==n?n:!1===e.merge},e.transactionId&&{transactionId:e.transactionId})},t)];case 1:return r=o.sent(),[2,Eu.filterRes(r)]}})})},"database.deleteDocument":function(e,t){return xu(this,void 0,Promise,function(){var n;return _u(this,function(r){switch(r.label){case 0:return[4,this.gateWay({url:"".concat(Eu.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents/remove"),method:"POST",data:wu({query:Eu.parseEJSONParam(e.query),multi:!!e.multi},e.transactionId&&{transactionId:e.transactionId})},t)];case 1:return n=r.sent(),[2,Eu.filterRes(n)]}})})},"database.countDocument":function(e,t){return xu(this,void 0,Promise,function(){var n,r,o;return _u(this,function(i){switch(i.label){case 0:return n=Eu.parseEJSONParam(e.query),r=Eu.buildQueryParams({count:!0,query:n?Qs.EJSON.stringify(n,{relaxed:!1}):void 0}),[4,this.gateWay({url:"".concat(Eu.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents?").concat(r),method:"GET"},t)];case 1:return o=i.sent(),[2,Eu.filterRes(o)]}})})},"database.addCollection":function(e,t){return xu(this,void 0,Promise,function(){var n;return _u(this,function(r){switch(r.label){case 0:return[4,this.gateWay({url:"".concat(Eu.getUrlPrefix(e),"/collections"),method:"POST",data:{collectionName:e.collectionName}},t)];case 1:return n=r.sent(),[2,Eu.filterRes(n)]}})})},"database.aggregate":function(e,t){var n;return xu(this,void 0,Promise,function(){var r,o;return _u(this,function(i){switch(i.label){case 0:return r=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]=Qs.EJSON.serialize(r),t}catch(t){return(n={})[e.stageKey]=e.stageValue,n}}),[4,this.gateWay({url:"".concat(Eu.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents/aggregations"),method:"POST",data:{pipeline:r}},t)];case 1:return o=i.sent(),Array.isArray(null===(n=o.data)||void 0===n?void 0:n.list)&&(o.data.list=JSON.stringify(o.data.list.map(function(e){return JSON.stringify(e)}))),[2,Eu.filterRes(o)]}})})},"database.startTransaction":function(e,t){return xu(this,void 0,void 0,function(){var n;return _u(this,function(r){switch(r.label){case 0:return[4,this.gateWay({url:"".concat(Eu.getUrlPrefix(e),"/transactions"),method:"POST"},t)];case 1:return n=r.sent(),[2,Eu.filterRes(Eu.flattenResData(n))]}})})},"database.commitTransaction":function(e,t){return xu(this,void 0,void 0,function(){var n;return _u(this,function(r){switch(r.label){case 0:return[4,this.gateWay({url:"".concat(Eu.getUrlPrefix(e),"/transactions/").concat(e.transactionId,"/commit"),method:"POST"},t)];case 1:return n=r.sent(),[2,Eu.filterRes(n)]}})})},"database.abortTransaction":function(e,t){return xu(this,void 0,void 0,function(){var n;return _u(this,function(r){switch(r.label){case 0:return[4,this.gateWay({url:"".concat(Eu.getUrlPrefix(e),"/transactions/").concat(e.transactionId,"/rollback"),method:"POST"},t)];case 1:return n=r.sent(),[2,Eu.filterRes(n)]}})})},"database.getInTransaction":function(e,t){var n;return xu(this,void 0,void 0,function(){var r;return _u(this,function(o){switch(o.label){case 0:return[4,Eu["database.queryDocument"].call(this,e,t)];case 1:return"object"==typeof(r=o.sent()).data&&null!==r.data?(null===(n=r.data)||void 0===n?void 0:n.code)?[2,Eu.flattenResData(r)]:[2,wu(wu({},r),{data:JSON.stringify(r.data)})]:[2,r]}})})},"database.updateDocInTransaction":function(e,t){return xu(this,void 0,void 0,function(){var n;return _u(this,function(r){switch(r.label){case 0:return[4,Eu["database.updateDocument"].call(this,e,t)];case 1:return n=r.sent(),[2,Eu.flattenResData(n)]}})})},"database.deleteDocInTransaction":function(e,t){return xu(this,void 0,void 0,function(){var n;return _u(this,function(r){switch(r.label){case 0:return[4,Eu["database.deleteDocument"].call(this,e,t)];case 1:return n=r.sent(),[2,Eu.flattenResData(n)]}})})},"database.insertDocInTransaction":function(e,t){var n;return xu(this,void 0,Promise,function(){var r,o;return _u(this,function(i){switch(i.label){case 0:return[4,Eu["database.addDocument"].call(this,e,t)];case 1:return"object"==typeof(r=i.sent()).data&&null!==r.data?(o=!!(null===(n=r.data)||void 0===n?void 0:n._id),r=wu(wu(wu({},r),{inserted:o?1:0,ok:o?1:0}),r.data)):r=wu({inserted:0,ok:0},r),delete r.data,[2,r]}})})},"database.runCommands":function(e,t){return xu(this,void 0,Promise,function(){var n;return _u(this,function(r){switch(r.label){case 0:return[4,this.gateWay({url:"".concat(Eu.getUrlPrefix(e),"/commands"),method:"POST",data:wu({commands:Qs.EJSON.serialize(Array.isArray(e.commands)?e.commands.map(function(e){return Eu.parseEJSONParam(e)}):e.commands)},e.transactionId&&{transactionId:e.transactionId})},t)];case 1:"object"==typeof(n=r.sent()).data&&null!==n.data&&(delete(n=wu(wu({},n),n.data)).data,delete n.request_id);try{n=Qs.EJSON.deserialize(n)}catch(e){}return[2,Eu.filterRes(n)]}})})},"database.getDocument":function(e,t){var n;return xu(this,void 0,Promise,function(){var r,o;return _u(this,function(i){switch(i.label){case 0:return(r=wu({},e)).query=Eu.parseEJSONParam(r.query),r.projection=Eu.parseEJSONValue(r.projection),[4,Eu["database.queryDocument"].call(this,r,t)];case 1:return o=i.sent(),Array.isArray(null===(n=o.data)||void 0===n?void 0:n.list)&&(o.data.list=o.data.list.map(function(e){return Qs.EJSON.stringify(e,{relaxed:!1})})),[2,o]}})})},"database.insertDocument":function(e,t){return xu(this,void 0,Promise,function(){var n;return _u(this,function(r){return(n=wu({},e)).data=Array.isArray(n.data)?n.data.map(function(e){return Eu.parseWriteParam(e)}):Eu.parseWriteParam(n.data),[2,Eu["database.addDocument"].call(this,n,t)]})})},"database.modifyDocument":function(e,t){return xu(this,void 0,Promise,function(){var n;return _u(this,function(r){return(n=wu({},e)).query=Eu.parseEJSONParam(n.query),n.data=Eu.parseEJSONParam(n.data),[2,Eu["database.updateDocument"].call(this,n,t)]})})},"database.modifyAndReturnDoc":function(e,t){var n,r;return xu(this,void 0,Promise,function(){var o,i,a;return _u(this,function(s){switch(s.label){case 0:return(o=wu({},e)).query=Eu.parseEJSONParam(o.query),o.data=Eu.parseEJSONParam(o.data),(i=Eu.extractDocId(o.query))?[4,this.gateWay({url:"".concat(Eu.getUrlPrefix(o),"/collections/").concat(o.collectionName,"/documents/").concat(i),method:"PATCH",data:wu({data:o.data,replaceMode:null!==(n=o.replaceMode)&&void 0!==n&&n,upsert:!!o.upsert,returnDoc:!0},o.transactionId&&{transactionId:o.transactionId})},t)]:[2,Eu["database.updateDocument"].call(this,o,t)];case 1:return a=s.sent(),void 0!==(null===(r=a.data)||void 0===r?void 0:r.doc)&&"string"!=typeof a.data.doc&&(a.data.doc=Qs.EJSON.stringify(a.data.doc,{relaxed:!1})),[2,Eu.filterRes(a)]}})})},"database.removeDocument":function(e,t){return xu(this,void 0,Promise,function(){var n;return _u(this,function(r){return(n=wu({},e)).query=Eu.parseEJSONParam(n.query),[2,Eu["database.deleteDocument"].call(this,n,t)]})})},"database.calculateDocument":function(e,t){return xu(this,void 0,Promise,function(){var n;return _u(this,function(r){return(n=wu({},e)).query=Eu.parseEJSONParam(n.query),[2,Eu["database.countDocument"].call(this,n,t)]})})},"database.aggregateDocuments":function(e,t){var n;return xu(this,void 0,Promise,function(){var r,o;return _u(this,function(i){switch(i.label){case 0:return r=wu({},e),Array.isArray(r.stages)&&(r.stages=r.stages.map(function(e){return wu(wu({},e),{stageValue:Eu.parseEJSONParam(e.stageValue)})})),[4,Eu["database.aggregate"].call(this,r,t)];case 1:if(o=i.sent(),"string"==typeof(null===(n=o.data)||void 0===n?void 0:n.list))try{o.data.list=JSON.parse(o.data.list)}catch(e){}return[2,o]}})})}},Iu={name:"database",entity:{database:function(e){var t;if(void 0!==e&&"Object"!==Object.prototype.toString.call(e).slice(8,-1))throw r.P6.createCloudbaseError({code:"INVALID_PARAM",msg:"dbConfig must be an object"},null===(t=this.config)||void 0===t?void 0:t.errorFactory);var n=this.platform,o=n.adapter,i=n.runtime,a=function(e){function t(t){return e.call(this,t)||this}return bu(t,e),t.prototype.send=function(t,n,o){var i,a,s,c;return xu(this,void 0,void 0,function(){var u,l,p;return _u(this,function(d){switch(d.label){case 0:return u=null,l=o&&"number"==typeof o.timeout?{timeout:o.timeout}:void 0,"GATEWAY"===this.config.endPointMode&&Eu[t]?[4,Eu[t].call(this,n,l)]:[3,2];case 1:return u=d.sent(),[3,4];case 2:return[4,e.prototype.send.call(this,t,n,void 0,l)];case 3:u=d.sent(),d.label=4;case 4:if(p=r.P6.resolveThrow(null!==(s=null===(a=null===(i=this.config)||void 0===i?void 0:i._fromApp)||void 0===a?void 0:a.config)&&void 0!==s?s:this.config),u&&u.code&&p)throw r.P6.createCloudbaseError({code:u.code,msg:u.message||u.data&&u.data.message||"",requestId:u.requestId},null===(c=this.config)||void 0===c?void 0:c.errorFactory);return[2,u]}})})},t}(this.request.constructor);return gu.reqClass=a,gu.getAccessToken=this.authInstance?this.authInstance.getAccessToken.bind(this.authInstance):function(){return""},gu.runtime=i,this.wsClientClass&&(gu.wsClass=o.wsClass,gu.wsClientClass=this.wsClientClass),gu.ws||(gu.ws=null),new(function(e){function t(t){return e.call(this,t)||this}return bu(t,e),t.prototype.runCommands=function(e){return xu(this,void 0,Promise,function(){return _u(this,function(t){return[2,gu.createRequest(this.config).send("database.runCommands",e)]})})},t}(gu))(wu(wu(wu({},this.config),{_fromApp:this}),e))}}};try{cloudbase.registerComponent(Iu)}catch(e){}function Su(e){try{e.registerComponent(Iu)}catch(e){console.warn(e)}}try{window.registerDatabase=Su}catch(e){}te.registerVersion("3.9.3");try{var Ou=__webpack_require__(7922).mI,Au=__webpack_require__(2332);te.useAdapters(Au.default);var Tu=te;Tu.version=Ou(),Tu.SYMBOL_CURRENT_ENV=Au.SYMBOL_CURRENT_ENV,Tu.SYMBOL_DEFAULT_ENV=Au.SYMBOL_DEFAULT_ENV,Tu.parseContext=Au.parseContext,Tu.getCloudbaseContext=Au.getCloudbaseContext}catch(e){}try{!function(e){try{e.registerComponent(ln)}catch(e){console.warn(e)}}(te),function(e){try{e.registerComponent(jn)}catch(e){console.warn(e)}}(te),Yr(te),Su(te),function(e){try{e.registerComponent(ko),e.registerHook(No)}catch(e){console.warn(e)}}(te),Go(te),La(te),xn(te),Wa(te),es(te)}catch(e){}try{window.cloudbase=te}catch(e){}const Pu=te})();var __webpack_exports__default=__webpack_exports__.Z;export{__webpack_exports__default as default};
|
|
2
|
+
import*as __WEBPACK_EXTERNAL_MODULE_jwt_decode_b659f100__ from"jwt-decode";import*as __WEBPACK_EXTERNAL_MODULE__cloudbase_adapter_interface_74717cc6__ from"@cloudbase/adapter-interface";import*as __WEBPACK_EXTERNAL_MODULE_node_crypto_803ecaf5__ from"node:crypto";import*as __WEBPACK_EXTERNAL_MODULE_node_fs_75ed2103__ from"node:fs";import*as __WEBPACK_EXTERNAL_MODULE_node_http_b674be28__ from"node:http";import*as __WEBPACK_EXTERNAL_MODULE_node_https_b78f5be9__ from"node:https";import*as __WEBPACK_EXTERNAL_MODULE_node_path_02319fef__ from"node:path";import*as __WEBPACK_EXTERNAL_MODULE_node_stream_62980834__ from"node:stream";import*as __WEBPACK_EXTERNAL_MODULE_node_url_da953c0c__ from"node:url";import*as __WEBPACK_EXTERNAL_MODULE_node_util_1f093676__ from"node:util";import*as __WEBPACK_EXTERNAL_MODULE_web_streams_polyfill_c4c9f3ad__ from"web-streams-polyfill";import*as __WEBPACK_EXTERNAL_MODULE__cloudbase_adapter_wx_mp_8d967865__ from"@cloudbase/adapter-wx_mp";import*as __WEBPACK_EXTERNAL_MODULE__cloudbase_wx_cloud_client_sdk_7708af81__ from"@cloudbase/wx-cloud-client-sdk";import*as __WEBPACK_EXTERNAL_MODULE__mattiasbuelens_web_streams_adapter_7d231298__ from"@mattiasbuelens/web-streams-adapter";import*as __WEBPACK_EXTERNAL_MODULE_text_encoding_shim_6f8fb6d2__ from"text-encoding-shim";import*as __WEBPACK_EXTERNAL_MODULE_bson__ from"bson";var __webpack_modules__={635:e=>{const t=async function(){}.constructor;e.exports=()=>t},7350:e=>{const t=async function*(){}.constructor;e.exports=()=>t},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)}},7922:(e,t,n)=>{n.d(t,{$R:()=>_,Bh:()=>y,Fy:()=>b,M4:()=>E,R1:()=>x,eX:()=>d,mI:()=>l,n0:()=>f,po:()=>u,tC:()=>p,vS:()=>w});var r=n(2976),o=function(){return o=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},o.apply(this,arguments)},i=r._G.tC,a=r._G.pM,s="",c="@cloudbase/js-sdk";function u(e){s=e}function l(){return s}function p(e){c=e,i(e)}function d(){return c}var h,f="2020-01-10",m=[],v=["env","endPointKey","region"],y="https:";function g(e){return m.find(function(t){return v.filter(function(t){return null!=e[t]}).every(function(n){return t[n]===e[n]})})}function b(e){var t,n;e.protocol&&!/:$/.test(e.protocol)&&(e.protocol="".concat(e.protocol,":"));var r=g(e);r?(null!=e.baseUrl&&(r.baseUrl=e.baseUrl),null!=e.protocol&&(r.protocol=e.protocol)):m.push(o(o({},e),{protocol:null!==(t=e.protocol)&&void 0!==t?t:y})),"CLOUD_API"===e.endPointKey&&a(null!==(n=e.protocol)&&void 0!==n?n:y)}function w(e,t,n){return g({env:e,endPointKey:t,region:n})}function _(e,t,n){var r="//".concat(e,".api.tcloudbasegateway.com/v1");n&&(r="//".concat(e,".api.intl.tcloudbasegateway.com/v1")),b({endPointKey:"GATEWAY",env:e,baseUrl:r,protocol:t})}function x(e,t,n){b({env:e,region:t,baseUrl:"//".concat(e,".").concat(t||"ap-shanghai",".tcb-api.tencentcloudapi.com/web"),protocol:n,endPointKey:"CLOUD_API"})}function E(e,t){void 0===t&&(t="CLOUD_API");var n=w(e,t||"CLOUD_API"),r=n.protocol,o=n.baseUrl;return"".concat(r).concat(o).match(/(http(s)?:)?\/\/([^/?#]*)/)[0]}!function(e){e.NULL="NULL",e.ANONYMOUS="ANONYMOUS",e.WECHAT="WECHAT",e.WECHAT_PUBLIC="WECHAT-PUBLIC",e.WECHAT_OPEN="WECHAT-OPEN",e.CUSTOM="CUSTOM",e.EMAIL="EMAIL",e.USERNAME="USERNAME",e.PHONE="PHONE"}(h||(h={}))},2332:(e,t,n)=>{n.r(t),n.d(t,{E:()=>q,NodeRequest:()=>de,SYMBOL_CURRENT_ENV:()=>K,SYMBOL_DEFAULT_ENV:()=>J,TcbError:()=>D,buildAdminUrl:()=>Se,callCompatibleWxOpenApi:()=>Ne,callWxOpenApi:()=>Re,callWxPayApi:()=>je,createWebStreamFromNodeReadableStream:()=>U,default:()=>Ye,filterUndefined:()=>B,filterValue:()=>M,getCloudbaseContext:()=>X,getGatewayUrl:()=>ee,getSecretInfo:()=>re,getServerInjectUrl:()=>Z,getTcbContextConfig:()=>Q,getWxCloudToken:()=>Ee,getWxOptions:()=>Ce,isPageModuleName:()=>V,isValidEnvFormat:()=>z,parseContext:()=>Y,parseQueryString:()=>L,processReturn:()=>G,sendWxFormDataRequest:()=>Ae,sendWxRequest:()=>Te,setThrowOnCode:()=>W,wxCallContainerApi:()=>Le});var r,o=n(7149),i=n(2539),a=n(6794),s={INVALID_PARAM:{code:"INVALID_PARAM",message:"invalid param"},SYS_ERR:{code:"SYS_ERR",message:"system error"},REQUEST_TIMEOUT:{code:"REQUEST_TIMEOUT",message:"request timeout"},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参数"}},c="/admin",u="/auth/v1/token/clientCredential",l=/^[a-zA-Z0-9_\-#@~=*(){}[\]:.,<>+]{4,32}$/;!function(e){e.SECRET="SECRET",e.SESSION_SECRET="SESSION_SECRET"}(r||(r={}));var p,d=n(2976),h=n(3408),f=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())})},m=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 v(e,t){return void 0===t&&(t={}),f(this,void 0,Promise,function(){var n,r,o,i;return m(this,function(a){switch(a.label){case 0:n="".concat("http://metadata.tencentyun.com","/").concat(p.latest,"/").concat(e),r=new AbortController,t.timeout&&(o=setTimeout(function(){return r.abort()},t.timeout)),a.label=1;case 1:return a.trys.push([1,,5,6]),[4,fetch(n,{signal:r.signal})];case 2:return 200!==(i=a.sent()).status?[3,4]:[4,i.text()];case 3:return[2,a.sent()];case 4:throw new Error("[ERROR] GET ".concat(n," status: ").concat(i.status));case 5:return o&&clearTimeout(o),[7];case 6:return[2]}})})}!function(e){e.v20170919="2017-09-19",e["v1.0"]="1.0",e.latest="latest"}(p||(p={}));var y={appId:void 0};function g(){return f(this,void 0,Promise,function(){var e;return m(this,function(t){switch(t.label){case 0:if(void 0!==y.appId)return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,v("meta-data/app-id",{timeout:30})];case 2:return e=t.sent(),/^[1-9][0-9]{4,64}$/gim.test(e)?y.appId=e:y.appId="",[3,4];case 3:return t.sent(),[3,4];case 4:return[2,y.appId||""]}})})}var b,w,_=n(3809),x=(b=function(e,t){return b=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])},b(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}b(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),E=function(){return E=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},E.apply(this,arguments)},I=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=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])}}},O=(w=d.P6).isFormData,T=w.toQueryString;function A(e){return"undefined"!=typeof process&&process.env?void 0!==e?process.env[e]:process.env:void 0!==e?void 0:{}}var P=function(){return"SCF"===A("TENCENTCLOUD_RUNENV")||!!A("TCB_CONTEXT_CNFG")},C=new Set(["formal","pre","test"]);function R(){return I(this,void 0,Promise,function(){var e;return S(this,function(t){switch(t.label){case 0:return"true"===A("TENCENTCLOUD")?[2,!0]:[4,g()];case 1:return[2,"string"==typeof(e=t.sent())&&""!==e]}})})}var k=function(e){if("string"!=typeof e)throw E(E({},s.INVALID_PARAM),{message:"uid must be a string"});if(!l.test(e))throw E(E({},s.INVALID_PARAM),{message:'Invalid uid: "'.concat(e,'"')})};function N(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}}function j(e){return Object.entries(e).reduce(function(e,t){var n=t[0],r=t[1];return e[n]=String(r),e},{})}function L(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}function U(e){var t=e[Symbol.asyncIterator]();return new h.ReadableStream({pull:function(e){return I(this,void 0,void 0,function(){var n;return S(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 D=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 x(t,e),t}(Error);function q(e){return new D(e)}function M(e,t){for(var n in e)e[n]===t&&delete e[n]}function B(e){M(e,void 0)}var F=!0;function W(e){F=e,(0,_.e)(e)}function G(e){if(!F)return e;throw q(E({},e))}function V(e){return void 0===e&&(e=""),"string"==typeof e&&e.startsWith("$:")}var H=/^[a-z0-9_-]{1,40}$/;function z(e){return void 0===e&&(e=""),"string"==typeof e&&H.test(e)}var K=Symbol.for("SYMBOL_CURRENT_ENV"),J=Symbol.for("SYMBOL_DEFAULT_ENV"),$=function(){return $=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},$.apply(this,arguments)};function Y(e){if("object"!=typeof e)throw $($({},s.INVALID_CONTEXT),{message:"context 必须为对象类型"});var t={},n=e.memory_limit_in_mb,r=e.time_limit_in_ms,o=e.request_id,i=e.function_version,a=e.namespace,c=e.function_name,u=e.environ,l=e.environment;try{if(t.memoryLimitInMb=n,t.timeLimitIns=r,t.requestId=o,t.functionVersion=i,t.namespace=a,t.functionName=c,l)t.environment=JSON.parse(l);else{var p=null==u?void 0:u.split(";"),d={};for(var h in p)if(p[h].includes("=")){var f=p[h].indexOf("="),m=p[h].slice(0,f),v=p[h].slice(f+1);v.indexOf(",")>=0&&(v=v.split(",")),d[m]=v}t.environ=d}}catch(e){throw $({},s.INVALID_CONTEXT)}return t}var X=function(e){P()&&(A("TENCENTCLOUD_REGION")||console.error("[TCB][ERROR] missing `TENCENTCLOUD_REGION` environment"),A("SCF_NAMESPACE")||console.error("[TCB][ERROR] missing `SCF_NAMESPACE` environment"));var t=A(),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,CLOUDBASE_APIKEY:t.CLOUDBASE_APIKEY},r={};if(e){var o=Y(e),i=o.environment,a=o.environ;r=i||a||{}}for(var s=0,c=[r.TCB_CONTEXT_KEYS||t.TCB_CONTEXT_KEYS,r.WX_CONTEXT_KEYS||t.WX_CONTEXT_KEYS];s<c.length;s++){var u=c[s];if(u)try{for(var l=0,p=u.split(",");l<p.length;l++){var d=p[l];n[d]=r[d]||A(d)}}catch(e){}}var h=$($({},n),r);return Object.fromEntries(Object.entries(h).filter(function(e){return void 0!==e[1]}))};function Q(){try{var e=X().TCB_CONTEXT_CNFG;return e?JSON.parse(e):{}}catch(e){return console.error("[TCB][ERROR] parse context error: ",e),{}}}function Z(){return Q().URL||""}function ee(){return Q().GATEWAY_URL||""}var te,ne={},re=function(e){var t,n,o,i,a,s,c;e&&(ne=JSON.parse(JSON.stringify(e)));var u=$({},e||ne),l=X(),p=l.TCB_ENV,d=l.SCF_NAMESPACE,h=l.TENCENTCLOUD_RUNENV,f=l.TENCENTCLOUD_SECRETID,m=l.TENCENTCLOUD_SECRETKEY,v=l.TENCENTCLOUD_SESSIONTOKEN,y=l.CLOUDBASE_APIKEY,g="";"local"===(g="symbol"!=typeof(null==e?void 0:e.env)&&(null==e?void 0:e.env)?e.env:p||d||"")&&"WX_LOCAL_SCF"===h&&(g="");var b={env:g,secretId:"",secretKey:"",sessionToken:"",accessKey:"",secretType:"",credentials:void 0,context:void 0};if((null==u?void 0:u.context)&&(b.context=u.context),((null==u?void 0:u.credentials)||(null===(t=null==e?void 0:e.auth)||void 0===t?void 0:t.credentials))&&(b.credentials=(null==u?void 0:u.credentials)||(null===(n=null==e?void 0:e.auth)||void 0===n?void 0:n.credentials)),(null==e?void 0:e.accessKey)||(null==u?void 0:u.accessKey))return b.accessKey=(null==e?void 0:e.accessKey)||(null==u?void 0:u.accessKey),b;if((null==u?void 0:u.secretId)&&(null==u?void 0:u.secretKey))return $($({},b),{secretId:u.secretId,secretKey:u.secretKey,sessionToken:u.sessionToken||"",secretType:u.sessionToken?r.SESSION_SECRET:r.SECRET});if((null===(o=null==e?void 0:e.auth)||void 0===o?void 0:o.secretId)&&(null===(i=null==e?void 0:e.auth)||void 0===i?void 0:i.secretKey))return $($({},b),{secretId:e.auth.secretId,secretKey:e.auth.secretKey,sessionToken:e.auth.sessionToken||"",secretType:e.auth.secretType||r.SECRET});if(y)return $($({},b),{accessKey:y});if(f&&m)return $($({},b),{secretId:f,secretKey:m,sessionToken:v||"",secretType:v?r.SESSION_SECRET:r.SECRET});var w=(null==u?void 0:u.context)||(null==e?void 0:e.context);if(null==w?void 0:w.extendedContext){var _=w.extendedContext;return g||(g=_.envId||""),$($({},b),{env:g,secretId:(null===(a=null==_?void 0:_.tmpSecret)||void 0===a?void 0:a.secretId)||"",secretKey:(null===(s=null==_?void 0:_.tmpSecret)||void 0===s?void 0:s.secretKey)||"",sessionToken:(null===(c=null==_?void 0:_.tmpSecret)||void 0===c?void 0:c.token)||""})}return $({},b)},oe=n(7922),ie=n(881),ae=function(){return ae=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},ae.apply(this,arguments)},se=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())})},ce=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])}}},ue=null;function le(){return se(this,void 0,void 0,function(){var e;return ce(this,function(t){return ue||(e=(0,ie.a)(["@cloudbase","/","signature-nodejs"],"缺少依赖 @cloudbase/signature-nodejs,请执行以下命令安装:\n\n npm install @cloudbase/signature-nodejs\n\n该依赖用于 Node 环境下的请求签名。"),ue=(null==e?void 0:e.sign)||null),[2,ue]})})}function pe(){if(void 0===te){var e=(0,ie.a)(["node","-fetch"]);te=(e&&e.default?e.default:e)||null}return te}var de=function(){function e(e){var t=this;this.getReqOptions=function(e,n){return se(t,void 0,void 0,function(){var t,r,o,i,a,s,l,p,d,h,f,m,v,y,g,b,w,_,x,E,O,T,k,j,L,U,D,q,M,B,F,W,G,V,H,z,K,J,$,Y,Q,Z,ee,te,ne;return ce(this,function(ie){switch(ie.label){case 0:return t=new URL(e),r=t.hostname,o=/^(\d{1,3}\.){3}\d{1,3}$/.test(r),i=(null===(H=re(this.config))||void 0===H?void 0:H.env)||this.config.env||A("SCF_NAMESPACE")||A("TCB_ENV")||"",a=o?"".concat(i,".api.tcloudbasegateway.com"):t.host,s=o?"".concat(t.protocol,"//").concat(a).concat(t.pathname).concat(t.search):e,l=X().TCB_SOURCE,h=(d="".concat((null===(K=null===(z=this.config.context)||void 0===z?void 0:z.extendedContext)||void 0===K?void 0:K.source)||l||"",",")).concat,[4,I(void 0,void 0,Promise,function(){return S(this,function(e){switch(e.label){case 0:return P()?[2,"scf"]:A("CBR_ENV_ID")?[2,"cbr"]:C.has(A("SUMERU_ENV")||"")?[2,"sumeru"]:[4,R()];case 1:return e.sent()?[2,"tencentcloud"]:[2,"unknown"]}})})];case 1:return p=h.apply(d,[ie.sent()]),n.headers=ae(ae({},n.headers),{"User-Agent":"adapter-node/".concat((null===(J=n.headers)||void 0===J?void 0:J["X-SDK-Version"])||"@cloudbase/js-sdk/".concat((0,oe.mI)())),"X-TCB-Source":p,"X-Client-Timestamp":(new Date).valueOf(),"X-TCB-Region":this.config.region||A("TENCENTCLOUD_REGION")||"",Host:a}),!1===n.withCredentials?[2,n]:(f=null!==(Y=null===($=n.headers)||void 0===$?void 0:$.Authorization)&&void 0!==Y?Y:null===(Q=n.headers)||void 0===Q?void 0:Q.authorization,(null===(Z=null==f?void 0:f.replace("Bearer",""))||void 0===Z?void 0:Z.trim())||t.pathname.startsWith("/auth/")&&t.pathname!==u?[2,n]:(m=re(this.config)).accessKey?(n.headers.Authorization="Bearer ".concat(m.accessKey),[2,n]):(v=t.pathname===c,["/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 y=ie.sent(),n.headers.Authorization="Bearer ".concat(y),[2,n];case 3:return g=ae(ae({},this.config),null===(ee=this.config)||void 0===ee?void 0:ee.auth),b=g.secretId,w=g.secretKey,_=g.sessionToken,x=ae(ae({},this.config),null===(te=this.config)||void 0===te?void 0:te.auth).secretType,E=n.method,O=n.body,T=JSON.parse(JSON.stringify(n.headers)),k=this.isNpmFormData(O),(j=k?O.__plainObj?ae({},O.__plainObj):{}:"object"==typeof O?O:N(O)||{}).envName=(null==j?void 0:j.env)||this.config.env||(null===(ne=re(this.config))||void 0===ne?void 0:ne.env)||"",j.access_token?[2,n]:("get"===E.toLowerCase()&&(j=void 0),b&&w&&"SESSION_SECRET"!==x||(L=re(this.config),b=L.secretId,w=L.secretKey,_=L.sessionToken),b&&w?(delete T.Authorization,T["content-type"]?T["content-type"]=T["content-type"].toLowerCase():T["Content-Type"]&&(T["Content-Type"]=T["Content-Type"].toLowerCase()),v&&_&&(j.sessionToken=_),U={secretId:b,secretKey:w,method:E,url:s,params:j,headers:T,withSignedParams:v,timestamp:Math.floor((new Date).getTime()/1e3)-1,isCloudApi:!v},T["content-type"]||T["Content-Type"]?[4,le()]:[2,n]):[2,n]);case 4:return(D=ie.sent())?(q=D(U),M=q.authorization,B=q.timestamp,"string"==typeof _&&""!==_?v?(T.Authorization="".concat(M),T["X-Timestamp"]=B,T["X-Signature-Expires"]=600):T.Authorization="".concat(M,", Timestamp=").concat(B,", Token=").concat(_):(T.Authorization="".concat(M,", Timestamp=").concat(B),v&&(T["X-Timestamp"]=B,T["X-Signature-Expires"]=600)),k?(F=O,W=new Set(Object.keys(F.__plainObj||{})),j.envName&&!W.has("envName")&&F.append("envName",j.envName),j.sessionToken&&!W.has("sessionToken")&&F.append("sessionToken",j.sessionToken),G=F.getBuffer(),V=F.getHeaders(),[2,ae(ae({},n),{headers:ae(ae(ae({},T),V),{"content-length":String(G.length)}),body:G})]):[2,ae(ae({},n),{headers:T,body:"object"==typeof j?JSON.stringify(j):j})]):[2,n]}})})},this.get=function(e){return t.request(ae(ae({},e),{method:"get"}),t.restrictedMethods.includes("get"))},this.post=function(e){return t.request(ae(ae({},e),{method:"post"}),t.restrictedMethods.includes("post"))},this.put=function(e){return t.request(ae(ae({},e),{method:"put"}))},this.upload=function(e){var n,r=e,o=r.data,i=r.file,a=r.fileContent,s=r.name,c=r.method,u=r.headers,l=void 0===u?{}:u,p=null!=i?i:a;if(void 0===p||void 0===s)throw new Error("file and name is required");var d=j(null!=o?o:{}),h=null==c?void 0:c.toLowerCase(),f=null!==(n=["post","put"].find(function(e){return e===h}))&&void 0!==n?n:"put",m=new FormData;return"post"===f?(Object.keys(d).forEach(function(e){m.append(e,d[e])}),m.append("key",s),m.append("file",p instanceof Blob?p:new Blob([p])),t.request(ae(ae({},e),{data:m,method:f}),t.restrictedMethods.includes("upload"))):t.request(ae(ae({},e),{method:"put",headers:l,body:p}),t.restrictedMethods.includes("upload"))},this.download=function(e){return se(t,void 0,Promise,function(){var t,n,r,o,s;return ce(this,function(c){switch(c.label){case 0:return[4,this.getFetchFn()(e.url,{headers:{},signal:this.timeout?AbortSignal.timeout(this.timeout):void 0})];case 1:if(!(t=c.sent()).ok)throw new Error("Download failed with status ".concat(t.status));return[4,t.arrayBuffer()];case 2:return n=c.sent(),r=Buffer.from(n),(o=e.tempFilePath)?(s=a.dirname(o),i.existsSync(s)||i.mkdirSync(s,{recursive:!0}),i.writeFileSync(o,r),[2,{statusCode:200,tempFilePath:o}]):[2,{statusCode:200,tempFilePath:e.url,fileContent:r}]}})})},this.fetch=function(e){return se(t,void 0,Promise,function(){var t,n,r,o,i,a,s,c,u,l,p,d,h,f,m,v;return ce(this,function(y){switch(y.label){case 0:return t=e.enableAbort,n=void 0!==t&&t,r=e.stream,o=void 0!==r&&r,i=e.signal,a=e.customReqOpts,s=this.getRealUrl(e.url,e.headers||{},e.body),c=(null==a?void 0:a.timeout)||this.timeout,u=this.createAbortController(c,n,i),l=u[0],p=u[1],d=e.headers?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}(e.headers):void 0,[4,this.getReqOptions(s,ae(ae({},e),{headers:d,body:e.body,signal:l.signal}))];case 1:h=y.sent(),this.applyDuplexIfNeeded(h),y.label=2;case 2:return y.trys.push([2,,8,9]),[4,this.getFetchFn()(s,h)];case 3:return f=y.sent(),m=void 0,204!==+f.status?[3,4]:(m="",[3,7]);case 4:return o?(m=f.body,[3,7]):[3,5];case 5:return v=N,[4,f.text()];case 6:m=v.apply(void 0,[y.sent()]),y.label=7;case 7:return[2,{data:m,statusCode:f.status,header:f.headers,response:f}];case 8:return p(),[7];case 9:return[2]}})})},this.request=function(e,n){return void 0===n&&(n=!1),se(t,void 0,Promise,function(){var t,r,i,a,s,c,u,l,p,d,h,f,m,v,y,g,b,w,_,x,E,I,S,A,P,C,R,k,L,U,D,q,M;return ce(this,function(B){switch(B.label){case 0:return t=e.url,r=e.headers,i=void 0===r?{}:r,a=e.data,s=e.responseType,c=e.withCredentials,u=e.body,l=e.method,p=e.customReqOpts,d=j(i),h=String(l).toLowerCase()||"get",f=(null==p?void 0:p.timeout)||this.timeout,m=e.signal,v=this.createAbortController(f,n,m),y=v[0],g=v[1],b=O(a)?a:"application/x-www-form-urlencoded"===d["content-type"]?T(null!=a?a:{}):u||(a?JSON.stringify(a):void 0),w=this.getRealUrl((0,o.formatUrl)("https",null!=t?t:"","get"===h?a:{}),e.headers||{},b),[4,this.getReqOptions(w,{method:h,headers:d,body:b,credentials:c?"include":"same-origin",signal:y.signal})];case 1:_=B.sent(),this.applyDuplexIfNeeded(_),B.label=2;case 2:return B.trys.push([2,,19,20]),[4,this.getFetchFn()(w,_)];case 3:x=B.sent(),E={header:{},statusCode:x.status},B.label=4;case 4:return B.trys.push([4,11,,18]),"blob"!==s?[3,6]:(I=E,[4,x.blob()]);case 5:return I.data=B.sent(),[3,10];case 6:return"buffer"!==s?[3,8]:(S=E,P=(A=Buffer).from,[4,x.arrayBuffer()]);case 7:return S.data=P.apply(A,[B.sent()]),[3,10];case 8:return C=E,R=N,[4,x.text()];case 9:C.data=R.apply(void 0,[B.sent()]),B.label=10;case 10:return[3,18];case 11:return k=B.sent(),console.log("catch an error",k),"blob"!==s?[3,13]:(L=E,[4,x.blob()]);case 12:return L.data=B.sent(),[3,17];case 13:return"buffer"!==s?[3,15]:(U=E,q=(D=Buffer).from,[4,x.arrayBuffer()]);case 14:return U.data=q.apply(D,[B.sent()]),[3,17];case 15:return M=E,[4,x.text()];case 16:M.data=B.sent(),B.label=17;case 17:return[3,18];case 18:return x.headers.forEach(function(e,t){return E.header[t.toLowerCase()]=e}),[2,E];case 19:return g(),[7];case 20:return[2]}})})};var n=e.timeout,r=e.restrictedMethods;this.timeout=n,this.restrictedMethods=r||["get","post","upload","download"],this.config=e}return e.prototype.getClientCredential=function(e){var t;return se(this,void 0,Promise,function(){var n;return ce(this,function(r){switch(r.label){case 0:return[4,this.fetch({url:"".concat(e.origin).concat(u),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;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:N(n)||"").access_token)return e;var i=new URL(e),a=re(this.config);return"/web"===i.pathname&&a.secretId&&a.secretKey&&(i.pathname=c),i.toString()},e.prototype.getFetchFn=function(){return(Z()||ee())&&pe()?pe():function(e,t){return fetch(e,t)}},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})),e&&(r=setTimeout(function(){var t="请求在".concat(e/1e3,"s内未完成,已中断");console.warn(t),o.abort(q({code:s.REQUEST_TIMEOUT.code,message: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}(),he=function(){return he=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},he.apply(this,arguments)},fe=function(){function e(){var e=X()._SCF_TCB_LOG;this.isSupportClsReport=!0,"1"!=="".concat(e)?this.isSupportClsReport=!1:console.__baseLog__||(this.isSupportClsReport=!1),this.isSupportClsReport}return e.prototype.transformMsg=function(e){var t={};return e&&"object"==typeof e&&!Array.isArray(e)?he(he({},t),e):{msg:e}},e.prototype.baseLog=function(e,t){"Object"!==Object.prototype.toString.call(e).slice(8,-1)&&(e={msg:e});var n=this.transformMsg(e);if(this.isSupportClsReport)console.__baseLog__(n,t);else{var r=console[t];"function"==typeof r?r(n):console.log(n)}},e.prototype.log=function(e){this.baseLog(e,"log")},e.prototype.info=function(e){this.baseLog(e,"info")},e.prototype.error=function(e){this.baseLog(e,"error")},e.prototype.warn=function(e){this.baseLog(e,"warn")},e}(),me=null;function ve(){return me||(me=new fe),me}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)},ge=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())})},be=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])}}},we="/.tencentcloudbase/wx/cloudbase_access_token",_e=6e5,xe={token:"",timestamp:0};function Ee(){var e=X(),t=e.TRIGGER_SRC,n=e.WX_TRIGGER_API_TOKEN_V0,r=e.WX_API_TOKEN,o=e.WX_CLOUDBASE_ACCESSTOKEN,a=void 0===o?"":o,s={};return s.wxCloudApiToken="timer"===t?n||r||"":r||"",s.wxCloudApiToken||(s.wxCloudbaseAccesstoken=a||function(){if(xe.token&&Date.now()-xe.timestamp<_e)return xe.token;try{if(("WX_LOCAL_SCF"===process.env.TENCENTCLOUD_RUNENV||"SCF"===process.env.TENCENTCLOUD_RUNENV)&&i.existsSync(we))return xe.token=i.readFileSync(we).toString(),xe.timestamp=Date.now(),xe.token}catch(e){console.warn("[TCB][ERROR]: loadWxCloudbaseAccesstoken error: ",e)}return""}()),s}var Ie=0;function Se(e,t,n){var r="symbol"==typeof e.env?process.env.TCB_ENV||process.env.SCF_NAMESPACE||"":e.env||"",o=e.region||process.env.TENCENTCLOUD_REGION||"",i=function(){Ie+=1;var e="".concat(Date.now().toString(16),"_").concat(Ie.toString(16)),t=X().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,l=t?"env=".concat(r,"&seqId=").concat(i,"&scfRequestId=").concat(t.requestId):"env=".concat(r,"&seqId=").concat(i);return u.includes("?")?"".concat(u).concat(l):"".concat(u,"?").concat(l)}function Oe(e){var t=X(),n=Ee(),r=n.wxCloudApiToken,o=n.wxCloudbaseAccesstoken;e.wxCloudApiToken=r,o&&(e.wxCloudbaseAccesstoken=o),e.tcb_sessionToken=t.TCB_SESSIONTOKEN||""}function Te(e,t,n,r){return ge(this,void 0,void 0,function(){return be(this,function(o){return Oe(n),[2,e.requestInstance.send(t,n,{pathname:"web",endPointMode:"GATEWAY"},r?{timeout:r.timeout}:void 0)]})})}function Ae(e,t,r,o){return ge(this,void 0,Promise,function(){var i,a,s,c,u,l,p,d;return be(this,function(h){switch(h.label){case 0:Oe(r);try{i=n(1191)}catch(e){throw new Error("缺少依赖 form-data,请执行 npm install form-data")}for((a=new i).append("action",t),s=0,c=Object.keys(r);s<c.length;s++)u=c[s],void 0!==r[u]&&a.append(u,r[u]);return l=ye({action:t},r),a.__plainObj=l,p=Se(e.config,e.scfContext,e.serviceUrl),[4,e.requestInstance.post({url:p,body:a,headers:a.getHeaders(),responseType:"buffer"},o?{timeout:o.timeout}:void 0)];case 1:return(d=h.sent()).data?[2,d.data]:[2,d]}})})}function Pe(e,t){if(void 0===t&&(t={}),t.getCrossAccountInfo||e.getCrossAccountInfo)throw q(ye(ye({},s.INVALID_PARAM),{message:"invalid config: getCrossAccountInfo"}))}function Ce(e,t,n,r){return{requestInstance:r,config:e,scfContext:t,serviceUrl:n}}function Re(e,t,n){var r=t.apiName,o=t.apiOptions,i=t.cgiName,a=t.requestData;return ge(this,void 0,void 0,function(){var t,c,u;return be(this,function(l){switch(l.label){case 0:try{t=a?JSON.stringify(a):""}catch(e){throw q(ye(ye({},e),{code:s.INVALID_PARAM.code,message:"对象出现了循环引用"}))}return Pe(e.config,n),[4,Te(e,"wx.api",{apiName:r,apiOptions:o,cgiName:i,requestData:t},n)];case 1:if((c=l.sent()).code)return[2,c];try{u=JSON.parse(c.responseData)}catch(e){u=c.responseData}return[2,{result:u,requestId:c.requestId}]}})})}function ke(e,t,n,r){var o=n.apiName,i=n.apiOptions,a=n.cgiName,s=n.requestData;return ge(this,void 0,void 0,function(){return be(this,function(n){return Pe(t.config,r),[2,Ae(t,e,{apiName:o,apiOptions:i,cgiName:a,requestData:s},r)]})})}var Ne=function(e,t,n){return ke("wx.openApi",e,t,n)},je=function(e,t,n){return ke("wx.wxPayApi",e,t,n)},Le=function(e,t,n){return ke("wx.wxCallContainerApi",e,t,n)},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(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())})},qe=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])}}},Me=null;function Be(){var e;return De(this,void 0,void 0,function(){var t;return qe(this,function(n){return Me||(t=(0,ie.a)(["json","webtoken"],"缺少依赖 jsonwebtoken,请执行以下命令安装:\n\n npm install jsonwebtoken\n\n该依赖用于 Node 环境下的自定义登录票据生成。"),Me=(null===(e=null==t?void 0:t.default)||void 0===e?void 0:e.sign)||(null==t?void 0:t.sign)||null),[2,Me]})})}function Fe(){var e=X();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 We(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 Ge,Ve=null,He=function(e,t){var n=t;"boolean"!=typeof n.throw&&(n.throw=!0),n.errorFactory=function(e){return new D({code:"INVALID_PARAMS"===e.code?"INVALID_PARAM":e.code,message:e.msg||e.message||"",requestId:e.requestId})},"function"!=typeof e.logger&&(e.logger=ve);var r=n.serviceUrl||ee()||"";if(r){var o=function(e){try{var t=new URL(e);t.pathname="/v1",t.search="",t.hash="";var n=t.protocol.replace(/:$/,"");return{baseUrl:"//".concat(t.host).concat(t.pathname),protocol:n}}catch(e){return null}}(r);o&&(0,oe.Fy)(Ue({endPointKey:"GATEWAY",env:t.env},o))}if(e.parseContext=function(e){var t=Y(e);return Ve=t,t},e.getCloudbaseContext=function(e){return X(e)},e.auth){var i={getUserInfo:function(){return Fe()},getEndUserInfo:function(n){return De(this,void 0,Promise,function(){var r;return qe(this,function(o){return r=Fe(),void 0===n?[2,{userInfo:r}]:(k(n),[2,We(e,{uuid:n,envName:t.env}).then(function(e){return e.code?e:{userInfo:Ue(Ue({},r),e.data),requestId:e.requestId}})])})})},createTicket:function(e,n){return void 0===n&&(n={}),De(this,void 0,Promise,function(){var r,o,i,a,c,u,l,p,d;return qe(this,function(h){switch(h.label){case 0:if(k(e),r=(new Date).getTime(),o=(t.auth||{}).credentials,!(i=t.env))throw Ue(Ue({},s.INVALID_PARAM),{message:"no env in config"});if(!(null==o?void 0:o.env_id))throw Ue(Ue({},s.INVALID_PARAM),{message:"当前私钥未包含env_id 信息, 请前往腾讯云云开发控制台,获取自定义登录最新私钥"});if(o.env_id!==i)throw Ue(Ue({},s.INVALID_PARAM),{message:"当前私钥所属环境与 init 指定环境不一致!"});return a=n.refresh,c=void 0===a?36e5:a,u=n.expire,l=void 0===u?r+6048e5:u,[4,Be()];case 1:return p=h.sent(),d=p({alg:"RS256",env:i,iat:r,exp:r+6e5,uid:e,refresh:c,expire:l},o.private_key,{allowInsecureKeySizes:!0,algorithm:"RS256"}),[2,"".concat(o.private_key_id,"/@@/").concat(d)]}})})},queryUserInfo:function(n){return De(this,void 0,Promise,function(){var r,o,i;return qe(this,function(a){return r=n.uid,o=n.platform,i=n.platformId,[2,We(e,{uuid:r,platform:o,platformId:i,envName:t.env}).then(function(e){return e.code?e:{userInfo:Ue({},e.data),requestId:e.requestId}})]})})},getClientIP:function(){return X().TCB_SOURCE_IP||""},getAuthContext:function(e){var t=X(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(n){return De(this,void 0,void 0,function(){var r,o;return qe(this,function(i){switch(i.label){case 0:return(r=re(t)).accessKey?[2,r.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"}},n?{timeout:n.timeout}:void 0)]);case 1:return[2,i.sent().data]}})})}},a=e.auth;Object.keys(i).forEach(function(e){a[e]=i[e]}),e.auth=new Proxy(a,{apply:function(e,t,n){var r=Reflect.apply(e,t,n);return r&&"object"==typeof r&&Object.keys(i).forEach(function(e){Object.prototype.hasOwnProperty.call(r,e)||(r[e]=i[e])}),r}})}function c(){var t=n.serviceUrl||Z()||void 0;return Ce(n,Ve,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 Re(c(),e,t)},e.callWxPayApi=function(e,t){return je(c(),e,t)},e.wxCallContainerApi=function(e,t){return Le(c(),e,t)},e.callCompatibleWxOpenApi=function(e,t){return Ne(c(),e,t)},e.getFileAuthority=function(t,n){var r=t.fileList;return De(void 0,void 0,void 0,function(){var t,o,i,a,c,u;return qe(this,function(l){switch(l.label){case 0:if(t=X().LOGINTYPE,!Array.isArray(r))throw q(Ue(Ue({},s.INVALID_PARAM),{message:"[js-sdk] getCosFileAuthority fileList must be a array"}));if(r.some(function(e){return!(null==e?void 0:e.path)||!["READ","WRITE","READWRITE"].includes(e.type)}))throw q(Ue(Ue({},s.INVALID_PARAM),{message:"[js-sdk] getCosFileAuthority fileList param error"}));return[4,e.auth.getEndUserInfo()];case 1:if(o=l.sent().userInfo,i=o.openId,a=o.uid,!i&&!a)throw q(Ue(Ue({},s.INVALID_PARAM),{message:"[js-sdk] admin do not need getCosFileAuthority."}));return c={openId:i,uid:a,loginType:t,fileList:r},[4,e.request.send("storage.getFileAuthority",c,{pathname:"web",endPointMode:"GATEWAY"},n?{timeout:n.timeout}:void 0)];case 2:if((u=l.sent()).code)throw q(Ue(Ue({},u),{message:"[js-sdk] getCosFileAuthority failed: ".concat(u.code)}));return[2,u]}})})},e.callApis=function(t,n){return De(void 0,void 0,void 0,function(){var r,o,i,a,s,c,u,l,p,d,h,f;return qe(this,function(m){if(e.apis)return r=t.name,o=t.path,i=void 0===o?"":o,a=t.method,s=void 0===a?"POST":a,c=t.header,u=void 0===c?{}:c,l=t.body,p=t.token,d=(s||"POST").toLowerCase(),[2,null===(f=null===(h=e.apis[r])||void 0===h?void 0:h[d])||void 0===f?void 0:f.call(h,{path:i,method:s,headers:u,body:l,token:p},n)];throw new Error("callApis is not supported in current configuration")})})}},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)},Ke=null,Je=!1,$e=(Ge=new Map,{mode:"sync",setItem:function(e,t){Ge.set(e,t)},getItem:function(e){return Ge.get(e)},removeItem:function(e){Ge.delete(e)},clear:function(){Ge.clear()}});const Ye={genAdapter:function(e){return{nodeTool:He,getSecretInfo:re,root:{globalThis:{}},reqClass:de,get wsClass(){return Ke||Je||(Je=!0,Ke=(0,ie.a)(["w","s"],"缺少依赖 ws,请执行以下命令安装:\n\n npm install ws\n\n该依赖用于 Node 环境下的 WebSocket 连接。")),Ke},sessionStorage:$e,localStorage:$e,primaryStorage:o.StorageType.session,captchaOptions:{openURIWithCallback:function(t){var n=e.EventBus,r={},o=t,i=t.match(/^(data:.*?)(\?[^#\s]*)?$/);if(i){o=i[1];var a=i[2];a&&(r=L(a))}var s=r.token,c=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}(r,["token"]);return/^data:/.test(o)&&!s?Promise.reject({error:"invalid_argument",error_description:"invalie captcha data: ".concat(t)}):s?new Promise(function(e){n.$emit("CAPTCHA_DATA_CHANGE",ze(ze({},c),{token:s,url:o})),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"}},881:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{function isNodeRuntime(){return"undefined"!=typeof process&&!!process.versions&&null!=process.versions.node}function getRuntimeRequire(){try{var req=eval('typeof require !== "undefined" ? require : null');if("function"==typeof req)return req}catch(e){}try{var builtinModuleName=["mod","ule"].join(""),proc="undefined"!=typeof process?process:null,getBuiltin=proc&&"function"==typeof proc.getBuiltinModule?proc.getBuiltinModule.bind(proc):null,mod=getBuiltin?getBuiltin(builtinModuleName):null;if(mod&&"function"==typeof mod.createRequire){var base=void 0;try{var metaUrl=eval('typeof import.meta !== "undefined" ? import.meta.url : ""');base=metaUrl||"".concat(process.cwd(),"/")}catch(e){base="".concat(process.cwd(),"/")}return mod.createRequire(base)}}catch(e){}return null}function optionalRequire(e,t){if(!isNodeRuntime())return null;var n=e.join(""),r=getRuntimeRequire();if(!r)return null;try{return r(n)}catch(e){return t&&console.error(t),null}}__webpack_require__.d(__webpack_exports__,{a:()=>optionalRequire})},3809:(e,t,n)=>{n.d(t,{F:()=>o,e:()=>i});var r=new Set;function o(e){e&&"object"==typeof e&&r.add(e)}function i(e){r.forEach(function(t){t.throw=e})}},3171:(e,t,n)=>{var r;if(n.r(t),n.d(t,{getEncryptInfo:()=>q}),!globalThis.IS_MP_BUILD){var o="undefined"!=typeof globalThis?globalThis.navigator:window.globalThis;function M(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function B(e,t){return e&t}function F(e,t){return e|t}function W(e,t){return e^t}function G(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 H(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function z(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=i.charAt(n>>6)+i.charAt(63&n);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=i.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=i.charAt(n>>2)+i.charAt((3&n)<<4));(3&r.length)>0;)r+="=";return r}function K(e){var t,n="",r=0,o=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t){var a=i.indexOf(e.charAt(t));a<0||(0==r?(n+=M(a>>2),o=3&a,r=1):1==r?(n+=M(o<<2|a>>4),o=15&a,r=2):2==r?(n+=M(o),n+=M(a>>2),o=3&a,r=3):(n+=M(o<<2|a>>4),n+=M(15&a),r=0))}return 1==r&&(n+=M(o<<2)),n}var a,s,c={decode:function(e){var t;if(void 0===a){var n="0123456789ABCDEF";for(a={},t=0;t<16;++t)a[n.charAt(t)]=t;for(n=n.toLowerCase(),t=10;t<16;++t)a[n.charAt(t)]=t;for(t=0;t<8;++t)a[" \f\n\r\t \u2028\u2029".charAt(t)]=-1}var r=[],o=0,i=0;for(t=0;t<e.length;++t){var s=e.charAt(t);if("="==s)break;if(-1!=(s=a[s])){if(void 0===s)throw new Error("Illegal character at offset "+t);o|=s,++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}},u={decode:function(e){var t;if(void 0===s){for(s=Object.create(null),t=0;t<64;++t)s["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(t=0;t<9;++t)s["= \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=s[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=u.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 u.decode(e)}},l=1e13;class J{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)<l?t=0:r-=(t=0|r/l)*l,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+=l,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+=(l+t[r]).toString().substring(1);return n}valueOf(){for(var e=this.buf,t=0,n=e.length-1;n>=0;--n)t=t*l+e[n];return t}simplify(){var e=this.buf;return 1==e.length?e[0]:this}}var p,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)?)?$/,h=/^(\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 $(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}class Y{constructor(e,t){this.hexDigits="0123456789ABCDEF",e instanceof Y?(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?d:h).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 J(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+$(i,n)}return o+i}parseOctetString(e,t,n){if(this.isASCII(e,t))return $(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 J,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 J)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 $(r,n);o=new J,i=0}}return i>0&&(r+=".incomplete"),r}}class X{constructor(e,t,n,r,o){if(!(r instanceof Q))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 $(this.stream.parseStringUTF(t,t+n),e);case 18:case 19:case 20:case 21:case 22:case 26:return $(this.stream.parseStringISO(t,t+n),e);case 30:return $(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 Y?e:new Y(e,0);var n=new Y(t),r=new Q(t),o=X.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]=X.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=X.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 X(n,a,o,r,s)}}class Q{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 J;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 f=[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],m=(1<<26)/f[f.length-1];class Z{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=ee();return Z.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)+se(this[this.t-1]^this.s&this.DM)}mod(e){var t=ee();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(Z.ZERO)>0&&e.subTo(t,t),t}modPowInt(e,t){var n;return n=e<256||t.isEven()?new y(t):new g(t),this.exp(e,n)}clone(){var e=ee();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=ee();return this.bitwiseTo(e,B,t),t}or(e){var t=ee();return this.bitwiseTo(e,F,t),t}xor(e){var t=ee();return this.bitwiseTo(e,W,t),t}andNot(e){var t=ee();return this.bitwiseTo(e,G,t),t}not(){for(var e=ee(),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=ee();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}shiftRight(e){var t=ee();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+=H(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,F)}clearBit(e){return this.changeBit(e,G)}flipBit(e){return this.changeBit(e,W)}add(e){var t=ee();return this.addTo(e,t),t}subtract(e){var t=ee();return this.subTo(e,t),t}multiply(e){var t=ee();return this.multiplyTo(e,t),t}divide(e){var t=ee();return this.divRemTo(e,t,null),t}remainder(e){var t=ee();return this.divRemTo(e,null,t),t}divideAndRemainder(e){var t=ee(),n=ee();return this.divRemTo(e,t,n),[t,n]}modPow(e,t){var n,r,o=e.bitLength(),i=ae(1);if(o<=0)return i;n=o<18?1:o<48?3:o<144?4:o<768?5:6,r=o<8?new y(t):t.isEven()?new b(t):new g(t);var a=[],s=3,c=n-1,u=(1<<n)-1;if(a[1]=r.convert(this),n>1){var l=ee();for(r.sqrTo(a[1],l);s<=u;)a[s]=ee(),r.mulTo(l,a[s-2],a[s]),s+=2}var p,d,h=e.t-1,f=!0,m=ee();for(o=se(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 Z.ZERO;for(var n=e.clone(),r=this.clone(),o=ae(1),i=ae(0),a=ae(0),s=ae(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(Z.ONE)?Z.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 v)}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]<=f[f.length-1]){for(t=0;t<f.length;++t)if(n[0]==f[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<f.length;){for(var r=f[t],o=t+1;o<f.length&&r<m;)r*=f[o++];for(r=n.modInt(r);t<o;)if(r%f[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]:ie(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&&Z.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&&Z.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=ee());var i=ee(),a=this.s,s=e.s,c=this.DB-se(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,y=t??ee();for(i.dlShiftTo(v,y),n.compareTo(y)>=0&&(n[n.t++]=1,n.subTo(y,n)),Z.ONE.dlShiftTo(u,y),y.subTo(i,i);i.t<u;)i[i.t++]=0;for(;--v>=0;){var g=n[--m]==l?this.DM:Math.floor(n[m]*d+(n[m-1]+f)*h);if((n[m]+=i.am(0,g,n,v,0,u))<g)for(i.dlShiftTo(v,y),n.subTo(y,n);n[m]<--g;)n.subTo(y,n)}null!=t&&(n.drShiftTo(u,t),a!=s&&Z.ZERO.subTo(t,t)),n.t=u,n.clamp(),c>0&&n.rShiftTo(c,n),a<0&&Z.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 Z.ONE;var n=ee(),r=ee(),o=t.convert(this),i=se(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=ae(n),o=ee(),i=ee(),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=ie(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&&Z.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(Z.ONE.shiftLeft(e-1),F,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(Z.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=Z.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(Z.ONE),n=t.getLowestSetBit();if(n<=0)return!1;var r=t.shiftRight(n);(e=e+1>>1)>f.length&&(e=f.length);for(var o=ee(),i=0;i<e;++i){o.fromInt(f[Math.floor(Math.random()*f.length)]);var a=o.modPow(r,this);if(0!=a.compareTo(Z.ONE)&&0!=a.compareTo(t)){for(var s=1;s++<n&&0!=a.compareTo(t);)if(0==(a=a.modPowInt(2,this)).compareTo(Z.ONE))return!1;if(0!=a.compareTo(t))return!1}}return!0}square(){var e=ee();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(Z.ONE.shiftLeft(e-1),F,this),this.isEven()&&this.dAddOffset(1,0);var o=this,i=function(){o.dAddOffset(2,0),o.bitLength()>e&&o.subTo(Z.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 v=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}(),y=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}(),g=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=ee();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(Z.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=ee();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}(),b=function(){function e(e){this.m=e,this.r2=ee(),this.q3=ee(),Z.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=ee();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 ee(){return new Z(null)}function te(e,t){return new Z(e,t)}function ne(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 re(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 oe(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)?(Z.prototype.am=re,p=30):"Netscape"!=(null==o?void 0:o.appName)?(Z.prototype.am=ne,p=26):(Z.prototype.am=oe,p=28),Z.prototype.DB=p,Z.prototype.DM=(1<<p)-1,Z.prototype.DV=1<<p,Z.prototype.FV=Math.pow(2,52),Z.prototype.F1=52-p,Z.prototype.F2=2*p-52;var w,_,x=[];for(w="0".charCodeAt(0),_=0;_<=9;++_)x[w++]=_;for(w="a".charCodeAt(0),_=10;_<36;++_)x[w++]=_;for(w="A".charCodeAt(0),_=10;_<36;++_)x[w++]=_;function ie(e,t){return x[e.charCodeAt(t)]??-1}function ae(e){var t=ee();return t.fromInt(e),t}function se(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}Z.ZERO=ae(0),Z.ONE=ae(1);class ce{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 E,I,S=null;if(null==S){S=[],I=0;var O,T,A=void 0;if("undefined"!=typeof window&&null!==(O=window)&&void 0!==O&&O.crypto&&null!==(T=window)&&void 0!==T&&T.crypto.getRandomValues){var P,C=new Uint32Array(256);for(null===(P=window)||void 0===P||P.crypto.getRandomValues(C),A=0;A<C.length;++A)S[I++]=255&C[A]}var R,k,N,j=function(e){var t,n,r;if(this.count=this.count||0,this.count>=256||I>=256){if("undefined"!=typeof window)if(null!==(t=window)&&void 0!==t&&t.removeEventListener)null===(r=window)||void 0===r||r.removeEventListener("mousemove",j,!1);else if(null!==(n=window)&&void 0!==n&&n.detachEvent){var o;null===(o=window)||void 0===o||o.detachEvent("onmousemove",j)}}else try{var i=e.x+e.y;S[I++]=255&i,this.count+=1}catch(e){}};if("undefined"!=typeof window)if(null!==(R=window)&&void 0!==R&&R.addEventListener)null===(N=window)||void 0===N||N.addEventListener("mousemove",j,!1);else if(null!==(k=window)&&void 0!==k&&k.attachEvent){var L;null===(L=window)||void 0===L||L.attachEvent("onmousemove",j)}}function ue(){if(null==E){for(E=new ce;I<256;){var e=Math.floor(65536*Math.random());S[I++]=255&e}for(E.init(S),I=0;I<S.length;++I)S[I]=0;I=0}return E.next()}class le{constructor(){}nextBytes(e){for(var t=0;t<e.length;++t)e[t]=ue()}}function pe(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 le,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 Z(n)}class de{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=te(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")}encrypt(e){var t=pe(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}),z(r)):z(this.encrypt(e))}catch(e){return!1}}decryptLong(e){var t=this,n=this.n.bitLength()+7>>3;e=K(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=te(e,16),this.e=parseInt(t,16),this.d=te(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=te(e,16),this.e=parseInt(t,16),this.d=te(n,16),this.p=te(r,16),this.q=te(o,16),this.dmp1=te(i,16),this.dmq1=te(a,16),this.coeff=te(s,16)):console.error("Invalid RSA private key")}generate(e,t){var n=new le,r=e>>1;this.e=parseInt(t,16);for(var o=new Z(t,16);;){for(;this.p=new Z(e-r,1,n),0!=this.p.subtract(Z.ONE).gcd(o).compareTo(Z.ONE)||!this.p.isProbablePrime(10););for(;this.q=new Z(r,1,n),0!=this.q.subtract(Z.ONE).gcd(o).compareTo(Z.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(Z.ONE),s=this.q.subtract(Z.ONE),c=a.multiply(s);if(0==c.gcd(o).compareTo(Z.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=te(e,16),n=this.doPrivate(t);return null==n?null:he(n,this.n.bitLength()+7>>3)}generateAsync(e,t,n){var r=new le,o=e>>1;this.e=parseInt(t,16);var i=new Z(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(Z.ONE),r=a.q.subtract(Z.ONE),o=t.multiply(r);0==o.gcd(i).compareTo(Z.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=ee(),a.q.fromNumberAsync(o,1,r,function(){a.q.subtract(Z.ONE).gcda(i,function(e){0==e.compareTo(Z.ONE)&&a.q.isProbablePrime(10)?setTimeout(t,0):setTimeout(c,0)})})},u=()=>{a.p=ee(),a.p.fromNumberAsync(e-o,1,r,function(){a.p.subtract(Z.ONE).gcda(i,function(e){0==e.compareTo(Z.ONE)&&a.p.isProbablePrime(10)?setTimeout(c,0):setTimeout(u,0)})})};setTimeout(u,0)};setTimeout(s,0)}}function he(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 fe extends de{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)?c.decode(e):u.unarmor(e),o=X.decode(r);if(3===o.sub.length&&(o=o.sub[2].sub[0]),9===o.sub.length){t=o.sub[1].getHexStringValue(),this.n=te(t,16),n=o.sub[2].getHexStringValue(),this.e=parseInt(n,16);var i=o.sub[3].getHexStringValue();this.d=te(i,16);var a=o.sub[4].getHexStringValue();this.p=te(a,16);var s=o.sub[5].getHexStringValue();this.q=te(s,16);var l=o.sub[6].getHexStringValue();this.dmp1=te(l,16);var p=o.sub[7].getHexStringValue();this.dmq1=te(p,16);var d=o.sub[8].getHexStringValue();this.coeff=te(d,16)}else{if(2!==o.sub.length)return!1;var h=o.sub[1].sub[0];t=h.sub[0].getHexStringValue(),this.n=te(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 fe(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(K(e))}catch(e){return!1}},r.prototype.encrypt=function(e){try{return z(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 fe,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 U=r;var D=n(2631),q=function(e){var t=void 0===e?{}:e,n=t.publicKey,r=void 0===n?"":n,o=t.payload,i=void 0===o?{}:o;if(!r)return"";try{var a=(0,D.I)(i),s=new U;return s.setPublicKey(r),s.encryptLong("object"==typeof a?JSON.stringify(a):a)}catch(e){console.error("encrypt error:",e)}return""}},2631:(e,t,n)=>{n.d(t,{I:()=>r,y:()=>o});var r=function(e){var t=function(t){for(var n in e)e.hasOwnProperty(n)&&(t[n]=r(e[n]));return t},n=null==e?"NullOrUndefined":Object.prototype.toString.call(e).slice(8,-1);if(["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"].includes(n))return e.slice();switch(n){case"Object":return t(Object.create(Object.getPrototypeOf(e)));case"Array":return t([]);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}},o=function(e){var t=e.match(/^(?:http(s)?:\/\/[^\/]+)?(\/[^\?#]*)/);return t&&t[2]||""}},2976:(e,t,n)=>{n.d(t,{j$:()=>i,Fs:()=>a,_G:()=>r,U3:()=>s,BM:()=>u,RR:()=>c,P6:()=>o});var r={};n.r(r),n.d(r,{vM:()=>y,Sg:()=>g,Fk:()=>v,eX:()=>d,pM:()=>f,tC:()=>p});var o={};n.r(o),n.d(o,{CloudbaseError:()=>G,createCloudbaseError:()=>H,createPromiseCallback:()=>D,errorToResult:()=>$,execCallback:()=>q,formatUrl:()=>k,genSeqId:()=>C,generateRequestId:()=>R,getHash:()=>L,getQuery:()=>j,isArray:()=>E,isFormData:()=>P,isInstanceOf:()=>A,isNull:()=>T,isPalinObject:()=>O,isString:()=>I,isUndefined:()=>S,maybeThrow:()=>K,parseCaptcha:()=>ee,parseQueryString:()=>Z,printError:()=>B,printGroupLog:()=>Y,printInfo:()=>F,printWarn:()=>M,promoteGatewayError:()=>J,removeParam:()=>U,resolveThrow:()=>z,sleep:()=>X,throwError:()=>W,toQueryString:()=>N,transformPhone:()=>Q});var i={};n.r(i),n.d(i,{Fk:()=>ce,xY:()=>ue});var a={};n.r(a),n.d(a,{q:()=>fe});var s={};n.r(s),n.d(s,{yE:()=>ge});var c={};n.r(c),n.d(c,{P:()=>we,$:()=>be});var u={};n.r(u),n.d(u,{D:()=>Oe});var l="@cloudbase/js-sdk";function p(e){l=e}function d(){return l}var h="https:";function f(e){h=e}var m,v=("undefined"==typeof process||process.env,!1),y="https://support.qq.com/products/148793",g={INVALID_PARAMS:"INVALID_PARAMS",INVALID_SYNTAX:"INVALID_SYNTAX",INVALID_OPERATION:"INVALID_OPERATION",OPERATION_FAIL:"OPERATION_FAIL",NETWORK_ERROR:"NETWORK_ERROR",UNKOWN_ERROR:"UNKOWN_ERROR"},b=n(7149),w=(m=function(e,t){return m=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])},m(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}m(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),_=function(){return _=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},_.apply(this,arguments)},x=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};function E(e){return"[object Array]"===Object.prototype.toString.call(e)}function I(e){return"string"==typeof e}function S(e){return void 0===e}function O(e){return"[object Object]"===Object.prototype.toString.call(e)}function T(e){return"[object Null]"===Object.prototype.toString.call(e)}function A(e,t){return e instanceof t}function P(e){return"[object FormData]"===Object.prototype.toString.call(e)}function C(){return Math.random().toString(16).slice(2)}function R(){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)})}function k(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)}function N(e){void 0===e&&(e={});var t=[];return Object.keys(e).forEach(function(n){t.push("".concat(n,"=").concat(encodeURIComponent(e[n])))}),t.join("&")}function j(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]:""}var L=function(e){if("undefined"==typeof window)return"";var t=window.location.hash.match(new RegExp("[#?&/]".concat(e,"=([^&#]*)")));return t?t[1]:""};function U(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}function D(){var e={};if(!Promise){(e=function(){}).promise={};var t=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}var n=new Promise(function(t,n){e=function(e,r){return e?n(e):t(r)}});return e.promise=n,e}function q(e,t,n){if(void 0===n&&(n=null),e&&"function"==typeof e)return e(t,n);if(t)throw t;return n}function M(e,t){console.warn("[".concat(d(),"][").concat(e,"]:").concat(t))}function B(e,t){console.error({code:e,msg:"[".concat(d(),"][").concat(e,"]:").concat(t)})}function F(e,t){console.log("[".concat(d(),"][").concat(e,"]:").concat(t))}function W(e,t){var n=new Error(JSON.stringify({code:e,msg:"[".concat(d(),"][").concat(e,"]:").concat(t)}));throw n.code=e,n}var G=function(e){function t(t){var n=e.call(this,t.msg||t.message||"")||this;return n.code=t.code||"",n.requestId=t.requestId||"",Object.defineProperty(n,"message",{value:t.msg||t.message||"",enumerable:!0,writable:!0,configurable:!0}),n}return w(t,e),t}(Error),V=function(e){return new G(e)};function H(e,t){return(t||V)(e)}function z(e){return!e||"boolean"!=typeof e.throw||e.throw}function K(e,t){if(z(e))throw H(t,null==e?void 0:e.errorFactory);return _({code:t.code,message:t.msg},t.requestId?{requestId:t.requestId}:{})}function J(e){if(e&&"object"==typeof e&&e.data&&"object"==typeof e.data){var t=e.data,n=t.code,r=t.message;if(!e.code&&n||!e.message&&r)return _(_(_({},e),!e.code&&n?{code:n}:{}),!e.message&&r?{message:r}:{})}return e}function $(e){if(e instanceof Error&&"string"==typeof e.message)try{var t=JSON.parse(e.message);if(t&&"string"==typeof t.code)return{code:t.code,message:t.msg||t.message||"",requestId:t.requestId}}catch(e){}return e&&"string"==typeof e.code?{code:e.code,message:e.message||"",requestId:e.requestId}:{code:"UNKNOWN_ERROR",message:String((null==e?void 0:e.message)||e||"")}}function Y(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)}var X=function(e){return void 0===e&&(e=0),new Promise(function(t){return setTimeout(t,e)})};function Q(e){return"+86".concat(e)}var Z=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};function ee(e){var t={},n=e.match(/^(data:.*?)(\?[^#\s]*)?$/);if(n){e=n[1];var r=n[2];r&&(t=Z(r))}var o=t.token,i=x(t,["token"]);return/^data:/.test(e)&&!o?{error:"invalid_argument",error_description:"invalid captcha data: ".concat(e)}:o?{state:i.state,token:o,captchaData:e}:{error:"unimplemented",error_description:"need to impl captcha data"}}var te,ne=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)}}(),re=function(){return re=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},re.apply(this,arguments)},oe=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())})},ie=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])}}},ae=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 ne(t,e),t.prototype.get=function(e){return this.request(re(re({},e),{method:"get"}),this.restrictedMethods.includes("get"))},t.prototype.post=function(e){return this.request(re(re({},e),{method:"post"}),this.restrictedMethods.includes("post"))},t.prototype.put=function(e){return this.request(re(re({},e),{method:"put"}))},t.prototype.upload=function(e){var t=e.data,n=e.file,r=e.name,o=e.method,i=e.headers,a=void 0===i?{}:i,s={post:"post",put:"put"}[null==o?void 0:o.toLowerCase()]||"put",c=new FormData;return"post"===s?(Object.keys(t).forEach(function(e){c.append(e,t[e])}),c.append("key",r),c.append("file",n),this.request(re(re({},e),{data:c,method:s}),this.restrictedMethods.includes("upload"))):this.request(re(re({},e),{method:"put",headers:a,body:n}),this.restrictedMethods.includes("upload"))},t.prototype.download=function(e){return oe(this,void 0,Promise,function(){var t,n,r,o;return ie(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.get(re(re({},e),{headers:{},responseType:"blob"}))];case 1:return t=i.sent().data,n=window.URL.createObjectURL(new Blob([t])),r=decodeURIComponent(new URL(e.url).pathname.split("/").pop()||""),(o=document.createElement("a")).href=n,o.setAttribute("download",r),o.style.display="none",document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(n),document.body.removeChild(o),[3,3];case 2:return i.sent(),[3,3];case 3:return[2,new Promise(function(t){t({statusCode:200,tempFilePath:e.url})})]}})})},t.prototype.fetch=function(e){var t;return oe(this,void 0,Promise,function(){var n,r,o,i,a,s,c,u,l,p,d,h,f,m=this;return ie(this,function(v){switch(v.label){case 0:return n=new AbortController,r=e.url,o=e.enableAbort,i=void 0!==o&&o,a=e.stream,s=void 0!==a&&a,c=e.signal,u=e.timeout,l=e.shouldThrowOnError,p=void 0===l||l,d=null!=u?u:this.timeout,c&&(c.aborted&&n.abort(),c.addEventListener("abort",function(){return n.abort()})),h=null,i&&d&&(h=setTimeout(function(){console.warn(m.timeoutMsg),n.abort(new Error(m.timeoutMsg))},d)),[4,fetch(r,re(re({},e),{signal:n.signal})).then(function(e){return oe(m,void 0,void 0,function(){var t,n,r;return ie(this,function(o){switch(o.label){case 0:return clearTimeout(h),p?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(h),Promise.reject(e)})];case 1:return f=v.sent(),[2,{data:s?f.body:(null===(t=f.headers.get("content-type"))||void 0===t?void 0:t.includes("application/json"))?f.json():f.text(),statusCode:f.status,header:f.headers,response:f}]}})})},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,u=e.responseType,l=e.withCredentials,p=e.body,d=e.onUploadProgress,f=k(h,i,"get"===r?c:{}),m=new XMLHttpRequest;m.open(r,f),u&&(m.responseType=u);var v,y,g=e.signal;g&&(g.aborted?m.abort():g.addEventListener("abort",function(){return m.abort()},{once:!0})),Object.keys(s).forEach(function(e){m.setRequestHeader(e,s[e])}),d&&m.upload.addEventListener("progress",d),m.onreadystatechange=function(){var e={};if(4===m.readyState){var t=m.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=m.status;try{e.data="blob"===u?m.response:JSON.parse(m.responseText)}catch(t){e.data="blob"===u?m.response:m.responseText}clearTimeout(v),o(e)}},t&&n.timeout&&(v=setTimeout(function(){console.warn(n.timeoutMsg),m.abort()},n.timeout)),y=P(c)?c:"application/x-www-form-urlencoded"===s["content-type"]?N(c):p||(c?JSON.stringify(c):void 0),l&&(m.withCredentials=!0),m.send(y)})},t}(b.AbstractSDKRequest),se=function(){return se=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},se.apply(this,arguments)};function ce(e,t){for(var n=0,r=E(e)?e:[e];n<r.length;n++){var o=r[n],i=o.isMatch,a=o.genAdapter,s=o.runtime;if(i())return{adapter:se({isMatch:i},a(t)),runtime:s}}}function ue(){return{adapter:se({},{type:"default",root:window,reqClass:ae,wsClass:WebSocket,localStorage}),runtime:te.WEB}}!function(e){e.WEB="web",e.WX_MP="wx_mp"}(te||(te={}));var le=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)}}(),pe=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())})},de=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])}}},he=function(e){function t(t){var n=e.call(this)||this;return n.root=t,t.tcbCacheObject||(t.tcbCacheObject={}),n}return le(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}(b.AbstractStorage),fe=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:(M(g.INVALID_PARAMS,"localStorage is not supported on current platform"),new he(t.root));case"none":return new he(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:g.OPERATION_FAIL,msg:"[".concat(d(),"][").concat(g.OPERATION_FAIL,"]setStore failed"),info:e}))}}else M(g.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},e.prototype.setStoreAsync=function(e,t,n){return pe(this,void 0,void 0,function(){var r;return de(this,function(o){switch(o.label){case 0:if(!this.storage)return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),r={version:n||"localCachev1",content:t},[4,this.storage.setItem(e,JSON.stringify(r))];case 2:return o.sent(),[3,4];case 3:return o.sent(),[2];case 4:return[2]}})})},e.prototype.getStore=function(e,t){var n;if("async"!==this.mode){try{if("undefined"!=typeof process&&(null===(n=process.env)||void 0===n?void 0:n.tcb_token))return process.env.tcb_token;if(!this.storage)return""}catch(e){return""}t=t||"localCachev1";var r=this.storage.getItem(e);return r&&r.indexOf(t)>=0?JSON.parse(r).content:""}M(g.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},e.prototype.getStoreAsync=function(e,t){var n;return pe(this,void 0,void 0,function(){var r;return de(this,function(o){switch(o.label){case 0:try{if("undefined"!=typeof process&&(null===(n=process.env)||void 0===n?void 0:n.tcb_token))return[2,process.env.tcb_token];if(!this.storage)return[2,""]}catch(e){return[2,""]}return t=t||"localCachev1",[4,this.storage.getItem(e)];case 1:return(r=o.sent())&&r.indexOf(t)>=0?[2,JSON.parse(r).content]:[2,""]}})})},e.prototype.removeStore=function(e){"async"!==this.mode?this.storage.removeItem(e):M(g.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},e.prototype.removeStoreAsync=function(e){return pe(this,void 0,void 0,function(){return de(this,function(t){switch(t.label){case 0:return[4,this.storage.removeItem(e)];case 1:return t.sent(),[2]}})})},e}(),me=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)}}(),ve=function(e,t){this.data=t||null,this.name=e},ye=function(e){function t(t,n){var r=e.call(this,"error",{error:t,data:n})||this;return r.error=t,r}return me(t,e),t}(ve),ge=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(A(e,ye))return console.error(e.error),this;var n=I(e)?new ve(e,t||{}):e,r=n.name;if(this.listens(r)){n.target=this;for(var o=0,i=this.listeners[r]?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))}([],this.listeners[r],!0):[];o<i.length;o++)i[o].call(this,n)}return this},e.prototype.listens=function(e){return this.listeners[e]&&this.listeners[e].length>0},e}();new ge;var be=new ge,we="lang_change",_e=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())})},xe=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])}}},Ee=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(Ee=-1!==navigator.userAgent.indexOf("Firefox"));var Ie=Ee?/(\.js\/)?__decorate(\$\d+)?<@.*\d$/:/(\/\w+\.js\.)?__decorate(\$\d+)?\s*\(.*\)$/,Se=/https?:\/\/.+:\d*\/.*\.js:\d+:\d+/;function Oe(e){var t=e.mode,n=void 0===t?"async":t,r=e.customInfo,o=void 0===r?{}:r,i=e.title,a=e.messages,s=void 0===a?[]:a;return function(e,t,r){if(v){var a=o.className||e.constructor.name,c=o.methodName||t,u=r.value,l=function(){var e="",t=(new Error).stack.split("\n"),n=t.findIndex(function(e){return Ie.test(e)});if(-1!==n){var r=Se.exec(t[n+1]||"");e=r?r[0]:""}return e}();r.value="sync"===n?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Te({err:new Error,className:a,methodName:c,sourceLink:l});try{return u.apply(this,e)}catch(e){var r=e,o=e.message,p=e.error,d=e.error_description,h={title:i||"".concat(a,".").concat(c," failed"),content:[{type:"error",body:e}]};if(o&&/^\{.*\}$/.test(o)){var f=JSON.parse(o);h.subtitle=o,f.code&&(n?(n.code=f.code,n.msg=f.msg):(e.code=f.code,e.message=f.msg),r=n||e,h.content=s.map(function(e){return{type:"info",body:e}}))}throw p&&d&&(h.subtitle=d,n?(n.code=p,n.msg=d):(e.code=p,e.message=d),r=n||e,h.content=s.map(function(e){return{type:"info",body:e}})),Y(h),r}}:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return _e(this,void 0,void 0,function(){var t,n,r,o,p,d,h,f;return xe(this,function(m){switch(m.label){case 0:t=Te({err:new Error,className:a,methodName:c,sourceLink:l}),m.label=1;case 1:return m.trys.push([1,3,,4]),[4,u.apply(this,e)];case 2:return[2,m.sent()];case 3:throw n=m.sent(),r=n,o=n.message,p=n.error,d=n.error_description,h={title:i||"".concat(a,".").concat(c," failed"),content:[{type:"error",body:n}]},o&&/^\{.*\}$/.test(o)&&(f=JSON.parse(o),h.subtitle=f,f.code&&(t?(t.code=f.code,t.message=f.msg):(n.code=f.code,n.message=f.msg),r=t||n,h.content=s.map(function(e){return{type:"info",body:e}}))),p&&d&&(h.subtitle=d,t?(t.code=p,t.msg=d):(n.code=p,n.message=d),r=t||n,h.content=s.map(function(e){return{type:"info",body:e}})),Y(h),r;case 4:return[2]}})})}}}}function Te(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"),s=Ee?/^catchErrorsDecorator\/<\/descriptor.value@.*\d$/:new RegExp("".concat(n,"\\.descriptor.value\\s*\\[as\\s").concat(r,"\\]\\s*\\(.*\\)$")),c=Ee?/^catchErrorsDecorator\/<\/descriptor.value/:new RegExp("".concat(n,"\\.descriptor.value\\s*\\[as\\s").concat(r,"\\]")),u=a.findIndex(function(e){return s.test(e)});if(-1!==u){var l=a.filter(function(e,t){return t>u});l.unshift(a[u].replace(c,"".concat(n,".").concat(r)).replace(Se,o)),(i=new Error).stack="".concat(Ee?"@debugger":"Error","\n").concat(l.join("\n"))}return i}Ae={default:()=>__WEBPACK_EXTERNAL_MODULE_jwt_decode_b659f100__.default},Pe={},n.d(Pe,Ae);var Ae,Pe},3388:e=>{e.exports={}},8182:function(e,t,n){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){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(7149),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,y,g=this;return s(this,function(b){switch(b.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(g.timeoutMsg),n.abort(new Error(g.timeoutMsg))},m)),[4,fetch(r,i(i({},e),{signal:n.signal})).then(function(e){return a(g,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 y=b.sent(),[2,{data:l?y.body:(null===(t=y.headers.get("content-type"))||void 0===t?void 0:t.includes("application/json"))?y.json():y.text(),statusCode:y.status,header:y.headers,response:y}]}})})},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 y,g,b=e.signal;b&&(b.aborted?v.abort():b.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(y),o(e)}},t&&n.timeout&&(y=setTimeout(function(){console.warn(n.timeoutMsg),v.abort()},n.timeout)),g=(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(g)})},t}(c.AbstractSDKRequest);t.WebRequest=p,t.genAdapter=function(){return{type:"default",root:window,reqClass:p,wsClass:WebSocket,localStorage}}},2946:(e,t)=>{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=("undefined"==typeof process||process.env,!1),t.COMMUNITY_SITE_URL="https://support.qq.com/products/148793"},6205:(e,t)=>{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){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){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,y=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:y});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:y}),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){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){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(7149),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=process.env)||void 0===n?void 0:n.tcb_token))return process.env.tcb_token;if(!this.storage)return""}catch(e){return""}t=t||"localCachev1";var r=this.storage.getItem(e);return r&&r.indexOf(t)>=0?JSON.parse(r).content:""}(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=process.env)||void 0===n?void 0:n.tcb_token))return[2,process.env.tcb_token];if(!this.storage)return[2,""]}catch(e){return[2,""]}return t=t||"localCachev1",[4,this.storage.getItem(e)];case 1:return(r=o.sent())&&r.indexOf(t)>=0?[2,JSON.parse(r).content]:[2,""]}})})},e.prototype.removeStore=function(e){"async"!==this.mode?this.storage.removeItem(e):(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){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){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.__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.errorToResult=t.promoteGatewayError=t.maybeThrow=t.resolveThrow=t.createCloudbaseError=t.CloudbaseError=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 s=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,s.getSdkName)(),"][").concat(e,"]:").concat(t))},t.printError=function(e,t){console.error({code:e,msg:"[".concat((0,s.getSdkName)(),"][").concat(e,"]:").concat(t)})},t.printInfo=function(e,t){console.log("[".concat((0,s.getSdkName)(),"][").concat(e,"]:").concat(t))},t.throwError=function(e,t){var n=new Error(JSON.stringify({code:e,msg:"[".concat((0,s.getSdkName)(),"][").concat(e,"]:").concat(t)}));throw n.code=e,n};var c=function(e){function t(t){var n=e.call(this,t.msg||t.message||"")||this;return n.code=t.code||"",n.requestId=t.requestId||"",Object.defineProperty(n,"message",{value:t.msg||t.message||"",enumerable:!0,writable:!0,configurable:!0}),n}return o(t,e),t}(Error);t.CloudbaseError=c;var u=function(e){return new c(e)};function l(e,t){return(t||u)(e)}function p(e){return!e||"boolean"!=typeof e.throw||e.throw}t.createCloudbaseError=l,t.resolveThrow=p,t.maybeThrow=function(e,t){if(p(e))throw l(t,null==e?void 0:e.errorFactory);return i({code:t.code,message:t.msg},t.requestId?{requestId:t.requestId}:{})},t.promoteGatewayError=function(e){if(e&&"object"==typeof e&&e.data&&"object"==typeof e.data){var t=e.data,n=t.code,r=t.message;if(!e.code&&n||!e.message&&r)return i(i(i({},e),!e.code&&n?{code:n}:{}),!e.message&&r?{message:r}:{})}return e},t.errorToResult=function(e){if(e instanceof Error&&"string"==typeof e.message)try{var t=JSON.parse(e.message);if(t&&"string"==typeof t.code)return{code:t.code,message:t.msg||t.message||"",requestId:t.requestId}}catch(e){}return e&&"string"==typeof e.code?{code:e.code,message:e.message||"",requestId:e.requestId}:{code:"UNKNOWN_ERROR",message:String((null==e?void 0:e.message)||e||"")}},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={},r=e.match(/^(data:.*?)(\?[^#\s]*)?$/);if(r){e=r[1];var o=r[2];o&&(n=(0,t.parseQueryString)(o))}var i=n.token,s=a(n,["token"]);return/^data:/.test(e)&&!i?{error:"invalid_argument",error_description:"invalid captcha data: ".concat(e)}:i?{state:s.state,token:i,captchaData:e}:{error:"unimplemented",error_description:"need to impl captcha data"}}},9919:(e,t,n)=>{var r=n(4090),o=n(9638),i=n(8418),a=n(6476);e.exports=a||r.call(i,o)},9638:e=>{e.exports=Function.prototype.apply},8418:e=>{e.exports=Function.prototype.call},8381:(e,t,n)=>{var r=n(4090),o=n(5408),i=n(8418),a=n(9919);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new o("a function is required");return a(r,i,e)}},6476:e=>{e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},6160:(e,t,n)=>{var r=n(921),o=n(8331).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(8331).Stream,o=n(921);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))}}},5141:(e,t,n)=>{var r,o=n(8381),i=n(9873);try{r=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var a=!!r&&i&&i(Object.prototype,"__proto__"),s=Object,c=s.getPrototypeOf;e.exports=a&&"function"==typeof a.get?o([a.get]):"function"==typeof c&&function(e){return c(null==e?e:s(e))}},999:e=>{var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},9654:e=>{e.exports=EvalError},2321:e=>{e.exports=Error},8205:e=>{e.exports=RangeError},9209:e=>{e.exports=ReferenceError},8342:e=>{e.exports=SyntaxError},5408:e=>{e.exports=TypeError},2885:e=>{e.exports=URIError},4546:e=>{e.exports=Object},8677:(e,t,n)=>{var r=n(7286)("%Object.defineProperty%",!0),o=n(7226)(),i=n(2196),a=n(5408),s=o?Symbol.toStringTag:null;e.exports=function(e,t){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(void 0!==n&&"boolean"!=typeof n||void 0!==o&&"boolean"!=typeof o)throw new a("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");!s||!n&&i(e,s)||(r?r(e,s,{configurable:!o,enumerable:!1,value:t,writable:!1}):e[s]=t)}},1191:(e,t,n)=>{var r=n(6160),o=n(921),i=n(6794),a=n(8100),s=n(6662),c=n(9657).parse,u=n(2539),l=n(8331).Stream,p=n(1047),d=n(6856),h=n(9954),f=n(8677),m=n(2196),v=n(5488);function y(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}function g(e){if(!(this instanceof g))return new g(e);for(var t in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],r.call(this),e=e||{})this[t]=e[t]}o.inherits(g,r),g.LINE_BREAK="\r\n",g.DEFAULT_CONTENT_TYPE="application/octet-stream",g.prototype.append=function(e,t,n){"string"==typeof(n=n||{})&&(n={filename:n});var o=r.prototype.append.bind(this);if("number"!=typeof t&&null!=t||(t=String(t)),Array.isArray(t))this._error(new Error("Arrays are not supported."));else{var i=this._multiPartHeader(e,t,n),a=this._multiPartFooter();o(i),o(t),o(a),this._trackLength(i,t,n)}},g.prototype._trackLength=function(e,t,n){var r=0;null!=n.knownLength?r+=Number(n.knownLength):Buffer.isBuffer(t)?r=t.length:"string"==typeof t&&(r=Buffer.byteLength(t)),this._valueLength+=r,this._overheadLength+=Buffer.byteLength(e)+g.LINE_BREAK.length,t&&(t.path||t.readable&&m(t,"httpVersion")||t instanceof l)&&(n.knownLength||this._valuesToMeasure.push(t))},g.prototype._lengthRetriever=function(e,t){m(e,"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){if(n)t(n);else{var o=r.size-(e.start?e.start:0);t(null,o)}}):m(e,"httpVersion")?t(null,Number(e.headers["content-length"])):m(e,"httpModule")?(e.on("response",function(n){e.pause(),t(null,Number(n.headers["content-length"]))}),e.resume()):t("Unknown stream")},g.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="'+y(e)+'"'].concat(o||[]),"Content-Type":[].concat(i||[])};for(var c in"object"==typeof n.header&&v(s,n.header),s)if(m(s,c)){if(null==(r=s[c]))continue;Array.isArray(r)||(r=[r]),r.length&&(a+=c+": "+r.join("; ")+g.LINE_BREAK)}return"--"+this.getBoundary()+g.LINE_BREAK+a+g.LINE_BREAK},g.prototype._getContentDisposition=function(e,t){var n;if("string"==typeof t.filepath?n=i.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?n=i.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&m(e,"httpVersion")&&(n=i.basename(e.client._httpMessage.path||"")),n)return'filename="'+y(n)+'"'},g.prototype._getContentType=function(e,t){var n=t.contentType;return!n&&e&&e.name&&(n=d.lookup(e.name)),!n&&e&&e.path&&(n=d.lookup(e.path)),!n&&e&&e.readable&&m(e,"httpVersion")&&(n=e.headers["content-type"]),n||!t.filepath&&!t.filename||(n=d.lookup(t.filepath||t.filename)),!n&&e&&"object"==typeof e&&(n=g.DEFAULT_CONTENT_TYPE),n},g.prototype._multiPartFooter=function(){return function(e){var t=g.LINE_BREAK;0===this._streams.length&&(t+=this._lastBoundary()),e(t)}.bind(this)},g.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+g.LINE_BREAK},g.prototype.getHeaders=function(e){var t,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)m(e,t)&&(n[t.toLowerCase()]=e[t]);return n},g.prototype.setBoundary=function(e){if("string"!=typeof e)throw new TypeError("FormData boundary must be a string");this._boundary=e},g.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},g.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(g.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},g.prototype._generateBoundary=function(){this._boundary="--------------------------"+p.randomBytes(12).toString("hex")},g.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},g.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},g.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;this._streams.length&&(t+=this._lastBoundary().length),this._valuesToMeasure.length?h.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))},g.prototype.submit=function(e,t){var n,r,o={method:"post"};return"string"==typeof e?(e=c(e),r=v({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(r=v(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},g.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},g.prototype.toString=function(){return"[object FormData]"},f(g.prototype,"FormData"),e.exports=g},5488:e=>{e.exports=function(e,t){return Object.keys(t).forEach(function(n){e[n]=e[n]||t[n]}),e}},7795:e=>{var t=Object.prototype.toString,n=Math.max,r=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var o=0;o<t.length;o+=1)n[o+e.length]=t[o];return n};e.exports=function(e){var o=this;if("function"!=typeof o||"[object Function]"!==t.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var i,a=function(e){for(var t=[],n=1,r=0;n<e.length;n+=1,r+=1)t[r]=e[n];return t}(arguments),s=n(0,o.length-a.length),c=[],u=0;u<s;u++)c[u]="$"+u;if(i=Function("binder","return function ("+function(e){for(var t="",n=0;n<e.length;n+=1)t+=e[n],n+1<e.length&&(t+=",");return t}(c)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var t=o.apply(this,r(a,arguments));return Object(t)===t?t:this}return o.apply(e,r(a,arguments))}),o.prototype){var l=function(){};l.prototype=o.prototype,i.prototype=new l,l.prototype=null}return i}},4090:(e,t,n)=>{var r=n(7795);e.exports=Function.prototype.bind||r},5462:e=>{const t=function*(){}.constructor;e.exports=()=>t},7286:(e,t,n)=>{var r,o=n(4546),i=n(2321),a=n(9654),s=n(8205),c=n(9209),u=n(8342),l=n(5408),p=n(2885),d=n(4383),h=n(5736),f=n(7130),m=n(2400),v=n(3654),y=n(6890),g=n(2026),b=n(9873),w=n(999),_=function(){throw new l},x=b?function(){try{return _}catch(e){try{return b(arguments,"callee").get}catch(e){return _}}}():_,E=n(2636)(),I=n(1750),S=n(2938),O=n(8354),T=n(9638),A=n(8418),P={},C="undefined"!=typeof Uint8Array&&I?I(Uint8Array):r,R={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":E&&I?I([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":P,"%AsyncGenerator%":P,"%AsyncGeneratorFunction%":P,"%AsyncIteratorPrototype%":P,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":"undefined"==typeof Float16Array?r:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":Function,"%GeneratorFunction%":P,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&I?I(I([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&E&&I?I((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":s,"%ReferenceError%":c,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&E&&I?I((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&I?I(""[Symbol.iterator]()):r,"%Symbol%":E?Symbol:r,"%SyntaxError%":u,"%ThrowTypeError%":x,"%TypedArray%":C,"%TypeError%":l,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":p,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet,"%Function.prototype.call%":A,"%Function.prototype.apply%":T,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":S,"%Math.abs%":d,"%Math.floor%":h,"%Math.max%":f,"%Math.min%":m,"%Math.pow%":v,"%Math.round%":y,"%Math.sign%":g,"%Reflect.getPrototypeOf%":O};if(I)try{null.error}catch(e){var k=I(I(e));R["%Error.prototype%"]=k}var N=n(635),j=n(5462),L=n(7350),U=function e(t){var n;if("%AsyncFunction%"===t)n=N()||void 0;else if("%GeneratorFunction%"===t)n=j()||void 0;else if("%AsyncGeneratorFunction%"===t)n=L()||void 0;else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&I&&(n=I(o.prototype))}return R[t]=n,n},D={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},q=n(4090),M=n(2196),B=q.call(A,Array.prototype.concat),F=q.call(T,Array.prototype.splice),W=q.call(A,String.prototype.replace),G=q.call(A,String.prototype.slice),V=q.call(A,RegExp.prototype.exec),H=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,z=/\\(\\)?/g,K=function(e,t){var n,r=e;if(M(D,r)&&(r="%"+(n=D[r])[0]+"%"),M(R,r)){var o=R[r];if(o===P&&(o=U(r)),void 0===o&&!t)throw new l("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new u("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new l('"allowMissing" argument must be a boolean');if(null===V(/^%?[^%]*%?$/,e))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=G(e,0,1),n=G(e,-1);if("%"===t&&"%"!==n)throw new u("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new u("invalid intrinsic syntax, expected opening `%`");var r=[];return W(e,H,function(e,t,n,o){r[r.length]=n?W(o,z,"$1"):t||e}),r}(e),r=n.length>0?n[0]:"",o=K("%"+r+"%",t),i=o.name,a=o.value,s=!1,c=o.alias;c&&(r=c[0],F(n,B([0,1],c)));for(var p=1,d=!0;p<n.length;p+=1){var h=n[p],f=G(h,0,1),m=G(h,-1);if(('"'===f||"'"===f||"`"===f||'"'===m||"'"===m||"`"===m)&&f!==m)throw new u("property names with quotes must have matching quotes");if("constructor"!==h&&d||(s=!0),M(R,i="%"+(r+="."+h)+"%"))a=R[i];else if(null!=a){if(!(h in a)){if(!t)throw new l("base intrinsic for "+e+" exists, but the property is not available.");return}if(b&&p+1>=n.length){var v=b(a,h);a=(d=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:a[h]}else d=M(a,h),a=a[h];d&&!s&&(R[i]=a)}}return a}},2938:(e,t,n)=>{var r=n(4546);e.exports=r.getPrototypeOf||null},8354:e=>{e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},1750:(e,t,n)=>{var r=n(8354),o=n(2938),i=n(5141);e.exports=r?function(e){return r(e)}:o?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return o(e)}:i?function(e){return i(e)}:null},3165:e=>{e.exports=Object.getOwnPropertyDescriptor},9873:(e,t,n)=>{var r=n(3165);if(r)try{r([],"length")}catch(e){r=null}e.exports=r},2636:(e,t,n)=>{var r="undefined"!=typeof Symbol&&Symbol,o=n(6679);e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&o()}},6679:e=>{e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(var r in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},7226:(e,t,n)=>{var r=n(6679);e.exports=function(){return r()&&!!Symbol.toStringTag}},2196:(e,t,n)=>{var r=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=n(4090);e.exports=i.call(r,o)},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(2344),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),y=n(8725),g=n(6152),b=n(3226),w=n(4714),_=n(9259),x=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,k){var N,j=1&n,L=2&n,U=4&n;if(P&&(N=R?P(t,C,R,k):P(t)),void 0!==N)return N;if(!_(t))return t;var D=g(t);if(D){if(N=m(t),!j)return u(t,N)}else{var q=f(t),M=q==O||"[object GeneratorFunction]"==q;if(b(t))return c(t,j);if(q==T||q==S||M&&!R){if(N=L||M?{}:y(t),!j)return L?p(t,s(N,t)):l(t,a(N,t))}else{if(!A[q])return R?t:{};N=v(t,q,j)}}k||(k=new r);var B=k.get(t);if(B)return B;k.set(t,N),x(t)?t.forEach(function(r){N.add(e(r,n,P,r,t,k))}):w(t)&&t.forEach(function(r,o){N.set(o,e(r,n,P,o,t,k))});var F=D?void 0:(U?L?h:d:L?I:E)(t);return o(F||t,function(r,o){F&&(r=t[o=r]),i(N,o,e(r,n,P,o,t,k))}),N}},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),s=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=-1,c=(t=r(t,e)).length;if(!c)return!0;for(;++n<c;){var u=a(t[n]);if("__proto__"===u&&!s.call(e,"__proto__"))return!1;if(("constructor"===u||"prototype"===u)&&n<c-1)return!1}var l=i(e,t);return null==l||delete l[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),y=u(i),g=u(a),b=u(s),w=c;(r&&w(new r(new ArrayBuffer(1)))!=f||o&&w(new o)!=l||i&&w(i.resolve())!=p||a&&w(new a)!=d||s&&w(new s)!=h)&&(w=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 y:return p;case g:return d;case b:return h}return t}),e.exports=w},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=n??9007199254740991)&&("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]}},2344:(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)}},4383:e=>{e.exports=Math.abs},5736:e=>{e.exports=Math.floor},8806:e=>{e.exports=Number.isNaN||function(e){return e!=e}},7130:e=>{e.exports=Math.max},2400:e=>{e.exports=Math.min},3654:e=>{e.exports=Math.pow},6890:e=>{e.exports=Math.round},2026:(e,t,n)=>{var r=n(8806);e.exports=function(e){return r(e)||0===e?e:e<0?-1:1}},9474:(e,t,n)=>{e.exports=n(7104)},6856:(e,t,n)=>{var r,o,i,a=n(9474),s=n(6794).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}}})},7149:e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__cloudbase_adapter_interface_74717cc6__},1047:e=>{e.exports=__WEBPACK_EXTERNAL_MODULE_node_crypto_803ecaf5__},2539:e=>{e.exports=__WEBPACK_EXTERNAL_MODULE_node_fs_75ed2103__},8100:e=>{e.exports=__WEBPACK_EXTERNAL_MODULE_node_http_b674be28__},6662:e=>{e.exports=__WEBPACK_EXTERNAL_MODULE_node_https_b78f5be9__},6794:e=>{e.exports=__WEBPACK_EXTERNAL_MODULE_node_path_02319fef__},8331:(e,t,n)=>{var r,o;e.exports=(r={Stream:()=>__WEBPACK_EXTERNAL_MODULE_node_stream_62980834__.Stream},o={},n.d(o,r),o)},9657:(e,t,n)=>{var r,o;e.exports=(r={parse:()=>__WEBPACK_EXTERNAL_MODULE_node_url_da953c0c__.parse},o={},n.d(o,r),o)},921:e=>{e.exports=__WEBPACK_EXTERNAL_MODULE_node_util_1f093676__},3408:(e,t,n)=>{var r,o;e.exports=(r={ReadableStream:()=>__WEBPACK_EXTERNAL_MODULE_web_streams_polyfill_c4c9f3ad__.ReadableStream,TransformStream:()=>__WEBPACK_EXTERNAL_MODULE_web_streams_polyfill_c4c9f3ad__.TransformStream},o={},n.d(o,r),o)},7104:e=>{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}}')}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};(()=>{__webpack_require__.d(__webpack_exports__,{Z:()=>dp});var e={};__webpack_require__.r(e);var t={};__webpack_require__.r(t),__webpack_require__.d(t,{ArkSimpleModel:()=>vs,DSSimpleModel:()=>_s,DefaultImageModel:()=>Ys,DefaultSimpleModel:()=>Ks,HunYuanBetaSimpleModel:()=>ss,HunYuanExpSimpleModel:()=>Ls,HunYuanOpenSimpleModel:()=>Ms,HunYuanSimpleModel:()=>ps,MODELS:()=>uc,MoonshotSimpleModel:()=>Rs,ReactModel:()=>nc,YiSimpleModel:()=>Os,ZhiPuSimpleModel:()=>es,toolMap:()=>ic});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{LineString:()=>xu,MultiLineString:()=>Tu,MultiPoint:()=>Su,MultiPolygon:()=>Pu,Point:()=>Zu,Polygon:()=>Iu});var r=__webpack_require__(2976),o=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))},i=r._G.Sg,a={};function s(e,t){var n=t.name,r=t.namespace,s=t.entity,u=t.injectEvents,l=t.IIFE,p=void 0!==l&&l;if(a[n]||r&&e[r])throw new Error(JSON.stringify({code:i.INVALID_OPERATION,msg:"Duplicate component ".concat(n)}));if(p){if(!s||"function"!=typeof s)throw new Error(JSON.stringify({code:i.INVALID_PARAMS,msg:"IIFE component's entity must be a function"}));s.call(e)}if(a[n]=t,r?e.prototype[r]=s:c(e.prototype,s),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=o(o([],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}}}}}function c(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]=c(e[o],t[o]))}return e}const u=(l={WxMpWebSocket:()=>__WEBPACK_EXTERNAL_MODULE__cloudbase_adapter_wx_mp_8d967865__.WxMpWebSocket,WxRequest:()=>__WEBPACK_EXTERNAL_MODULE__cloudbase_adapter_wx_mp_8d967865__.WxRequest,default:()=>__WEBPACK_EXTERNAL_MODULE__cloudbase_adapter_wx_mp_8d967865__.default,parseQueryString:()=>__WEBPACK_EXTERNAL_MODULE__cloudbase_adapter_wx_mp_8d967865__.parseQueryString,wxMpStorage:()=>__WEBPACK_EXTERNAL_MODULE__cloudbase_adapter_wx_mp_8d967865__.wxMpStorage},p={},__webpack_require__.d(p,l),p);var l,p,d=__webpack_require__(7149),h=function(){return h=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},h.apply(this,arguments)},f={},m=function(){return m=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},m.apply(this,arguments)},v=r.Fs.q,y={},g={};function b(e){var t=e.env,n=e.platformInfo,r={userInfoKey:"".concat("user_info","_").concat(t)};y[t]=y[t]||new v(m(m({},e),{keys:r,platformInfo:n})),g[t]=g[t]||new v(m(m({},e),{keys:r,platformInfo:n,persistence:"local"}))}function w(e){return g[e]}var _=__webpack_require__(7922),x=function(){return x=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},x.apply(this,arguments)},E=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=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])}}},S=r._G.Sg,O=r.P6.genSeqId,T=r.P6.isFormData,A=r.P6.formatUrl,P=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"];function C(e,t,n){var r=e[t];e[t]=function(t){var o={},i={};n.forEach(function(n){var r=n.call(e,t),a=r.data,s=r.headers;Object.assign(o,a),Object.assign(i,s)});var a=t.data;return a&&(T(a)?Object.keys(o).forEach(function(e){a.append(e,o[e])}):t.data=x(x({},a),o)),t.headers=x(x({},t.headers||{}),i),r.call(e,t)}}function R(){var e=O();return{data:{seqId:e},headers:{"X-SDK-Version":"@cloudbase/js-sdk/".concat((0,_.mI)()),"x-seqid":e}}}var k,N,j=function(){function e(e){var t=this;this.config=e;var n={env:this.config.env,region:this.config.region,accessKey:this.config.accessKey,context:this.config.context,auth:this.config.auth,timeout:this.config.timeout,timeoutMsg:"[@cloudbase/js-sdk] 请求在".concat(this.config.timeout/1e3,"s内未完成,已中断"),restrictedMethods:["post","put"]};this.reqClass=new f.adapter.reqClass(n),this.localCache=w(this.config.env),"GATEWAY"!==this.config.endPointMode&&(C(this.reqClass,"post",[R]),C(this.reqClass,"upload",[R]),C(this.reqClass,"download",[R])),r.RR.$.on(r.RR.P,function(e){var n;t.config.i18n=(null===(n=e.data)||void 0===n?void 0:n.i18n)||t.config.i18n})}return Object.defineProperty(e.prototype,"throwWhenRequestFail",{get:function(){var e,t,n,r,o=null===(n=null===(t=null===(e=this.config)||void 0===e?void 0:e._fromApp)||void 0===t?void 0:t.config)||void 0===n?void 0:n.throw;return"boolean"==typeof o?o:!1!==(null===(r=this.config)||void 0===r?void 0:r.throw)},enumerable:!1,configurable:!0}),e.prototype.getAccessToken=function(e){return void 0===e&&(e=null),E(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,_.mI)()),e},e.prototype.post=function(e,t){return E(this,void 0,Promise,function(){return I(this,function(n){switch(n.label){case 0:return[4,this.reqClass.post(x(x({},e),{headers:x(x({},e.headers),this.getDefaultHeaders()),customReqOpts:t}))];case 1:return[2,n.sent()]}})})},e.prototype.upload=function(e){return E(this,void 0,Promise,function(){return I(this,function(t){switch(t.label){case 0:return[4,this.reqClass.upload(x(x({},e),{headers:x(x({},e.headers),this.getDefaultHeaders())}))];case 1:return[2,t.sent()]}})})},e.prototype.download=function(e){return E(this,void 0,Promise,function(){return I(this,function(t){switch(t.label){case 0:return[4,this.reqClass.download(x(x({},e),{headers:x(x({},e.headers),this.getDefaultHeaders())}))];case 1:return[2,t.sent()]}})})},e.prototype.getBaseEndPoint=function(e){return void 0===e&&(e="CLOUD_API"),(0,_.M4)(this.config.env,e)},e.prototype.getOauthAccessTokenV2=function(e){return E(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,r){var o,i;return E(this,void 0,Promise,function(){var a,s,c,u,l,p,d,h,f,m,v,y,g,b,w,E,S,O,T,C,R,k,N;return I(this,function(I){switch(I.label){case 0:if(I.trys.push([0,4,,5]),a="x-tcb-trace_".concat(this.config.env),s="application/x-www-form-urlencoded",c=x({action:e,dataVersion:_.n0,env:this.config.env},t),-1!==P.indexOf(e))return[3,2];if(!(u=this.config._fromApp).oauthInstance)throw new Error("you can't request without auth");return l=u.oauthInstance,p=l.oauth2client,d=c,[4,this.getOauthAccessTokenV2(p)];case 1:d.access_token=I.sent().accessToken,I.label=2;case 2:return"storage.uploadFile"===e?(h=new FormData,Object.keys(h).forEach(function(e){Object.prototype.hasOwnProperty.call(h,e)&&void 0!==h[e]&&h.append(e,c[e])}),s="multipart/form-data"):(s="application/json;charset=UTF-8",h={},Object.keys(c).forEach(function(e){void 0!==c[e]&&(h[e]=c[e])})),f={headers:x(x({"content-type":s},this.getDefaultHeaders()),null==n?void 0:n.headers)},(null==n?void 0:n.onUploadProgress)&&(f.onUploadProgress=n.onUploadProgress),this.config.region&&(f.headers["X-TCB-Region"]=this.config.region),(m=this.localCache.getStore(a))&&(f.headers["X-TCB-Trace"]=m),v=void 0!==(null==n?void 0:n.parse)?n.parse:t.parse,y=void 0!==(null==n?void 0:n.inQuery)?n.inQuery:t.inQuery,g=void 0!==(null==n?void 0:n.search)?n.search:t.search,b=x(x({},(null==n?void 0:n.defaultQuery)||{}),{env:this.config.env}),v&&(b.parse=!0),y&&(b=x(x({},y),b)),w=(null==n?void 0:n.endPointMode)||this.config.endPointMode||"CLOUD_API",E=(0,_.vS)(this.config.env,w),S=E.baseUrl,O=E.protocol,"GATEWAY"===w&&/^((database)\.)|(auth\.wsWebSign)/.test(e)&&(T=(0,_.vS)(this.config.env,"CLOUD_API"),S="".concat(T.baseUrl.match(/\/\/([^/?#]*)/)[0],"/web")),C=void 0,C=n.pathname?A(O,"".concat(null===(o=(0,_.M4)(this.config.env,w))||void 0===o?void 0:o.replace(/^https?:/,""),"/").concat(n.pathname),b):A(O,S,b),g&&(C+=g),[4,this.post(x({url:C,data:h},f),r)];case 3:if(R=I.sent(),(k=null===(i=R.header)||void 0===i?void 0:i["x-tcb-trace"])&&this.localCache.setStore(a,k),200!==Number(R.status)&&200!==Number(R.statusCode)||!R.data)throw new Error("network request error");return[2,R];case 4:N=I.sent();try{N.requestId=N.requestId||(null==n?void 0:n.headers["x-request-id"])||(null==n?void 0:n.headers["X-Request-Id"])||""}catch(e){}throw N;case 5:return[2]}})})},e.prototype.fetch=function(e){var t,n,r,o,i,a,s,c;return E(this,void 0,Promise,function(){var u,l,p,d,h,f,m,v,y=this;return I(this,function(g){switch(g.label){case 0:u=e.token,l=e.headers,p=void 0===l?{}:l,d=e.withCredentials,h=void 0===d||d,f=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}(e,["token","headers","withCredentials"]),m=function(){return E(y,void 0,void 0,function(){var e,t,n,r;return I(this,function(o){switch(o.label){case 0:if(e={},!h)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.getAccessToken(u)];case 2:return(t=o.sent())&&(e.Authorization="Bearer ".concat(t)),[3,4];case 3:if(n=o.sent(),"undefined"==typeof process||null==process.versions||null==process.versions.node)throw n;return[3,4];case 4:return r=x({headers:x(x(x({"X-SDK-Version":"@cloudbase/js-sdk/".concat((0,_.mI)())},e),this.getDefaultHeaders()),p),withCredentials:h},f),[2,this.reqClass.fetch(r)]}})})},g.label=1;case 1:return g.trys.push([1,3,,6]),[4,m()];case 2:return[2,g.sent()];case 3:v=g.sent();try{v.requestId=v.requestId||p["x-request-id"]||p["X-Request-Id"]||""}catch(e){}if("ACCESS_TOKEN_EXPIRED"!==(null==v?void 0:v.code))return[3,5];if("function"!=typeof(null===(o=null===(r=null===(n=null===(t=this.config)||void 0===t?void 0:t._fromApp)||void 0===n?void 0:n.oauthInstance)||void 0===r?void 0:r.authApi)||void 0===o?void 0:o.refreshTokenForce))throw v;return[4,null===(c=null===(s=null===(a=null===(i=this.config)||void 0===i?void 0:i._fromApp)||void 0===a?void 0:a.oauthInstance)||void 0===s?void 0:s.authApi)||void 0===c?void 0:c.refreshTokenForce()];case 4:return g.sent(),[2,m()];case 5:throw v;case 6:return[2]}})})},e.prototype.send=function(e,t,n,r){return void 0===t&&(t={}),void 0===n&&(n={}),E(this,void 0,Promise,function(){var o;return I(this,function(i){switch(i.label){case 0:return[4,this.request(e,t,x(x({},n),{onUploadProgress:t.onUploadProgress}),r)];case 1:if((o=i.sent()).data.code&&this.throwWhenRequestFail)throw new Error(JSON.stringify({code:S.OPERATION_FAIL,msg:"[".concat(o.data.code,"] ").concat(o.data.message)}));return[2,o.data]}})})},e.prototype.gateWay=function(e,t){var n;return E(this,void 0,void 0,function(){var o,i,a,s,c,u,l,p,d,h,f,m,v,y,g,b,w,E,O;return I(this,function(I){switch(I.label){case 0:if(o=e.url,i=e.name,a=e.data,s=e.path,c=void 0===s?"":s,u=e.method,l=e.header,p=void 0===l?{}:l,!(i&&c||o))throw new Error(JSON.stringify({code:S.INVALID_PARAMS,msg:"[gateWay] invalid function name or path or url"}));try{d=a?JSON.stringify(a):""}catch(e){throw new Error(JSON.stringify({code:S.INVALID_PARAMS,msg:"[gateWay] invalid data"}))}if(h=r.P6.generateRequestId(),f=(0,_.vS)(this.config.env,"GATEWAY"),m=f.baseUrl,v=f.protocol,y="".concat(v).concat(m).concat(o||"/".concat(c,"/").concat(i)),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||{}}y="".concat(y).concat(y.includes("?")?"&":"?").concat(Object.keys(b).map(function(e){return"".concat(e,"=").concat(b[e])}).join("&"))}catch(e){}return[4,this.fetch(x(x({method:u||"POST",headers:x({"Content-Type":"application/json; charset=utf-8","X-Request-Id":h},p)},g?{}:{body:d}),{url:y,customReqOpts:t,shouldThrowOnError:this.throwWhenRequestFail}))];case 1:return w=I.sent(),E=[x({requestId:h},w)],O={},[4,w.data];case 2:return[2,x.apply(void 0,E.concat([(O.data=I.sent(),O)]))]}})})},e}(),L={};!function(e){e.ZH="zh-CN",e.EN="en-US"}(N||(N={}));var U=((k={})[N.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"},k),D=function(e,t){var n;return(null===(n=U[t])||void 0===n?void 0:n[e])||e},q=function(e,t){var n,o,i=function(e){return"lang_".concat(e.clientId||e.env)}(t),a=(e.adapter||{}).localStorage,s=t.lang||(null===(n=null==a?void 0:a.getItem)||void 0===n?void 0:n.call(a,i))||N.ZH;return null===(o=null==a?void 0:a.setItem)||void 0===o||o.call(a,i,s),new Proxy({t:function(e){return D(e,s)},LANG_HEADER_KEY:"Accept-Language",lang:s},{get:function(e,t){var n;return"lang"===t&&(null===(n=null==a?void 0:a.getItem)||void 0===n?void 0:n.call(a,i))||e[t]},set:function(e,t,n){var o;return"lang"===t&&n!==e[t]&&(e[t]=n,e.t=function(e){return D(e,n)},null===(o=null==a?void 0:a.setItem)||void 0===o||o.call(a,i,n),r.RR.$.fire(r.RR.P,{i18n:e})),e[t]=n,!0}})},M=__webpack_require__(3809),B=function(){return B=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},B.apply(this,arguments)},F=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},W=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},G=r.j$.Fk,V=r.j$.xY,H=r._G.Sg,z=r._G.vM,K=r.P6.printWarn,J=r.BM.D,$={persistence:"local"},Y=6e5,X={},Q=function(){function e(e){this.cloudbaseConfig=e||this.cloudbaseConfig,this.authInstance=null,this.oauthInstance=null,this.requestInstance=null,this.version=(0,_.mI)()}return Object.defineProperty(e.prototype,"config",{get:function(){return this.cloudbaseConfig},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"platform",{get:function(){return f},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cache",{get:function(){return e=this.cloudbaseConfig.env,y[e];var e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localCache",{get:function(){return w(this.cloudbaseConfig.env)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){return this.requestInstance||(e=this.cloudbaseConfig.env,L[e]);var e},enumerable:!1,configurable:!0}),e.prototype.init=function(t){var n,r,o,i,a;if(void 0===t&&(t={env:""}),t.endPointMode=t.endPointMode||"GATEWAY",f.adapter||this.useDefaultAdapter(),(t=this.dealNodeAdapterConfig(t)).throw=null===(r=null!==(n=t.throw)&&void 0!==n?n:t.throwOnCode)||void 0===r||r,delete t.throwOnCode,!t.env)throw new Error(JSON.stringify({code:H.INVALID_PARAMS,msg:"env must not be specified"}));this.isInitialized(t);var s=this.isNodeEnv()?void 0:15e3,c=t.timeout||s,u={env:t.env,region:t.region,accessKey:t.accessKey,context:t.context,auth:t.auth,timeout:c,timeoutMsg:c?"[".concat((0,_.eX)(),"][REQUEST TIMEOUT] request had been abort since didn't finished within").concat(c/1e3,"s"):void 0};this.requestClient=new f.adapter.reqClass(u),this.cloudbaseConfig=B(B(B({},$),t),{timeout:c,i18n:q(f,t)}),(0,M.F)(this.cloudbaseConfig),delete this.cloudbaseConfig.lang,this.cloudbaseConfig.timeout=this.formatTimeout(this.cloudbaseConfig.timeout);var l=this.cloudbaseConfig,p=l.env,d=l.persistence,h=l.debug,m=l.timeout,v=l.oauthClient,y=l.i18n;b({env:p,persistence:d,debug:h,platformInfo:this.platform}),(0,_.R1)(p,t.region||""),(0,_.$R)(p,_.Bh,t.intl);var g=new e(this.cloudbaseConfig);return g.requestInstance=function(e){var t=new j(x(x({},e),{throw:e.throw}));return L[e.env]=t,t}({env:p,region:t.region||"",timeout:m,oauthClient:v,_fromApp:g,i18n:y,endPointMode:t.endPointMode,auth:t.auth,context:t.context,accessKey:t.accessKey,throw:t.throw}),g.requestClient=this.requestClient,null===(o=null==this?void 0:this.fire)||void 0===o||o.call(this,"cloudbase_init",g),this.try2InitAuth(g),(null===(i=f.adapter)||void 0===i?void 0:i.nodeTool)&&(null===(a=f.adapter)||void 0===a||a.nodeTool(g,this.cloudbaseConfig)),g},e.prototype.updateConfig=function(e){var t=e.persistence,n=e.debug;this.cloudbaseConfig.persistence=t,this.cloudbaseConfig.debug=n,b({env:this.cloudbaseConfig.env,persistence:t,debug:n,platformInfo:this.platform})},e.prototype.setThrowOnCode=function(e){this.cloudbaseConfig.throw=e},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){X[e.name]=e},e.prototype.invokeExtension=function(e,t){return n=this,r=void 0,i=function(){var n;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(r){switch(r.label){case 0:if(!(n=X[e]))throw new Error(JSON.stringify({code:H.INVALID_PARAMS,msg:"extension:".concat(e," must be registered before invoke")}));return[4,n.invoke(t,this)];case 1:return[2,r.sent()]}})},new((o=void 0)||(o=Promise))(function(e,t){function a(e){try{c(i.next(e))}catch(e){t(e)}}function s(e){try{c(i.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o(function(e){e(n)})).then(a,s)}c((i=i.apply(n,r||[])).next())});var n,r,o,i},e.prototype.useAdapters=function(e,t){var n=G(e,t)||{},r=n.adapter,o=n.runtime;r&&(f.adapter=r),o&&(f.runtime=o)},e.prototype.registerHook=function(t){!function(e,t){var n=t.entity,r=t.target;if(Object.prototype.hasOwnProperty.call(e,r))throw new Error(JSON.stringify({code:i.INVALID_OPERATION,msg:"target:".concat(r," is not exist")}));var a=e.prototype[r];if("function"!=typeof a)throw new Error(JSON.stringify({code:i.INVALID_OPERATION,msg:"target:".concat(r," is not a function which is the only type supports hook")}));e.prototype[r]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.call.apply(n,o([this],e,!1)),a.call.apply(a,o([this],e,!1))}}(e,t)},e.prototype.registerComponent=function(t){s(e,t)},e.prototype.registerVersion=function(e){(0,_.po)(e),this.version=e},e.prototype.registerSdkName=function(e){(0,_.tC)(e)},e.prototype.isInitialized=function(e){return void 0===e&&(e=this.cloudbaseConfig),"string"==typeof e.env&&["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()})&&K(H.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,_.Fy)({baseUrl:e,protocol:t,env:this.config.env,endPointKey:"CLOUD_API"})},e.prototype.registerEndPointWithKey=function(e){(0,_.Fy)({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,_.Fy)({baseUrl:"".concat(r,"/web"),protocol:t,env:this.config.env,endPointKey:"CLOUD_API"}),(0,_.Fy)({baseUrl:"".concat(r,"/v1"),protocol:t,env:this.config.env,endPointKey:"GATEWAY"})},e.prototype.getEndPointWithKey=function(e){var t=(0,_.vS)(this.config.env,e);return{BASE_URL:t.baseUrl,PROTOCOL:t.protocol}},e.prototype.parseCaptcha=function(e){return r.P6.parseCaptcha(e)},e.prototype.useDefaultAdapter=function(){var e=V.bind(this)(),t=e.adapter,n=e.runtime;f.adapter=t,f.runtime=n},e.prototype.isNodeEnv=function(){var e;return"undefined"!=typeof process&&void 0!==process.env&&!!(null===(e=f.adapter)||void 0===e?void 0:e.getSecretInfo)},e.prototype.formatTimeout=function(e){if(null==e)return e;switch(!0){case e>Y:return K(H.INVALID_PARAMS,"timeout is greater than maximum value[10min]"),Y;case e<100:return K(H.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,r,o,i;if(this.isNodeEnv()){var a=null===(t=f.adapter)||void 0===t?void 0:t.getSecretInfo(e);e.env&&"symbol"!=typeof e.env||(e.env=a.env),a.credentials&&(e.auth=B(B({},e.auth),{credentials:a.credentials}));var s=e,c=s.secretId||(null===(n=e.auth)||void 0===n?void 0:n.secretId),u=s.secretKey||(null===(r=e.auth)||void 0===r?void 0:r.secretKey);if(c&&u){var l=s.sessionToken||(null===(o=e.auth)||void 0===o?void 0:o.sessionToken)||"";e.auth=B(B({},e.auth),{secretId:c,secretKey:u,sessionToken:l,secretType:(null===(i=e.auth)||void 0===i?void 0:i.secretType)||(l?"SESSION_SECRET":"SECRET")})}}return e},F([J({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(z)]}),W("design:type",Function),W("design:paramtypes",[Object]),W("design:returntype",e)],e.prototype,"init",null),F([J({title:"调用扩展能力失败",messages:["请确认以下各项:"," 1 - 调用 invokeExtension() 的语法或参数是否正确"," 2 - 被调用的扩展能力是否已经安装并通过 registerExtension() 注册","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(z)]}),W("design:type",Function),W("design:paramtypes",[String,Object]),W("design:returntype",Promise)],e.prototype,"invokeExtension",null),e}(),Z=new Q,ee=void 0===u.WxRequest?null:(u.WxRequest.prototype.upload=function(e){var t=this,n=this;return new Promise(function(r){var o=e.url,i=e.file,a=e.data,s=e.headers,c=wx.getFileSystemManager(),u=wx.request({url:o,method:e.method,header:h({"content-type":" "},s),data:c.readFileSync(i),timeout:t._timeout,success:function(e){var t={statusCode:e.statusCode,data:e.data||{}};200===e.statusCode&&(null==a?void 0:a.success_action_status)&&(t.statusCode=parseInt(a.success_action_status,10)),r(t)},fail:function(e){r(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{u.abort()}catch(e){}}}})})},u.default.genAdapter=function(e){return{root:{globalThis:{}},reqClass:u.WxRequest,wsClass:u.WxMpWebSocket,captchaOptions:{openURIWithCallback:function(t){var n=e.EventBus,r={},o=t;console.log("openURIWithCallback",t);var i=t.match(/^(data:.*?)(\?[^#\s]*)?$/);if(i){o=i[1],console.log("openURIWithCallback url",o);var a=i[2];a&&(r=(0,u.parseQueryString)(a))}console.log("openURIWithCallback queryObj",r);var s=r.token,c=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}(r,["token"]);return/^data:/.test(o)&&!s?Promise.reject({error:"invalid_argument",error_description:"invalie captcha data: ".concat(t)}):s?new Promise(function(e){console.log("wait for captcha..."),n.$emit("CAPTCHA_DATA_CHANGE",h(h({},c),{token:s,url:o})),n.$once("RESOLVE_CAPTCHA_DATA",function(t){e(t)})}):Promise.reject({error:"unimplemented",error_description:"need to impl captcha data"})}},localStorage:u.wxMpStorage,primaryStorage:d.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:""}}},u.default);ee&&Z.useAdapters(ee);const te=Z;var ne,re,oe,ie,ae,se,ce="/auth";!function(e){e.AUTH_SIGN_UP_URL="/v1/signup",e.AUTH_TOKEN_URL="/v1/token",e.AUTH_REVOKE_URL="/v1/revoke",e.WEDA_USER_URL="/v1/plugin/weda/userinfo",e.AUTH_RESET_PASSWORD="/v1/reset",e.AUTH_GET_DEVICE_CODE="/v1/device/code",e.CHECK_USERNAME="/v1/checkUsername",e.CHECK_IF_USER_EXIST="/v1/checkIfUserExist",e.GET_PROVIDER_TYPE="/v1/mgr/provider/providerSubType",e.AUTH_SIGN_IN_URL="/v1/signin",e.AUTH_SIGN_IN_ANONYMOUSLY_URL="/v1/signin/anonymously",e.AUTH_SIGN_IN_WITH_PROVIDER_URL="/v1/signin/with/provider",e.AUTH_SIGN_IN_WITH_WECHAT_URL="/v1/signin/wechat/noauth",e.AUTH_SIGN_IN_CUSTOM="/v1/signin/custom",e.PROVIDER_TOKEN_URL="/v1/provider/token",e.PROVIDER_URI_URL="/v1/provider/uri",e.USER_ME_URL="/v1/user/me",e.AUTH_SIGNOUT_URL="/v1/user/signout",e.USER_QUERY_URL="/v1/user/query",e.USER_PRIFILE_URL="/v1/user/profile",e.USER_BASIC_EDIT_URL="/v1/user/basic/edit",e.USER_TRANS_BY_PROVIDER_URL="/v1/user/trans/by/provider",e.PROVIDER_LIST="/v1/user/provider",e.PROVIDER_BIND_URL="/v1/user/provider/bind",e.PROVIDER_UNBIND_URL="/v1/user/provider",e.CHECK_PWD_URL="/v1/user/sudo",e.SUDO_URL="/v1/user/sudo",e.BIND_CONTACT_URL="/v1/user/contact",e.AUTH_SET_PASSWORD="/v1/user/password",e.AUTHORIZE_DEVICE_URL="/v1/user/device/authorize",e.AUTHORIZE_URL="/v1/user/authorize",e.AUTHORIZE_INFO_URL="/v1/user/authorize/info",e.AUTHORIZED_DEVICES_DELETE_URL="/v1/user/authorized/devices/",e.AUTH_REVOKE_ALL_URL="/v1/user/revoke/all",e.GET_USER_BEHAVIOR_LOG="/v1/user/security/history",e.VERIFICATION_URL="/v1/verification",e.VERIFY_URL="/v1/verification/verify",e.CAPTCHA_DATA_URL="/v1/captcha/data",e.VERIFY_CAPTCHA_DATA_URL="/v1/captcha/data/verify",e.GET_CAPTCHA_URL="/v1/captcha/init",e.GET_MINIPROGRAM_QRCODE="/v1/qrcode/generate",e.GET_MINIPROGRAM_QRCODE_STATUS="/v1/qrcode/get/status"}(ne||(ne={})),function(e){e.AUTH_SIGN_IN_URL="/v2/signin/username",e.AUTH_TOKEN_URL="/v2/token",e.USER_ME_URL="/v2/user/me",e.VERIFY_URL="/v2/signin/verificationcode",e.AUTH_SIGN_IN_WITH_PROVIDER_URL="/v2/signin/with/provider",e.AUTH_PUBLIC_KEY="/v2/signin/publichkey",e.AUTH_RESET_PASSWORD="/v2/signin/password/update"}(re||(re={})),function(e){e.REGISTER="REGISTER",e.SIGN_IN="SIGN_IN",e.PASSWORD_RESET="PASSWORD_RESET",e.EMAIL_ADDRESS_CHANGE="EMAIL_ADDRESS_CHANGE",e.PHONE_NUMBER_CHANGE="PHONE_NUMBER_CHANGE"}(oe||(oe={})),(se=ie||(ie={})).UNREACHABLE="unreachable",se.LOCAL="local",se.CANCELLED="cancelled",se.UNKNOWN="unknown",se.UNAUTHENTICATED="unauthenticated",se.RESOURCE_EXHAUSTED="resource_exhausted",se.FAILED_PRECONDITION="failed_precondition",se.INVALID_ARGUMENT="invalid_argument",se.DEADLINE_EXCEEDED="deadline_exceeded",se.NOT_FOUND="not_found",se.ALREADY_EXISTS="already_exists",se.PERMISSION_DENIED="permission_denied",se.ABORTED="aborted",se.OUT_OF_RANGE="out_of_range",se.UNIMPLEMENTED="unimplemented",se.INTERNAL="internal",se.UNAVAILABLE="unavailable",se.DATA_LOSS="data_loss",se.INVALID_PASSWORD="invalid_password",se.PASSWORD_NOT_SET="password_not_set",se.INVALID_STATUS="invalid_status",se.USER_PENDING="user_pending",se.USER_BLOCKED="user_blocked",se.INVALID_VERIFICATION_CODE="invalid_verification_code",se.TWO_FACTOR_REQUIRED="two_factor_required",se.INVALID_TWO_FACTOR="invalid_two_factor",se.INVALID_TWO_FACTOR_RECOVERY="invalid_two_factor_recovery",se.UNDER_REVIEW="under_review",se.INVALID_REQUEST="invalid_request",se.UNAUTHORIZED_CLIENT="unauthorized_client",se.ACCESS_DENIED="access_denied",se.UNSUPPORTED_RESPONSE_TYPE="unsupported_response_type",se.INVALID_SCOPE="invalid_scope",se.INVALID_GRANT="invalid_grant",se.SERVER_ERROR="server_error",se.TEMPORARILY_UNAVAILABLE="temporarily_unavailable",se.INTERACTION_REQUIRED="interaction_required",se.LOGIN_REQUIRED="login_required",se.ACCOUNT_SELECTION_REQUIRED="account_selection_required",se.CONSENT_REQUIRED="consent_required",se.INVALID_REQUEST_URI="invalid_request_uri",se.INVALID_REQUEST_OBJECT="invalid_request_object",se.REQUEST_NOT_SUPPORTED="request_not_supported",se.REQUEST_URI_NOT_SUPPORTED="request_uri_not_supported",se.REGISTRATION_NOT_SUPPORTED="registration_not_supported",se.CAPTCHA_REQUIRED="captcha_required",se.CAPTCHA_INVALID="captcha_invalid",se.PROVIDER_NOT_ENABLED="provider_not_enabled",se.LOGIN_METHOD_DISABLED="login_method_disabled",se.INVALID_USERNAME_OR_PASSWORD="invalid_username_or_password",se.INVALID_CREDENTIALS="invalid_credentials",se.WRONG_PASSWORD="wrong_password",se.USER_NOT_FOUND="user_not_found",se.MFA_PHONE_REQUIRED="mfa_phone_required",se.LOGIN_TYPE_DISABLED="login_type_disabled",se.PROVIDER_ERROR="provider_error",se.MISSING_REQUIRED_PARAM="missing_required_param",function(e){e[e.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",e[e.NOT_FOUND=5]="NOT_FOUND",e[e.PERMISSION_DENIED=7]="PERMISSION_DENIED",e[e.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",e[e.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",e[e.ABORTED=10]="ABORTED",e[e.UNIMPLEMENTED=12]="UNIMPLEMENTED",e[e.INTERNAL=13]="INTERNAL",e[e.UNAVAILABLE=14]="UNAVAILABLE",e[e.UNAUTHENTICATED=16]="UNAUTHENTICATED",e[e.MISSING_REQUIRED_PARAM=4e3]="MISSING_REQUIRED_PARAM",e[e.CAPTCHA_REQUIRED=4001]="CAPTCHA_REQUIRED",e[e.CAPTCHA_INVALID=4002]="CAPTCHA_INVALID",e[e.PROVIDER_ERROR=4019]="PROVIDER_ERROR",e[e.UNAUTHORIZED_CLIENT=4022]="UNAUTHORIZED_CLIENT",e[e.MFA_PHONE_REQUIRED=4042]="MFA_PHONE_REQUIRED",e[e.LOGIN_TYPE_DISABLED=4045]="LOGIN_TYPE_DISABLED"}(ae||(ae={}));var ue,le,pe="credentials_error",de="SIGNED_OUT",he="SIGNED_IN",fe="INITIAL_SESSION",me="TOKEN_REFRESHED",ve="USER_UPDATED",ye="BIND_IDENTITY",ge="loginStateChanged",be="authStateChanged",we="sign_in",_e="bind_identity",xe="node-sdk-scope";function Ee(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}!function(e){e.EMAIL="email",e.RECOVERY="recovery",e.REAUTHENTICATION="reauthentication"}(ue||(ue={})),function(e){e.CLIENT_ID="client_id",e.CLIENT_SECRET="client_secret",e.RESPONSE_TYPE="response_type",e.SCOPE="scope",e.STATE="state",e.REDIRECT_URI="redirect_uri",e.ERROR="error",e.ERROR_DESCRIPTION="error_description",e.ERROR_URI="error_uri",e.GRANT_TYPE="grant_type",e.CODE="code",e.ACCESS_TOKEN="access_token",e.TOKEN_TYPE="token_type",e.EXPIRES_IN="expires_in",e.USERNAME="username",e.PASSWORD="password",e.REFRESH_TOKEN="refresh_token"}(le||(le={}));var Ie=__webpack_require__(2631),Se=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())})},Oe=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])}}},Te=new Map,Ae=function(){function e(e){this.clientId=(null==e?void 0:e.clientId)||"",this.getScope=null==e?void 0:e.getScope,Te=Te||new Map}return e.prototype.run=function(e,t){return Se(this,void 0,Promise,function(){var n,r,o=this;return Oe(this,function(i){return n=this.getScope?this.getScope():this.clientId,e="".concat(n,"_").concat(e),(r=Te.get(e))||(r=new Promise(function(n,r){Se(o,void 0,void 0,function(){var o,i,a;return Oe(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,4,5]),[4,this.runIdlePromise()];case 1:return s.sent(),o=t(),i=n,[4,o];case 2:return i.apply(void 0,[s.sent()]),[3,5];case 3:return a=s.sent(),r(a),[3,5];case 4:return Te.delete(e),[7];case 5:return[2]}})})}),Te.set(e,r)),[2,r]})})},e.prototype.runIdlePromise=function(){return Promise.resolve()},e}(),Pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Ce=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/,Re=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!Ce.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 n,r,o="",i=0;i<e.length;)t=Pe.indexOf(e.charAt(i++))<<18|Pe.indexOf(e.charAt(i++))<<12|(n=Pe.indexOf(e.charAt(i++)))<<6|(r=Pe.indexOf(e.charAt(i++))),o+=64===n?String.fromCharCode(t>>16&255):64===r?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o};function ke(){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}var Ne=!1;function je(){Ne=Ne||void 0!==typeof window&&"miniprogram"===window.__wxjs_environment}try{ke()||(Ne=Ne||!!navigator.userAgent.match(/miniprogram/i)||"miniprogram"===window.__wxjs_environment,window&&window.WeixinJSBridge&&window.WeixinJSBridge.invoke?je():"undefined"!=typeof document&&document.addEventListener("WeixinJSBridgeReady",je,!1))}catch(e){}var Le=function(){return Le=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},Le.apply(this,arguments)},Ue=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())})},De=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])}}},qe=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))},Me="x-request-id",Be="x-device-id",Fe="device_id",We=function(e,t){return Ue(this,void 0,Promise,function(){var n,r,o,i,a;return De(this,function(s){switch(s.label){case 0:n=null,r=null,s.label=1;case 1:return s.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,s.sent().json()];case 3:return(null==(i=s.sent())?void 0:i.error)?(r=i).error_uri=new URL(e).pathname:n=i,[3,5];case 4:return a=s.sent(),r={error:ie.UNREACHABLE,error_description:a.message,error_uri:new URL(e).pathname},[3,5];case 5:if(r)throw r;return[2,n]}})})},Ge=function(){function e(e){this._env=(null==e?void 0:e.env)||""}return e.prototype.getItem=function(e){return Ue(this,void 0,Promise,function(){return De(this,function(t){return[2,window.localStorage.getItem("".concat(e).concat(this._env))]})})},e.prototype.removeItem=function(e){return Ue(this,void 0,Promise,function(){return De(this,function(t){return window.localStorage.removeItem("".concat(e).concat(this._env)),[2]})})},e.prototype.setItem=function(e,t){return Ue(this,void 0,Promise,function(){return De(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}(),Ve=new Ge,He=function(){function e(e){var t=this;this.credentials=null,this.accessKeyCredentials=null,this.singlePromise=null,this.tokenSectionName=e.tokenSectionName,this.storage=e.storage,this.clientId=e.clientId,this.singlePromise=new Ae({clientId:this.clientId,getScope:function(){var e;return(null===(e=t.accessKeyCredentials)||void 0===e?void 0:e.access_token)?"".concat(t.clientId,"_").concat(t.accessKeyCredentials.access_token):t.clientId}}),this.credentials=e.credentials||null,this.onCredentialsChange=e.onCredentialsChange}return e.prototype.syncMemoryCredentials=function(e){this.credentials=e},e.prototype.getMemoryCredentials=function(){return this.credentials},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,t){var n;return Ue(this,void 0,Promise,function(){var r,o;return De(this,function(i){switch(i.label){case 0:return r=!(!this.credentials||!this.credentials.access_token),(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?(o=JSON.stringify(e),[4,this.storage.setItem(this.tokenSectionName,o)]):[3,2]):[3,3];case 1:i.sent(),i.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:i.sent(),i.label=5;case 5:this.credentials=null,i.label=6;case 6:return this.onCredentialsChange&&this.onCredentialsChange(e||null,{isInit:null!==(n=null==t?void 0:t.isInit)&&void 0!==n&&n,hadCredentials:r}),[2]}})})},e.prototype.setAccessKeyCredentials=function(e){this.accessKeyCredentials=e,e.scope===xe&&(this.credentials=e)},e.prototype.getCredentials=function(){return Ue(this,void 0,Promise,function(){var e=this;return De(this,function(t){return[2,this.singlePromise.run("getCredentials",function(){return Ue(e,void 0,void 0,function(){var e,t;return De(this,function(n){switch(n.label){case 0:return[4,this.getStorageCredentials()];case 1:return e=n.sent(),t=e.credentials,e.isAccessKeyCredentials?[2,t]:(this.credentials=t,[2,this.credentials])}})})})]})})},e.prototype.getStorageCredentials=function(){return Ue(this,void 0,Promise,function(){var e=this;return De(this,function(t){return[2,this.singlePromise.run("_getStorageCredentials",function(){return Ue(e,void 0,void 0,function(){var e,t,n;return De(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}(),ze=function(){function e(t){var n,o=this;this.initializePromise=null,this.lockAcquired=!1,this.pendingInLock=[],this.singlePromise=null,this._initSessionEmitted=!1,t.clientSecret||(t.clientSecret=""),!t.clientId&&t.env&&(t.clientId=t.env),this.apiOrigin=t.apiOrigin,this.getApiOriginFunc=t.getApiOrigin,this.apiPath=t.apiPath||ce,this.clientId=t.clientId,this.i18n=t.i18n,this.eventBus=t.eventBus,this.singlePromise=new Ae({clientId:this.clientId}),this.retry=this.formatRetry(t.retry,e.defaultRetry),t.baseRequest?this.baseRequest=t.baseRequest:this.baseRequest=We,this.tokenInURL=t.tokenInURL,this.headers=t.headers,this.storage=t.storage||Ve,this.localCredentials=new He({tokenSectionName:"credentials_".concat(t.clientId),storage:this.storage,clientId:t.clientId,onCredentialsChange:this._handleCredentialsChange.bind(this)}),this.clientSecret=t.clientSecret,t.clientId&&(this.basicAuth="Basic ".concat(function(e){for(var t,n,r,o,i="",a=0,s=(e=String(e)).length%3;a<e.length;){if((n=e.charCodeAt(a++))>255||(r=e.charCodeAt(a++))>255||(o=e.charCodeAt(a++))>255)throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");i+=Pe.charAt((t=n<<16|r<<8|o)>>18&63)+Pe.charAt(t>>12&63)+Pe.charAt(t>>6&63)+Pe.charAt(63&t)}return s?i.slice(0,s-3)+"===".substring(s):i}("".concat(t.clientId,":").concat(this.clientSecret)))),this.wxCloud=t.wxCloud;try{ke()&&(this.useWxCloud=t.useWxCloud,void 0===this.wxCloud&&t.env&&(wx.cloud.init({env:t.env}),this.wxCloud=wx.cloud))}catch(e){}this.refreshTokenFunc=t.refreshTokenFunc||this.defaultRefreshTokenFunc,this.anonymousSignInFunc=t.anonymousSignInFunc,this.onCredentialsError=t.onCredentialsError,this.getInitialSession=t.getInitialSession,this.onInitialSessionObtained=t.onInitialSessionObtained,this.logDebugMessages=null!==(n=t.debug)&&void 0!==n&&n,r.RR.$.on(r.RR.P,function(e){var t;o.i18n=(null===(t=e.data)||void 0===t?void 0:t.i18n)||o.i18n}),this._initBroadcastChannel(),this._initVisibilityListener()}return e.prototype.setGetInitialSession=function(e){this.getInitialSession=e},e.prototype.setOnInitialSessionObtained=function(e){this.onInitialSessionObtained=e},e.prototype.initialize=function(e){return Ue(this,void 0,Promise,function(){var t=this;return De(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=Ue(t,void 0,void 0,function(){var e=this;return De(this,function(t){switch(t.label){case 0:return[4,this._acquireLock(-1,function(){return Ue(e,void 0,void 0,function(){return De(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 Ue(this,void 0,Promise,function(){var t=this;return De(this,function(n){switch(n.label){case 0:return[4,this.initializePromise];case 1:return n.sent(),[2,this._acquireLock(-1,function(){return Ue(t,void 0,void 0,function(){return De(this,function(t){return[2,this.localCredentials.setCredentials(e)]})})})]}})})},Object.defineProperty(e.prototype,"initSessionEmitted",{get:function(){return this._initSessionEmitted},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){try{this.broadcastChannel&&"function"==typeof this.broadcastChannel.close&&this.broadcastChannel.close()}catch(e){this._debug("#destroy","close BroadcastChannel error",e)}finally{this.broadcastChannel=null}try{var e=this.visibilityEventHandler;this.visibilityEventHandler=void 0,e&&"undefined"!=typeof window&&"undefined"!=typeof document&&"function"==typeof window.removeEventListener&&window.removeEventListener("visibilitychange",e)}catch(e){this._debug("#destroy","remove visibility listener error",e)}},e.prototype.setAccessKeyCredentials=function(e){return this.localCredentials.setAccessKeyCredentials(e)},e.prototype.getAccessToken=function(){return Ue(this,void 0,Promise,function(){var e,t;return De(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)===xe||(null==e?void 0:e.access_token)?[2,Promise.resolve(e.access_token)]:(t={error:ie.UNAUTHENTICATED},[2,Promise.reject(t)])}})})},e.prototype.request=function(t,n){var r,o;return Ue(this,void 0,Promise,function(){var i,a,s,c,u,l,p,d,h,f;return De(this,function(m){switch(m.label){case 0:return n||(n={}),i=this.formatRetry(n.retry,this.retry),n.headers=Le(Le({},n.headers),((f={})[null===(r=this.i18n)||void 0===r?void 0:r.LANG_HEADER_KEY]=null===(o=this.i18n)||void 0===o?void 0:o.lang,f)),this.headers&&(n.headers=Le(Le({},this.headers),n.headers)),n.headers[Me]||(n.headers[Me]=Ee()),n.headers[Be]?[3,2]:[4,this.getDeviceId()];case 1:a=m.sent(),n.headers[Be]=a,m.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 c=m.sent(),[3,6];case 4:return[4,this.getCredentials()];case 5:c=m.sent(),m.label=6;case 6:return(s=c)&&(this.tokenInURL?(t.indexOf("?")<0&&(t+="?"),t+="access_token=".concat(s.access_token)):n.headers.Authorization="".concat(s.token_type," ").concat(s.access_token)),[3,8];case 7:this.clientId&&t.indexOf("client_id")<0&&(t+=t.indexOf("?")<0?"?":"&",t+="client_id=".concat(this.clientId)),m.label=8;case 8:t.startsWith("/")&&(u=this.getApiOriginFunc?this.getApiOriginFunc():this.apiOrigin,t="".concat(u).concat(this.apiPath).concat(t)),l=null,p=i+1,d=0,m.label=9;case 9:if(!(d<p))return[3,21];m.label=10;case 10:return m.trys.push([10,15,,18]),n.useWxCloud||this.useWxCloud?[4,this.wxCloudCallFunction(t,n)]:[3,12];case 11:return l=m.sent(),[3,14];case 12:return[4,this.baseRequest(t,n)];case 13:l=m.sent(),m.label=14;case 14:if(null==l?void 0:l.code)throw{error:l.code,error_description:l.message,error_uri:new URL(t).pathname};return[3,21];case 15:h=m.sent();try{h.requestId=h.requestId||n.headers[Me]||""}catch(e){}return n.withCredentials&&h&&h.error===ie.UNAUTHENTICATED?[4,this.setCredentials(null)]:[3,17];case 16:return m.sent(),[2,Promise.reject(h)];case 17:return d!==i&&h&&"unreachable"===h.error?[3,18]:[2,Promise.reject(h)];case 18:return[4,this.sleep(e.retryInterval)];case 19:m.sent(),m.label=20;case 20:return d++,[3,9];case 21:return[2,l]}})})},e.prototype.wxCloudCallFunction=function(e,t){var n;return Ue(this,void 0,Promise,function(){var r,o,i,a,s;return De(this,function(c){switch(c.label){case 0:r=null,o=null,c.label=1;case 1:c.trys.push([1,7,,8]),i="",c.label=2;case 2:return c.trys.push([2,4,,5]),[4,wx.getRendererUserAgent()];case 3:return i=c.sent(),[3,5];case 4:return c.sent(),[3,5];case 5:return[4,this.wxCloud.callFunction({name:"httpOverCallFunction",data:{url:e,method:t.method,headers:Le({origin:"https://servicewechat.com","User-Agent":i},t.headers),body:t.body}})];case 6:return a=c.sent().result,(null===(n=null==a?void 0:a.body)||void 0===n?void 0:n.error_code)?(o=null==a?void 0:a.body).error_uri=(0,Ie.y)(e):r=null==a?void 0:a.body,[3,8];case 7:return s=c.sent(),o={error:ie.UNREACHABLE,error_description:s.message,error_uri:(0,Ie.y)(e)},[3,8];case 8:if(o)throw o;return[2,r]}})})},e.prototype.getCredentials=function(){return Ue(this,void 0,Promise,function(){var e=this;return De(this,function(t){switch(t.label){case 0:return[4,this.initializePromise];case 1:return t.sent(),[2,this._acquireLock(-1,function(){return Ue(e,void 0,void 0,function(){return De(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 Ue(this,void 0,Promise,function(){var t,n;return De(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 Ue(this,void 0,Promise,function(){var t,n;return De(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 Ue(this,void 0,Promise,function(){var n=this;return De(this,function(r){switch(r.label){case 0:return[4,this.initializePromise];case 1:return r.sent(),[2,this._acquireLock(-1,function(){return Ue(n,void 0,void 0,function(){return De(this,function(n){return[2,this._refreshToken(e,t)]})})})]}})})},e.prototype._refreshToken=function(e,t){return Ue(this,void 0,Promise,function(){var n=this;return De(this,function(r){return[2,this.singlePromise.run("_refreshToken",function(){return Ue(n,void 0,void 0,function(){var n,r,o,i,a,s;return De(this,function(c){switch(c.label){case 0:if((null==e?void 0:e.scope)===xe)return[2,e];if(!e||!e.refresh_token)return o="no refresh token found in credentials",null===(i=this.onCredentialsError)||void 0===i||i.call(this,{msg:o}),[2,this.unAuthenticatedError(o)];c.label=1;case 1:return c.trys.push([1,4,,7]),[4,this.refreshTokenFunc(e.refresh_token,e)];case 2:return n=c.sent(),[4,this.localCredentials.setCredentials(n)];case 3:return c.sent(),[2,n];case 4:if(r=c.sent(),null==t?void 0:t.throwError)throw r;return r.error!==ie.INVALID_GRANT?[3,6]:[4,this.localCredentials.setCredentials(null)];case 5:return c.sent(),o=r.error_description,null===(a=this.onCredentialsError)||void 0===a||a.call(this,{msg:o}),[2,this.unAuthenticatedError(o)];case 6:return null===(s=this.onCredentialsError)||void 0===s||s.call(this,{msg:r.error_description}),[2,Promise.reject(r)];case 7:return[2]}})})})]})})},e.prototype.anonymousLogin=function(e){return Ue(this,void 0,void 0,function(){var t=this;return De(this,function(n){return[2,this.singlePromise.run("_anonymousLogin",function(){return Ue(t,void 0,void 0,function(){var t,n;return De(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:ie.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 Ue(this,void 0,Promise,function(){return De(this,function(t){return[2,new Promise(function(t){setTimeout(function(){t()},e)})]})})},e.prototype.anonymousSignIn=function(e){return Ue(this,void 0,Promise,function(){var t=this;return De(this,function(n){return[2,this.singlePromise.run("_anonymous",function(){return Ue(t,void 0,void 0,function(){var t,n;return De(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(ne.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!==ie.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 Ue(this,void 0,Promise,function(){var r,o,i;return De(this,function(a){switch(a.label){case 0:return void 0===e||""===e?(r="refresh token not found",null===(n=this.onCredentialsError)||void 0===n||n.call(this,{msg:r}),[2,this.unAuthenticatedError(r)]):(o=ne.AUTH_TOKEN_URL,"v2"===(null==t?void 0:t.version)&&(o=re.AUTH_TOKEN_URL),[4,this.request(o,{method:"POST",body:{client_id:this.clientId,client_secret:this.clientSecret,grant_type:"refresh_token",refresh_token:e}})]);case 1:return i=a.sent(),[2,Le(Le({},i),{version:(null==t?void 0:t.version)||"v1"})]}})})},e.prototype.getDeviceId=function(){return Ue(this,void 0,Promise,function(){var e;return De(this,function(t){switch(t.label){case 0:return this.deviceID?[2,this.deviceID]:[4,this.storage.getItem(Fe)];case 1:return"string"==typeof(e=t.sent())&&e.length>=16&&e.length<=48?[3,3]:(e=Ee(),[4,this.storage.setItem(Fe,e)]);case 2:t.sent(),t.label=3;case 3:return this.deviceID=e,[2,e]}})})},e.prototype.unAuthenticatedError=function(e){var t={error:ie.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,qe(["[OAuth2Client]"],e,!1))},e.prototype._initialize=function(){return Ue(this,void 0,Promise,function(){var e,t,n,r,o,i;return De(this,function(a){switch(a.label){case 0:if(a.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"),a.label=1;case 1:return a.trys.push([1,9,,10]),[4,this.getInitialSession()];case 2:return i=a.sent(),e=i.data,t=i.error,(null==e?void 0:e.session)?(this._debug("#_initialize()","session obtained from getInitialSession",e.session),this._initSessionEmitted=!0,[4,this.localCredentials.setCredentials(null==e?void 0:e.session,{isInit:!0})]):[3,4];case 3:a.sent(),a.label=4;case 4:if(!this.onInitialSessionObtained)return[3,8];this._debug("#_initialize()","calling onInitialSessionObtained callback"),a.label=5;case 5:return a.trys.push([5,7,,8]),[4,this.onInitialSessionObtained(e,t)];case 6:return a.sent(),[3,8];case 7:return n=a.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=a.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=a.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 Ue(this,void 0,Promise,function(){var n,r,o,i,a=this;return De(this,function(s){switch(s.label){case 0:this._debug("#_acquireLock","begin",e),s.label=1;case 1:if(s.trys.push([1,,10,11]),this.lockAcquired)return n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),r=Ue(a,void 0,void 0,function(){return De(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(Ue(a,void 0,void 0,function(){return De(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),s.label=2;case 2:return s.trys.push([2,,8,9]),this.lockAcquired=!0,o=t(),this.pendingInLock.push(Ue(a,void 0,void 0,function(){return De(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,o];case 1:case 2:return e.sent(),[3,3];case 3:return[2]}})})),[4,o];case 3:s.sent(),s.label=4;case 4:return this.pendingInLock.length?(i=qe([],this.pendingInLock,!0),[4,Promise.all(i)]):[3,6];case 5:return s.sent(),this.pendingInLock.splice(0,i.length),[3,4];case 6:return[4,o];case 7:return[2,s.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 Ue(this,void 0,Promise,function(){var r,o,i;return De(this,function(a){switch(a.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:if((null==(r=a.sent())?void 0:r.scope)===xe)return[2,r];if(!r)return i="credentials not found",null===(e=this.onCredentialsError)||void 0===e||e.call(this,{msg:i}),[2,this.unAuthenticatedError(i)];if(!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}(r))return[3,12];if(!r.refresh_token)return[3,9];a.label=2;case 2:return a.trys.push([2,4,,8]),[4,this._refreshToken(r)];case 3:return r=a.sent(),[3,8];case 4:return o=a.sent(),"anonymous"!==r.scope?[3,6]:[4,this.anonymousLogin(r)];case 5:return r=a.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=a.sent(),[3,12];case 11:return i="no refresh token found in credentials",null===(n=this.onCredentialsError)||void 0===n||n.call(this,{msg:i}),[2,this.unAuthenticatedError(i)];case 12:return[2,r]}})})},e.prototype._isUserCredentials=function(e){return!!(null==e?void 0:e.access_token)&&"accessKey"!==e.scope&&e.scope!==xe},e.prototype._fireCredentialsEvents=function(e,t,n){var r,o,i,a,s,c;this._isUserCredentials(e)?t?null===(i=this.eventBus)||void 0===i||i.fire(be,{event:fe}):n?null===(a=this.eventBus)||void 0===a||a.fire(be,{event:me}):(null===(s=this.eventBus)||void 0===s||s.fire(be,{event:he}),null===(c=this.eventBus)||void 0===c||c.fire(ge,{eventType:"sign_in"})):n&&(null===(r=this.eventBus)||void 0===r||r.fire(be,{event:de}),null===(o=this.eventBus)||void 0===o||o.fire(ge,{eventType:"sign_out"}))},e.prototype._handleCredentialsChange=function(e,t){this._fireCredentialsEvents(e,t.isInit,t.hadCredentials),this._broadcastCredentials(e,t)},e.prototype._initBroadcastChannel=function(){var e=this;if(void 0===this.broadcastChannel)try{"undefined"!=typeof BroadcastChannel&&(this.broadcastChannelName="credentials_".concat(this.clientId),this.broadcastChannel=new BroadcastChannel(this.broadcastChannelName),this.broadcastChannel.addEventListener("message",function(t){e._handleBroadcastMessage(t.data)}),this._debug("#_initBroadcastChannel","channel created: ".concat(this.broadcastChannelName)))}catch(e){this.broadcastChannel=null,this._debug("#_initBroadcastChannel","BroadcastChannel not available, skip",e)}},e.prototype._broadcastCredentials=function(e,t){if(this.broadcastChannel)try{this.broadcastChannel.postMessage({type:"credentials_changed",credentials:e,context:t})}catch(e){this._debug("#_broadcastCredentials","postMessage error",e)}},e.prototype._handleBroadcastMessage=function(e){var t,n;try{if(!e||"credentials_changed"!==e.type)return;var r=e.context,o=e.credentials;if((null==o?void 0:o.expires_at)&&"string"==typeof o.expires_at&&(o=Le(Le({},o),{expires_at:new Date(o.expires_at)})),(null==o?void 0:o.access_token)===(null===(t=this.localCredentials.getMemoryCredentials())||void 0===t?void 0:t.access_token))return;var i=!!(null===(n=this.localCredentials.getMemoryCredentials())||void 0===n?void 0:n.access_token);this.localCredentials.syncMemoryCredentials(o),this._fireCredentialsEvents(o,r.isInit,i)}catch(e){this._debug("#_handleBroadcastMessage","error",e)}},e.prototype._initVisibilityListener=function(){var e=this;try{if("undefined"==typeof window||"undefined"==typeof document||"function"!=typeof window.addEventListener)return;this.visibilityEventHandler=function(){return Ue(e,void 0,void 0,function(){var e;return De(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this._onVisibilityChanged()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),this._debug("#visibilityChangedCallback","error",e),[3,3];case 3:return[2]}})})},window.addEventListener("visibilitychange",this.visibilityEventHandler)}catch(e){this._debug("#_initVisibilityListener",e)}},e.prototype._onVisibilityChanged=function(){return Ue(this,void 0,Promise,function(){var e=this;return De(this,function(t){return"visible"!==document.visibilityState||this._acquireLock(-1,function(){return Ue(e,void 0,void 0,function(){var e,t,n,r,o,i;return De(this,function(a){switch(a.label){case 0:if("visible"!==document.visibilityState)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),e=this.localCredentials.getMemoryCredentials(),[4,this.localCredentials.getCredentials()];case 2:return t=a.sent(),n=null==e?void 0:e.access_token,r=null==t?void 0:t.access_token,n===r?[2]:(o=!!n,this._fireCredentialsEvents(t,!1,o),[3,4]);case 3:return i=a.sent(),this._debug("#_onVisibilityChanged","reload credentials error",i),[3,4];case 4:return[2]}})})}),[2]})})},e.defaultRetry=2,e.minRetry=0,e.maxRetry=5,e.retryInterval=1e3,e}(),Ke=__webpack_require__(9689),Je=__webpack_require__(3616),$e=function(){return $e=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},$e.apply(this,arguments)},Ye=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())})},Xe=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])}}},Qe=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)}},Ze=new Ke.CloudbaseEventEmitter,et="resolveCaptchaData",tt="padding:10px 8px;background:#007bff;color:#fff;border:none;border-radius:4px;cursor:pointer;flex:1;white-space:nowrap;margin-left:10px",nt="width:100%;padding:10px;background:#007bff;color:#fff;border:none;border-radius:4px;cursor:pointer",rt="background:#6c757d;cursor:not-allowed",ot=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())})},it=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])}}},at=function(){function e(e){e.openURIWithCallback||(e.openURIWithCallback=this.getDefaultOpenURIWithCallback()),e.storage||(e.storage=Ve),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))||ke()},e.prototype.request=function(e,t){return ot(this,void 0,Promise,function(){var n,r,o,i;return it(this,function(a){switch(a.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=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,7]),[4,this.config.request(r,t)];case 3:return o=a.sent(),[3,7];case 4:return(i=a.sent()).error!==ie.CAPTCHA_REQUIRED&&i.error!==ie.CAPTCHA_INVALID?[3,6]:[4,this.appendCaptchaTokenToURL(e,n,i.error===ie.CAPTCHA_INVALID)];case 5:return e=a.sent(),[2,this.config.request(e,t)];case 6:return[2,Promise.reject(i)];case 7:return[2,o]}})})},e.prototype.getDefaultOpenURIWithCallback=function(){var e=this;return function(t){return function(e,t){return Ye(void 0,void 0,Promise,function(){var n,r,o,i;return Xe(this,function(a){return n=(0,Je.parseCaptcha)(e),r=n.captchaData,o=n.state,i=n.token,function(e){var t=e.oauthInstance,n=e.captchaState,r="captcha-image",o=function(){return Ye(void 0,void 0,void 0,function(){var e,o;return Xe(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=$e($e({},n),{captchaData:e.data,token:e.token}),document.getElementById(r).src=e.data,[3,3];case 2:return o=i.sent(),console.error("刷新图形验证码失败",o),[3,3];case 3:return[2]}})})},i=function(e,t,n){var r=document.createElement(e);return t&&(r.style.cssText=t),n&&(r.textContent=n),r},a=i("div","position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.5);z-index:999"),s=i("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");s.appendChild(i("p","margin-bottom:15px","请输入你看到的字符:"));var c=i("div","display:flex;align-items:center;justify-content:space-between;margin-bottom:15px"),u=i("img","width:100%;height:auto;border:1px solid #eee");u.id=r,u.src=n.captchaData,c.appendChild(u);var l=i("button",tt,"刷新");l.onclick=Qe(function(){return Ye(void 0,void 0,void 0,function(){return Xe(this,function(e){switch(e.label){case 0:l.textContent="加载中...",l.disabled=!0,l.style.cssText="".concat(tt,";").concat(rt),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,o()];case 2:return e.sent(),[3,4];case 3:return l.textContent="刷新",l.disabled=!1,l.style.cssText=tt,[7];case 4:return[2]}})})},500),c.appendChild(l),s.appendChild(c);var p=i("input","width:100%;padding:14px 16px;margin-bottom:15px;box-sizing:border-box;border:2px solid #e8ecf4;border-radius:10px;font-size:15px");p.type="text",p.placeholder="输入字符",p.maxLength=4,s.appendChild(p);var d=i("div","color:#dc3545;font-size:12px;margin-bottom:10px;display:none;padding:8px;background:#f8d7da;border:1px solid #f5c6cb;border-radius:4px");s.appendChild(d);var h=function(e){d.textContent=e,d.style.display="block"},f=i("button",nt,"确定");f.onclick=Qe(function(){return Ye(void 0,void 0,void 0,function(){var e,r,i,c;return Xe(this,function(u){switch(u.label){case 0:if(!(e=p.value.trim()))return h("请输入字符"),[2];d.style.display="none",f.textContent="验证中...",f.disabled=!0,f.style.cssText="".concat(nt,";").concat(rt),u.label=1;case 1:return u.trys.push([1,3,5,6]),[4,t.verifyCaptchaData({token:n.token,key:e})];case 2:return r=u.sent(),Ze.fire(et,r),console.log("图形验证码校验成功"),document.body.removeChild(a),document.body.removeChild(s),[3,6];case 3:return i=u.sent(),console.error("图形验证码校验失败",i),c=i.error_description||"图形验证码校验失败",h(c),p.value="",p.focus(),[4,o()];case 4:return u.sent(),[3,6];case 5:return f.textContent="确定",f.disabled=!1,f.style.cssText=nt,[7];case 6:return[2]}})})},500),s.appendChild(f),document.body.appendChild(a),document.body.appendChild(s)}({oauthInstance:t,captchaState:{captchaData:r,state:o,token:i}}),[2,new Promise(function(e){console.log("等待图形验证码校验结果..."),Ze.on(et,function(t){e(null==t?void 0:t.data)})})]})})}(t,e.config.oauthInstance)}},e.prototype.getCaptchaToken=function(e,t){return ot(this,void 0,Promise,function(){var n,r,o,i;return it(this,function(a){switch(a.label){case 0:return e?[3,2]:[4,this.findCaptchaToken()];case 1:if(n=a.sent())return[2,n];a.label=2;case 2:return[4,this.config.request(ne.CAPTCHA_DATA_URL,{method:"POST",body:{state:t,redirect_uri:""},withCredentials:!1})];case 3:return r=a.sent(),o="".concat(r.data,"?state=").concat(encodeURIComponent(t),"&token=").concat(encodeURIComponent(r.token)),[4,this.config.openURIWithCallback(o)];case 4:return i=a.sent(),this.saveCaptchaToken(i),[2,i.captcha_token]}})})},e.prototype.appendCaptchaTokenToURL=function(e,t,n){return ot(this,void 0,Promise,function(){var r;return it(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 ot(this,void 0,void 0,function(){var t;return it(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 ot(this,void 0,Promise,function(){var e,t;return it(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}(),st=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}();const ct=st;var ut,lt,pt=(ut=function(e,t){return ut=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])},ut(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}ut(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});!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"}(lt||(lt={}));var dt="https://tcb.cloud.tencent.com/dev?envId=#/identity/login-manage",ht="https://docs.cloudbase.net/api-reference/webv3/initialization";function ft(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 lt.PROVIDER_NOT_ENABLED:return"[CloudBase Auth] 登录方式未开启\n\n"+" 当前调用的 ".concat(n,"() 所需的登录方式尚未在云开发控制台启用。\n")+" 需要开启的登录方式:".concat(r,"\n")+"\n 请按以下步骤开启:\n"+" 1. 打开云开发控制台:".concat(dt,"\n")+" 2. 选择对应的云开发环境\n 3. 进入「登录授权」页面,在「登录方式」或「身份源列表」中开启所需的登录方式\n\n 各登录方法与所需登录方式的对应关系:\n - signInWithPassword → 「用户名密码登录」\n - signInAnonymously → 「匿名登录」\n - signInWithOtp/signUp → 「短信验证码登录」或「邮箱验证码登录」\n - signInWithOAuth/signInWithIdToken → 对应的第三方身份源\n\n 如使用 CLI/MCP 工具,可通过 auth 工具查询和配置身份源状态。\n"+" 更多帮助请参考文档:".concat(ht);case lt.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 lt.USER_NOT_FOUND:return"[CloudBase Auth] 用户不存在\n\n 请检查以下项目:\n 1. 确认用户名/邮箱/手机号是否正确\n 2. 确认是在正确的云开发环境(envId)下操作\n 3. 如果是新用户,请先通过 auth.signUp() 注册\n"+" 4. 也可在云开发控制台手动创建用户:".concat(dt,"\n")+"\n 提示:不同环境(开发/测试/生产)的用户库是隔离的,请确认 envId 正确。";case lt.USER_STATUS_ABNORMAL:return"[CloudBase Auth] 用户状态异常\n\n 当前用户账号可能处于以下状态之一:\n - 账号已被封禁\n - 账号正在审核中\n - 账号已被锁定(多次密码错误)\n\n"+" 请联系管理员在云开发控制台检查用户状态:".concat(dt);case lt.SERVICE_ERROR:return"[CloudBase Auth] 服务异常\n\n 请检查以下项目:\n 1. 网络连接是否正常\n 2. 云开发环境是否正常运行\n 3. 稍后重试,如持续失败请联系技术支持\n\n 提示:如果是超时错误,请检查网络环境和请求频率。\n 常见服务端错误:smtp 未配置、短信服务未配置、wedaapis 未设置等。";case lt.INVALID_PARAMS:if((null==t?void 0:t.errorCode)===ae.MISSING_REQUIRED_PARAM||(null==t?void 0:t.code)===ie.MISSING_REQUIRED_PARAM){var o=["verifyOtp","signInWithOtp","signUp"].includes(n)?"\n 若在校验验证码阶段缺参:\n - 独立调用 auth.verifyOtp() 时 messageId 为必填,请补上 params.messageId。\n - 推荐改用发码接口返回的回调(SDK 会自动携带 messageId):\n const { data } = await auth.signInWithOtp({ phone })\n await data.verifyOtp({ token })\n // 或 auth.signUp({ phone }) 返回的 data.verifyOtp\n":"";return"[CloudBase Auth] 缺少必填参数\n\n"+" 调用 auth.".concat(n,"() 时缺少必填参数。\n")+" 这是客户端入参问题,不是控制台通道配置问题。\n\n 修复方式:\n"+" 1. 查看 error.message 中的参数路径,补上缺失字段。\n".concat(o,"\n 参考 API 文档确认各参数的格式和约束:").concat(ht)}return"[CloudBase Auth] 参数错误\n\n 请检查传入的参数是否符合要求:\n - 不能同时输入手机号和邮箱\n - 手机号格式需正确(如 +86 开头)\n - 必须提供手机号或邮箱\n\n"+" 参考 API 文档确认各参数的格式和约束:".concat(ht);case lt.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(dt);case lt.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 lt.CAPTCHA_REQUIRED:return"[CloudBase Auth] 需要滑块验证码\n\n 当前操作触发了风控策略,需要完成滑块验证。\n\n 处理方式:\n 1. 调用滑块验证码 SDK 展示验证组件\n 2. 用户完成验证后,将 captcha_token 附带到请求中重新发送\n 3. 可通过 getVerification 的 options.withCaptcha 参数自动携带验证码";case lt.CAPTCHA_INVALID:return"[CloudBase Auth] 滑块验证码校验失败\n\n 提交的验证码 token 校验未通过(可能已过期或 client_id 不匹配)。\n\n 处理方式:\n 1. 刷新滑块验证码,让用户重新验证\n 2. 确认 captcha 组件初始化的 client_id 与认证配置一致";case lt.MFA_REQUIRED:return"[CloudBase Auth] 需要 MFA 验证\n\n 当前操作要求用户绑定手机号进行多因素认证 (MFA)。\n\n 处理方式:\n 1. 引导用户进入手机号绑定流程\n 2. 绑定完成后重新执行原操作\n 3. error 中可能包含 MFA 详情信息";case lt.PRECONDITION_FAILED:return"[CloudBase Auth] 前置条件不满足\n\n 当前操作的前置条件不满足,常见原因:\n - 该手机号/邮箱已被其他账号绑定\n - 目标用户不存在或已存在(与 target 参数冲突)\n - 当前邮箱/手机号未注册用户\n\n 请根据 error.message 中的具体描述处理。";case lt.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(dt,"\n")+" 2. 到官方问答社区提问:https://cnb.cool/tencent/cloud/cloudbase/community/-/issues\n"+" 3. 查阅文档:".concat(ht)}}function mt(e){return e&&{signInWithPassword:"当前使用「用户名密码登录」,需确保:\n ✓ 控制台已开启「用户名密码登录」\n ✓ 用户已注册且凭据正确\n 如果不需要用户系统,建议改用 auth.signInAnonymously()",signInAnonymously:"当前使用「匿名登录」,需确保:\n ✓ 控制台已开启「匿名登录」\n 注意:匿名用户无需用户名密码,适用于快速体验或临时访问场景",signInWithOtp:"当前使用「OTP 验证码登录」,需确保:\n ✓ 控制台已开启「短信验证码登录」或「邮箱验证码登录」",signInWithOAuth:"当前使用「第三方 OAuth 登录」,需确保:\n ✓ 控制台已配置并开启对应的第三方身份源"}[e]||""}var vt=function(e){function t(t,n){var r=this,o=function(e){return"object"==typeof e&&null!==e&&"__isAuthError"in e}(t);return(r=e.call(this,o?t.message:t.error_description||t.message)||this).__isAuthError=!0,r.name="AuthError",o?(r.status=t.status,r.code=t.code,r.errorCode=t.errorCode,r.requestId=t.requestId,r.category=t.category,r.retryAfter=t.retryAfter,r.helpMessage=ft(r.category,{method:null==n?void 0:n.method,errorCode:r.errorCode,code:r.code}),r.loginMethodHint=mt(null==n?void 0:n.method),r):(r.status=t.error,r.code=String(t.error||t.error_code||"unknown").toLowerCase(),r.errorCode="number"==typeof t.error_code?t.error_code:"string"==typeof t.error_code&&parseInt(t.error_code,10)||void 0,r.requestId=t.requestId,r.category=function(e,t,n){if(!e&&!t&&!n)return lt.UNKNOWN;try{var r=(e||"").toLowerCase(),o="string"==typeof n?parseInt(n,10):n;return o===ae.MISSING_REQUIRED_PARAM||t===ie.MISSING_REQUIRED_PARAM?lt.INVALID_PARAMS:o===ae.CAPTCHA_REQUIRED||t===ie.CAPTCHA_REQUIRED?lt.CAPTCHA_REQUIRED:o===ae.CAPTCHA_INVALID||t===ie.CAPTCHA_INVALID?lt.CAPTCHA_INVALID:o===ae.MFA_PHONE_REQUIRED||t===ie.MFA_PHONE_REQUIRED?lt.MFA_REQUIRED:o===ae.LOGIN_TYPE_DISABLED||t===ie.LOGIN_TYPE_DISABLED?lt.PROVIDER_NOT_ENABLED:o===ae.RESOURCE_EXHAUSTED||t===ie.RESOURCE_EXHAUSTED?lt.RATE_LIMITED:o===ae.INTERNAL||o===ae.UNAVAILABLE||o===ae.UNIMPLEMENTED||o===ae.ABORTED?lt.SERVICE_ERROR:o===ae.NOT_FOUND?lt.USER_NOT_FOUND:o===ae.UNAUTHENTICATED?lt.INVALID_CREDENTIALS:o===ae.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("过期"))?lt.VERIFICATION_FAILED:t===ie.PROVIDER_NOT_ENABLED||t===ie.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("匿名登录未开启")?lt.PROVIDER_NOT_ENABLED:t===ie.FAILED_PRECONDITION||o===ae.FAILED_PRECONDITION&&!r.includes("请联系开发者")?r.includes("不存在")||r.includes("not found")||r.includes("未注册")?lt.USER_NOT_FOUND:lt.PRECONDITION_FAILED:t===ie.INVALID_PASSWORD||t===ie.INVALID_GRANT||t===ie.INVALID_VERIFICATION_CODE||t===ie.INVALID_USERNAME_OR_PASSWORD||t===ie.INVALID_CREDENTIALS||t===ie.WRONG_PASSWORD||t===ie.UNAUTHENTICATED||t===ie.INVALID_TWO_FACTOR||t===ie.INVALID_TWO_FACTOR_RECOVERY||t===ie.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")?lt.INVALID_CREDENTIALS:t===ie.NOT_FOUND||t===ie.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")?lt.USER_NOT_FOUND:t===ie.USER_BLOCKED||t===ie.USER_PENDING||t===ie.UNDER_REVIEW||t===ie.INVALID_STATUS||r.includes("被封禁")||r.includes("blocked")||r.includes("pending")||r.includes("审核")||r.includes("review")||r.includes("locked")||r.includes("已锁定")?lt.USER_STATUS_ABNORMAL:t===ie.SERVER_ERROR||t===ie.UNAVAILABLE||t===ie.TEMPORARILY_UNAVAILABLE||t===ie.INTERNAL||t===ie.UNREACHABLE||t===ie.DEADLINE_EXCEEDED||t===ie.DATA_LOSS||t===ie.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")?lt.SERVICE_ERROR:t===ie.INVALID_ARGUMENT||t===ie.INVALID_REQUEST||t===ie.INVALID_SCOPE||t===ie.INVALID_REQUEST_URI||t===ie.INVALID_REQUEST_OBJECT||o===ae.INVALID_ARGUMENT?lt.INVALID_PARAMS:t===ie.PERMISSION_DENIED||t===ie.ACCESS_DENIED||t===ie.UNAUTHORIZED_CLIENT?lt.PROVIDER_NOT_ENABLED:lt.UNKNOWN}catch(e){return t}}(r.message,r.status,r.errorCode),r.helpMessage=ft(r.category,{method:null==n?void 0:n.method,errorCode:r.errorCode,code:r.code}),r.loginMethodHint=mt(null==n?void 0:n.method),r.category===lt.RATE_LIMITED&&(r.retryAfter=t.retry_after||t.retryAfter||void 0),r)}return pt(t,e),t.prototype.toJSON=function(){return{name:this.name,message:this.message,code:this.code,errorCode:this.errorCode,status:this.status,requestId:this.requestId,category:this.category,retryAfter:this.retryAfter}},t}(Error),yt=function(){return yt=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},yt.apply(this,arguments)},gt=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())})},bt=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 wt(e,t){var n;return gt(this,void 0,void 0,function(){var r,o=this;return bt(this,function(i){r=function(){return gt(o,void 0,void 0,function(){return bt(this,function(e){switch(e.label){case 0:return e.trys.push([0,1,,6]),[2,__webpack_require__(3171)];case 1:e.sent(),e.label=2;case 2:return e.trys.push([2,4,,5]),[4,Promise.resolve().then(__webpack_require__.bind(__webpack_require__,3171))];case 3:return[2,e.sent()];case 4:return e.sent(),[2];case 5:return[3,6];case 6:return[2]}})})};try{if(((null===(n=null==t?void 0:t.root)||void 0===n?void 0:n.globalThis)||globalThis).IS_MP_BUILD)return[2];if(e)return[2,r()]}catch(t){if(e)return[2,r()]}return[2]})})}var _t=function(){function e(e){var t=e.request,n=e.credentialsClient;if(!n){var r={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 ze(r)}if(!t){var o=n.request.bind(n),i=new at(yt({env:e.env,clientId:e.clientId,request:o,storage:e.storage,adapter:e.adapter,oauthInstance:this},e.captchaOptions));t=i.request.bind(i)}this.config={env:e.env,apiOrigin:e.apiOrigin,apiPath:e.apiPath,clientId:e.clientId,request:t,credentialsClient:n,storage:e.storage||Ve,adapter:e.adapter}}return e.parseParamsToSearch=function(e){return Object.keys(e).forEach(function(t){e[t]||delete e[t]}),new ct(e).toString()},e.prototype.getParamsByVersion=function(e,t){var n,r=(0,Ie.I)(e),o=(null===(n={v2:re}[null==r?void 0:r.version])||void 0===n?void 0:n[t])||ne[t];return r&&delete r.version,{params:r,url:o}},e.prototype.signIn=function(e){return gt(this,void 0,Promise,function(){var t,n,r,o;return bt(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 r=i.sent(),[4,this.config.request(n.url,{method:"POST",body:r})];case 2:return o=i.sent(),[4,this.config.credentialsClient.setCredentials(yt(yt({},o),{version:t}))];case 3:return i.sent(),[2,Promise.resolve(o)]}})})},e.prototype.signInAnonymously=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=!1),gt(this,void 0,Promise,function(){var n;return bt(this,function(r){switch(r.label){case 0:return[4,this.config.request(ne.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 gt(this,void 0,Promise,function(){var t;return bt(this,function(n){switch(n.label){case 0:return[4,this.config.request(ne.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 gt(this,void 0,Promise,function(){var t,n,r,o;return bt(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(ne.AUTH_SIGNOUT_URL,{method:"POST",withCredentials:!0,body:e})];case 2:return t=i.sent(),[3,4];case 3:return(n=i.sent()).error!==ie.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(ne.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 gt(this,void 0,Promise,function(){return bt(this,function(e){switch(e.label){case 0:return[4,this.config.request(ne.AUTH_REVOKE_ALL_URL,{method:"DELETE",withCredentials:!0})];case 1:return e.sent(),[2]}})})},e.prototype.revokeDevice=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){switch(t.label){case 0:return[4,this.config.request(ne.AUTHORIZED_DEVICES_DELETE_URL+e.device_id,{method:"DELETE",withCredentials:!0})];case 1:return t.sent(),[2]}})})},e.prototype.getVerification=function(e,t){return gt(this,void 0,Promise,function(){var n,r;return bt(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,Ie.I)(e)).phone_number&&!/^\+\d{1,3}\s+\d+/.test(r.phone_number)&&(r.phone_number="+86 ".concat(r.phone_number)),[2,this.config.request(ne.VERIFICATION_URL,{method:"POST",body:r,withCaptcha:(null==t?void 0:t.withCaptcha)||!1,withCredentials:n})]}})})},e.prototype.verify=function(e){return gt(this,void 0,Promise,function(){var t,n;return bt(this,function(r){switch(r.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=r.sent(),"v2"!==(null==e?void 0:e.version)?[3,3]:[4,this.config.credentialsClient.setCredentials(yt(yt({},n),{version:"v2"}))];case 2:r.sent(),r.label=3;case 3:return[2,n]}})})},e.prototype.genProviderRedirectUri=function(t){return gt(this,void 0,Promise,function(){var n,r,o,i,a;return bt(this,function(s){return n=t.provider_redirect_uri,r=t.other_params,o=void 0===r?{}:r,i=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}(t,["provider_redirect_uri","other_params"]),n&&!i.redirect_uri&&(i.redirect_uri=n),a="".concat(ne.PROVIDER_URI_URL,"?").concat(e.parseParamsToSearch(i)),Object.keys(o).forEach(function(e){var t=o[e];("sign_out_uri"!==e||(null==t?void 0:t.length)>0)&&(a+="&other_params[".concat(e,"]=").concat(encodeURIComponent(t)))}),[2,this.config.request(a,{method:"GET"})]})})},e.prototype.grantProviderToken=function(e,t){return void 0===t&&(t=!1),gt(this,void 0,Promise,function(){return bt(this,function(n){return[2,this.config.request(ne.PROVIDER_TOKEN_URL,{method:"POST",body:e,useWxCloud:t})]})})},e.prototype.patchProviderToken=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.PROVIDER_TOKEN_URL,{method:"PATCH",body:e})]})})},e.prototype.signInWithProvider=function(e,t){return void 0===t&&(t=!1),gt(this,void 0,Promise,function(){var n,r;return bt(this,function(o){switch(o.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 r=o.sent(),[4,this.config.credentialsClient.setCredentials(yt(yt({},r),{version:(null==e?void 0:e.version)||"v1"}))];case 2:return o.sent(),[2,Promise.resolve(r)]}})})},e.prototype.toBindIdentity=function(e){var t,n;return gt(this,void 0,void 0,function(){var r,o,i,a;return bt(this,function(s){switch(s.label){case 0:return(o=e.credentials)?[3,2]:[4,this.config.credentialsClient.localCredentials.getCredentials()];case 1:o=s.sent(),s.label=2;case 2:r=o,s.label=3;case 3:return s.trys.push([3,5,,6]),[4,this.bindWithProvider({provider_token:e.provider_token},r)];case 4:return s.sent(),i={data:{type:_e,provider:e.provider},error:null},[3,6];case 5:return a=s.sent(),i={data:{type:_e},error:new vt(a)},[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,be,{event:ye,info:i})),[2,i]}})})},e.prototype.getInitialSession=function(){return gt(this,void 0,Promise,function(){var e,t,n,r,o,i,a,s,c,u,l,p,d,h,f;return bt(this,function(m){switch(m.label){case 0:e={},m.label=1;case 1:if(m.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"),r=t.get("state"),!n||!r)return[2,{data:null,error:null}];o=null;try{o=JSON.parse(sessionStorage.getItem(r)||"null")}catch(e){}return e={type:null==o?void 0:o.type},i=t.get("error"),a=t.get("error_description"),i||a?[2,{data:e,error:new vt({message:a||i||"Unknown error from OAuth provider"})}]:(s=(null==o?void 0:o.provider)||t.get("provider"))?(c=location.origin+location.pathname,[4,this.grantProviderToken({provider_id:s,provider_redirect_uri:c,provider_code:n})]):[2,{data:e,error:new vt({message:"Provider is required for OAuth verification"})}];case 2:return u=m.sent().provider_token,l=void 0,p=null,d=void 0,o.type!==_e?[3,5]:[4,this.config.credentialsClient.localCredentials.getCredentials()];case 3:return l=m.sent(),[4,this.toBindIdentity({provider:s,provider_token:u,credentials:l})];case 4:return d=m.sent(),[3,11];case 5:return o.type!==we?[3,11]:(d=this.getParamsByVersion({provider:s},"AUTH_SIGN_IN_WITH_PROVIDER_URL"),[4,this.config.request(d.url,{method:"POST",body:{provider_token:u}})]);case 6:l=m.sent(),m.label=7;case 7:return m.trys.push([7,9,,10]),[4,this.getUserInfo({credentials:l})];case 8:return p=m.sent(),[3,10];case 9:return h=m.sent(),console.error("get user info error",h),[3,10];case 10:d={data:yt(yt({},e),{session:l,user:p}),error:null},m.label=11;case 11:t.delete("code"),t.delete("state"),t.delete("provider"),this.restoreUrlState(void 0===(null==o?void 0:o.search)?"?".concat(t.toString()):o.search,(null==o?void 0:o.hash)||location.hash);try{sessionStorage.removeItem(r)}catch(e){}return[2,d];case 12:return f=m.sent(),[2,{data:e,error:new vt(f)}];case 13:return[2]}})})},e.prototype.signInCustom=function(e){return gt(this,void 0,Promise,function(){var t;return bt(this,function(n){switch(n.label){case 0:return[4,this.config.request(ne.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={}),gt(this,void 0,Promise,function(){var t;return bt(this,function(n){switch(n.label){case 0:return[4,this.config.request(ne.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 gt(this,void 0,Promise,function(){return bt(this,function(n){return[2,this.config.request(ne.PROVIDER_BIND_URL,{method:"POST",body:e,withCredentials:!0,getCredentials:t?function(){return t}:void 0})]})})},e.prototype.getUserProfile=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.getUserInfo(e)]})})},e.prototype.getUserInfo=function(e){var t,n,r;return void 0===e&&(e={}),gt(this,void 0,Promise,function(){var o,i,a,s,c;return bt(this,function(u){switch(u.label){case 0:return o=this.getParamsByVersion(e,"USER_ME_URL"),(null===(t=o.params)||void 0===t?void 0:t.query)&&(i=new ct(o.params.query),o.url+="?".concat(i.toString())),[4,this.config.request(o.url,{method:"GET",withCredentials:!0,getCredentials:e.credentials?function(){return e.credentials}:void 0})];case 1:if((a=u.sent()).sub&&(a.uid=a.sub),null===(n=a.providers)||void 0===n?void 0:n.length)try{"undefined"!=typeof wx&&wx.getAccountInfoSync&&(s=null===(r=wx.getAccountInfoSync().miniProgram)||void 0===r?void 0:r.appId,(null==(c=a.providers.find(function(e){return e.id===s}))?void 0:c.provider_user_id)&&(a.open_id=c.provider_user_id))}catch(e){}return[2,a]}})})},e.prototype.getWedaUserInfo=function(){return gt(this,void 0,Promise,function(){return bt(this,function(e){switch(e.label){case 0:return[4,this.config.request(ne.WEDA_USER_URL,{method:"GET",withCredentials:!0})];case 1:return[2,e.sent()]}})})},e.prototype.deleteMe=function(t){return gt(this,void 0,Promise,function(){var n,r;return bt(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 gt(this,void 0,Promise,function(){return bt(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 gt(this,void 0,Promise,function(){return bt(this,function(e){return[2,this.config.credentialsClient.getCredentialsAsync()]})})},e.prototype.transByProvider=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.USER_TRANS_BY_PROVIDER_URL,{method:"PATCH",body:e,withCredentials:!0})]})})},e.prototype.grantToken=function(e){return gt(this,void 0,Promise,function(){var t;return bt(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 gt(this,void 0,Promise,function(){return bt(this,function(e){return[2,this.config.request(ne.PROVIDER_LIST,{method:"GET",withCredentials:!0})]})})},e.prototype.unbindProvider=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request("".concat(ne.PROVIDER_UNBIND_URL,"/").concat(e.provider_id),{method:"DELETE",withCredentials:!0})]})})},e.prototype.checkPassword=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request("".concat(ne.CHECK_PWD_URL),{method:"POST",withCredentials:!0,body:e})]})})},e.prototype.editContact=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request("".concat(ne.BIND_CONTACT_URL),{method:"PATCH",withCredentials:!0,body:e})]})})},e.prototype.setPassword=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request("".concat(ne.AUTH_SET_PASSWORD),{method:"PATCH",withCredentials:!0,body:e})]})})},e.prototype.updatePasswordByOld=function(e){return gt(this,void 0,Promise,function(){var t;return bt(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 gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request("".concat(ne.SUDO_URL),{method:"POST",withCredentials:!0,body:e})]})})},e.prototype.sendVerificationCodeToCurrentUser=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return e.target="CUR_USER",[2,this.config.request(ne.VERIFICATION_URL,{method:"POST",body:e,withCredentials:!0,withCaptcha:!0})]})})},e.prototype.changeBoundProvider=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request("".concat(ne.PROVIDER_LIST,"/").concat(e.provider_id,"/trans"),{method:"POST",body:{provider_trans_token:e.trans_token},withCredentials:!0})]})})},e.prototype.setUserProfile=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.USER_PRIFILE_URL,{method:"PATCH",body:e,withCredentials:!0})]})})},e.prototype.updateUserBasicInfo=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.USER_BASIC_EDIT_URL,{method:"POST",withCredentials:!0,body:e})]})})},e.prototype.queryUserProfile=function(e){return gt(this,void 0,Promise,function(){var t;return bt(this,function(n){return t=new ct(e),[2,this.config.request("".concat(ne.USER_QUERY_URL,"?").concat(t.toString()),{method:"GET",withCredentials:!0})]})})},e.prototype.setCustomSignFunc=function(e){this.getCustomSignTicketFn=e},e.prototype.signInWithCustomTicket=function(){return gt(this,void 0,Promise,function(){var e,t;return bt(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 gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.AUTH_RESET_PASSWORD,{method:"POST",body:e})]})})},e.prototype.authorize=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.AUTHORIZE_URL,{method:"POST",withCredentials:!0,body:e})]})})},e.prototype.authorizeDevice=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.AUTHORIZE_DEVICE_URL,{method:"POST",withCredentials:!0,body:e})]})})},e.prototype.deviceAuthorize=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.AUTH_GET_DEVICE_CODE,{method:"POST",body:e})]})})},e.prototype.authorizeInfo=function(t){return gt(this,void 0,Promise,function(){var n,r,o;return bt(this,function(i){switch(i.label){case 0:return n="".concat(ne.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 gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.CHECK_USERNAME,{method:"GET",body:e,withCredentials:!0})]})})},e.prototype.checkIfUserExist=function(e){return gt(this,void 0,Promise,function(){var t;return bt(this,function(n){return t=new ct(e),[2,this.config.request("".concat(ne.CHECK_IF_USER_EXIST,"?").concat(t.toString()),{method:"GET"})]})})},e.prototype.loginScope=function(){return gt(this,void 0,Promise,function(){return bt(this,function(e){return[2,this.config.credentialsClient.getScope()]})})},e.prototype.loginGroups=function(){return gt(this,void 0,Promise,function(){return bt(this,function(e){return[2,this.config.credentialsClient.getGroups()]})})},e.prototype.refreshTokenForce=function(e){return gt(this,void 0,void 0,function(){var t;return bt(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(yt(yt({},t),{version:(null==e?void 0:e.version)||"v1"}))];case 2:return[2,n.sent()]}})})},e.prototype.getCredentials=function(){return gt(this,void 0,void 0,function(){return bt(this,function(e){return[2,this.config.credentialsClient.getCredentials()]})})},e.prototype.getPublicKey=function(){return gt(this,void 0,Promise,function(){return bt(this,function(e){return[2,this.config.request(re.AUTH_PUBLIC_KEY,{method:"POST",body:{}})]})})},e.prototype.getEncryptParams=function(e){return gt(this,void 0,Promise,function(){var t,n,r,o,i,a;return bt(this,function(s){switch(s.label){case 0:return t=e.isEncrypt,delete e.isEncrypt,n=(0,Ie.I)(e),[4,wt(t,this.config.adapter)];case 1:if(!(r=s.sent()))return[2,e];o="",i="",s.label=2;case 2:return s.trys.push([2,4,,5]),[4,this.getPublicKey()];case 3:if(a=s.sent(),o=a.public_key,i=a.public_key_thumbprint,!o||!i)throw a;return[3,5];case 4:throw s.sent();case 5:return[2,{params:r.getEncryptInfo({publicKey:o,payload:n}),public_key_thumbprint:i}]}})})},e.prototype.getProviderSubType=function(){return gt(this,void 0,Promise,function(){return bt(this,function(e){return[2,this.config.request(ne.GET_PROVIDER_TYPE,{method:"POST",body:{provider_id:"weda"}})]})})},e.prototype.verifyCaptchaData=function(e){var t=e.token,n=e.key;return gt(this,void 0,void 0,function(){return bt(this,function(e){return[2,this.config.request(ne.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 gt(this,void 0,void 0,function(){return bt(this,function(e){return[2,this.config.request(ne.CAPTCHA_DATA_URL,{method:"POST",body:{state:t,redirect_uri:r},withCredentials:!1})]})})},e.prototype.getMiniProgramCode=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.GET_MINIPROGRAM_QRCODE,{method:"POST",body:e})]})})},e.prototype.getMiniProgramQrCodeStatus=function(e){return gt(this,void 0,Promise,function(){return bt(this,function(t){return[2,this.config.request(ne.GET_MINIPROGRAM_QRCODE_STATUS,{method:"POST",body:e})]})})},e.prototype.getUserBehaviorLog=function(e){return gt(this,void 0,Promise,function(){var t,n;return bt(this,function(r){return t={LOGIN:"query[action]=USER_LOGIN",MODIFY:"ne_query[action]=USER_LOGIN"},n="".concat(ne.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 gt(this,void 0,Promise,function(){var t,n,r,o,i,a;return bt(this,function(s){switch(s.label){case 0:return t="",n="",[4,wt(!0,this.config.adapter)];case 1:if(!(r=s.sent()))throw new Error("do not support encrypt, a encrypt util required.");s.label=2;case 2:return s.trys.push([2,4,,5]),[4,this.getPublicKey()];case 3:if(o=s.sent(),t=o.public_key,n=o.public_key_thumbprint,!t||!n)throw o;return[3,5];case 4:throw s.sent();case 5:return i=e.password?r.getEncryptInfo({publicKey:t,payload:e.password}):"",a=r.getEncryptInfo({publicKey:t,payload:e.new_password}),[2,this.config.request(ne.USER_BASIC_EDIT_URL,{method:"POST",withCredentials:!0,body:{user_id:e.user_id,encrypt_password:i,encrypt_new_password:a,public_key_thumbprint:n}})]}})})},e.prototype.modifyPasswordWithoutLogin=function(e){return gt(this,void 0,Promise,function(){var t,n,r,o,i,a;return bt(this,function(s){switch(s.label){case 0:return t="",n="",[4,wt(!0,this.config.adapter)];case 1:if(!(r=s.sent()))throw new Error("do not support encrypt, a encrypt util required.");s.label=2;case 2:return s.trys.push([2,4,,5]),[4,this.getPublicKey()];case 3:if(o=s.sent(),t=o.public_key,n=o.public_key_thumbprint,!t||!n)throw o;return[3,5];case 4:throw s.sent();case 5:return i=e.password?r.getEncryptInfo({publicKey:t,payload:e.password}):"",a=r.getEncryptInfo({publicKey:t,payload:e.new_password}),[2,this.config.request(re.AUTH_RESET_PASSWORD,{method:"POST",body:{username:e.username,password:i,new_password:a,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}(),xt=function(){return xt=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},xt.apply(this,arguments)},Et=function(){function e(e){var t=e.apiOrigin,n=e.getApiOrigin,r=e.apiPath,o=void 0===r?ce:r,i=e.clientId,a=e.env,s=e.storage,c=e.request,u=e.baseRequest,l=e.anonymousSignInFunc,p=e.wxCloud,d=e.adapter,h=e.onCredentialsError,f=e.headers,m=e.i18n,v=e.useWxCloud,y=e.eventBus,g=e.detectSessionInUrl,b=e.debug;if(this.detectSessionInUrl=null!=g&&g,this.oauth2client=new ze({apiOrigin:t,getApiOrigin:n,apiPath:o,clientId:i,env:a,storage:s,baseRequest:u||c,anonymousSignInFunc:l,wxCloud:p,onCredentialsError:h,headers:f||{},i18n:m,useWxCloud:v,eventBus:y,debug:b}),this.authApi=new _t(xt(xt({credentialsClient:this.oauth2client},e),{request:c?this.oauth2client.request.bind(this.oauth2client):void 0,adapter:d})),g)this.oauth2client.setGetInitialSession(this.authApi.getInitialSession.bind(this.authApi));else try{var w=new URL(window.location.href),_=w.searchParams.get("code"),x=w.searchParams.get("state"),E=JSON.parse(sessionStorage.getItem(x)||"null");_&&x&&(null==E?void 0:E.hash)&&(w.hash=E.hash,window.history.replaceState(null,"",w.toString()),window.location.replace(w.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}(),It=__webpack_require__(794),St=__webpack_require__(141),Ot=__webpack_require__(6197),Tt=__webpack_require__(8182),At=function(){return At=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},At.apply(this,arguments)},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())})},Ct=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])}}},Rt=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 Pt(this,void 0,Promise,function(){return Ct(this,function(t){return[2,this.localStorage.getItem(e)]})})},e.prototype.removeItem=function(e){return Pt(this,void 0,void 0,function(){return Ct(this,function(t){return this.localStorage.removeItem(e),[2]})})},e.prototype.setItem=function(e,t){return Pt(this,void 0,Promise,function(){return Ct(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}(),kt=/^[^:]+:\/\/[^/]+(\/[^?#]+)/,Nt=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,kt.test(i)?RegExp.$1:i),e):(null==e?void 0:e.data)||{}},jt=function(e){return e.adapter&&"default"!==e.adapter.type?function(e,t){var n=At({},e);try{if(!(null==e?void 0:e.storage)&&(null==t?void 0:t.localStorage)&&(n.storage=new Rt({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 r={timeout:1e4,restrictedMethods:["get","post","upload","download","request"],auth:e.auth},o=new t.reqClass(r);n.baseRequest=function(e,t){var n,r,i,a,s;return Pt(this,void 0,void 0,function(){var c,u,l,p;return Ct(this,function(d){switch(d.label){case 0:if(c={},u=(null===(n=t.method)||void 0===n?void 0:n.toLocaleLowerCase())||"post","function"!=typeof(l=null===(i=null===(r=null==o?void 0:o[u])||void 0===r?void 0:r.bind)||void 0===i?void 0:i.call(r,o)))throw new Error("invalid 【".concat(u,"】 request method"));d.label=1;case 1:return d.trys.push([1,3,,4]),(null===(a=t.headers)||void 0===a?void 0:a["content-type"])&&!(null===(s=t.headers)||void 0===s?void 0:s["content-type"].includes("application/json"))||["string","undefined"].includes(typeof t.body)||(t.data=t.data||t.body,t.body=JSON.stringify(t.body)),[4,l(At({url:e},t))];case 2:return c=d.sent(),c=Nt(c,At(At({},t),{url:e})),[3,4];case 3:throw p=d.sent(),c=At(At({},null==p?void 0:p.data),p);case 4:if(null==c?void 0:c.error)throw c;return[2,c]}})})}}}catch(e){console.error("user adapter generate fail:",e)}return n}(e,e.adapter):function(e,t){var n=At({},e),r={};if((null==t?void 0:t.captchaOptions)&&(n.captchaOptions=t.captchaOptions),!u.default.isMatch()||e.storage&&e.baseRequest)return n;try{var o=u.default.genAdapter({}),i=o.localStorage,a=o.reqClass;if(i&&(r.storage=new Rt({localStorage:i,adapter:t})),a){var s=new a({timeout:1e4,restrictedMethods:["get","post","upload","download","request"]});r.request=function(e){return function(t,n){return Pt(this,void 0,void 0,function(){return Ct(this,function(r){return[2,new Promise(function(r,o){var i=Object.assign({},n);i.body&&"string"!=typeof i.body&&(i.body=JSON.stringify(i.body));var a=wx.request({url:t,data:i.body,timeout:e._timeout,method:i.method||"GET",header:i.headers,success:function(e){(e=Nt(e,At(At({},n),{url:t}))).error&&o(e),r(e)},fail:function(e){o({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{a.abort()}catch(e){}}}})})]})})}}(s)}return n.captchaOptions&&(r.baseRequest=r.request,r.request=void 0),At(At({},n),r)}catch(e){console.error("adapter generate fail:",e)}return n}(e,e.adapter)},Lt=function(){return Lt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Lt.apply(this,arguments)},Ut=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])}}},qt=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 Ut(this,void 0,Promise,function(){return Dt(this,function(e){throw new Error("[v1 兼容] WeixinAuthProvider.getRedirectResult() 在当前版本中无法实现。 建议使用 auth.verifyOAuth({ code, state, provider }) 替代。")})})},e.prototype.getLinkRedirectResult=function(e){return Ut(this,void 0,Promise,function(){return Dt(this,function(e){throw new Error("[v1 兼容] WeixinAuthProvider.getLinkRedirectResult() 在当前版本中无法实现。 建议使用 auth.linkIdentity({ provider: 'providerId' }) 替代。")})})},e}(),Mt=function(){function e(e){this.authInstance=e.authInstance}return e.prototype.signIn=function(e){return Ut(this,void 0,Promise,function(){return Dt(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}(),Bt=function(){function e(e){this.authInstance=e.authInstance}return e.prototype.signIn=function(){return Ut(this,void 0,Promise,function(){return Dt(this,function(e){switch(e.label){case 0:return[4,this.authInstance.signInAnonymously({})];case 1:return e.sent(),[2]}})})},e}(),Ft=function(){function e(){}return e.prototype.weixinAuthProvider=function(e){return new qt({authInstance:this,appid:e.appid,scope:e.scope})},e.prototype.customAuthProvider=function(){return new Mt({authInstance:this})},e.prototype.anonymousAuthProvider=function(){return new Bt({authInstance:this})},e.prototype.signUpWithEmailAndPassword=function(e,t){return Ut(this,void 0,Promise,function(){return Dt(this,function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"email must be a string"),"string"!=typeof t&&(0,Je.throwError)(It.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 Ut(this,void 0,Promise,function(){return Dt(this,function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"email must be a string"),"string"!=typeof t&&(0,Je.throwError)(It.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 Ut(this,void 0,Promise,function(){return Dt(this,function(t){switch(t.label){case 0:return"string"!=typeof e&&(0,Je.throwError)(It.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 Ut(this,void 0,Promise,function(){return Dt(this,function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"username must be a string"),"string"!=typeof t&&(0,Je.throwError)(It.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 Ut(this,void 0,Promise,function(){var t;return Dt(this,function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,Je.throwError)(It.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 Ut(this,void 0,Promise,function(){var r;return Dt(this,function(o){switch(o.label){case 0:return"string"!=typeof e&&(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"phoneNumber must be a string"),"string"!=typeof t&&(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"phoneCode must be a string"),r=this.formatPhone(e),[4,this.signUp(Lt({phone_number:r,verification_code:t},n?{password:n}:{}))];case 1:return o.sent(),[2,this.createLoginState()]}})})},e.prototype.signInWithPhoneCodeOrPassword=function(e){return Ut(this,void 0,Promise,function(){var t,n,r,o;return Dt(this,function(i){switch(i.label){case 0:return t=e.phoneNumber,n=e.phoneCode,r=e.password,"string"!=typeof t&&(0,Je.throwError)(It.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,Je.throwError)(It.ERRORS.INVALID_PARAMS,"phoneCode or password must be provided"),i.label=5;case 5:return[2,this.createLoginState()]}})})},e.prototype.forceResetPwdByPhoneCode=function(e){return Ut(this,void 0,Promise,function(){var t,n,r,o;return Dt(this,function(i){switch(i.label){case 0:return t=e.phoneNumber,n=e.phoneCode,r=e.password,"string"!=typeof t&&(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"phoneNumber must be a string"),"string"!=typeof n&&(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"phoneCode must be a string"),"string"!=typeof r&&(0,Je.throwError)(It.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)===pe&&e.call(t)})},e.prototype.onAccessTokenRefreshed=function(e){var t=this;this.onAuthStateChange(function(n){n===me&&e.call(t)})},e.prototype.onAnonymousConverted=function(e){var t=this;this.onAuthStateChange(function(n){n===he&&e.call(t)})},e.prototype.onLoginTypeChanged=function(e){var t=this;this.onAuthStateChange(function(n){n!==he&&n!==de||e.call(t)})},e}(),Wt=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)}}(),Gt=function(){return Gt=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},Gt.apply(this,arguments)},Vt=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},Ht=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},zt=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())})},Kt=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])}}},Jt=function(){return"undefined"!=typeof window&&"undefined"!=typeof document},$t=function(e){return function(t){e.fire(ge,Gt(Gt({},t),{eventType:pe}))}},Yt=["avatar_url","avatarUrl"];function Xt(e){return"undefined"!=typeof TextEncoder?(new TextEncoder).encode(e).length:e.length}function Qt(e,t){if(e)for(var n=0,r=Yt;n<r.length;n++){var o=r[n],i=e[o];if(null!=i&&""!==i){var a=Xt(String(i));if(a>204800)throw new vt({error:"invalid_argument",error_code:ae.INVALID_ARGUMENT,error_description:"auth.".concat(t,'(params): "').concat(o,'" 超过 200KB 限制(当前 ').concat(a," 字节),请传入图片 URL 而非文件内容")},{method:t})}}}var Zt,en=function(){function t(e){var t=e.cache,n=e.oauthInstance;this.cache=t,this.oauthInstance=n,this.setUserInfo()}var n,r,o;return t.prototype.checkLocalInfo=function(){return zt(this,void 0,void 0,function(){return Kt(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]})})},t.prototype.checkLocalInfoAsync=function(){return zt(this,void 0,void 0,function(){var e,t,n,r;return Kt(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]}})})},t.prototype.update=function(e){return zt(this,void 0,Promise,function(){var t;return Kt(this,function(n){switch(n.label){case 0:return Qt(e,"update"),[4,this.oauthInstance.authApi.setUserProfile(Gt({},e))];case 1:return t=n.sent(),this.setLocalUserInfo(t),[2]}})})},t.prototype.updateUserBasicInfo=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){switch(t.label){case 0:return Qt(e,"updateUserBasicInfo"),[4,this.oauthInstance.authApi.updateUserBasicInfo(Gt({},e))];case 1:return t.sent(),[4,this.refresh()];case 2:return t.sent(),[2]}})})},t.prototype.updatePassword=function(e,t){return this.oauthInstance.authApi.updatePasswordByOld({old_password:t,new_password:e})},t.prototype.updateUsername=function(e){return"string"!=typeof e&&(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"username must be a string"),this.update({username:e})},t.prototype.refresh=function(e){return zt(this,void 0,Promise,function(){var t;return Kt(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]}})})},t.prototype.getLocalUserInfo=function(e){var t=this.cache.keys.userInfoKey,n=this.cache.getStore(t);return e?n[e]:n||{}},t.prototype.setLocalUserInfo=function(e){var t=this.cache.keys.userInfoKey;this.cache.setStore(t,e),this.setUserInfo()},t.prototype.getLocalUserInfoAsync=function(e){return zt(this,void 0,Promise,function(){var t;return Kt(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]]}})})},t.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]})},Vt([(0,St.catchErrorsDecorator)({title:"更新用户信息失败",messages:["请确认以下各项:"," 1 - 调用 User.update() 的语法或参数是否正确"," 2 - 用户信息中是否包含非法值","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",["function"==typeof(n=e.UserProfile)?n:Object]),Ht("design:returntype","function"==typeof(r="undefined"!=typeof Promise&&Promise)?r:Object)],t.prototype,"update",null),Vt([(0,St.catchErrorsDecorator)({title:"更新密码失败",messages:["请确认以下各项:"," 1 - 调用 User.updatePassword() 的语法或参数是否正确"," 3 - 新密码中是否包含非法字符","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[String,String]),Ht("design:returntype",void 0)],t.prototype,"updatePassword",null),Vt([(0,St.catchErrorsDecorator)({title:"更新用户名失败",messages:["请确认以下各项:"," 1 - 调用 User.updateUsername() 的语法或参数是否正确"," 2 - 当前环境是否开通了用户名密码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[String]),Ht("design:returntype",void 0)],t.prototype,"updateUsername",null),Vt([(0,St.catchErrorsDecorator)({title:"刷新本地用户信息失败",messages:["请确认以下各项:"," 1 - 调用 User.refresh() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[Object]),Ht("design:returntype","function"==typeof(o="undefined"!=typeof Promise&&Promise)?o:Object)],t.prototype,"refresh",null),t}();(Zt=en).prototype.linkWithTicket=function(e){return Ut(this,void 0,Promise,function(){return Dt(this,function(e){throw new Error("[v1 兼容] User.linkWithTicket() 在当前版本中无法实现。 建议使用 auth.signInWithCustomTicket(() => Promise.resolve(ticket)) 替代。")})})},Zt.prototype.linkWithRedirect=function(e){throw new Error("[v1 兼容] User.linkWithRedirect() 在当前版本中无法实现。 建议使用 auth.linkIdentity({ provider: 'providerId' }) 替代。")},Zt.prototype.updateEmail=function(e,t){return Ut(this,void 0,Promise,function(){return Dt(this,function(t){switch(t.label){case 0:return"string"!=typeof e&&(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"newEmail must be a string"),[4,this.updateUserBasicInfo({email:e})];case 1:return t.sent(),[2]}})})},Zt.prototype.linkWithPhoneNumber=function(e,t){return Ut(this,void 0,Promise,function(){return Dt(this,function(e){throw new Error("[v1 兼容] User.linkWithPhoneNumber() 在当前版本中无法实现。 建议使用 auth.bindPhoneNumber({ phone_number, verification_token, sudo_token }) 替代。")})})},Zt.prototype.updatePhoneNumber=function(e,t){return Ut(this,void 0,Promise,function(){return Dt(this,function(e){throw new Error("[v1 兼容] User.updatePhoneNumber() 在当前版本中无法实现。 建议使用 auth.updateUser({ phone: newPhoneNumber }) 替代。")})})},Zt.prototype.unlink=function(e){return Ut(this,void 0,Promise,function(){return Dt(this,function(e){throw new Error("[v1 兼容] User.unlink() 在当前版本中无法实现。 建议使用 auth.unlinkIdentity({ provider: loginType }) 替代。")})})};var tn=function(){function e(e){var t=e.envId,n=e.cache,r=e.oauthInstance;t||(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"envId is not defined"),this.cache=n,this.oauthInstance=r,this.user=new en({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 zt(this,void 0,void 0,function(){return Kt(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}(),nn=function(t){function n(e){var n=t.call(this)||this;return n.listeners=new Map,n.hasListenerSetUp=!1,n.config=e,n.oauthInstance=e.oauthInstance,n.cache=e.cache,n.init(),n.setAccessKey(),n}var o,i,a,s,c,l,p,d,h,f,m,v,y,g,b,w,_,x,E,I,S;return Wt(n,t),n.prototype.signInAnonymously=function(e){return zt(this,void 0,Promise,function(){var t,n,r,o,i;return Kt(this,function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,this.oauthInstance.authApi.signInAnonymously(e)];case 1:return a.sent(),[4,this.createLoginState()];case 2:return t=a.sent(),[4,this.getSession()];case 3:return n=a.sent().data,r=(void 0===n?{}:n).session,[2,Gt(Gt({},t),{data:{user:r.user,session:r},error:null})];case 4:return o=a.sent(),(i=new vt(o,{method:"signInAnonymously"})).category===lt.PROVIDER_NOT_ENABLED?(console.error(i.helpMessage),console.error("[CloudBase Auth] 提示:匿名登录需要在控制台开启「匿名登录」。\n 如果您需要使用用户名密码登录,请改用 auth.signInWithPassword({ username, password })。\n 不要在匿名登录失败后自动回退到密码登录,这两种方式的使用场景不同。")):(console.warn("[CloudBase Auth] signInAnonymously 失败 [".concat(i.category,"]: ").concat(i.message)),i.loginMethodHint&&console.warn(i.loginMethodHint)),[2,{data:{user:null,session:null},error:i}];case 5:return[2]}})})},n.prototype.signUp=function(e){return zt(this,void 0,Promise,function(){var t,n,r=this;return Kt(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"]],"signUp"),[4,this.getVerification(e.email?{email:e.email,usage:ue.EMAIL}:{phone_number:this.formatPhone(e.phone)})];case 3:return t=o.sent(),[2,{data:{verifyOtp:function(n){var o=n.token,i=n.messageId,a=void 0===i?t.verification_id:i;return zt(r,void 0,Promise,function(){var n,r,i,s,c;return Kt(this,function(u){switch(u.label){case 0:return u.trys.push([0,8,,9]),[4,this.verify({verification_id:a||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(Gt(Gt(Gt({},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 i=u.sent().data,[2,{data:{user:(s=(void 0===i?{}:i).session).user,session:s},error:null}];case 8:return c=u.sent(),[2,{data:{user:null,session:null},error:new vt(c,{method:"signUp"})}];case 9:return[2]}})})}},error:null}];case 4:return n=o.sent(),[2,{data:{user:null,session:null},error:new vt(n,{method:"signUp"})}];case 5:return[2]}})})},n.prototype.signOut=function(e){return zt(this,void 0,Promise,function(){var t,n,r;return Kt(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),t=this.cache.keys.userInfoKey,[4,this.oauthInstance.authApi.signOut(e)];case 1:return n=o.sent(),[4,this.cache.removeStoreAsync(t)];case 2:return o.sent(),this.setAccessKey(),[2,Gt(Gt({},n),{data:{},error:null})];case 3:return r=o.sent(),[2,{data:{},error:new vt(r,{method:"signOut"})}];case 4:return[2]}})})},n.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))}}}}},n.prototype.signInWithPassword=function(e){var t,n;return zt(this,void 0,Promise,function(){var r,o,i,a,s,c,u,l;return Kt(this,function(p){switch(p.label){case 0:return p.trys.push([0,3,,4]),this.validateAtLeastOne(e,[["username"],["email"],["phone"]],"signInWithPassword"),this.validateParams(e,{password:{required:!0,message:"Password is required"}},"signInWithPassword"),r="username"in e?e.username:void 0,o="email"in e?e.email:void 0,i="phone"in e?e.phone:void 0,a=null!==(n=null===(t=e.options)||void 0===t?void 0:t.is_encrypt)&&void 0!==n?n:e.is_encrypt,[4,this.signIn(Gt({username:r||o||this.formatPhone(i),password:e.password},a?{isEncrypt:!0,version:"v2"}:{}))];case 1:return p.sent(),[4,this.getSession()];case 2:return s=p.sent().data,[2,{data:{user:(c=(void 0===s?{}:s).session).user,session:c},error:null}];case 3:return u=p.sent(),(l=new vt(u,{method:"signInWithPassword"})).category===lt.PROVIDER_NOT_ENABLED?console.error(l.helpMessage):l.category===lt.INVALID_CREDENTIALS||l.category===lt.USER_NOT_FOUND?console.warn(l.helpMessage):console.warn("[CloudBase Auth] signInWithPassword 失败 [".concat(l.category,"]: ").concat(l.message)),l.loginMethodHint&&console.info(l.loginMethodHint),[2,{data:{user:null,session:null},error:l}];case 4:return[2]}})})},n.prototype.signInWithIdToken=function(e){return zt(this,void 0,Promise,function(){var t,n,r;return Kt(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"}},"signInWithIdToken"),[4,this.signInWithProvider({provider_id:e.provider,provider_id_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 vt(r,{method:"signInWithIdToken"})}];case 4:return[2]}})})},n.prototype.signInWithOtp=function(e){return zt(this,void 0,Promise,function(){var t,n,r,o,i,a=this;return Kt(this,function(s){switch(s.label){case 0:if(t=e.options,n="email"in e?e.email:void 0,r="phone"in e?e.phone:void 0,!(null==t?void 0:t.emailRedirectTo)&&(void 0===(null==t?void 0:t.shouldCreateUser)||(null==t?void 0:t.shouldCreateUser)))return[2,this.signUp(n?{email:n}:{phone:r})];s.label=1;case 1:return s.trys.push([1,3,,4]),this.validateAtLeastOne(e,[["email"],["phone"]],"signInWithOtp"),[4,this.getVerification(Gt(Gt({email_redirect_to:null==t?void 0:t.emailRedirectTo},n?{email:n,usage:ue.EMAIL}:{phone_number:this.formatPhone(r)}),{target:(null==t?void 0:t.emailRedirectTo)&&(null==t?void 0:t.shouldCreateUser)?"ANY":"USER"}))];case 2:return o=s.sent(),[2,{data:{user:null,session:null,verifyOtp:function(e){var t=e.token,i=e.messageId,s=void 0===i?o.verification_id:i;return zt(a,void 0,Promise,function(){return Kt(this,function(e){return[2,this.verifyOtp(n?{email:n,token:String(t),messageId:s||""}:{phone:r,token:String(t),messageId:s||""})]})})}},error:null}];case 3:return i=s.sent(),[2,{data:{user:null,session:null},error:new vt(i,{method:"signInWithOtp"})}];case 4:return[2]}})})},n.prototype.verifyOAuth=function(e){return zt(this,void 0,Promise,function(){var t,n,o,i,a,s,c,u,l;return Kt(this,function(p){switch(p.label){case 0:t={},p.label=1;case 1:return p.trys.push([1,7,,8]),n=(null==e?void 0:e.code)||r.P6.getQuery("code"),o=(null==e?void 0:e.state)||r.P6.getQuery("state"),n?o?(i=function(e){try{return JSON.parse(sessionStorage.getItem(e))}catch(e){return console.error("Failed to get browser session:",e),null}}(o),t.type=null==i?void 0:i.type,(a=(null==e?void 0:e.provider)||(null==i?void 0:i.provider)||r.P6.getQuery("provider"))?[4,this.grantProviderToken({provider_id:a,provider_redirect_uri:location.origin+location.pathname,provider_code:n})]:[2,{data:Gt(Gt({},t),{user:null,session:null,redirectUrl:null}),error:this.missingRequiredParam("verifyOAuth","provider")}]):[2,{data:{user:null,session:null,redirectUrl:null},error:this.missingRequiredParam("verifyOAuth","state")}]:[2,{data:{user:null,session:null,redirectUrl:null},error:this.missingRequiredParam("verifyOAuth","code")}];case 2:return s=p.sent().provider_token,c=void 0,i.type!==_e?[3,4]:[4,this.oauthInstance.authApi.toBindIdentity({provider_token:s,provider:a,fireEvent:!0})];case 3:return c=p.sent(),[3,6];case 4:return[4,this.signInWithIdToken({token:s})];case 5:(c=p.sent()).data=Gt(Gt({},t),c.data),p.label=6;case 6:return(u=new URLSearchParams(null===location||void 0===location?void 0:location.search)).delete("code"),u.delete("state"),c.data.redirectUrl=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}}(void 0===(null==i?void 0:i.search)?"?".concat(u.toString()):null==i?void 0:i.search,(null==i?void 0:i.hash)||location.hash),function(e){try{return sessionStorage.removeItem(e),!0}catch(e){return console.error("Failed to remove browser session:",e),null}}(o),[2,c];case 7:return l=p.sent(),[2,{data:Gt(Gt({},t),{user:null,session:null,redirectUrl:null}),error:new vt(l,{method:"verifyOAuth"})}];case 8:return[2]}})})},n.prototype.signInWithOAuth=function(e){var t,n,r,o,i;return zt(this,void 0,Promise,function(){var a,s,c,u,l,p,d,h,f;return Kt(this,function(m){switch(m.label){case 0:return m.trys.push([0,2,,3]),this.validateParams(e,{provider:{required:!0,message:"Provider is required"}},"signInWithOAuth"),a=(null===(t=e.options)||void 0===t?void 0:t.redirectTo)||location.href,s=new URL(a),c=s.origin+s.pathname,u=(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:u})];case 1:return l=m.sent().uri,p=decodeURIComponent(l),d=p,(null===(r=e.options)||void 0===r?void 0:r.queryParams)&&(h=new URL(p),Object.entries(e.options.queryParams).forEach(function(e){var t=e[0],n=e[1];h.searchParams.set(t,n)}),d=h.toString()),function(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){console.error("Failed to save to browser session:",e)}}(u,{provider:e.provider,search:s.search,hash:s.hash,type:(null===(o=e.options)||void 0===o?void 0:o.type)||we}),Jt()&&!(null===(i=e.options)||void 0===i?void 0:i.skipBrowserRedirect)&&window.location.assign(d),[2,{data:{url:d,provider:e.provider},error:null}];case 2:return f=m.sent(),[2,{data:{url:null,provider:null},error:new vt(f,{method:"signInWithOAuth"})}];case 3:return[2]}})})},n.prototype.getClaims=function(){return zt(this,void 0,Promise,function(){var e;return Kt(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.getAccessToken()];case 1:return[2,{data: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(function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Illegal base64url string!")}try{return function(e){return decodeURIComponent(Re(e).replace(/(.)/g,function(e){var t=e.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0".concat(t)),"%".concat(t)}))}(t)}catch(e){return Re(t)}}(e))});return{claims:t[1],header:t[0],signature:t[2]}}catch(e){throw new Error("Invalid token specified: ".concat(e)?e.message:0)}}(t.sent().accessToken),error:null}];case 2:return e=t.sent(),[2,{data:{claims:null,header:null,signature:null},error:new vt(e,{method:"getClaims"})}];case 3:return[2]}})})},n.prototype.resetPasswordForEmail=function(e,t){return zt(this,void 0,Promise,function(){var n,r,o,i,a,s,c=this;return Kt(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),this.validateParams({emailOrPhone:e},{emailOrPhone:{required:!0,message:"Email or phone is required"}},"resetPasswordForEmail"),n=(t||{}).redirectTo,r=e.includes("@"),o=void 0,r?o={email:e,usage:ue.RECOVERY}:(i=this.formatPhone(e),o={phone_number:i}),[4,this.getVerification(Gt(Gt({},o),{target:"USER"}))];case 1:return a=u.sent(),[2,{data:{updateUser:function(t){return zt(c,void 0,Promise,function(){var o,i,s,c;return Kt(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"}},"resetPasswordForEmail"),u.label=1;case 1:return u.trys.push([1,5,,6]),[4,this.verify({verification_id:a.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(be,{event:"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&&Jt()&&window.location.assign(n),[2,i];case 5:return s=u.sent(),[2,{data:{user:null,session:null},error:new vt(s,{method:"resetPasswordForEmail"})}];case 6:return[2]}})})}},error:null}];case 2:return s=u.sent(),[2,{data:{updateUser:null},error:new vt(s,{method:"resetPasswordForEmail"})}];case 3:return[2]}})})},n.prototype.resetPasswordForOld=function(e){return zt(this,void 0,Promise,function(){var t,n,r;return Kt(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 vt(r,{method:"resetPasswordForOld"})}];case 4:return[2]}})})},n.prototype.verifyOtp=function(e){return zt(this,void 0,Promise,function(){var t,n,r,o,i,a,s;return Kt(this,function(c){switch(c.label){case 0:return c.trys.push([0,6,,7]),t=e.type,n=String(e.token),r="email"in e?e.email:void 0,o="phone"in e?e.phone:void 0,this.validateParams(e,{token:{required:!0,message:"Token is required"},messageId:{required:!0,message:"messageId is required"}},"verifyOtp"),["phone_change","email_change"].includes(t)?[4,this.verify({verification_id:e.messageId,verification_code:n})]:[3,2];case 1:return c.sent(),[3,4];case 2:return[4,this.signInWithUsername({verificationInfo:{verification_id:e.messageId,is_user:!0},verificationCode:n,username:r||this.formatPhone(o)||"",loginType:r?"email":"phone"})];case 3:c.sent(),c.label=4;case 4:return[4,this.getSession()];case 5:return i=c.sent().data,[2,{data:{user:(a=(void 0===i?{}:i).session).user,session:a},error:null}];case 6:return s=c.sent(),[2,{data:{user:null,session:null},error:new vt(s,{method:"verifyOtp"})}];case 7:return[2]}})})},n.prototype.getSession=function(){return zt(this,void 0,Promise,function(){var e,t,n,r;return Kt(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:Gt(Gt({},e),{user:n}),user:n},error:null}];case 3:return r=o.sent(),[2,{data:{session:null,user:null},error:new vt(r,{method:"getSession"})}];case 4:return[2]}})})},n.prototype.refreshSession=function(e){return zt(this,void 0,Promise,function(){var t,n,r,o,i;return Kt(this,function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,this.oauthInstance.oauth2client.localCredentials.getCredentials()];case 1:return(t=a.sent()).refresh_token=e||t.refresh_token,[4,this.oauthInstance.oauth2client.refreshToken(t)];case 2:return n=a.sent(),[4,this.getUser(!1)];case 3:return r=a.sent().data,[2,{data:{user:o=(void 0===r?{}:r).user,session:Gt(Gt({},n),{user:o})},error:null}];case 4:return i=a.sent(),[2,{data:{user:null,session:null},error:new vt(i,{method:"refreshSession"})}];case 5:return[2]}})})},n.prototype.getUser=function(e){return void 0===e&&(e=!0),zt(this,void 0,Promise,function(){var t,n,r;return Kt(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 vt(r,{method:"getUser"})}];case 4:return[2]}})})},n.prototype.refreshUser=function(){return zt(this,void 0,Promise,function(){var e,t,n;return Kt(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 vt(n,{method:"refreshUser"})}];case 4:return[2]}})})},n.prototype.updateUser=function(e){var t;return zt(this,void 0,Promise,function(){var n,r,o,i,a,s,c,u,l,p,d,h,f,m,v=this;return Kt(this,function(y){switch(y.label){case 0:if(y.trys.push([0,8,,9]),Qt(e,"updateUser"),n=["password","new_password"].find(function(t){var n=e[t];return null!=n&&""!==n}),n)throw new vt({message:'updateUser 不支持更新密码,检测到传入了 "'.concat(n,'" 参数。如需修改密码请使用 resetPasswordForOld(旧密码修改)、resetPasswordForEmail(验证码重置)或 reauthenticate(重新认证后改密)')});if(r=Object.keys(e).some(function(t){return void 0!==e[t]&&null!==e[t]&&""!==e[t]}),!r)throw this.missingRequiredParam("updateUser","(at least one field)");return o=e.email,i=e.phone,a=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}(e,["email","phone"]),c=void 0!==i,u={},(s=void 0!==o)||c?(l=void 0,s?(l={email:e.email,usage:ue.REAUTHENTICATION},p="email_change"):(d=this.formatPhone(e.phone),l={phone_number:d},p="phone_change"),[4,this.getVerification(Gt({},l))]):[3,4];case 1:return h=y.sent(),Object.keys(a).length>0?[4,this.updateUserBasicInfo(a)]:[3,3];case 2:y.sent(),y.label=3;case 3:return u={messageId:h.verification_id,verifyOtp:function(t){return zt(v,void 0,Promise,function(){var n,r,o,i;return Kt(this,function(a){switch(a.label){case 0:return a.trys.push([0,11,,12]),t.email&&e.email===t.email?[4,this.verifyOtp({type:"email_change",email:e.email,token:t.token,messageId:h.verification_id||""})]:[3,3];case 1:return(n=a.sent()).error?[2,n]:[4,this.updateUserBasicInfo({email:e.email})];case 2:return a.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:h.verification_id||""})]:[3,6];case 4:return(n=a.sent()).error?[2,n]:[4,this.updateUserBasicInfo({phone:this.formatPhone(e.phone)})];case 5:return a.sent(),[3,9];case 6:return[4,this.verifyOtp(s?{type:p,email:e.email,token:t.token,messageId:h.verification_id||""}:{type:p,phone:e.phone,token:t.token,messageId:h.verification_id||""})];case 7:return(n=a.sent()).error?[2,n]:[4,this.updateUserBasicInfo(e)];case 8:a.sent(),a.label=9;case 9:return[4,this.getUser(!1)];case 10:return r=a.sent().data.user,null===(i=this.config.eventBus)||void 0===i||i.fire(be,{event:ve}),[2,{data:{user:r},error:null}];case 11:return o=a.sent(),[2,{data:{user:null},error:new vt(o,{method:"updateUser"})}];case 12:return[2]}})})}},[3,6];case 4:return[4,this.updateUserBasicInfo(e)];case 5:y.sent(),y.label=6;case 6:return[4,this.getUser(!1)];case 7:return f=y.sent().data.user,Object.keys(a).length>0&&(null===(t=this.config.eventBus)||void 0===t||t.fire(be,{event:ve})),[2,{data:Gt({user:f},u),error:null}];case 8:return m=y.sent(),[2,{data:{user:null},error:new vt(m,{method:"updateUser"})}];case 9:return[2]}})})},n.prototype.getUserIdentities=function(){var e;return zt(this,void 0,Promise,function(){var t,n;return Kt(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 vt(n,{method:"getUserIdentities"})}];case 3:return[2]}})})},n.prototype.linkIdentity=function(e){return zt(this,void 0,Promise,function(){var t;return Kt(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"}},"linkIdentity"),[4,this.signInWithOAuth({provider:e.provider,options:{type:_e}})];case 1:return n.sent(),[2,{data:{provider:e.provider},error:null}];case 2:return t=n.sent(),[2,{data:{provider:null},error:new vt(t,{method:"linkIdentity"})}];case 3:return[2]}})})},n.prototype.unlinkIdentity=function(e){return zt(this,void 0,Promise,function(){var t;return Kt(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"}},"unlinkIdentity"),[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 vt(t,{method:"unlinkIdentity"})}];case 3:return[2]}})})},n.prototype.reauthenticate=function(){return zt(this,void 0,Promise,function(){var e,t,n,r,o=this;return Kt(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.getUser(!1)];case 1:return e=i.sent().data.user,this.validateAtLeastOne(e,[["email","phone"]],"reauthenticate"),t=e.email?{email:e.email,usage:ue.REAUTHENTICATION}:{phone_number:this.formatPhone(e.phone)},[4,this.getVerification(t)];case 2:return n=i.sent(),[2,{data:{updateUser:function(e){return zt(o,void 0,Promise,function(){var r,o,i,a,s;return Kt(this,function(c){switch(c.label){case 0:this.validateParams(e,{nonce:{required:!0,message:"Nonce is required"}},"reauthenticate"),c.label=1;case 1:return c.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=c.sent(),[4,this.oauthInstance.authApi.sudo({verification_token:r.verification_token})];case 3:return o=c.sent(),[4,this.oauthInstance.authApi.setPassword({new_password:e.password,sudo_token:o.sudo_token})];case 4:return c.sent(),[3,7];case 5:return[4,this.signInWithUsername(Gt(Gt({verificationInfo:n,verificationCode:e.nonce},t),{loginType:t.email?"email":"phone"}))];case 6:c.sent(),c.label=7;case 7:return[4,this.getSession()];case 8:return i=c.sent().data,[2,{data:{user:(a=(void 0===i?{}:i).session).user,session:a},error:null}];case 9:return s=c.sent(),[2,{data:{user:null,session:null},error:new vt(s,{method:"reauthenticate"})}];case 10:return[2]}})})}},error:null}];case 3:return r=i.sent(),[2,{data:{updateUser:null},error:new vt(r,{method:"reauthenticate"})}];case 4:return[2]}})})},n.prototype.resend=function(e){return zt(this,void 0,Promise,function(){var t,n,r;return Kt(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.validateAtLeastOne(e,[["email"],["phone"]],"resend"),t="signup"===e.type?"ANY":"USER",n={target:t},"email"in e&&(n.email=e.email,n.usage=ue.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 vt(r,{method:"resend"})}];case 3:return[2]}})})},n.prototype.setSession=function(e){return zt(this,void 0,Promise,function(){var t,n,r;return Kt(this,function(o){switch(o.label){case 0:return o.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"}},"setSession"),[4,this.oauthInstance.oauth2client.refreshToken(e,{throwError:!0})];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 vt(r,{method:"setSession"})}];case 4:return[2]}})})},n.prototype.exchangeCodeForSession=function(){return zt(this,void 0,void 0,function(){return Kt(this,function(e){return[2]})})},n.prototype.deleteUser=function(e){return zt(this,void 0,Promise,function(){var t,n;return Kt(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"}},"deleteUser"),[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 vt(n,{method:"deleteUser"})}];case 4:return[2]}})})},n.prototype.toDefaultLoginPage=function(e){return void 0===e&&(e={}),zt(this,void 0,Promise,function(){var t,n,r,o,i;return Kt(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("&"),u.default.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 vt(e,{method:"toDefaultLoginPage"})}]}return[2]})})},n.prototype.signInWithCustomTicket=function(e){return zt(this,void 0,Promise,function(){var t,n,r,o;return Kt(this,function(i){switch(i.label){case 0:e&&this.setCustomSignFunc(e),i.label=1;case 1:return i.trys.push([1,5,,6]),[4,this.oauthInstance.authApi.signInWithCustomTicket()];case 2:return i.sent(),[4,this.createLoginState()];case 3:return t=i.sent(),[4,this.getSession()];case 4:return n=i.sent().data,r=(void 0===n?{}:n).session,[2,Gt(Gt({},t),{data:{user:r.user,session:r},error:null})];case 5:return o=i.sent(),[2,{data:{user:null,session:null},error:new vt(o,{method:"signInWithCustomTicket"})}];case 6:return[2]}})})},n.prototype.signInWithOpenId=function(e){var t=(void 0===e?{}:e).useWxCloud,n=void 0===t||t;return zt(this,void 0,Promise,function(){var e,t,r,o,i,a,s=this;return Kt(this,function(c){switch(c.label){case 0:if(!u.default.isMatch())throw Error("wx api undefined");e=wx.getAccountInfoSync().miniProgram,t=function(t){return zt(s,void 0,void 0,function(){var r,o;return Kt(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]}})})},c.label=1;case 1:return c.trys.push([1,5,,6]),[4,new Promise(function(e,n){wx.login({success:function(r){return zt(s,void 0,void 0,function(){var o;return Kt(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 c.sent(),[4,this.createLoginState()];case 3:return r=c.sent(),[4,this.getSession()];case 4:return o=c.sent().data,i=(void 0===o?{}:o).session,[2,Gt(Gt({},r),{data:{user:i.user,session:i},error:null})];case 5:return a=c.sent(),[2,{data:{user:null,session:null},error:new vt(a,{method:"signInWithOpenId"})}];case 6:return[2]}})})},n.prototype.signInWithPhoneAuth=function(e){var t=e.phoneCode,n=void 0===t?"":t,r=e.useWxCloud,o=void 0!==r&&r;return zt(this,void 0,Promise,function(){var e,t,r,i,a,s,c,l,p;return Kt(this,function(d){switch(d.label){case 0:return u.default.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 vt({message:"wx api undefined"})}];case 1:r=d.sent().code,t.provider_code=r,d.label=2;case 2:return d.trys.push([2,5,,6]),[4,this.oauthInstance.authApi.grantProviderToken(t,o)];case 3:if((i=d.sent()).error_code)throw i;return[4,this.oauthInstance.authApi.signInWithProvider({provider_token:i.provider_token},o)];case 4:if(null==(a=d.sent())?void 0:a.error_code)throw a;return[3,6];case 5:return s=d.sent(),[2,{data:{user:null,session:null},error:new vt(s,{method:"signInWithPhoneAuth"})}];case 6:return[4,this.createLoginState()];case 7:return c=d.sent(),[4,this.getSession()];case 8:return l=d.sent().data,p=(void 0===l?{}:l).session,[2,Gt(Gt({},c),{data:{user:p.user,session:p},error:null})]}})})},n.prototype.bindPhoneNumber=function(e){return zt(this,void 0,void 0,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.editContact(e)]})})},n.prototype.unbindProvider=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.unbindProvider(e)]})})},n.prototype.bindEmail=function(e){return this.oauthInstance.authApi.editContact(e)},n.prototype.verify=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.verify(e)]})})},n.prototype.getVerification=function(e,t){return zt(this,void 0,Promise,function(){return Kt(this,function(n){return e.phone_number&&(e.phone_number=this.formatPhone(e.phone_number)),[2,this.oauthInstance.authApi.getVerification(e,t)]})})},Object.defineProperty(n.prototype,"currentUser",{get:function(){if("async"!==this.cache.mode){var e=this.hasLoginState();return e&&e.user||null}(0,Je.printWarn)(It.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getCurrentUser instead")},enumerable:!1,configurable:!0}),n.prototype.getCurrentUser=function(e){return void 0===e&&(e=!0),zt(this,void 0,Promise,function(){var t,n,r;return Kt(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,Gt(Gt({},n.user),r)];case 8:return[2,null]}})})},n.prototype.signInAnonymouslyInWx=function(e){var t=(void 0===e?{}:e).useWxCloud;return zt(this,void 0,Promise,function(){var e,n,r=this;return Kt(this,function(o){switch(o.label){case 0:if(!u.default.isMatch())throw Error("wx api undefined");return e=wx.getAccountInfoSync().miniProgram,n=function(n){return zt(r,void 0,void 0,function(){var r,o;return Kt(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 zt(r,void 0,void 0,function(){var r;return Kt(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})]}})})},n.prototype.bindOpenId=function(){return zt(this,void 0,Promise,function(){var e,t,n=this;return Kt(this,function(r){switch(r.label){case 0:if(!u.default.isMatch())throw Error("wx api undefined");return e=wx.getAccountInfoSync().miniProgram,t=function(t){return zt(n,void 0,void 0,function(){var n;return Kt(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 zt(n,void 0,void 0,function(){var n;return Kt(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]}})})},n.prototype.signInWithUnionId=function(){return zt(this,void 0,Promise,function(){var e=this;return Kt(this,function(t){switch(t.label){case 0:if(!u.default.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 zt(e,void 0,void 0,function(){var e,i,a,s,c;return Kt(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()]}})})},n.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,c=void 0===s?void 0:s;return zt(this,void 0,Promise,function(){return Kt(this,function(e){try{return[2,this.signInWithUsername({verificationInfo:n,verificationCode:o,bindInfo:c,username:a,loginType:"sms"})]}catch(e){throw e}return[2]})})},n.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,c=void 0===s?"":s;return zt(this,void 0,Promise,function(){return Kt(this,function(e){try{return[2,this.signInWithUsername({verificationInfo:n,verificationCode:o,bindInfo:a,username:c,loginType:"email"})]}catch(e){throw e}return[2]})})},n.prototype.setCustomSignFunc=function(e){this.oauthInstance.authApi.setCustomSignFunc(e)},n.prototype.signIn=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.signIn(e)];case 1:return t.sent(),[2,this.createLoginState(e)]}})})},n.prototype.setPassword=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.setPassword(e)]})})},n.prototype.isUsernameRegistered=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){switch(t.label){case 0:return"string"!=typeof e&&(0,Je.throwError)(It.ERRORS.INVALID_PARAMS,"username must be a string"),[4,this.oauthInstance.authApi.checkIfUserExist({username:e})];case 1:return[2,t.sent().exist]}})})},n.prototype.hasLoginState=function(){var e;if("async"!==this.cache.mode)return(null===(e=this.oauthInstance)||void 0===e?void 0:e.authApi.hasLoginStateSync())?new tn({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance}):null;(0,Je.printWarn)(It.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getLoginState instead")},n.prototype.getLoginState=function(){return zt(this,void 0,Promise,function(){var e;return Kt(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 tn({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance})]:[2,null]}})})},n.prototype.getUserInfo=function(){return zt(this,void 0,Promise,function(){return Kt(this,function(e){return[2,this.getCurrentUser()]})})},n.prototype.getWedaUserInfo=function(){return zt(this,void 0,Promise,function(){return Kt(this,function(e){return[2,this.oauthInstance.authApi.getWedaUserInfo()]})})},n.prototype.updateUserBasicInfo=function(e){return zt(this,void 0,void 0,function(){var t;return Kt(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]}})})},n.prototype.getAuthHeader=function(){return console.error("Auth.getAuthHeader API 已废弃"),{}},n.prototype.bindWithProvider=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.bindWithProvider(e)]})})},n.prototype.queryUser=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.queryUserProfile(e)]})})},n.prototype.getAccessToken=function(){return zt(this,void 0,Promise,function(){return Kt(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}]}})})},n.prototype.grantProviderToken=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.grantProviderToken(e)]})})},n.prototype.patchProviderToken=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.patchProviderToken(e)]})})},n.prototype.signInWithProvider=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.signInWithProvider(e)];case 1:return t.sent(),[2,this.createLoginState(e)]}})})},n.prototype.signInWithWechat=function(e){return void 0===e&&(e={}),zt(this,void 0,void 0,function(){return Kt(this,function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.signInWithWechat(e)];case 1:return t.sent(),[2,this.createLoginState(e)]}})})},n.prototype.grantToken=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.grantToken(e)];case 1:return t.sent(),[2,this.createLoginState()]}})})},n.prototype.genProviderRedirectUri=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.genProviderRedirectUri(e)]})})},n.prototype.resetPassword=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.resetPassword(e)]})})},n.prototype.deviceAuthorize=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.deviceAuthorize(e)]})})},n.prototype.sudo=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.sudo(e)]})})},n.prototype.deleteMe=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.deleteMe(e)]})})},n.prototype.getProviders=function(){return zt(this,void 0,Promise,function(){return Kt(this,function(e){return[2,this.oauthInstance.authApi.getProviders()]})})},n.prototype.loginScope=function(){return zt(this,void 0,Promise,function(){return Kt(this,function(e){return[2,this.oauthInstance.authApi.loginScope()]})})},n.prototype.loginGroups=function(){return zt(this,void 0,Promise,function(){return Kt(this,function(e){return[2,this.oauthInstance.authApi.loginGroups()]})})},n.prototype.onLoginStateChanged=function(e){var t;return zt(this,void 0,void 0,function(){var n,r=this;return Kt(this,function(o){switch(o.label){case 0:return null===(t=this.config.eventBus)||void 0===t||t.on(ge,function(t){return zt(r,void 0,void 0,function(){var n,r,o;return Kt(this,function(i){switch(i.label){case 0:return(null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.eventType)===pe?[3,2]:[4,this.getLoginState()];case 1:return r=i.sent(),[3,3];case 2:r={},i.label=3;case 3:return n=r,e.call(this,Gt(Gt({},t),n)),[2]}})})}),[4,this.getLoginState()];case 1:return n=o.sent(),e.call(this,n),[2]}})})},n.prototype.refreshTokenForce=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.refreshTokenForce(e)]})})},n.prototype.getCredentials=function(){return zt(this,void 0,Promise,function(){return Kt(this,function(e){return[2,this.oauthInstance.authApi.getCredentials()]})})},n.prototype.setCredentials=function(e){return zt(this,void 0,void 0,function(){return Kt(this,function(t){switch(t.label){case 0:return[4,this.oauthInstance.oauth2client.setCredentials(e)];case 1:return t.sent(),[2]}})})},n.prototype.getProviderSubType=function(){return zt(this,void 0,Promise,function(){return Kt(this,function(e){return[2,this.oauthInstance.authApi.getProviderSubType()]})})},n.prototype.createCaptchaData=function(e){return zt(this,void 0,void 0,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.createCaptchaData(e)]})})},n.prototype.verifyCaptchaData=function(e){return zt(this,void 0,void 0,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.verifyCaptchaData(e)]})})},n.prototype.getMiniProgramQrCode=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.getMiniProgramCode(e)]})})},n.prototype.getMiniProgramQrCodeStatus=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.getMiniProgramQrCodeStatus(e)]})})},n.prototype.modifyPassword=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.modifyPassword(e)]})})},n.prototype.modifyPasswordWithoutLogin=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.modifyPasswordWithoutLogin(e)]})})},n.prototype.getUserBehaviorLog=function(e){return zt(this,void 0,Promise,function(){return Kt(this,function(t){return[2,this.oauthInstance.authApi.getUserBehaviorLog(e)]})})},n.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,i=e.username,a=void 0===i?"":i,s=e.bindInfo,c=void 0===s?void 0:s,u=e.loginType,l=void 0===u?"":u;return zt(this,void 0,Promise,function(){var e,t,r,i,s,u,p;return Kt(this,function(d){switch(d.label){case 0:return d.trys.push([0,8,,9]),[4,this.oauthInstance.authApi.verify({verification_id:n.verification_id,verification_code:o})];case 1:if(null==(e=d.sent())?void 0:e.error_code)throw e;return t=e.verification_token,r=this.formatPhone(a),i={phone_number:r},"email"===l&&(i={email:r=a}),n.is_user?[4,this.oauthInstance.authApi.signIn({username:r,verification_token:t})]:[3,5];case 2:if(null==(s=d.sent())?void 0:s.error_code)throw s;return c?[4,this.oauthInstance.authApi.bindWithProvider({provider_token:null==c?void 0:c.providerToken})]:[3,4];case 3:if(null==(u=d.sent())?void 0:u.error_code)throw u;d.label=4;case 4:return[3,7];case 5:return[4,this.oauthInstance.authApi.signUp(Gt(Gt({},i),{verification_token:t,provider_token:null==c?void 0:c.providerId}))];case 6:if(null==(p=d.sent())?void 0:p.error_code)throw p;d.label=7;case 7:return[2,this.createLoginState()];case 8:throw d.sent();case 9:return[2]}})})},n.prototype.createLoginState=function(e,t){return zt(this,void 0,Promise,function(){var n;return Kt(this,function(r){switch(r.label){case 0:return[4,(n=new tn({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance})).checkLocalStateAsync()];case 1:return r.sent(),(null==t?void 0:t.userInfo)?(n.user.setLocalUserInfo(t.userInfo),[3,5]):[3,2];case 2:return(null==t?void 0:t.asyncRefreshUser)?(n.user.refresh(e),[3,5]):[3,3];case 3:return[4,n.user.refresh(e)];case 4:r.sent(),r.label=5;case 5:return[2,n]}})})},n.prototype.setAccessKey=function(){var e,t;return zt(this,void 0,void 0,function(){var n,r;return Kt(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=xe),!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]})})},n.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)},n.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)}})})},n.prototype.setupListeners=function(){var e,t=this;null===(e=this.config.eventBus)||void 0===e||e.on(be,function(e){return zt(t,void 0,void 0,function(){var t,n,r,o,i,a,s;return Kt(this,function(c){switch(c.label){case 0:return t=null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.event,n=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.info,t!==he||n?[3,2]:[4,this.getUser(!0)];case 1:r=c.sent().data,(o=(void 0===r?{}:r).user)&&(n={user:o}),c.label=2;case 2:return[4,this.getSession()];case 3:return i=c.sent().data.session,this.notifyListeners(t,i,n),[2]}})})})},n.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}},n.prototype.missingRequiredParam=function(e,t){return new vt({error:"missing_required_param",error_code:4e3,error_description:"auth.".concat(e,"(params): missing required param '").concat(t,"'")},{method:e})},n.prototype.validateParams=function(e,t,n){for(var r=0,o=Object.entries(t);r<o.length;r++){var i=o[r],a=i[0];if(i[1].required&&(void 0===(null==e?void 0:e[a])||null===(null==e?void 0:e[a])||""===(null==e?void 0:e[a])))throw this.missingRequiredParam(n,a)}},n.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 this.missingRequiredParam(n,t.map(function(e){return e.join("|")}).join("|"))},n.prototype.init=function(){var e;return zt(this,void 0,Promise,function(){return Kt(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()&&!this.oauthInstance.oauth2client.initSessionEmitted&&(null===(e=this.config.eventBus)||void 0===e||e.fire(be,{event:fe})),[3,3];case 2:return t.sent(),[3,3];case 3:return[2,{error:null}]}})})},Vt([(0,St.catchErrorsDecorator)({title:"绑定手机号失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindPhoneNumber() 的语法或参数是否正确"," 2 - 当前环境是否开通了短信验证码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",["function"==typeof(o=e.BindPhoneRequest)?o:Object]),Ht("design:returntype",Promise)],n.prototype,"bindPhoneNumber",null),Vt([(0,St.catchErrorsDecorator)({title:"解除三方绑定失败",messages:["请确认以下各项:"," 1 - 调用 auth().unbindProvider() 的语法或参数是否正确"," 2 - 当前账户是否已经与此登录方式解绑","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",["function"==typeof(i=e.UnbindProviderRequest)?i:Object]),Ht("design:returntype","function"==typeof(a="undefined"!=typeof Promise&&Promise)?a:Object)],n.prototype,"unbindProvider",null),Vt([(0,St.catchErrorsDecorator)({title:"绑定邮箱地址失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindEmail() 的语法或参数是否正确"," 2 - 当前环境是否开通了邮箱密码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",["function"==typeof(s=e.BindEmailRequest)?s:Object]),Ht("design:returntype",void 0)],n.prototype,"bindEmail",null),Vt([(0,St.catchErrorsDecorator)({title:"验证码验证失败",messages:["请确认以下各项:"," 1 - 调用 auth().verify() 的语法或参数是否正确"," 2 - 当前环境是否开通了手机验证码/邮箱登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",["function"==typeof(c=e.VerifyRequest)?c:Object]),Ht("design:returntype","function"==typeof(l="undefined"!=typeof Promise&&Promise)?l:Object)],n.prototype,"verify",null),Vt([(0,St.catchErrorsDecorator)({title:"获取验证码失败",messages:["请确认以下各项:"," 1 - 调用 auth().getVerification() 的语法或参数是否正确"," 2 - 当前环境是否开通了手机验证码/邮箱登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",["function"==typeof(p=e.GetVerificationRequest)?p:Object,Object]),Ht("design:returntype","function"==typeof(d="undefined"!=typeof Promise&&Promise)?d:Object)],n.prototype,"getVerification",null),Vt([(0,St.catchErrorsDecorator)({title:"获取用户信息失败",messages:["请确认以下各项:"," 1 - 调用 auth().getCurrentUser() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[Object]),Ht("design:returntype","function"==typeof(h="undefined"!=typeof Promise&&Promise)?h:Object)],n.prototype,"getCurrentUser",null),Vt([(0,St.catchErrorsDecorator)({title:"小程序匿名登录失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了匿名登录"," 2 - 调用 auth().signInAnonymouslyInWx() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[Object]),Ht("design:returntype","function"==typeof(f="undefined"!=typeof Promise&&Promise)?f:Object)],n.prototype,"signInAnonymouslyInWx",null),Vt([(0,St.catchErrorsDecorator)({title:"小程序绑定OpenID失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序openId静默登录"," 2 - 调用 auth().bindOpenId() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[]),Ht("design:returntype","function"==typeof(m="undefined"!=typeof Promise&&Promise)?m:Object)],n.prototype,"bindOpenId",null),Vt([(0,St.catchErrorsDecorator)({title:"小程序unionId静默登录失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序unionId静默登录"," 2 - 调用 auth().signInWithUnionId() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[]),Ht("design:returntype","function"==typeof(v="undefined"!=typeof Promise&&Promise)?v:Object)],n.prototype,"signInWithUnionId",null),Vt([(0,St.catchErrorsDecorator)({title:"短信验证码登陆",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序短信验证码登陆"," 2 - 调用 auth().signInWithSms() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[Object]),Ht("design:returntype","function"==typeof(y="undefined"!=typeof Promise&&Promise)?y:Object)],n.prototype,"signInWithSms",null),Vt([(0,St.catchErrorsDecorator)({title:"邮箱验证码登陆",messages:["请确认以下各项:"," 1 - 当前环境是否开启了邮箱登陆"," 2 - 调用 auth().signInWithEmail() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[Object]),Ht("design:returntype","function"==typeof(g="undefined"!=typeof Promise&&Promise)?g:Object)],n.prototype,"signInWithEmail",null),Vt([(0,St.catchErrorsDecorator)({title:"获取用户是否被占用失败",messages:["请确认以下各项:"," 1 - 调用 auth().isUsernameRegistered() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[String]),Ht("design:returntype","function"==typeof(b="undefined"!=typeof Promise&&Promise)?b:Object)],n.prototype,"isUsernameRegistered",null),Vt([(0,St.catchErrorsDecorator)({title:"获取本地登录态失败",messages:["请确认以下各项:"," 1 - 调用 auth().getLoginState() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[]),Ht("design:returntype","function"==typeof(w="undefined"!=typeof Promise&&Promise)?w:Object)],n.prototype,"getLoginState",null),Vt([(0,St.catchErrorsDecorator)({title:"获取用户信息失败",messages:["请确认以下各项:"," 1 - 是否已登录"," 2 - 调用 auth().getUserInfo() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[]),Ht("design:returntype","function"==typeof(_="undefined"!=typeof Promise&&Promise)?_:Object)],n.prototype,"getUserInfo",null),Vt([(0,St.catchErrorsDecorator)({title:"获取微搭插件用户信息失败",messages:["请确认以下各项:"," 1 - 是否已登录"," 2 - 调用 auth().getWedaUserInfo() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[]),Ht("design:returntype","function"==typeof(x="undefined"!=typeof Promise&&Promise)?x:Object)],n.prototype,"getWedaUserInfo",null),Vt([(0,St.catchErrorsDecorator)({title:"绑定第三方登录方式失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindWithProvider() 的语法或参数是否正确"," 2 - 此账户是否已经绑定此第三方","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",["function"==typeof(E=e.BindWithProviderRequest)?E:Object]),Ht("design:returntype","function"==typeof(I="undefined"!=typeof Promise&&Promise)?I:Object)],n.prototype,"bindWithProvider",null),Vt([(0,St.catchErrorsDecorator)({title:"获取身份源类型",messages:["请确认以下各项:"," 1 - 调用 auth().getProviderSubType() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(It.COMMUNITY_SITE_URL)]}),Ht("design:type",Function),Ht("design:paramtypes",[]),Ht("design:returntype","function"==typeof(S="undefined"!=typeof Promise&&Promise)?S:Object)],n.prototype,"getProviderSubType",null),n}(Ft),rn="auth";function on(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 an={name:"auth",namespace:rn,entity:function(e){var t=function(e){var t,n=this;if(this.authInstance&&!e)return this.authInstance;e=e||{region:"",persistence:"local",apiPath:ce};var r=this.platform.adapter,o=e.persistence||r.primaryStorage;o&&o!==this.config.persistence&&this.updateConfig({persistence:o});var i=function(e,t){var n,r,o,i,a=this,s=e.region,c=void 0===s?"ap-shanghai":s,u=e.i18n,l=e.accessKey,p=e.useWxCloud,d=(null==t?void 0:t.platform)||Tt.useDefaultAdapter.bind(t)(),h=d.runtime,f=d.adapter,m=t||{},v=m.env,y=m.clientId,g=m.debug,b=m.cache,w=m.app,_=m.getApiOrigin,x=(t||{}).apiOrigin;x||(x="https://".concat(v,".").concat(c,".tcb-api.tencentcloudapi.com"));var E={env:v,clientId:y,i18n:u,accessKey:l,useWxCloud:p,eventBus:new Ke.CloudbaseEventEmitter},I=new Et(jt(Gt(Gt({},E),{apiOrigin:x,getApiOrigin:_,apiPath:(null==e?void 0:e.apiPath)||ce,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:f,onCredentialsError:$t(E.eventBus),headers:Gt({"X-SDK-Version":"@cloudbase/js-sdk/".concat(e.sdkVersion)},e.headers||{}),detectSessionInUrl:e.detectSessionInUrl,debug:g,auth:null===(r=null===(n=t.app)||void 0===n?void 0:n.config)||void 0===r?void 0:r.auth}))),S=new nn(Gt(Gt({},E),{region:c,persistence:e.persistence,debug:g,cache:b||new Ot.CloudbaseCache({persistence:e.persistence,keys:{userInfoKey:"user_info_".concat(v)},platformInfo:d}),runtime:h||"web",_fromApp:w,oauthInstance:I,auth:null===(i=null===(o=t.app)||void 0===o?void 0:o.config)||void 0===i?void 0:i.auth}));return I.initializeSession(function(e,t){return zt(a,void 0,void 0,function(){return Kt(this,function(n){return e?(e.type===we?t?E.eventBus.fire(be,{event:he,info:Gt(Gt({},e),{error:t})}):e.user&&S.createLoginState({},{userInfo:e.user}):e.type===_e&&E.eventBus.fire(be,{event:ye,info:Gt(Gt({},e),{error:t})}),[2]):[2]})})}),{authInstance:S,oauthInstance:I}}(Gt(Gt({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}),a=i.authInstance,s=i.oauthInstance;return this.oauthInstance=s,this.authInstance=a,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=on(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[rn]=r,r}};try{cloudbase.registerComponent(an)}catch(e){}var sn=__webpack_require__(3388),cn=function(){return cn=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},cn.apply(this,arguments)},un=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())})},ln=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])}}},pn=r._G.Sg,dn="cloudrun",hn=function(){function e(){}return e.prototype.callContainer=function(e,t){return un(this,void 0,void 0,function(){var n,r,o;return ln(this,function(i){switch(i.label){case 0:if(n=e.name,r=e.data,!n)throw new Error(JSON.stringify({code:pn.INVALID_PARAMS,msg:"[".concat(dn,".callContainer] invalid name")}));try{o=r?JSON.stringify(r):""}catch(e){throw new Error(JSON.stringify({code:pn.INVALID_PARAMS,msg:"[".concat(dn,".callContainer] invalid data")}))}return[4,fn.call(this,cn(cn({},e),{data:o}),t)];case 1:return[2,i.sent()]}})})},e}();function fn(e,t){var n;return un(this,void 0,void 0,function(){var r,o,i,a,s,c,u,l,p,d,h,f,m,v,y;return ln(this,function(g){switch(g.label){case 0:if(r=e.name,o=e.data,i=e.path,a=void 0===i?"":i,s=e.method,c=e.header,u=void 0===c?{}:c,l=this.getEndPointWithKey("GATEWAY"),p=l.BASE_URL,d=l.PROTOCOL,h="".concat(d).concat(p,"/cloudrun/").concat(r),f=a.startsWith("/")?a:"/".concat(a),m=["GET","HEAD"].includes(null===(n=null==s?void 0:s.toUpperCase)||void 0===n?void 0:n.call(s)))try{v={};try{v=JSON.parse(o)}catch(e){v=o||{}}f="".concat(f).concat(f.includes("?")?"&":"?").concat(Object.keys(v).map(function(e){return"".concat(e,"=").concat(v[e])}).join("&"))}catch(e){}return[4,this.request.fetch(cn(cn({method:s||"POST",headers:Object.assign({},{"Content-Type":"application/json; charset=utf-8"},u)},m?{}:{body:o}),{url:"".concat(h).concat(f),customReqOpts:t}))];case 1:return y=g.sent(),"node-sdk"===(null==t?void 0:t.from)?[2,y]:[4,y.data];case 2:return[2,g.sent()]}})})}var mn=new hn,vn={name:dn,entity:{callContainer:mn.callContainer}};try{cloudbase.registerComponent(vn)}catch(e){}function yn(e){try{e.registerComponent(vn)}catch(e){console.warn(e)}}try{window.registerCloudrun=yn}catch(e){}var gn=function(){return gn=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},gn.apply(this,arguments)},bn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},wn=r._G.eX,_n=r._G.Sg,xn=r._G.vM,En=r.P6.execCallback,In=r.P6.createCloudbaseError,Sn=r.P6.resolveThrow,On=r.P6.maybeThrow,Tn=r.BM.D,An="functions",Pn=function(){function e(){}var t,n,o;return e.prototype.callFunction=function(e,t,n){var o,i,a,s,c,u,l;return s=this,c=void 0,l=function(){var s,c,u,l,p,d,h,f,m,v,y,g,b,w,_,x,E,I,S,O,T,A,P,C;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(R){switch(R.label){case 0:if(s=e.name,c=e.data,u=e.query,l=e.parse,p=e.search,d=e.type,h=e.path,f=void 0===h?"":h,m=e.method,v=e.header,y=void 0===v?{}:v,b=(g=this).request,w=g.config,!s)return[2,On(w,{code:_n.INVALID_PARAMS,msg:"[".concat(An,".callFunction] invalid function name")})];try{_=c?JSON.stringify(c):""}catch(e){return[2,On(w,{code:_n.INVALID_PARAMS,msg:"[".concat(An,".callFunction] invalid data")})]}return"cloudrun"!==d?[3,2]:(x=r.P6.generateRequestId(),[4,fn.call(this,{name:s,data:_,path:f,method:m,header:gn(gn({},y),{"X-Request-Id":x})})]);case 1:return[2,{result:P=R.sent(),requestId:x}];case 2:E="functions.invokeFunction",I={inQuery:u,parse:l,search:p,function_name:s,request_data:_},S={},O=!("GATEWAY"!==w.endPointMode||(k=s,"lcap-common-service"===k||"lcap-datasource-test"===k||k.startsWith("lcap-data")||k.startsWith("lowcode-datasource")||"cloudbase_module"===k)||function(e){return"lowcode-wx-datasource"===e}(s)),R.label=3;case 3:return R.trys.push([3,8,,9]),O?[4,b.gateWay(gn(gn({},e),{path:"functions"}),n)]:[3,5];case 4:return T=R.sent(),S=gn({requestId:T.requestId},(null===(o=T.data)||void 0===o?void 0:o.code)?T.data:{data:{response_data:T.data}}),[3,7];case 5:return[4,b.send(E,I,{endPointMode:"CLOUD_API",defaultQuery:(null===(i=null==c?void 0:c.params)||void 0===i?void 0:i.action)?{action:null===(a=null==c?void 0:c.params)||void 0===a?void 0:a.action}:{}},n)];case 6:S=R.sent(),R.label=7;case 7:if(S.code){if(A=S.message||S.msg||"",function(e){return Sn(e)}(w))throw In({code:S.code,msg:A,requestId:S.requestId},null==w?void 0:w.errorFactory);return[2,En(t,null,{code:S.code,message:A,requestId:S.requestId})]}if(P=S.data.response_data,l||O)return[2,En(t,null,{result:P,requestId:S.requestId})];try{return P=JSON.parse(S.data.response_data),[2,En(t,null,{result:P,requestId:S.requestId})]}catch(e){En(t,new Error("[".concat(wn(),"][").concat(_n.INVALID_PARAMS,"][").concat(An,".callFunction] response data must be json")))}return[3,9];case 8:return C=R.sent(),En(t,C),[3,9];case 9:return[2]}var k})},new((u=void 0)||(u=Promise))(function(e,t){function n(e){try{o(l.next(e))}catch(e){t(e)}}function r(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){var o;t.done?e(t.value):(o=t.value,o instanceof u?o:new u(function(e){e(o)})).then(n,r)}o((l=l.apply(s,c||[])).next())})},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);i>3&&a&&Object.defineProperty(t,n,a)}([Tn({customInfo:{className:"Cloudbase",methodName:"callFunction"},title:"函数调用失败",messages:["请确认以下各项:"," 1 - 调用 callFunction() 的语法或参数是否正确"," 2 - 当前环境下是否存在此函数"," 3 - 函数安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(xn)]}),bn("design:type",Function),bn("design:paramtypes",["function"==typeof(t=void 0!==sn.ICallFunctionOptions&&sn.ICallFunctionOptions)?t:Object,"function"==typeof(n="undefined"!=typeof Function&&Function)?n:Object,"function"==typeof(o=void 0!==sn.ICustomReqOpts&&sn.ICustomReqOpts)?o:Object]),bn("design:returntype",Promise)],e.prototype,"callFunction",null),e}(),Cn=new Pn,Rn={name:An,entity:{callFunction:Cn.callFunction}};try{cloudbase.registerComponent(Rn)}catch(e){}var kn=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)}}(),Nn=function(e){function t(t){var n=e.call(this,t)||this;return n.__isStorageError=!0,n.name="StorageError",n}return kn(t,e),t}(Error);function jn(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}var Ln,Un=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 kn(t,e),t.prototype.toJSON=function(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}},t}(Nn);function Dn(){return globalThis.Buffer}function qn(e){var t=Dn();return t?t.from(e).toString("base64"):btoa(e)}function Mn(e){return e.split("/").map(function(e){return encodeURIComponent(e)}).join("/")}kn(function(e,t){var n=Ln.call(this,e)||this;return n.name="StorageUnknownError",n.originalError=t,n},Ln=Nn);var Bn=function(){return Bn=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},Bn.apply(this,arguments)},Fn=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())})},Wn=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])}}},Gn="/v1/storages";function Vn(e,t){return Fn(this,void 0,Promise,function(){var n;return Wn(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 jn(n)?[2,{data:null,error:n}]:[2,{data:null,error:new Nn((null==n?void 0:n.message)||String(n))}];case 3:return[2]}})})}var Hn=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(Gn).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(Gn).concat(e.startsWith("/")?"":"/").concat(e):e},e.prototype.send=function(e){return Fn(this,void 0,Promise,function(){var t,n,r,o,i,a;return Wn(this,function(s){switch(s.label){case 0:return t=this.buildUrl(e.path,e.query),n=e.method.toUpperCase(),r=["GET","HEAD"].includes(n),o=Bn({},e.headers||{}),r||(void 0!==e.rawBody?i=e.rawBody:void 0!==e.json&&(o["Content-Type"]=o["Content-Type"]||"application/json",i=JSON.stringify(e.json))),[4,this.request.fetch(Bn(Bn(Bn(Bn({url:t,method:n,headers:o},void 0!==i?{body:i}:{}),{withCredentials:!1!==e.withCredentials,shouldThrowOnError:!1}),e.signal?{signal:e.signal}:{}),e.cache?{cache:e.cache}:{}))];case 1:return a=s.sent(),[2,this.unwrap(a,t)]}})})},e.prototype.download=function(e){var t,n;return Fn(this,void 0,Promise,function(){var r,o,i,a;return Wn(this,function(s){switch(s.label){case 0:return r=this.buildUrl(e.path,e.query),[4,this.request.fetch(Bn(Bn({url:r,method:"GET",headers:Bn({},e.headers||{}),stream:!0,withCredentials:!1!==e.withCredentials,shouldThrowOnError:!1},e.signal?{signal:e.signal}:{}),e.cache?{cache:e.cache}:{}))];case 1:if(o=s.sent(),null===(t=e.signal)||void 0===t?void 0:t.aborted)throw new Un("The download was aborted",0,"STORAGE_PG_ABORTED");if(304===(i=Number(null!==(n=null==o?void 0:o.statusCode)&&void 0!==n?n:200)))throw new Un("Not Modified",i,"STORAGE_PG_NOT_MODIFIED");if(i>=400)throw new Un("Download failed with status ".concat(i),i,"STORAGE_PG_REQUEST_FAIL");if(!(a=null==o?void 0:o.response))throw new Un("Underlying adapter did not expose the raw Response",i,"STORAGE_PG_NO_RESPONSE");return[2,{response:a,status:i,header:null==o?void 0:o.header}]}})})},e.prototype.unwrap=function(e,t){var n,r;return Fn(this,void 0,Promise,function(){var o,i,a,s;return Wn(this,function(c){switch(c.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),i=null==e?void 0:e.data,c.label=1;case 1:return c.trys.push([1,3,,4]),[4,i];case 2:return i=c.sent(),[3,4];case 3:return c.sent(),i=void 0,[3,4];case 4:if(o>=200&&o<300)return[2,i];throw a=(null==i?void 0:i.code)||(null==i?void 0:i.error)||"STORAGE_PG_REQUEST_FAIL",s=(null==i?void 0:i.message)||"Storage request failed with status ".concat(o,": ").concat(t),new Un(s,o,a)}})})},e}(),zn=function(){return zn=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},zn.apply(this,arguments)},Kn=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())})},Jn=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 $n(e){return jn(e)?e:new Nn((null==e?void 0:e.message)||String(e))}function Yn(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 Xn=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 Kn(this,void 0,Promise,function(){var n,r,o,i,a;return Jn(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),n=Yn(this.ctx.options),r=n.headers,o=n.query,[4,this.ctx.http.download({path:"/object/".concat(this.ctx.bucketId,"/").concat(Mn(this.ctx.cleanName)),headers:zn(zn({},this.ctx.headers),r),query:o,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(!(i=s.sent().response).body)throw new Un("Response body is empty",i.status,"STORAGE_PG_EMPTY_BODY");return[2,{data:i.body,error:null}];case 2:if(a=s.sent(),this.ctx.shouldThrowOnError)throw a;return[2,{data:null,error:$n(a)}];case 3:return[2]}})})},e}(),Qn=function(){function e(e){this.ctx=e}return e.prototype.asStream=function(){return new Xn(this.ctx)},e.prototype.then=function(e,t){return this.execute().then(e,t)},e.prototype.execute=function(){var e,t;return Kn(this,void 0,Promise,function(){var n,r,o,i,a,s;return Jn(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),n=Yn(this.ctx.options),r=n.headers,o=n.query,[4,this.ctx.http.download({path:"/object/".concat(this.ctx.bucketId,"/").concat(Mn(this.ctx.cleanName)),headers:zn(zn({},this.ctx.headers),r),query:o,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 i=c.sent().response,s={},[4,i.blob()];case 2:return[2,(s.data=c.sent(),s.error=null,s)];case 3:if(a=c.sent(),this.ctx.shouldThrowOnError)throw a;return[2,{data:null,error:$n(a)}];case 4:return[2]}})})},e}(),Zn=function(){return Zn=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},Zn.apply(this,arguments)},er=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())})},tr=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])}}},nr="3600",rr=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 Nn("setHeader requires a non-empty header name");if(/[\r\n]/.test(e)||"string"==typeof t&&/[\r\n]/.test(t))throw new Nn("setHeader does not allow CR/LF characters in header name or value");return this.headers=Zn(Zn({},this.headers),((n={})[e]=String(t),n)),this},e.prototype.upload=function(e,t,n){return er(this,void 0,Promise,function(){return tr(this,function(r){return[2,this.uploadOrUpdate("POST",e,t,n)]})})},e.prototype.update=function(e,t,n){return er(this,void 0,Promise,function(){return tr(this,function(r){return[2,this.uploadOrUpdate("PUT",e,t,n)]})})},e.prototype.download=function(e,t,n){return new Qn({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 er(this,void 0,Promise,function(){var r=this;return tr(this,function(o){return[2,Vn(function(){return er(r,void 0,void 0,function(){var r;return tr(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 er(this,void 0,Promise,function(){var t=this;return tr(this,function(n){return[2,Vn(function(){return er(t,void 0,void 0,function(){var t,n,r,o,i,a=this;return tr(this,function(s){switch(s.label){case 0:t=e.map(function(e){return a.cleanPath(e)}),n=[],r=0,s.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:i=s.sent(),Array.isArray(i)&&n.push.apply(n,i),s.label=3;case 3:return r+=100,[3,1];case 4:return[2,n]}})})},this.shouldThrowOnError)]})})},e.prototype.copy=function(e,t,n){return er(this,void 0,Promise,function(){var r=this;return tr(this,function(o){return[2,Vn(function(){return er(r,void 0,void 0,function(){var r;return tr(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 er(this,void 0,Promise,function(){var r=this;return tr(this,function(o){return[2,Vn(function(){return er(r,void 0,void 0,function(){return tr(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 er(this,void 0,Promise,function(){var t=this;return tr(this,function(n){return[2,Vn(function(){return er(t,void 0,void 0,function(){var t,n;return tr(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 er(this,void 0,Promise,function(){var t,n,r;return tr(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 Nn?n:new Nn((null==n?void 0:n.message)||String(n))}];case 3:return[2]}})})},e.prototype.createSignedUrl=function(e,t,n){return er(this,void 0,Promise,function(){var r=this;return tr(this,function(o){return[2,Vn(function(){return er(r,void 0,void 0,function(){var r,o,i;return tr(this,function(a){switch(a.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=a.sent(),i=o.fullSignedURL||this.http.toFullUrl(o.signedURL||""),[2,{fullSignedURL:this.appendUrlOptions(i,n)}]}})})},this.shouldThrowOnError)]})})},e.prototype.createSignedUrls=function(e,t,n){return er(this,void 0,Promise,function(){var r=this;return tr(this,function(o){return[2,Vn(function(){return er(r,void 0,void 0,function(){var r,o,i,a,s=this;return tr(this,function(c){switch(c.label){case 0:r=e.map(function(e){return s.cleanPath(e)}),o=[],i=0,c.label=1;case 1:return i<r.length?(a=r.slice(i,i+500),[4,this.send({method:"POST",path:"/object/sign/".concat(this.bucketId),json:{expiresIn:t,paths:a}})]):[3,4];case 2:c.sent().forEach(function(e){var t,r=e.fullSignedURL||(e.signedURL?s.http.toFullUrl(e.signedURL):null);o.push({path:e.path,fullSignedURL:r?s.appendUrlOptions(r,n):null,error:null!==(t=e.error)&&void 0!==t?t:null})}),c.label=3;case 3:return i+=500,[3,1];case 4:return[2,o]}})})},this.shouldThrowOnError)]})})},e.prototype.createSignedUploadUrl=function(e,t){return er(this,void 0,Promise,function(){var n=this;return tr(this,function(r){return[2,Vn(function(){return er(n,void 0,void 0,function(){var n,r,o;return tr(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 er(this,void 0,Promise,function(){var o=this;return tr(this,function(i){return[2,Vn(function(){return er(o,void 0,void 0,function(){var o,i,a,s,c;return tr(this,function(u){switch(u.label){case 0:return o=this.cleanPath(e),i=this.buildUploadBody(n,r),a=i.body,s=i.headers,[4,this.send({method:"PUT",path:"/object/upload/sign/".concat(this.bucketId,"/").concat(this.encodePath(o)),query:{token:t},rawBody:a,headers:s,withCredentials:!1})];case 1:return c=u.sent(),[2,{path:o,fullPath:c.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(Zn(Zn({},e),{headers:Zn(Zn({},this.headers),e.headers||{})}))},e.prototype.uploadOrUpdate=function(e,t,n,r){return er(this,void 0,Promise,function(){var o=this;return tr(this,function(i){return[2,Vn(function(){return er(o,void 0,void 0,function(){var o,i,a,s,c;return tr(this,function(u){switch(u.label){case 0:return o=this.cleanPath(t),i=this.buildUploadBody(n,r),a=i.body,s=i.headers,"POST"===e&&(s["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:a,headers:s})];case 1:return[2,{id:(c=u.sent()).Id,path:o,fullPath:c.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 Nn('invalid path: ".." segment is not allowed');return t},e.prototype.encodePath=function(e){return Mn(e)},e.prototype.buildUploadBody=function(e,t){var n,r,o,i,a,s=Zn({},(null==t?void 0:t.headers)||{}),c=e,u="undefined"!=typeof FormData&&e instanceof FormData;if("undefined"!=typeof Blob&&e instanceof Blob||u){var l=void 0,p={};if(u){var d=this.extractFromFormData(e);l=d.file,p=d.fields}else l=e;var h=null!==(r=null!==(n=null==t?void 0:t.cacheControl)&&void 0!==n?n:p.cacheControl)&&void 0!==r?r:nr,f=null!==(o=null==t?void 0:t.contentType)&&void 0!==o?o:p.contentType,m=void 0!==(null==t?void 0:t.metadata)?JSON.stringify(t.metadata):p.metadata,v=new FormData;void 0!==h&&v.append("cacheControl",String(h)),void 0!==f&&v.append("contentType",f),void 0!==m&&v.append("metadata",m),v.append("",l),c=v}else c=e,h=null!==(i=null==t?void 0:t.cacheControl)&&void 0!==i?i:nr,f=null!==(a=null==t?void 0:t.contentType)&&void 0!==a?a:"text/plain;charset=UTF-8",s["cache-control"]="max-age=".concat(h),f&&(s["content-type"]=f),(null==t?void 0:t.metadata)&&(s["x-metadata"]=this.toBase64(JSON.stringify(t.metadata)));return{body:c,headers:s}},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 Nn("FormData must contain a file");if(r>1)throw new Nn("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 qn(e)},e}(),or=/[\x00-\x20\x7f/\\?#%]/;function ir(e,t){if("string"!=typeof e||0===e.length)throw new Nn("[storage.".concat(t,"] bucketId is required"));if(e.length>256)throw new Nn("[storage.".concat(t,"] invalid bucketId: length must be 1-").concat(256));var n=or.exec(e);if(n){var r="[storage.".concat(t,'] invalid bucketId "').concat(e,'": ')+"contains forbidden character ".concat(JSON.stringify(n[0]),"; ")+'must not contain whitespace, control chars, "/", "\\", "?", "#" or "%"';throw new Nn(r)}}var ar,sr=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())})},cr=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])}}},ur=function(){function e(e,t){void 0===t&&(t=!1),this.http=new Hn(e),this.shouldThrowOnError=t}return e.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},e.prototype.listBuckets=function(e){return sr(this,void 0,Promise,function(){var t=this;return cr(this,function(n){return[2,Vn(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 sr(this,void 0,Promise,function(){var t=this;return cr(this,function(n){return[2,Vn(function(){return ir(e,"getBucket"),t.http.send({method:"GET",path:"/bucket/".concat(e)})},this.shouldThrowOnError)]})})},e.prototype.createBucket=function(e,t){return sr(this,void 0,Promise,function(){var n=this;return cr(this,function(r){return[2,Vn(function(){var r;return ir(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 sr(this,void 0,Promise,function(){var n=this;return cr(this,function(r){return[2,Vn(function(){return ir(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 sr(this,void 0,Promise,function(){var t=this;return cr(this,function(n){return[2,Vn(function(){return ir(e,"deleteBucket"),t.http.send({method:"DELETE",path:"/bucket/".concat(e)})},this.shouldThrowOnError)]})})},e}(),lr=function(){return lr=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},lr.apply(this,arguments)},pr=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},dr=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},hr=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())})},fr=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(e){e.put="put",e.post="post"}(ar||(ar={}));var mr=r._G.eX,vr=r._G.Sg,yr=r._G.vM,gr=r.P6.isArray,br=r.P6.isString,wr=r.P6.isPalinObject,_r=r.P6.execCallback,xr=r.P6.maybeThrow,Er=r.P6.printWarn,Ir=r.BM.D,Sr="storage";function Or(e,t){return t&&"function"!=typeof t?[lr(lr({},e),{customReqOpts:t}),void 0]:[e,t]}var Tr=function(e,t,n){return hr(void 0,void 0,void 0,function(){var o,i,a;return fr(this,function(s){switch(s.label){case 0:return[4,e.gateWay({path:"storages",name:"get-objects-upload-info",data:[lr({objectId:t.path},t.signedHeader?{signedHeader:t.signedHeader}:{})]},n)];case 1:return o=s.sent(),o=r.P6.promoteGatewayError(o),i=(null===(a=o.data)||void 0===a?void 0:a[0])||{},[2,lr(lr({},o),{data:lr(lr({},i.code?lr({},i):{}),{authorization:i.authorization,token:i.token,url:i.uploadUrl,fileId:i.cloudObjectId,cosFileId:i.cloudObjectMeta,download_url:i.downloadUrl})})]}})})},Ar=function(e,t,n){return hr(void 0,void 0,void 0,function(){var o;return fr(this,function(i){switch(i.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=i.sent(),o=r.P6.promoteGatewayError(o),[2,lr(lr({},o),{data:{download_list:Array.isArray(o.data)?o.data.map(function(e){return{code:e.code||"SUCCESS",message:e.message,fileid:e.cloudObjectId,download_url:e.downloadUrl,fileID:e.cloudObjectId,tempFileURL:e.downloadUrl,mime_type:e.contentType||kr(null,e.cloudObjectId||"")}}):[]}})]}})})},Pr=function(e,t,n){return hr(void 0,void 0,void 0,function(){var o;return fr(this,function(i){switch(i.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=i.sent(),o=r.P6.promoteGatewayError(o),[2,lr(lr({},o),{data:{delete_list:Array.isArray(o.data)?o.data.map(function(e){return{code:e.code||"SUCCESS",fileID:e.cloudObjectId,message:e.message}}):[]}})]}})})},Cr=function(e,t,n){return hr(void 0,void 0,void 0,function(){var o;return fr(this,function(i){switch(i.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=i.sent(),o=r.P6.promoteGatewayError(o),[2,lr(lr({},o),{data:{copy_list:Array.isArray(o.data)?o.data.map(function(e){return{code:e.code||"SUCCESS",fileID:e.cloudObjectId,fileId:e.cloudObjectId,message:e.message}}):[]}})]}})})},Rr={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 kr(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 Rr[r]||"application/octet-stream"}function Nr(e,t){var n=t.toLowerCase();return Object.keys(e).some(function(e){return e.toLowerCase()===n})}function jr(e){return Object.keys(e).reduce(function(t,n){var r;return lr(lr({},t),((r={})[n]=[e[n]],r))},{})}var Lr=function(){function e(e){this.context=e}var t,n,r,o,i,a,s,c,u,l,p,d,h,f,m,v;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,t){return hr(this,void 0,Promise,function(){var n,r,o,i,a,s,c,u,l,p,d,h,f,m,v,y,g,b,w,_,x,E,I,S,O,T,A,P,C,R,k,N;return fr(this,function(j){switch(j.label){case 0:return C=Or(e,t),e=C[0],t=C[1],n=e.cloudPath,r=e.filePath,o=e.onUploadProgress,R=e.method,i=void 0===R?"put":R,k=e.headers,a=void 0===k?{}:k,s=e.fileContent,br(n)&&(r||s)?(c={put:ar.put,post:ar.post}[i.toLocaleLowerCase()]||ar.put,u=this.isGateWay(),l=lr({},a),p=Object.keys(a).reduce(function(e,t){return"content-length"!==t.toLowerCase()&&(e[t]=a[t]),e},{}),c===ar.put&&u&&(Nr(l,"content-length")||"number"==typeof(d=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=function(e){var t;return null===(t=Dn())||void 0===t?void 0:t.byteLength(e)}(n);return"number"==typeof r?r:n.length}return"object"==typeof n&&"number"==typeof n.size?n.size:void 0}}(r,s))&&(l["content-length"]=String(d)),Nr(l,"content-type")||(l["content-type"]=kr(r,n)),Nr(p,"content-type")||(p["content-type"]=kr(r,n))),[4,this.getUploadMetadata({cloudPath:n,method:c,headers:c!==ar.put||u?void 0:p,signedHeader:c===ar.put&&u?jr(l):void 0,customReqOpts:e.customReqOpts})]):[2,xr(this.config,{code:vr.INVALID_PARAMS,msg:"[".concat(Sr,".uploadFile] invalid params")})];case 1:return h=j.sent(),f=h.data,m=h.requestId,(null==(v=f)?void 0:v.code)||!(null==v?void 0:v.url)?(y=(null==v?void 0:v.code)||vr.OPERATION_FAIL,g=(null==v?void 0:v.message)||"get upload info failed",[2,_r(t,new Error("[".concat(mr(),"][").concat(y,"][").concat(Sr,"]:").concat(g)))]):(b=f.url,w=f.authorization,_=f.token,x=f.fileId,E=f.cosFileId,I=f.download_url,O=lr(lr({},S={url:b,file:r,name:n,onUploadProgress:o,fileContent:s,fileId:x,requestId:m}),{method:ar.put,headers:lr(lr({},p),{authorization:w,"x-cos-meta-fileid":E,"x-cos-security-token":_})}),T=lr(lr({},S),{method:ar.post,data:{key:n,signature:w,"x-cos-meta-fileid":E,success_action_status:"201","x-cos-security-token":_}}),(N={})[ar.put]={params:O,isSuccess:function(e){return e>=200&&e<300}},N[ar.post]={params:T,isSuccess:function(e){return 201===e}},A=N,[4,this.request.upload(A[c].params)]);case 2:return P=j.sent(),A[c].isSuccess(P.statusCode)?[2,_r(t,null,{fileID:x,download_url:I,requestId:m})]:[2,_r(t,new Error("[".concat(mr(),"][").concat(vr.OPERATION_FAIL,"][").concat(Sr,"]:").concat(P.data)))]}})})},e.prototype.getUploadMetadata=function(e,t){return hr(this,void 0,Promise,function(){var n,r,o,i,a,s,c,u,l,p;return fr(this,function(d){switch(d.label){case 0:if(n=e.cloudPath,r=e.method,o=e.headers,i=e.signedHeader,!br(n))return[2,xr(this.config,{code:vr.INVALID_PARAMS,msg:"[".concat(Sr,".getUploadMetadata] invalid cloudPath")})];a=this.request,s="storage.getUploadMetadata",d.label=1;case 1:return d.trys.push([1,6,,7]),c=void 0,u={path:n},l=this.isGateWay(),r&&(u.method=r),r===ar.put&&(l&&i?u.signedHeader=i:!l&&o&&(u.headers=o)),r!==ar.post&&l?[3,3]:[4,a.send(s,u,{endPointMode:"CLOUD_API"},e.customReqOpts)];case 2:return c=d.sent(),[3,5];case 3:return[4,Tr(a,u,e.customReqOpts)];case 4:c=d.sent(),d.label=5;case 5:return[2,_r(t,null,c)];case 6:return p=d.sent(),[2,_r(t,p)];case 7:return[2]}})})},e.prototype.deleteFile=function(e,t){return hr(this,void 0,Promise,function(){var n,r,o,i,a,s,c,u,l;return fr(this,function(p){switch(p.label){case 0:if(l=Or(e,t),e=l[0],t=l[1],!(n=e.fileList)||!gr(n)||0===n.length)return[2,xr(this.config,{code:vr.INVALID_PARAMS,msg:"[".concat(Sr,".deleteFile] fileList must not be empty")})];for(r=0,o=n;r<o.length;r++)if(!(i=o[r])||!br(i))return[2,xr(this.config,{code:vr.INVALID_PARAMS,msg:"[".concat(Sr,".deleteFile] fileID must be string")})];return a="storage.batchDeleteFile",s=this.request,c={},this.isGateWay()?[4,Pr(s,{fileList:n},e.customReqOpts)]:[3,2];case 1:return c=p.sent(),[3,4];case 2:return[4,s.send(a,{fileid_list:n},e.customReqOpts)];case 3:c=p.sent(),p.label=4;case 4:return c.code?[2,_r(t,null,c)]:(u={fileList:c.data.delete_list,requestId:c.requestId},[2,_r(t,null,u)])}})})},e.prototype.getTempFileURL=function(e,t){var n;return hr(this,void 0,Promise,function(){var r,o,i,a,s,c,u,l,p,d;return fr(this,function(h){switch(h.label){case 0:if(d=Or(e,t),e=d[0],t=d[1],!(r=e.fileList)||!gr(r)||0===r.length)return[2,xr(this.config,{code:vr.INVALID_PARAMS,msg:"[".concat(Sr,".getTempFileURL] fileList must not be empty")})];for(o=[],i=!1,a=0,s=r;a<s.length;a++)if(c=s[a],wr(c)){if(!Object.prototype.hasOwnProperty.call(c,"fileID"))return[2,xr(this.config,{code:vr.INVALID_PARAMS,msg:"[".concat(Sr,".getTempFileURL] file info must include fileID")})];!i&&Object.prototype.hasOwnProperty.call(c,"maxAge")&&(Er(vr.INVALID_PARAMS,"[".concat(Sr,".getTempFileURL] maxAge 仅为兼容字段,传统模式不会用它生成下载链接,TTL 传入无效。需要可控过期请改用 app.storage.from(bucketId).createSignedUrl(path, expiresIn)(PG 模式下可用)。")),i=!0),o.push({fileid:c.fileID,max_age:c.maxAge||7200})}else{if(!br(c))return[2,xr(this.config,{code:vr.INVALID_PARAMS,msg:"[".concat(Sr,".getTempFileURL] invalid fileList")})];o.push({fileid:c})}return u="storage.batchGetDownloadUrl",l=this.request,p={},this.isGateWay()?[4,Ar(l,{convertedFileList:o},e.customReqOpts)]:[3,2];case 1:return p=h.sent(),[3,4];case 2:return[4,l.send(u,{file_list:o},e.customReqOpts)];case 3:p=h.sent(),h.label=4;case 4:return p.code?[2,_r(t,null,p)]:[2,_r(t,null,{fileList:Array.isArray(null===(n=p.data)||void 0===n?void 0:n.download_list)?p.data.download_list:[],requestId:p.requestId})]}})})},e.prototype.downloadFile=function(e,t){return hr(this,void 0,Promise,function(){var n,r,o,i,a,s,c;return fr(this,function(u){switch(u.label){case 0:return c=Or(e,t),e=c[0],t=c[1],n=e.fileID,br(n)?[4,this.getTempFileURL.call(this,{fileList:[n],customReqOpts:e.customReqOpts})]:[2,xr(this.config,{code:vr.INVALID_PARAMS,msg:"[".concat(Sr,".getTempFileURL] fileID must be string")})];case 1:return r=u.sent(),"SUCCESS"!==(o=r.fileList[0]).code?[2,_r(t,o)]:(i=this.request,a=encodeURI(o.download_url),[4,i.download({url:a,tempFilePath:e.tempFilePath})]);case 2:return s=u.sent(),[2,_r(t,null,s)]}})})},e.prototype.copyFile=function(e,t){return hr(this,void 0,Promise,function(){var n,r,o,i,a,s,c,u,l,p;return fr(this,function(d){switch(d.label){case 0:if(p=Or(e,t),e=p[0],t=p[1],!(n=e.fileList)||!gr(n)||0===n.length)return[2,xr(this.config,{code:vr.INVALID_PARAMS,msg:"[".concat(Sr,".copyFile] fileList must not be empty")})];for(r=[],o=0,i=n;o<i.length;o++){if(a=i[o],s=a.srcPath,c=a.dstPath,!s||!c||"string"!=typeof s||"string"!=typeof c)return[2,xr(this.config,{code:vr.INVALID_PARAMS,msg:"[".concat(Sr,".copyFile] srcPath and dstPath may not be empty")})];if(s===c)return[2,xr(this.config,{code:vr.INVALID_PARAMS,msg:"[".concat(Sr,".copyFile] srcPath and dstPath can not be the same")})];r.push({src_path:s,dst_path:c,overwrite:a.overwrite,remove_original:a.removeOriginal})}return u=this.request,l={},this.isGateWay()?[4,Cr(u,{convertedFileList:r},e.customReqOpts)]:[3,2];case 1:return l=d.sent(),[3,4];case 2:return[4,u.send("storage.batchCopyFile",{file_list:r},e.customReqOpts)];case 3:l=d.sent(),d.label=4;case 4:return l.code?[2,_r(t,null,l)]:[2,_r(t,null,{fileList:l.data.copy_list,requestId:l.requestId})]}})})},e.prototype.getFileInfo=function(e){var t;return hr(this,void 0,Promise,function(){var n,r=this;return fr(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 hr(r,void 0,void 0,function(){var t,n,r,o,i,a,s;return fr(this,function(c){switch(c.label){case 0:if("SUCCESS"!==e.code)return[2,{code:e.code,fileID:e.fileID,tempFileURL:e.tempFileURL,message:e.message}];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,this.request.fetch({url:e.tempFileURL,method:"HEAD"})];case 2:return t=c.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=c.sent(),s="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:s}];case 4:return[2]}})})}))]:[3,3];case 2:return[2,{fileList:o.sent(),requestId:n.requestId}];case 3:return[2,{fileList:[],requestId:n.requestId}]}})})},pr([Ir({customInfo:{className:"Cloudbase",methodName:"uploadFile"},title:"上传文件失败",messages:["请确认以下各项:"," 1 - 调用 uploadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(yr)]}),dr("design:type",Function),dr("design:paramtypes",[Object,"function"==typeof(t="undefined"!=typeof Function&&Function)?t:Object]),dr("design:returntype","function"==typeof(n="undefined"!=typeof Promise&&Promise)?n:Object)],e.prototype,"uploadFile",null),pr([Ir({customInfo:{className:"Cloudbase",methodName:"getUploadMetadata"},title:"获取上传元信息失败",messages:["请确认以下各项:"," 1 - 调用 getUploadMetadata() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(yr)]}),dr("design:type",Function),dr("design:paramtypes",[Object,"function"==typeof(r="undefined"!=typeof Function&&Function)?r:Object]),dr("design:returntype","function"==typeof(o="undefined"!=typeof Promise&&Promise)?o:Object)],e.prototype,"getUploadMetadata",null),pr([Ir({customInfo:{className:"Cloudbase",methodName:"deleteFile"},title:"删除文件失败",messages:["请确认以下各项:"," 1 - 调用 deleteFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(yr)]}),dr("design:type",Function),dr("design:paramtypes",["function"==typeof(i=void 0!==sn.ICloudbaseDeleteFileParams&&sn.ICloudbaseDeleteFileParams)?i:Object,"function"==typeof(a="undefined"!=typeof Function&&Function)?a:Object]),dr("design:returntype","function"==typeof(s="undefined"!=typeof Promise&&Promise)?s:Object)],e.prototype,"deleteFile",null),pr([Ir({customInfo:{className:"Cloudbase",methodName:"getTempFileURL"},title:"获取文件下载链接",messages:["请确认以下各项:"," 1 - 调用 getTempFileURL() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(yr)]}),dr("design:type",Function),dr("design:paramtypes",["function"==typeof(c=void 0!==sn.ICloudbaseGetTempFileURLParams&&sn.ICloudbaseGetTempFileURLParams)?c:Object,"function"==typeof(u="undefined"!=typeof Function&&Function)?u:Object]),dr("design:returntype","function"==typeof(l="undefined"!=typeof Promise&&Promise)?l:Object)],e.prototype,"getTempFileURL",null),pr([Ir({customInfo:{className:"Cloudbase",methodName:"downloadFile"},title:"下载文件失败",messages:["请确认以下各项:"," 1 - 调用 downloadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(yr)]}),dr("design:type",Function),dr("design:paramtypes",["function"==typeof(p=void 0!==sn.ICloudbaseDownloadFileParams&&sn.ICloudbaseDownloadFileParams)?p:Object,"function"==typeof(d="undefined"!=typeof Function&&Function)?d:Object]),dr("design:returntype","function"==typeof(h="undefined"!=typeof Promise&&Promise)?h:Object)],e.prototype,"downloadFile",null),pr([Ir({customInfo:{className:"Cloudbase",methodName:"copyFile"},title:"批量复制文件",messages:["请确认以下各项:"," 1 - 调用 copyFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(yr)]}),dr("design:type",Function),dr("design:paramtypes",["function"==typeof(f=void 0!==sn.ICloudbaseCopyFileParams&&sn.ICloudbaseCopyFileParams)?f:Object,"function"==typeof(m="undefined"!=typeof Function&&Function)?m:Object]),dr("design:returntype","function"==typeof(v="undefined"!=typeof Promise&&Promise)?v:Object)],e.prototype,"copyFile",null),e}(),Ur=function(){return Ur=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},Ur.apply(this,arguments)},Dr=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())})},qr=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])}}},Mr=r._G.Sg,Br=function(){function e(e,t){void 0===t&&(t=!1),this.shouldThrowOnError=!1,this.bucketId="",this.context=e,this.shouldThrowOnError=t,this.storage=new Lr(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 Dr(this,void 0,Promise,function(){var r,o,i,a,s,c,u,l,p;return qr(this,function(d){switch(d.label){case 0:r=Ur({upsert:!0},n),o=r.cacheControl,i=r.contentType,a=r.metadata,d.label=1;case 1:return d.trys.push([1,3,,4]),s=this.getCloudPath(e),c={cloudPath:s,filePath:t},(o||i||a)&&(u={},o&&(u["cache-control"]=o),i&&(u["content-type"]=i),a&&(u["x-cos-metadata-metadata"]=this.toBase64(JSON.stringify(a))),c.headers=u),[4,this.storage.uploadFile(c)];case 2:if(!(l=d.sent()).fileID)throw new Error(JSON.stringify({code:Mr.OPERATION_FAIL,msg:"[".concat(Sr,".update] no fileID returned")}));return[2,{data:{id:l.fileID,path:e,fullPath:e},error:null}];case 3:if(p=d.sent(),this.shouldThrowOnError)throw p;if(jn(p))return[2,{data:null,error:p}];throw p;case 4:return[2]}})})},e.prototype.uploadToSignedUrl=function(e,t,n,r){return Dr(this,void 0,Promise,function(){return qr(this,function(t){return[2,this.upload(e,n,r)]})})},e.prototype.createSignedUploadUrl=function(e){return Dr(this,void 0,Promise,function(){var t,n,r;return qr(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 Nn?r:new Nn(r.message)}];case 3:return[2]}})})},e.prototype.update=function(e,t,n){return Dr(this,void 0,Promise,function(){return qr(this,function(r){return[2,this.upload(e,t,Ur(Ur({},n),{upsert:!0}))]})})},e.prototype.move=function(e,t){return Dr(this,void 0,Promise,function(){var n,r;return qr(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 Nn(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(jn(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}})})},e.prototype.copy=function(e,t){return Dr(this,void 0,Promise,function(){var n,r;return qr(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 Nn(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(jn(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}})})},e.prototype.createSignedUrl=function(e,t,n){return Dr(this,void 0,Promise,function(){var t,r,o,i,a,s,c;return qr(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),t=this.normalizeCloudId(e),[4,this.storage.getTempFileURL({fileList:[t]})];case 1:if("SUCCESS"!==(r=u.sent()).fileList[0].code)throw new Nn("Failed to create signed URL: [".concat(r.fileList[0].code,"] ").concat(r.fileList[0].fileID));return o=r.fileList[0].download_url,i=[],void 0!==(null==n?void 0:n.download)&&("string"==typeof n.download?i.push("download=".concat(encodeURIComponent(n.download))):!0===n.download&&i.push("download=true")),(null==n?void 0:n.transform)&&(a=this.transformOptsToQueryString(n.transform))&&i.push(a),i.length>0&&(s=o.includes("?")?"&":"?",o="".concat(o).concat(s).concat(i.join("&"))),[2,{data:{signedUrl:o},error:null}];case 2:if(c=u.sent(),this.shouldThrowOnError)throw c;if(jn(c))return[2,{data:null,error:c}];throw c;case 3:return[2]}})})},e.prototype.createSignedUrls=function(e,t){return Dr(this,void 0,Promise,function(){var t,n,r=this;return qr(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),t=e.map(function(e){return r.normalizeCloudId(e)}),[4,this.storage.getTempFileURL({fileList:t})];case 1:return[2,{data:o.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(n=o.sent(),this.shouldThrowOnError)throw n;if(jn(n))return[2,{data:null,error:n}];throw n;case 3:return[2]}})})},e.prototype.download=function(e,t){return Dr(this,void 0,Promise,function(){var n,r,o=this;return qr(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r={},[4,Dr(o,void 0,void 0,function(){var n,r,o,i;return qr(this,function(a){switch(a.label){case 0:return[4,this.createSignedUrl(e,600,{transform:t})];case 1:if((n=a.sent()).error)throw n.error;return r=encodeURI(null===(i=n.data)||void 0===i?void 0:i.signedUrl),[4,this.request.reqClass.get({url:r,headers:{},responseType:"blob"})];case 2:if(!(o=a.sent().data))throw new Nn("Download failed: no file content");return[2,new Blob([o])]}})})];case 1:return[2,(r.data=i.sent(),r.error=null,r)];case 2:if(n=i.sent(),this.shouldThrowOnError)throw n;if(jn(n))return[2,{data:null,error:n}];throw n;case 3:return[2]}})})},e.prototype.info=function(e){return Dr(this,void 0,Promise,function(){var t,n,r,o,i,a,s,c;return qr(this,function(u){switch(u.label){case 0:return u.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=u.sent(),"SUCCESS"!==(i=o.fileList[0]).code)throw new Nn(i.message);return a=(new Date).toISOString(),s=(i.lastModified?new Date(i.lastModified):new Date).toISOString(),[2,{data:{id:i.fileID,version:"1",name:n,bucketId:r,updatedAt:s,createdAt:s,lastAccessedAt:a,size:i.size,cacheControl:i.cacheControl,contentType:i.contentType,etag:i.etag,lastModified:s,metadata:{}},error:null}];case 2:if(c=u.sent(),this.shouldThrowOnError)throw c;return[2,{data:null,error:c instanceof Nn?c:new Nn(c.message)}];case 3:return[2]}})})},e.prototype.exists=function(e){return Dr(this,void 0,Promise,function(){var t,n,r;return qr(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 Nn(n.message);return[2,{data:!0,error:null}];case 2:if(r=o.sent(),this.shouldThrowOnError)throw r;if(jn(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}})})},e.prototype.getPublicUrl=function(e,t){return Dr(this,void 0,Promise,function(){var n;return qr(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 Dr(this,void 0,Promise,function(){var t,n,r,o,i,a,s,c,u,l,p=this;return qr(this,function(d){switch(d.label){case 0:for(d.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 p.info(e)}))}))];case 1:return o=d.sent(),i=new Map,o.forEach(function(n,r){n.forEach(function(n,o){n.data&&i.set(e[r*t+o],n.data)})}),a=e.map(function(e){return p.normalizeCloudId(e)}),[4,this.storage.deleteFile({fileList:a})];case 2:if(s=d.sent(),(c=s.fileList.filter(function(e){return"SUCCESS"!==e.code})).length>0)throw new Nn("Delete failed for ".concat(c.length," file(s)"));return u=(new Date).toISOString(),[2,{data:e.map(function(e){var t=i.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)||u,created_at:null==t?void 0:t.createdAt,last_accessed_at:(null==t?void 0:t.lastAccessedAt)||u,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:u}}}),error:null}];case 3:if(l=d.sent(),this.shouldThrowOnError)throw l;if(jn(l))return[2,{data:null,error:l}];throw l;case 4:return[2]}})})},e.prototype.list=function(){return Dr(this,void 0,void 0,function(){return qr(this,function(e){throw new Nn("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 Nn("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 qn(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}(),Fr=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)}}(),Wr=new Lr,Gr={name:Sr,entity:{uploadFile:Wr.uploadFile,deleteFile:Wr.deleteFile,getTempFileURL:Wr.getTempFileURL,downloadFile:Wr.downloadFile,getUploadMetadata:Wr.getUploadMetadata,copyFile:Wr.copyFile,getFileInfo:Wr.getFileInfo,isGateWay:Wr.isGateWay}},Vr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Fr(t,e),t.prototype.from=function(e){return e?(ir(e,"from"),new rr(this.http,e,this.shouldThrowOnError)):new Br(this.http.ctx,this.shouldThrowOnError)},t}(ur),Hr={name:"".concat(Sr,"/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 Vr(n);return e.set(this,r),r},configurable:!0,enumerable:!0})}};try{cloudbase.registerComponent(Gr),cloudbase.registerComponent(Hr)}catch(e){}function zr(e){try{e.registerComponent(Gr),e.registerComponent(Hr)}catch(e){console.warn(e)}}try{window.registerStorage=zr}catch(e){}var Kr=__webpack_require__(6765),Jr=__webpack_require__.n(Kr),$r=__webpack_require__(7195),Yr=__webpack_require__.n($r),Xr=__webpack_require__(9850),Qr=__webpack_require__.n(Xr);function Zr(e){return void 0===e&&(e=""),"".concat(e?"".concat(e,"_"):"").concat(+new Date,"_").concat(Math.random())}var eo,to=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}})},no=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}})},ro=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)}}(),oo=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 ro(t,e),t}(Error),io=function(e){return null==e?void 0:e.isRealtimeErrorMessageError},ao=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 ro(t,e),t}(Error),so=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 ro(t,e),t}(Error),co=function(e){function t(t){var n=e.call(this,t.errMsg)||this;return n.errCode="UNKNOWN_ERROR",Object.defineProperties(n,{message:{get:function(){return"errCode: ".concat(this.errCode," ").concat(uo[this.errCode]||""," | errMsg: ").concat(this.errMsg)},set:function(e){this.errMsg=e}}}),n.errCode=t.errCode||"UNKNOWN_ERROR",n.errMsg=t.errMsg,n}return ro(t,e),Object.defineProperty(t.prototype,"message",{get:function(){return"errCode: ".concat(this.errCode," | errMsg: ").concat(this.errMsg)},set:function(e){this.errMsg=e},enumerable:!1,configurable:!0}),t}(Error),uo={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"},lo=function(e){return void 0===e&&(e=0),new Promise(function(t){return setTimeout(t,e)})},po=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())})},ho=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])}}},fo=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(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"}(eo||(eo={}));var mo=function(){function e(e){var t=this;this.watchStatus=eo.INITING,this.wsLogin=function(e,n){return po(t,void 0,Promise,function(){var t;return ho(this,function(r){switch(r.label){case 0:return this.watchStatus=eo.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 po(t,void 0,Promise,function(){var t,n=this;return ho(this,function(r){switch(r.label){case 0:if(null!==this.initWatchPromise&&void 0!==this.initWatchPromise)return[2,this.initWatchPromise];this.initWatchPromise=new Promise(function(t,r){po(n,void 0,void 0,function(){var n,o,i,a,s,c,u,l,p,d;return ho(this,function(h){switch(h.label){case 0:return h.trys.push([0,3,,4]),this.watchStatus===eo.PAUSED?(console.log("[realtime] initWatch cancelled on pause"),[2,t()]):[4,this.wsLogin(this.envId,e)];case 1:return n=h.sent().envId,this.watchStatus===eo.PAUSED?(console.log("[realtime] initWatch cancelled on pause"),[2,t()]):(this.watchStatus=eo.INITING,o={watchId:this.watchId,requestId:Zr(),msgType:"INIT_WATCH",msgData:{envId:n,collName:this.collectionName,query:this.query,limit:this.limit,orderBy:this.orderBy}},[4,this.send({msg:o,waitResponse:!0,skipOnMessage:!0,timeout:1e4})]);case 2:if(i=h.sent(),a=i.msgData,s=a.events,c=a.currEvent,this.sessionInfo={queryID:i.msgData.queryID,currentEventId:c-1,currentDocs:[]},s.length>0){for(u=0,l=s;u<l.length;u++)l[u].ID=c;this.handleServerEvents(i)}else this.sessionInfo.currentEventId=c,p=new no({id:c,docChanges:[],docs:[],type:"init"}),this.listener.onChange(p),this.scheduleSendACK();return this.onWatchStart(this,this.sessionInfo.queryID),this.watchStatus=eo.ACTIVE,this.availableRetries.INIT_WATCH=2,t(),[3,4];case 3:return d=h.sent(),this.handleWatchEstablishmentError(d,{operationName:"INIT_WATCH",resolve:t,reject:r}),[3,4];case 4:return[2]}})})}),t=!1,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this.initWatchPromise];case 2:return r.sent(),t=!0,[3,4];case 3:return this.initWatchPromise=void 0,[7];case 4:return console.log("[realtime] initWatch ".concat(t?"success":"fail")),[2]}})})},this.rebuildWatch=function(e){return po(t,void 0,Promise,function(){var t,n=this;return ho(this,function(r){switch(r.label){case 0:if(null!==this.rebuildWatchPromise&&void 0!==this.rebuildWatchPromise)return[2,this.rebuildWatchPromise];this.rebuildWatchPromise=new Promise(function(t,r){po(n,void 0,void 0,function(){var n,o,i,a;return ho(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),this.watchStatus===eo.PAUSED?(console.log("[realtime] rebuildWatch cancelled on pause"),[2,t()]):[4,this.wsLogin(this.envId,e)];case 1:if(n=s.sent().envId,!this.sessionInfo)throw new Error("can not rebuildWatch without a successful initWatch (lack of sessionInfo)");return this.watchStatus===eo.PAUSED?(console.log("[realtime] rebuildWatch cancelled on pause"),[2,t()]):(this.watchStatus=eo.REBUILDING,o={watchId:this.watchId,requestId:Zr(),msgType:"REBUILD_WATCH",msgData:{envId:n,collName:this.collectionName,queryID:this.sessionInfo.queryID,eventID:this.sessionInfo.currentEventId}},[4,this.send({msg:o,waitResponse:!0,skipOnMessage:!1,timeout:1e4})]);case 2:return i=s.sent(),this.handleServerEvents(i),this.watchStatus=eo.ACTIVE,this.availableRetries.REBUILD_WATCH=2,t(),[3,4];case 3:return a=s.sent(),this.handleWatchEstablishmentError(a,{operationName:"REBUILD_WATCH",resolve:t,reject:r}),[3,4];case 4:return[2]}})})}),t=!1,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this.rebuildWatchPromise];case 2:return r.sent(),t=!0,[3,4];case 3:return this.rebuildWatchPromise=void 0,[7];case 4:return console.log("[realtime] rebuildWatch ".concat(t?"success":"fail")),[2]}})})},this.handleWatchEstablishmentError=function(e,n){return po(t,void 0,void 0,function(){var t,r,o,i=this;return ho(this,function(a){return t="INIT_WATCH"===n.operationName,r=function(){i.closeWithError(new co({errCode:t?uo.SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL:uo.SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL,errMsg:e})),n.reject(e)},o=function(e){i.useRetryTicket(n.operationName)?t?(i.initWatchPromise=void 0,n.resolve(i.initWatch(e))):(i.rebuildWatchPromise=void 0,n.resolve(i.rebuildWatch(e))):r()},this.handleCommonError(e,{onSignError:function(){return o(!0)},onTimeoutError:function(){return o(!1)},onNotRetryableError:r,onCancelledError:n.reject,onUnknownError:function(){po(i,void 0,void 0,function(){var e,t=this;return ho(this,function(r){switch(r.label){case 0:return r.trys.push([0,8,,9]),e=function(){return po(t,void 0,void 0,function(){return ho(this,function(e){switch(e.label){case 0:return this.pause(),[4,this.onceWSConnected()];case 1:return e.sent(),o(!0),[2]}})})},this.isWSConnected()?[3,2]:[4,e()];case 1:return r.sent(),[3,7];case 2:return[4,lo(100)];case 3:return r.sent(),this.watchStatus!==eo.PAUSED?[3,4]:(n.reject(new so("".concat(n.operationName," cancelled due to pause after unknownError"))),[3,7]);case 4:return this.isWSConnected()?[3,6]:[4,e()];case 5:return r.sent(),[3,7];case 6:o(!1),r.label=7;case 7:return[3,9];case 8:return r.sent(),o(!0),[3,9];case 9:return[2]}})})}}),[2]})})},this.closeWatch=function(){return po(t,void 0,void 0,function(){var e,t,n;return ho(this,function(r){switch(r.label){case 0:if(e=this.sessionInfo?this.sessionInfo.queryID:"",this.watchStatus!==eo.ACTIVE)return this.watchStatus=eo.CLOSED,this.onWatchClose(this,e),[2];r.label=1;case 1:return r.trys.push([1,3,4,5]),this.watchStatus=eo.CLOSING,t={watchId:this.watchId,requestId:Zr(),msgType:"CLOSE_WATCH",msgData:null},[4,this.send({msg:t})];case 2:return r.sent(),this.sessionInfo=void 0,this.watchStatus=eo.CLOSED,[3,5];case 3:return n=r.sent(),this.closeWithError(new co({errCode:uo.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 po(t,void 0,Promise,function(){var e,t,n;return ho(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this.watchStatus!==eo.ACTIVE?(this.scheduleSendACK(),[2]):this.sessionInfo?(e={watchId:this.watchId,requestId:Zr(),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(),io(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 co({errCode:uo.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 co({errCode:uo.SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL,errMsg:t})),[3,3];case 3:return[2]}})})},this.handleCommonError=function(e,t){if(io(e))switch(e.payload.msgData.code){case"CHECK_LOGIN_FAILED":case"SIGN_EXPIRED_ERROR":case"SIGN_INVALID_ERROR":case"SIGN_PARAM_INVALID":return void t.onSignError(e);default:return void t.onNotRetryableError(e)}else{if(function(e){return"timeout"===e.type}(e))return void t.onTimeoutError(e);if(function(e){return"cancelled"===e.type}(e))return void t.onCancelledError(e)}t.onUnknownError(e)},this.watchId="watchid_".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 to({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 eo.PAUSED:if("ERROR"!==e.msgType)return;break;case eo.LOGGINGIN:case eo.INITING:case eo.REBUILDING:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received while ".concat(this.watchStatus));case eo.CLOSED:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received when the watch has closed");case eo.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 co({errCode:uo.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=eo.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=eo.PAUSED,console.log("[realtime] client paused (".concat(this.collectionName," ").concat(this.query,") (watchId ").concat(this.watchId,")"))},e.prototype.resume=function(){return po(this,void 0,Promise,function(){var e;return ho(this,function(t){switch(t.label){case 0:this.watchStatus=eo.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 po(this,void 0,void 0,function(){var t;return ho(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 po(this,void 0,void 0,function(){var t,n,r,o,i,a,s,c,u,l,p,d;return ho(this,function(h){switch(h.label){case 0:if(t=e.requestId,n=e.msgData.events,r=e.msgType,!n.length||!this.sessionInfo)return[2];o=this.sessionInfo;try{i=n.map(vo)}catch(e){return this.closeWithError(new co({errCode:uo.SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA,errMsg:e})),[2]}a=fo([],o.currentDocs,!0),s=!1,c=function(n,c){var l,p,d,h,f,m,v,y,g,b,w,_;return ho(this,function(x){switch(x.label){case 0:return l=i[n],o.currentEventId>=l.id?(!i[n-1]||l.id>i[n-1].id?console.warn("[realtime] duplicate event received, cur ".concat(o.currentEventId," but got ").concat(l.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(o.currentEventId!==l.id-1)return[3,2];switch(l.dataType){case"update":if(!l.doc)switch(l.queueType){case"update":case"dequeue":if(p=a.find(function(e){return e._id===l.docId}),p){if(d=Qr()(p),l.updatedFields&&Object.keys(l.updatedFields).forEach(function(e){Jr()(d,e,l.updatedFields[e])}),l.removedFields)for(h=0,f=l.removedFields;h<f.length;h++)m=f[h],Yr()(d,m);l.doc=d}else console.error("[realtime listener] internal non-fatal server error: unexpected update dataType event where no doc is associated.");break;case"enqueue":throw y=new co({errCode:uo.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="update" and queueType="enqueue" (requestId '.concat(e.requestId,")")}),u.closeWithError(y),y}break;case"replace":if(!l.doc)throw y=new co({errCode:uo.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="replace" (requestId '.concat(e.requestId,")")}),u.closeWithError(y),y;break;case"remove":(v=a.find(function(e){return e._id===l.docId}))?l.doc=v:console.error("[realtime listener] internal non-fatal server error: unexpected remove event where no doc is associated.");break;case"limit":if(!l.doc)switch(l.queueType){case"dequeue":(v=a.find(function(e){return e._id===l.docId}))?l.doc=v:console.error("[realtime listener] internal non-fatal server error: unexpected limit dataType event where no doc is associated.");break;case"enqueue":throw y=new co({errCode:uo.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="limit" and queueType="enqueue" (requestId '.concat(e.requestId,")")}),u.closeWithError(y),y}}switch(l.queueType){case"init":s?a.push(l.doc):(s=!0,a=[l.doc]);break;case"enqueue":a.push(l.doc);break;case"dequeue":g=a.findIndex(function(e){return e._id===l.docId}),g>-1?a.splice(g,1):console.error("[realtime listener] internal non-fatal server error: unexpected dequeue event where no doc is associated.");break;case"update":g=a.findIndex(function(e){return e._id===l.docId}),g>-1?a[g]=l.doc:console.error("[realtime listener] internal non-fatal server error: unexpected queueType update event where no doc is associated.")}return(n===c-1||i[n+1]&&i[n+1].id!==l.id)&&(b=fo([],a,!0),w=i.slice(0,n+1).filter(function(e){return e.id===l.id}),u.sessionInfo.currentEventId=l.id,u.sessionInfo.currentDocs=a,_=new no({id:l.id,docChanges:w,docs:b,msgType:r}),u.listener.onChange(_)),[3,4];case 2:return console.warn("[realtime listener] event received is out of order, cur ".concat(u.sessionInfo.currentEventId," but got ").concat(l.id)),[4,u.rebuildWatch()];case 3:return x.sent(),[2,{value:void 0}];case 4:return[2]}})},u=this,l=0,p=i.length,h.label=1;case 1:return l<p?[5,c(l,p)]:[3,4];case 2:if("object"==typeof(d=h.sent()))return[2,d.value];h.label=3;case 3:return l++,[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 vo(e){var t={id:e.ID,dataType:e.DataType,queueType:e.QueueType,docId:e.DocID,doc:e.Doc&&"{}"!==e.Doc?JSON.parse(e.Doc):void 0};return"update"===e.DataType&&(e.UpdatedFields&&(t.updatedFields=JSON.parse(e.UpdatedFields)),(e.removedFields||e.RemovedFields)&&(t.removedFields=JSON.parse(e.removedFields))),t}var yo,go={1e3:{code:1e3,name:"Normal Closure",description:"Normal closure; the connection successfully completed whatever purpose for which it was created."},1001:{code:1001,name:"Going Away",description:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection."},1002:{code:1002,name:"Protocol Error",description:"The endpoint is terminating the connection due to a protocol error."},1003:{code:1003,name:"Unsupported Data",description:"The connection is being terminated because the endpoint received data of a type it cannot accept (for example, a text-only endpoint received binary data)."},1005:{code:1005,name:"No Status Received",description:"Indicates that no status code was provided even though one was expected."},1006:{code:1006,name:"Abnormal Closure",description:"Used to indicate that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},1007:{code:1007,name:"Invalid frame payload data",description:"The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},1008:{code:1008,name:"Policy Violation",description:"The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},1009:{code:1009,name:"Message too big",description:"The endpoint is terminating the connection because a data frame was received that is too large."},1010:{code:1010,name:"Missing Extension",description:"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},1011:{code:1011,name:"Internal Error",description:"The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."},1012:{code:1012,name:"Service Restart",description:"The server is terminating the connection because it is restarting."},1013:{code:1013,name:"Try Again Later",description:"The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients."},1014:{code:1014,name:"Bad Gateway",description:"The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code."},1015:{code:1015,name:"TLS Handshake",description:"Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."},3e3:{code:3e3,name:"Reconnect WebSocket",description:"The client is terminating the connection because it wants to reconnect"},3001:{code:3001,name:"No Realtime Listeners",description:"The client is terminating the connection because no more realtime listeners exist"},3002:{code:3002,name:"Heartbeat Ping Error",description:"The client is terminating the connection due to its failure in sending heartbeat messages"},3003:{code:3003,name:"Heartbeat Pong Timeout Error",description:"The client is terminating the connection because no heartbeat response is received from the server"},3050:{code:3050,name:"Server Close",description:"The client is terminating the connection because no heartbeat response is received from the server"}};!function(e){e[e.NormalClosure=1e3]="NormalClosure",e[e.GoingAway=1001]="GoingAway",e[e.ProtocolError=1002]="ProtocolError",e[e.UnsupportedData=1003]="UnsupportedData",e[e.NoStatusReceived=1005]="NoStatusReceived",e[e.AbnormalClosure=1006]="AbnormalClosure",e[e.InvalidFramePayloadData=1007]="InvalidFramePayloadData",e[e.PolicyViolation=1008]="PolicyViolation",e[e.MessageTooBig=1009]="MessageTooBig",e[e.MissingExtension=1010]="MissingExtension",e[e.InternalError=1011]="InternalError",e[e.ServiceRestart=1012]="ServiceRestart",e[e.TryAgainLater=1013]="TryAgainLater",e[e.BadGateway=1014]="BadGateway",e[e.TLSHandshake=1015]="TLSHandshake",e[e.ReconnectWebSocket=3e3]="ReconnectWebSocket",e[e.NoRealtimeListeners=3001]="NoRealtimeListeners",e[e.HeartbeatPingError=3002]="HeartbeatPingError",e[e.HeartbeatPongTimeoutError=3003]="HeartbeatPongTimeoutError",e[e.NoAuthentication=3050]="NoAuthentication"}(yo||(yo={}));var bo=function(e,t){var n=go[e],r=n?"".concat(n.name,", code ").concat(e,", reason ").concat(t||n.description):"code ".concat(e);return new co({errCode:uo.SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED,errMsg:r})},wo=null,_o="web";function xo(){return wo}function Eo(){return _o}function Io(e){_o=e}var So=function(){return So=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},So.apply(this,arguments)},Oo=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())})},To=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])}}},Ao=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 Oo(t,void 0,Promise,function(){var t=this;return To(this,function(n){return[2,new Promise(function(n,r){Oo(t,void 0,void 0,function(){var t,o,i,a,s,c,u,l,p=this;return To(this,function(d){switch(d.label){case 0:o=!1,i=!1,a=function(e){o=!0,t&&clearTimeout(t),n(e)},s=function(e){i=!0,t&&clearTimeout(t),r(e)},e.timeout&&(t=setTimeout(function(){Oo(p,void 0,void 0,function(){return To(this,function(e){switch(e.label){case 0:return o&&i?[3,2]:[4,lo(0)];case 1:e.sent(),o&&i||s(new ao("wsclient.send timedout")),e.label=2;case 2:return[2]}})})},e.timeout)),d.label=1;case 1:return d.trys.push([1,8,,9]),void 0===this.wsInitPromise&&null===this.wsInitPromise?[3,3]:[4,this.wsInitPromise];case 2:d.sent(),d.label=3;case 3:if(!this.ws)return s(new Error("invalid state: ws connection not exists, can not send message")),[2];if(1!==this.ws.readyState)return s(new Error("ws readyState invalid: ".concat(this.ws.readyState,", can not send message"))),[2];e.waitResponse&&(c={resolve:a,reject:s,skipOnMessage:e.skipOnMessage},this.wsResponseWait.set(e.msg.requestId,c)),d.label=4;case 4:return d.trys.push([4,6,,7]),[4,this.ws.send(JSON.stringify(e.msg))];case 5:return d.sent(),e.waitResponse||a(void 0),[3,7];case 6:return(u=d.sent())&&(s(u),e.waitResponse&&this.wsResponseWait.delete(e.msg.requestId)),[3,7];case 7:return[3,9];case 8:return l=d.sent(),s(l),[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),Oo(t,void 0,Promise,function(){var t=this;return To(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(yo.ReconnectWebSocket),this.wsInitPromise=new Promise(function(r,o){Oo(t,void 0,void 0,function(){var t,i,a=this;return To(this,function(s){switch(s.label){case 0:return s.trys.push([0,6,,11]),[4,this.getWsSign()];case 1:return t=s.sent(),[4,new Promise(function(e){var n=t.wsUrl||"wss://tcb-ws.tencentcloudapi.com",r=xo();a.ws=r?new r(n):new WebSocket(n),e(void 0)})];case 2:return s.sent(),this.ws.connect?[4,this.ws.connect()]:[3,4];case 3:s.sent(),s.label=4;case 4:return[4,this.initWebSocketEvent()];case 5:return s.sent(),r(),e&&(this.resumeClients(),this.reconnectState=!1),[3,11];case 6:return i=s.sent(),console.error("[realtime] initWebSocketConnection connect fail",i),n>0?(this.wsInitPromise=void 0,[4,lo(this.reconnectInterval)]):[3,9];case 7:s.sent(),e&&(this.reconnectState=!1),s.label=8;case 8:return r(this.initWebSocketConnection(e,n-1)),[3,10];case 9:o(i),e&&this.closeAllClients(new co({errCode:uo.SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL,errMsg:i})),s.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 co({errCode:uo.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 yo.ReconnectWebSocket:case yo.NoRealtimeListeners:break;case yo.HeartbeatPingError:case yo.HeartbeatPongTimeoutError:case yo.NormalClosure:case yo.AbnormalClosure:t.maxReconnect>0?t.initWebSocketConnection(!0,t.maxReconnect):t.closeAllClients(bo(e.code));break;case yo.NoAuthentication:t.closeAllClients(bo(e.code,e.reason));break;default:t.maxReconnect>0?t.initWebSocketConnection(!0,t.maxReconnect):t.closeAllClients(bo(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 oo(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,u=Array.from(t.watchIdClientMap.entries());c<u.length;c++){u[c][1].onMessage(r);break}}}else if(t.lastPingSendTS){var l=Date.now()-t.lastPingSendTS;if(l>1e4)return void console.warn("[realtime] untrusted rtt observed: ".concat(l));t.rttObserved.length>=3&&t.rttObserved.splice(0,t.rttObserved.length-3+1),t.rttObserved.push(l)}},t.heartbeat()})},this.isWSConnected=function(){return Boolean(t.ws&&1===t.ws.readyState)},this.onceWSConnected=function(){return Oo(t,void 0,Promise,function(){var e=this;return To(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 Oo(t,void 0,Promise,function(){var t,r,o,i,a,s,c,u,l=this;return To(this,function(p){switch(p.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];o=new Promise(function(e,t){Oo(l,void 0,void 0,function(){var n,r,o,i,a;return To(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),[4,this.getWsSign()];case 1:return n=s.sent(),r={envId:n.envId||"",accessToken:"",referrer:"web",sdkVersion:"",dataVersion:""},o={watchId:void 0,requestId:Zr(),msgType:"LOGIN",msgData:r,exMsgData:{runtime:Eo(),signStr:n.signStr,secretVersion:n.secretVersion}},[4,this.send({msg:o,waitResponse:!0,skipOnMessage:!0,timeout:5e3})];case 2:return(i=s.sent()).msgData.code?t(new Error("".concat(i.msgData.code," ").concat(i.msgData.message))):e({envId:n.envId}),[3,4];case 3:return a=s.sent(),t(a),[3,4];case 4:return[2]}})})}),i=e&&this.logins.get(e),a=Date.now(),i?(i.loggedIn=!1,i.loggingInPromise=o,i.loginStartTS=a):(i={loggedIn:!1,loggingInPromise:o,loginStartTS:a},this.logins.set(e||"",i)),p.label=1;case 1:return p.trys.push([1,3,,4]),[4,o];case 2:if(s=p.sent(),(c=e&&this.logins.get(e))&&c===i&&c.loginStartTS===a)return i.loggedIn=!0,i.loggingInPromise=void 0,i.loginStartTS=void 0,i.loginResult=s,[2,s];if(c){if(c.loggedIn&&c.loginResult)return[2,c.loginResult];if(null!==c.loggingInPromise&&void 0!==c.loggingInPromise)return[2,c.loggingInPromise];throw new Error("ws unexpected login info")}throw new Error("ws login info reset");case 3:throw u=p.sent(),i.loggedIn=!1,i.loggingInPromise=void 0,i.loginStartTS=void 0,i.loginResult=void 0,u;case 4:return[2]}})})},this.getWsSign=function(){return Oo(t,void 0,Promise,function(){var e,t,n,r,o,i,a;return To(this,function(s){switch(s.label){case 0:return this.wsSign&&this.wsSign.expiredTs>Date.now()?[2,this.wsSign]:(e=Date.now()+6e4,[4,this.context.appConfig.request.send("auth.wsWebSign",{runtime:Eo()})]);case 1:if((t=s.sent()).code)throw new Error("[tcb-js-sdk] 获取实时数据推送登录票据失败: ".concat(t.code));if(t.data)return n=t.data,r=n.signStr,o=n.wsUrl,i=n.secretVersion,a=n.envId,[2,{signStr:r,wsUrl:o,secretVersion:i,envId:a,expiredTs:e}];throw new Error("[tcb-js-sdk] 获取实时数据推送登录票据失败")}})})},this.getWaitExpectedTimeoutLength=function(){return t.rttObserved.length?t.rttObserved.reduce(function(e,t){return e+t})/t.rttObserved.length*1.5:5e3},this.ping=function(){return Oo(t,void 0,void 0,function(){var e;return To(this,function(t){switch(t.label){case 0:return e={watchId:void 0,requestId:Zr(),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(yo.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,go[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 mo(So(So({},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(){Oo(t,void 0,void 0,function(){var e=this;return To(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(yo.HeartbeatPingError),[3,3];case 3:return[2]}})})},e?0:this.context.appConfig.realtimePingInterval)},e}(),Po={target:"database",entity:function(){var e,t=this.platform,n=t.adapter,r=t.runtime;e=n.wsClass,wo=e,Io(r)}},Co={name:"realtime",IIFE:!0,entity:function(){this.prototype.wsClientClass=Ao}};try{cloudbase.registerComponent(Co),cloudbase.registerHook(Po)}catch(e){}var Ro=function(){function e(){}return e.detectEnvironment=function(){var e;if("undefined"!=typeof WebSocket)return{type:"native",wsConstructor:WebSocket};var t=globalThis;if("undefined"!=typeof globalThis&&void 0!==t.WebSocket)return{type:"native",wsConstructor:t.WebSocket};var n="undefined"!=typeof global?global:void 0;if(n&&void 0!==n.WebSocket)return{type:"native",wsConstructor:n.WebSocket};if("undefined"!=typeof globalThis&&void 0!==t.WebSocketPair&&void 0===globalThis.WebSocket)return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if("undefined"!=typeof globalThis&&t.EdgeRuntime||"undefined"!=typeof navigator&&(null===(e=navigator.userAgent)||void 0===e?void 0:e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};var r=globalThis.process;if(r){var o=r.versions;if(o&&o.node)return{type:"unsupported",error:"Node.js detected but native WebSocket not found.",workaround:"Ensure you are running Node.js 22+ or provide a WebSocket implementation via the transport option."}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}},e.getWebSocketConstructor=function(){var e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;var t=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(t+="\n\nSuggested solution: ".concat(e.workaround)),new Error(t)},e.isWebSocketSupported=function(){try{return"native"===this.detectEnvironment().type}catch(e){return!1}},e}();const ko=Ro;"realtime-js/".concat("1.0.0-alpha.0");var No="1.0.0",jo="2.0.0",Lo=jo,Uo="errored",Do="joined",qo="phx_close",Mo="phx_error",Bo="phx_join",Fo="phx_leave",Wo=function(){function e(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=null!=e?e:[]}return e.prototype.encode=function(e,t){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&"string"==typeof e.payload.event)return t(this._binaryEncodeUserBroadcastPush(e));var n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))},e.prototype._binaryEncodeUserBroadcastPush=function(e){var t;return this._isArrayBuffer(null===(t=e.payload)||void 0===t?void 0:t.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)},e.prototype._encodeBinaryUserBroadcastPush=function(e){var t,n,r=null!==(n=null===(t=e.payload)||void 0===t?void 0:t.payload)&&void 0!==n?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,r)},e.prototype._encodeJsonUserBroadcastPush=function(e){var t,n,r=null!==(n=null===(t=e.payload)||void 0===t?void 0:t.payload)&&void 0!==n?n:{},o=(new TextEncoder).encode(JSON.stringify(r)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,o)},e.prototype._encodeUserBroadcastPush=function(e,t,n){var r,o,i=new TextEncoder,a=i.encode(e.topic),s=i.encode(null!==(r=e.ref)&&void 0!==r?r:""),c=i.encode(null!==(o=e.join_ref)&&void 0!==o?o:""),u=i.encode(e.payload.event),l=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},p=i.encode(0===Object.keys(l).length?"":JSON.stringify(l));if(c.length>255)throw new Error("joinRef length ".concat(c.length," exceeds maximum of 255"));if(s.length>255)throw new Error("ref length ".concat(s.length," exceeds maximum of 255"));if(a.length>255)throw new Error("topic length ".concat(a.length," exceeds maximum of 255"));if(u.length>255)throw new Error("userEvent length ".concat(u.length," exceeds maximum of 255"));if(p.length>255)throw new Error("metadata length ".concat(p.length," exceeds maximum of 255"));var d=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+s.length+a.length+u.length+p.length,h=new ArrayBuffer(this.HEADER_LENGTH+d),f=new DataView(h),m=new Uint8Array(h),v=0;f.setUint8(v++,this.KINDS.userBroadcastPush),f.setUint8(v++,c.length),f.setUint8(v++,s.length),f.setUint8(v++,a.length),f.setUint8(v++,u.length),f.setUint8(v++,p.length),f.setUint8(v++,t),m.set(c,v),v+=c.length,m.set(s,v),v+=s.length,m.set(a,v),v+=a.length,m.set(u,v),v+=u.length,m.set(p,v),v+=p.length;var y=new Uint8Array(h.byteLength+n.byteLength);return y.set(new Uint8Array(h),0),y.set(new Uint8Array(n),h.byteLength),y.buffer},e.prototype.decode=function(e,t){if(this._isArrayBuffer(e))return t(this._binaryDecode(e));if("string"==typeof e){var n=JSON.parse(e);return t({join_ref:n[0],ref:n[1],topic:n[2],event:n[3],payload:n[4]})}return t({})},e.prototype._binaryDecode=function(e){var t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;if(n===this.KINDS.userBroadcast)return this._decodeUserBroadcast(e,t,r)},e.prototype._decodeUserBroadcast=function(e,t,n){var r=t.getUint8(1),o=t.getUint8(2),i=t.getUint8(3),a=t.getUint8(4),s=this.HEADER_LENGTH+4,c=n.decode(e.slice(s,s+r));s+=r;var u=n.decode(e.slice(s,s+o));s+=o;var l=n.decode(e.slice(s,s+i));s+=i;var p=e.slice(s,e.byteLength),d=a===this.JSON_ENCODING?JSON.parse(n.decode(p)):p,h={type:this.BROADCAST_EVENT,event:u,payload:d};return i>0&&(h.meta=JSON.parse(l)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:h}},e.prototype._isArrayBuffer=function(e){var t;return e instanceof ArrayBuffer||"ArrayBuffer"===(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)},e.prototype._pick=function(e,t){return e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(function(e){var n=e[0];return t.includes(n)})):{}},e}();const Go=Wo;var Vo;!function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"}(Vo||(Vo={}));var Ho=function(e,t,n){var r;void 0===n&&(n={});var o=null!==(r=n.skipTypes)&&void 0!==r?r:[];return t?Object.keys(t).reduce(function(n,r){return n[r]=zo(r,e,t,o),n},{}):{}},zo=function(e,t,n,r){var o=t.find(function(t){return t.name===e}),i=null==o?void 0:o.type,a=n[e];return i&&!r.includes(i)?Ko(i,a):Jo(a)},Ko=function(e,t){if("_"===e.charAt(0)){var n=e.slice(1,e.length);return Qo(t,n)}switch(e){case Vo.bool:return $o(t);case Vo.float4:case Vo.float8:case Vo.int2:case Vo.int4:case Vo.int8:case Vo.numeric:case Vo.oid:return Yo(t);case Vo.json:case Vo.jsonb:return Xo(t);case Vo.timestamp:return Zo(t);case Vo.abstime:case Vo.date:case Vo.daterange:case Vo.int4range:case Vo.int8range:case Vo.money:case Vo.reltime:case Vo.text:case Vo.time:case Vo.timestamptz:case Vo.timetz:case Vo.tsrange:case Vo.tstzrange:default:return Jo(t)}},Jo=function(e){return e},$o=function(e){switch(e){case"t":return!0;case"f":return!1;default:return e}},Yo=function(e){if("string"==typeof e){var t=parseFloat(e);if(!Number.isNaN(t))return t}return e},Xo=function(e){if("string"==typeof e)try{return JSON.parse(e)}catch(t){return e}return e},Qo=function(e,t){if("string"!=typeof e)return e;var n=e.length-1,r=e[n];if("{"===e[0]&&"}"===r){var o=void 0,i=e.slice(1,n);try{o=JSON.parse("["+i+"]")}catch(e){o=i?i.split(","):[]}return o.map(function(e){return Ko(t,e)})}return e},Zo=function(e){return"string"==typeof e?e.replace(" ","T"):e};function ei(e){var t=e.indexOf("#"),n=-1===t?e:e.slice(0,t),r=-1===t?"":e.slice(t),o=n.indexOf("?");return{base:-1===o?n:n.slice(0,o),query:-1===o?"":n.slice(o),hash:r}}var ti=function(e){var t=ei(e),n=t.base,r=t.query,o=t.hash,i=n.replace(/^ws/i,"http").replace(/\/+$/,"");return(i=(i=i.replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,"")).replace(/\/+$/,"")+"/api/broadcast")+r+o},ni=e=>"function"==typeof e?e:function(){return e},ri="undefined"!=typeof self?self:null,oi="undefined"!=typeof window?window:null,ii=ri||oi||globalThis,ai="closed",si="errored",ci="joined",ui="joining",li="leaving",pi="phx_close",di="phx_error",hi="phx_reply",fi="phx_leave",mi="websocket",vi="base64url.bearer.phx.",yi=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},gi=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},bi=class{constructor(e,t,n){this.state=ai,this.topic=e,this.params=ni(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new yi(this,"phx_join",this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new gi(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=ci,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this.joinPush.receive("error",e=>{this.state=si,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,e),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=ai,this.socket.remove(this)}),this.onError(e=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=si,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new yi(this,fi,ni({}),this.timeout).send(),this.state=si,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(hi,(e,t)=>{this.trigger(this.replyEventName(t),e)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=ai,this.bindings=[]}onClose(e){this.on(pi,e)}onError(e){return this.on(di,t=>e(t))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter(n=>!(n.event===e&&(void 0===t||t===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new yi(this,e,function(){return t},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=li;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(pi,"leave")},n=new yi(this,fi,ni({}),e);return n.receive("ok",()=>t()).receive("timeout",()=>t()),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(e,t,n){return t}filterBindings(e,t,n){return!0}isMember(e,t,n,r){return!(this.topic!==e||r&&r!==this.joinRef()&&(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:r}),1))}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=ui,this.joinPush.resend(e))}trigger(e,t,n,r){let o=this.onMessage(e,t,n,r);if(t&&!o)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter(r=>r.event===e&&this.filterBindings(r,t,n));for(let e=0;e<i.length;e++)i[e].callback(o,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===ai}isErrored(){return this.state===si}isJoined(){return this.state===ci}isJoining(){return this.state===ui}isLeaving(){return this.state===li}},wi=class{static request(e,t,n,r,o,i,a){if(ii.XDomainRequest){let n=new ii.XDomainRequest;return this.xdomainRequest(n,e,t,r,o,i,a)}if(ii.XMLHttpRequest){let s=new ii.XMLHttpRequest;return this.xhrRequest(s,e,t,n,r,o,i,a)}if(ii.fetch&&ii.AbortController)return this.fetchRequest(e,t,n,r,o,i,a);throw new Error("No suitable XMLHttpRequest implementation found")}static fetchRequest(e,t,n,r,o,i,a){let s={method:e,headers:n,body:r},c=null;return o&&(c=new AbortController,setTimeout(()=>c.abort(),o),s.signal=c.signal),ii.fetch(t,s).then(e=>e.text()).then(e=>this.parseJSON(e)).then(e=>a&&a(e)).catch(e=>{"AbortError"===e.name&&i?i():a&&a(null)}),c}static xdomainRequest(e,t,n,r,o,i,a){return e.timeout=o,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);a&&a(t)},i&&(e.ontimeout=i),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,o,i,a,s){e.open(t,n,!0),e.timeout=i;for(let[t,n]of Object.entries(r))e.setRequestHeader(t,n);return e.onerror=()=>s&&s(null),e.onreadystatechange=()=>{if(4===e.readyState&&s){let t=this.parseJSON(e.responseText);s(t)}},a&&(e.ontimeout=a),e.send(o),e}static parseJSON(e){if(!e||""===e)return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let o=t?`${t}[${r}]`:r,i=e[r];"object"==typeof i?n.push(this.serialize(i,o)):n.push(encodeURIComponent(o)+"="+encodeURIComponent(i))}return n.join("&")}static appendParams(e,t){if(0===Object.keys(t).length)return e;let n=e.match(/\?/)?"&":"?";return`${e}${n}${this.serialize(t)}`}},_i=class{constructor(e,t){t&&2===t.length&&t[1].startsWith(vi)&&(this.authToken=atob(t[1].slice(21))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=0,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+mi),"$1/longpoll")}endpointURL(){return wi.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=0}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return 1===this.readyState||0===this.readyState}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:n,messages:r}=e;if(410===t&&null!==this.token)return this.onerror(410),void this.closeAndRetry(3410,"session_gone",!1);this.token=n}else t=0;switch(t){case 200:r.forEach(e=>{setTimeout(()=>this.onmessage({data:e}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=1,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${t}`)}})}send(e){"string"!=typeof e&&(e=(e=>{let t="",n=new Uint8Array(e),r=n.byteLength;for(let e=0;e<r;e++)t+=String.fromCharCode(n[e]);return btoa(t)})(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e,t=0){this.awaitingBatchAck=!0;const n=t+100,r=e.slice(t,n);this.ajax("POST",{"Content-Type":"application/x-ndjson"},r.join("\n"),()=>this.onerror("timeout"),t=>{t&&200===t.status?n<e.length?this.batchSend(e,n):this.batchBuffer.length>0?(this.batchSend(this.batchBuffer),this.batchBuffer=[]):this.awaitingBatchAck=!1:(this.awaitingBatchAck=!1,this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1))})}close(e,t,n){for(let e of this.reqs)e.abort();this.readyState=3;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,"undefined"!=typeof CloseEvent?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(e,t,n,r,o){let i;i=wi.request(e,this.endpointURL(),t,n,this.timeout,()=>{this.reqs.delete(i),r()},e=>{this.reqs.delete(i),this.isActive()&&o(e)}),this.reqs.add(i)}},xi=class e{constructor(t,n={}){let r=n.events||{state:"presence_state",diff:"presence_diff"};this.state=Object.create(null),this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(r.state,t=>{let{onJoin:n,onLeave:r,onSync:o}=this.caller;this.joinRef=this.channel.joinRef(),this.state=e.syncState(this.state,t,n,r),this.pendingDiffs.forEach(t=>{this.state=e.syncDiff(this.state,t,n,r)}),this.pendingDiffs=[],o()}),this.channel.on(r.diff,t=>{let{onJoin:n,onLeave:r,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(t):(this.state=e.syncDiff(this.state,t,n,r),o())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(t){return e.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,t,n,r){let o=this.toNullProtoObj(this.clone(e));t=this.toNullProtoObj(t);let i=Object.create(null),a=Object.create(null);return this.map(o,(e,n)=>{t[e]||(a[e]=n)}),this.map(t,(e,t)=>{let n=o[e];if(n){let r=t.metas.map(e=>e.phx_ref),o=n.metas.map(e=>e.phx_ref),s=t.metas.filter(e=>o.indexOf(e.phx_ref)<0),c=n.metas.filter(e=>r.indexOf(e.phx_ref)<0);s.length>0&&(i[e]=t,i[e].metas=s),c.length>0&&(a[e]=this.clone(n),a[e].metas=c)}else i[e]=t}),this.syncDiff(o,{joins:i,leaves:a},n,r)}static syncDiff(e,t,n,r){e=this.toNullProtoObj(e);let{joins:o,leaves:i}=this.clone(t);return n||(n=function(){}),r||(r=function(){}),this.map(o,(t,r)=>{let o=e[t];if(e[t]=this.clone(r),o){let n=e[t].metas.map(e=>e.phx_ref),r=o.metas.filter(e=>n.indexOf(e.phx_ref)<0);e[t].metas.unshift(...r)}n(t,o,r)}),this.map(i,(t,n)=>{let o=e[t];if(!o)return;let i=n.metas.map(e=>e.phx_ref);o.metas=o.metas.filter(e=>i.indexOf(e.phx_ref)<0),r(t,o,n),0===o.metas.length&&delete e[t]}),e}static list(e,t){return t||(t=function(e,t){return t}),this.map(e,(e,n)=>t(e,n))}static map(e,t){return Object.getOwnPropertyNames(e).map(n=>t(n,e[n]))}static toNullProtoObj(e){if(null===Object.getPrototypeOf(e))return e;let t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(n=>{t[n]=e[n]}),t}static clone(e){return JSON.parse(JSON.stringify(e))}},Ei={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,o,i,a]=JSON.parse(e);return t({join_ref:n,ref:r,topic:o,event:i,payload:a})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:o,payload:i}=e,a=new TextEncoder,s=a.encode(t),c=a.encode(n),u=a.encode(o),l=a.encode(r);this.assertFieldSize(s.byteLength,"join_ref"),this.assertFieldSize(c.byteLength,"ref"),this.assertFieldSize(u.byteLength,"topic"),this.assertFieldSize(l.byteLength,"event");let p=this.META_LENGTH+s.byteLength+c.byteLength+u.byteLength+l.byteLength,d=new ArrayBuffer(this.HEADER_LENGTH+p),h=new Uint8Array(d),f=new DataView(d),m=0;f.setUint8(m++,this.KINDS.push),f.setUint8(m++,s.byteLength),f.setUint8(m++,c.byteLength),f.setUint8(m++,u.byteLength),f.setUint8(m++,l.byteLength),h.set(s,m),m+=s.byteLength,h.set(c,m),m+=c.byteLength,h.set(u,m),m+=u.byteLength,h.set(l,m),m+=l.byteLength;var v=new Uint8Array(d.byteLength+i.byteLength);return v.set(h,0),v.set(new Uint8Array(i),d.byteLength),v.buffer},assertFieldSize(e,t){if(e>255)throw new Error(`unable to convert ${t} to binary: must be less than or equal to 255 bytes, but is ${e} bytes`)},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}},decodePush(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=t.getUint8(3),a=this.HEADER_LENGTH+this.META_LENGTH-1,s=n.decode(e.slice(a,a+r));a+=r;let c=n.decode(e.slice(a,a+o));a+=o;let u=n.decode(e.slice(a,a+i));return a+=i,{join_ref:s,ref:null,topic:c,event:u,payload:e.slice(a,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=t.getUint8(3),a=t.getUint8(4),s=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(s,s+r));s+=r;let u=n.decode(e.slice(s,s+o));s+=o;let l=n.decode(e.slice(s,s+i));s+=i;let p=n.decode(e.slice(s,s+a));s+=a;let d=e.slice(s,e.byteLength);return{join_ref:c,ref:u,topic:l,event:hi,payload:{status:p,response:d}}},decodeBroadcast(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=this.HEADER_LENGTH+2,a=n.decode(e.slice(i,i+r));i+=r;let s=n.decode(e.slice(i,i+o));return i+=o,{join_ref:null,ref:null,topic:a,event:s,payload:e.slice(i,e.byteLength)}}},Ii=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||1e4,this.transport=t.transport||ii.WebSocket||_i,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let n=null;try{n=ii&&ii.sessionStorage}catch{}this.sessionStore=t.sessionStorage||n,this.establishedConnections=0,this.defaultEncoder=Ei.encode.bind(Ei),this.defaultDecoder=Ei.decode.bind(Ei),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==_i?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let r=null;oi&&oi.addEventListener&&(oi.addEventListener("pagehide",e=>{this.conn&&(this.disconnect(),r=this.connectClock)}),oi.addEventListener("pageshow",e=>{r===this.connectClock&&(r=null,this.connect())}),oi.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState?this.pageHidden=!0:(this.pageHidden=!1,this.isConnected()||this.closeWasClean||this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(e,t,n)=>{console.log(`${e}: ${t}`,n)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=ni(t.params||{}),this.endPoint=`${e}/${mi}`,this.vsn=t.vsn||"2.0.0",this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new gi(()=>{if(this.pageHidden)return this.log("Not reconnecting as page is hidden!"),void this.teardown();this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken&&ni(t.authToken)}getLongPollTransport(){return _i}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=wi.appendParams(wi.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return"/"!==e.charAt(0)?e:"/"===e.charAt(1)?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,n)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=ni(e)),this.conn&&!this.disconnecting||(this.longPollFallbackMs&&this.transport!==_i?this.connectWithFallback(_i,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return null!==this.logger}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let r=this.onMessage(o=>{o.ref===t&&(this.off([r]),e(Date.now()-n))});return!0}transportName(e){return e===_i?"LongPoll":e.name}transportConnect(){let e;this.connectClock++,this.closeWasClean=!1,this.authToken&&(e=["phoenix",`${vi}${btoa(this.authToken()).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n,r=!1,o=!0,i=this.transportName(e),a=t=>{this.log("transport",`falling back to ${i}...`,t),this.off([void 0,n]),o=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${i}`))return a("memorized");this.fallbackTimer=setTimeout(a,t),n=this.onError(e=>{this.log("transport","error",e),o&&!r&&(clearTimeout(this.fallbackTimer),a(e))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!o){let t=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${t}`,"true"),this.log("transport",`established ${t} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(a,t),this.ping(e=>{this.log("transport","connected to primary after",e),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),1e3,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();const r=this.conn;this.waitForBufferDone(r,()=>{t?r.close(t,n||""):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,n=1){5!==n&&e.bufferedAmount?setTimeout(()=>{this.waitForBufferDone(e,t,n+1)},150*n):t()}waitForSocketClosed(e,t,n=1){5!==n&&3!==e.readyState?setTimeout(()=>{this.waitForSocketClosed(e,t,n+1)},150*n):t()}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport","error",e);let t=this.transport,n=this.establishedConnections;this.triggerStateCallbacks("error",e,t,n),(t===this.transport||n>0)&&this.triggerChanError(e)}triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(di,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case 0:return"connecting";case 1:return"open";case 2:return"closing";default:return"closed"}}isConnected(){return"open"===this.connectionState()}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([t])=>-1===e.indexOf(t))}channel(e,t={}){let n=new bi(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:o,join_ref:i}=e;this.log("push",`${t} ${n} (${i}, ${o})`,r)}this.isConnected()?this.encode(e,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(e,e=>this.conn.send(e)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(this.isConnected())if(this.pendingHeartbeatRef)this.heartbeatTimeout();else{this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}else try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:n,payload:r,ref:o,join_ref:i}=e;if(o&&o===this.pendingHeartbeatRef){const e=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback("ok"===r.status?"ok":"error",e)}catch(e){this.log("error","error in heartbeat callback",e)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${r.status||""} ${t} ${n} ${o&&"("+o+")"||""}`.trim(),r);for(let e=0;e<this.channels.length;e++){const a=this.channels[e];a.isMember(t,n,r,i)&&a.trigger(n,r,o,i)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([n,r])=>{try{r(...t)}catch(t){this.log("error",`error in ${e} callback`,t)}})}catch(t){this.log("error",`error triggering ${e} callbacks`,t)}}leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t.isJoined()||t.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}},Si=function(){function e(t,n){var r=function(e){return(null==e?void 0:e.events)&&{events:e.events}}(n);this.presence=new xi(t.getChannel(),r),this.presence.onJoin(function(n,r,o){var i=e.onJoinPayload(n,r,o);t.getChannel().trigger("presence",i)}),this.presence.onLeave(function(n,r,o){var i=e.onLeavePayload(n,r,o);t.getChannel().trigger("presence",i)}),this.presence.onSync(function(){t.getChannel().trigger("presence",{event:"sync"})})}return Object.defineProperty(e.prototype,"state",{get:function(){return e.transformState(this.presence.state)},enumerable:!1,configurable:!0}),e.transformState=function(e){return e=function(e){return JSON.parse(JSON.stringify(e))}(e),Object.getOwnPropertyNames(e).reduce(function(t,n){var r=e[n];return t[n]=Ti(r),t},{})},e.onJoinPayload=function(e,t,n){return{event:"join",key:e,currentPresences:Ai(t),newPresences:Ti(n)}},e.onLeavePayload=function(e,t,n){return{event:"leave",key:e,currentPresences:Ai(t),leftPresences:Ti(n)}},e}();const Oi=Si;function Ti(e){return e.metas.map(function(e){var t=Object.getOwnPropertyDescriptors(e),n=Object.defineProperties({},t);return n.presence_ref=n.phx_ref,delete n.phx_ref,delete n.phx_ref_prev,n})}function Ai(e){return(null==e?void 0:e.metas)?Ti(e):[]}var Pi;!function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"}(Pi||(Pi={}));const Ci=function(){function e(e,t){this.channel=e,this.presenceAdapter=new Oi(this.channel.channelAdapter,t)}return Object.defineProperty(e.prototype,"state",{get:function(){return this.presenceAdapter.state},enumerable:!1,configurable:!0}),e}();var Ri=function(){return Ri=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},Ri.apply(this,arguments)};const ki=function(){function e(e,t,n){var r={config:Ri({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config)};this.channel=e.getSocket().channel(t,r),this.socket=e}return Object.defineProperty(e.prototype,"state",{get:function(){return this.channel.state},set:function(e){this.channel.state=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"joinedOnce",{get:function(){return this.channel.joinedOnce},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"joinPush",{get:function(){return this.channel.joinPush},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rejoinTimer",{get:function(){return this.channel.rejoinTimer},enumerable:!1,configurable:!0}),e.prototype.on=function(e,t){return this.channel.on(e,t)},e.prototype.off=function(e,t){this.channel.off(e,t)},e.prototype.subscribe=function(e){return this.channel.join(e)},e.prototype.unsubscribe=function(e){return this.channel.leave(e)},e.prototype.teardown=function(){this.channel.teardown()},e.prototype.detachLifecycleHooks=function(){this.channel.off(qo),this.channel.off(Mo)},e.prototype.onClose=function(e){this.channel.onClose(e)},e.prototype.onError=function(e){return this.channel.onError(e)},e.prototype.push=function(e,t,n){var r;try{r=this.channel.push(e,t,n)}catch(t){throw new Error("tried to push '".concat(e,"' to '").concat(this.channel.topic,"' before joining. Use channel.subscribe() before pushing events"))}if(this.channel.pushBuffer.length>100){var o=this.channel.pushBuffer.shift();o.cancelTimeout(),this.socket.log("channel","discarded push due to buffer overflow: ".concat(o.event),o.payload())}return r},e.prototype.updateJoinPayload=function(e){var t=this.channel.joinPush.payload();this.channel.joinPush.payload=function(){return Ri(Ri({},t),e)}},e.prototype.canPush=function(){return this.socket.isConnected()&&this.state===Do},e.prototype.isJoined=function(){return this.state===Do},e.prototype.isJoining=function(){return"joining"===this.state},e.prototype.isClosed=function(){return"closed"===this.state},e.prototype.isLeaving=function(){return"leaving"===this.state},e.prototype.updateFilterBindings=function(e){this.channel.filterBindings=e},e.prototype.updatePayloadTransform=function(e){this.channel.onMessage=e},e.prototype.getChannel=function(){return this.channel},e}();var Ni,ji,Li,Ui=/[,()"\\]/,Di=function(e){var t=null===e?"null":String(e);return function(e){return Ui.test(e)||e!==e.trim()}(t)?function(e){return'"'.concat(e.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),'"')}(t):t},qi=function(){function e(){this.filters=[]}return e.prototype.add=function(e,t,n,r){void 0===r&&(r=!1);var o=r?"not.":"";return this.filters.push("".concat(e,"=").concat(o).concat(function(e,t){if("in"===e){var n=Array.isArray(t)?t:[t];if(0===n.length)throw new Error("Realtime `in` filter requires at least one value.");var r=Array.from(new Set(n)).map(function(e){return Di(e)}).join(",");return"in.(".concat(r,")")}return"is"===e?"is.".concat(function(e){return null===e?"null":String(e)}(t)):"".concat(e,".").concat(Di(t))}(t,n))),this},e.prototype.eq=function(e,t){return this.add(e,"eq",t)},e.prototype.neq=function(e,t){return this.add(e,"neq",t)},e.prototype.gt=function(e,t){return this.add(e,"gt",t)},e.prototype.gte=function(e,t){return this.add(e,"gte",t)},e.prototype.lt=function(e,t){return this.add(e,"lt",t)},e.prototype.lte=function(e,t){return this.add(e,"lte",t)},e.prototype.in=function(e,t){return this.add(e,"in",t)},e.prototype.like=function(e,t){return this.add(e,"like",t)},e.prototype.ilike=function(e,t){return this.add(e,"ilike",t)},e.prototype.match=function(e,t){return this.add(e,"match",t)},e.prototype.imatch=function(e,t){return this.add(e,"imatch",t)},e.prototype.is=function(e,t){return this.add(e,"is",t)},e.prototype.isDistinct=function(e,t){return this.add(e,"isdistinct",t)},e.prototype.not=function(e,t,n){return this.add(e,t,n,!0)},e.prototype.build=function(){return this.filters.join(",")},e.prototype.toString=function(){return this.build()},e}(),Mi=function(){return Mi=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},Mi.apply(this,arguments)},Bi=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())})},Fi=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(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"}(Ni||(Ni={})),function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"}(ji||(ji={})),function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"}(Li||(Li={}));var Wi=function(){function e(e,t,n){void 0===t&&(t={config:{}});var r,o,i=this;if(this.topic=e,this.params=t,this.socket=n,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Mi({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config),this.channelAdapter=new ki(this.socket.socketAdapter,e,this.params),this.presence=new Ci(this),this._onClose(function(){i.socket._remove(i)}),this._updateFilterTransform(),this.private=this.params.config.private||!1,!this.private&&(null===(o=null===(r=this.params.config)||void 0===r?void 0:r.broadcast)||void 0===o?void 0:o.replay))throw new Error("tried to use replay on public channel '".concat(this.topic,"'. It must be a private channel."))}return Object.defineProperty(e.prototype,"state",{get:function(){return this.channelAdapter.state},set:function(e){this.channelAdapter.state=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"joinedOnce",{get:function(){return this.channelAdapter.joinedOnce},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timeout",{get:function(){return this.socket.timeout},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"broadcastEndpointURL",{get:function(){return ti(this.socket.socketAdapter.endPointURL())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"joinPush",{get:function(){return this.channelAdapter.joinPush},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rejoinTimer",{get:function(){return this.channelAdapter.rejoinTimer},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e,t){var n,r,o,i;if(void 0===t&&(t=this.timeout),this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){var a=this.params.config,s=a.broadcast,c=a.presence,u=a.private,l=a.postgres_changes_options,p=null!==(r=null===(n=this.bindings.postgres_changes)||void 0===n?void 0:n.map(function(e){return e.filter}))&&void 0!==r?r:[],d=!!this.bindings[ji.PRESENCE]&&this.bindings[ji.PRESENCE].length>0||!0===(null===(o=this.params.config.presence)||void 0===o?void 0:o.enabled),h=Mi({broadcast:s,presence:Mi(Mi({},c),{enabled:d}),postgres_changes:p,private:u},l?{postgres_changes_options:l}:{});this._subscribeCallback=e,this._subscribeTimeout=t,this._bindSubscribeLifecycle(),this.updateJoinPayload({config:h}),this._updateFilterMessage();var f=(null==l?void 0:l.wait)&&p.length>0?Math.max(t,(null!==(i=l.timeout)&&void 0!==i?i:15e3)+1e4):t;this._subscribeJoinTimeout=f,this.channelAdapter.subscribe(f),this._bindJoinPushReceivers()}return this},e.prototype._warmupOn=function(e){var t=this,n=new ki(e,this.topic,this.params);return n.updateJoinPayload(this.channelAdapter.joinPush.payload()),new Promise(function(e,r){var o,i;n.subscribe(null!==(i=null!==(o=t._subscribeJoinTimeout)&&void 0!==o?o:t._subscribeTimeout)&&void 0!==i?i:t.timeout).receive("ok",function(o){var i=o.postgres_changes;void 0===i||t._postgresBindingsAlign(i)?e({adapter:n,postgres_changes:i}):r(new Error("mismatch between server and client bindings for postgres changes"))}).receive("error",function(e){var t=Object.values(e).join(", ")||"error";r(new Error(t,{cause:e}))}).receive("timeout",function(){r(new Error("standby channel join timed out"))})})},e.prototype._adopt=function(e){var t=this,n=this.channelAdapter;n.detachLifecycleHooks(),n.teardown(),this.channelAdapter=e.adapter;for(var r=0,o=Object.keys(this.bindings);r<o.length;r++)for(var i=o[r],a=0,s=this.bindings[i];a<s.length;a++){var c=s[a];c.ref=this.channelAdapter.on(c.type,c.callback)}this._updateFilterMessage(),this._updateFilterTransform(),void 0!==e.postgres_changes&&this._applyPostgresBindingIds(e.postgres_changes),this._onClose(function(){t.socket._remove(t)}),this._bindSubscribeLifecycle(),this._bindJoinPushReceivers({skipImmediate:!0}),this.presence=new Ci(this)},e.prototype._bindSubscribeLifecycle=function(){if(this._subscribeCallback){var e=this._subscribeCallback;this._onError(function(t){e(Li.CHANNEL_ERROR,function(e){if(e instanceof Error)return e;if("string"==typeof e)return new Error(e);if(e&&"object"==typeof e){var t=e;if("number"==typeof t.code){var n="string"==typeof t.reason&&t.reason?" (".concat(t.reason,")"):"";return new Error("socket closed: ".concat(t.code).concat(n),{cause:e})}return new Error("channel error: transport failure",{cause:e})}return new Error("channel error: connection lost")}(t))}),this._onClose(function(){return e(Li.CLOSED)})}},e.prototype._bindJoinPushReceivers=function(e){var t,n=this,r=function(e){var t=e.postgres_changes;return Bi(n,void 0,void 0,function(){var e;return Fi(this,function(n){return this.socket._isManualToken()||this.socket.setAuth(),void 0===t?(null===(e=this._subscribeCallback)||void 0===e||e.call(this,Li.SUBSCRIBED),[2]):(this._updatePostgresBindings(t,this._subscribeCallback),[2])})})},o=function(e){var t;n.state=Uo;var r=Object.values(e).join(", ")||"error";null===(t=n._subscribeCallback)||void 0===t||t.call(n,Li.CHANNEL_ERROR,new Error(r,{cause:e}))},i=function(){var e;null===(e=n._subscribeCallback)||void 0===e||e.call(n,Li.TIMED_OUT)},a=this.channelAdapter.joinPush;if((null==e?void 0:e.skipImmediate)&&"ok"===(null===(t=a.receivedResp)||void 0===t?void 0:t.status))return a.recHooks.push({status:"ok",callback:r}),a.recHooks.push({status:"error",callback:o}),void a.recHooks.push({status:"timeout",callback:i});this.channelAdapter.joinPush.receive("ok",r),this.channelAdapter.joinPush.receive("error",o),this.channelAdapter.joinPush.receive("timeout",i)},e.prototype._postgresBindingsAlign=function(t){for(var n,r=this.bindings.postgres_changes,o=null!==(n=null==r?void 0:r.length)&&void 0!==n?n:0,i=0;i<o;i++){var a=r[i].filter,s=a.event,c=a.schema,u=a.table,l=a.filter,p=t&&t[i];if(!(p&&p.event===s&&e.isFilterValueEqual(p.schema,c)&&e.isFilterValueEqual(p.table,u)&&e.isFilterValueEqual(p.filter,l)))return!1}return!0},e.prototype._applyPostgresBindingIds=function(e){for(var t,n=this.bindings.postgres_changes,r=null!==(t=null==n?void 0:n.length)&&void 0!==t?t:0,o=[],i=0;i<r;i++){var a=n[i],s=e&&e[i];o.push(Mi(Mi({},a),{id:null==s?void 0:s.id}))}this.bindings.postgres_changes=o},e.prototype._updatePostgresBindings=function(e,t){if(!this._postgresBindingsAlign(e))return this.unsubscribe(),this.state=Uo,void(null==t||t(Li.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes")));this._applyPostgresBindingIds(e),this.state!=Uo&&t&&t(Li.SUBSCRIBED)},e.prototype.presenceState=function(){return this.presence.state},e.prototype.track=function(e,t){return void 0===t&&(t={}),Bi(this,void 0,Promise,function(){return Fi(this,function(n){switch(n.label){case 0:return[4,this.send({type:"presence",event:"track",payload:e},t)];case 1:return[2,n.sent()]}})})},e.prototype.untrack=function(e){return void 0===e&&(e={}),Bi(this,void 0,Promise,function(){return Fi(this,function(t){switch(t.label){case 0:return[4,this.send({type:"presence",event:"untrack"},e)];case 1:return[2,t.sent()]}})})},e.prototype.on=function(e,t,n){var r=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),o=e===ji.PRESENCE||e===ji.POSTGRES_CHANGES;if(r&&o)throw this.socket.log("channel","cannot add `".concat(e,"` callbacks for ").concat(this.topic," after `subscribe()`.")),new Error("cannot add `".concat(e,"` callbacks for ").concat(this.topic," after `subscribe()`."));return this._on(e,t,n)},e.prototype.httpSend=function(e,t,n){var r;return void 0===n&&(n={}),Bi(this,void 0,Promise,function(){var o,i,a,s,c,u,l;return Fi(this,function(p){switch(p.label){case 0:return null==t?[2,Promise.reject(new Error("Payload is required for httpSend()"))]:[4,this.socket.setAuth()];case 1:return p.sent(),o=t instanceof ArrayBuffer||ArrayBuffer.isView(t),i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":o?"application/octet-stream":"application/json"},this.socket.accessTokenValue&&(i.Authorization="Bearer ".concat(this.socket.accessTokenValue)),a=function(e,t,n,r){var o=ei(e),i=o.base,a=o.query,s=o.hash,c="/".concat(encodeURIComponent(t),"/events/").concat(encodeURIComponent(n)),u=i.replace(/\/+$/,"")+c,l=[];if(a.startsWith("?")&&a.length>1&&l.push(a.slice(1)),r)for(var p=0,d=Object.entries(r);p<d.length;p++){var h=d[p],f=h[0],m=h[1];l.push("".concat(encodeURIComponent(f),"=").concat(encodeURIComponent(m)))}return u+(l.length?"?".concat(l.join("&")):"")+s}(this.broadcastEndpointURL,this.subTopic,e,this.private?{private:"true"}:void 0),s={method:"POST",headers:i,body:o?t:JSON.stringify(t)},[4,this._fetchWithTimeout(a,s,null!==(r=n.timeout)&&void 0!==r?r:this.timeout)];case 2:if(202===(c=p.sent()).status)return[2,{success:!0}];if(404===c.status)return[2,Promise.reject(new Error("httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/TencentCloudBase/cloudbase-js-sdk/blob/master/packages/realtime-js/migrations/httpsend-server-version.md"))];u=c.statusText,p.label=3;case 3:return p.trys.push([3,5,,6]),[4,c.json()];case 4:return l=p.sent(),u=l.error||l.message||u,[3,6];case 5:return p.sent(),[3,6];case 6:return[2,Promise.reject(new Error(u))]}})})},e.prototype.send=function(e,t){var n,r;return void 0===t&&(t={}),Bi(this,void 0,Promise,function(){var o,i,a,s,c,u,l,p=this;return Fi(this,function(d){switch(d.label){case 0:return this.channelAdapter.canPush()||"broadcast"!==e.type?[3,7]:(o="Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.",this.socket.hasLogger()?this.socket.log("channel",o):console.warn(o),i=e.event,a=e.payload,[4,this.socket.setAuth()]);case 1:d.sent(),s={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},this.socket.accessTokenValue&&(s.Authorization="Bearer ".concat(this.socket.accessTokenValue)),c={method:"POST",headers:s,body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:a,private:this.private}]})},d.label=2;case 2:return d.trys.push([2,5,,6]),[4,this._fetchWithTimeout(this.broadcastEndpointURL,c,null!==(n=t.timeout)&&void 0!==n?n:this.timeout)];case 3:return u=d.sent(),[4,null===(r=u.body)||void 0===r?void 0:r.cancel()];case 4:return d.sent(),[2,u.ok?"ok":"error"];case 5:return(l=d.sent())instanceof Error&&"AbortError"===l.name?[2,"timed out"]:[2,"error"];case 6:return[3,8];case 7:return[2,new Promise(function(n){var r,o,i,a=p.channelAdapter.push(e.type,e,t.timeout||p.timeout);"broadcast"!==e.type||(null===(i=null===(o=null===(r=p.params)||void 0===r?void 0:r.config)||void 0===o?void 0:o.broadcast)||void 0===i?void 0:i.ack)||n("ok"),a.receive("ok",function(){return n("ok")}),a.receive("error",function(){return n("error")}),a.receive("timeout",function(){return n("timed out")})})];case 8:return[2]}})})},e.prototype.updateJoinPayload=function(e){this.channelAdapter.updateJoinPayload(e)},e.prototype.unsubscribe=function(e){return void 0===e&&(e=this.timeout),Bi(this,void 0,void 0,function(){var t=this;return Fi(this,function(n){return[2,new Promise(function(n){t.channelAdapter.unsubscribe(e).receive("ok",function(){return n("ok")}).receive("timeout",function(){return n("timed out")}).receive("error",function(){return n("error")})})]})})},e.prototype.teardown=function(){this.channelAdapter.teardown()},e.prototype._fetchWithTimeout=function(e,t,n){return Bi(this,void 0,void 0,function(){var r,o,i,a;return Fi(this,function(s){switch(s.label){case 0:if(r=function(){var e=new Error("The operation was aborted");return e.name="AbortError",e},"undefined"!=typeof AbortController)return[3,4];s.label=1;case 1:return s.trys.push([1,,3,4]),[4,Promise.race([this.socket.fetch(e,t),new Promise(function(e,t){o=setTimeout(function(){return t(r())},n)})])];case 2:return[2,s.sent()];case 3:return o&&clearTimeout(o),[7];case 4:i=new AbortController,a=setTimeout(function(){return i.abort()},n),s.label=5;case 5:return s.trys.push([5,,7,8]),[4,this.socket.fetch(e,Mi(Mi({},t),{signal:i.signal}))];case 6:return[2,s.sent()];case 7:return clearTimeout(a),[7];case 8:return[2]}})})},e.prototype._on=function(t,n,r){var o,i=t.toLocaleLowerCase(),a=null==n?void 0:n.filter;if((a instanceof qi||"object"==typeof a&&null!==a&&"function"==typeof a.build)&&(n=Mi(Mi({},n),{filter:a.build()})),i===ji.POSTGRES_CHANGES&&(null===(o=this.bindings[i])||void 0===o?void 0:o.find(function(t){return e.isSamePostgresFilter(t.filter,n)})))return this.socket.log("error","duplicate `postgres_changes` binding for ".concat(this.topic," ignored"),n),this;var s=this.channelAdapter.on(t,r),c={type:i,filter:n,callback:r,ref:s};return this.bindings[i]?this.bindings[i].push(c):this.bindings[i]=[c],this._updateFilterMessage(),this},e.prototype._onClose=function(e){this.channelAdapter.onClose(e)},e.prototype._onError=function(e){this.channelAdapter.onError(e)},e.prototype._updateFilterMessage=function(){var e=this;this.channelAdapter.updateFilterBindings(function(t,n,r){var o,i,a,s,c,u,l,p=t.event.toLocaleLowerCase();if(e._notThisChannelEvent(p,r))return!1;var d=null===(o=e.bindings[p])||void 0===o?void 0:o.find(function(e){return e.ref===t.ref});if(!d)return!0;if(["broadcast","presence","postgres_changes"].includes(p)){if("id"in d){var h=d.id,f=null===(i=d.filter)||void 0===i?void 0:i.event;return h&&(null===(a=n.ids)||void 0===a?void 0:a.includes(h))&&("*"===f||(null==f?void 0:f.toLocaleLowerCase())===(null===(s=n.data)||void 0===s?void 0:s.type.toLocaleLowerCase()))}return"*"===(f=null===(u=null===(c=null==d?void 0:d.filter)||void 0===c?void 0:c.event)||void 0===u?void 0:u.toLocaleLowerCase())||f===(null===(l=null==n?void 0:n.event)||void 0===l?void 0:l.toLocaleLowerCase())}return d.type.toLocaleLowerCase()===p})},e.prototype._notThisChannelEvent=function(e,t){return t&&[qo,Mo,Fo,Bo].includes(e)&&t!==this.joinPush.ref},e.prototype._updateFilterTransform=function(){var e=this;this.channelAdapter.updatePayloadTransform(function(t,n,r){if("object"==typeof n&&"ids"in n){var o=n.data,i=o.schema,a=o.table,s=o.commit_timestamp,c=o.type,u=o.errors;return Mi(Mi({},{schema:i,table:a,commit_timestamp:s,eventType:c,new:{},old:{},errors:u}),e._getPayloadRecords(o))}return n})},e.prototype.copyBindings=function(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(var t in e.bindings)for(var n=0,r=e.bindings[t];n<r.length;n++){var o=r[n];this._on(o.type,o.filter,o.callback)}},e.isFilterValueEqual=function(e,t){return(null!=e?e:void 0)===(null!=t?t:void 0)},e.isSamePostgresFilter=function(t,n){var r,o,i,a,s=null!==(o=null===(r=null==t?void 0:t.select)||void 0===r?void 0:r.join())&&void 0!==o?o:void 0,c=null!==(a=null===(i=null==n?void 0:n.select)||void 0===i?void 0:i.join())&&void 0!==a?a:void 0;return(null==t?void 0:t.event)===(null==n?void 0:n.event)&&e.isFilterValueEqual(null==t?void 0:t.schema,null==n?void 0:n.schema)&&e.isFilterValueEqual(null==t?void 0:t.table,null==n?void 0:n.table)&&e.isFilterValueEqual(null==t?void 0:t.filter,null==n?void 0:n.filter)&&s===c},e.prototype._getPayloadRecords=function(e){var t={new:{},old:{}};return"INSERT"!==e.type&&"UPDATE"!==e.type||(t.new=Ho(e.columns,e.record)),"UPDATE"!==e.type&&"DELETE"!==e.type||(t.old=Ho(e.columns,e.old_record)),t},e}();const Gi=Wi,Vi=function(){function e(e,t){this.socket=new Ii(e,t)}return Object.defineProperty(e.prototype,"timeout",{get:function(){return this.socket.timeout},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"endPoint",{get:function(){return this.socket.endPoint},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transport",{get:function(){return this.socket.transport},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"heartbeatIntervalMs",{get:function(){return this.socket.heartbeatIntervalMs},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"heartbeatCallback",{get:function(){return this.socket.heartbeatCallback},set:function(e){this.socket.heartbeatCallback=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"heartbeatTimer",{get:function(){return this.socket.heartbeatTimer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pendingHeartbeatRef",{get:function(){return this.socket.pendingHeartbeatRef},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"reconnectTimer",{get:function(){return this.socket.reconnectTimer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vsn",{get:function(){return this.socket.vsn},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"encode",{get:function(){return this.socket.encode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"decode",{get:function(){return this.socket.decode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"reconnectAfterMs",{get:function(){return this.socket.reconnectAfterMs},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sendBuffer",{get:function(){return this.socket.sendBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stateChangeCallbacks",{get:function(){return this.socket.stateChangeCallbacks},enumerable:!1,configurable:!0}),e.prototype.connect=function(){this.socket.connect()},e.prototype.disconnect=function(e,t,n,r){var o=this;return void 0===r&&(r=1e4),new Promise(function(i){setTimeout(function(){return i("timeout")},r),o.socket.disconnect(function(){e(),i("ok")},t,n)})},e.prototype.push=function(e){this.socket.push(e)},e.prototype.log=function(e,t,n){this.socket.log(e,t,n)},e.prototype.hasLogger=function(){return this.socket.hasLogger()},e.prototype.makeRef=function(){return this.socket.makeRef()},e.prototype.onOpen=function(e){this.socket.onOpen(e)},e.prototype.onClose=function(e){this.socket.onClose(e)},e.prototype.onError=function(e){this.socket.onError(e)},e.prototype.onMessage=function(e){this.socket.onMessage(e)},e.prototype.isConnected=function(){return this.socket.isConnected()},e.prototype.isConnecting=function(){return"connecting"==this.socket.connectionState()},e.prototype.isDisconnecting=function(){return"closing"==this.socket.connectionState()},e.prototype.connectionState=function(){return this.socket.connectionState()},e.prototype.endPointURL=function(){return this.socket.endPointURL()},e.prototype.sendHeartbeat=function(){this.socket.sendHeartbeat()},e.prototype.getSocket=function(){return this.socket},e}();var Hi=function(){return Hi=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},Hi.apply(this,arguments)},zi=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())})},Ki=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])}}},Ji=[1e3,2e3,5e3,1e4];var $i=function(){function e(e,t){var n;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new Go,this._manuallySetToken=!1,this._authPromise=null,this._authGeneration=0,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._endPoint="",this._socketOptions={},this._openingActive=!1,this._handlersAdapter=null,this._standbyAdapter=null,this._rotating=!1,this._cutoverStarted=!1,this._refreshTimer=null,this._rotateRetryTimer=null,this.connectionMaxAgeMs=0,this.connectionRefreshJitterMs=2e4,this._resolveFetch=function(e){return e?function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.apply(void 0,t)}:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if("undefined"==typeof fetch)throw new Error("httpSend() requires a fetch implementation. Pass options.fetch, or use app.realtime() after registering a platform adapter that provides reqClass.");return fetch.apply(void 0,e)}},!(null===(n=null==t?void 0:t.params)||void 0===n?void 0:n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=t.params.apikey;var r=this._initializeOptions(t);this._endPoint=e,this._socketOptions=r,this.socketAdapter=this._createSocketAdapter(),this.httpEndpoint=ti(e),this.fetch=this._resolveFetch(null==t?void 0:t.fetch)}return Object.defineProperty(e.prototype,"endPoint",{get:function(){return this.socketAdapter.endPoint},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timeout",{get:function(){return this.socketAdapter.timeout},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transport",{get:function(){return this.socketAdapter.transport},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"heartbeatCallback",{get:function(){return this.socketAdapter.heartbeatCallback},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"heartbeatIntervalMs",{get:function(){return this.socketAdapter.heartbeatIntervalMs},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"heartbeatTimer",{get:function(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pendingHeartbeatRef",{get:function(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"reconnectTimer",{get:function(){return this.socketAdapter.reconnectTimer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vsn",{get:function(){return this.socketAdapter.vsn},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"encode",{get:function(){return this.socketAdapter.encode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"decode",{get:function(){return this.socketAdapter.decode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"reconnectAfterMs",{get:function(){return this.socketAdapter.reconnectAfterMs},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sendBuffer",{get:function(){return this.socketAdapter.sendBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stateChangeCallbacks",{get:function(){return this.socketAdapter.stateChangeCallbacks},enumerable:!1,configurable:!0}),e.prototype.connect=function(){var e=this;if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected()||this._openingActive)){if(this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._beforeTransportConnect)return this._openingActive=!0,void this._openActiveSocket().catch(function(t){e.log("error","failed to open socket",t)});this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){var t=e.message;throw new Error("WebSocket not available: ".concat(t))}this._handleNodeJsRaceCondition()}},e.prototype.endpointURL=function(){return this.socketAdapter.endPointURL()},e.prototype.disconnect=function(e,t){return zi(this,void 0,void 0,function(){var n,r,o=this;return Ki(this,function(i){switch(i.label){case 0:return this._cancelPendingDisconnect(),this._cancelConnectionRefresh(),this._cancelRotateRetry(),this._rotating=!1,this._cutoverStarted=!1,n=this._standbyAdapter,this._standbyAdapter=null,this.isDisconnecting()?n?[4,n.disconnect(function(){},1e3,"connection refresh abort")]:[3,2]:[3,3];case 1:i.sent(),i.label=2;case 2:return[2,"ok"];case 3:return[4,this.socketAdapter.disconnect(function(){clearInterval(o._workerHeartbeatTimer),o._terminateWorker()},e,t)];case 4:return r=i.sent(),n?[4,n.disconnect(function(){},1e3,"connection refresh abort")]:[3,6];case 5:i.sent(),i.label=6;case 6:return[2,r]}})})},e.prototype.getChannels=function(){return this.channels},e.prototype.removeChannel=function(e){return zi(this,void 0,Promise,function(){var t;return Ki(this,function(n){switch(n.label){case 0:return[4,e.unsubscribe()];case 1:return"ok"===(t=n.sent())&&e.teardown(),[2,t]}})})},e.prototype.removeAllChannels=function(){return zi(this,void 0,Promise,function(){var e,t,n=this;return Ki(this,function(r){switch(r.label){case 0:return e=this.channels.map(function(e){return zi(n,void 0,void 0,function(){var t;return Ki(this,function(n){switch(n.label){case 0:return[4,e.unsubscribe()];case 1:return t=n.sent(),e.teardown(),[2,t]}})})}),[4,Promise.all(e)];case 1:return t=r.sent(),[4,this.disconnect()];case 2:return r.sent(),[2,t]}})})},e.prototype.log=function(e,t,n){this.socketAdapter.log(e,t,n)},e.prototype.hasLogger=function(){return this.socketAdapter.hasLogger()},e.prototype.connectionState=function(){return this.socketAdapter.connectionState()||"closed"},e.prototype.isConnected=function(){return this.socketAdapter.isConnected()},e.prototype.isConnecting=function(){return this.socketAdapter.isConnecting()},e.prototype.isDisconnecting=function(){return this.socketAdapter.isDisconnecting()},e.prototype.channel=function(e,t){void 0===t&&(t={config:{}});var n="realtime:".concat(e),r=this.getChannels().find(function(e){return e.topic===n});if(r)return r;var o=new Gi("realtime:".concat(e),t,this);return this._cancelPendingDisconnect(),this.channels.push(o),o},e.prototype.push=function(e){this.socketAdapter.push(e)},e.prototype.setAuth=function(e){return void 0===e&&(e=null),zi(this,void 0,Promise,function(){var t,n;return Ki(this,function(r){switch(r.label){case 0:t=++this._authGeneration,n=this._performAuth(e,t),t===this._authGeneration&&(this._authPromise=n),r.label=1;case 1:return r.trys.push([1,,3,4]),[4,n];case 2:return r.sent(),[3,4];case 3:return this._authPromise===n&&(this._authPromise=null),[7];case 4:return[2]}})})},e.prototype._isManualToken=function(){return this._manuallySetToken},e.prototype.sendHeartbeat=function(){return zi(this,void 0,void 0,function(){return Ki(this,function(e){return this.socketAdapter.sendHeartbeat(),[2]})})},e.prototype.onHeartbeat=function(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)},e.prototype._makeRef=function(){return this.socketAdapter.makeRef()},e.prototype._remove=function(e){this.channels=this.channels.filter(function(t){return t.topic!==e.topic}),0===this.channels.length&&(this.log("transport","no channels remaining, scheduling disconnect"),this._cancelConnectionRefresh(),this._cancelRotateRetry(),this._abortRotate(),this._schedulePendingDisconnect())},e.prototype._schedulePendingDisconnect=function(){var e=this;if(this._cancelPendingDisconnect(),0===this._disconnectOnEmptyChannelsAfterMs)return this.log("transport","disconnecting immediately - no channels"),void this.disconnect();this._pendingDisconnectTimer=setTimeout(function(){e._pendingDisconnectTimer=null,0===e.channels.length&&(e.log("transport","deferred disconnect fired - no channels, disconnecting"),e.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport","deferred disconnect scheduled in ".concat(this._disconnectOnEmptyChannelsAfterMs,"ms"))},e.prototype._cancelPendingDisconnect=function(){null!==this._pendingDisconnectTimer&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)},e.prototype._performAuth=function(e,t){return zi(this,void 0,Promise,function(){var n,r,o;return Ki(this,function(i){switch(i.label){case 0:return r=!1,e?(n=e,r=!0,[3,7]):[3,1];case 1:if(!this.accessToken)return[3,6];i.label=2;case 2:return i.trys.push([2,4,,5]),[4,this.accessToken()];case 3:return n=i.sent(),[3,5];case 4:return o=i.sent(),this.log("error","Error fetching access token from callback",o),n=this.accessTokenValue,[3,5];case 5:return[3,7];case 6:n=this.accessTokenValue,i.label=7;case 7:return t!==this._authGeneration||(this.accessToken?this._manuallySetToken=!1:r&&(this._manuallySetToken=!0),this.accessTokenValue!=n&&(this.accessTokenValue=n)),[2]}})})},e.prototype._waitForAuthIfNeeded=function(){return zi(this,void 0,Promise,function(){return Ki(this,function(e){switch(e.label){case 0:return this._authPromise?[4,this._authPromise]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},e.prototype._setAuthSafely=function(e){var t=this;void 0===e&&(e="general"),this._isManualToken()||this.setAuth().catch(function(n){t.log("error","Error setting auth in ".concat(e),n)})},e.prototype._setupConnectionHandlers=function(){var e=this;if(this._handlersAdapter!==this.socketAdapter){this._handlersAdapter=this.socketAdapter;var t=this.socketAdapter;t.onOpen(function(){e.socketAdapter===t&&((e._authPromise||(e.accessToken&&!e.accessTokenValue?e.setAuth():Promise.resolve())).catch(function(t){e.log("error","error waiting for auth on connect",t)}),e.worker&&!e.workerRef&&e._startWorkerHeartbeat(),e._scheduleConnectionRefresh())}),t.onClose(function(){e.socketAdapter===t&&(e.worker&&e.workerRef&&e._terminateWorker(),e._rotating&&!e._cutoverStarted&&(e.log("transport","active socket closed during refresh, aborting standby"),e._abortRotate()),e._rotating||e._cancelConnectionRefresh())}),t.onMessage(function(n){e.socketAdapter===t&&n.ref&&n.ref===e._pendingWorkerHeartbeatRef&&(e._pendingWorkerHeartbeatRef=null)})}},e.prototype._handleNodeJsRaceCondition=function(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()},e.prototype._wrapHeartbeatCallback=function(e){var t=this;return function(n,r){"disconnected"!==n&&("sent"==n&&t._setAuthSafely(),e&&e(n,r))}},e.prototype._startWorkerHeartbeat=function(){var e=this;this.workerUrl?this.log("worker","starting worker for from ".concat(this.workerUrl)):this.log("worker","starting default worker");var t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=function(t){e.log("worker","worker error",t.message),e._terminateWorker(),e.disconnect()},this.workerRef.onmessage=function(t){"keepAlive"===t.data.event&&e.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})},e.prototype._terminateWorker=function(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)},e.prototype._workerObjectUrl=function(e){var t;if(e)t=e;else{var n=new Blob(['\n addEventListener("message", (e) => {\n if (e.data.event === "start") {\n setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);\n }\n });'],{type:"application/javascript"});t=URL.createObjectURL(n)}return t},e.prototype._initializeOptions=function(e){var t,n,r,o,i,a,s,c,u,l,p,d,h,f;this.worker=null!==(t=null==e?void 0:e.worker)&&void 0!==t&&t,this.accessToken=null!==(n=null==e?void 0:e.accessToken)&&void 0!==n?n:null,this.connectionMaxAgeMs=null!==(r=null==e?void 0:e.connectionMaxAgeMs)&&void 0!==r?r:0,this.connectionRefreshJitterMs=null!==(o=null==e?void 0:e.connectionRefreshJitterMs)&&void 0!==o?o:2e4,this._beforeTransportConnect=null==e?void 0:e.beforeTransportConnect;var m,v,y={};y.timeout=null!==(i=null==e?void 0:e.timeout)&&void 0!==i?i:1e4,y.heartbeatIntervalMs=null!==(a=null==e?void 0:e.heartbeatIntervalMs)&&void 0!==a?a:25e3,this._disconnectOnEmptyChannelsAfterMs=null!==(s=null==e?void 0:e.disconnectOnEmptyChannelsAfterMs)&&void 0!==s?s:2*(null!==(c=null==e?void 0:e.heartbeatIntervalMs)&&void 0!==c?c:25e3),y.transport=null!==(u=null==e?void 0:e.transport)&&void 0!==u?u:ko.getWebSocketConstructor(),y.params=null==e?void 0:e.params,y.logger=null==e?void 0:e.logger,y.heartbeatCallback=this._wrapHeartbeatCallback(null==e?void 0:e.heartbeatCallback),y.sessionStorage=null!==(l=null==e?void 0:e.sessionStorage)&&void 0!==l?l:function(){try{if("undefined"!=typeof globalThis&&globalThis.sessionStorage)return globalThis.sessionStorage}catch(e){}return e=new Map,{get length(){return e.size},clear:function(){e.clear()},getItem:function(t){return e.has(t)?e.get(t):null},key:function(t){var n;return null!==(n=Array.from(e.keys())[t])&&void 0!==n?n:null},removeItem:function(t){e.delete(t)},setItem:function(t,n){e.set(t,String(n))}};var e}(),y.reconnectAfterMs=null!==(p=null==e?void 0:e.reconnectAfterMs)&&void 0!==p?p:function(e){return Ji[e-1]||1e4};var g=null!==(d=null==e?void 0:e.vsn)&&void 0!==d?d:Lo;switch(g){case No:m=function(e,t){return t(JSON.stringify(e))},v=function(e,t){return t(JSON.parse(e))};break;case jo:m=this.serializer.encode.bind(this.serializer),v=this.serializer.decode.bind(this.serializer);break;default:throw new Error("Unsupported serializer version: ".concat(y.vsn))}if(y.vsn=g,y.encode=null!==(h=null==e?void 0:e.encode)&&void 0!==h?h:m,y.decode=null!==(f=null==e?void 0:e.decode)&&void 0!==f?f:v,y.beforeReconnect=this._reconnectAuth.bind(this),((null==e?void 0:e.logLevel)||(null==e?void 0:e.log_level))&&(this.logLevel=e.logLevel||e.log_level,y.params=Hi(Hi({},y.params),{log_level:this.logLevel})),this.worker){if("undefined"!=typeof window&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=null==e?void 0:e.workerUrl,y.autoSendHeartbeat=!this.worker}return y},e.prototype._reconnectAuth=function(){return zi(this,void 0,void 0,function(){return Ki(this,function(e){switch(e.label){case 0:return[4,this._waitForAuthIfNeeded()];case 1:return e.sent(),this.isConnected()||this.connect(),[2]}})})},e.prototype._createSocketAdapter=function(){return new Vi(this._endPoint,this._socketOptions)},e.prototype._openActiveSocket=function(){return zi(this,void 0,void 0,function(){var e,t;return Ki(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,4,5]),this._beforeTransportConnect?[4,this._beforeTransportConnect()]:[3,2];case 1:n.sent(),n.label=2;case 2:return this.isConnecting()||this.isDisconnecting()||this.isConnected()?[2]:(this._setupConnectionHandlers(),this.socketAdapter.connect(),this._handleNodeJsRaceCondition(),[3,5]);case 3:throw e=n.sent(),t=e.message,new Error("WebSocket not available: ".concat(t));case 4:return this._openingActive=!1,[7];case 5:return[2]}})})},e.prototype._scheduleConnectionRefresh=function(){var e=this;if(this._cancelConnectionRefresh(),!(this.connectionMaxAgeMs<=0)){var t=this.connectionRefreshJitterMs>0?Math.floor(Math.random()*this.connectionRefreshJitterMs):0,n=this.connectionMaxAgeMs+t;this._refreshTimer=setTimeout(function(){e._refreshTimer=null,e._rotateConnection()},n),this.log("transport","connection refresh scheduled in ".concat(n,"ms"))}},e.prototype._cancelConnectionRefresh=function(){null!==this._refreshTimer&&(clearTimeout(this._refreshTimer),this._refreshTimer=null)},e.prototype._scheduleRotateRetry=function(){var e=this;this._cancelRotateRetry(),this._rotateRetryTimer=setTimeout(function(){e._rotateRetryTimer=null,e.isConnected()&&!e._rotating&&e._rotateConnection()},1e4),this.log("transport","connection refresh retry scheduled in ".concat(1e4,"ms"))},e.prototype._cancelRotateRetry=function(){null!==this._rotateRetryTimer&&(clearTimeout(this._rotateRetryTimer),this._rotateRetryTimer=null)},e.prototype._rotateConnection=function(){return zi(this,void 0,void 0,function(){var e,t,n,r;return Ki(this,function(o){switch(o.label){case 0:if(this._rotating||!this.isConnected()||0===this.channels.length)return[2];this._rotating=!0,this._cutoverStarted=!1,this._cancelConnectionRefresh(),this.log("transport","starting connection refresh"),o.label=1;case 1:return o.trys.push([1,6,,8]),this._beforeTransportConnect?[4,this._beforeTransportConnect()]:[3,3];case 2:o.sent(),o.label=3;case 3:if(!this.isConnected()||0===this.channels.length)throw new Error("active connection lost before standby connect");return e=this._createSocketAdapter(),this._standbyAdapter=e,[4,this._connectAndWaitOpen(e)];case 4:return o.sent(),t=this.channels.filter(function(e){return e.joinedOnce&&!e.channelAdapter.isClosed()&&!e.channelAdapter.isLeaving()}),[4,Promise.all(t.map(function(t){return t._warmupOn(e)}))];case 5:return n=o.sent(),this._cutover(t,n,e),[3,8];case 6:return r=o.sent(),this.log("transport","connection refresh failed",r),[4,this._teardownStandby()];case 7:return o.sent(),this._rotating=!1,this._cutoverStarted=!1,this.isConnected()&&this.channels.length>0&&this._scheduleRotateRetry(),[3,8];case 8:return[2]}})})},e.prototype._cutover=function(e,t,n){this._cutoverStarted=!0;for(var r=this.socketAdapter,o=0;o<e.length;o++)e[o]._adopt(t[o]);this.socketAdapter=n,this._standbyAdapter=null,this._setupConnectionHandlers(),this.worker&&(this._terminateWorker(),this._startWorkerHeartbeat()),this._rotating=!1,this._scheduleConnectionRefresh(),r.disconnect(function(){},1e3,"connection refresh"),this.log("transport","connection refresh complete")},e.prototype._connectAndWaitOpen=function(e,t){return void 0===t&&(t=1e4),zi(this,void 0,Promise,function(){return Ki(this,function(n){switch(n.label){case 0:return[4,new Promise(function(n,r){var o=setTimeout(function(){r(new Error("standby connect timed out"))},t);e.onOpen(function(){clearTimeout(o),n()}),e.onError(function(e){clearTimeout(o),r(e instanceof Error?e:new Error(String(e)))});try{e.connect()}catch(e){clearTimeout(o),r(e)}})];case 1:return n.sent(),[2]}})})},e.prototype._teardownStandby=function(){return zi(this,void 0,void 0,function(){var e;return Ki(this,function(t){switch(t.label){case 0:if(e=this._standbyAdapter,this._standbyAdapter=null,!e)return[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,e.disconnect(function(){},1e3,"connection refresh abort")];case 2:case 3:return t.sent(),[3,4];case 4:return[2]}})})},e.prototype._abortRotate=function(){return zi(this,void 0,void 0,function(){return Ki(this,function(e){switch(e.label){case 0:return this._cancelRotateRetry(),[4,this._teardownStandby()];case 1:return e.sent(),this._rotating=!1,this._cutoverStarted=!1,[2]}})})},e}();const Yi=$i;var Xi=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())})},Qi=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 Zi(e){if(!e)return{};if("undefined"!=typeof Headers&&e instanceof Headers){var t={};return e.forEach(function(e,n){t[n]=e}),t}if(Array.isArray(e)){for(var n={},r=0,o=e;r<o.length;r++){var i=o[r],a=i[0],s=i[1];n[a]=String(s)}return n}for(var c={},u=0,l=Object.entries(e);u<l.length;u++){var p=l[u];a=p[0],null!=(s=p[1])&&(c[a]=String(s))}return c}function ea(e){var t;return"string"==typeof e?e:"undefined"!=typeof URL&&e instanceof URL?e.toString():"undefined"!=typeof Request&&e instanceof Request?e.url:String(null!==(t=e.url)&&void 0!==t?t:e)}function ta(e){return Xi(this,void 0,Promise,function(){var t;return Qi(this,function(n){switch(n.label){case 0:return[4,e];case 1:if(null==(t=n.sent())||""===t)return[2,{}];if("string"==typeof t)try{return[2,JSON.parse(t)]}catch(e){return[2,{message:t}]}return[2,t]}})})}function na(e){var t,n,r,o,i=this;if(e&&"object"==typeof e&&"number"==typeof e.status&&"function"==typeof e.json)return e;var a=null!=e?e:{},s=null!==(n=null!==(t=a.statusCode)&&void 0!==t?t:a.status)&&void 0!==n?n:0,c=a.data;return{ok:s>=200&&s<300,status:s,statusText:a.statusMessage||a.statusText||a.errMsg||"",headers:null!==(o=null!==(r=a.header)&&void 0!==r?r:a.headers)&&void 0!==o?o:{},json:function(){return Xi(i,void 0,void 0,function(){return Qi(this,function(e){return[2,ta(c)]})})},text:function(){return Xi(i,void 0,void 0,function(){var e;return Qi(this,function(t){switch(t.label){case 0:return[4,c];case 1:return"string"==typeof(e=t.sent())?[2,e]:null==e?[2,""]:[2,JSON.stringify(e)]}})})}}}var ra=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())})},oa=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])}}},ia=new Set(["TOKEN_REFRESHED","SIGNED_IN","INITIAL_SESSION"]),aa=new WeakSet,sa=new WeakMap;function ca(e){var t,n;return ra(this,void 0,Promise,function(){var r;return oa(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,null===(n=null===(t=e.request)||void 0===t?void 0:t.getAccessToken)||void 0===n?void 0:n.call(t)];case 1:return(r=o.sent())?(aa.delete(e),[2,r]):[3,3];case 2:return o.sent(),[3,3];case 3:return function(e){aa.has(e)||(aa.add(e),console.warn("[CloudBase Realtime] 当前没有登录态,无法使用 realtime 能力。\n请确认以下各项:\n 1 - 是否已调用 app.auth() 初始化认证\n 2 - 是否已完成登录(如 auth.signInAnonymously() / auth.signInWithPassword())\n 3 - 登录态是否已过期,需要重新登录"))}(e),[2,null]}})})}function ua(e){return!!e&&"function"==typeof e.onAuthStateChange}var la=new WeakSet,pa=new WeakMap,da=new WeakSet;function ha(e,t){var n;la.has(e)||(la.add(e),t.onAuthStateChange(function(t,r){var o,i=null!==(o=null==r?void 0:r.access_token)&&void 0!==o?o:void 0;if(ia.has(t)&&i&&n!==i)return n=i,void e.setAuth(i).catch(function(t){e.log("error","Error setting auth from auth state change",t)});"SIGNED_OUT"===t&&(n=void 0,e.setAuth().catch(function(t){e.log("error","Error clearing auth from SIGNED_OUT",t)}))}))}function fa(e){var t,n,r,o,i,a,s=this,c=function(e){var t=e.getEndPointWithKey("GATEWAY"),n=t.BASE_URL,r=t.PROTOCOL,o=/^https:?$/i.test(r)?"wss:":"ws:",i=String(n||"").replace(/\/+$/,"");return"".concat(o).concat(i,"/realtime")}(e),u={apikey:(null===(t=e.config)||void 0===t?void 0:t.env)||"cloudbase"},l=function(e){return e&&(a.apiKey=e,u.apikey=e),e},p={params:u,vsn:No,accessToken:function(){return ra(s,void 0,void 0,function(){var t;return oa(this,function(n){switch(n.label){case 0:return t=l,[4,ca(e)];case 1:return[2,t.apply(void 0,[n.sent()])]}})})},connectionMaxAgeMs:27e4,beforeTransportConnect:function(){return ra(s,void 0,void 0,function(){return oa(this,function(e){switch(e.label){case 0:return[4,a.setAuth()];case 1:return e.sent(),[2]}})})}},d=null===(r=null===(n=e.platform)||void 0===n?void 0:n.adapter)||void 0===r?void 0:r.wsClass;d&&(p.transport=d);var h=null===(i=null===(o=e.platform)||void 0===o?void 0:o.adapter)||void 0===i?void 0:i.reqClass;return h&&(p.fetch=function(e,t){var n=this;void 0===t&&(t={});var r=new e(t);return function(e,t){return void 0===t&&(t={}),Xi(n,void 0,void 0,function(){var n;return Qi(this,function(o){switch(o.label){case 0:return[4,r.fetch({url:ea(e),method:t.method||"GET",headers:Zi(t.headers),body:t.body,data:t.body,signal:null!==(n=t.signal)&&void 0!==n?n:void 0,shouldThrowOnError:!1})];case 1:return[2,na(o.sent())]}})})}}(h)),a=new Yi(c,p),function(e,t){var n=function(e){try{if(ua(e.auth))return e.auth;if(ua(e.authInstance))return e.authInstance}catch(e){}return null}(e);if(n)ha(t,n);else{var r=e.auth;if("function"==typeof r){var o=pa.get(e);if(o||(o=new Set,pa.set(e,o)),o.add(t),!da.has(e)){da.add(e);var i=function(t){var n=r.call(null!=this?this:e,t);return ua(n)&&function(e,t){var n=pa.get(e);if(n){for(var r=0,o=n;r<o.length;r++)ha(o[r],t);n.clear(),pa.delete(e)}}(e,n),n};try{Object.defineProperty(e,"auth",{configurable:!0,enumerable:!0,writable:!0,value:i})}catch(t){e.auth=i}}}}}(e,a),a}var ma={name:"realtime-js",entity:{realtime:function(){return function(e){var t=sa.get(e);if(t)return t;var n=fa(e);return sa.set(e,n),n}(this)}}};try{cloudbase.registerComponent(ma)}catch(k){}function va(e){try{e.registerComponent(ma)}catch(e){console.warn(e)}}try{window.registerRealtimeJs=va}catch(e){}const ya=(e=>{var t={};return __webpack_require__.d(t,e),t})({generateHTTPClient:()=>__WEBPACK_EXTERNAL_MODULE__cloudbase_wx_cloud_client_sdk_7708af81__.generateHTTPClient,generateMySQLClient:()=>__WEBPACK_EXTERNAL_MODULE__cloudbase_wx_cloud_client_sdk_7708af81__.generateMySQLClient,generatePGClient:()=>__WEBPACK_EXTERNAL_MODULE__cloudbase_wx_cloud_client_sdk_7708af81__.generatePGClient});var ga=function(){return ga=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},ga.apply(this,arguments)},ba=r.U3.yE,wa="models",_a=new WeakMap;function xa(e){return new Proxy({},{get:function(t,n){var r=e.getEndPointWithKey("GATEWAY"),o=r.BASE_URL,i=r.PROTOCOL,a=ga(ga({},e),{BASE_URL:o,PROTOCOL:i}),s=_a.get(a);return s||(s=function(e){var t=this,n=e.callFunction.bind(e),r=e.request.fetch.bind(e.request),o=e.getEndPointWithKey("GATEWAY"),i=o.BASE_URL,a=o.PROTOCOL,s="".concat(a).concat(i,"/model"),c="".concat(a).concat(i,"/sql"),u=(0,ya.generateHTTPClient)(n,function(e){return n=t,o=void 0,a=function(){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:return[4,r(ga(ga({},e),{headers:ga({"Content-Type":"application/json"},e.headers)}))];case 1:return[4,t.sent().data];case 2:return[2,t.sent()]}})},new((i=void 0)||(i=Promise))(function(e,t){function r(e){try{c(a.next(e))}catch(e){t(e)}}function s(e){try{c(a.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i(function(e){e(n)})).then(r,s)}c((a=a.apply(n,o||[])).next())});var n,o,i,a},s,{sqlBaseUrl:c});return u}(e),_a.set(a,s)),s[n]}})}var Ea="cloudbase_init",Ia=new ba;Ia.on(Ea,function(e){var t=e.data;Object.assign(t,{models:xa(t)})});var Sa={name:wa,namespace:wa,entity:new Proxy({},{get:function(e,t){console.warn("【deprecated】Accessing Cloudbase.prototype.models.".concat(t,"."))}}),injectEvents:{bus:Ia,events:[Ea]}};try{cloudbase.registerComponent(Sa)}catch(e){}function Oa(e){try{e.registerComponent(Sa)}catch(e){console.warn(e)}}try{window.registerModel=Oa}catch(e){}var Ta=__webpack_require__(3408);const Aa=(e=>{var t={};return __webpack_require__.d(t,e),t})({createReadableStreamWrapper:()=>__WEBPACK_EXTERNAL_MODULE__mattiasbuelens_web_streams_adapter_7d231298__.createReadableStreamWrapper});var Pa=[239,187,191];const Ca=(e=>{var t={};return __webpack_require__.d(t,e),t})({TextDecoder:()=>__WEBPACK_EXTERNAL_MODULE_text_encoding_shim_6f8fb6d2__.TextDecoder});var Ra=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())})},ka=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])}}},Na="function"==typeof globalThis.ReadableStream&&"function"==typeof globalThis.TransformStream&&"function"==typeof globalThis.ReadableStream.prototype.pipeThrough,ja=Na?globalThis.ReadableStream:Ta.ReadableStream,La=Na?globalThis.TransformStream:Ta.TransformStream,Ua=function(){var e;return new La({start:function(t){e=function(e){var t,n,r,o,i,a,s;return c(),{feed:function(e){n=n?n+e:e,t&&function(e){return Pa.every(function(t,n){return e.charCodeAt(n)===t})}(n)&&(n=n.slice(Pa.length)),t=!1;for(var i=n.length,a=0,s=!1;a<i;){s&&("\n"===n[a]&&(a+=1),s=!1);for(var c=-1,l=o,p=void 0,d=r;c<0&&d<i;d++)":"===(p=n[d])&&l<0?l=d-a:"\r"===p?(s=!0,c=d-a):"\n"===p&&(c=d-a);if(c<0){r=i-a,o=l;break}r=0,o=-1,u(n,a,l,c),a+=c+1}a===i?n="":a>0&&(n=n.slice(a))},reset:c};function c(){t=!0,n="",r=0,o=-1,i=void 0,a=void 0,s=""}function u(t,n,r,o){if(0===o)return s.length>0&&(e({type:"event",id:i,event:a||void 0,data:s.slice(0,-1)}),s="",i=void 0),void(a=void 0);var c,u=r<0,l=t.slice(n,n+(u?o:r)),p=n+(c=u?o:" "===t[n+r+1]?r+2:r+1),d=o-c,h=t.slice(p,p+d).toString();if("data"===l)s+=h?"".concat(h,"\n"):"\n";else if("event"===l)a=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 i=h}}(function(e){"event"===e.type&&t.enqueue(e)})},transform:function(t){e.feed(t)}})},Da=Na?function(e){return e}:(0,Aa.createReadableStreamWrapper)(ja),qa=function(){function e(e,t){void 0===e&&(e="utf-8"),void 0===t&&(t={});var n=this;this.transform=new La({transform:function(e,t){var r=n.handle.decode(new Uint8Array(e),{stream:!0});r&&t.enqueue(r)},flush:function(e){var t=n.handle.decode();t&&e.enqueue(t),e.terminate()}}),this.handle=new Ca.TextDecoder(e,t)}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 Ma(e){var t=e;return t[Symbol.asyncIterator]=function(){var t=e.getReader();return{next:function(){return Ra(this,void 0,Promise,function(){var e,n,r;return ka(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 Ba(e){return Ma(e.pipeThrough(new qa).pipeThrough(Ua()).pipeThrough(new La({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()}}})))}function Fa(e){var t,n,r,o;return Ra(this,void 0,void 0,function(){var i,a,s,c,u,l;return ka(this,function(p){switch(p.label){case 0:i=function(e){return Ma(Da(e).pipeThrough(new qa))}(e),a="",p.label=1;case 1:p.trys.push([1,6,7,12]),s=!0,c=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)})}}}(i),p.label=2;case 2:return[4,c.next()];case 3:if(u=p.sent(),t=u.done)return[3,5];o=u.value,s=!1;try{a+=o}finally{s=!0}p.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return l=p.sent(),n={error:l},[3,12];case 7:return p.trys.push([7,,10,11]),s||t||!(r=c.return)?[3,9]:[4,r.call(c)];case 8:p.sent(),p.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(a)]}})})}function Wa(){var e,t;return{promise:new Promise(function(n,r){e=n,t=r}),res:e,rej:t}}function Ga(e){var t;return"assistant"===e.role&&"tool_calls"in e&&null!=(null===(t=e.tool_calls)||void 0===t?void 0:t[0])}var Va=function(){return Va=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},Va.apply(this,arguments)},Ha=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())})},za=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])}}},Ka=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},Ja=function(){function e(e,t){this.baseUrl=t;var n=arguments[2];this.req="string"==typeof n?function(t){var r=t.headers,o=void 0===r?{}:r,i=Ka(t,["headers"]);return e(Va(Va({},i),{headers:Va(Va({},o),{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 Ha(this,void 0,void 0,function(){return za(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=Ka(e,["botId"]);return Ha(this,void 0,void 0,function(){return za(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,r=void 0===n?10:n,o=e.pageNumber,i=void 0===o?1:o,a=e.botId,s=Ka(e,["pageSize","pageNumber","botId"]);return Ha(this,void 0,void 0,function(){var e,n;return za(this,function(o){if(i<1)throw new Error("pageNumber must be greater than 0");return e=r*(i-1),n=r,[2,this.req({method:"get",url:this.join("bots/".concat(a,"/conversation")),data:Va(Va({},s),{offset:e,limit:n}),timeout:null==t?void 0:t.timeout})]})})},e.prototype.deleteConversation=function(e,t){var n=e.botId,r=e.conversationId,o=Ka(e,["botId","conversationId"]);return Ha(this,void 0,void 0,function(){return za(this,function(e){return[2,this.req({method:"delete",url:this.join("bots/".concat(n,"/conversation/").concat(r)),data:o,timeout:null==t?void 0:t.timeout})]})})},e.prototype.speechToText=function(e,t){return Ha(this,void 0,void 0,function(){return za(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 Ha(this,void 0,void 0,function(){return za(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 Ha(this,void 0,void 0,function(){return za(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 Ha(this,void 0,void 0,function(){var n;return za(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 $a(n)]}})})},e.prototype.generateBot=function(e,t){return Ha(this,void 0,void 0,function(){var n;return za(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 $a(n)]}})})},e.prototype.getPreview=function(e,t){return Ha(this,void 0,void 0,function(){var n;return za(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 $a(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 Ha(this,void 0,void 0,function(){var n;return za(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 $a(n)]}})})},e.prototype.join=function(e){return"".concat(this.baseUrl,"/").concat(e)},e}(),$a=function(){function e(e){var t=Da(e);this._eventSourceStream=t.pipeThrough(new qa).pipeThrough(Ua())}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 Ma(this.teeedStream)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataStream",{get:function(){return Ma(this.eventSourceStream.pipeThrough(new La({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 Ma(this.dataStream.pipeThrough(new La({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}(),Ya=function(){return Ya=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},Ya.apply(this,arguments)},Xa=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())})},Qa=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 Za(e){var t=e.messages,n=e.model,r=e.temperature,o=e.tool_choice,i=e.tools,a=e.top_p;return Ya(Ya({},e),{messages:t,model:n,temperature:r,tool_choice:(o&&"auto"!==o&&console.warn("`tool_choice` is not 'auto'"),o),tools:i,top_p:a})}var es=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 Xa(this,void 0,Promise,function(){var n,r;return Qa(this,function(o){switch(o.label){case 0:return n=Za(e),[4,this.req({url:this.url,data:Ya(Ya({},n),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return r=o.sent(),[2,Ya(Ya({},r),{rawResponse:r})]}})})},e.prototype.doStream=function(e,t){return Xa(this,void 0,Promise,function(){var n,r,o,i;return Qa(this,function(a){switch(a.label){case 0:return n=Za(e),r=null,[4,this.req({url:this.url,data:Ya(Ya({},n),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return o=a.sent(),i=Da(o),[2,Ma(Ba(i).pipeThrough(new La({transform:function(e,t){var n=e.choices.map(function(e){var t=e.delta;return null==r&&(r=Ga(t)),r?Ya(Ya({},e),{finish_reason:"tool_calls",delta:t}):e}),o=Ya(Ya({},e),{choices:n});t.enqueue(Ya(Ya({},o),{rawResponse:e}))}})))]}})})},e}(),ts=function(){return ts=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},ts.apply(this,arguments)};function ns(e){var t=e.messages,n=e.model,r=e.temperature,o=e.tool_choice,i=e.tools,a=e.top_p;return ts(ts({},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:n,tools:function(){if(i)return i.forEach(function(e){"function"!==e.type&&console.warn("`type` in tool is not 'function'",e)}),i}(),top_p:a,tool_choice:o,temperature:r})}function rs(e){return"object"!=typeof e||null==e?e:Array.isArray(e)?e.map(function(e){return rs(e)}):Object.entries(e).reduce(function(e,t){var n,r=t[0],o=t[1];return e["_"===(n=r.replace(/[A-Z]/g,function(e){return"_".concat(e.toLowerCase())})).charAt(0)?n.slice(1):n]="object"==typeof o?rs(o):o,e},{})}var os=function(){return os=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},os.apply(this,arguments)},is=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())})},as=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])}}},ss=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 is(this,void 0,Promise,function(){var n;return as(this,function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:os(os({},ns(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,os(os({},n),{rawResponse:n})]}})})},e.prototype.doStream=function(e,t){return is(this,void 0,Promise,function(){var n,r,o;return as(this,function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:os(os({},ns(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=Da(r),[2,Ma(Ba(o).pipeThrough(new La({transform:function(e,t){var r=e.choices.map(function(e){var t=e.delta;return null==n&&(n=Ga(t)),n?os(os({},e),{finish_reason:"tool_calls",delta:t}):e}),o=os(os({},e),{choices:r});t.enqueue(os(os({},o),{rawResponse:e}))}})))]}})})},e}(),cs=function(){return cs=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},cs.apply(this,arguments)},us=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())})},ls=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])}}},ps=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 us(this,void 0,Promise,function(){var n,r;return ls(this,function(o){switch(o.label){case 0:return[4,this.req({url:this.url,headers:{"X-Tc-Action":"ChatCompletions"},data:cs(cs({},ns(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=o.sent(),r=rs(n.Response),[2,cs(cs({},r),{rawResponse:n})]}})})},e.prototype.doStream=function(e,t){return us(this,void 0,Promise,function(){var n,r,o;return ls(this,function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,headers:{"X-Tc-Action":"ChatCompletions"},data:cs(cs({},e),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=Da(r),[2,Ma(Ba(o).pipeThrough(new La({transform:function(e,t){var r=rs(e),o=r.choices.map(function(e){var t=e.delta;return null==n&&(n=Ga(t)),n?cs(cs({},e),{finish_reason:"tool_calls",delta:t}):e}),i=cs(cs({},r),{choices:o});t.enqueue(cs(cs({},i),{rawResponse:e}))}})))]}})})},e}(),ds=function(){return ds=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},ds.apply(this,arguments)},hs=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())})},fs=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 ms(e){var t=e.messages,n=e.model,r=e.temperature,o=e.tools,i=e.top_p;return ds(ds({},e),{messages:t,model:n,tools:o,top_p:i,temperature:r})}var vs=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 hs(this,void 0,Promise,function(){var n;return fs(this,function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:ds(ds({},ms(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,ds(ds({},n),{rawResponse:n})]}})})},e.prototype.doStream=function(e,t){return hs(this,void 0,Promise,function(){var n,r,o;return fs(this,function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:ds(ds({},ms(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=Da(r),[2,Ma(Ba(o).pipeThrough(new La({transform:function(e,t){var r=e.choices.map(function(e){var t=e.delta;return null==n&&(n=Ga(t)),n?ds(ds({},e),{finish_reason:"tool_calls",delta:t}):e}),o=ds(ds({},e),{choices:r});t.enqueue(ds(ds({},o),{rawResponse:e}))}})))]}})})},e}(),ys=function(){return ys=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},ys.apply(this,arguments)},gs=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())})},bs=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 ws(e){var t=e.messages,n=e.model,r=e.temperature,o=e.tools,i=e.top_p;return ys(ys({},e),{messages:t,model:n,tools:o,top_p:i,temperature:r})}var _s=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 gs(this,void 0,Promise,function(){var n;return bs(this,function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:ys(ys({},ws(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,ys(ys({},n),{rawResponse:n})]}})})},e.prototype.doStream=function(e,t){return gs(this,void 0,Promise,function(){var n,r,o;return bs(this,function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:ys(ys({},ws(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=Da(r),[2,Ma(Ba(o).pipeThrough(new La({transform:function(e,t){var r=e.choices.map(function(e){var t=Object.assign(e.delta,{role:"assistant"});return null==n&&(n=Ga(t)),ys(ys({},e),n?{finish_reason:"tool_calls",delta:t}:{delta:t})}),o=ys(ys({},e),{choices:r});t.enqueue(ys(ys({},o),{rawResponse:e}))}})))]}})})},e}(),xs=function(){return xs=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},xs.apply(this,arguments)},Es=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())})},Is=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 Ss(e){var t=e.messages,n=e.model,r=e.temperature,o=e.tools,i=e.top_p;return xs(xs({},e),{messages:t,model:n,tools:o,top_p:i,temperature:r})}var Os=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 Es(this,void 0,Promise,function(){var n;return Is(this,function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:xs(xs({},Ss(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,xs(xs({},n),{rawResponse:n})]}})})},e.prototype.doStream=function(e,t){return Es(this,void 0,Promise,function(){var n,r,o,i,a;return Is(this,function(s){switch(s.label){case 0:return n=null,[4,this.req({url:this.url,data:xs(xs({},Ss(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=s.sent(),o=Da(r),i=Ba(o),a=i.pipeThrough(new La({transform:function(e,t){var r,o,i,a,s,c;if((null===(i=null===(o=null===(r=null==e?void 0:e.choices)||void 0===r?void 0:r[0])||void 0===o?void 0:o.delta)||void 0===i?void 0:i.content)||(null===(c=null===(s=null===(a=null==e?void 0:e.choices)||void 0===a?void 0:a[0])||void 0===s?void 0:s.delta)||void 0===c?void 0:c.tool_calls)){var u=e.choices.map(function(e){var t=Object.assign(e.delta,{role:"assistant"});return null==n&&(n=Ga(t)),xs(xs({},e),n?{finish_reason:"tool_calls",delta:t}:{delta:t})}),l=xs(xs({},e),{choices:u});t.enqueue(xs(xs({},l),{rawResponse:e}))}}})),[2,Ma(a)]}})})},e}(),Ts=function(){return Ts=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},Ts.apply(this,arguments)},As=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())})},Ps=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 Cs(e){var t=e.messages,n=e.model,r=e.temperature,o=e.tools,i=e.top_p;return Ts(Ts({},e),{messages:t,model:n,tools:o,top_p:i,temperature:r})}var Rs=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 As(this,void 0,Promise,function(){var n;return Ps(this,function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:Ts(Ts({},Cs(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,Ts(Ts({},n),{rawResponse:n})]}})})},e.prototype.doStream=function(e,t){return As(this,void 0,Promise,function(){var n,r,o;return Ps(this,function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:Ts(Ts({},Cs(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=Da(r),[2,Ma(Ba(o).pipeThrough(new La({transform:function(e,t){var r=e.choices.map(function(e){var t=e.delta;return null==n&&(n=Ga(t)),n?Ts(Ts({},e),{finish_reason:"tool_calls",delta:t}):e}),o=Ts(Ts({},e),{choices:r});t.enqueue(Ts(Ts({},o),{rawResponse:e}))}})))]}})})},e}(),ks=function(){return ks=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},ks.apply(this,arguments)},Ns=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())})},js=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])}}},Ls=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 Ns(this,void 0,Promise,function(){var t;return js(this,function(n){switch(n.label){case 0:return[4,this.req({url:this.url,data:ks(ks({},ns(e)),{stream:!1}),stream:!1})];case 1:return t=n.sent(),[2,ks(ks({},t),{rawResponse:t})]}})})},e.prototype.doStream=function(e){return Ns(this,void 0,Promise,function(){var t,n,r;return js(this,function(o){switch(o.label){case 0:return t=null,[4,this.req({url:this.url,data:ks(ks({},ns(e)),{stream:!0}),stream:!0})];case 1:return n=o.sent(),r=Da(n),[2,Ma(Ba(r).pipeThrough(new La({transform:function(e,n){var r=e.choices.map(function(e){var n=e.delta;return null==t&&(t=Ga(n)),t?ks(ks({},e),{finish_reason:"tool_calls",delta:n}):e}),o=ks(ks({},e),{choices:r});n.enqueue(ks(ks({},o),{rawResponse:e}))}})))]}})})},e}(),Us=function(){return Us=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},Us.apply(this,arguments)},Ds=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())})},qs=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])}}},Ms=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 Ds(this,void 0,Promise,function(){var n;return qs(this,function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:Us(Us({},ns(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,Us(Us({},n),{rawResponse:n})]}})})},e.prototype.doStream=function(e,t){return Ds(this,void 0,Promise,function(){var n,r,o;return qs(this,function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:Us(Us({},ns(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=Da(r),[2,Ma(Ba(o).pipeThrough(new La({transform:function(e,t){var r=e.choices.map(function(e){var t=e.delta;return null==n&&(n=Ga(t)),n?Us(Us({},e),{finish_reason:"tool_calls",delta:t}):e}),o=Us(Us({},e),{choices:r});t.enqueue(Us(Us({},o),{rawResponse:e}))}})))]}})})},e}(),Bs=function(){return Bs=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},Bs.apply(this,arguments)},Fs=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())})},Ws=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])}}},Gs=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 Fs(this,void 0,Promise,function(){var n;return Ws(this,function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:Bs(Bs({},e),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,Bs(Bs({},n),{rawResponse:n})]}})})},e.prototype.doStream=function(e,t){return Fs(this,void 0,Promise,function(){var n,r,o;return Ws(this,function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:Bs(Bs({},e),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=Da(r),[2,Ma(Ba(o).pipeThrough(new La({transform:function(e,t){var r=e.choices.map(function(e){var t=e.delta;return null==n&&(n=Ga(t)),n?Bs(Bs({},e),{finish_reason:"tool_calls",delta:t}):e}),o=Bs(Bs({},e),{choices:r});t.enqueue(Bs(Bs({},o),{rawResponse:e}))}})))]}})})},e}(),Vs=function(){return Vs=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},Vs.apply(this,arguments)},Hs=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())})},zs=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])}}},Ks=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 Hs(this,void 0,Promise,function(){var t;return zs(this,function(n){switch(n.label){case 0:return[4,this.req({url:this.url,data:Vs(Vs({},e),{stream:!1}),stream:!1})];case 1:return t=n.sent(),[2,Vs(Vs({},t),{rawResponse:t})]}})})},e.prototype.doStream=function(e){return Hs(this,void 0,Promise,function(){var t,n,r;return zs(this,function(o){switch(o.label){case 0:return t=null,[4,this.req({url:this.url,data:Vs(Vs({},e),{stream:!0}),stream:!0})];case 1:return n=o.sent(),r=Da(n),[2,Ma(Ba(r).pipeThrough(new La({transform:function(e,n){var r=e.choices.map(function(e){var n=e.delta;return null==t&&(t=Ga(n)),t?Vs(Vs({},e),{finish_reason:"tool_calls",delta:n}):e}),o=Vs(Vs({},e),{choices:r});n.enqueue(Vs(Vs({},o),{rawResponse:e}))}})))]}})})},e}(),Js=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)}}(),$s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.name="InvalidParamsError",r.code="INVALID_PARAMS",r.field=n,r}return Js(t,e),t.prototype.toJSON=function(){return{code:this.code,message:this.message,field:this.field}},t}(Error),Ys=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 t=this,n=void 0,o=function(){var t,n,r,o,i;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(a){switch(a.label){case 0:if("object"==typeof e&&e&&"model"in e&&"HY-Image-v3.0-I2I-ToB-v1.0.1"===e.model&&(""===this.provider||"hunyuan-image"===this.provider)){if(n=(t=e).image_urls,r=t.images,n&&n.length>1)throw new $s("当模型为 HY-Image-v3.0-I2I-ToB-v1.0.1 时,image_urls 最多只能有 1 个元素","image_urls");if(r&&r.length>1)throw new $s("当模型为 HY-Image-v3.0-I2I-ToB-v1.0.1 时,images 最多只能有 1 个元素","images")}return o=this.defaultGenerateImageSubUrl,"object"==typeof e&&e&&"model"in e&&"string"==typeof e.model&&(i=this.getGenerateImageSubUrl(this.provider,e.model))&&(o=i),[4,this.req({url:this.getGenerateUrl(o),data:e,stream:!1})];case 1:return[2,a.sent()]}})},new((r=Promise)||(r=Promise))(function(e,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r(function(e){e(n)})).then(a,s)}c((o=o.apply(t,n||[])).next())});var t,n,r,o},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}(),Xs=function(){return Xs=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},Xs.apply(this,arguments)},Qs=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())})},Zs=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])}}},ec=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 tc(e){var t,n=e.onStepFinish,r=e.abortSignal,o=e.maxSteps,i=e.topP,a=e.toolChoice,s=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}(e,["onStepFinish","abortSignal","maxSteps","topP","toolChoice"]);if(null!=o&&o<1)throw new Error("`maxSteps` muse be greater than 0.");return[{onStepFinish:n,abortSignal:r,maxSteps:o},Xs(Xs({},s),{tools:null===(t=s.tools)||void 0===t?void 0:t.map(function(e){return"fn"in e?function(e){return{type:"function",function:{description:e.description,name:e.name,parameters:e.parameters}}}(e):e}),top_p:null!=i?i:s.top_p,tool_choice:null!=a?a:s.tool_choice})]}var nc=function(){function e(e){this.model=e}return e.prototype.generateText=function(e,t){var n,r;return Qs(this,void 0,Promise,function(){var o,i,a,s,c,u,l,p,d,h,f,m,v,y,g,b,w,_,x,E,I,S=this;return Zs(this,function(O){switch(O.label){case 0:return o=[],i={completion_tokens:0,prompt_tokens:0,total_tokens:0},a=tc(e),s=a[0],c=s.onStepFinish,u=s.maxSteps,l=void 0===u?10:u,p=a[1],[4,(d=function(){return S.model.doGenerate(p,t)})()];case 1:h=O.sent(),f=1,h.rawResponse&&o.push(h.rawResponse),m=null,O.label=2;case 2:if(!(f<l&&null!=(m=rc(h))))return[3,9];v=sc(h.usage),cc(i,v),O.label=3;case 3:return O.trys.push([3,7,,8]),[4,ac(m)];case 4:return y=O.sent(),g=h.choices[0],[4,null==c?void 0:c({finishReason:g.finish_reason,messages:p.messages.slice(),text:g.message.content,toolCall:m,toolResult:y,stepUsage:v,totalUsage:Object.assign({},i)})];case 5:return O.sent(),oc(p.messages,g.message,y),[4,d()];case 6:return(h=O.sent()).rawResponse&&o.push(h.rawResponse),f+=1,[3,8];case 7:return b=O.sent(),[2,{text:"",messages:p.messages,usage:i,error:b,rawResponses:o}];case 8:return[3,2];case 9:return w=null===(n=null==h?void 0:h.choices)||void 0===n?void 0:n[0],_=null==w?void 0:w.message,x=null!==(r=null==_?void 0:_.content)&&void 0!==r?r:"",E=_?ec(ec([],p.messages,!0),[_],!1):p.messages,I=sc(h.usage),cc(i,I),[4,null==c?void 0:c({finishReason:w.finish_reason,messages:E.slice(),text:x,toolCall:rc(h),toolResult:null,stepUsage:I,totalUsage:Object.assign({},i)})];case 10:return O.sent(),[2,{text:x,messages:E,usage:i,rawResponses:o}]}})})},e.prototype.streamText=function(e,t){var n;return Qs(this,void 0,Promise,function(){var r,o,i,a,s,c,u,l,p,d,h,f,m,v,y,g,b,w,_,x,E,I,S,O,T,A,P,C,R,k,N,j,L,U,D,q,M=this;return Zs(this,function(B){switch(B.label){case 0:return r={completion_tokens:0,prompt_tokens:0,total_tokens:0},o=tc(e),i=o[0],a=i.onStepFinish,s=i.maxSteps,c=void 0===s?10:s,u=o[1],[4,(l=function(){return M.model.doStream(u,t)})()];case 1:p=B.sent(),d=1,h=null,f=function(){var e=p.tee(),t=e[0],n=e[1];return p=Ma(t),function(e){var t,n,r,o,i,a,s,c,u,l;return Qs(this,void 0,Promise,function(){var p,d,h,f,m,v,y,g,b,w,_,x,E;return Zs(this,function(I){switch(I.label){case 0:p={completion_tokens:0,prompt_tokens:0,total_tokens:0},d=Ma(e),f={role:"assistant",content:"",tool_calls:[h={id:"",function:{name:"",arguments:""},type:""}]},I.label=1;case 1:I.trys.push([1,6,7,12]),m=!0,v=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)})}}}(d),I.label=2;case 2:return[4,v.next()];case 3:if(y=I.sent(),t=y.done)return[3,5];o=y.value,m=!1;try{if(!(b=null==(g=o)?void 0:g.choices[0]))return[2,null];if(w=b.finish_reason,_=b.delta,"tool_calls"!==w)return[2,null];if(!_)return[3,4];if(_.content&&(f.content+=_.content),!("tool_calls"in _))return[3,4];(null==(x=null===(i=null==_?void 0:_.tool_calls)||void 0===i?void 0:i[0])?void 0:x.id)&&(h.id=x.id),(null==x?void 0:x.type)&&(h.type=x.type),(null===(a=null==x?void 0:x.function)||void 0===a?void 0:a.name)&&(h.function.name=x.function.name),(null===(s=null==x?void 0:x.function)||void 0===s?void 0:s.arguments)&&(h.function.arguments+=x.function.arguments),(null===(c=null==g?void 0:g.usage)||void 0===c?void 0:c.completion_tokens)&&(p.completion_tokens=g.usage.completion_tokens),(null===(u=null==g?void 0:g.usage)||void 0===u?void 0:u.prompt_tokens)&&(p.prompt_tokens=g.usage.prompt_tokens),(null===(l=null==g?void 0:g.usage)||void 0===l?void 0:l.total_tokens)&&(p.total_tokens=g.usage.total_tokens)}finally{m=!0}I.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return E=I.sent(),n={error:E},[3,12];case 7:return I.trys.push([7,,10,11]),m||t||!(r=v.return)?[3,9]:[4,r.call(v)];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:f,usage:p}]}})})}(n)},B.label=2;case 2:return(m=d<c)?[4,f()]:[3,4];case 3:m=null!=(h=B.sent()),B.label=4;case 4:if(!m)return[3,11];v=h.message,y=h.usage,cc(r,y),g=null===(n=v.tool_calls)||void 0===n?void 0:n[0],B.label=5;case 5:return B.trys.push([5,9,,10]),[4,ac(g)];case 6:return b=B.sent(),[4,null==a?void 0:a({finishReason:"tool_calls",messages:u.messages.slice(),text:v.content,toolCall:g,toolResult:b,stepUsage:y,totalUsage:Object.assign({},r)})];case 7:return B.sent(),oc(u.messages,v,b),[4,l()];case 8:return p=B.sent(),[3,10];case 9:return w=B.sent(),_=p.tee(),x=_[0],E=_[1],[2,{messages:Promise.resolve(u.messages),dataStream:Ma(x),textStream:Ma(E.pipeThrough(new La({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:w}];case 10:return[3,2];case 11:return[4,f()];case 12:return(h=B.sent())?(I=h.message,S=h.usage,cc(r,S),O=ec(ec([],u.messages,!0),[I],!1),a({messages:O.slice(),finishReason:"tool_call",stepUsage:S,text:I.content,toolCall:I.tool_calls[0],totalUsage:Object.assign({},r)}),T=p.tee(),A=T[0],P=T[1],[2,{messages:Promise.resolve(ec(ec([],u.messages,!0),[I],!1)),dataStream:Ma(A),textStream:Ma(P.pipeThrough(new La({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)}]):(C=Wa(),R=Wa(),k={role:"assistant",content:""},N="",j={completion_tokens:0,prompt_tokens:0,total_tokens:0},L=p.pipeThrough(new La({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&&(k.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&&(N=p),(null===(s=null==e?void 0:e.usage)||void 0===s?void 0:s.completion_tokens)&&(j.completion_tokens=e.usage.completion_tokens),(null===(c=null==e?void 0:e.usage)||void 0===c?void 0:c.prompt_tokens)&&(j.prompt_tokens=e.usage.prompt_tokens),(null===(u=null==e?void 0:e.usage)||void 0===u?void 0:u.total_tokens)&&(j.total_tokens=e.usage.total_tokens),t.enqueue(e)},flush:function(){C.res(ec(ec([],u.messages,!0),[k],!1)),cc(r,j),R.res(Object.assign({},r)),null==a||a({messages:ec(ec([],u.messages,!0),[k],!1),finishReason:N,text:k.content,stepUsage:j,totalUsage:Object.assign({},r)})}})),U=L.tee(),D=U[0],q=U[1],[2,{messages:C.promise,dataStream:Ma(D),textStream:Ma(q.pipeThrough(new La({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:R.promise}])}})})},e}();function rc(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&&Ga(o)?o.tool_calls[0]:null}function oc(e,t,n){e.push(t,{role:"tool",tool_call_id:t.tool_calls[0].id,content:JSON.stringify(n)})}var ic=new Map;function ac(e){return ic.get(e.function.name)(JSON.parse(e.function.arguments))}function sc(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 cc(e,t){e.completion_tokens+=t.completion_tokens,e.prompt_tokens+=t.prompt_tokens,e.total_tokens+=t.total_tokens}var uc={hunyuan:ps,"hunyuan-beta":ss,ark:vs,dashscope:_s,"01-ai":Os,moonshot:Rs,zhipu:es,"hunyuan-exp":Ls,"hunyuan-open":Ms,deepseek:Gs},lc=function(){return lc=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},lc.apply(this,arguments)},pc=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())})},dc=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])}}},hc=uc,fc=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,r=e.headers,o=e.stream,a=e.timeout;return pc(i,void 0,void 0,function(){var e,i,s,c,u,l,p;return dc(this,function(d){switch(d.label){case 0:return e={"Content-Type":"application/json"},o&&Object.assign(e,{Accept:"text/event-stream"}),[4,this.req.fetch({method:"post",headers:lc(lc((u={},u[null===(l=this.i18n)||void 0===l?void 0:l.LANG_HEADER_KEY]=null===(p=this.i18n)||void 0===p?void 0:p.lang,u),e),r),body:JSON.stringify(n),url:this.resolveUrl(t),stream:o,timeout:a})];case 1:return i=d.sent(),s=i.data,c=i.header,[2,this.handleResponseData(s,c)]}})})},this.botRequest=function(e){var t=e.method,n=e.url,r=e.data,o=void 0===r?{}:r,a=e.headers,s=e.stream,c=e.timeout;return pc(i,void 0,void 0,function(){var e,r,i,u,l,p,d,h,f;return dc(this,function(m){switch(m.label){case 0:return e=this.resolveUrl(n),"get"!==t?[3,2]:(r=this.handleResponseData,[4,this.req.fetch({url:"".concat(e,"?").concat((v=o,Object.entries(v).map(function(e){var t=e[0],n=e[1];return"".concat(t,"=").concat(n)}).join("&"))),method:t,headers:a,stream:s,timeout:c})]);case 1:return[2,r.apply(this,[m.sent().data])];case 2:return i={"Content-Type":"application/json"},s&&Object.assign(i,{Accept:"text/event-stream"}),[4,this.req.fetch({url:e,body:JSON.stringify(o),headers:lc(lc((d={},d[null===(h=this.i18n)||void 0===h?void 0:h.LANG_HEADER_KEY]=null===(f=this.i18n)||void 0===f?void 0:f.lang,d),i),a),stream:s,method:t,timeout:c})];case 3:return u=m.sent(),l=u.data,p=u.header,[2,this.handleResponseData(l,p)]}var v})})},this._getBaseUrl=o,this.bot=new Ja(this.botRequest,this.aiBotBaseUrl),this.i18n=n,r.RR.$.on(r.RR.P,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 pc(this,void 0,void 0,function(){var o,i,a,s,c=this;return dc(this,function(u){switch(u.label){case 0:return o="".concat(this.i18n.t("请检查调用方式,或前往云开发 AI+ 首页查看文档"),":https://tcb.cloud.tencent.com/dev#/ai"),i=function(e){if("object"==typeof e&&e&&"code"in e&&"NORMAL"!==e.code)throw new Error("".concat(c.i18n.t("AI+ 请求出错,错误码"),":").concat(e.code,",").concat(c.i18n.t("错误信息"),":").concat(e.message,"\n").concat(o,"\n").concat(JSON.stringify(e,null,2)))},"object"==typeof e&&e&&"function"!=typeof e.getReader?"then"in e?[4,e]:[3,2]:[3,4];case 1:return a=u.sent(),[3,3];case 2:a=e,u.label=3;case 3:return i(s=a),[2,e];case 4:if("function"!=typeof(null==e?void 0:e.getReader)){if("object"==typeof(s=e)&&s&&"code"in s&&"NORMAL"!==s.code)throw new Error("".concat(this.i18n.t("AI+ 请求出错,错误码"),":").concat(s.code,",").concat(this.i18n.t("错误信息"),":").concat(s.message,"\n").concat(o,"\n").concat(JSON.stringify(s,null,2)));return[2,e]}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,Fa(e)]:[3,6];case 5:s=u.sent(),i(s),u.label=6;case 6:return[2,e]}})})},e.prototype.createModel=function(e,t){var n,r=hc[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 Ks(this.modelRequest,this.aiBaseUrl,"".concat(e).concat(o))}return new nc(n)},e.prototype.registerModel=function(e,t){null==hc[e]?hc[e]=t:console.warn("AI model ".concat(e," already exists!"))},e.prototype.createImageModel=function(e){return new Ys(this.modelRequest,this.aiBaseUrl,e)},e.prototype.registerFunctionTool=function(e){ic.has(e.name)&&console.warn("AI function tool ".concat(e.name," already exists and will be overwritten!")),ic.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}(),mc=function(){return mc=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},mc.apply(this,arguments)},vc=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};function yc(e){var t=e.env,n=e.baseUrl,r=e.getBaseUrl,o=e.req,i=e.getAccessToken,a=e.handleReqInstance,s=e.i18n;return new fc(function(){if(null==a){if(null==i)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 r=void 0,o=void 0,a=function(){var r,o,i,a,s;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(c){switch(c.label){case 0:if("function"!=typeof n.fetch)throw new Error("req.fetch is not a function");return r=e.token,o=e.headers,i=void 0===o?{}:o,a=vc(e,["token","headers"]),null==r?[3,1]:(s=r,[3,3]);case 1:return[4,t()];case 2:s=c.sent().accessToken,c.label=3;case 3:return[2,n.fetch(mc({headers:mc({Authorization:"Bearer ".concat(s)},i)},a))]}})},new((i=void 0)||(i=Promise))(function(e,t){function n(e){try{c(a.next(e))}catch(e){t(e)}}function s(e){try{c(a.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i(function(e){e(r)})).then(n,s)}c((a=a.apply(r,o||[])).next())});var r,o,i,a}}}({req:o,getAccessToken:i})}return a({req:o})}(),function(){if(null!=r)return r();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")}(),s,r)}vc(t,["MODELS"]);var gc={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)?yc({req:n,baseUrl:e.baseUrl,handleReqInstance:function(e){return e.req},i18n:this.config.i18n}):yc({req:n,baseUrl:r(),getBaseUrl:r,handleReqInstance:function(e){return e.req},i18n:this.config.i18n})}}};function bc(e){try{e.registerComponent(gc)}catch(e){console.warn(e)}}try{window.registerAi=bc}catch(e){}var wc=function(){return wc=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},wc.apply(this,arguments)};function _c(e){if(!e)return{get:function(){return null},forEach:function(){}};if("function"==typeof e.get)return e;var t={};return Object.keys(e).forEach(function(n){t[n.toLowerCase()]=e[n]}),{get:function(e){var n;return null!==(n=t[e.toLowerCase()])&&void 0!==n?n:null},forEach:function(e){Object.entries(t).forEach(function(t){var n=t[0],r=t[1];return e(r,n)})}}}function xc(e,t,n){var r=this,o=e.request.fetch.bind(e.request),i=t||{},a=i.instance,s=void 0===a?n?void 0:"default":a,c=i.database,u=void 0===c?n?void 0:e.config.env:c,l=e.getEndPointWithKey("GATEWAY"),p=l.BASE_URL,d=l.PROTOCOL,h="".concat(d).concat(p),f=function(t,n){return i=r,a=void 0,l=function(){var r,i,a,c,l,p,d,f,m,v;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(y){switch(y.label){case 0:return r={},n.headers instanceof Headers?n.headers.forEach(function(e,t){r[t]=e}):n.headers&&Object.assign(r,n.headers),[["X-Db-Instance",s],["Accept-Profile",u],["Content-Profile",u]].forEach(function(e){var t=e[0],n=e[1];r[t]||r[t.toLocaleLowerCase()]||!n||(r[t]=n)}),i=t.toString(),a=e.getEndPointWithKey("GATEWAY"),c=a.BASE_URL,l=a.PROTOCOL,(p="".concat(l).concat(c))!==h&&i.startsWith(h)&&(i=i.replace(h,p)),[4,o(wc(wc({url:i},n),{headers:wc({"Content-Type":"application/json"},r),shouldThrowOnError:!1}))];case 1:d=y.sent(),f={},y.label=2;case 2:return y.trys.push([2,4,,5]),[4,d.data];case 3:return f=y.sent(),[3,5];case 4:if(m=y.sent(),!(null===(v=null==m?void 0:m.message)||void 0===v?void 0:v.includes("Unexpected end of JSON input")))throw m;return[3,5];case 5:return[2,{ok:(null==d?void 0:d.statusCode)>=200&&(null==d?void 0:d.statusCode)<300,status:(null==d?void 0:d.statusCode)||200,statusText:(null==d?void 0:d.statusMessage)||"OK",json:function(){return Promise.resolve(f||{})},text:function(){return Promise.resolve("string"==typeof f?f:JSON.stringify(f||{}))},headers:_c(null==d?void 0:d.header)}]}})},new((c=void 0)||(c=Promise))(function(e,t){function n(e){try{o(l.next(e))}catch(e){t(e)}}function r(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){var o;t.done?e(t.value):(o=t.value,o instanceof c?o:new c(function(e){e(o)})).then(n,r)}o((l=l.apply(i,a||[])).next())});var i,a,c,l},m="".concat(d).concat(p,"/rdb/rest");return n?(0,ya.generatePGClient)(e,{pgBaseUrl:m,fetch:f}):(0,ya.generateMySQLClient)(e,{mysqlBaseUrl:m,fetch:f})}var Ec={name:"mysql",entity:{mysql:function(e){return xc(this,e,!1)(e)}}},Ic={name:"rdb",entity:{rdb:function(e){return xc(this,e,!0)(e)}}};try{cloudbase.registerComponent(Ec),cloudbase.registerComponent(Ic)}catch(e){}function Sc(e){try{e.registerComponent(Ec),e.registerComponent(Ic)}catch(e){console.warn(e)}}try{window.registerMySQL=Sc}catch(e){}var Oc=function(){return Oc=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},Oc.apply(this,arguments)},Tc=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())})},Ac=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 Pc(e,t){var n,r,o,i;return Tc(this,void 0,Promise,function(){var a,s,c,u,l,p,d,h,f,m,v,y,g,b,w,_,x,E,I,S,O,T,A;return Ac(this,function(P){switch(P.label){case 0:s=(a=e||{}).name,c=a.body,u=a.path,l=void 0===u?"":u,p=a.method,d=void 0===p?"POST":p,h=a.headers,f=void 0===h?{}:h,m=(e||{}).token,v={};try{v=JSON.parse(c)}catch(e){v=c||{}}if(!s)throw new Error(JSON.stringify({code:It.ERRORS.INVALID_PARAMS,msg:"[apis] invalid api name"}));return y="",b=(g=this).gatewayOrigin,w=g.getAccessToken,_=g.env,b?y="".concat(b,"/v1"):this.getEndPointWithKey?(x=this.getEndPointWithKey("GATEWAY"),E=x.BASE_URL,I=x.PROTOCOL,y="".concat(I).concat(E)):y="https://".concat(_,".api.tcloudbasegateway.com/v1"),S="".concat(y,"/apis/").concat(s),O=l.startsWith("/")?l:"/".concat(l),w?[4,w()]:[3,2];case 1:T=P.sent().accessToken,f.Authorization="Bearer ".concat(T),P.label=2;case 2:if(A=["GET","HEAD"].includes(null===(n=null==d?void 0:d.toUpperCase)||void 0===n?void 0:n.call(d)))try{O="".concat(O).concat(O.includes("?")?"&":"?").concat(Object.keys(v).map(function(e){return"".concat(e,"=").concat(v[e])}).join("&"))}catch(e){}return[4,this.request.fetch(Oc(Oc(Oc({url:"".concat(S).concat(O),method:d||"POST",headers:Oc({"Content-Type":"application/json; charset=utf-8"},f)},A?{}:{body:JSON.stringify(v)}),{token:(null===(r=null==m?void 0:m.trim)||void 0===r?void 0:r.call(m))||(null===(i=null===(o=f.Authorization)||void 0===o?void 0:o.replace)||void 0===i?void 0:i.call(o,/^Bearer /,""))||null}),t))];case 3:return[4,P.sent().data];case 4:return[2,P.sent()]}})})}var Cc=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH","REQUEST"];function Rc(e){var t=this;return new Proxy({},{get:function(n,r){if("string"!=typeof r)throw new Error("[apis] method must be string");var o=r.toLocaleUpperCase();if(!Cc.includes(o))throw new Error("[apis] invalid method: ".concat(r));return function(n,r){return Tc(t,void 0,void 0,function(){return Ac(this,function(t){switch(t.label){case 0:return[4,Pc.call(this,Oc({name:e,method:("REQUEST"===o?n.method:o)||"POST"},n),r)];case 1:return[2,t.sent()]}})})}}})}function kc(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 Rc.call(t,n)}})}var Nc,jc,Lc="apis",Uc={name:Lc,IIFE:!0,entity:function(){Object.defineProperty(this.prototype,Lc,{get:function(){return kc.call(this)},configurable:!0,enumerable:!0})}};function Dc(e){try{e.registerComponent(Uc)}catch(e){console.warn(e)}}try{cloudbase.registerComponent(Uc)}catch(e){}try{window.registerApis=Dc}catch(e){}!function(e){e.DocIDError="文档ID不合法",e.CollNameError="集合名称不合法",e.OpStrError="操作符不合法",e.DirectionError="排序字符不合法",e.IntergerError="must be integer",e.BooleanError="must be boolean",e.ArrayError="must be array",e.QueryParamTypeError="查询参数必须为对象",e.QueryParamValueError="查询参数对象值不能均为undefined",e.CentersPhereError="centersPhere结构不合法"}(jc||(jc={}));var qc,Mc,Bc="Object",Fc="GeoPoint",Wc="GeoLineString",Gc="GeoPolygon",Vc="GeoMultiPoint",Hc="GeoMultiLineString",zc="GeoMultiPolygon",Kc="Date",Jc="ServerDate",$c=["desc","asc"],Yc=["<","<=","==",">=",">"];!function(e){e.lt="<",e.gt=">",e.lte="<=",e.gte=">=",e.eq="=="}(qc||(qc={})),(Nc={})[qc.eq]="$eq",Nc[qc.lt]="$lt",Nc[qc.lte]="$lte",Nc[qc.gt]="$gt",Nc[qc.gte]="$gte",function(e){e.WHERE="WHERE",e.DOC="DOC"}(Mc||(Mc={}));var Xc=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)}}(),Qc=[],Zc={},eu=function(e){function t(t,n){if(n!==Zc)throw new TypeError("InternalSymbol cannot be constructed with new operator");return e.call(this,t)||this}return Xc(t,e),t.for=function(e){for(var n=0,r=Qc.length;n<r;n++)if(Qc[n].target===e)return Qc[n].instance;var o=new t(e,Zc);return Qc.push({target:e,instance:o}),o},t}(function(e){Object.defineProperties(this,{target:{enumerable:!1,writable:!1,configurable:!1,value:e}})});const tu=eu;var nu=tu.for("UNSET_FIELD_NAME"),ru=tu.for("UPDATE_COMMAND"),ou=tu.for("QUERY_COMMAND"),iu=tu.for("LOGIC_COMMAND"),au=tu.for("GEO_POINT"),su=tu.for("SYMBOL_GEO_LINE_STRING"),cu=tu.for("SYMBOL_GEO_POLYGON"),uu=tu.for("SYMBOL_GEO_MULTI_POINT"),lu=tu.for("SYMBOL_GEO_MULTI_LINE_STRING"),pu=tu.for("SYMBOL_GEO_MULTI_POLYGON"),du=tu.for("SERVER_DATE"),hu=tu.for("REGEXP"),fu=tu.for("OBJECTID"),mu=function(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()},vu=function(e){return"object"===mu(e)},yu=function(e){return"number"===mu(e)},gu=function(e){return Array.isArray(e)},bu=function(e){return"date"===mu(e)},wu=function(e){return"regexp"===mu(e)},_u=function(e){return e&&e._internalType instanceof eu},xu=function(){function e(e){if(!gu(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 Zu))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||!gu(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(!yu(i[0])||!yu(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 su},enumerable:!1,configurable:!0}),e}(),Eu=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.")},Iu=function(){function e(e){if(!gu(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 xu))throw new TypeError('"lines" must be of type LineString[]. Received type '.concat(typeof e,"[]"));if(!xu.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||!gu(e.coordinates))return!1;try{for(var i=Eu(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,Eu(s)),u=c.next();!u.done;u=c.next()){var l=u.value;if(!yu(l[0])||!yu(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 cu},enumerable:!1,configurable:!0}),e}(),Su=function(){function e(e){if(!gu(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 Zu))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||!gu(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(!yu(i[0])||!yu(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 uu},enumerable:!1,configurable:!0}),e}(),Ou=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.")},Tu=function(){function e(e){if(!gu(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 xu))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||!gu(e.coordinates))return!1;try{for(var i=Ou(e.coordinates),a=i.next();!a.done;a=i.next()){var s=a.value;try{for(var c=(r=void 0,Ou(s)),u=c.next();!u.done;u=c.next()){var l=u.value;if(!yu(l[0])||!yu(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 lu},enumerable:!1,configurable:!0}),e}(),Au=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.")},Pu=function(){function e(e){var t,n;if(!gu(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=Au(e),o=r.next();!o.done;o=r.next()){var i=o.value;if(!(i instanceof Iu))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||!gu(e.coordinates))return!1;try{for(var s=Au(e.coordinates),c=s.next();!c.done;c=s.next()){var u=c.value;try{for(var l=(r=void 0,Au(u)),p=l.next();!p.done;p=l.next()){var d=p.value;try{for(var h=(i=void 0,Au(d)),f=h.next();!f.done;f=h.next()){var m=f.value;if(!yu(m[0])||!yu(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 pu},enumerable:!1,configurable:!0}),e}(),Cu=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},Ru=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 Fc:o=new Zu(i.coordinates[0],i.coordinates[1]);break;case Wc:o=new xu(i.coordinates.map(function(e){return new Zu(e[0],e[1])}));break;case Gc:o=new Iu(i.coordinates.map(function(e){return new xu(e.map(function(e){var t=Cu(e,2),n=t[0],r=t[1];return new Zu(n,r)}))}));break;case Vc:o=new Su(i.coordinates.map(function(e){return new Zu(e[0],e[1])}));break;case Hc:o=new Tu(i.coordinates.map(function(e){return new xu(e.map(function(e){var t=Cu(e,2),n=t[0],r=t[1];return new Zu(n,r)}))}));break;case zc:o=new Pu(i.coordinates.map(function(e){return new Iu(e.map(function(e){return new xu(e.map(function(e){var t=Cu(e,2),n=t[0],r=t[1];return new Zu(n,r)}))}))}));break;case Kc:o=i;break;case Bc:case"Array":o=e.formatField(i);break;case Jc: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);return t===Kc?Kc:(t===Bc&&(e.$date?t=Jc:Zu.validate(e)?t=Fc:xu.validate(e)?t=Wc:Iu.validate(e)?t=Gc:Su.validate(e)?t=Vc:Tu.validate(e)?t=Hc:Pu.validate(e)&&(t=zc)),t)},e.generateDocId=function(){for(var e="",t=0;t<24;t++)e+="ABCDEFabcdef0123456789".charAt(Math.floor(22*Math.random()));return e},e}(),ku={code:"INVALID_PARAM",message:"Invalid request param"},Nu="DATABASE_TRANSACTION_CONFLICT",ju={code:"DATABASE_REQUEST_FAILED",message:"database request failed"};const Lu=(e=>{var t={};return __webpack_require__.d(t,e),t})({EJSON:()=>__WEBPACK_EXTERNAL_MODULE_bson__.EJSON});var Uu=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)}}(),Du=function(){return Du=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},Du.apply(this,arguments)};function qu(e,t){if("function"!=typeof t)return e;e.then(function(e){return t(0,e)},function(e){return t(e)})}var Mu={};function Bu(e){if(!tp.wsClientClass)throw new Error("to use realtime you must import realtime module first");var t=e.config.env;return Mu[t]||(Mu[t]=new tp.wsClientClass({context:{appConfig:{docSizeLimit:1e3,realtimePingInterval:1e4,realtimePongWaitTimeout:5e3,request:tp.createRequest(e.config)}}})),Mu[t]}var Fu=function(e){return void 0!==e.timeout?{timeout:e.timeout}:{}},Wu=function(e){if(!vu(e))return e;for(var t in e)void 0===e[t]?delete e[t]:vu(e[t])&&(e[t]=Wu(e[t]));return e},Gu=function(e){return e=Wu(e),Lu.EJSON.stringify(e,{relaxed:!1})},Vu=function(e){var t,n;if(e instanceof Date)return{$date:+e};if(e instanceof RegExp)return{$regex:e.source,$options:e.flags};if(e&&"object"==typeof e){if("ObjectId"===e._bsontype)return{$oid:e.toHexString()};if("BSONRegExp"===e._bsontype)return{$regex:e.pattern,$options:e.options};if(Array.isArray(e))return e.map(Vu);var r={};try{for(var o=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.")}(Object.keys(e)),i=o.next();!i.done;i=o.next()){var a=i.value;r[a]=Vu(e[a])}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}return e},Hu=function(e){if(!e)return"{}";try{var t=Lu.EJSON.parse(e);return JSON.stringify(Vu(t))}catch(t){return e}},zu=function(e){function t(t){var n=e.call(this,t.message)||this;return n.code=t.code,n.message=t.message,n}return Uu(t,e),t}(Error),Ku=function(e){return new zu(e)};function Ju(e,t){if(!1===e)return t;throw Ku(Du({},t))}var $u,Yu=function(){return Yu=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},Yu.apply(this,arguments)},Xu=["limit","offset","projection","order","multiple","timeout","raw"],Qu=function(){function e(){}return e.isGeopoint=function(e,t){if("Number"!==Ru.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+jc.IntergerError);return!0},e.mustBeBoolean=function(e,t){if("boolean"!=typeof t)throw new Error(e+jc.BooleanError);return!0},e.isProjection=function(e,t){if("object"!==mu(t))throw Ku(Yu(Yu({},ku),{message:"".concat(e," projection must be an object")}));for(var n in t){var r=t[n];if("number"===mu(r)){if(0!==r&&1!==r)throw Ku(Yu(Yu({},ku),{message:"if the value in projection is of number, it must be 0 or 1"}))}else if("object"!==mu(r))throw Ku(Yu(Yu({},ku),{message:"invalid projection"}))}return!0},e.isOrder=function(e,t){if("object"!==mu(t))throw Ku(Yu(Yu({},ku),{message:"".concat(e," order must be an object")}));for(var n in t){var r=t[n];if(1!==r&&-1!==r)throw Ku(Yu(Yu({},ku),{message:"order value must be 1 or -1"}))}return!0},e.isFieldOrder=function(e){if(-1===$c.indexOf(e))throw new Error(jc.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===Yc.indexOf(e))throw new Error(jc.OpStrError);return!0},e.isCollName=function(e){if(!/^[a-zA-Z0-9]([a-zA-Z0-9-_]){1,32}$/.test(e))throw new Error(jc.CollNameError);return!0},e.isDocID=function(e){if(!/^([a-fA-F0-9]){24}$/.test(e))throw new Error(jc.DocIDError);return!0},e.isValidOptions=function(t){if(void 0===t&&(t={}),"object"!==mu(t))throw Ku(Yu(Yu({},ku),{message:"options must be an object"}));var n=Object.keys(t);for(var r in n)if(Xu.indexOf(n[r])<0)throw Ku(Yu(Yu({},ku),{message:"".concat(n[r]," is invalid options key")}));var o=t,i=o.limit,a=o.offset,s=o.projection,c=o.order,u=t.multiple;return void 0!==i&&e.isInteger("limit",i),void 0!==a&&e.isInteger("offset",a),void 0!==s&&e.isProjection("projection",s),void 0!==c&&e.isOrder("order",c),void 0!==u&&e.mustBeBoolean("multiple",u),void 0!==t.timeout&&e.isInteger("timeout",t.timeout),!0},e.isValidAggregation=function(e){if(1!==Object.keys(e).length)throw Ku(Yu(Yu({},ku),{message:"aggregation stage must have one key"}));return!0},e.isCentersPhere=function(t){if(Array.isArray(t)&&2===t.length){if("object"===mu(t[0])&&t[0]._internalType===au&&"number"==typeof t[1])return!0;if(Array.isArray(t[0])&&2===t[0].length){var n=t[0][0],r=t[0][1];if(e.isGeopoint("longitude",n),e.isGeopoint("latitude",r),"number"==typeof t[1])return!0}}throw new Error("".concat(jc.CentersPhereError))},e}(),Zu=function(){function e(e,t){Qu.isGeopoint("longitude",e),Qu.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&&gu(e.coordinates)&&Qu.isGeopoint("longitude",e.coordinates[0])&&Qu.isGeopoint("latitude",e.coordinates[1])},Object.defineProperty(e.prototype,"_internalType",{get:function(){return au},enumerable:!1,configurable:!0}),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"}($u||($u={}));var el,tl=function(){function e(e,t,n){this._internalType=ru,Object.defineProperties(this,{_internalType:{enumerable:!1,configurable:!1}}),this.operator=e,this.operands=t,this.fieldName=n||nu}return e.prototype._setFieldName=function(t){return new e(this.operator,this.operands,t)},e}();function nl(e){return e&&e instanceof tl&&e._internalType===ru}!function(e){e.AND="and",e.OR="or",e.NOT="not",e.NOR="nor"}(el||(el={}));var rl=function(){function e(e,t,n){if(this._internalType=iu,Object.defineProperties(this,{_internalType:{enumerable:!1,configurable:!1}}),this.operator=e,this.operands=t,this.fieldName=n||nu,this.fieldName!==nu)if(Array.isArray(t)){t=t.slice(),this.operands=t;for(var r=0,o=t.length;r<o;r++)(ol(i=t[r])||cl(i))&&(t[r]=i._setFieldName(this.fieldName))}else{var i;(ol(i=t)||cl(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(el.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(el.OR,r,this.fieldName)},e}();function ol(e){return e&&e instanceof rl&&e._internalType===iu}var il,al=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"}(il||(il={}));var sl=function(e){function t(t,n,r){var o=e.call(this,t,n,r)||this;return o.operator=t,o._internalType=ou,o}return al(t,e),t.prototype.toJSON=function(){var e,t,n;switch(this.operator){case il.IN:case il.NIN:return(e={})["$"+this.operator]=this.operands,e;case il.NEQ:return(t={}).$ne=this.operands[0],t;default:return(n={})["$"+this.operator]=this.operands[0],n}},t.prototype._setFieldName=function(e){return new t(this.operator,this.operands,e)},t.prototype.eq=function(e){var n=new t(il.EQ,[e],this.fieldName);return this.and(n)},t.prototype.neq=function(e){var n=new t(il.NEQ,[e],this.fieldName);return this.and(n)},t.prototype.gt=function(e){var n=new t(il.GT,[e],this.fieldName);return this.and(n)},t.prototype.gte=function(e){var n=new t(il.GTE,[e],this.fieldName);return this.and(n)},t.prototype.lt=function(e){var n=new t(il.LT,[e],this.fieldName);return this.and(n)},t.prototype.lte=function(e){var n=new t(il.LTE,[e],this.fieldName);return this.and(n)},t.prototype.in=function(e){var n=new t(il.IN,e,this.fieldName);return this.and(n)},t.prototype.nin=function(e){var n=new t(il.NIN,e,this.fieldName);return this.and(n)},t.prototype.geoNear=function(e){if(!(e.geometry instanceof Zu))throw new TypeError('"geometry" must be of type Point. Received type '.concat(typeof e.geometry));if(void 0!==e.maxDistance&&!yu(e.maxDistance))throw new TypeError('"maxDistance" must be of type Number. Received type '.concat(typeof e.maxDistance));if(void 0!==e.minDistance&&!yu(e.minDistance))throw new TypeError('"minDistance" must be of type Number. Received type '.concat(typeof e.minDistance));var n=new t(il.GEO_NEAR,[e],this.fieldName);return this.and(n)},t.prototype.geoWithin=function(e){if(!(e.geometry instanceof Pu||e.geometry instanceof Iu||Qu.isCentersPhere(e.centerSphere)))throw new TypeError('"geometry" must be of type Polygon or MultiPolygon. Received type '.concat(typeof e.geometry));var n=new t(il.GEO_WITHIN,[e],this.fieldName);return this.and(n)},t.prototype.geoIntersects=function(e){if(!(e.geometry instanceof Zu||e.geometry instanceof xu||e.geometry instanceof Iu||e.geometry instanceof Su||e.geometry instanceof Tu||e.geometry instanceof Pu))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(il.GEO_INTERSECTS,[e],this.fieldName);return this.and(n)},t}(rl);function cl(e){return e&&e instanceof sl&&e._internalType===ou}function ul(e){return cl(e)}var ll={};for(var pl in il)ll[pl]="$"+pl;for(var pl in el)ll[pl]="$"+pl;for(var pl in $u)ll[pl]="$"+pl;function dl(e){return ll[e]||"$"+e}ll[il.NEQ]="$ne",ll[$u.REMOVE]="$unset",ll[$u.SHIFT]="$pop",ll[$u.UNSHIFT]="$push";var hl=function(){return hl=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},hl.apply(this,arguments)},fl=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},ml=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 vl(e){return yl(e,[e])}function yl(e,t){if(!_u(e)){if(bu(e))return e;if(wu(e))return{$regularExpression:{pattern:e.source,options:e.flags}};if(gu(e))return e.map(function(e){if(t.indexOf(e)>-1)throw new Error("Cannot convert circular structure to JSON");return yl(e,ml(ml([],fl(t),!1),[e],!1))});if(vu(e)){var n=hl({},e),r={};for(var o in n){if(t.indexOf(n[o])>-1)throw new Error("Cannot convert circular structure to JSON");void 0!==n[o]&&(r[o]=yl(n[o],ml(ml([],fl(t),!1),[n[o]],!1)))}return r}return e}switch(e._internalType){case au:return e.toJSON();case du:case hu:case fu:return e.parse();default:return e.toJSON?e.toJSON():e}}var gl=function(){return gl=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},gl.apply(this,arguments)},bl=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},wl=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 _l(e,t,n,r){var o=gl({},e);for(var i in e)if(!/^\$/.test(i)){var a=e[i];if(void 0!==a){if(a&&vu(a)&&!t(a)){if(r.indexOf(a)>-1)throw new Error("Cannot convert circular structure to JSON");var s=_l(a,t,wl(wl([],bl(n),!1),[i],!1),wl(wl([],bl(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]}}else delete o[i]}return o}function xl(e){return _l(e,Il,[],[e])}function El(e,t,n){for(var r in t[n]||delete e[n],t)e[r]?gu(e[r])?e[r].push(t[r]):vu(e[r])?vu(t[r])?Object.assign(e[r],t[r]):(console.warn("unmergable condition, query is object but condition is ".concat(mu(t),", can only overwrite"),t,n),e[r]=t[r]):(console.warn("to-merge query is of type ".concat(mu(e),", can only overwrite"),e,t,n),e[r]=t[r]):e[r]=t[r]}function Il(e){return _u(e)||bu(e)||wu(e)}function Sl(e){return vl(e)}var Ol=function(){function e(){}return e.encode=function(t){return(new e).encodeUpdate(t)},e.encodeEJSON=function(t,n){var r=new e;return Gu(n?t:r.encodeUpdate(t))},e.prototype.encodeUpdate=function(e){return nl(e)?this.encodeUpdateCommand(e):"object"===mu(e)?this.encodeUpdateObject(e):e},e.prototype.encodeUpdateCommand=function(e){if(e.fieldName===nu)throw new Error("Cannot encode a comparison command with unset field name");switch(e.operator){case $u.PUSH:case $u.PULL:case $u.PULL_ALL:case $u.POP:case $u.SHIFT:case $u.UNSHIFT:case $u.ADD_TO_SET:return this.encodeArrayUpdateCommand(e);default:return this.encodeFieldUpdateCommand(e)}},e.prototype.encodeFieldUpdateCommand=function(e){var t,n,r,o,i=dl(e.operator);return e.operator===$u.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=dl(e.operator);switch(e.operator){case $u.PUSH:var d=void 0;return d=gu(e.operands)?{$each:e.operands.map(Sl)}:e.operands,(t={})[p]=((n={})[e.fieldName]=d,n),t;case $u.UNSHIFT:return d={$each:e.operands.map(Sl),$position:0},(r={})[p]=((o={})[e.fieldName]=d,o),r;case $u.POP:return(i={})[p]=((a={})[e.fieldName]=1,a),i;case $u.SHIFT:return(s={})[p]=((c={})[e.fieldName]=-1,c),s;default:return(u={})[p]=((l={})[e.fieldName]=Sl(e.operands),l),u}},e.prototype.encodeUpdateObject=function(e){var t=xl(e);for(var n in t)if(!/^\$/.test(n)){var r=t[n];if(nl(r))t[n]=r._setFieldName(n),El(t,this.encodeUpdateCommand(t[n]),n);else{t[n]=r=Sl(r);var o=new tl($u.SET,[r],n);El(t,this.encodeUpdateCommand(o),n)}}return t},e}(),Tl=function(){return Tl=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},Tl.apply(this,arguments)},Al=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())})},Pl=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])}}},Cl=function(){function e(e,t,n,r,o){var i=this;this.watch=function(e){return Bu(i._db).watch(Tl(Tl({},e),{envId:i._db.config.env,collectionName:i._coll,query:JSON.stringify({_id:i.id})}))},this._db=e,this._coll=t,this.id=r,this._transactionId=o,this.request=tp.createRequest(this._db.config),this._apiOptions=n}return e.prototype.create=function(e,t){return qu(this._create(e),t)},e.prototype._create=function(e){return Al(this,void 0,void 0,function(){var t,n,r;return Pl(this,function(o){switch(o.label){case 0:return!(t=Array.isArray(e))&&this.id&&(e._id=this.id),n={collectionName:this._coll,data:t?e.map(function(e){return Gu(vl(e))}):[Gu(vl(e))],transactionId:this._transactionId},[4,this.request.send("database.insertDocument",n,Fu(this._apiOptions))];case 1:return(r=o.sent()).code?[2,r]:this._transactionId?[2,{inserted:1,ok:1,id:r.data.insertedIds[0],requestId:r.requestId}]:t?[2,{ids:r.data&&r.data.insertedIds||[],requestId:r.requestId}]:[2,{id:r.data.insertedIds[0],requestId:r.requestId}]}})})},e.prototype.set=function(e,t){return qu(this._set(e),t)},e.prototype._set=function(e){return Al(this,void 0,void 0,function(){var t,n,r,o;return Pl(this,function(i){switch(i.label){case 0:return this.id?e&&"object"==typeof e?e.hasOwnProperty("_id")?[2,Ju(this._db.config.throwOnCode,Tl(Tl({},ku),{message:"不能更新_id的值"}))]:(t=!1,n=function(e){if("object"==typeof e)for(var r in e)e[r]instanceof tl?t=!0:"object"==typeof e[r]&&n(e[r])},n(e),t?[2,Ju(this._db.config.throwOnCode,Tl(Tl({},ju),{message:"update operator complicit"}))]:(r={collectionName:this._coll,queryType:Mc.DOC,data:Gu(vl(e)),transactionId:this._transactionId,multi:!1,merge:!1,upsert:!0},this.id&&(r.query=Gu({_id:this.id})),[4,this.request.send("database.modifyDocument",r,Fu(this._apiOptions))])):[2,Ju(this._db.config.throwOnCode,Tl(Tl({},ku),{message:"参数必需是非空对象"}))]:[2,Ju(this._db.config.throwOnCode,Tl(Tl({},ku),{message:"docId不能为空"}))];case 1:return(o=i.sent()).code?[2,o]:this._transactionId?[2,{updated:o.data.updated,upserted:[{_id:o.data.upsert_id}],requestId:o.requestId}]:[2,{updated:o.data.updated,upsertedId:o.data.upsert_id,requestId:o.requestId}]}})})},e.prototype.update=function(e,t){return qu(this._update(e),t)},e.prototype._update=function(e){return Al(this,void 0,void 0,function(){var t,n,r;return Pl(this,function(o){switch(o.label){case 0:return e&&"object"==typeof e?e.hasOwnProperty("_id")?[2,Ju(this._db.config.throwOnCode,Tl(Tl({},ku),{message:"不能更新_id的值"}))]:(t=Gu({_id:this.id}),n={collectionName:this._coll,transactionId:this._transactionId,data:Ol.encodeEJSON(e,this._apiOptions.raw||!1),query:t,queryType:Mc.DOC,multi:!1,merge:!0,upsert:!1},[4,this.request.send("database.modifyDocument",n,Fu(this._apiOptions))]):[2,Ju(this._db.config.throwOnCode,Tl(Tl({},ku),{message:"参数必需是非空对象"}))];case 1:return(r=o.sent()).code?[2,r]:[2,{updated:r.data.updated,requestId:r.requestId}]}})})},e.prototype.delete=function(e){return this.remove(e)},e.prototype.remove=function(e){return qu(this._remove(),e)},e.prototype._remove=function(){return Al(this,void 0,void 0,function(){var e,t,n;return Pl(this,function(r){switch(r.label){case 0:return e=Gu({_id:this.id}),t={collectionName:this._coll,transactionId:this._transactionId,query:e,queryType:Mc.DOC,multi:!1},[4,this.request.send("database.removeDocument",t,Fu(this._apiOptions))];case 1:return(n=r.sent()).code?[2,n]:[2,{deleted:n.data.deleted,requestId:n.requestId}]}})})},e.prototype.get=function(e){return qu(this._get(),e)},e.prototype._get=function(){return Al(this,void 0,void 0,function(){var e,t,n,r,o,i;return Pl(this,function(a){switch(a.label){case 0:return e=Gu({_id:this.id}),t=this._apiOptions.projection,n={collectionName:this._coll,query:e,transactionId:this._transactionId,queryType:Mc.DOC,multi:!1},t&&(n.projection=Gu(t)),[4,this.request.send("database.getDocument",n,Fu(this._apiOptions))];case 1:return(r=a.sent()).code?[2,r]:(o=r.data.list.map(function(e){return Lu.EJSON.parse(e)}),i=Ru.formatResDocumentData(o),this._transactionId?[2,{data:i[0]||null,requestId:r.requestId}]:[2,{data:i,requestId:r.requestId}])}})})},e.prototype.field=function(t){var n={};for(var r in t)"boolean"==typeof t[r]&&(n[r]=!0===t[r]?1:0),"number"==typeof t[r]&&(n[r]=t[r]>0?1:0),"object"==typeof t[r]&&(n[r]=t[r]);var o=Tl({},this._apiOptions);return o.projection=n,new e(this._db,this._coll,o,this.id,this._transactionId)},e}(),Rl=function(){function e(){}return e.encode=function(e){return(new kl).encodeQuery(e)},e.encodeEJSON=function(e,t){var n=new kl;return Gu(t?e:n.encodeQuery(e))},e}(),kl=function(){function e(){}return e.prototype.encodeQuery=function(e,t){var n,r,o;return Il(e)?ol(e)?this.encodeLogicCommand(e):cl(e)?this.encodeQueryCommand(e):wu(e)?((n={})[t]=this.encodeRegExp(e),n):bu(e)?((r={})[t]=Sl(e),r):((o={})[t]=this.encodeQueryObject(e),o):vu(e)?this.encodeQueryObject(e):e},e.prototype.encodeRegExp=function(e){return{$regularExpression:{pattern:e.source,options:e.flags}}},e.prototype.encodeLogicCommand=function(e){var t,n,r,o,i,a,s,c=this;switch(e.operator){case el.NOR:case el.AND:case el.OR:var u=dl(e.operator),l=e.operands.map(function(t){return c.encodeQuery(t,e.fieldName)});return(t={})[u]=l,t;case el.NOT:u=dl(e.operator);var p=e.operands[0];return wu(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=dl(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 ul(e),this.encodeComparisonCommand(e)},e.prototype.encodeComparisonCommand=function(e){var t,n,r,o,i,a,s,c,u,l,p;if(e.fieldName===nu)throw new Error("Cannot encode a comparison command with unset field name");var d=dl(e.operator);switch(e.operator){case il.EQ:case il.NEQ:case il.LT:case il.LTE:case il.GT:case il.GTE:case il.ELEM_MATCH:case il.EXISTS:case il.SIZE:case il.MOD:return(t={})[e.fieldName]=((n={})[d]=Sl(e.operands[0]),n),t;case il.IN:case il.NIN:case il.ALL:return(r={})[e.fieldName]=((o={})[d]=Sl(e.operands),o),r;case il.GEO_NEAR:var h=e.operands[0];return(i={})[e.fieldName]={$nearSphere:{$geometry:h.geometry.toJSON(),$maxDistance:h.maxDistance,$minDistance:h.minDistance}},i;case il.GEO_WITHIN:if((h=e.operands[0]).centerSphere){Qu.isCentersPhere(h.centerSphere);var f=h.centerSphere;return f[0]._internalType===au?((a={})[e.fieldName]={$geoWithin:{$centerSphere:[f[0].toJSON().coordinates,f[1]]}},a):((s={})[e.fieldName]={$geoWithin:{$centerSphere:h.centerSphere}},s)}return(c={})[e.fieldName]={$geoWithin:{$geometry:h.geometry.toJSON()}},c;case il.GEO_INTERSECTS:return h=e.operands[0],(u={})[e.fieldName]={$geoIntersects:{$geometry:h.geometry.toJSON()}},u;default:return(l={})[e.fieldName]=((p={})[d]=Sl(e.operands[0]),p),l}},e.prototype.encodeQueryObject=function(e){var t=xl(e);for(var n in t){var r=t[n];if(ol(r)){t[n]=r._setFieldName(n);var o=this.encodeLogicCommand(t[n]);this.mergeConditionAfterEncode(t,o,n)}else ul(r)?(t[n]=r._setFieldName(n),o=this.encodeComparisonCommand(t[n]),this.mergeConditionAfterEncode(t,o,n)):Il(r)&&(t[n]=Sl(r))}return t},e.prototype.mergeConditionAfterEncode=function(e,t,n){for(var r in t[n]||delete e[n],t)e[r]?gu(e[r])?e[r]=e[r].concat(t[r]):vu(e[r])?vu(t[r])?Object.assign(e,t):(console.warn("unmergable condition, query is object but condition is ".concat(mu(t),", can only overwrite"),t,n),e[r]=t[r]):(console.warn("to-merge query is of type ".concat(mu(e),", can only overwrite"),e,t,n),e[r]=t[r]):e[r]=t[r]},e}(),Nl=function(){return Nl=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},Nl.apply(this,arguments)},jl=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())})},Ll=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])}}},Ul=function(){function e(e,t,n,r,o){var i=this;this.watch=function(e){var t=Bu(i._db),n=i._apiOptions,r=n.limit,o=n.order,a=o?Object.entries(o).reduce(function(e,t){var n=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}(t,2),r=n[0],o=n[1];return e[r]=-1===o?"desc":"asc",e},{}):void 0;return t.watch(Nl(Nl({},e),{envId:i._db.config.env,collectionName:i._coll,query:Hu(i._fieldFilters),limit:r,orderBy:a}))},this._db=e,this._coll=t,this._fieldFilters=n,this._apiOptions=r||{},this._request=tp.createRequest(this._db.config),this._transactionId=o}return e.prototype.get=function(e){return qu(this._get(),e)},e.prototype._get=function(){return jl(this,void 0,void 0,function(){var e,t,n,r,o,i,a,s,c;return Ll(this,function(u){switch(u.label){case 0:return e=this._apiOptions.order,t={collectionName:this._coll,queryType:Mc.WHERE,transactionId:this._transactionId},this._fieldFilters&&(t.query=this._fieldFilters),e&&(t.order=Gu(e)),(n=this._apiOptions.offset)&&(t.offset=n),r=this._apiOptions.limit,t.limit=r?r<1e3?r:1e3:100,(o=this._apiOptions.projection)&&(t.projection=Gu(o)),[4,this._request.send("database.getDocument",t,Fu(this._apiOptions))];case 1:return(i=u.sent()).code?[2,i]:(a=i.data.list.map(function(e){return Lu.EJSON.parse(e)}),s=Ru.formatResDocumentData(a),c={data:s,requestId:i.requestId},i.total&&(c.total=i.total),i.limit&&(c.limit=i.limit),i.offset&&(c.offset=i.offset),[2,c])}})})},e.prototype.count=function(e){return qu(this._count(),e)},e.prototype._count=function(){return jl(this,void 0,void 0,function(){var e,t;return Ll(this,function(n){switch(n.label){case 0:return e={collectionName:this._coll,queryType:Mc.WHERE},this._fieldFilters&&(e.query=this._fieldFilters),[4,this._request.send("database.calculateDocument",e,Fu(this._apiOptions))];case 1:return(t=n.sent()).code?[2,t]:[2,{requestId:t.requestId,total:t.data.total}]}})})},e.prototype.where=function(t){if("Object"!==Object.prototype.toString.call(t).slice(8,-1))throw Error(jc.QueryParamTypeError);var n=Object.keys(t),r=n.some(function(e){return void 0!==t[e]});if(n.length&&!r)throw Error(jc.QueryParamValueError);return new e(this._db,this._coll,Rl.encodeEJSON(t,this._apiOptions.raw||!1),this._apiOptions,this._transactionId)},e.prototype.options=function(t){return Qu.isValidOptions(t),new e(this._db,this._coll,this._fieldFilters,t,this._transactionId)},e.prototype.orderBy=function(t,n){var r;Qu.isFieldPath(t),Qu.isFieldOrder(n);var o=((r={})[t]="desc"===n?-1:1,r),i=this._apiOptions.order||{},a=Object.assign({},this._apiOptions,{order:Object.assign({},i,o)});return new e(this._db,this._coll,this._fieldFilters,a,this._transactionId)},e.prototype.limit=function(t){Qu.isInteger("limit",t);var n=Nl({},this._apiOptions);return n.limit=t,new e(this._db,this._coll,this._fieldFilters,n,this._transactionId)},e.prototype.skip=function(t){Qu.isInteger("offset",t);var n=Nl({},this._apiOptions);return n.offset=t,new e(this._db,this._coll,this._fieldFilters,n,this._transactionId)},e.prototype.update=function(e,t){return qu(this._update(e),t)},e.prototype._update=function(e){return jl(this,void 0,void 0,function(){var t,n,r,o;return Ll(this,function(i){switch(i.label){case 0:return e&&"object"==typeof e?e.hasOwnProperty("_id")?[2,Ju(this._db.config.throwOnCode,Nl(Nl({},ku),{message:"不能更新_id的值"}))]:(t=this._apiOptions.multiple,n=void 0===t||t,r={collectionName:this._coll,queryType:Mc.WHERE,multi:n,merge:!0,upsert:!1,data:Ol.encodeEJSON(e,this._apiOptions.raw||!1)},this._transactionId&&(r.transactionId=this._transactionId),this._fieldFilters&&(r.query=this._fieldFilters),[4,this._request.send("database.modifyDocument",r,Fu(this._apiOptions))]):[2,Ju(this._db.config.throwOnCode,Nl(Nl({},ku),{message:"参数必需是非空对象"}))];case 1:return(o=i.sent()).code?[2,o]:[2,{requestId:o.requestId,updated:o.data.updated,upsertId:o.data.upsert_id}]}})})},e.prototype.field=function(t){var n={};for(var r in t)"boolean"==typeof t[r]&&(n[r]=!0===t[r]?1:0),"number"==typeof t[r]&&(n[r]=t[r]>0?1:0),"object"==typeof t[r]&&(n[r]=t[r]);var o=Nl({},this._apiOptions);return o.projection=n,new e(this._db,this._coll,this._fieldFilters,o,this._transactionId)},e.prototype.remove=function(e){return qu(this._remove(),e)},e.prototype._remove=function(){return jl(this,void 0,void 0,function(){var e,t,n,r,o,i,a,s,c;return Ll(this,function(u){switch(u.label){case 0:return e=this._apiOptions,t=e.offset,n=e.limit,r=e.projection,o=e.order,void 0===t&&void 0===n&&void 0===r&&void 0===o||console.warn("`offset`, `limit`, `projection`, `orderBy` are not supported in remove() operation"),i=this._apiOptions.multiple,a=void 0===i||i,s={collectionName:this._coll,query:this._fieldFilters,queryType:Mc.WHERE,multi:a},this._transactionId&&(s.transactionId=this._transactionId),[4,this._request.send("database.removeDocument",s,Fu(this._apiOptions))];case 1:return(c=u.sent()).code?[2,c]:[2,{requestId:c.requestId,deleted:c.data.deleted}]}})})},e.prototype.updateAndReturn=function(e){return jl(this,void 0,void 0,function(){var t,n;return Ll(this,function(r){switch(r.label){case 0:return e&&"object"==typeof e?e.hasOwnProperty("_id")?[2,Ju(this._db.config.throwOnCode,Nl(Nl({},ku),{message:"不能更新_id的值"}))]:(t={collectionName:this._coll,queryType:Mc.WHERE,data:Ol.encodeEJSON(e,!1)},this._transactionId&&(t.transactionId=this._transactionId),this._fieldFilters&&(t.query=this._fieldFilters),[4,this._request.send("database.modifyAndReturnDoc",t,Fu(this._apiOptions))]):[2,Ju(this._db.config.throwOnCode,Nl(Nl({},ku),{message:"参数必需是非空对象"}))];case 1:return(n=r.sent()).code?[2,n]:[2,{requestId:n.requestId,updated:n.data.updated,doc:n.data.doc&&Lu.EJSON.parse(n.data.doc)}]}})})},e}(),Dl=function(){function e(e,t,n){var r=this;this._stages=[],e&&t&&(this._db=e,this._request=tp.createRequest(this._db.config),this._collectionName=t,n&&n.length>0&&n.forEach(function(e){Qu.isValidAggregation(e);var t=Object.keys(e)[0];r._pipe(t,e[t],!0)}))}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.aggregateDocuments",{collectionName:this._collectionName,stages:this._stages})];case 1:return(e=t.sent())&&e.data&&e.data.list?[2,{requestId:e.requestId,data:e.data.list.map(Lu.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,n){void 0===n&&(n=!1);var r;return r="object"===mu(t)?Gu(t):JSON.stringify(t),this._stages.push({stageKey:n?e:"$".concat(e),stageValue:r}),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=Rl.encode(e.query)),e.distanceMultiplier&&"number"==typeof e.distanceMultiplier&&(e.distanceMultiplier=e.distanceMultiplier),e.near&&(e.near=new Zu(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",Rl.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 ql=Dl;var Ml=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)}}(),Bl=function(e){function t(t,n,r,o){var i=e.call(this,t,n,"",r,o)||this;return o&&(i._transactionId=o),i}return Ml(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 Cl(this._db,this._coll,this._apiOptions,e,this._transactionId)},t.prototype.add=function(e,t){return qu(this._add(e),t)},t.prototype._add=function(e){return t=this,n=void 0,o=function(){var t,n,r;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(o){switch(o.label){case 0:return t=e,gu(e)||(t=[e]),t=t.map(function(e){return Gu(vl(e))}),n={collectionName:this._coll,data:t},this._transactionId&&(n.transactionId=this._transactionId),[4,this._request.send("database.insertDocument",n,Fu(this._apiOptions))];case 1:return(r=o.sent()).code?[2,r]:gu(e)?[2,{ids:r.data.insertedIds,requestId:r.requestId}]:this._transactionId?[2,{inserted:1,ok:1,id:r.data.insertedIds[0],requestId:r.requestId}]:[2,{id:r.data.insertedIds[0],requestId:r.requestId}]}})},new((r=void 0)||(r=Promise))(function(e,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r(function(e){e(n)})).then(a,s)}c((o=o.apply(t,n||[])).next())});var t,n,r,o},t.prototype.aggregate=function(e){return void 0===e&&(e=[]),new ql(this._db,this._coll,this._apiOptions.raw?e:[])},t.prototype.options=function(e){return Qu.isValidOptions(e),new t(this._db,this._coll,e,this._transactionId)},t}(Ul),Fl={eq:function(e){return new sl(il.EQ,[e])},neq:function(e){return new sl(il.NEQ,[e])},lt:function(e){return new sl(il.LT,[e])},lte:function(e){return new sl(il.LTE,[e])},gt:function(e){return new sl(il.GT,[e])},gte:function(e){return new sl(il.GTE,[e])},in:function(e){return new sl(il.IN,e)},nin:function(e){return new sl(il.NIN,e)},all:function(e){return new sl(il.ALL,e)},elemMatch:function(e){return new sl(il.ELEM_MATCH,[e])},exists:function(e){return new sl(il.EXISTS,[e])},size:function(e){return new sl(il.SIZE,[e])},mod:function(){return new sl(il.MOD,1==arguments.length?[arguments[0]]:2==arguments.length?[[arguments[0],arguments[1]]]:arguments)},geoNear:function(e){return new sl(il.GEO_NEAR,[e])},geoWithin:function(e){return new sl(il.GEO_WITHIN,[e])},geoIntersects:function(e){return new sl(il.GEO_INTERSECTS,[e])},and:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=gu(arguments[0])?arguments[0]:Array.from(arguments);return new rl(el.AND,n)},nor:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=gu(arguments[0])?arguments[0]:Array.from(arguments);return new rl(el.NOR,n)},or:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=gu(arguments[0])?arguments[0]:Array.from(arguments);return new rl(el.OR,n)},not:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=gu(arguments[0])?arguments[0]:Array.from(arguments);return new rl(el.NOT,n)},set:function(e){return new tl($u.SET,[e])},remove:function(){return new tl($u.REMOVE,[])},inc:function(e){return new tl($u.INC,[e])},mul:function(e){return new tl($u.MUL,[e])},push:function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(vu(t[0])&&t[0].hasOwnProperty("each")){e={};var r=t[0];void 0!==r.each&&(e.$each=r.each),void 0!==r.position&&(e.$position=r.position),void 0!==r.sort&&(e.$sort=r.sort),void 0!==r.slice&&(e.$slice=r.slice)}else e=gu(t[0])?t[0]:Array.from(t);return new tl($u.PUSH,e)},pull:function(e){return new tl($u.PULL,e)},pullAll:function(e){return new tl($u.PULL_ALL,e)},pop:function(){return new tl($u.POP,[])},shift:function(){return new tl($u.SHIFT,[])},unshift:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=gu(arguments[0])?arguments[0]:Array.from(arguments);return new tl($u.UNSHIFT,n)},addToSet:function(e){return new tl($u.ADD_TO_SET,e)},rename:function(e){return new tl($u.RENAME,[e])},bit:function(e){return new tl($u.BIT,[e])},max:function(e){return new tl($u.MAX,[e])},min:function(e){return new tl($u.MIN,[e])},expr:function(e){return{$expr:e}},jsonSchema:function(e){return{$jsonSchema:e}},text:function(e){return function(e){return"string"===mu(e)}(e)?{$search:e.search}:{$search:e.search,$language:e.language,$caseSensitive:e.caseSensitive,$diacriticSensitive:e.diacriticSensitive}},aggregate:{pipeline:function(){return new ql},abs:function(e){return new Wl("abs",e)},add:function(e){return new Wl("add",e)},ceil:function(e){return new Wl("ceil",e)},divide:function(e){return new Wl("divide",e)},exp:function(e){return new Wl("exp",e)},floor:function(e){return new Wl("floor",e)},ln:function(e){return new Wl("ln",e)},log:function(e){return new Wl("log",e)},log10:function(e){return new Wl("log10",e)},mod:function(e){return new Wl("mod",e)},multiply:function(e){return new Wl("multiply",e)},pow:function(e){return new Wl("pow",e)},sqrt:function(e){return new Wl("sqrt",e)},subtract:function(e){return new Wl("subtract",e)},trunc:function(e){return new Wl("trunc",e)},arrayElemAt:function(e){return new Wl("arrayElemAt",e)},arrayToObject:function(e){return new Wl("arrayToObject",e)},concatArrays:function(e){return new Wl("concatArrays",e)},filter:function(e){return new Wl("filter",e)},in:function(e){return new Wl("in",e)},indexOfArray:function(e){return new Wl("indexOfArray",e)},isArray:function(e){return new Wl("isArray",e)},map:function(e){return new Wl("map",e)},range:function(e){return new Wl("range",e)},reduce:function(e){return new Wl("reduce",e)},reverseArray:function(e){return new Wl("reverseArray",e)},size:function(e){return new Wl("size",e)},slice:function(e){return new Wl("slice",e)},zip:function(e){return new Wl("zip",e)},and:function(e){return new Wl("and",e)},not:function(e){return new Wl("not",e)},or:function(e){return new Wl("or",e)},cmp:function(e){return new Wl("cmp",e)},eq:function(e){return new Wl("eq",e)},gt:function(e){return new Wl("gt",e)},gte:function(e){return new Wl("gte",e)},lt:function(e){return new Wl("lt",e)},lte:function(e){return new Wl("lte",e)},neq:function(e){return new Wl("ne",e)},cond:function(e){return new Wl("cond",e)},ifNull:function(e){return new Wl("ifNull",e)},switch:function(e){return new Wl("switch",e)},dateFromParts:function(e){return new Wl("dateFromParts",e)},dateFromString:function(e){return new Wl("dateFromString",e)},dayOfMonth:function(e){return new Wl("dayOfMonth",e)},dayOfWeek:function(e){return new Wl("dayOfWeek",e)},dayOfYear:function(e){return new Wl("dayOfYear",e)},isoDayOfWeek:function(e){return new Wl("isoDayOfWeek",e)},isoWeek:function(e){return new Wl("isoWeek",e)},isoWeekYear:function(e){return new Wl("isoWeekYear",e)},millisecond:function(e){return new Wl("millisecond",e)},minute:function(e){return new Wl("minute",e)},month:function(e){return new Wl("month",e)},second:function(e){return new Wl("second",e)},hour:function(e){return new Wl("hour",e)},week:function(e){return new Wl("week",e)},year:function(e){return new Wl("year",e)},literal:function(e){return new Wl("literal",e)},mergeObjects:function(e){return new Wl("mergeObjects",e)},objectToArray:function(e){return new Wl("objectToArray",e)},allElementsTrue:function(e){return new Wl("allElementsTrue",e)},anyElementTrue:function(e){return new Wl("anyElementTrue",e)},setDifference:function(e){return new Wl("setDifference",e)},setEquals:function(e){return new Wl("setEquals",e)},setIntersection:function(e){return new Wl("setIntersection",e)},setIsSubset:function(e){return new Wl("setIsSubset",e)},setUnion:function(e){return new Wl("setUnion",e)},concat:function(e){return new Wl("concat",e)},dateToString:function(e){return new Wl("dateToString",e)},indexOfBytes:function(e){return new Wl("indexOfBytes",e)},indexOfCP:function(e){return new Wl("indexOfCP",e)},split:function(e){return new Wl("split",e)},strLenBytes:function(e){return new Wl("strLenBytes",e)},strLenCP:function(e){return new Wl("strLenCP",e)},strcasecmp:function(e){return new Wl("strcasecmp",e)},substr:function(e){return new Wl("substr",e)},substrBytes:function(e){return new Wl("substrBytes",e)},substrCP:function(e){return new Wl("substrCP",e)},toLower:function(e){return new Wl("toLower",e)},toUpper:function(e){return new Wl("toUpper",e)},meta:function(e){return new Wl("meta",e)},addToSet:function(e){return new Wl("addToSet",e)},avg:function(e){return new Wl("avg",e)},first:function(e){return new Wl("first",e)},last:function(e){return new Wl("last",e)},max:function(e){return new Wl("max",e)},min:function(e){return new Wl("min",e)},push:function(e){return new Wl("push",e)},stdDevPop:function(e){return new Wl("stdDevPop",e)},stdDevSamp:function(e){return new Wl("stdDevSamp",e)},sum:function(e){return new Wl("sum",e)},let:function(e){return new Wl("let",e)}},project:{slice:function(e){return new Gl("slice",e)},elemMatch:function(e){return new Gl("elemMatch",e)}}},Wl=function(e,t){this["$"+e]=t},Gl=function(e,t){this["$"+e]=t},Vl=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 du},enumerable:!1,configurable:!0}),e.prototype.parse=function(){return{$tcb_server_date:{offset:this.offset}}},e}();function Hl(e){return new Vl(e)}var zl=function(){function e(e){var t=e.regexp,n=e.options;if(!t)throw new TypeError("regexp must be a string");this.$regularExpression={pattern:t||"",options:n||""}}return e.prototype.parse=function(){return{$regularExpression:{pattern:this.$regularExpression.pattern,options:this.$regularExpression.options}}},Object.defineProperty(e.prototype,"_internalType",{get:function(){return hu},enumerable:!1,configurable:!0}),e}();function Kl(e){return new zl(e)}var Jl=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())})},$l=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])}}},Yl=function(){function e(e){this._db=e,this._request=tp.createRequest(this._db.config),this.aborted=!1,this.commited=!1,this.inited=!1}return e.prototype.init=function(){return Jl(this,void 0,void 0,function(){var e;return $l(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 Bl(this._db,e,{},this._id)},e.prototype.getTransactionId=function(){return this._id},e.prototype.getRequestMethod=function(){return this._request},e.prototype.commit=function(){return Jl(this,void 0,void 0,function(){var e,t;return $l(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 Jl(this,void 0,void 0,function(){var t,n;return $l(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 Xl(){return Jl(this,void 0,void 0,function(){var e;return $l(this,function(t){switch(t.label){case 0:return[4,(e=new Yl(this)).init()];case 1:return t.sent(),[2,e]}})})}function Ql(e,t){return void 0===t&&(t=3),Jl(this,void 0,void 0,function(){var n,r,o,i,a=this;return $l(this,function(s){switch(s.label){case 0:return s.trys.push([0,4,,10]),[4,(n=new Yl(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 Jl(a,void 0,void 0,function(){return $l(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===Nu?[4,Ql.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 Zl=function(){function e(e){var t=(void 0===e?{}:e).id,n=void 0===t?"":t;this.id=n}return Object.defineProperty(e.prototype,"_internalType",{get:function(){return fu},enumerable:!1,configurable:!0}),e.prototype.parse=function(){return{$oid:this.id}},e}();function ep(e){return new Zl(e)}var tp=function(){function e(e){this.config=e,this.Geo=n,this.serverDate=Hl,this.command=Fl,this.RegExp=Kl,this.ObjectId=ep,this.startTransaction=Xl,this.runTransaction=Ql,this.logicCommand=rl,this.updateCommand=tl,this.queryCommand=sl}return e.createRequest=function(t){var n=new e.reqClass(t),r=n.send;return n.send=function(e,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];return n&&(t.instance&&(n.instance=t.instance),t.database&&(n.database=t.database)),r.call.apply(r,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))}([this,e,n],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}(o),!1))},n},e.prototype.collection=function(e){if(!e)throw new Error("Collection name is required");return new Bl(this,e)},e.prototype.createCollection=function(t){var n={collectionName:t};return e.createRequest(this.config).send("database.addCollection",n)},e}(),np=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)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)}}(),rp=function(){return rp=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},rp.apply(this,arguments)},op=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())})},ip=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])}}},ap={filterRes:function(e){return delete(e=r.P6.promoteGatewayError(e)).header,delete e.statusCode,e},flattenResData:function(e){if("object"==typeof e.data&&null!==e.data){var t=rp(rp({},e),e.data);return delete t.data,t}return e},safeParseEJSON:function(e){if("string"!=typeof e)return e;try{return Lu.EJSON.parse(e)}catch(t){return e}},parseEJSONParam:function(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}},parseEJSONValue:function(e){if("string"!=typeof e)return e;try{return Lu.EJSON.parse(e)}catch(t){return ap.parseEJSONParam(e)}},normalizeOrderParam:function(e){if(null!=e&&""!==e){for(var t=ap.parseEJSONValue(e),n=function(e){var t=e&&"object"==typeof e?Number(e):e;if("number"==typeof t&&!isNaN(t))return t<0?"desc":"asc";if("string"==typeof t){var n=t.toLowerCase();if("desc"===n||"-1"===n)return"desc";if("asc"===n||"1"===n)return"asc"}},r=[],o=0,i=Array.isArray(t)?t:[t];o<i.length;o++){var a=i[o];if(a&&"object"==typeof a)if(void 0!==a.field)(u=n(a.direction))&&r.push({field:a.field,direction:u});else for(var s=0,c=Object.entries(a);s<c.length;s++){var u,l=c[s],p=l[0];(u=n(l[1]))&&r.push({field:p,direction:u})}}return r.length?r:void 0}},extractDocId:function(e){if(e&&"object"==typeof e&&!Array.isArray(e)&&1===Object.keys(e).length&&"_id"in e){var t=e._id;if("string"==typeof t||"number"==typeof t)return String(t);if(t&&"object"==typeof t){if("string"==typeof t.$oid)return t.$oid;var n=t.$eq;if("string"==typeof n||"number"==typeof n)return String(n);if(n&&"object"==typeof n&&"string"==typeof n.$oid)return n.$oid}}},toLegacyRegExp:function(e){if(!e||"object"!=typeof e)return e;if(e.$regularExpression&&"object"==typeof e.$regularExpression){var t=e.$regularExpression;return{$regex:t.pattern,$options:t.options}}if(Array.isArray(e))return e.map(function(e){return ap.toLegacyRegExp(e)});var n={};for(var r in e)n[r]=ap.toLegacyRegExp(e[r]);return n},parseWriteParam:function(e){return ap.toLegacyRegExp(ap.parseEJSONParam(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,t){var n,r,o,i;return op(this,void 0,Promise,function(){var a,s,c,u,l,p,d;return ip(this,function(h){switch(h.label){case 0:return a=ap.parseEJSONParam(e.query),s=ap.parseEJSONValue(e.projection),c=ap.extractDocId(a),u=void 0!==c,l=ap.buildQueryParams(rp({projection:s,transactionId:e.transactionId},u?{}:{offset:null!==(n=e.offset)&&void 0!==n?n:0,limit:null!==(r=e.limit)&&void 0!==r?r:100,order:ap.normalizeOrderParam(e.order),query:a?Lu.EJSON.stringify(a,{relaxed:!1}):void 0})),p="".concat(ap.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents?").concat(l),u&&(p="".concat(ap.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents/").concat(c,"?").concat(l)),[4,this.gateWay({url:p,method:"GET"},t)];case 1:return(d=h.sent()).data=ap.safeParseEJSON(JSON.stringify(d.data)),!u||d.code||(null===(o=d.data)||void 0===o?void 0:o.code)?(d.code||(null===(i=d.data)||void 0===i?void 0:i.code)?d=rp(rp({},d),{data:rp(rp({},d.data),{list:[]})}):Array.isArray(d.data)?d=rp(rp({},d),{data:{list:d.data}}):d.data&&!Array.isArray(d.data.list)&&(d=rp(rp({},d),{data:rp(rp({},d.data),{list:[]})})),[2,ap.filterRes(d)]):[2,rp(rp({},d),{data:{list:[d.data]}})]}})})},"database.addDocument":function(e,t){var n,r,o;return op(this,void 0,Promise,function(){var i,a;return ip(this,function(s){switch(s.label){case 0:return i=(Array.isArray(e.data)?e.data:[e.data]).map(function(e){return ap.parseWriteParam(e)}),[4,this.gateWay({url:"".concat(ap.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents"),method:"POST",data:rp({data:i},e.transactionId&&{transactionId:e.transactionId})},t)];case 1:return a=s.sent(),Array.isArray(e.data)?a=rp(rp({},a),{data:rp({ids:(null===(n=a.data)||void 0===n?void 0:n.insertedIds)||[]},a.data)}):(null===(o=null===(r=a.data)||void 0===r?void 0:r.insertedIds)||void 0===o?void 0:o[0])&&(a=rp(rp({},a),{data:rp({_id:a.data.insertedIds[0]},a.data)})),[2,ap.filterRes(a)]}})})},"database.updateDocument":function(e,t){var n;return op(this,void 0,Promise,function(){var r;return ip(this,function(o){switch(o.label){case 0:return[4,this.gateWay({url:"".concat(ap.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents"),method:"PATCH",data:rp({query:ap.parseEJSONParam(e.query),data:ap.parseEJSONParam(e.data),multi:!!e.multi,upsert:!!e.upsert,replaceMode:null!==(n=e.replaceMode)&&void 0!==n?n:!1===e.merge},e.transactionId&&{transactionId:e.transactionId})},t)];case 1:return r=o.sent(),[2,ap.filterRes(r)]}})})},"database.deleteDocument":function(e,t){return op(this,void 0,Promise,function(){var n;return ip(this,function(r){switch(r.label){case 0:return[4,this.gateWay({url:"".concat(ap.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents/remove"),method:"POST",data:rp({query:ap.parseEJSONParam(e.query),multi:!!e.multi},e.transactionId&&{transactionId:e.transactionId})},t)];case 1:return n=r.sent(),[2,ap.filterRes(n)]}})})},"database.countDocument":function(e,t){return op(this,void 0,Promise,function(){var n,r,o;return ip(this,function(i){switch(i.label){case 0:return n=ap.parseEJSONParam(e.query),r=ap.buildQueryParams({count:!0,query:n?Lu.EJSON.stringify(n,{relaxed:!1}):void 0}),[4,this.gateWay({url:"".concat(ap.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents?").concat(r),method:"GET"},t)];case 1:return o=i.sent(),[2,ap.filterRes(o)]}})})},"database.addCollection":function(e,t){return op(this,void 0,Promise,function(){var n;return ip(this,function(r){switch(r.label){case 0:return[4,this.gateWay({url:"".concat(ap.getUrlPrefix(e),"/collections"),method:"POST",data:{collectionName:e.collectionName}},t)];case 1:return n=r.sent(),[2,ap.filterRes(n)]}})})},"database.aggregate":function(e,t){var n;return op(this,void 0,Promise,function(){var r,o;return ip(this,function(i){switch(i.label){case 0:return r=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]=Lu.EJSON.serialize(r),t}catch(t){return(n={})[e.stageKey]=e.stageValue,n}}),[4,this.gateWay({url:"".concat(ap.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents/aggregations"),method:"POST",data:{pipeline:r}},t)];case 1:return o=i.sent(),Array.isArray(null===(n=o.data)||void 0===n?void 0:n.list)&&(o.data.list=JSON.stringify(o.data.list.map(function(e){return JSON.stringify(e)}))),[2,ap.filterRes(o)]}})})},"database.startTransaction":function(e,t){return op(this,void 0,void 0,function(){var n;return ip(this,function(r){switch(r.label){case 0:return[4,this.gateWay({url:"".concat(ap.getUrlPrefix(e),"/transactions"),method:"POST"},t)];case 1:return n=r.sent(),[2,ap.filterRes(ap.flattenResData(n))]}})})},"database.commitTransaction":function(e,t){return op(this,void 0,void 0,function(){var n;return ip(this,function(r){switch(r.label){case 0:return[4,this.gateWay({url:"".concat(ap.getUrlPrefix(e),"/transactions/").concat(e.transactionId,"/commit"),method:"POST"},t)];case 1:return n=r.sent(),[2,ap.filterRes(n)]}})})},"database.abortTransaction":function(e,t){return op(this,void 0,void 0,function(){var n;return ip(this,function(r){switch(r.label){case 0:return[4,this.gateWay({url:"".concat(ap.getUrlPrefix(e),"/transactions/").concat(e.transactionId,"/rollback"),method:"POST"},t)];case 1:return n=r.sent(),[2,ap.filterRes(n)]}})})},"database.getInTransaction":function(e,t){var n;return op(this,void 0,void 0,function(){var r;return ip(this,function(o){switch(o.label){case 0:return[4,ap["database.queryDocument"].call(this,e,t)];case 1:return"object"==typeof(r=o.sent()).data&&null!==r.data?(null===(n=r.data)||void 0===n?void 0:n.code)?[2,ap.flattenResData(r)]:[2,rp(rp({},r),{data:JSON.stringify(r.data)})]:[2,r]}})})},"database.updateDocInTransaction":function(e,t){return op(this,void 0,void 0,function(){var n;return ip(this,function(r){switch(r.label){case 0:return[4,ap["database.updateDocument"].call(this,e,t)];case 1:return n=r.sent(),[2,ap.flattenResData(n)]}})})},"database.deleteDocInTransaction":function(e,t){return op(this,void 0,void 0,function(){var n;return ip(this,function(r){switch(r.label){case 0:return[4,ap["database.deleteDocument"].call(this,e,t)];case 1:return n=r.sent(),[2,ap.flattenResData(n)]}})})},"database.insertDocInTransaction":function(e,t){var n;return op(this,void 0,Promise,function(){var r,o;return ip(this,function(i){switch(i.label){case 0:return[4,ap["database.addDocument"].call(this,e,t)];case 1:return"object"==typeof(r=i.sent()).data&&null!==r.data?(o=!!(null===(n=r.data)||void 0===n?void 0:n._id),r=rp(rp(rp({},r),{inserted:o?1:0,ok:o?1:0}),r.data)):r=rp({inserted:0,ok:0},r),delete r.data,[2,r]}})})},"database.runCommands":function(e,t){return op(this,void 0,Promise,function(){var n;return ip(this,function(r){switch(r.label){case 0:return[4,this.gateWay({url:"".concat(ap.getUrlPrefix(e),"/commands"),method:"POST",data:rp({commands:Lu.EJSON.serialize(Array.isArray(e.commands)?e.commands.map(function(e){return ap.parseEJSONParam(e)}):e.commands)},e.transactionId&&{transactionId:e.transactionId})},t)];case 1:"object"==typeof(n=r.sent()).data&&null!==n.data&&(delete(n=rp(rp({},n),n.data)).data,delete n.request_id);try{n=Lu.EJSON.deserialize(n)}catch(e){}return[2,ap.filterRes(n)]}})})},"database.getDocument":function(e,t){var n;return op(this,void 0,Promise,function(){var r,o;return ip(this,function(i){switch(i.label){case 0:return(r=rp({},e)).query=ap.parseEJSONParam(r.query),r.projection=ap.parseEJSONValue(r.projection),[4,ap["database.queryDocument"].call(this,r,t)];case 1:return o=i.sent(),Array.isArray(null===(n=o.data)||void 0===n?void 0:n.list)&&(o.data.list=o.data.list.map(function(e){return Lu.EJSON.stringify(e,{relaxed:!1})})),[2,o]}})})},"database.insertDocument":function(e,t){return op(this,void 0,Promise,function(){var n;return ip(this,function(r){return(n=rp({},e)).data=Array.isArray(n.data)?n.data.map(function(e){return ap.parseWriteParam(e)}):ap.parseWriteParam(n.data),[2,ap["database.addDocument"].call(this,n,t)]})})},"database.modifyDocument":function(e,t){return op(this,void 0,Promise,function(){var n;return ip(this,function(r){return(n=rp({},e)).query=ap.parseEJSONParam(n.query),n.data=ap.parseEJSONParam(n.data),[2,ap["database.updateDocument"].call(this,n,t)]})})},"database.modifyAndReturnDoc":function(e,t){var n,r;return op(this,void 0,Promise,function(){var o,i,a;return ip(this,function(s){switch(s.label){case 0:return(o=rp({},e)).query=ap.parseEJSONParam(o.query),o.data=ap.parseEJSONParam(o.data),(i=ap.extractDocId(o.query))?[4,this.gateWay({url:"".concat(ap.getUrlPrefix(o),"/collections/").concat(o.collectionName,"/documents/").concat(i),method:"PATCH",data:rp({data:o.data,replaceMode:null!==(n=o.replaceMode)&&void 0!==n&&n,upsert:!!o.upsert,returnDoc:!0},o.transactionId&&{transactionId:o.transactionId})},t)]:[2,ap["database.updateDocument"].call(this,o,t)];case 1:return a=s.sent(),void 0!==(null===(r=a.data)||void 0===r?void 0:r.doc)&&"string"!=typeof a.data.doc&&(a.data.doc=Lu.EJSON.stringify(a.data.doc,{relaxed:!1})),[2,ap.filterRes(a)]}})})},"database.removeDocument":function(e,t){return op(this,void 0,Promise,function(){var n;return ip(this,function(r){return(n=rp({},e)).query=ap.parseEJSONParam(n.query),[2,ap["database.deleteDocument"].call(this,n,t)]})})},"database.calculateDocument":function(e,t){return op(this,void 0,Promise,function(){var n;return ip(this,function(r){return(n=rp({},e)).query=ap.parseEJSONParam(n.query),[2,ap["database.countDocument"].call(this,n,t)]})})},"database.aggregateDocuments":function(e,t){var n;return op(this,void 0,Promise,function(){var r,o;return ip(this,function(i){switch(i.label){case 0:return r=rp({},e),Array.isArray(r.stages)&&(r.stages=r.stages.map(function(e){return rp(rp({},e),{stageValue:ap.parseEJSONParam(e.stageValue)})})),[4,ap["database.aggregate"].call(this,r,t)];case 1:if(o=i.sent(),"string"==typeof(null===(n=o.data)||void 0===n?void 0:n.list))try{o.data.list=JSON.parse(o.data.list)}catch(e){}return[2,o]}})})}},sp={name:"database",entity:{database:function(e){var t;if(void 0!==e&&"Object"!==Object.prototype.toString.call(e).slice(8,-1))throw r.P6.createCloudbaseError({code:"INVALID_PARAM",msg:"dbConfig must be an object"},null===(t=this.config)||void 0===t?void 0:t.errorFactory);var n=this.platform,o=n.adapter,i=n.runtime,a=function(e){function t(t){return e.call(this,t)||this}return np(t,e),t.prototype.send=function(t,n,o){var i,a,s,c;return op(this,void 0,void 0,function(){var u,l,p;return ip(this,function(d){switch(d.label){case 0:return u=null,l=o&&"number"==typeof o.timeout?{timeout:o.timeout}:void 0,"GATEWAY"===this.config.endPointMode&&ap[t]?[4,ap[t].call(this,n,l)]:[3,2];case 1:return u=d.sent(),[3,4];case 2:return[4,e.prototype.send.call(this,t,n,void 0,l)];case 3:u=d.sent(),d.label=4;case 4:if(p=r.P6.resolveThrow(null!==(s=null===(a=null===(i=this.config)||void 0===i?void 0:i._fromApp)||void 0===a?void 0:a.config)&&void 0!==s?s:this.config),u&&u.code&&p)throw r.P6.createCloudbaseError({code:u.code,msg:u.message||u.data&&u.data.message||"",requestId:u.requestId},null===(c=this.config)||void 0===c?void 0:c.errorFactory);return[2,u]}})})},t}(this.request.constructor);return tp.reqClass=a,tp.getAccessToken=this.authInstance?this.authInstance.getAccessToken.bind(this.authInstance):function(){return""},tp.runtime=i,this.wsClientClass&&(tp.wsClass=o.wsClass,tp.wsClientClass=this.wsClientClass),tp.ws||(tp.ws=null),new(function(e){function t(t){return e.call(this,t)||this}return np(t,e),t.prototype.runCommands=function(e){return op(this,void 0,Promise,function(){return ip(this,function(t){return[2,tp.createRequest(this.config).send("database.runCommands",e)]})})},t}(tp))(rp(rp(rp({},this.config),{_fromApp:this}),e))}}};try{cloudbase.registerComponent(sp)}catch(e){}function cp(e){try{e.registerComponent(sp)}catch(e){console.warn(e)}}try{window.registerDatabase=cp}catch(e){}te.registerVersion("3.9.5-alpha.0");try{var up=__webpack_require__(7922).mI,lp=__webpack_require__(2332);te.useAdapters(lp.default);var pp=te;pp.version=up(),pp.SYMBOL_CURRENT_ENV=lp.SYMBOL_CURRENT_ENV,pp.SYMBOL_DEFAULT_ENV=lp.SYMBOL_DEFAULT_ENV,pp.parseContext=lp.parseContext,pp.getCloudbaseContext=lp.getCloudbaseContext}catch(e){}try{!function(e){try{e.registerComponent(an)}catch(e){console.warn(e)}}(te),function(e){try{e.registerComponent(Rn)}catch(e){console.warn(e)}}(te),zr(te),cp(te),function(e){try{e.registerComponent(Co),e.registerHook(Po)}catch(e){console.warn(e)}}(te),va(te),Oa(te),bc(te),yn(te),Sc(te),Dc(te)}catch(e){}try{window.cloudbase=te}catch(e){}const dp=te})();var __webpack_exports__default=__webpack_exports__.Z;export{__webpack_exports__default as default};
|
|
3
3
|
//# sourceMappingURL=index.node.esm.js.map
|