@cloudbase/js-sdk 3.5.5-beta.2 → 3.6.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.
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see index.node.esm.js.LICENSE.txt */
2
- import*as e from"jwt-decode";import*as t from"@cloudbase/adapter-interface";import*as n from"@cloudbase/signature-nodejs";import*as r from"jsonwebtoken";import*as o from"web-streams-polyfill";import*as i from"ws";import{createRequire as a}from"module";import*as s from"@cloudbase/adapter-wx_mp";import*as c from"@cloudbase/wx-cloud-client-sdk";import*as u from"@mattiasbuelens/web-streams-adapter";import*as l from"text-encoding-shim";import*as p from"bson";var d={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:()=>w,Bh:()=>g,Fy:()=>b,M4:()=>I,R1:()=>_,eX:()=>d,mI:()=>l,n0:()=>f,po:()=>u,tC:()=>p,vS:()=>x});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"],g="https:";function y(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=y(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:g})),"CLOUD_API"===e.endPointKey&&a(null!==(n=e.protocol)&&void 0!==n?n:g)}function x(e,t,n){return y({env:e,endPointKey:t,region:n})}function w(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 I(e,t){void 0===t&&(t="CLOUD_API");var n=x(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={}))},2301:(e,t,n)=>{n.r(t),n.d(t,{E:()=>M,NodeRequest:()=>ue,SYMBOL_CURRENT_ENV:()=>J,SYMBOL_DEFAULT_ENV:()=>Y,TcbError:()=>q,buildAdminUrl:()=>ye,callCompatibleWxOpenApi:()=>Oe,callWxOpenApi:()=>Ee,callWxPayApi:()=>Te,createWebStreamFromNodeReadableStream:()=>D,default:()=>Ve,filterUndefined:()=>B,filterValue:()=>F,getCloudbaseContext:()=>X,getSecretInfo:()=>ne,getServerInjectUrl:()=>ee,getTcbContextConfig:()=>Z,getWxCloudToken:()=>ve,getWxOptions:()=>Ie,isPageModuleName:()=>H,isValidEnvFormat:()=>K,parseContext:()=>Q,parseQueryString:()=>L,processReturn:()=>G,sendWxFormDataRequest:()=>we,sendWxRequest:()=>xe,setThrowOnCode:()=>V,wxCallContainerApi:()=>Ae});var r,o=n(7149),i=n(7147),a=n(1017),s={INVALID_PARAM:{code:"INVALID_PARAM",message:"invalid param"},SYS_ERR:{code:"SYS_ERR",message:"system error"},STORAGE_REQUEST_FAIL:{code:"STORAGE_REQUEST_FAIL",message:"storage request fail"},STORAGE_FILE_NONEXIST:{code:"STORAGE_FILE_NONEXIST",message:"storage file not exist"},TCB_CLS_UNOPEN:{code:"TCB_CLS_UNOPEN",message:"需要先开通日志检索功能"},INVALID_CONTEXT:{code:"INVALID_CONTEXT",message:"无效的context对象,请使用 云函数入口的context参数"}},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])}}},v="http://metadata.tencentyun.com",g="meta-data/app-id";function y(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(v,"/").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 b={appId:void 0};function x(){return f(this,void 0,Promise,(function(){var e;return m(this,(function(t){switch(t.label){case 0:if(void 0!==b.appId)return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,y(g,{timeout:30})];case 2:return e=t.sent(),/^[1-9][0-9]{4,64}$/gim.test(e)?b.appId=e:b.appId="",[3,4];case 3:return t.sent(),[3,4];case 4:return[2,b.appId||""]}}))}))}var w,_,I=(w=function(e,t){return w=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])},w(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}w(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)},S=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=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])}}},T=(_=d.P6).isFormData,A=_.toQueryString;function P(e){return"undefined"!=typeof process&&process.env?void 0!==e?process.env[e]:process.env:void 0!==e?void 0:{}}var R=function(){return"SCF"===P("TENCENTCLOUD_RUNENV")},C=new Set(["formal","pre","test"]);function N(){return S(this,void 0,Promise,(function(){var e;return O(this,(function(t){switch(t.label){case 0:return"true"===P("TENCENTCLOUD")?[2,!0]:[4,x()];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 U(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 D(e){var t=e[Symbol.asyncIterator]();return new h.ReadableStream({pull:function(e){return S(this,void 0,void 0,(function(){var n;return O(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 q=function(e){function t(t){var n=e.call(this,t.message)||this;return n.code=t.code||"",n.message=t.message||"",n.requestId=t.requestId||"",n}return I(t,e),t}(Error);function M(e){return new q(e)}function F(e,t){for(var n in e)e[n]===t&&delete e[n]}function B(e){F(e,void 0)}var W=!0;function V(e){W=e}function G(e){if(!W)return e;throw M(E({},e))}function H(e){return void 0===e&&(e=""),"string"==typeof e&&e.startsWith("$:")}var z=/^[a-z0-9_-]{1,40}$/;function K(e){return void 0===e&&(e=""),"string"==typeof e&&z.test(e)}var J=Symbol.for("SYMBOL_CURRENT_ENV"),Y=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 Q(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){R()&&(P("TENCENTCLOUD_REGION")||console.error("[TCB][ERROR] missing `TENCENTCLOUD_REGION` environment"),P("SCF_NAMESPACE")||console.error("[TCB][ERROR] missing `SCF_NAMESPACE` environment"));var t=P(),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},r={};if(e){var o=Q(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]||P(d)}}catch(e){}}var h=$($({},n),r);return Object.fromEntries(Object.entries(h).filter((function(e){return void 0!==e[1]})))};function Z(){try{var e=X().TCB_CONTEXT_CNFG;return e?JSON.parse(e):{}}catch(e){return console.error("[TCB][ERROR] parse context error: ",e),{}}}function ee(){return Z().URL||""}var te={},ne=function(e){var t,n,o,i,a;te=JSON.parse(JSON.stringify(e||te));var s=P(),c=s.TCB_ENV,u=s.SCF_NAMESPACE,l=s.TENCENTCLOUD_RUNENV,p=s.TENCENTCLOUD_SECRETID,d=s.TENCENTCLOUD_SECRETKEY,h=s.TENCENTCLOUD_SESSIONTOKEN,f=s.CLOUDBASE_APIKEY,m=$($({},te),e),v="";"local"===(v="symbol"!=typeof(null==e?void 0:e.env)&&(null==e?void 0:e.env)?e.env:c||u||"")&&"WX_LOCAL_SCF"===l&&(v="");var g={env:v,secretId:"",secretKey:"",sessionToken:"",accessKey:"",secretType:"",credentials:void 0,context:void 0};if((null==m?void 0:m.context)&&(g.context=m.context),(null==m?void 0:m.credentials)&&(g.credentials=m.credentials),(null==e?void 0:e.accessKey)||(null==m?void 0:m.accessKey))return g.accessKey=(null==e?void 0:e.accessKey)||(null==m?void 0:m.accessKey),g;if((null==m?void 0:m.secretId)&&(null==m?void 0:m.secretKey))return $($({},g),{secretId:m.secretId,secretKey:m.secretKey,sessionToken:h||"",secretType:m.sessionToken?r.SESSION_SECRET:r.SECRET});if((null===(t=null==e?void 0:e.auth)||void 0===t?void 0:t.secretId)&&(null===(n=null==e?void 0:e.auth)||void 0===n?void 0:n.secretKey))return $($({},g),{secretId:e.auth.secretId,secretKey:e.auth.secretKey,sessionToken:h||"",secretType:e.auth.secretType||r.SECRET});if(f)return $($({},g),{accessKey:f});if(p&&d)return $($({},g),{secretId:p,secretKey:d,sessionToken:h||"",secretType:r.SESSION_SECRET});var y=(null==m?void 0:m.context)||(null==e?void 0:e.context);if(null==y?void 0:y.extendedContext){var b=y.extendedContext;return v||(v=b.envId||""),$($({},g),{env:v,secretId:(null===(o=null==b?void 0:b.tmpSecret)||void 0===o?void 0:o.secretId)||"",secretKey:(null===(i=null==b?void 0:b.tmpSecret)||void 0===i?void 0:i.secretKey)||"",sessionToken:(null===(a=null==b?void 0:b.tmpSecret)||void 0===a?void 0:a.token)||""})}return $({},g)},re=n(7922),oe=function(){return oe=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},oe.apply(this,arguments)},ie=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())}))},ae=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])}}},se=null;function ce(){return ie(this,void 0,void 0,(function(){var e;return ae(this,(function(t){switch(t.label){case 0:if(se)return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Promise.resolve().then(n.bind(n,9143))];case 2:return e=t.sent(),se=e.sign,[3,4];case 3:return t.sent(),console.error("缺少依赖 @cloudbase/signature-nodejs,请执行以下命令安装:\n\n npm install @cloudbase/signature-nodejs\n\n该依赖用于 Node 环境下的请求签名。"),[3,4];case 4:return[2,se]}}))}))}var ue=function(){function e(e){var t=this;this.getReqOptions=function(e,n){return ie(t,void 0,void 0,(function(){var t,r,o,i,a,s,l,p,d,h,f,m,v,g,y,b,x,w,_,I,E,T,A,k,j,L,D,q,M,F,B,W,V,G,H;return ae(this,(function(z){switch(z.label){case 0:return t=new URL(e),r=X().TCB_SOURCE,a=(i="".concat((null===(M=null===(q=te.context)||void 0===q?void 0:q.extendedContext)||void 0===M?void 0:M.source)||r||"",",")).concat,[4,S(void 0,void 0,Promise,(function(){return O(this,(function(e){switch(e.label){case 0:return R()?[2,"scf"]:P("CBR_ENV_ID")?[2,"cbr"]:C.has(P("SUMERU_ENV")||"")?[2,"sumeru"]:[4,N()];case 1:return e.sent()?[2,"tencentcloud"]:[2,"unknown"]}}))}))];case 1:return o=a.apply(i,[z.sent()]),n.headers=oe(oe({},n.headers),{"User-Agent":"adapter-node/".concat((null===(F=n.headers)||void 0===F?void 0:F["X-SDK-Version"])||"@cloudbase/js-sdk/".concat((0,re.mI)())),"X-TCB-Source":o,"X-Client-Timestamp":(new Date).valueOf(),"X-TCB-Region":te.region||P("TENCENTCLOUD_REGION")||"",Host:t.host}),!1===n.withCredentials||(null===(W=null===(B=n.headers.Authorization)||void 0===B?void 0:B.replace("Bearer",""))||void 0===W?void 0:W.trim())||t.pathname.startsWith("/auth/")&&t.pathname!==u?[2,n]:(s=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 l=z.sent(),n.headers.Authorization="Bearer ".concat(l),[2,n];case 3:return p=(null===(V=this.config)||void 0===V?void 0:V.auth)||{},d=p.secretId,h=p.secretKey,f=p.sessionToken,m=((null===(G=this.config)||void 0===G?void 0:G.auth)||{}).secretType,v=n.method,g=n.body,y=JSON.parse(JSON.stringify(n.headers)),b=this.isNpmFormData(g),(x=b?g.__plainObj?oe({},g.__plainObj):{}:"object"==typeof g?g:U(g)||{}).envName=(null==x?void 0:x.env)||this.config.env||(null===(H=ne())||void 0===H?void 0:H.env)||"",x.access_token?[2,n]:("get"===v.toLowerCase()&&(x=void 0),d&&h&&"SESSION_SECRET"!==m||(w=ne(),d=w.secretId,h=w.secretKey,f=w.sessionToken),d&&h?(delete y.Authorization,y["content-type"]?y["content-type"]=y["content-type"].toLowerCase():y["Content-Type"]&&(y["Content-Type"]=y["Content-Type"].toLowerCase()),s&&f&&(x.sessionToken=f),_={secretId:d,secretKey:h,method:v,url:e,params:x,headers:y,withSignedParams:s,timestamp:Math.floor((new Date).getTime()/1e3)-1,isCloudApi:!s},y["content-type"]||y["Content-Type"]?[4,ce()]:[2,n]):[2,n]);case 4:return(I=z.sent())?(E=I(_),T=E.authorization,A=E.timestamp,"string"==typeof f&&""!==f?s?(y.Authorization="".concat(T),y["X-Timestamp"]=A,y["X-Signature-Expires"]=600):y.Authorization="".concat(T,", Timestamp=").concat(A,", Token=").concat(f):(y.Authorization="".concat(T,", Timestamp=").concat(A),s&&(y["X-Timestamp"]=A,y["X-Signature-Expires"]=600)),b?(k=g,j=new Set(Object.keys(k.__plainObj||{})),x.envName&&!j.has("envName")&&k.append("envName",x.envName),x.sessionToken&&!j.has("sessionToken")&&k.append("sessionToken",x.sessionToken),L=k.getBuffer(),D=k.getHeaders(),[2,oe(oe({},n),{headers:oe(oe(oe({},y),D),{"content-length":String(L.length)}),body:L})]):[2,oe(oe({},n),{headers:y,body:"object"==typeof x?JSON.stringify(x):x})]):[2,n]}}))}))},this.get=function(e){return t.request(oe(oe({},e),{method:"get"}),t.restrictedMethods.includes("get"))},this.post=function(e){return t.request(oe(oe({},e),{method:"post"}),t.restrictedMethods.includes("post"))},this.put=function(e){return t.request(oe(oe({},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(oe(oe({},e),{data:m,method:f}),t.restrictedMethods.includes("upload"))):t.request(oe(oe({},e),{method:"put",headers:l,body:p}),t.restrictedMethods.includes("upload"))},this.download=function(e){return ie(t,void 0,Promise,(function(){var t,n,r,o,s;return ae(this,(function(c){switch(c.label){case 0:return[4,fetch(e.url,{headers:{},signal:AbortSignal.timeout(this.timeout)})];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 ie(t,void 0,Promise,(function(){var t,n,r,o,i,a,s,c,u,l,p,d,h,f,m,v;return ae(this,(function(g){switch(g.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,oe(oe({},e),{headers:d,body:e.body,signal:l.signal}))];case 1:h=g.sent(),this.applyDuplexIfNeeded(h),g.label=2;case 2:return g.trys.push([2,,8,9]),[4,fetch(s,h)];case 3:return f=g.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=U,[4,f.text()];case 6:m=v.apply(void 0,[g.sent()]),g.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),ie(t,void 0,Promise,(function(){var t,r,i,a,s,c,u,l,p,d,h,f,m,v,g,y,b,x,w,_,I,E,S,O,P,R,C,N,k,L,D,q,M;return ae(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=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),g=v[0],y=v[1],b=T(a)?a:"application/x-www-form-urlencoded"===d["content-type"]?A(null!=a?a:{}):u||(a?JSON.stringify(a):void 0),x=this.getRealUrl((0,o.formatUrl)("https",null!=t?t:"","get"===h?a:{}),e.headers||{},b),[4,this.getReqOptions(x,{method:h,headers:d,body:b,credentials:c?"include":"same-origin",signal:g.signal})];case 1:w=F.sent(),this.applyDuplexIfNeeded(w),F.label=2;case 2:return F.trys.push([2,,19,20]),[4,fetch(x,w)];case 3:_=F.sent(),I={header:{},statusCode:_.status},F.label=4;case 4:return F.trys.push([4,11,,18]),"blob"!==s?[3,6]:(E=I,[4,_.blob()]);case 5:return E.data=F.sent(),[3,10];case 6:return"buffer"!==s?[3,8]:(S=I,P=(O=Buffer).from,[4,_.arrayBuffer()]);case 7:return S.data=P.apply(O,[F.sent()]),[3,10];case 8:return R=I,C=U,[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]:(k=I,[4,_.blob()]);case 12:return k.data=F.sent(),[3,17];case 13:return"buffer"!==s?[3,15]:(L=I,q=(D=Buffer).from,[4,_.arrayBuffer()]);case 14:return L.data=q.apply(D,[F.sent()]),[3,17];case 15:return M=I,[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 I.header[t.toLowerCase()]=e})),[2,I];case 19:return y(),[7];case 20:return[2]}}))}))};var n=e.timeout,r=e.restrictedMethods;this.timeout=n||15e3,this.restrictedMethods=r||["get","post","upload","download"],this.config=e}return e.prototype.getClientCredential=function(e){var t;return ie(this,void 0,Promise,(function(){var n;return ae(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,i,a;if(null===(o=null===(r=t.Authorization)||void 0===r?void 0:r.replace("Bearer",""))||void 0===o?void 0:o.trim())return e;if(("object"==typeof n?n:U(n)||"").access_token)return e;var s=new URL(e);return"/web"===s.pathname&&(null===(i=this.config.auth)||void 0===i?void 0:i.secretId)&&(null===(a=this.config.auth)||void 0===a?void 0:a.secretKey)&&(s.pathname=c),s.toString()},e.prototype.createAbortController=function(e,t,n){var r,o=new AbortController;return n&&(n.aborted?o.abort():n.addEventListener("abort",(function(){return o.abort()}),{once:!0})),(t||e)&&(r=setTimeout((function(){var t="请求在".concat(e/1e3,"s内未完成,已中断");console.warn(t),o.abort(new Error(t))}),e)),[o,function(){return clearTimeout(r)}]},e.prototype.applyDuplexIfNeeded=function(e){var t;e.body&&"function"==typeof(null===(t=e.body)||void 0===t?void 0:t.pipe)&&(e.duplex="half")},e.prototype.isNpmFormData=function(e){return e&&"object"==typeof e&&"function"==typeof e.getHeaders&&"function"==typeof e.getBuffer},e}(),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)},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="/.tencentcloudbase/wx/cloudbase_access_token",fe=6e5,me={token:"",timestamp:0};function ve(){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(me.token&&Date.now()-me.timestamp<fe)return me.token;try{if(("WX_LOCAL_SCF"===process.env.TENCENTCLOUD_RUNENV||"SCF"===process.env.TENCENTCLOUD_RUNENV)&&i.existsSync(he))return me.token=i.readFileSync(he).toString(),me.timestamp=Date.now(),me.token}catch(e){console.warn("[TCB][ERROR]: loadWxCloudbaseAccesstoken error: ",e)}return""}()),s}var ge=0;function ye(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(){ge+=1;var e="".concat(Date.now().toString(16),"_").concat(ge.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 be(e){var t=X(),n=ve(),r=n.wxCloudApiToken,o=n.wxCloudbaseAccesstoken;e.wxCloudApiToken=r,o&&(e.wxCloudbaseAccesstoken=o),e.tcb_sessionToken=t.TCB_SESSIONTOKEN||""}function xe(e,t,n,r){return pe(this,void 0,void 0,(function(){return de(this,(function(o){return be(n),[2,e.requestInstance.send(t,n,{pathname:"web",endPointMode:"GATEWAY"},r?{timeout:r.timeout}:void 0)]}))}))}function we(e,t,r,o){return pe(this,void 0,Promise,(function(){var i,a,s,c,u,l,p,d;return de(this,(function(h){switch(h.label){case 0:be(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=le({action:t},r),a.__plainObj=l,p=ye(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 _e(e,t){if(void 0===t&&(t={}),t.getCrossAccountInfo||e.getCrossAccountInfo)throw M(le(le({},s.INVALID_PARAM),{message:"invalid config: getCrossAccountInfo"}))}function Ie(e,t,n,r){return{requestInstance:r,config:e,scfContext:t,serviceUrl:n}}function Ee(e,t,n){var r=t.apiName,o=t.apiOptions,i=t.cgiName,a=t.requestData;return pe(this,void 0,void 0,(function(){var t,c,u;return de(this,(function(l){switch(l.label){case 0:try{t=a?JSON.stringify(a):""}catch(e){throw M(le(le({},e),{code:s.INVALID_PARAM.code,message:"对象出现了循环引用"}))}return _e(e.config,n),[4,xe(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 Se(e,t,n,r){var o=n.apiName,i=n.apiOptions,a=n.cgiName,s=n.requestData;return pe(this,void 0,void 0,(function(){return de(this,(function(n){return _e(t.config,r),[2,we(t,e,{apiName:o,apiOptions:i,cgiName:a,requestData:s},r)]}))}))}var Oe=function(e,t,n){return Se("wx.openApi",e,t,n)},Te=function(e,t,n){return Se("wx.wxPayApi",e,t,n)},Ae=function(e,t,n){return Se("wx.wxCallContainerApi",e,t,n)},Pe=function(){return Pe=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},Pe.apply(this,arguments)},Re=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])}}},Ne=null;function ke(){var e;return Re(this,void 0,void 0,(function(){var t;return Ce(this,(function(r){switch(r.label){case 0:if(Ne)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Promise.resolve().then(n.bind(n,9617))];case 2:return t=r.sent(),Ne=(null===(e=t.default)||void 0===e?void 0:e.sign)||t.sign,[3,4];case 3:return r.sent(),console.error("缺少依赖 jsonwebtoken,请执行以下命令安装:\n\n npm install jsonwebtoken\n\n该依赖用于 Node 环境下的自定义登录票据生成。"),[3,4];case 4:return[2,Ne]}}))}))}function Ue(){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 je(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 Le=null,De=function(e,t){var n=t;if(e.parseContext=function(e){var t=Q(e);return Le=t,t},e.getCloudbaseContext=function(e){return X(e)},e.auth){var r={getUserInfo:function(){return Ue()},getEndUserInfo:function(n){return Re(this,void 0,Promise,(function(){var r;return Ce(this,(function(o){return r=Ue(),void 0===n?[2,{userInfo:r}]:(k(n),[2,je(e,{uuid:n,envName:t.env}).then((function(e){return e.code?e:{userInfo:Pe(Pe({},r),e.data),requestId:e.requestId}}))])}))}))},createTicket:function(e,n){return void 0===n&&(n={}),Re(this,void 0,Promise,(function(){var r,o,i,a,c,u,l,p,d;return Ce(this,(function(h){switch(h.label){case 0:if(k(e),r=(new Date).getTime(),o=(t.auth||{}).credentials,!(i=t.env))throw Pe(Pe({},s.INVALID_PARAM),{message:"no env in config"});if(!(null==o?void 0:o.env_id))throw Pe(Pe({},s.INVALID_PARAM),{message:"当前私钥未包含env_id 信息, 请前往腾讯云云开发控制台,获取自定义登录最新私钥"});if(o.env_id!==i)throw Pe(Pe({},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,ke()];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 Re(this,void 0,Promise,(function(){var r,o,i;return Ce(this,(function(a){return r=n.uid,o=n.platform,i=n.platformId,[2,je(e,{uuid:r,platform:o,platformId:i,envName:t.env}).then((function(e){return e.code?e:{userInfo:Pe({},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(r){return Re(this,void 0,void 0,(function(){var o;return Ce(this,(function(i){switch(i.label){case 0:return n.accessKey||t.accessKey?[2,n.accessKey||t.accessKey]:(o=e.request.getBaseEndPoint("GATEWAY"),[4,e.request.post({url:"".concat(o).concat("/auth/v1/token/clientCredential"),data:{grant_type:"client_credentials"},headers:{"content-type":"application/json"}},r?{timeout:r.timeout}:void 0)]);case 1:return[2,i.sent().data]}}))}))}},o=e.auth;Object.keys(r).forEach((function(e){o[e]=r[e]})),e.auth=new Proxy(o,{apply:function(e,t,n){var o=Reflect.apply(e,t,n);return o&&"object"==typeof o&&Object.keys(r).forEach((function(e){e in o||(o[e]=r[e])})),o}})}function i(){var t=n.serviceUrl||ee()||void 0;return Ie(n,Le,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 Ee(i(),e,t)},e.callWxPayApi=function(e,t){return Te(i(),e,t)},e.wxCallContainerApi=function(e,t){return Ae(i(),e,t)},e.callCompatibleWxOpenApi=function(e,t){return Oe(i(),e,t)},e.getFileAuthority=function(t,n){var r=t.fileList;return Re(void 0,void 0,void 0,(function(){var t,o,i,a,c,u;return Ce(this,(function(l){switch(l.label){case 0:if(t=X().LOGINTYPE,!Array.isArray(r))throw M(Pe(Pe({},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 M(Pe(Pe({},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 M(Pe(Pe({},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 M(Pe(Pe({},u),{message:"[js-sdk] getCosFileAuthority failed: ".concat(u.code)}));return[2,u]}}))}))},e.callApis=function(t,n){return Re(void 0,void 0,void 0,(function(){var r,o,i,a,s,c,u,l,p,d,h,f;return Ce(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")}))}))}},qe=function(){return qe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},qe.apply(this,arguments)},Me=null;function Fe(){if(!Me)try{Me=n(9814)}catch(e){console.error("缺少依赖 ws,请执行以下命令安装:\n\n npm install ws\n\n该依赖用于 Node 环境下的 WebSocket 连接。")}return Me}var Be,We=(Be=new Map,{mode:"sync",setItem:function(e,t){Be.set(e,t)},getItem:function(e){return Be.get(e)},removeItem:function(e){Be.delete(e)},clear:function(){Be.clear()}});const Ve={genAdapter:function(e){return{nodeTool:De,getSecretInfo:ne,root:{globalThis:{}},reqClass:ue,wsClass:Fe(),sessionStorage:We,localStorage:We,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",qe(qe({},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"}},3171:(e,t,n)=>{var r;if(n.r(t),n.d(t,{getEncryptInfo:()=>M}),!globalThis.IS_MP_BUILD){var o="undefined"!=typeof globalThis?globalThis.navigator:window.globalThis,i="0123456789abcdefghijklmnopqrstuvwxyz";function F(e){return i.charAt(e)}function B(e,t){return e&t}function W(e,t){return e|t}function V(e,t){return e^t}function G(e,t){return e&~t}function H(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 z(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function K(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=a.charAt(n>>6)+a.charAt(63&n);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=a.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=a.charAt(n>>2)+a.charAt((3&n)<<4));(3&r.length)>0;)r+="=";return r}function J(e){var t,n="",r=0,o=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t){var i=a.indexOf(e.charAt(t));i<0||(0==r?(n+=F(i>>2),o=3&i,r=1):1==r?(n+=F(o<<2|i>>4),o=15&i,r=2):2==r?(n+=F(o),n+=F(i>>2),o=3&i,r=3):(n+=F(o<<2|i>>4),n+=F(15&i),r=0))}return 1==r&&(n+=F(o<<2)),n}var s,c,u={decode:function(e){var t;if(void 0===s){var n="0123456789ABCDEF";for(s={},t=0;t<16;++t)s[n.charAt(t)]=t;for(n=n.toLowerCase(),t=10;t<16;++t)s[n.charAt(t)]=t;for(t=0;t<8;++t)s[" \f\n\r\t \u2028\u2029".charAt(t)]=-1}var r=[],o=0,i=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if("="==a)break;if(-1!=(a=s[a])){if(void 0===a)throw new Error("Illegal character at offset "+t);o|=a,++i>=2?(r[r.length]=o,o=0,i=0):o<<=4}}if(i)throw new Error("Hex encoding incomplete: 4 bits missing");return r}},l={decode:function(e){var t;if(void 0===c){for(c=Object.create(null),t=0;t<64;++t)c["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(t=0;t<9;++t)c["= \f\n\r\t \u2028\u2029".charAt(t)]=-1}var n=[],r=0,o=0;for(t=0;t<e.length;++t){var i=e.charAt(t);if("="==i)break;if(-1!=(i=c[i])){if(void 0===i)throw new Error("Illegal character at offset "+t);r|=i,++o>=4?(n[n.length]=r>>16,n[n.length]=r>>8&255,n[n.length]=255&r,r=0,o=0):r<<=6}}switch(o){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=r>>10;break;case 3:n[n.length]=r>>16,n[n.length]=r>>8&255}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(e){var t=l.re.exec(e);if(t)if(t[1])e=t[1];else{if(!t[2])throw new Error("RegExp out of sync");e=t[2]}return l.decode(e)}},p=1e13;class Y{constructor(e){this.buf=[+e||0]}mulAdd(e,t){var n,r,o=this.buf,i=o.length;for(n=0;n<i;++n)(r=o[n]*e+t)<p?t=0:r-=(t=0|r/p)*p,o[n]=r;t>0&&(o[n]=t)}sub(e){var t,n,r=this.buf,o=r.length;for(t=0;t<o;++t)(n=r[t]-e)<0?(n+=p,e=1):e=0,r[t]=n;for(;0===r[r.length-1];)r.pop()}toString(e){if(10!=(e||10))throw new Error("only base 10 is supported");for(var t=this.buf,n=t[t.length-1].toString(),r=t.length-2;r>=0;--r)n+=(p+t[r]).toString().substring(1);return n}valueOf(){for(var e=this.buf,t=0,n=e.length-1;n>=0;--n)t=t*p+e[n];return t}simplify(){var e=this.buf;return 1==e.length?e[0]:this}}var d,h=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,f=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function $(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}class Q{constructor(e,t){this.hexDigits="0123456789ABCDEF",e instanceof Q?(this.enc=e.enc,this.pos=e.pos):(this.enc=e,this.pos=t)}get(e){if(void 0===e&&(e=this.pos++),e>=this.enc.length)throw new Error("Requesting byte offset "+e+" on a stream of length "+this.enc.length);return"string"==typeof this.enc?this.enc.charCodeAt(e):this.enc[e]}hexByte(e){return this.hexDigits.charAt(e>>4&15)+this.hexDigits.charAt(15&e)}hexDump(e,t,n){for(var r="",o=e;o<t;++o)if(r+=this.hexByte(this.get(o)),!0!==n)switch(15&o){case 7:r+=" ";break;case 15:r+="\n";break;default:r+=" "}return r}isASCII(e,t){for(var n=e;n<t;++n){var r=this.get(n);if(r<32||r>176)return!1}return!0}parseStringISO(e,t){for(var n="",r=e;r<t;++r)n+=String.fromCharCode(this.get(r));return n}parseStringUTF(e,t){for(var n="",r=e;r<t;){var o=this.get(r++);n+=o<128?String.fromCharCode(o):o>191&&o<224?String.fromCharCode((31&o)<<6|63&this.get(r++)):String.fromCharCode((15&o)<<12|(63&this.get(r++))<<6|63&this.get(r++))}return n}parseStringBMP(e,t){for(var n,r,o="",i=e;i<t;)n=this.get(i++),r=this.get(i++),o+=String.fromCharCode(n<<8|r);return o}parseTime(e,t,n){var r=this.parseStringISO(e,t),o=(n?h:f).exec(r);return o?(n&&(o[1]=+o[1],o[1]+=+o[1]<70?2e3:1900),r=o[1]+"-"+o[2]+"-"+o[3]+" "+o[4],o[5]&&(r+=":"+o[5],o[6]&&(r+=":"+o[6],o[7]&&(r+="."+o[7]))),o[8]&&(r+=" UTC","Z"!=o[8]&&(r+=o[8],o[9]&&(r+=":"+o[9]))),r):"Unrecognized time: "+r}parseInteger(e,t){for(var n,r=this.get(e),o=r>127,i=o?255:0,a="";r==i&&++e<t;)r=this.get(e);if(0==(n=t-e))return o?-1:0;if(n>4){for(a=r,n<<=3;!(128&(+a^i));)a=+a<<1,--n;a="("+n+" bit)\n"}o&&(r-=256);for(var s=new Y(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 Y,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 Y)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 Y,i=0}}return i>0&&(r+=".incomplete"),r}}class X{constructor(e,t,n,r,o){if(!(r instanceof Z))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 Q?e:new Q(e,0);var n=new Q(t),r=new Z(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 Z{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 Y;do{t=e.get(),n.mulAdd(128,127&t)}while(128&t);this.tagNumber=n.simplify()}}isUniversal(){return 0===this.tagClass}isEOC(){return 0===this.tagClass&&0===this.tagNumber}}var m=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],v=(1<<26)/m[m.length-1];class ee{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=F(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+=F(n));return o?i:"0"}negate(){var e=te();return ee.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)+ce(this[this.t-1]^this.s&this.DM)}mod(e){var t=te();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(ee.ZERO)>0&&e.subTo(t,t),t}modPowInt(e,t){var n;return n=e<256||t.isEven()?new y(t):new b(t),this.exp(e,n)}clone(){var e=te();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=te();return this.bitwiseTo(e,B,t),t}or(e){var t=te();return this.bitwiseTo(e,W,t),t}xor(e){var t=te();return this.bitwiseTo(e,V,t),t}andNot(e){var t=te();return this.bitwiseTo(e,G,t),t}not(){for(var e=te(),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=te();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}shiftRight(e){var t=te();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+H(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+=z(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,W)}clearBit(e){return this.changeBit(e,G)}flipBit(e){return this.changeBit(e,V)}add(e){var t=te();return this.addTo(e,t),t}subtract(e){var t=te();return this.subTo(e,t),t}multiply(e){var t=te();return this.multiplyTo(e,t),t}divide(e){var t=te();return this.divRemTo(e,t,null),t}remainder(e){var t=te();return this.divRemTo(e,null,t),t}divideAndRemainder(e){var t=te(),n=te();return this.divRemTo(e,t,n),[t,n]}modPow(e,t){var n,r,o=e.bitLength(),i=se(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 x(t):new b(t);var a=[],s=3,c=n-1,u=(1<<n)-1;if(a[1]=r.convert(this),n>1){var l=te();for(r.sqrTo(a[1],l);s<=u;)a[s]=te(),r.mulTo(l,a[s-2],a[s]),s+=2}var p,d,h=e.t-1,f=!0,m=te();for(o=ce(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 ee.ZERO;for(var n=e.clone(),r=this.clone(),o=se(1),i=se(0),a=se(0),s=se(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(ee.ONE)?ee.ZERO:s.compareTo(e)>=0?s.subtract(e):s.signum()<0?(s.addTo(e,s),s.signum()<0?s.add(e):s):s}pow(e){return this.exp(e,new g)}gcd(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var o=t.getLowestSetBit(),i=n.getLowestSetBit();if(i<0)return t;for(o<i&&(i=o),i>0&&(t.rShiftTo(i,t),n.rShiftTo(i,n));t.signum()>0;)(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return i>0&&n.lShiftTo(i,n),n}isProbablePrime(e){var t,n=this.abs();if(1==n.t&&n[0]<=m[m.length-1]){for(t=0;t<m.length;++t)if(n[0]==m[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<m.length;){for(var r=m[t],o=t+1;o<m.length&&r<v;)r*=m[o++];for(r=n.modInt(r);t<o;)if(r%m[t++]==0)return!1}return n.millerRabin(e)}copyTo(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}fromInt(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}fromString(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(256==t)n=8;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)return void this.fromRadix(e,t);n=2}this.t=0,this.s=0;for(var r=e.length,o=!1,i=0;--r>=0;){var a=8==n?255&+e[r]:ae(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&&ee.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&&ee.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=te());var i=te(),a=this.s,s=e.s,c=this.DB-ce(r[r.t-1]);c>0?(r.lShiftTo(c,i),o.lShiftTo(c,n)):(r.copyTo(i),o.copyTo(n));var u=i.t,l=i[u-1];if(0!=l){var p=l*(1<<this.F1)+(u>1?i[u-2]>>this.F2:0),d=this.FV/p,h=(1<<this.F1)/p,f=1<<this.F2,m=n.t,v=m-u,g=null==t?te():t;for(i.dlShiftTo(v,g),n.compareTo(g)>=0&&(n[n.t++]=1,n.subTo(g,n)),ee.ONE.dlShiftTo(u,g),g.subTo(i,i);i.t<u;)i[i.t++]=0;for(;--v>=0;){var y=n[--m]==l?this.DM:Math.floor(n[m]*d+(n[m-1]+f)*h);if((n[m]+=i.am(0,y,n,v,0,u))<y)for(i.dlShiftTo(v,g),n.subTo(g,n);n[m]<--y;)n.subTo(g,n)}null!=t&&(n.drShiftTo(u,t),a!=s&&ee.ZERO.subTo(t,t)),n.t=u,n.clamp(),c>0&&n.rShiftTo(c,n),a<0&&ee.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 ee.ONE;var n=te(),r=te(),o=t.convert(this),i=ce(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=se(n),o=te(),i=te(),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=ae(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&&ee.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(ee.ONE.shiftLeft(e-1),W,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(ee.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=ee.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(ee.ONE),n=t.getLowestSetBit();if(n<=0)return!1;var r=t.shiftRight(n);(e=e+1>>1)>m.length&&(e=m.length);for(var o=te(),i=0;i<e;++i){o.fromInt(m[Math.floor(Math.random()*m.length)]);var a=o.modPow(r,this);if(0!=a.compareTo(ee.ONE)&&0!=a.compareTo(t)){for(var s=1;s++<n&&0!=a.compareTo(t);)if(0==(a=a.modPowInt(2,this)).compareTo(ee.ONE))return!1;if(0!=a.compareTo(t))return!1}}return!0}square(){var e=te();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(ee.ONE.shiftLeft(e-1),W,this),this.isEven()&&this.dAddOffset(1,0);var o=this,i=function(){o.dAddOffset(2,0),o.bitLength()>e&&o.subTo(ee.ONE.shiftLeft(e-1),o),o.isProbablePrime(t)?setTimeout((function(){r()}),0):setTimeout(i,0)};setTimeout(i,0)}else{var a=[],s=7&e;a.length=1+(e>>3),t.nextBytes(a),s>0?a[0]&=(1<<s)-1:a[0]=0,this.fromString(a,256)}}}var g=function(){function e(){}return e.prototype.convert=function(e){return e},e.prototype.revert=function(e){return e},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n)},e.prototype.sqrTo=function(e,t){e.squareTo(t)},e}(),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}(),b=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=te();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(ee.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=te();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}(),x=function(){function e(e){this.m=e,this.r2=te(),this.q3=te(),ee.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=te();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 te(){return new ee(null)}function ne(e,t){return new ee(e,t)}function re(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 oe(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 ie(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)?(ee.prototype.am=oe,d=30):"Netscape"!=(null==o?void 0:o.appName)?(ee.prototype.am=re,d=26):(ee.prototype.am=ie,d=28),ee.prototype.DB=d,ee.prototype.DM=(1<<d)-1,ee.prototype.DV=1<<d,ee.prototype.FV=Math.pow(2,52),ee.prototype.F1=52-d,ee.prototype.F2=2*d-52;var w,_,I=[];for(w="0".charCodeAt(0),_=0;_<=9;++_)I[w++]=_;for(w="a".charCodeAt(0),_=10;_<36;++_)I[w++]=_;for(w="A".charCodeAt(0),_=10;_<36;++_)I[w++]=_;function ae(e,t){var n=I[e.charCodeAt(t)];return null==n?-1:n}function se(e){var t=te();return t.fromInt(e),t}function ce(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}ee.ZERO=se(0),ee.ONE=se(1);class ue{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,S,O=null;if(null==O){O=[],S=0;var T,A,P=void 0;if("undefined"!=typeof window&&null!==(T=window)&&void 0!==T&&T.crypto&&null!==(A=window)&&void 0!==A&&A.crypto.getRandomValues){var R,C=new Uint32Array(256);for(null===(R=window)||void 0===R||R.crypto.getRandomValues(C),P=0;P<C.length;++P)O[S++]=255&C[P]}var N,k,U,j=function(e){var t,n,r;if(this.count=this.count||0,this.count>=256||S>=256){if("undefined"!=typeof window)if(null!==(t=window)&&void 0!==t&&t.removeEventListener)null===(r=window)||void 0===r||r.removeEventListener("mousemove",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;O[S++]=255&i,this.count+=1}catch(e){}};if("undefined"!=typeof window)if(null!==(N=window)&&void 0!==N&&N.addEventListener)null===(U=window)||void 0===U||U.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 le(){if(null==E){for(E=new ue;S<256;){var e=Math.floor(65536*Math.random());O[S++]=255&e}for(E.init(O),S=0;S<O.length;++S)O[S]=0;S=0}return E.next()}class pe{constructor(){}nextBytes(e){for(var t=0;t<e.length;++t)e[t]=le()}}function de(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 pe,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 ee(n)}class he{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=ne(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")}encrypt(e){var t=de(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})),K(r)):K(this.encrypt(e))}catch(e){return!1}}decryptLong(e){var t=this,n=this.n.bitLength()+7>>3;e=J(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=ne(e,16),this.e=parseInt(t,16),this.d=ne(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=ne(e,16),this.e=parseInt(t,16),this.d=ne(n,16),this.p=ne(r,16),this.q=ne(o,16),this.dmp1=ne(i,16),this.dmq1=ne(a,16),this.coeff=ne(s,16)):console.error("Invalid RSA private key")}generate(e,t){var n=new pe,r=e>>1;this.e=parseInt(t,16);for(var o=new ee(t,16);;){for(;this.p=new ee(e-r,1,n),0!=this.p.subtract(ee.ONE).gcd(o).compareTo(ee.ONE)||!this.p.isProbablePrime(10););for(;this.q=new ee(r,1,n),0!=this.q.subtract(ee.ONE).gcd(o).compareTo(ee.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(ee.ONE),s=this.q.subtract(ee.ONE),c=a.multiply(s);if(0==c.gcd(o).compareTo(ee.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=ne(e,16),n=this.doPrivate(t);return null==n?null:fe(n,this.n.bitLength()+7>>3)}generateAsync(e,t,n){var r=new pe,o=e>>1;this.e=parseInt(t,16);var i=new ee(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(ee.ONE),r=a.q.subtract(ee.ONE),o=t.multiply(r);0==o.gcd(i).compareTo(ee.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=te(),a.q.fromNumberAsync(o,1,r,(function(){a.q.subtract(ee.ONE).gcda(i,(function(e){0==e.compareTo(ee.ONE)&&a.q.isProbablePrime(10)?setTimeout(t,0):setTimeout(c,0)}))}))},u=()=>{a.p=te(),a.p.fromNumberAsync(e-o,1,r,(function(){a.p.subtract(ee.ONE).gcda(i,(function(e){0==e.compareTo(ee.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 me extends he{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";super(),e&&("string"==typeof e?this.parseKey(e):(this.hasPrivateKeyProperty(e)||this.hasPublicKeyProperty(e))&&this.parsePropertiesFrom(e))}parseKey(e){try{var t=0,n=0,r=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(e)?u.decode(e):l.unarmor(e),o=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=ne(t,16),n=o.sub[2].getHexStringValue(),this.e=parseInt(n,16);var i=o.sub[3].getHexStringValue();this.d=ne(i,16);var a=o.sub[4].getHexStringValue();this.p=ne(a,16);var s=o.sub[5].getHexStringValue();this.q=ne(s,16);var c=o.sub[6].getHexStringValue();this.dmp1=ne(c,16);var p=o.sub[7].getHexStringValue();this.dmq1=ne(p,16);var d=o.sub[8].getHexStringValue();this.coeff=ne(d,16)}else{if(2!==o.sub.length)return!1;var h=o.sub[1].sub[0];t=h.sub[0].getHexStringValue(),this.n=ne(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 me(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(J(e))}catch(e){return!1}},r.prototype.encrypt=function(e){try{return K(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 me,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 D=r;var q=n(2631),M=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,q.I)(i),s=new D;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:(t,n,r)=>{r.d(n,{j$:()=>a,Fs:()=>s,_G:()=>o,U3:()=>c,BM:()=>l,RR:()=>u,P6:()=>i});var o={};r.r(o),r.d(o,{vM:()=>g,Sg:()=>y,Fk:()=>v,eX:()=>h,pM:()=>m,tC:()=>d});var i={};r.r(i),r.d(i,{createPromiseCallback:()=>j,execCallback:()=>L,formatUrl:()=>R,genSeqId:()=>A,generateRequestId:()=>P,getHash:()=>k,getQuery:()=>N,isArray:()=>w,isFormData:()=>T,isInstanceOf:()=>O,isNull:()=>S,isPalinObject:()=>E,isString:()=>_,isUndefined:()=>I,parseCaptcha:()=>H,parseQueryString:()=>G,printError:()=>q,printGroupLog:()=>B,printInfo:()=>M,printWarn:()=>D,removeParam:()=>U,sleep:()=>W,throwError:()=>F,toQueryString:()=>C,transformPhone:()=>V});var a={};r.r(a),r.d(a,{Fk:()=>ee,xY:()=>te});var s={};r.r(s),r.d(s,{q:()=>ae});var c={};r.r(c),r.d(c,{yE:()=>le});var u={};r.r(u),r.d(u,{P:()=>de,$:()=>pe});var l={};r.r(l),r.d(l,{D:()=>ye});var p="@cloudbase/js-sdk";function d(e){p=e}function h(){return p}var f="https:";function m(e){f=e}var v=("undefined"==typeof process||process.env,!1),g="https://support.qq.com/products/148793",y={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=r(7149),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 w(e){return"[object Array]"===Object.prototype.toString.call(e)}function _(e){return"string"==typeof e}function I(e){return void 0===e}function E(e){return"[object Object]"===Object.prototype.toString.call(e)}function S(e){return"[object Null]"===Object.prototype.toString.call(e)}function O(e,t){return e instanceof t}function T(e){return"[object FormData]"===Object.prototype.toString.call(e)}function A(){return Math.random().toString(16).slice(2)}function P(){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 R(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 C(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 N(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 k=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 j(){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 L(e,t,n){if(void 0===n&&(n=null),e&&"function"==typeof e)return e(t,n);if(t)throw t;return n}function D(e,t){console.warn("[".concat(h(),"][").concat(e,"]:").concat(t))}function q(e,t){console.error({code:e,msg:"[".concat(h(),"][").concat(e,"]:").concat(t)})}function M(e,t){console.log("[".concat(h(),"][").concat(e,"]:").concat(t))}function F(e,t){throw new Error(JSON.stringify({code:e,msg:"[".concat(h(),"][").concat(e,"]:").concat(t)}))}function B(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 W=function(e){return void 0===e&&(e=0),new Promise((function(t){return setTimeout(t,e)}))};function V(e){return"+86".concat(e)}var G=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 H(e){var t={},n=e.match(/^(data:.*?)(\?[^#\s]*)?$/);if(n){e=n[1];var r=n[2];r&&(t=G(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 z,K,J=(z=function(e,t){return z=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])},z(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}z(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),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,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())}))},Q=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])}}},X=function(e){function t(t){var n=e.call(this)||this,r=t.timeout,o=t.timeoutMsg,i=t.restrictedMethods;return n.timeout=r||0,n.timeoutMsg=o||"请求超时",n.restrictedMethods=i||["get","post","upload","download"],n}return J(t,e),t.prototype.get=function(e){return this.request(Y(Y({},e),{method:"get"}),this.restrictedMethods.includes("get"))},t.prototype.post=function(e){return this.request(Y(Y({},e),{method:"post"}),this.restrictedMethods.includes("post"))},t.prototype.put=function(e){return this.request(Y(Y({},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(Y(Y({},e),{data:c,method:s}),this.restrictedMethods.includes("upload"))):this.request(Y(Y({},e),{method:"put",headers:a,body:n}),this.restrictedMethods.includes("upload"))},t.prototype.download=function(e){return $(this,void 0,Promise,(function(){var t,n,r,o;return Q(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.get(Y(Y({},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 $(this,void 0,Promise,(function(){var n,r,o,i,a,s,c,u,l,p,d,h,f,m=this;return Q(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,Y(Y({},e),{signal:n.signal})).then((function(e){return $(m,void 0,void 0,(function(){var t,n,r;return Q(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,h=R(f,i,"get"===r?c:{}),m=new XMLHttpRequest;m.open(r,h),u&&(m.responseType=u);var v,g,y=e.signal;y&&(y.aborted?m.abort():y.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)),g=T(c)?c:"application/x-www-form-urlencoded"===s["content-type"]?C(c):p||(c?JSON.stringify(c):void 0),l&&(m.withCredentials=!0),m.send(g)}))},t}(b.AbstractSDKRequest),Z=function(){return Z=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},Z.apply(this,arguments)};function ee(e,t){for(var n=0,r=w(e)?e:[e];n<r.length;n++){var o=r[n],i=o.isMatch,a=o.genAdapter,s=o.runtime;if(i())return{adapter:Z({isMatch:i},a(t)),runtime:s}}}function te(){return{adapter:Z({},{type:"default",root:window,reqClass:X,wsClass:WebSocket,localStorage}),runtime:K.WEB}}!function(e){e.WEB="web",e.WX_MP="wx_mp"}(K||(K={}));var 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(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])}}},ie=function(e){function t(t){var n=e.call(this)||this;return n.root=t,t.tcbCacheObject||(t.tcbCacheObject={}),n}return ne(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),ae=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:(D(y.INVALID_PARAMS,"localStorage is not supported on current platform"),new ie(t.root));case"none":return new ie(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:y.OPERATION_FAIL,msg:"[".concat(h(),"][").concat(y.OPERATION_FAIL,"]setStore failed"),info:e}))}}else D(y.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},e.prototype.setStoreAsync=function(e,t,n){return re(this,void 0,void 0,(function(){var r;return oe(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:""}D(y.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},e.prototype.getStoreAsync=function(e,t){var n;return re(this,void 0,void 0,(function(){var r;return oe(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):D(y.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},e.prototype.removeStoreAsync=function(e){return re(this,void 0,void 0,(function(){return oe(this,(function(t){switch(t.label){case 0:return[4,this.storage.removeItem(e)];case 1:return t.sent(),[2]}}))}))},e}(),se=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)}}(),ce=function(e,t){this.data=t||null,this.name=e},ue=function(e){function t(t,n){var r=e.call(this,"error",{error:t,data:n})||this;return r.error=t,r}return se(t,e),t}(ce),le=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(O(e,ue))return console.error(e.error),this;var n=_(e)?new ce(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 le;var pe=new le,de="lang_change",he=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())}))},fe=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=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(me=-1!==navigator.userAgent.indexOf("Firefox"));var ve=me?/(\.js\/)?__decorate(\$\d+)?<@.*\d$/:/(\/\w+\.js\.)?__decorate(\$\d+)?\s*\(.*\)$/,ge=/https?:\/\/.+:\d*\/.*\.js:\d+:\d+/;function ye(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 ve.test(e)}));if(-1!==n){var r=ge.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=be({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}}))),B(h),r}}:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return he(this,void 0,void 0,(function(){var t,n,r,o,p,d,h,f;return fe(this,(function(m){switch(m.label){case 0:t=be({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}}))),B(h),r;case 4:return[2]}}))}))}}}}function be(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=me?/^catchErrorsDecorator\/<\/descriptor.value@.*\d$/:new RegExp("".concat(n,"\\.descriptor.value\\s*\\[as\\s").concat(r,"\\]\\s*\\(.*\\)$")),c=me?/^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(ge,o)),(i=new Error).stack="".concat(me?"@debugger":"Error","\n").concat(l.join("\n"))}return i}xe={default:()=>e.default},we={},r.d(we,xe);var xe,we},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,g,y=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(y.timeoutMsg),n.abort(new Error(y.timeoutMsg))}),m)),[4,fetch(r,i(i({},e),{signal:n.signal})).then((function(e){return a(y,void 0,void 0,(function(){var t,n,r;return s(this,(function(o){switch(o.label){case 0:return clearTimeout(v),f?e.ok?(t=e,[3,3]):[3,1]:[3,4];case 1:return r=(n=Promise).reject,[4,e.json()];case 2:t=r.apply(n,[o.sent()]),o.label=3;case 3:return[2,t];case 4:return[2,e]}}))}))})).catch((function(e){return clearTimeout(v),Promise.reject(e)}))];case 1:return g=b.sent(),[2,{data:l?g.body:(null===(t=g.headers.get("content-type"))||void 0===t?void 0:t.includes("application/json"))?g.json():g.text(),statusCode:g.status,header:g.headers,response:g}]}}))}))},t.prototype.request=function(e,t){var n=this;void 0===t&&(t=!1);var r=String(e.method).toLowerCase()||"get";return new Promise((function(o){var i=e.url,a=e.headers,s=void 0===a?{}:a,c=e.data,p=e.responseType,d=e.withCredentials,h=e.body,f=e.onUploadProgress,m=(0,u.formatUrl)((0,l.getProtocol)(),i,"get"===r?c:{}),v=new XMLHttpRequest;v.open(r,m),p&&(v.responseType=p);var g,y,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(g),o(e)}},t&&n.timeout&&(g=setTimeout((function(){console.warn(n.timeoutMsg),v.abort()}),n.timeout)),y=(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(y)}))},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,g=function(){var e="",t=(new Error).stack.split("\n"),n=t.findIndex((function(e){return c.test(e)}));if(-1!==n){var r=u.exec(t[n+1]||"");e=r?r[0]:""}return e}();s.value="sync"===n?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=l({err:new Error,className:h,methodName:m,sourceLink:g});try{return v.apply(this,e)}catch(e){var r=e,o=e.message,a=e.error,s=e.error_description,c={title:d||"".concat(h,".").concat(m," failed"),content:[{type:"error",body:e}]};if(o&&/^\{.*\}$/.test(o)){var u=JSON.parse(o);c.subtitle=o,u.code&&(n?(n.code=u.code,n.msg=u.msg):(e.code=u.code,e.message=u.msg),r=n||e,c.content=f.map((function(e){return{type:"info",body:e}})))}throw a&&s&&(c.subtitle=s,n?(n.code=a,n.msg=s):(e.code=a,e.message=s),r=n||e,c.content=f.map((function(e){return{type:"info",body:e}}))),(0,i.printGroupLog)(c),r}}:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r(this,void 0,void 0,(function(){var t,n,r,a,s,c,u,p;return o(this,(function(o){switch(o.label){case 0:t=l({err:new Error,className:h,methodName:m,sourceLink:g}),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,v.apply(this,e)];case 2:return[2,o.sent()];case 3:throw n=o.sent(),r=n,a=n.message,s=n.error,c=n.error_description,u={title:d||"".concat(h,".").concat(m," failed"),content:[{type:"error",body:n}]},a&&/^\{.*\}$/.test(a)&&(p=JSON.parse(a),u.subtitle=p,p.code&&(t?(t.code=p.code,t.message=p.msg):(n.code=p.code,n.message=p.msg),r=t||n,u.content=f.map((function(e){return{type:"info",body:e}})))),s&&c&&(u.subtitle=c,t?(t.code=s,t.msg=c):(n.code=s,n.message=c),r=t||n,u.content=f.map((function(e){return{type:"info",body:e}}))),(0,i.printGroupLog)(u),r;case 4:return[2]}}))}))}}}}},141:function(e,t,n){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=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.parseCaptcha=t.parseQueryString=t.transformPhone=t.sleep=t.printGroupLog=t.throwError=t.printInfo=t.printError=t.printWarn=t.execCallback=t.createPromiseCallback=t.removeParam=t.getHash=t.getQuery=t.toQueryString=t.formatUrl=t.generateRequestId=t.genSeqId=t.isFormData=t.isInstanceOf=t.isNull=t.isPalinObject=t.isUndefined=t.isString=t.isArray=void 0;var o=n(794);t.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},t.isString=function(e){return"string"==typeof e},t.isUndefined=function(e){return void 0===e},t.isPalinObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},t.isNull=function(e){return"[object Null]"===Object.prototype.toString.call(e)},t.isInstanceOf=function(e,t){return e instanceof t},t.isFormData=function(e){return"[object FormData]"===Object.prototype.toString.call(e)},t.genSeqId=function(){return Math.random().toString(16).slice(2)},t.generateRequestId=function(){var e=(new Date).getTime(),t=(null===Date||void 0===Date?void 0:Date.now)&&1e3*Date.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(n){var r=16*Math.random();return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),("x"===n?r:7&r|8).toString(16)}))},t.formatUrl=function(e,t,n){void 0===n&&(n={});var r=/\?/.test(t),o="";return Object.keys(n).forEach((function(e){""===o?!r&&(t+="?"):o+="&",o+="".concat(e,"=").concat(encodeURIComponent(n[e]))})),/^http(s)?:\/\//.test(t+=o)?t:"".concat(e).concat(t)},t.toQueryString=function(e){void 0===e&&(e={});var t=[];return Object.keys(e).forEach((function(n){t.push("".concat(n,"=").concat(encodeURIComponent(e[n])))})),t.join("&")},t.getQuery=function(e,t){if("undefined"==typeof window)return!1;var n=t||decodeURIComponent(window.location.search),r=new RegExp("(^|&)".concat(e,"=([^&]*)(&|$)")),o=n.substr(n.indexOf("?")+1).match(r);return null!=o?o[2]:""},t.getHash=function(e){if("undefined"==typeof window)return"";var t=window.location.hash.match(new RegExp("[#?&/]".concat(e,"=([^&#]*)")));return t?t[1]:""},t.removeParam=function(e,t){var n=t.split("?")[0],r=[],o=-1!==t.indexOf("?")?t.split("?")[1]:"";if(""!==o){for(var i=(r=o.split("&")).length-1;i>=0;i-=1)r[i].split("=")[0]===e&&r.splice(i,1);n="".concat(n,"?").concat(r.join("&"))}return n},t.createPromiseCallback=function(){var e={};if(!Promise){(e=function(){}).promise={};var t=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}var n=new Promise((function(t,n){e=function(e,r){return e?n(e):t(r)}}));return e.promise=n,e},t.execCallback=function(e,t,n){if(void 0===n&&(n=null),e&&"function"==typeof e)return e(t,n);if(t)throw t;return n},t.printWarn=function(e,t){console.warn("[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t))},t.printError=function(e,t){console.error({code:e,msg:"[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t)})},t.printInfo=function(e,t){console.log("[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t))},t.throwError=function(e,t){throw new Error(JSON.stringify({code:e,msg:"[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t)}))},t.printGroupLog=function(e){var t,n=e.title,r=e.subtitle,o=void 0===r?"":r,i=e.content,a=void 0===i?[]:i,s=e.printTrace,c=void 0!==s&&s,u=e.collapsed;void 0!==u&&u?(console.groupCollapsed||console.error)(n,o):(console.group||console.error)(n,o);for(var l=0,p=a;l<p.length;l++){var d=p[l],h=d.type,f=d.body;switch(h){case"info":console.log(f);break;case"warn":console.warn(f);break;case"error":console.error(f)}}c&&(console.trace||console.log)("stack trace:"),null===(t=console.groupEnd)||void 0===t||t.call(console)},t.sleep=function(e){return void 0===e&&(e=0),new Promise((function(t){return setTimeout(t,e)}))},t.transformPhone=function(e){return"+86".concat(e)},t.parseQueryString=function(e){e=e.replace(/^\?/,"");var t={};return e.split("&").forEach((function(e){var n=e.split("="),r=n[0],o=n[1];r=decodeURIComponent(r),o=decodeURIComponent(o),r&&(t[r]?Array.isArray(t[r])?t[r].push(o):t[r]=[t[r],o]:t[r]=o)})),t},t.parseCaptcha=function(e){var n={},o=e.match(/^(data:.*?)(\?[^#\s]*)?$/);if(o){e=o[1];var i=o[2];i&&(n=(0,t.parseQueryString)(i))}var a=n.token,s=r(n,["token"]);return/^data:/.test(e)&&!a?{error:"invalid_argument",error_description:"invalid captcha data: ".concat(e)}:a?{state:s.state,token:a,captchaData:e}:{error:"unimplemented",error_description:"need to impl captcha data"}}},6160:(e,t,n)=>{var r=n(3837),o=n(2781).Stream,i=n(8178);function a(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}e.exports=a,r.inherits(a,o),a.create=function(e){var t=new this;for(var n in e=e||{})t[n]=e[n];return t},a.isStreamLike=function(e){return"function"!=typeof e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&!Buffer.isBuffer(e)},a.prototype.append=function(e){if(a.isStreamLike(e)){if(!(e instanceof i)){var t=i.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=t}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this},a.prototype.pipe=function(e,t){return o.prototype.pipe.call(this,e,t),this.resume(),e},a.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop)this._pendingNext=!0;else{this._insideLoop=!0;try{do{this._pendingNext=!1,this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=!1}}},a.prototype._realGetNext=function(){var e=this._streams.shift();void 0!==e?"function"==typeof e?e(function(e){a.isStreamLike(e)&&(e.on("data",this._checkDataSize.bind(this)),this._handleErrors(e)),this._pipeNext(e)}.bind(this)):this._pipeNext(e):this.end()},a.prototype._pipeNext=function(e){if(this._currentStream=e,a.isStreamLike(e))return e.on("end",this._getNext.bind(this)),void e.pipe(this,{end:!1});var t=e;this.write(t),this._getNext()},a.prototype._handleErrors=function(e){var t=this;e.on("error",(function(e){t._emitError(e)}))},a.prototype.write=function(e){this.emit("data",e)},a.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.pause&&this._currentStream.pause(),this.emit("pause"))},a.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.resume&&this._currentStream.resume(),this.emit("resume")},a.prototype.end=function(){this._reset(),this.emit("end")},a.prototype.destroy=function(){this._reset(),this.emit("close")},a.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null},a.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}},a.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach((function(t){t.dataSize&&(e.dataSize+=t.dataSize)})),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)},a.prototype._emitError=function(e){this._reset(),this.emit("error",e)}},8178:(e,t,n)=>{var r=n(2781).Stream,o=n(3837);function i(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}e.exports=i,o.inherits(i,r),i.create=function(e,t){var n=new this;for(var r in t=t||{})n[r]=t[r];n.source=e;var o=e.emit;return e.emit=function(){return n._handleEmit(arguments),o.apply(e,arguments)},e.on("error",(function(){})),n.pauseStream&&e.pause(),n},Object.defineProperty(i.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),i.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},i.prototype.resume=function(){this._released||this.release(),this.source.resume()},i.prototype.pause=function(){this.source.pause()},i.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]},i.prototype.pipe=function(){var e=r.prototype.pipe.apply(this,arguments);return this.resume(),e},i.prototype._handleEmit=function(e){this._released?this.emit.apply(this,e):("data"===e[0]&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e))},i.prototype._checkIfMaxDataSizeExceeded=function(){if(!(this._maxDataSizeExceeded||this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}},1191:(e,t,n)=>{var r=n(6160),o=n(3837),i=n(1017),a=n(3685),s=n(5687),c=n(7310).parse,u=n(7147),l=n(2781).Stream,p=n(6856),d=n(9954),h=n(5488);function f(e){if(!(this instanceof f))return new f(e);for(var t in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],r.call(this),e=e||{})this[t]=e[t]}e.exports=f,o.inherits(f,r),f.LINE_BREAK="\r\n",f.DEFAULT_CONTENT_TYPE="application/octet-stream",f.prototype.append=function(e,t,n){"string"==typeof(n=n||{})&&(n={filename:n});var i=r.prototype.append.bind(this);if("number"==typeof t&&(t=""+t),o.isArray(t))this._error(new Error("Arrays are not supported."));else{var a=this._multiPartHeader(e,t,n),s=this._multiPartFooter();i(a),i(t),i(s),this._trackLength(a,t,n)}},f.prototype._trackLength=function(e,t,n){var r=0;null!=n.knownLength?r+=+n.knownLength:Buffer.isBuffer(t)?r=t.length:"string"==typeof t&&(r=Buffer.byteLength(t)),this._valueLength+=r,this._overheadLength+=Buffer.byteLength(e)+f.LINE_BREAK.length,t&&(t.path||t.readable&&t.hasOwnProperty("httpVersion")||t instanceof l)&&(n.knownLength||this._valuesToMeasure.push(t))},f.prototype._lengthRetriever=function(e,t){e.hasOwnProperty("fd")?null!=e.end&&e.end!=1/0&&null!=e.start?t(null,e.end+1-(e.start?e.start:0)):u.stat(e.path,(function(n,r){var o;n?t(n):(o=r.size-(e.start?e.start:0),t(null,o))})):e.hasOwnProperty("httpVersion")?t(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",(function(n){e.pause(),t(null,+n.headers["content-length"])})),e.resume()):t("Unknown stream")},f.prototype._multiPartHeader=function(e,t,n){if("string"==typeof n.header)return n.header;var r,o=this._getContentDisposition(t,n),i=this._getContentType(t,n),a="",s={"Content-Disposition":["form-data",'name="'+e+'"'].concat(o||[]),"Content-Type":[].concat(i||[])};for(var c in"object"==typeof n.header&&h(s,n.header),s)s.hasOwnProperty(c)&&null!=(r=s[c])&&(Array.isArray(r)||(r=[r]),r.length&&(a+=c+": "+r.join("; ")+f.LINE_BREAK));return"--"+this.getBoundary()+f.LINE_BREAK+a+f.LINE_BREAK},f.prototype._getContentDisposition=function(e,t){var n,r;return"string"==typeof t.filepath?n=i.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e.name||e.path?n=i.basename(t.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(n=i.basename(e.client._httpMessage.path||"")),n&&(r='filename="'+n+'"'),r},f.prototype._getContentType=function(e,t){var n=t.contentType;return!n&&e.name&&(n=p.lookup(e.name)),!n&&e.path&&(n=p.lookup(e.path)),!n&&e.readable&&e.hasOwnProperty("httpVersion")&&(n=e.headers["content-type"]),n||!t.filepath&&!t.filename||(n=p.lookup(t.filepath||t.filename)),n||"object"!=typeof e||(n=f.DEFAULT_CONTENT_TYPE),n},f.prototype._multiPartFooter=function(){return function(e){var t=f.LINE_BREAK;0===this._streams.length&&(t+=this._lastBoundary()),e(t)}.bind(this)},f.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+f.LINE_BREAK},f.prototype.getHeaders=function(e){var t,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)e.hasOwnProperty(t)&&(n[t.toLowerCase()]=e[t]);return n},f.prototype.setBoundary=function(e){this._boundary=e},f.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},f.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),n=0,r=this._streams.length;n<r;n++)"function"!=typeof this._streams[n]&&(e=Buffer.isBuffer(this._streams[n])?Buffer.concat([e,this._streams[n]]):Buffer.concat([e,Buffer.from(this._streams[n])]),"string"==typeof this._streams[n]&&this._streams[n].substring(2,t.length+2)===t||(e=Buffer.concat([e,Buffer.from(f.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},f.prototype._generateBoundary=function(){for(var e="--------------------------",t=0;t<24;t++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},f.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},f.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},f.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;this._streams.length&&(t+=this._lastBoundary().length),this._valuesToMeasure.length?d.parallel(this._valuesToMeasure,this._lengthRetriever,(function(n,r){n?e(n):(r.forEach((function(e){t+=e})),e(null,t))})):process.nextTick(e.bind(this,null,t))},f.prototype.submit=function(e,t){var n,r,o={method:"post"};return"string"==typeof e?(e=c(e),r=h({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(r=h(e,o)).port||(r.port="https:"==r.protocol?443:80),r.headers=this.getHeaders(e.headers),n="https:"==r.protocol?s.request(r):a.request(r),this.getLength(function(e,r){if(e&&"Unknown stream"!==e)this._error(e);else if(r&&n.setHeader("Content-Length",r),this.pipe(n),t){var o,i=function(e,r){return n.removeListener("error",i),n.removeListener("response",o),t.call(this,e,r)};o=i.bind(this,null),n.on("error",i),n.on("response",o)}}.bind(this)),n},f.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},f.prototype.toString=function(){return"[object FormData]"}},5488:e=>{e.exports=function(e,t){return Object.keys(t).forEach((function(n){e[n]=e[n]||t[n]})),e}},9515:(e,t,n)=>{var r=n(8761)(n(7772),"DataView");e.exports=r},9612:(e,t,n)=>{var r=n(2118),o=n(6909),i=n(8138),a=n(4174),s=n(7942);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},235:(e,t,n)=>{var r=n(3945),o=n(1846),i=n(2862),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),g=n(8725),y=n(6152),b=n(3226),x=n(4714),w=n(9259),_=n(3679),I=n(249),E=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,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(!w(t))return t;var D=y(t);if(D){if(k=m(t),!U)return u(t,k)}else{var q=f(t),M=q==O||"[object GeneratorFunction]"==q;if(b(t))return c(t,U);if(q==T||q==S||M&&!C){if(k=j||M?{}:g(t),!U)return j?p(t,s(k,t)):l(t,a(k,t))}else{if(!A[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))})):x(t)&&t.forEach((function(r,o){k.set(o,e(r,n,P,o,t,N))}));var B=D?void 0:(L?j?h:d:j?E:I)(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 h=s(t[u]),f=n;if("__proto__"===h||"constructor"===h||"prototype"===h)return e;if(u!=p){var m=d[h];void 0===(f=c?c(m,h,d):void 0)&&(f=a(m)?m:i(t[u+1])?[]:{})}r(d,h,f),d=d[h]}return e}},9872:e=>{e.exports=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}},6473:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},1054:(e,t,n)=>{var r=n(857),o=n(343),i=n(6152),a=n(4795),s=r?r.prototype:void 0,c=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(a(t))return c?c.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},7826:e=>{e.exports=function(e){return function(t){return e(t)}}},9078:(e,t,n)=>{var r=n(7297),o=n(6974),i=n(2721),a=n(3812);e.exports=function(e,t){return t=r(t,e),null==(e=i(e,t))||delete e[a(o(t))]}},7297:(e,t,n)=>{var r=n(6152),o=n(1401),i=n(4452),a=n(6188);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:i(a(e))}},9882:(e,t,n)=>{var r=n(9162);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},2175:(e,t,n)=>{e=n.nmd(e);var r=n(7772),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},4727:(e,t,n)=>{var r=n(9882);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},6058:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},169:(e,t,n)=>{var r=n(857),o=r?r.prototype:void 0,i=o?o.valueOf:void 0;e.exports=function(e){return i?Object(i.call(e)):{}}},6190:(e,t,n)=>{var r=n(9882);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},1522:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},752:(e,t,n)=>{var r=n(91),o=n(3940);e.exports=function(e,t,n,i){var a=!n;n||(n={});for(var s=-1,c=t.length;++s<c;){var u=t[s],l=i?i(n[u],e[u],u,n,e):void 0;void 0===l&&(l=e[u]),a?o(n,u,l):r(n,u,l)}return n}},7680:(e,t,n)=>{var r=n(752),o=n(633);e.exports=function(e,t){return r(e,o(e),t)}},9987:(e,t,n)=>{var r=n(752),o=n(2680);e.exports=function(e,t){return r(e,o(e),t)}},4019:(e,t,n)=>{var r=n(7772)["__core-js_shared__"];e.exports=r},3043:(e,t,n)=>{var r=n(8761),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},1242:e=>{var t="object"==typeof global&&global&&global.Object===Object&&global;e.exports=t},3483:(e,t,n)=>{var r=n(1897),o=n(633),i=n(249);e.exports=function(e){return r(e,i,o)}},6939:(e,t,n)=>{var r=n(1897),o=n(2680),i=n(8582);e.exports=function(e){return r(e,i,o)}},7937:(e,t,n)=>{var r=n(8304);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},8761:(e,t,n)=>{var r=n(6840),o=n(8109);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},7353:(e,t,n)=>{var r=n(241)(Object.getPrototypeOf,Object);e.exports=r},2107:(e,t,n)=>{var r=n(857),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[s]=n:delete e[s]),o}},633:(e,t,n)=>{var r=n(7552),o=n(981),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return i.call(e,t)})))}:o;e.exports=s},2680:(e,t,n)=>{var r=n(5067),o=n(7353),i=n(633),a=n(981),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:a;e.exports=s},940:(e,t,n)=>{var r=n(9515),o=n(326),i=n(2760),a=n(2143),s=n(3215),c=n(3366),u=n(7035),l="[object Map]",p="[object Promise]",d="[object Set]",h="[object WeakMap]",f="[object DataView]",m=u(r),v=u(o),g=u(i),y=u(a),b=u(s),x=c;(r&&x(new r(new ArrayBuffer(1)))!=f||o&&x(new o)!=l||i&&x(i.resolve())!=p||a&&x(new a)!=d||s&&x(new s)!=h)&&(x=function(e){var t=c(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case m:return f;case v:return l;case g:return p;case y:return d;case b:return h}return t}),e.exports=x},8109:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},2118:(e,t,n)=>{var r=n(9191);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},6909:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},8138:(e,t,n)=>{var r=n(9191),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},4174:(e,t,n)=>{var r=n(9191),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},7942:(e,t,n)=>{var r=n(9191);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},9917:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},8222:(e,t,n)=>{var r=n(9882),o=n(4727),i=n(6058),a=n(169),s=n(6190);e.exports=function(e,t,n){var c=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return o(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return i(e);case"[object Symbol]":return a(e)}}},8725:(e,t,n)=>{var r=n(9413),o=n(7353),i=n(6001);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:r(o(e))}},9045:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},1401:(e,t,n)=>{var r=n(6152),o=n(4795),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||a.test(e)||!i.test(e)||null!=t&&e in Object(t)}},8304:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7394:(e,t,n)=>{var r,o=n(4019),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},6001:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},3945:e=>{e.exports=function(){this.__data__=[],this.size=0}},1846:(e,t,n)=>{var r=n(2218),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}},2862:(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)}},9474:(e,t,n)=>{e.exports=n(7104)},6856:(e,t,n)=>{var r,o,i,a=n(9474),s=n(1017).extname,c=/^\s*([^;\s]*)(?:;|\s|$)/,u=/^text\//i;function l(e){if(!e||"string"!=typeof e)return!1;var t=c.exec(e),n=t&&a[t[1].toLowerCase()];return n&&n.charset?n.charset:!(!t||!u.test(t[1]))&&"UTF-8"}t.charset=l,t.charsets={lookup:l},t.contentType=function(e){if(!e||"string"!=typeof e)return!1;var n=-1===e.indexOf("/")?t.lookup(e):e;if(!n)return!1;if(-1===n.indexOf("charset")){var r=t.charset(n);r&&(n+="; charset="+r.toLowerCase())}return n},t.extension=function(e){if(!e||"string"!=typeof e)return!1;var n=c.exec(e),r=n&&t.extensions[n[1].toLowerCase()];return!(!r||!r.length)&&r[0]},t.extensions=Object.create(null),t.lookup=function(e){if(!e||"string"!=typeof e)return!1;var n=s("x."+e).toLowerCase().substr(1);return n&&t.types[n]||!1},t.types=Object.create(null),r=t.extensions,o=t.types,i=["nginx","apache",void 0,"iana"],Object.keys(a).forEach((function(e){var t=a[e],n=t.extensions;if(n&&n.length){r[e]=n;for(var s=0;s<n.length;s++){var c=n[s];if(o[c]){var u=i.indexOf(a[o[c]].source),l=i.indexOf(t.source);if("application/octet-stream"!==o[c]&&(u>l||u===l&&"application/"===o[c].substr(0,12)))continue}o[c]=e}}}))},7149:e=>{e.exports=t},9143:e=>{e.exports=n},9617:e=>{e.exports=r},3408:(e,t,n)=>{var r,i;e.exports=(r={ReadableStream:()=>o.ReadableStream,TransformStream:()=>o.TransformStream},i={},n.d(i,r),i)},9814:e=>{e.exports=i},7147:e=>{e.exports=a(import.meta.url)("fs")},3685:e=>{e.exports=a(import.meta.url)("http")},5687:e=>{e.exports=a(import.meta.url)("https")},1017:e=>{e.exports=a(import.meta.url)("path")},2781:e=>{e.exports=a(import.meta.url)("stream")},7310:e=>{e.exports=a(import.meta.url)("url")},3837:e=>{e.exports=a(import.meta.url)("util")},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}}')}},h={};function f(e){var t=h[e];if(void 0!==t)return t.exports;var n=h[e]={id:e,loaded:!1,exports:{}};return d[e].call(n.exports,n,n.exports,f),n.loaded=!0,n.exports}f.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return f.d(t,{a:t}),t},f.d=(e,t)=>{for(var n in t)f.o(t,n)&&!f.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},f.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),f.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var m={};(()=>{f.d(m,{Z:()=>uu});var e={};f.r(e);var t={};f.r(t),f.d(t,{ArkSimpleModel:()=>Ii,DSSimpleModel:()=>Ai,DefaultImageModel:()=>ta,DefaultSimpleModel:()=>ea,HunYuanBetaSimpleModel:()=>fi,HunYuanExpSimpleModel:()=>Wi,HunYuanOpenSimpleModel:()=>zi,HunYuanSimpleModel:()=>yi,MODELS:()=>fa,MoonshotSimpleModel:()=>qi,ReactModel:()=>sa,YiSimpleModel:()=>ki,ZhiPuSimpleModel:()=>si,toolMap:()=>la});var n={};f.r(n),f.d(n,{LineString:()=>Os,MultiLineString:()=>Cs,MultiPoint:()=>Ps,MultiPolygon:()=>ks,Point:()=>Fs,Polygon:()=>As});var r=f(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 d(e,t){var n=t.name,r=t.namespace,s=t.entity,c=t.injectEvents,u=t.IIFE,l=void 0!==u&&u;if(a[n]||r&&e[r])throw new Error(JSON.stringify({code:i.INVALID_OPERATION,msg:"Duplicate component ".concat(n)}));if(l){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:h(e.prototype,s),c){var p=c.bus,d=c.events;if(!p||!d||0===d.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),d,!0):e.prototype.events[n]={bus:p,events:d},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 h(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]=h(e[o],t[o]))}return e}const v=(g={WxMpWebSocket:()=>s.WxMpWebSocket,WxRequest:()=>s.WxRequest,default:()=>s.default,parseQueryString:()=>s.parseQueryString,wxMpStorage:()=>s.wxMpStorage},y={},f.d(y,g),y);var g,y,b=f(7149),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)},w={},_=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)},I=r.Fs.q,E={},S={};function O(e){var t=e.env,n=e.platformInfo,r={userInfoKey:"".concat("user_info","_").concat(t)};E[t]=E[t]||new I(_(_({},e),{keys:r,platformInfo:n})),S[t]=S[t]||new I(_(_({},e),{keys:r,platformInfo:n,persistence:"local"}))}function T(e){return S[e]}var A=f(7922),P=function(){return P=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},P.apply(this,arguments)},R=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},C=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])}}},N=r._G.Sg,k=r.P6.genSeqId,U=r.P6.isFormData,j=r.P6.formatUrl,L=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"];function D(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&&(U(a)?Object.keys(o).forEach((function(e){a.append(e,o[e])})):t.data=P(P({},a),o)),t.headers=P(P({},t.headers||{}),i),r.call(e,t)}}function q(){var e=k();return{data:{seqId:e},headers:{"X-SDK-Version":"@cloudbase/js-sdk/".concat((0,A.mI)()),"x-seqid":e}}}var M,F,B=function(){function e(e){var t=this;this.throwWhenRequestFail=!1,this.config=e;var n={timeout:this.config.timeout,timeoutMsg:"[@cloudbase/js-sdk] 请求在".concat(this.config.timeout/1e3,"s内未完成,已中断"),restrictedMethods:["post","put"],auth:e.auth};this.reqClass=new w.adapter.reqClass(n),this.throwWhenRequestFail=e.throw||!1,this.localCache=T(this.config.env),"GATEWAY"!==this.config.endPointMode&&(D(this.reqClass,"post",[q]),D(this.reqClass,"upload",[q]),D(this.reqClass,"download",[q])),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 e.prototype.getAccessToken=function(e){return void 0===e&&(e=null),R(this,void 0,void 0,(function(){var t,n,r;return C(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,A.mI)()),e},e.prototype.post=function(e,t){return R(this,void 0,Promise,(function(){return C(this,(function(n){switch(n.label){case 0:return[4,this.reqClass.post(P(P({},e),{headers:P(P({},e.headers),this.getDefaultHeaders()),customReqOpts:t}))];case 1:return[2,n.sent()]}}))}))},e.prototype.upload=function(e){return R(this,void 0,Promise,(function(){return C(this,(function(t){switch(t.label){case 0:return[4,this.reqClass.upload(P(P({},e),{headers:P(P({},e.headers),this.getDefaultHeaders())}))];case 1:return[2,t.sent()]}}))}))},e.prototype.download=function(e){return R(this,void 0,Promise,(function(){return C(this,(function(t){switch(t.label){case 0:return[4,this.reqClass.download(P(P({},e),{headers:P(P({},e.headers),this.getDefaultHeaders())}))];case 1:return[2,t.sent()]}}))}))},e.prototype.getBaseEndPoint=function(e){return void 0===e&&(e="CLOUD_API"),(0,A.M4)(this.config.env,e)},e.prototype.getOauthAccessTokenV2=function(e){return R(this,void 0,Promise,(function(){var t,n;return C(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 R(this,void 0,Promise,(function(){var a,s,c,u,l,p,d,h,f,m,v,g,y,b,x,w,_,I,E,S,O,T,R;return C(this,(function(C){switch(C.label){case 0:if(C.trys.push([0,4,,5]),a="x-tcb-trace_".concat(this.config.env),s="application/x-www-form-urlencoded",c=P({action:e,dataVersion:A.n0,env:this.config.env},t),-1!==L.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=C.sent().accessToken,C.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:P(P({"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,g=void 0!==(null==n?void 0:n.inQuery)?n.inQuery:t.inQuery,y=void 0!==(null==n?void 0:n.search)?n.search:t.search,b=P(P({},(null==n?void 0:n.defaultQuery)||{}),{env:this.config.env}),v&&(b.parse=!0),g&&(b=P(P({},g),b)),x=(null==n?void 0:n.endPointMode)||this.config.endPointMode||"CLOUD_API",w=(0,A.vS)(this.config.env,x),_=w.baseUrl,I=w.protocol,"GATEWAY"===x&&/^((database)\.)|(auth\.wsWebSign)/.test(e)&&(E=(0,A.vS)(this.config.env,"CLOUD_API"),_="".concat(E.baseUrl.match(/\/\/([^/?#]*)/)[0],"/web")),S=void 0,S=n.pathname?j(I,"".concat(null===(o=(0,A.M4)(this.config.env,x))||void 0===o?void 0:o.replace(/^https?:/,""),"/").concat(n.pathname),b):j(I,_,b),y&&(S+=y),[4,this.post(P({url:S,data:h},f),r)];case 3:if(O=C.sent(),(T=null===(i=O.header)||void 0===i?void 0:i["x-tcb-trace"])&&this.localCache.setStore(a,T),200!==Number(O.status)&&200!==Number(O.statusCode)||!O.data)throw new Error("network request error");return[2,O];case 4:R=C.sent();try{R.requestId=R.requestId||(null==n?void 0:n.headers["x-request-id"])||(null==n?void 0:n.headers["X-Request-Id"])||""}catch(e){}throw R;case 5:return[2]}}))}))},e.prototype.fetch=function(e){var t,n,r,o,i,a,s,c;return R(this,void 0,Promise,(function(){var u,l,p,d,h,f,m,v,g=this;return C(this,(function(y){switch(y.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 R(g,void 0,void 0,(function(){var e,t,n,r;return C(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=P({headers:P(P(P({"X-SDK-Version":"@cloudbase/js-sdk/".concat((0,A.mI)())},e),this.getDefaultHeaders()),p),withCredentials:h},f),[2,this.reqClass.fetch(r)]}}))}))},y.label=1;case 1:return y.trys.push([1,3,,6]),[4,m()];case 2:return[2,y.sent()];case 3:v=y.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 y.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={}),R(this,void 0,Promise,(function(){var o;return C(this,(function(i){switch(i.label){case 0:return[4,this.request(e,t,P(P({},n),{onUploadProgress:t.onUploadProgress}),r)];case 1:if((o=i.sent()).data.code&&this.throwWhenRequestFail)throw new Error(JSON.stringify({code:N.OPERATION_FAIL,msg:"[".concat(o.data.code,"] ").concat(o.data.message)}));return[2,o.data]}}))}))},e.prototype.gateWay=function(e,t){var n;return R(this,void 0,void 0,(function(){var o,i,a,s,c,u,l,p,d,h,f,m,v,g,y,b,x,w,_;return C(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:N.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:N.INVALID_PARAMS,msg:"[gateWay] invalid data"}))}if(h=r.P6.generateRequestId(),f=(0,A.vS)(this.config.env,"GATEWAY"),m=f.baseUrl,v=f.protocol,g="".concat(v).concat(m).concat(o||"/".concat(c,"/").concat(i)),y=["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||{}}g="".concat(g).concat(g.includes("?")?"&":"?").concat(Object.keys(b).map((function(e){return"".concat(e,"=").concat(b[e])})).join("&"))}catch(e){}return[4,this.fetch(P(P({method:u||"POST",headers:P({"Content-Type":"application/json; charset=utf-8","X-Request-Id":h},p)},y?{}:{body:d}),{url:g,customReqOpts:t}))];case 1:return x=I.sent(),w=[P({requestId:h},x)],_={},[4,x.data];case 2:return[2,P.apply(void 0,w.concat([(_.data=I.sent(),_)]))]}}))}))},e}(),W={};!function(e){e.ZH="zh-CN",e.EN="en-US"}(F||(F={}));var V=((M={})[F.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"},M),G=function(e,t){var n;return(null===(n=V[t])||void 0===n?void 0:n[e])||e},H=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))||F.ZH;return null===(o=null==a?void 0:a.setItem)||void 0===o||o.call(a,i,s),new Proxy({t:function(e){return G(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 G(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}})},z=function(){return z=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},z.apply(this,arguments)},K=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},J=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Y=r.j$.Fk,$=r.j$.xY,Q=r._G.Sg,X=r._G.vM,Z=r.P6.printWarn,ee=r.BM.D,te={timeout:15e3,persistence:"local"},ne=6e5,re={},oe=function(){function e(e){this.cloudbaseConfig=e||this.cloudbaseConfig,this.authInstance=null,this.oauthInstance=null,this.version=(0,A.mI)()}return Object.defineProperty(e.prototype,"config",{get:function(){return this.cloudbaseConfig},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"platform",{get:function(){return w},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cache",{get:function(){return e=this.cloudbaseConfig.env,E[e];var e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localCache",{get:function(){return T(this.cloudbaseConfig.env)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){return e=this.cloudbaseConfig.env,W[e];var e},enumerable:!1,configurable:!0}),e.prototype.init=function(t){var n,r,o;if(void 0===t&&(t={env:""}),t.endPointMode=t.endPointMode||"GATEWAY",w.adapter||this.useDefaultAdapter(),!(t=this.dealNodeAdapterConfig(t)).env)throw new Error(JSON.stringify({code:Q.INVALID_PARAMS,msg:"env must not be specified"}));this.isInitialized(t);var i={timeout:t.timeout||15e3,timeoutMsg:"[".concat((0,A.eX)(),"][REQUEST TIMEOUT] request had been abort since didn't finished within").concat(t.timeout/1e3,"s"),auth:t.auth};this.requestClient=new w.adapter.reqClass(i),this.cloudbaseConfig=z(z(z({},te),t),{i18n:H(w,t)}),delete this.cloudbaseConfig.lang,this.cloudbaseConfig.timeout=this.formatTimeout(this.cloudbaseConfig.timeout);var a=this.cloudbaseConfig,s=a.env,c=a.persistence,u=a.debug,l=a.timeout,p=a.oauthClient,d=a.i18n;O({env:s,persistence:c,debug:u,platformInfo:this.platform}),(0,A.R1)(s,t.region||""),(0,A.$R)(s,A.Bh,t.intl);var h=new e(this.cloudbaseConfig);return function(e){W[e.env]=new B(P(P({},e),{throw:!0}))}({env:s,region:t.region||"",timeout:l,oauthClient:p,_fromApp:h,i18n:d,endPointMode:t.endPointMode,auth:t.auth}),h.requestClient=this.requestClient,null===(n=null==this?void 0:this.fire)||void 0===n||n.call(this,"cloudbase_init",h),this.try2InitAuth(h),(null===(r=w.adapter)||void 0===r?void 0:r.nodeTool)&&(null===(o=w.adapter)||void 0===o||o.nodeTool(h,this.cloudbaseConfig)),h},e.prototype.updateConfig=function(e){var t=e.persistence,n=e.debug;this.cloudbaseConfig.persistence=t,this.cloudbaseConfig.debug=n,O({env:this.cloudbaseConfig.env,persistence:t,debug:n,platformInfo:this.platform})},e.prototype.updateLang=function(e){var t;e&&e!==(null===(t=this.cloudbaseConfig.i18n)||void 0===t?void 0:t.lang)&&(this.cloudbaseConfig.i18n.lang=e)},e.prototype.registerExtension=function(e){re[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=re[e]))throw new Error(JSON.stringify({code:Q.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=Y(e,t)||{},r=n.adapter,o=n.runtime;r&&(w.adapter=r),o&&(w.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){d(e,t)},e.prototype.registerVersion=function(e){(0,A.po)(e),this.version=e},e.prototype.registerSdkName=function(e){(0,A.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()}))&&Z(Q.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,A.Fy)({baseUrl:e,protocol:t,env:this.config.env,endPointKey:"CLOUD_API"})},e.prototype.registerEndPointWithKey=function(e){(0,A.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,A.Fy)({baseUrl:"".concat(r,"/web"),protocol:t,env:this.config.env,endPointKey:"CLOUD_API"}),(0,A.Fy)({baseUrl:"".concat(r,"/v1"),protocol:t,env:this.config.env,endPointKey:"GATEWAY"})},e.prototype.getEndPointWithKey=function(e){var t=(0,A.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=$.bind(this)(),t=e.adapter,n=e.runtime;w.adapter=t,w.runtime=n},e.prototype.formatTimeout=function(e){switch(!0){case e>ne:return Z(Q.INVALID_PARAMS,"timeout is greater than maximum value[10min]"),ne;case e<100:return Z(Q.INVALID_PARAMS,"timeout is less than maximum value[100ms]"),100;default:return e}},e.prototype.try2InitAuth=function(e){try{e.auth()}catch(e){console.log("try2InitAuth error:",e)}},e.prototype.dealNodeAdapterConfig=function(e){var t,n;if("undefined"!=typeof process&&void 0!==process.env&&(null===(t=w.adapter)||void 0===t?void 0:t.getSecretInfo)){var r=null===(n=w.adapter)||void 0===n?void 0:n.getSecretInfo(e);e.auth=z(z({},e.auth),{secretId:r.secretId,secretKey:r.secretKey,sessionToken:r.sessionToken,secretType:r.secretType}),e.env&&"symbol"!=typeof e.env||(e.env=r.env),!e.accessKey&&r.accessKey&&(e.accessKey=r.accessKey)}return e},K([ee({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(X)]}),J("design:type",Function),J("design:paramtypes",[Object]),J("design:returntype",e)],e.prototype,"init",null),K([ee({title:"调用扩展能力失败",messages:["请确认以下各项:"," 1 - 调用 invokeExtension() 的语法或参数是否正确"," 2 - 被调用的扩展能力是否已经安装并通过 registerExtension() 注册","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(X)]}),J("design:type",Function),J("design:paramtypes",[String,Object]),J("design:returntype",Promise)],e.prototype,"invokeExtension",null),e}(),ie=new oe,ae=void 0===v.WxRequest?null:(v.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:x({"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){}}}})}))},v.default.genAdapter=function(e){return{root:{globalThis:{}},reqClass:v.WxRequest,wsClass:v.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,v.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",x(x({},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:v.wxMpStorage,primaryStorage:b.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:""}}},v.default);ae&&ie.useAdapters(ae);const se=ie;var ce,ue,le,pe,de,he,fe="/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"}(ce||(ce={})),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"}(ue||(ue={})),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"}(le||(le={})),(he=pe||(pe={})).UNREACHABLE="unreachable",he.LOCAL="local",he.CANCELLED="cancelled",he.UNKNOWN="unknown",he.UNAUTHENTICATED="unauthenticated",he.RESOURCE_EXHAUSTED="resource_exhausted",he.FAILED_PRECONDITION="failed_precondition",he.INVALID_ARGUMENT="invalid_argument",he.DEADLINE_EXCEEDED="deadline_exceeded",he.NOT_FOUND="not_found",he.ALREADY_EXISTS="already_exists",he.PERMISSION_DENIED="permission_denied",he.ABORTED="aborted",he.OUT_OF_RANGE="out_of_range",he.UNIMPLEMENTED="unimplemented",he.INTERNAL="internal",he.UNAVAILABLE="unavailable",he.DATA_LOSS="data_loss",he.INVALID_PASSWORD="invalid_password",he.PASSWORD_NOT_SET="password_not_set",he.INVALID_STATUS="invalid_status",he.USER_PENDING="user_pending",he.USER_BLOCKED="user_blocked",he.INVALID_VERIFICATION_CODE="invalid_verification_code",he.TWO_FACTOR_REQUIRED="two_factor_required",he.INVALID_TWO_FACTOR="invalid_two_factor",he.INVALID_TWO_FACTOR_RECOVERY="invalid_two_factor_recovery",he.UNDER_REVIEW="under_review",he.INVALID_REQUEST="invalid_request",he.UNAUTHORIZED_CLIENT="unauthorized_client",he.ACCESS_DENIED="access_denied",he.UNSUPPORTED_RESPONSE_TYPE="unsupported_response_type",he.INVALID_SCOPE="invalid_scope",he.INVALID_GRANT="invalid_grant",he.SERVER_ERROR="server_error",he.TEMPORARILY_UNAVAILABLE="temporarily_unavailable",he.INTERACTION_REQUIRED="interaction_required",he.LOGIN_REQUIRED="login_required",he.ACCOUNT_SELECTION_REQUIRED="account_selection_required",he.CONSENT_REQUIRED="consent_required",he.INVALID_REQUEST_URI="invalid_request_uri",he.INVALID_REQUEST_OBJECT="invalid_request_object",he.REQUEST_NOT_SUPPORTED="request_not_supported",he.REQUEST_URI_NOT_SUPPORTED="request_uri_not_supported",he.REGISTRATION_NOT_SUPPORTED="registration_not_supported",he.CAPTCHA_REQUIRED="captcha_required",he.CAPTCHA_INVALID="captcha_invalid",he.PROVIDER_NOT_ENABLED="provider_not_enabled",he.LOGIN_METHOD_DISABLED="login_method_disabled",he.INVALID_USERNAME_OR_PASSWORD="invalid_username_or_password",he.INVALID_CREDENTIALS="invalid_credentials",he.WRONG_PASSWORD="wrong_password",he.USER_NOT_FOUND="user_not_found",he.MFA_PHONE_REQUIRED="mfa_phone_required",he.LOGIN_TYPE_DISABLED="login_type_disabled",he.PROVIDER_ERROR="provider_error",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.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"}(de||(de={}));var me,ve="credentials_error",ge="SIGNED_OUT",ye="SIGNED_IN",be="TOKEN_REFRESHED",xe="USER_UPDATED",we="BIND_IDENTITY",_e="loginStateChanged",Ie="authStateChanged",Ee="sign_in",Se="bind_identity",Oe="node-sdk-scope";function Te(){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.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"}(me||(me={}));var Ae=f(2631),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())}))},Re=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])}}},Ce=new Map,Ne=function(){function e(e){this.clientId=(null==e?void 0:e.clientId)||"",Ce=Ce||new Map}return e.prototype.run=function(e,t){return Pe(this,void 0,Promise,(function(){var n,r=this;return Re(this,(function(o){return e="".concat(this.clientId,"_").concat(e),(n=Ce.get(e))||(n=new Promise((function(n,o){Pe(r,void 0,void 0,(function(){var r,i,a;return Re(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,4,5]),[4,this.runIdlePromise()];case 1:return s.sent(),r=t(),i=n,[4,r];case 2:return i.apply(void 0,[s.sent()]),[3,5];case 3:return a=s.sent(),o(a),[3,5];case 4:return Ce.delete(e),[7];case 5:return[2]}}))}))})),Ce.set(e,n)),[2,n]}))}))},e.prototype.runIdlePromise=function(){return Promise.resolve()},e}(),ke="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Ue=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/,je=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!Ue.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=ke.indexOf(e.charAt(i++))<<18|ke.indexOf(e.charAt(i++))<<12|(n=ke.indexOf(e.charAt(i++)))<<6|(r=ke.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 Le(){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 De=!1;function qe(){De=De||void 0!==typeof window&&"miniprogram"===window.__wxjs_environment}try{Le()||(De=De||!!navigator.userAgent.match(/miniprogram/i)||"miniprogram"===window.__wxjs_environment,window&&window.WeixinJSBridge&&window.WeixinJSBridge.invoke?qe():"undefined"!=typeof document&&document.addEventListener("WeixinJSBridgeReady",qe,!1))}catch(e){}var Me=function(){return Me=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},Me.apply(this,arguments)},Fe=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=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))},Ve="x-request-id",Ge="x-device-id",He="device_id",ze=function(e,t){return Fe(this,void 0,Promise,(function(){var n,r,o,i,a;return Be(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:pe.UNREACHABLE,error_description:a.message,error_uri:new URL(e).pathname},[3,5];case 5:if(r)throw r;return[2,n]}}))}))},Ke=function(){function e(e){this._env=(null==e?void 0:e.env)||""}return e.prototype.getItem=function(e){return Fe(this,void 0,Promise,(function(){return Be(this,(function(t){return[2,window.localStorage.getItem("".concat(e).concat(this._env))]}))}))},e.prototype.removeItem=function(e){return Fe(this,void 0,Promise,(function(){return Be(this,(function(t){return window.localStorage.removeItem("".concat(e).concat(this._env)),[2]}))}))},e.prototype.setItem=function(e,t){return Fe(this,void 0,Promise,(function(){return Be(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}(),Je=new Ke;function Ye(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}var $e=function(){function e(e){this.credentials=null,this.accessKeyCredentials=null,this.singlePromise=null,this.tokenSectionName=e.tokenSectionName,this.storage=e.storage,this.clientId=e.clientId,this.singlePromise=new Ne({clientId:this.clientId}),this.credentials=e.credentials||null}return e.prototype.getStorageCredentialsSync=function(){var e=null,t=this.storage.getItemSync(this.tokenSectionName);if(null!=t)try{(null==(e=JSON.parse(t))?void 0:e.expires_at)&&(e.expires_at=new Date(e.expires_at))}catch(t){this.storage.removeItem(this.tokenSectionName),e=null}return e},e.prototype.setCredentials=function(e){return Fe(this,void 0,Promise,(function(){var t;return Be(this,(function(n){switch(n.label){case 0:return(null==e?void 0:e.expires_in)?((null==e?void 0:e.expires_at)||(e.expires_at=new Date(Date.now()+1e3*(e.expires_in-30))),this.storage?(t=JSON.stringify(e),[4,this.storage.setItem(this.tokenSectionName,t)]):[3,2]):[3,3];case 1:n.sent(),n.label=2;case 2:return this.credentials=e,[3,6];case 3:return this.storage?[4,this.storage.removeItem(this.tokenSectionName)]:[3,5];case 4:n.sent(),n.label=5;case 5:this.credentials=null,n.label=6;case 6:return[2]}}))}))},e.prototype.setAccessKeyCredentials=function(e){this.accessKeyCredentials=e,e.scope===Oe&&(this.credentials=e)},e.prototype.getCredentials=function(){return Fe(this,void 0,Promise,(function(){var e=this;return Be(this,(function(t){return[2,this.singlePromise.run("getCredentials",(function(){return Fe(e,void 0,void 0,(function(){var e,t;return Be(this,(function(n){switch(n.label){case 0:return Ye(this.credentials)?[4,this.getStorageCredentials()]:[3,2];case 1:if(e=n.sent(),t=e.credentials,e.isAccessKeyCredentials)return[2,t];this.credentials=t,n.label=2;case 2:return[2,this.credentials]}}))}))}))]}))}))},e.prototype.getStorageCredentials=function(){return Fe(this,void 0,Promise,(function(){var e=this;return Be(this,(function(t){return[2,this.singlePromise.run("_getStorageCredentials",(function(){return Fe(e,void 0,void 0,(function(){var e,t,n;return Be(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}(),Qe=function(){function e(t){var n,o=this;this.initializePromise=null,this.lockAcquired=!1,this.pendingInLock=[],this.singlePromise=null,t.clientSecret||(t.clientSecret=""),!t.clientId&&t.env&&(t.clientId=t.env),this.apiOrigin=t.apiOrigin,this.getApiOriginFunc=t.getApiOrigin,this.apiPath=t.apiPath||fe,this.clientId=t.clientId,this.i18n=t.i18n,this.eventBus=t.eventBus,this.singlePromise=new Ne({clientId:this.clientId}),this.retry=this.formatRetry(t.retry,e.defaultRetry),t.baseRequest?this.baseRequest=t.baseRequest:this.baseRequest=ze,this.tokenInURL=t.tokenInURL,this.headers=t.headers,this.storage=t.storage||Je,this.localCredentials=new $e({tokenSectionName:"credentials_".concat(t.clientId),storage:this.storage,clientId:t.clientId}),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+=ke.charAt((t=n<<16|r<<8|o)>>18&63)+ke.charAt(t>>12&63)+ke.charAt(t>>6&63)+ke.charAt(63&t)}return s?i.slice(0,s-3)+"===".substring(s):i}("".concat(t.clientId,":").concat(this.clientSecret)))),this.wxCloud=t.wxCloud;try{Le()&&(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}))}return e.prototype.setGetInitialSession=function(e){this.getInitialSession=e},e.prototype.setOnInitialSessionObtained=function(e){this.onInitialSessionObtained=e},e.prototype.initialize=function(e){return Fe(this,void 0,Promise,(function(){var t=this;return Be(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=Fe(t,void 0,void 0,(function(){var e=this;return Be(this,(function(t){switch(t.label){case 0:return[4,this._acquireLock(-1,(function(){return Fe(e,void 0,void 0,(function(){return Be(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 Fe(this,void 0,Promise,(function(){var t=this;return Be(this,(function(n){switch(n.label){case 0:return[4,this.initializePromise];case 1:return n.sent(),[2,this._acquireLock(-1,(function(){return Fe(t,void 0,void 0,(function(){return Be(this,(function(t){return[2,this.localCredentials.setCredentials(e)]}))}))}))]}}))}))},e.prototype.setAccessKeyCredentials=function(e){return this.localCredentials.setAccessKeyCredentials(e)},e.prototype.getAccessToken=function(){return Fe(this,void 0,Promise,(function(){var e,t;return Be(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)===Oe||(null==e?void 0:e.access_token)?[2,Promise.resolve(e.access_token)]:(t={error:pe.UNAUTHENTICATED},[2,Promise.reject(t)])}}))}))},e.prototype.request=function(t,n){var r,o;return Fe(this,void 0,Promise,(function(){var i,a,s,c,u,l,p,d,h,f;return Be(this,(function(m){switch(m.label){case 0:return n||(n={}),i=this.formatRetry(n.retry,this.retry),n.headers=Me(Me({},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=Me(Me({},this.headers),n.headers)),n.headers[Ve]||(n.headers[Ve]=Te()),n.headers[Ge]?[3,2]:[4,this.getDeviceId()];case 1:a=m.sent(),n.headers[Ge]=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[Ve]||""}catch(e){}return n.withCredentials&&h&&h.error===pe.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 Fe(this,void 0,Promise,(function(){var r,o,i,a,s;return Be(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:Me({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,Ae.y)(e):r=null==a?void 0:a.body,[3,8];case 7:return s=c.sent(),o={error:pe.UNREACHABLE,error_description:s.message,error_uri:(0,Ae.y)(e)},[3,8];case 8:if(o)throw o;return[2,r]}}))}))},e.prototype.getCredentials=function(){return Fe(this,void 0,Promise,(function(){var e=this;return Be(this,(function(t){switch(t.label){case 0:return[4,this.initializePromise];case 1:return t.sent(),[2,this._acquireLock(-1,(function(){return Fe(e,void 0,void 0,(function(){return Be(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 Fe(this,void 0,Promise,(function(){var t,n;return Be(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 Fe(this,void 0,Promise,(function(){var t,n;return Be(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 Fe(this,void 0,Promise,(function(){var n=this;return Be(this,(function(r){switch(r.label){case 0:return[4,this.initializePromise];case 1:return r.sent(),[2,this._acquireLock(-1,(function(){return Fe(n,void 0,void 0,(function(){return Be(this,(function(n){return[2,this._refreshToken(e,t)]}))}))}))]}}))}))},e.prototype._refreshToken=function(e,t){return Fe(this,void 0,Promise,(function(){var n=this;return Be(this,(function(r){return[2,this.singlePromise.run("_refreshToken",(function(){return Fe(n,void 0,void 0,(function(){var n,r,o,i,a,s,c;return Be(this,(function(u){switch(u.label){case 0:if((null==e?void 0:e.scope)===Oe)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)];u.label=1;case 1:return u.trys.push([1,4,,7]),[4,this.refreshTokenFunc(e.refresh_token,e)];case 2:return n=u.sent(),[4,this.localCredentials.setCredentials(n)];case 3:return u.sent(),null===(a=this.eventBus)||void 0===a||a.fire(Ie,{event:be}),[2,n];case 4:if(r=u.sent(),null==t?void 0:t.throwError)throw r;return r.error!==pe.INVALID_GRANT?[3,6]:[4,this.localCredentials.setCredentials(null)];case 5:return u.sent(),o=r.error_description,null===(s=this.onCredentialsError)||void 0===s||s.call(this,{msg:o}),[2,this.unAuthenticatedError(o)];case 6:return null===(c=this.onCredentialsError)||void 0===c||c.call(this,{msg:r.error_description}),[2,Promise.reject(r)];case 7:return[2]}}))}))}))]}))}))},e.prototype.anonymousLogin=function(e){return Fe(this,void 0,void 0,(function(){var t=this;return Be(this,(function(n){return[2,this.singlePromise.run("_anonymousLogin",(function(){return Fe(t,void 0,void 0,(function(){var t,n;return Be(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:pe.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 Fe(this,void 0,Promise,(function(){return Be(this,(function(t){return[2,new Promise((function(t){setTimeout((function(){t()}),e)}))]}))}))},e.prototype.anonymousSignIn=function(e){return Fe(this,void 0,Promise,(function(){var t=this;return Be(this,(function(n){return[2,this.singlePromise.run("_anonymous",(function(){return Fe(t,void 0,void 0,(function(){var t,n;return Be(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(ce.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!==pe.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 Fe(this,void 0,Promise,(function(){var r,o,i;return Be(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=ce.AUTH_TOKEN_URL,"v2"===(null==t?void 0:t.version)&&(o=ue.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,Me(Me({},i),{version:(null==t?void 0:t.version)||"v1"})]}}))}))},e.prototype.getDeviceId=function(){return Fe(this,void 0,Promise,(function(){var e;return Be(this,(function(t){switch(t.label){case 0:return this.deviceID?[2,this.deviceID]:[4,this.storage.getItem(He)];case 1:return"string"==typeof(e=t.sent())&&e.length>=16&&e.length<=48?[3,3]:(e=Te(),[4,this.storage.setItem(He,e)]);case 2:t.sent(),t.label=3;case 3:return this.deviceID=e,[2,e]}}))}))},e.prototype.unAuthenticatedError=function(e){var t={error:pe.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,We(["[OAuth2Client]"],e,!1))},e.prototype._initialize=function(){return Fe(this,void 0,Promise,(function(){var e,t,n,r,o,i;return Be(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),[4,this.localCredentials.setCredentials(null==e?void 0:e.session)]):[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 Fe(this,void 0,Promise,(function(){var n,r,o,i,a=this;return Be(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=Fe(a,void 0,void 0,(function(){return Be(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(Fe(a,void 0,void 0,(function(){return Be(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(Fe(a,void 0,void 0,(function(){return Be(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=We([],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 Fe(this,void 0,Promise,(function(){var r,o,i;return Be(this,(function(a){switch(a.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:if((null==(r=a.sent())?void 0:r.scope)===Oe)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(!Ye(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.defaultRetry=2,e.minRetry=0,e.maxRetry=5,e.retryInterval=1e3,e}(),Xe=f(9689),Ze=f(3616),et=function(){return et=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},et.apply(this,arguments)},tt=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())}))},nt=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(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)}},ot=new Xe.CloudbaseEventEmitter,it="resolveCaptchaData",at="padding:10px 8px;background:#007bff;color:#fff;border:none;border-radius:4px;cursor:pointer;flex:1;white-space:nowrap;margin-left:10px",st="width:100%;padding:10px;background:#007bff;color:#fff;border:none;border-radius:4px;cursor:pointer",ct="background:#6c757d;cursor:not-allowed",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())}))},lt=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])}}},pt=function(){function e(e){e.openURIWithCallback||(e.openURIWithCallback=this.getDefaultOpenURIWithCallback()),e.storage||(e.storage=Je),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))||Le()},e.prototype.request=function(e,t){return ut(this,void 0,Promise,(function(){var n,r,o,i;return lt(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!==pe.CAPTCHA_REQUIRED&&i.error!==pe.CAPTCHA_INVALID?[3,6]:[4,this.appendCaptchaTokenToURL(e,n,i.error===pe.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 tt(void 0,void 0,Promise,(function(){var n,r,o,i;return nt(this,(function(a){return n=(0,Ze.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 tt(void 0,void 0,void 0,(function(){var e,o;return nt(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=et(et({},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",at,"刷新");l.onclick=rt((function(){return tt(void 0,void 0,void 0,(function(){return nt(this,(function(e){switch(e.label){case 0:l.textContent="加载中...",l.disabled=!0,l.style.cssText="".concat(at,";").concat(ct),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=at,[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",st,"确定");f.onclick=rt((function(){return tt(void 0,void 0,void 0,(function(){var e,r,i,c;return nt(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(st,";").concat(ct),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(),ot.fire(it,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=st,[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("等待图形验证码校验结果..."),ot.on(it,(function(t){e(null==t?void 0:t.data)}))}))]}))}))}(t,e.config.oauthInstance)}},e.prototype.getCaptchaToken=function(e,t){return ut(this,void 0,Promise,(function(){var n,r,o,i;return lt(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(ce.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 ut(this,void 0,Promise,(function(){var r;return lt(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 ut(this,void 0,void 0,(function(){var t;return lt(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 ut(this,void 0,Promise,(function(){var e,t;return lt(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}(),dt=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 ht=dt;var ft,mt,vt=(ft=function(e,t){return ft=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])},ft(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}ft(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"}(mt||(mt={}));var gt="https://tcb.cloud.tencent.com/dev?envId=#/identity/login-manage",yt="https://docs.cloudbase.net/api-reference/webv3-next/initialization",bt=function(e){function t(t,n){var r,o=this,i=t.error_description||t.message;return(o=e.call(this,i)||this).__isAuthError=!0,o.name="AuthError",o.status=t.error,o.code=String(t.error||t.error_code||"unknown").toLowerCase(),o.errorCode="number"==typeof t.error_code?t.error_code:"string"==typeof t.error_code&&parseInt(t.error_code,10)||void 0,o.requestId=t.requestId,o.category=function(e,t,n){if(!e&&!t&&!n)return mt.UNKNOWN;try{var r=(e||"").toLowerCase(),o="string"==typeof n?parseInt(n,10):n;return o===de.CAPTCHA_REQUIRED||t===pe.CAPTCHA_REQUIRED?mt.CAPTCHA_REQUIRED:o===de.CAPTCHA_INVALID||t===pe.CAPTCHA_INVALID?mt.CAPTCHA_INVALID:o===de.MFA_PHONE_REQUIRED||t===pe.MFA_PHONE_REQUIRED?mt.MFA_REQUIRED:o===de.LOGIN_TYPE_DISABLED||t===pe.LOGIN_TYPE_DISABLED?mt.PROVIDER_NOT_ENABLED:o===de.RESOURCE_EXHAUSTED||t===pe.RESOURCE_EXHAUSTED?mt.RATE_LIMITED:o===de.INTERNAL||o===de.UNAVAILABLE||o===de.UNIMPLEMENTED||o===de.ABORTED?mt.SERVICE_ERROR:o===de.NOT_FOUND?mt.USER_NOT_FOUND:o===de.UNAUTHENTICATED?mt.INVALID_CREDENTIALS:o===de.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("过期"))?mt.VERIFICATION_FAILED:t===pe.PROVIDER_NOT_ENABLED||t===pe.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("匿名登录未开启")?mt.PROVIDER_NOT_ENABLED:t===pe.FAILED_PRECONDITION||o===de.FAILED_PRECONDITION&&!r.includes("请联系开发者")?r.includes("不存在")||r.includes("not found")||r.includes("未注册")?mt.USER_NOT_FOUND:mt.PRECONDITION_FAILED:t===pe.INVALID_PASSWORD||t===pe.INVALID_GRANT||t===pe.INVALID_VERIFICATION_CODE||t===pe.INVALID_USERNAME_OR_PASSWORD||t===pe.INVALID_CREDENTIALS||t===pe.WRONG_PASSWORD||t===pe.UNAUTHENTICATED||t===pe.INVALID_TWO_FACTOR||t===pe.INVALID_TWO_FACTOR_RECOVERY||t===pe.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")?mt.INVALID_CREDENTIALS:t===pe.NOT_FOUND||t===pe.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")?mt.USER_NOT_FOUND:t===pe.USER_BLOCKED||t===pe.USER_PENDING||t===pe.UNDER_REVIEW||t===pe.INVALID_STATUS||r.includes("被封禁")||r.includes("blocked")||r.includes("pending")||r.includes("审核")||r.includes("review")||r.includes("locked")||r.includes("已锁定")?mt.USER_STATUS_ABNORMAL:t===pe.SERVER_ERROR||t===pe.UNAVAILABLE||t===pe.TEMPORARILY_UNAVAILABLE||t===pe.INTERNAL||t===pe.UNREACHABLE||t===pe.DEADLINE_EXCEEDED||t===pe.DATA_LOSS||t===pe.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")?mt.SERVICE_ERROR:t===pe.INVALID_ARGUMENT||t===pe.INVALID_REQUEST||t===pe.INVALID_SCOPE||t===pe.INVALID_REQUEST_URI||t===pe.INVALID_REQUEST_OBJECT||o===de.INVALID_ARGUMENT?mt.INVALID_PARAMS:t===pe.PERMISSION_DENIED||t===pe.ACCESS_DENIED||t===pe.UNAUTHORIZED_CLIENT?mt.PROVIDER_NOT_ENABLED:mt.UNKNOWN}catch(e){return t}}(i,o.status,o.errorCode),o.helpMessage=function(e,t){var n=(null==t?void 0:t.method)||"signIn",r={signInWithPassword:"「用户名密码登录」",signInAnonymously:"「匿名登录」",signInWithOtp:"「短信验证码登录」或「邮箱验证码登录」",signUp:"「短信验证码登录」或「邮箱验证码登录」",signInWithOAuth:"对应的第三方身份源",signInWithIdToken:"对应的第三方身份源",signInWithOpenId:"「微信小程序 OpenID 登录」",signInWithPhoneAuth:"「微信小程序手机号授权登录」",signInWithCustomTicket:"「自定义登录」",getVerification:"「短信验证码登录」或「邮箱验证码登录」",verify:"「短信验证码登录」或「邮箱验证码登录」",verifyOtp:"「短信验证码登录」或「邮箱验证码登录」",resetPasswordForEmail:"「邮箱验证码登录」",reauthenticate:"「短信验证码登录」或「邮箱验证码登录」"}[n]||"对应的登录方式";switch(e){case mt.PROVIDER_NOT_ENABLED:return"[CloudBase Auth] 登录方式未开启\n\n"+" 当前调用的 ".concat(n,"() 所需的登录方式尚未在云开发控制台启用。\n")+" 需要开启的登录方式:".concat(r,"\n")+"\n 请按以下步骤开启:\n"+" 1. 打开云开发控制台:".concat(gt,"\n")+" 2. 选择对应的云开发环境\n 3. 进入「登录授权」页面,在「登录方式」或「身份源列表」中开启所需的登录方式\n\n 各登录方法与所需登录方式的对应关系:\n - signInWithPassword → 「用户名密码登录」\n - signInAnonymously → 「匿名登录」\n - signInWithOtp/signUp → 「短信验证码登录」或「邮箱验证码登录」\n - signInWithOAuth/signInWithIdToken → 对应的第三方身份源\n\n 如使用 CLI/MCP 工具,可通过 auth 工具查询和配置身份源状态。\n"+" 更多帮助请参考文档:".concat(yt);case mt.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 mt.USER_NOT_FOUND:return"[CloudBase Auth] 用户不存在\n\n 请检查以下项目:\n 1. 确认用户名/邮箱/手机号是否正确\n 2. 确认是在正确的云开发环境(envId)下操作\n 3. 如果是新用户,请先通过 auth.signUp() 注册\n"+" 4. 也可在云开发控制台手动创建用户:".concat(gt,"\n")+"\n 提示:不同环境(开发/测试/生产)的用户库是隔离的,请确认 envId 正确。";case mt.USER_STATUS_ABNORMAL:return"[CloudBase Auth] 用户状态异常\n\n 当前用户账号可能处于以下状态之一:\n - 账号已被封禁\n - 账号正在审核中\n - 账号已被锁定(多次密码错误)\n\n"+" 请联系管理员在云开发控制台检查用户状态:".concat(gt);case mt.SERVICE_ERROR:return"[CloudBase Auth] 服务异常\n\n 请检查以下项目:\n 1. 网络连接是否正常\n 2. 云开发环境是否正常运行\n 3. 稍后重试,如持续失败请联系技术支持\n\n 提示:如果是超时错误,请检查网络环境和请求频率。\n 常见服务端错误:smtp 未配置、短信服务未配置、wedaapis 未设置等。";case mt.INVALID_PARAMS:return"[CloudBase Auth] 参数错误\n\n 请检查传入的参数是否符合要求:\n - 不能同时输入手机号和邮箱\n - 手机号格式需正确(如 +86 开头)\n - 必须提供手机号或邮箱\n\n"+" 参考 API 文档确认各参数的格式和约束:".concat(yt);case mt.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(gt);case mt.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 mt.CAPTCHA_REQUIRED:return"[CloudBase Auth] 需要滑块验证码\n\n 当前操作触发了风控策略,需要完成滑块验证。\n\n 处理方式:\n 1. 调用滑块验证码 SDK 展示验证组件\n 2. 用户完成验证后,将 captcha_token 附带到请求中重新发送\n 3. 可通过 getVerification 的 options.withCaptcha 参数自动携带验证码";case mt.CAPTCHA_INVALID:return"[CloudBase Auth] 滑块验证码校验失败\n\n 提交的验证码 token 校验未通过(可能已过期或 client_id 不匹配)。\n\n 处理方式:\n 1. 刷新滑块验证码,让用户重新验证\n 2. 确认 captcha 组件初始化的 client_id 与认证配置一致";case mt.MFA_REQUIRED:return"[CloudBase Auth] 需要 MFA 验证\n\n 当前操作要求用户绑定手机号进行多因素认证 (MFA)。\n\n 处理方式:\n 1. 引导用户进入手机号绑定流程\n 2. 绑定完成后重新执行原操作\n 3. error 中可能包含 MFA 详情信息";case mt.PRECONDITION_FAILED:return"[CloudBase Auth] 前置条件不满足\n\n 当前操作的前置条件不满足,常见原因:\n - 该手机号/邮箱已被其他账号绑定\n - 目标用户不存在或已存在(与 target 参数冲突)\n - 当前邮箱/手机号未注册用户\n\n 请根据 error.message 中的具体描述处理。";case mt.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(gt,"\n")+" 2. 到官方问答社区提问:https://cnb.cool/tencent/cloud/cloudbase/community/-/issues\n"+" 3. 查阅文档:".concat(yt)}}(o.category,n),o.loginMethodHint=(r=null==n?void 0:n.method)&&{signInWithPassword:"当前使用「用户名密码登录」,需确保:\n ✓ 控制台已开启「用户名密码登录」\n ✓ 用户已注册且凭据正确\n 如果不需要用户系统,建议改用 auth.signInAnonymously()",signInAnonymously:"当前使用「匿名登录」,需确保:\n ✓ 控制台已开启「匿名登录」\n 注意:匿名用户无需用户名密码,适用于快速体验或临时访问场景",signInWithOtp:"当前使用「OTP 验证码登录」,需确保:\n ✓ 控制台已开启「短信验证码登录」或「邮箱验证码登录」",signInWithOAuth:"当前使用「第三方 OAuth 登录」,需确保:\n ✓ 控制台已配置并开启对应的第三方身份源"}[r]||"",o.category===mt.RATE_LIMITED&&(o.retryAfter=t.retry_after||t.retryAfter||void 0),o}return vt(t,e),t}(Error),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)},wt=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())}))},_t=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 It(e,t){var n;return wt(this,void 0,void 0,(function(){var r,o=this;return _t(this,(function(i){r=function(){return wt(o,void 0,void 0,(function(){return _t(this,(function(e){switch(e.label){case 0:return e.trys.push([0,1,,6]),[2,f(3171)];case 1:e.sent(),e.label=2;case 2:return e.trys.push([2,4,,5]),[4,Promise.resolve().then(f.bind(f,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 Et,St=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 Qe(r)}if(!t){var o=n.request.bind(n),i=new pt(xt({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||Je,adapter:e.adapter}}return e.parseParamsToSearch=function(e){return Object.keys(e).forEach((function(t){e[t]||delete e[t]})),new ht(e).toString()},e.prototype.getParamsByVersion=function(e,t){var n,r=(0,Ae.I)(e),o=(null===(n={v2:ue}[null==r?void 0:r.version])||void 0===n?void 0:n[t])||ce[t];return r&&delete r.version,{params:r,url:o}},e.prototype.signIn=function(e){return wt(this,void 0,Promise,(function(){var t,n,r,o;return _t(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(xt(xt({},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),wt(this,void 0,Promise,(function(){var n;return _t(this,(function(r){switch(r.label){case 0:return[4,this.config.request(ce.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 wt(this,void 0,Promise,(function(){var t;return _t(this,(function(n){switch(n.label){case 0:return[4,this.config.request(ce.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 wt(this,void 0,Promise,(function(){var t,n,r,o;return _t(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(ce.AUTH_SIGNOUT_URL,{method:"POST",withCredentials:!0,body:e})];case 2:return t=i.sent(),[3,4];case 3:return(n=i.sent()).error!==pe.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(ce.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 wt(this,void 0,Promise,(function(){return _t(this,(function(e){switch(e.label){case 0:return[4,this.config.request(ce.AUTH_REVOKE_ALL_URL,{method:"DELETE",withCredentials:!0})];case 1:return e.sent(),[2]}}))}))},e.prototype.revokeDevice=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){switch(t.label){case 0:return[4,this.config.request(ce.AUTHORIZED_DEVICES_DELETE_URL+e.device_id,{method:"DELETE",withCredentials:!0})];case 1:return t.sent(),[2]}}))}))},e.prototype.getVerification=function(e,t){return wt(this,void 0,Promise,(function(){var n,r;return _t(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,Ae.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(ce.VERIFICATION_URL,{method:"POST",body:r,withCaptcha:(null==t?void 0:t.withCaptcha)||!1,withCredentials:n})]}}))}))},e.prototype.verify=function(e){return wt(this,void 0,Promise,(function(){var t,n;return _t(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(xt(xt({},n),{version:"v2"}))];case 2:r.sent(),r.label=3;case 3:return[2,n]}}))}))},e.prototype.genProviderRedirectUri=function(t){return wt(this,void 0,Promise,(function(){var n,r,o,i,a;return _t(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(ce.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),wt(this,void 0,Promise,(function(){return _t(this,(function(n){return[2,this.config.request(ce.PROVIDER_TOKEN_URL,{method:"POST",body:e,useWxCloud:t})]}))}))},e.prototype.patchProviderToken=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.PROVIDER_TOKEN_URL,{method:"PATCH",body:e})]}))}))},e.prototype.signInWithProvider=function(e,t){return void 0===t&&(t=!1),wt(this,void 0,Promise,(function(){var n,r;return _t(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(xt(xt({},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 wt(this,void 0,void 0,(function(){var r,o,i,a;return _t(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:Se,provider:e.provider},error:null},[3,6];case 5:return a=s.sent(),i={data:{type:Se},error:new bt(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,Ie,{event:we,info:i})),[2,i]}}))}))},e.prototype.getInitialSession=function(){return wt(this,void 0,Promise,(function(){var e,t,n,r,o,i,a,s,c,u,l,p,d,h,f;return _t(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 bt({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 bt({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!==Se?[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!==Ee?[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:xt(xt({},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 bt(f)}];case 13:return[2]}}))}))},e.prototype.signInCustom=function(e){return wt(this,void 0,Promise,(function(){var t;return _t(this,(function(n){switch(n.label){case 0:return[4,this.config.request(ce.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={}),wt(this,void 0,Promise,(function(){var t;return _t(this,(function(n){switch(n.label){case 0:return[4,this.config.request(ce.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 wt(this,void 0,Promise,(function(){return _t(this,(function(n){return[2,this.config.request(ce.PROVIDER_BIND_URL,{method:"POST",body:e,withCredentials:!0,getCredentials:t?function(){return t}:void 0})]}))}))},e.prototype.getUserProfile=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.getUserInfo(e)]}))}))},e.prototype.getUserInfo=function(e){var t,n,r;return void 0===e&&(e={}),wt(this,void 0,Promise,(function(){var o,i,a,s,c;return _t(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 ht(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 wt(this,void 0,Promise,(function(){return _t(this,(function(e){switch(e.label){case 0:return[4,this.config.request(ce.WEDA_USER_URL,{method:"GET",withCredentials:!0})];case 1:return[2,e.sent()]}}))}))},e.prototype.deleteMe=function(t){return wt(this,void 0,Promise,(function(){var n,r;return _t(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 wt(this,void 0,Promise,(function(){return _t(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 wt(this,void 0,Promise,(function(){return _t(this,(function(e){return[2,this.config.credentialsClient.getCredentialsAsync()]}))}))},e.prototype.transByProvider=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.USER_TRANS_BY_PROVIDER_URL,{method:"PATCH",body:e,withCredentials:!0})]}))}))},e.prototype.grantToken=function(e){return wt(this,void 0,Promise,(function(){var t;return _t(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 wt(this,void 0,Promise,(function(){return _t(this,(function(e){return[2,this.config.request(ce.PROVIDER_LIST,{method:"GET",withCredentials:!0})]}))}))},e.prototype.unbindProvider=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request("".concat(ce.PROVIDER_UNBIND_URL,"/").concat(e.provider_id),{method:"DELETE",withCredentials:!0})]}))}))},e.prototype.checkPassword=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request("".concat(ce.CHECK_PWD_URL),{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.editContact=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request("".concat(ce.BIND_CONTACT_URL),{method:"PATCH",withCredentials:!0,body:e})]}))}))},e.prototype.setPassword=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request("".concat(ce.AUTH_SET_PASSWORD),{method:"PATCH",withCredentials:!0,body:e})]}))}))},e.prototype.updatePasswordByOld=function(e){return wt(this,void 0,Promise,(function(){var t;return _t(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 wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request("".concat(ce.SUDO_URL),{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.sendVerificationCodeToCurrentUser=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return e.target="CUR_USER",[2,this.config.request(ce.VERIFICATION_URL,{method:"POST",body:e,withCredentials:!0,withCaptcha:!0})]}))}))},e.prototype.changeBoundProvider=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request("".concat(ce.PROVIDER_LIST,"/").concat(e.provider_id,"/trans"),{method:"POST",body:{provider_trans_token:e.trans_token},withCredentials:!0})]}))}))},e.prototype.setUserProfile=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.USER_PRIFILE_URL,{method:"PATCH",body:e,withCredentials:!0})]}))}))},e.prototype.updateUserBasicInfo=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.USER_BASIC_EDIT_URL,{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.queryUserProfile=function(e){return wt(this,void 0,Promise,(function(){var t;return _t(this,(function(n){return t=new ht(e),[2,this.config.request("".concat(ce.USER_QUERY_URL,"?").concat(t.toString()),{method:"GET",withCredentials:!0})]}))}))},e.prototype.setCustomSignFunc=function(e){this.getCustomSignTicketFn=e},e.prototype.signInWithCustomTicket=function(){return wt(this,void 0,Promise,(function(){var e,t;return _t(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 wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.AUTH_RESET_PASSWORD,{method:"POST",body:e})]}))}))},e.prototype.authorize=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.AUTHORIZE_URL,{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.authorizeDevice=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.AUTHORIZE_DEVICE_URL,{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.deviceAuthorize=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.AUTH_GET_DEVICE_CODE,{method:"POST",body:e})]}))}))},e.prototype.authorizeInfo=function(t){return wt(this,void 0,Promise,(function(){var n,r,o;return _t(this,(function(i){switch(i.label){case 0:return n="".concat(ce.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 wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.CHECK_USERNAME,{method:"GET",body:e,withCredentials:!0})]}))}))},e.prototype.checkIfUserExist=function(e){return wt(this,void 0,Promise,(function(){var t;return _t(this,(function(n){return t=new ht(e),[2,this.config.request("".concat(ce.CHECK_IF_USER_EXIST,"?").concat(t.toString()),{method:"GET"})]}))}))},e.prototype.loginScope=function(){return wt(this,void 0,Promise,(function(){return _t(this,(function(e){return[2,this.config.credentialsClient.getScope()]}))}))},e.prototype.loginGroups=function(){return wt(this,void 0,Promise,(function(){return _t(this,(function(e){return[2,this.config.credentialsClient.getGroups()]}))}))},e.prototype.refreshTokenForce=function(e){return wt(this,void 0,void 0,(function(){var t;return _t(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(xt(xt({},t),{version:(null==e?void 0:e.version)||"v1"}))];case 2:return[2,n.sent()]}}))}))},e.prototype.getCredentials=function(){return wt(this,void 0,void 0,(function(){return _t(this,(function(e){return[2,this.config.credentialsClient.getCredentials()]}))}))},e.prototype.getPublicKey=function(){return wt(this,void 0,Promise,(function(){return _t(this,(function(e){return[2,this.config.request(ue.AUTH_PUBLIC_KEY,{method:"POST",body:{}})]}))}))},e.prototype.getEncryptParams=function(e){return wt(this,void 0,Promise,(function(){var t,n,r,o,i,a;return _t(this,(function(s){switch(s.label){case 0:return t=e.isEncrypt,delete e.isEncrypt,n=(0,Ae.I)(e),[4,It(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 wt(this,void 0,Promise,(function(){return _t(this,(function(e){return[2,this.config.request(ce.GET_PROVIDER_TYPE,{method:"POST",body:{provider_id:"weda"}})]}))}))},e.prototype.verifyCaptchaData=function(e){var t=e.token,n=e.key;return wt(this,void 0,void 0,(function(){return _t(this,(function(e){return[2,this.config.request(ce.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 wt(this,void 0,void 0,(function(){return _t(this,(function(e){return[2,this.config.request(ce.CAPTCHA_DATA_URL,{method:"POST",body:{state:t,redirect_uri:r},withCredentials:!1})]}))}))},e.prototype.getMiniProgramCode=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.GET_MINIPROGRAM_QRCODE,{method:"POST",body:e})]}))}))},e.prototype.getMiniProgramQrCodeStatus=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.GET_MINIPROGRAM_QRCODE_STATUS,{method:"POST",body:e})]}))}))},e.prototype.getUserBehaviorLog=function(e){return wt(this,void 0,Promise,(function(){var t,n;return _t(this,(function(r){return t={LOGIN:"query[action]=USER_LOGIN",MODIFY:"ne_query[action]=USER_LOGIN"},n="".concat(ce.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 wt(this,void 0,Promise,(function(){var t,n,r,o,i,a;return _t(this,(function(s){switch(s.label){case 0:return t="",n="",[4,It(!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(ce.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 wt(this,void 0,Promise,(function(){var t,n,r,o,i,a;return _t(this,(function(s){switch(s.label){case 0:return t="",n="",[4,It(!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(ue.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}(),Ot=function(){return Ot=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ot.apply(this,arguments)},Tt=function(){function e(e){var t=e.apiOrigin,n=e.getApiOrigin,r=e.apiPath,o=void 0===r?fe: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,g=e.eventBus,y=e.detectSessionInUrl,b=e.debug;if(this.detectSessionInUrl=null!=y&&y,this.oauth2client=new Qe({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:g,debug:b}),this.authApi=new St(Ot(Ot({credentialsClient:this.oauth2client},e),{request:c?this.oauth2client.request.bind(this.oauth2client):void 0,adapter:d})),y)this.oauth2client.setGetInitialSession(this.authApi.getInitialSession.bind(this.authApi));else try{var x=new URL(window.location.href),w=x.searchParams.get("code"),_=x.searchParams.get("state"),I=JSON.parse(sessionStorage.getItem(_)||"null");w&&_&&(null==I?void 0:I.hash)&&(x.hash=I.hash,window.history.replaceState(null,"",x.toString()),window.location.replace(x.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}(),At=f(794),Pt=f(141),Rt=f(6197),Ct=f(8182),Nt=function(){return Nt=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},Nt.apply(this,arguments)},kt=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())}))},Ut=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(){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 kt(this,void 0,Promise,(function(){return Ut(this,(function(t){return[2,this.localStorage.getItem(e)]}))}))},e.prototype.removeItem=function(e){return kt(this,void 0,void 0,(function(){return Ut(this,(function(t){return this.localStorage.removeItem(e),[2]}))}))},e.prototype.setItem=function(e,t){return kt(this,void 0,Promise,(function(){return Ut(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}(),Lt=/^[^:]+:\/\/[^/]+(\/[^?#]+)/,Dt=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,Lt.test(i)?RegExp.$1:i),e):(null==e?void 0:e.data)||{}},qt=function(e){return e.adapter&&"default"!==e.adapter.type?function(e,t){var n=Nt({},e);try{if(!(null==e?void 0:e.storage)&&(null==t?void 0:t.localStorage)&&(n.storage=new jt({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 kt(this,void 0,void 0,(function(){var c,u,l,p;return Ut(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(Nt({url:e},t))];case 2:return c=d.sent(),c=Dt(c,Nt(Nt({},t),{url:e})),[3,4];case 3:throw p=d.sent(),c=Nt(Nt({},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=Nt({},e),r={};if((null==t?void 0:t.captchaOptions)&&(n.captchaOptions=t.captchaOptions),!v.default.isMatch()||e.storage&&e.baseRequest)return n;try{var o=v.default.genAdapter({}),i=o.localStorage,a=o.reqClass;if(i&&(r.storage=new jt({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 kt(this,void 0,void 0,(function(){return Ut(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=Dt(e,Nt(Nt({},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),Nt(Nt({},n),r)}catch(e){console.error("adapter generate fail:",e)}return n}(e,e.adapter)},Mt=function(){return Mt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Mt.apply(this,arguments)},Ft=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])}}},Wt=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 Ft(this,void 0,Promise,(function(){return Bt(this,(function(e){throw new Error("[v1 兼容] WeixinAuthProvider.getRedirectResult() 在当前版本中无法实现。 建议使用 auth.verifyOAuth({ code, state, provider }) 替代。")}))}))},e.prototype.getLinkRedirectResult=function(e){return Ft(this,void 0,Promise,(function(){return Bt(this,(function(e){throw new Error("[v1 兼容] WeixinAuthProvider.getLinkRedirectResult() 在当前版本中无法实现。 建议使用 auth.linkIdentity({ provider: 'providerId' }) 替代。")}))}))},e}(),Vt=function(){function e(e){this.authInstance=e.authInstance}return e.prototype.signIn=function(e){return Ft(this,void 0,Promise,(function(){return Bt(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}(),Gt=function(){function e(e){this.authInstance=e.authInstance}return e.prototype.signIn=function(){return Ft(this,void 0,Promise,(function(){return Bt(this,(function(e){switch(e.label){case 0:return[4,this.authInstance.signInAnonymously({})];case 1:return e.sent(),[2]}}))}))},e}(),Ht=function(){function e(){}return e.prototype.weixinAuthProvider=function(e){return new Wt({authInstance:this,appid:e.appid,scope:e.scope})},e.prototype.customAuthProvider=function(){return new Vt({authInstance:this})},e.prototype.anonymousAuthProvider=function(){return new Gt({authInstance:this})},e.prototype.signUpWithEmailAndPassword=function(e,t){return Ft(this,void 0,Promise,(function(){return Bt(this,(function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,Ze.throwError)(At.ERRORS.INVALID_PARAMS,"email must be a string"),"string"!=typeof t&&(0,Ze.throwError)(At.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 Ft(this,void 0,Promise,(function(){return Bt(this,(function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,Ze.throwError)(At.ERRORS.INVALID_PARAMS,"email must be a string"),"string"!=typeof t&&(0,Ze.throwError)(At.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 Ft(this,void 0,Promise,(function(){return Bt(this,(function(t){switch(t.label){case 0:return"string"!=typeof e&&(0,Ze.throwError)(At.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 Ft(this,void 0,Promise,(function(){return Bt(this,(function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,Ze.throwError)(At.ERRORS.INVALID_PARAMS,"username must be a string"),"string"!=typeof t&&(0,Ze.throwError)(At.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 Ft(this,void 0,Promise,(function(){var t;return Bt(this,(function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,Ze.throwError)(At.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 Ft(this,void 0,Promise,(function(){var r;return Bt(this,(function(o){switch(o.label){case 0:return"string"!=typeof e&&(0,Ze.throwError)(At.ERRORS.INVALID_PARAMS,"phoneNumber must be a string"),"string"!=typeof t&&(0,Ze.throwError)(At.ERRORS.INVALID_PARAMS,"phoneCode must be a string"),r=this.formatPhone(e),[4,this.signUp(Mt({phone_number:r,verification_code:t},n?{password:n}:{}))];case 1:return o.sent(),[2,this.createLoginState()]}}))}))},e.prototype.signInWithPhoneCodeOrPassword=function(e){return Ft(this,void 0,Promise,(function(){var t,n,r,o;return Bt(this,(function(i){switch(i.label){case 0:return t=e.phoneNumber,n=e.phoneCode,r=e.password,"string"!=typeof t&&(0,Ze.throwError)(At.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,Ze.throwError)(At.ERRORS.INVALID_PARAMS,"phoneCode or password must be provided"),i.label=5;case 5:return[2,this.createLoginState()]}}))}))},e.prototype.forceResetPwdByPhoneCode=function(e){return Ft(this,void 0,Promise,(function(){var t,n,r,o;return Bt(this,(function(i){switch(i.label){case 0:return t=e.phoneNumber,n=e.phoneCode,r=e.password,"string"!=typeof t&&(0,Ze.throwError)(At.ERRORS.INVALID_PARAMS,"phoneNumber must be a string"),"string"!=typeof n&&(0,Ze.throwError)(At.ERRORS.INVALID_PARAMS,"phoneCode must be a string"),"string"!=typeof r&&(0,Ze.throwError)(At.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)===ve&&e.call(t)}))},e.prototype.onAccessTokenRefreshed=function(e){var t=this;this.onAuthStateChange((function(n){n===be&&e.call(t)}))},e.prototype.onAnonymousConverted=function(e){var t=this;this.onAuthStateChange((function(n){n===ye&&e.call(t)}))},e.prototype.onLoginTypeChanged=function(e){var t=this;this.onAuthStateChange((function(n){n!==ye&&n!==ge||e.call(t)}))},e}(),zt=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)}}(),Kt=function(){return Kt=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},Kt.apply(this,arguments)},Jt=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},Yt=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},$t=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())}))},Qt=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])}}},Xt=function(){return"undefined"!=typeof window&&"undefined"!=typeof document},Zt=function(e){return function(t){e.fire(_e,Kt(Kt({},t),{eventType:ve}))}},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 $t(this,void 0,void 0,(function(){return Qt(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 $t(this,void 0,void 0,(function(){var e,t,n,r;return Qt(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 $t(this,void 0,Promise,(function(){var t;return Qt(this,(function(n){switch(n.label){case 0:return[4,this.oauthInstance.authApi.setUserProfile(Kt({},e))];case 1:return t=n.sent(),this.setLocalUserInfo(t),[2]}}))}))},t.prototype.updateUserBasicInfo=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.updateUserBasicInfo(Kt({},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,Ze.throwError)(At.ERRORS.INVALID_PARAMS,"username must be a string"),this.update({username:e})},t.prototype.refresh=function(e){return $t(this,void 0,Promise,(function(){var t;return Qt(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 $t(this,void 0,Promise,(function(){var t;return Qt(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]}))},Jt([(0,Pt.catchErrorsDecorator)({title:"更新用户信息失败",messages:["请确认以下各项:"," 1 - 调用 User.update() 的语法或参数是否正确"," 2 - 用户信息中是否包含非法值","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",["function"==typeof(n=void 0!==e&&e.UserProfile)?n:Object]),Yt("design:returntype","function"==typeof(r="undefined"!=typeof Promise&&Promise)?r:Object)],t.prototype,"update",null),Jt([(0,Pt.catchErrorsDecorator)({title:"更新密码失败",messages:["请确认以下各项:"," 1 - 调用 User.updatePassword() 的语法或参数是否正确"," 3 - 新密码中是否包含非法字符","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[String,String]),Yt("design:returntype",void 0)],t.prototype,"updatePassword",null),Jt([(0,Pt.catchErrorsDecorator)({title:"更新用户名失败",messages:["请确认以下各项:"," 1 - 调用 User.updateUsername() 的语法或参数是否正确"," 2 - 当前环境是否开通了用户名密码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[String]),Yt("design:returntype",void 0)],t.prototype,"updateUsername",null),Jt([(0,Pt.catchErrorsDecorator)({title:"刷新本地用户信息失败",messages:["请确认以下各项:"," 1 - 调用 User.refresh() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[Object]),Yt("design:returntype","function"==typeof(o="undefined"!=typeof Promise&&Promise)?o:Object)],t.prototype,"refresh",null),t}();(Et=en).prototype.linkWithTicket=function(e){return Ft(this,void 0,Promise,(function(){return Bt(this,(function(e){throw new Error("[v1 兼容] User.linkWithTicket() 在当前版本中无法实现。 建议使用 auth.signInWithCustomTicket(() => Promise.resolve(ticket)) 替代。")}))}))},Et.prototype.linkWithRedirect=function(e){throw new Error("[v1 兼容] User.linkWithRedirect() 在当前版本中无法实现。 建议使用 auth.linkIdentity({ provider: 'providerId' }) 替代。")},Et.prototype.updateEmail=function(e,t){return Ft(this,void 0,Promise,(function(){return Bt(this,(function(t){switch(t.label){case 0:return"string"!=typeof e&&(0,Ze.throwError)(At.ERRORS.INVALID_PARAMS,"newEmail must be a string"),[4,this.updateUserBasicInfo({email:e})];case 1:return t.sent(),[2]}}))}))},Et.prototype.linkWithPhoneNumber=function(e,t){return Ft(this,void 0,Promise,(function(){return Bt(this,(function(e){throw new Error("[v1 兼容] User.linkWithPhoneNumber() 在当前版本中无法实现。 建议使用 auth.bindPhoneNumber({ phone_number, verification_token, sudo_token }) 替代。")}))}))},Et.prototype.updatePhoneNumber=function(e,t){return Ft(this,void 0,Promise,(function(){return Bt(this,(function(e){throw new Error("[v1 兼容] User.updatePhoneNumber() 在当前版本中无法实现。 建议使用 auth.updateUser({ phone: newPhoneNumber }) 替代。")}))}))},Et.prototype.unlink=function(e){return Ft(this,void 0,Promise,(function(){return Bt(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,Ze.throwError)(At.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 $t(this,void 0,void 0,(function(){return Qt(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,u,l,p,d,h,f,m,g,y,b,x,w,_,I,E;return zt(n,t),n.prototype.signInAnonymously=function(e){return $t(this,void 0,Promise,(function(){var t,n,r,o,i;return Qt(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,Kt(Kt({},t),{data:{user:r.user,session:r},error:null})];case 4:return o=a.sent(),(i=new bt(o,{method:"signInAnonymously"})).category===mt.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 $t(this,void 0,Promise,(function(){var t,n,r=this;return Qt(this,(function(o){switch(o.label){case 0:return e.phone_number||e.verification_code||e.verification_token||e.provider_token?(e.phone_number&&(e.phone_number=this.formatPhone(e.phone_number)),[4,this.oauthInstance.authApi.signUp(e)]):[3,2];case 1:return o.sent(),[2,this.createLoginState()];case 2:return o.trys.push([2,4,,5]),this.validateAtLeastOne(e,[["email"],["phone"]],"You must provide either an email or phone number"),[4,this.getVerification(e.email?{email:e.email}:{phone_number:this.formatPhone(e.phone)})];case 3:return t=o.sent(),[2,{data:{verifyOtp:function(n){var o=n.token,i=n.messageId,a=void 0===i?t.verification_id:i;return $t(r,void 0,Promise,(function(){var n,r,i,s,c;return Qt(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(Kt(Kt(Kt({},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 bt(c,{method:"signUp"})}];case 9:return[2]}}))}))}},error:null}];case 4:return n=o.sent(),[2,{data:{user:null,session:null},error:new bt(n,{method:"signUp"})}];case 5:return[2]}}))}))},n.prototype.signOut=function(e){var t,n;return $t(this,void 0,Promise,(function(){var r,o,i;return Qt(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),r=this.cache.keys.userInfoKey,[4,this.oauthInstance.authApi.signOut(e)];case 1:return o=a.sent(),[4,this.cache.removeStoreAsync(r)];case 2:return a.sent(),this.setAccessKey(),null===(t=this.config.eventBus)||void 0===t||t.fire(_e,{eventType:"sign_out"}),null===(n=this.config.eventBus)||void 0===n||n.fire(Ie,{event:ge}),[2,Kt(Kt({},o),{data:{},error:null})];case 3:return i=a.sent(),[2,{data:{},error:new bt(i,{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){return $t(this,void 0,Promise,(function(){var t,n,r,o;return Qt(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),this.validateAtLeastOne(e,[["username"],["email"],["phone"]],"You must provide either username, email, or phone"),this.validateParams(e,{password:{required:!0,message:"Password is required"}}),[4,this.signIn(Kt({username:e.username||e.email||this.formatPhone(e.phone),password:e.password},e.is_encrypt?{isEncrypt:!0,version:"v2"}:{}))];case 1:return i.sent(),[4,this.getSession()];case 2:return t=i.sent().data,[2,{data:{user:(n=(void 0===t?{}:t).session).user,session:n},error:null}];case 3:return r=i.sent(),(o=new bt(r,{method:"signInWithPassword"})).category===mt.PROVIDER_NOT_ENABLED?console.error(o.helpMessage):o.category===mt.INVALID_CREDENTIALS||o.category===mt.USER_NOT_FOUND?console.warn(o.helpMessage):console.warn("[CloudBase Auth] signInWithPassword 失败 [".concat(o.category,"]: ").concat(o.message)),o.loginMethodHint&&console.info(o.loginMethodHint),[2,{data:{user:null,session:null},error:o}];case 4:return[2]}}))}))},n.prototype.signInWithIdToken=function(e){return $t(this,void 0,Promise,(function(){var t,n,r;return Qt(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),this.validateParams(e,{token:{required:!0,message:"Token is required"}}),[4,this.signInWithProvider({provider_token:e.token})];case 1:return o.sent(),[4,this.getSession()];case 2:return t=o.sent().data,[2,{data:{user:(n=(void 0===t?{}:t).session).user,session:n},error:null}];case 3:return r=o.sent(),[2,{data:{user:null,session:null},error:new bt(r,{method:"signInWithIdToken"})}];case 4:return[2]}}))}))},n.prototype.signInWithOtp=function(e){var t,n,r,o;return $t(this,void 0,Promise,(function(){var i,a,s=this;return Qt(this,(function(c){switch(c.label){case 0:if(!(null===(t=e.options)||void 0===t?void 0:t.emailRedirectTo)&&(void 0===(null===(n=e.options)||void 0===n?void 0:n.shouldCreateUser)||(null===(r=e.options)||void 0===r?void 0:r.shouldCreateUser)))return[2,this.signUp({email:e.email,phone:e.phone})];c.label=1;case 1:return c.trys.push([1,3,,4]),this.validateAtLeastOne(e,[["email"],["phone"]],"You must provide either an email or phone number"),[4,this.getVerification(Kt(Kt({email_redirect_to:null===(o=e.options)||void 0===o?void 0:o.emailRedirectTo},e.email?{email:e.email}:{phone_number:this.formatPhone(e.phone)}),{target:"USER"}))];case 2:return i=c.sent(),[2,{data:{user:null,session:null,verifyOtp:function(t){var n=t.token,r=t.messageId,o=void 0===r?i.verification_id:r;return $t(s,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.verifyOtp({email:e.email,phone:e.phone,token:String(n),messageId:o})]}))}))}},error:null}];case 3:return a=c.sent(),[2,{data:{user:null,session:null},error:new bt(a,{method:"signInWithOtp"})}];case 4:return[2]}}))}))},n.prototype.verifyOAuth=function(e){return $t(this,void 0,Promise,(function(){var t,n,o,i,a,s,c,u,l;return Qt(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:Kt(Kt({},t),{user:null,session:null,redirectUrl:null}),error:new bt({message:"Provider is required"})}]):[2,{data:{user:null,session:null,redirectUrl:null},error:new bt({message:"State is required"})}]:[2,{data:{user:null,session:null,redirectUrl:null},error:new bt({message:"Code is required"})}];case 2:return s=p.sent().provider_token,c=void 0,i.type!==Se?[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=Kt(Kt({},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:Kt(Kt({},t),{user:null,session:null,redirectUrl:null}),error:new bt(l,{method:"verifyOAuth"})}];case 8:return[2]}}))}))},n.prototype.signInWithOAuth=function(e){var t,n,r,o,i;return $t(this,void 0,Promise,(function(){var a,s,c,u,l,p,d,h,f;return Qt(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"}}),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)||Ee}),Xt()&&!(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 bt(f,{method:"signInWithOAuth"})}];case 3:return[2]}}))}))},n.prototype.getClaims=function(){return $t(this,void 0,Promise,(function(){var e;return Qt(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(je(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 je(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 bt(e,{method:"getClaims"})}];case 3:return[2]}}))}))},n.prototype.resetPasswordForEmail=function(e,t){return $t(this,void 0,Promise,(function(){var n,r,o,i,a,s,c=this;return Qt(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"}}),n=(t||{}).redirectTo,r=e.includes("@"),o=void 0,r?o={email:e}:(i=this.formatPhone(e),o={phone_number:i}),[4,this.getVerification(Kt(Kt({},o),{target:"USER"}))];case 1:return a=u.sent(),[2,{data:{updateUser:function(t){return $t(c,void 0,Promise,(function(){var o,i,s,c;return Qt(this,(function(u){switch(u.label){case 0:this.validateParams(t,{nonce:{required:!0,message:"Nonce is required"},password:{required:!0,message:"Password is required"}}),u.label=1;case 1:return u.trys.push([1,5,,6]),[4,this.verify({verification_id: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(Ie,{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&&Xt()&&window.location.assign(n),[2,i];case 5:return s=u.sent(),[2,{data:{user:null,session:null},error:new bt(s,{method:"resetPasswordForEmail"})}];case 6:return[2]}}))}))}},error:null}];case 2:return s=u.sent(),[2,{data:{updateUser:null},error:new bt(s,{method:"resetPasswordForEmail"})}];case 3:return[2]}}))}))},n.prototype.resetPasswordForOld=function(e){return $t(this,void 0,void 0,(function(){var t,n,r;return Qt(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 bt(r,{method:"resetPasswordForOld"})}];case 4:return[2]}}))}))},n.prototype.verifyOtp=function(e){return $t(this,void 0,Promise,(function(){var t,n,r,o,i;return Qt(this,(function(a){switch(a.label){case 0:return a.trys.push([0,6,,7]),t=e.type,n=String(e.token),this.validateParams(e,{token:{required:!0,message:"Token is required"},messageId:{required:!0,message:"messageId is required"}}),["phone_change","email_change"].includes(t)?[4,this.verify({verification_id:e.messageId,verification_code:n})]:[3,2];case 1:return a.sent(),[3,4];case 2:return[4,this.signInWithUsername({verificationInfo:{verification_id:e.messageId,is_user:!0},verificationCode:n,username:e.email||this.formatPhone(e.phone)||"",loginType:e.email?"email":"phone"})];case 3:a.sent(),a.label=4;case 4:return[4,this.getSession()];case 5:return r=a.sent().data,[2,{data:{user:(o=(void 0===r?{}:r).session).user,session:o},error:null}];case 6:return i=a.sent(),[2,{data:{user:null,session:null},error:new bt(i,{method:"verifyOtp"})}];case 7:return[2]}}))}))},n.prototype.getSession=function(){return $t(this,void 0,Promise,(function(){var e,t,n,r;return Qt(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:Kt(Kt({},e),{user:n}),user:n},error:null}];case 3:return r=o.sent(),[2,{data:{session:null,user:null},error:new bt(r,{method:"getSession"})}];case 4:return[2]}}))}))},n.prototype.refreshSession=function(e){return $t(this,void 0,Promise,(function(){var t,n,r,o,i;return Qt(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:Kt(Kt({},n),{user:o})},error:null}];case 4:return i=a.sent(),[2,{data:{user:null,session:null},error:new bt(i,{method:"refreshSession"})}];case 5:return[2]}}))}))},n.prototype.getUser=function(e){return void 0===e&&(e=!0),$t(this,void 0,Promise,(function(){var t,n,r;return Qt(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 bt(r,{method:"getUser"})}];case 4:return[2]}}))}))},n.prototype.refreshUser=function(){return $t(this,void 0,Promise,(function(){var e,t,n;return Qt(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 bt(n,{method:"refreshUser"})}];case 4:return[2]}}))}))},n.prototype.updateUser=function(e){var t;return $t(this,void 0,Promise,(function(){var n,r,o,i,a,s,c,u,l,p,d,h,f,m=this;return Qt(this,(function(v){switch(v.label){case 0:if(v.trys.push([0,8,,9]),n=Object.keys(e).some((function(t){return void 0!==e[t]&&null!==e[t]&&""!==e[t]})),!n)throw new bt({message:"At least one field must be provided for update"});return r=e.email,o=e.phone,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}(e,["email","phone"]),s=void 0!==o,c={},(a=void 0!==r)||s?(u=void 0,a?(u={email:e.email},l="email_change"):(p=this.formatPhone(e.phone),u={phone_number:p},l="phone_change"),[4,this.getVerification(Kt({},u))]):[3,4];case 1:return d=v.sent(),Object.keys(i).length>0?[4,this.updateUserBasicInfo(i)]:[3,3];case 2:v.sent(),v.label=3;case 3:return c={messageId:d.verification_id,verifyOtp:function(t){return $t(m,void 0,Promise,(function(){var n,r,o,i;return Qt(this,(function(s){switch(s.label){case 0:return s.trys.push([0,11,,12]),t.email&&e.email===t.email?[4,this.verifyOtp({type:"email_change",email:e.email,token:t.token,messageId:d.verification_id})]:[3,3];case 1:return(n=s.sent()).error?[2,n]:[4,this.updateUserBasicInfo({email:e.email})];case 2:return s.sent(),[3,9];case 3:return t.phone&&e.phone===t.phone?[4,this.verifyOtp({type:"phone_change",phone:e.phone,token:t.token,messageId:d.verification_id})]:[3,6];case 4:return(n=s.sent()).error?[2,n]:[4,this.updateUserBasicInfo({phone:this.formatPhone(e.phone)})];case 5:return s.sent(),[3,9];case 6:return[4,this.verifyOtp({type:l,email:a?e.email:void 0,phone:a?void 0:e.phone,token:t.token,messageId:d.verification_id})];case 7:return(n=s.sent()).error?[2,n]:[4,this.updateUserBasicInfo(e)];case 8:s.sent(),s.label=9;case 9:return[4,this.getUser(!1)];case 10:return r=s.sent().data.user,null===(i=this.config.eventBus)||void 0===i||i.fire(Ie,{event:xe}),[2,{data:{user:r},error:null}];case 11:return o=s.sent(),[2,{data:{user:null},error:new bt(o,{method:"updateUser"})}];case 12:return[2]}}))}))}},[3,6];case 4:return[4,this.updateUserBasicInfo(e)];case 5:v.sent(),v.label=6;case 6:return[4,this.getUser(!1)];case 7:return h=v.sent().data.user,Object.keys(i).length>0&&(null===(t=this.config.eventBus)||void 0===t||t.fire(Ie,{event:xe})),[2,{data:Kt({user:h},c),error:null}];case 8:return f=v.sent(),[2,{data:{user:null},error:new bt(f,{method:"updateUser"})}];case 9:return[2]}}))}))},n.prototype.getUserIdentities=function(){var e;return $t(this,void 0,Promise,(function(){var t,n;return Qt(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 bt(n,{method:"getUserIdentities"})}];case 3:return[2]}}))}))},n.prototype.linkIdentity=function(e){return $t(this,void 0,Promise,(function(){var t;return Qt(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.validateParams(e,{provider:{required:!0,message:"Provider is required"}}),[4,this.signInWithOAuth({provider:e.provider,options:{type:Se}})];case 1:return n.sent(),[2,{data:{provider:e.provider},error:null}];case 2:return t=n.sent(),[2,{data:{provider:null},error:new bt(t,{method:"linkIdentity"})}];case 3:return[2]}}))}))},n.prototype.unlinkIdentity=function(e){return $t(this,void 0,Promise,(function(){var t;return Qt(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.validateParams(e,{provider:{required:!0,message:"Provider is required"}}),[4,this.oauthInstance.authApi.unbindProvider({provider_id:e.provider})];case 1:return n.sent(),[2,{data:{},error:null}];case 2:return t=n.sent(),[2,{data:{},error:new bt(t,{method:"unlinkIdentity"})}];case 3:return[2]}}))}))},n.prototype.reauthenticate=function(){return $t(this,void 0,Promise,(function(){var e,t,n,r,o=this;return Qt(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"]],"You must provide either an email or phone number"),t=e.email?{email:e.email}:{phone_number:this.formatPhone(e.phone)},[4,this.getVerification(t)];case 2:return n=i.sent(),[2,{data:{updateUser:function(e){return $t(o,void 0,Promise,(function(){var r,o,i,a,s;return Qt(this,(function(c){switch(c.label){case 0:this.validateParams(e,{nonce:{required:!0,message:"Nonce is required"}}),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(Kt(Kt({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 bt(s,{method:"reauthenticate"})}];case 10:return[2]}}))}))}},error:null}];case 3:return r=i.sent(),[2,{data:{updateUser:null},error:new bt(r,{method:"reauthenticate"})}];case 4:return[2]}}))}))},n.prototype.resend=function(e){return $t(this,void 0,Promise,(function(){var t,n,r;return Qt(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.validateAtLeastOne(e,[["email"],["phone"]],"You must provide either an email or phone number"),t="signup"===e.type?"ANY":"USER",n={target:t},"email"in e&&(n.email=e.email),"phone"in e&&(n.phone_number=this.formatPhone(e.phone)),[4,this.oauthInstance.authApi.getVerification(n)];case 1:return[2,{data:{messageId:o.sent().verification_id},error:null}];case 2:return r=o.sent(),[2,{data:{messageId:null},error:new bt(r,{method:"resend"})}];case 3:return[2]}}))}))},n.prototype.setSession=function(e){var t;return $t(this,void 0,Promise,(function(){var n,r,o;return Qt(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),this.validateParams(e,{access_token:{required:!0,message:"Access token is required"},refresh_token:{required:!0,message:"Refresh token is required"}}),[4,this.oauthInstance.oauth2client.refreshToken(e,{throwError:!0})];case 1:return i.sent(),[4,this.getSession()];case 2:return n=i.sent().data,r=(void 0===n?{}:n).session,null===(t=this.config.eventBus)||void 0===t||t.fire(Ie,{event:ye}),[2,{data:{user:r.user,session:r},error:null}];case 3:return o=i.sent(),[2,{data:{user:null,session:null},error:new bt(o,{method:"setSession"})}];case 4:return[2]}}))}))},n.prototype.exchangeCodeForSession=function(){return $t(this,void 0,void 0,(function(){return Qt(this,(function(e){return[2]}))}))},n.prototype.deleteUser=function(e){return $t(this,void 0,Promise,(function(){var t,n;return Qt(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),this.validateParams(e,{password:{required:!0,message:"Password is required"}}),[4,this.oauthInstance.authApi.sudo(e)];case 1:return t=r.sent().sudo_token,[4,this.oauthInstance.authApi.deleteMe({sudo_token:t})];case 2:return r.sent(),[2,{data:{},error:null}];case 3:return n=r.sent(),[2,{data:{},error:new bt(n,{method:"deleteUser"})}];case 4:return[2]}}))}))},n.prototype.toDefaultLoginPage=function(e){return void 0===e&&(e={}),$t(this,void 0,Promise,(function(){var t,n,r,o,i;return Qt(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("&"),v.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 bt(e,{method:"toDefaultLoginPage"})}]}return[2]}))}))},n.prototype.signInWithCustomTicket=function(e){return $t(this,void 0,Promise,(function(){var t,n,r,o;return Qt(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,Kt(Kt({},t),{data:{user:r.user,session:r},error:null})];case 5:return o=i.sent(),[2,{data:{user:null,session:null},error:new bt(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 $t(this,void 0,Promise,(function(){var e,t,r,o,i,a,s=this;return Qt(this,(function(c){switch(c.label){case 0:if(!v.default.isMatch())throw Error("wx api undefined");e=wx.getAccountInfoSync().miniProgram,t=function(t){return $t(s,void 0,void 0,(function(){var r,o;return Qt(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 $t(s,void 0,void 0,(function(){var o;return Qt(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,Kt(Kt({},r),{data:{user:i.user,session:i},error:null})];case 5:return a=c.sent(),[2,{data:{user:null,session:null},error:new bt(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 $t(this,void 0,Promise,(function(){var e,t,r,i,a,s,c,u,l;return Qt(this,(function(p){switch(p.label){case 0:return v.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 bt({message:"wx api undefined"})}];case 1:r=p.sent().code,t.provider_code=r,p.label=2;case 2:return p.trys.push([2,5,,6]),[4,this.oauthInstance.authApi.grantProviderToken(t,o)];case 3:if((i=p.sent()).error_code)throw i;return[4,this.oauthInstance.authApi.signInWithProvider({provider_token:i.provider_token},o)];case 4:if(null==(a=p.sent())?void 0:a.error_code)throw a;return[3,6];case 5:return s=p.sent(),[2,{data:{user:null,session:null},error:new bt(s,{method:"signInWithPhoneAuth"})}];case 6:return[4,this.createLoginState()];case 7:return c=p.sent(),[4,this.getSession()];case 8:return u=p.sent().data,l=(void 0===u?{}:u).session,[2,Kt(Kt({},c),{data:{user:l.user,session:l},error:null})]}}))}))},n.prototype.bindPhoneNumber=function(e){return $t(this,void 0,void 0,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.editContact(e)]}))}))},n.prototype.unbindProvider=function(e){return $t(this,void 0,Promise,(function(){return Qt(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 $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.verify(e)]}))}))},n.prototype.getVerification=function(e,t){return $t(this,void 0,Promise,(function(){return Qt(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,Ze.printWarn)(At.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),$t(this,void 0,Promise,(function(){var t,n,r;return Qt(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,Kt(Kt({},n.user),r)];case 8:return[2,null]}}))}))},n.prototype.signInAnonymouslyInWx=function(e){var t=(void 0===e?{}:e).useWxCloud;return $t(this,void 0,Promise,(function(){var e,n,r=this;return Qt(this,(function(o){switch(o.label){case 0:if(!v.default.isMatch())throw Error("wx api undefined");return e=wx.getAccountInfoSync().miniProgram,n=function(n){return $t(r,void 0,void 0,(function(){var r,o;return Qt(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 $t(r,void 0,void 0,(function(){var r;return Qt(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 $t(this,void 0,Promise,(function(){var e,t,n=this;return Qt(this,(function(r){switch(r.label){case 0:if(!v.default.isMatch())throw Error("wx api undefined");return e=wx.getAccountInfoSync().miniProgram,t=function(t){return $t(n,void 0,void 0,(function(){var n;return Qt(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 $t(n,void 0,void 0,(function(){var n;return Qt(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 $t(this,void 0,Promise,(function(){var e=this;return Qt(this,(function(t){switch(t.label){case 0:if(!v.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 $t(e,void 0,void 0,(function(){var e,i,a,s,c;return Qt(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 $t(this,void 0,Promise,(function(){return Qt(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 $t(this,void 0,Promise,(function(){return Qt(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 $t(this,void 0,Promise,(function(){return Qt(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 $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.setPassword(e)]}))}))},n.prototype.isUsernameRegistered=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){switch(t.label){case 0:return"string"!=typeof e&&(0,Ze.throwError)(At.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,Ze.printWarn)(At.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getLoginState instead")},n.prototype.getLoginState=function(){return $t(this,void 0,void 0,(function(){var e;return Qt(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 $t(this,void 0,Promise,(function(){return Qt(this,(function(e){return[2,this.getCurrentUser()]}))}))},n.prototype.getWedaUserInfo=function(){return $t(this,void 0,Promise,(function(){return Qt(this,(function(e){return[2,this.oauthInstance.authApi.getWedaUserInfo()]}))}))},n.prototype.updateUserBasicInfo=function(e){return $t(this,void 0,void 0,(function(){var t;return Qt(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 $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.bindWithProvider(e)]}))}))},n.prototype.queryUser=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.queryUserProfile(e)]}))}))},n.prototype.getAccessToken=function(){return $t(this,void 0,void 0,(function(){return Qt(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 $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.grantProviderToken(e)]}))}))},n.prototype.patchProviderToken=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.patchProviderToken(e)]}))}))},n.prototype.signInWithProvider=function(e){return $t(this,void 0,Promise,(function(){return Qt(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={}),$t(this,void 0,void 0,(function(){return Qt(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 $t(this,void 0,Promise,(function(){return Qt(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 $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.genProviderRedirectUri(e)]}))}))},n.prototype.resetPassword=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.resetPassword(e)]}))}))},n.prototype.deviceAuthorize=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.deviceAuthorize(e)]}))}))},n.prototype.sudo=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.sudo(e)]}))}))},n.prototype.deleteMe=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.deleteMe(e)]}))}))},n.prototype.getProviders=function(){return $t(this,void 0,Promise,(function(){return Qt(this,(function(e){return[2,this.oauthInstance.authApi.getProviders()]}))}))},n.prototype.loginScope=function(){return $t(this,void 0,Promise,(function(){return Qt(this,(function(e){return[2,this.oauthInstance.authApi.loginScope()]}))}))},n.prototype.loginGroups=function(){return $t(this,void 0,Promise,(function(){return Qt(this,(function(e){return[2,this.oauthInstance.authApi.loginGroups()]}))}))},n.prototype.onLoginStateChanged=function(e){var t;return $t(this,void 0,void 0,(function(){var n,r=this;return Qt(this,(function(o){switch(o.label){case 0:return null===(t=this.config.eventBus)||void 0===t||t.on(_e,(function(t){return $t(r,void 0,void 0,(function(){var n,r,o;return Qt(this,(function(i){switch(i.label){case 0:return(null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.eventType)===ve?[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,Kt(Kt({},t),n)),[2]}}))}))})),[4,this.getLoginState()];case 1:return n=o.sent(),e.call(this,n),[2]}}))}))},n.prototype.refreshTokenForce=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.refreshTokenForce(e)]}))}))},n.prototype.getCredentials=function(){return $t(this,void 0,Promise,(function(){return Qt(this,(function(e){return[2,this.oauthInstance.authApi.getCredentials()]}))}))},n.prototype.setCredentials=function(e){return $t(this,void 0,void 0,(function(){return Qt(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 $t(this,void 0,Promise,(function(){return Qt(this,(function(e){return[2,this.oauthInstance.authApi.getProviderSubType()]}))}))},n.prototype.createCaptchaData=function(e){return $t(this,void 0,void 0,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.createCaptchaData(e)]}))}))},n.prototype.verifyCaptchaData=function(e){return $t(this,void 0,void 0,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.verifyCaptchaData(e)]}))}))},n.prototype.getMiniProgramQrCode=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.getMiniProgramCode(e)]}))}))},n.prototype.getMiniProgramQrCodeStatus=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.getMiniProgramQrCodeStatus(e)]}))}))},n.prototype.modifyPassword=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.modifyPassword(e)]}))}))},n.prototype.modifyPasswordWithoutLogin=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.modifyPasswordWithoutLogin(e)]}))}))},n.prototype.getUserBehaviorLog=function(e){return $t(this,void 0,Promise,(function(){return Qt(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 $t(this,void 0,Promise,(function(){var e,t,r,i,s,u,p;return Qt(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(Kt(Kt({},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){var n,r;return $t(this,void 0,Promise,(function(){var o;return Qt(this,(function(i){switch(i.label){case 0:return[4,(o=new tn({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance})).checkLocalStateAsync()];case 1:return i.sent(),(null==t?void 0:t.userInfo)?(o.user.setLocalUserInfo(t.userInfo),[3,5]):[3,2];case 2:return(null==t?void 0:t.asyncRefreshUser)?(o.user.refresh(e),[3,5]):[3,3];case 3:return[4,o.user.refresh(e)];case 4:i.sent(),i.label=5;case 5:return null===(n=this.config.eventBus)||void 0===n||n.fire(_e,{eventType:"sign_in"}),null===(r=this.config.eventBus)||void 0===r||r.fire(Ie,{event:ye}),[2,o]}}))}))},n.prototype.setAccessKey=function(){var e,t;return $t(this,void 0,void 0,(function(){var n,r;return Qt(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=Oe),!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(Ie,(function(e){return $t(t,void 0,void 0,(function(){var t,n,r,o,i;return Qt(this,(function(a){switch(a.label){case 0:return t=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.event,n=null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.info,[4,this.getSession()];case 1:return r=a.sent().data.session,this.notifyListeners(t,r,n),[2]}}))}))}))},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.validateParams=function(e,t){for(var n=0,r=Object.entries(t);n<r.length;n++){var o=r[n],i=o[0],a=o[1];if(a.required&&(void 0===(null==e?void 0:e[i])||null===(null==e?void 0:e[i])||""===(null==e?void 0:e[i])))throw new bt({message:a.message})}},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 new bt({message:n})},n.prototype.init=function(){var e;return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.oauthInstance.oauth2client.localCredentials.getCredentials()];case 1:return t.sent()&&(null===(e=this.config.eventBus)||void 0===e||e.fire(Ie,{event:"INITIAL_SESSION"})),[3,3];case 2:return t.sent(),[3,3];case 3:return[2,{error:null}]}}))}))},Jt([(0,Pt.catchErrorsDecorator)({title:"绑定手机号失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindPhoneNumber() 的语法或参数是否正确"," 2 - 当前环境是否开通了短信验证码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",["function"==typeof(o=void 0!==e&&e.BindPhoneRequest)?o:Object]),Yt("design:returntype",Promise)],n.prototype,"bindPhoneNumber",null),Jt([(0,Pt.catchErrorsDecorator)({title:"解除三方绑定失败",messages:["请确认以下各项:"," 1 - 调用 auth().unbindProvider() 的语法或参数是否正确"," 2 - 当前账户是否已经与此登录方式解绑","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",["function"==typeof(i=void 0!==e&&e.UnbindProviderRequest)?i:Object]),Yt("design:returntype","function"==typeof(a="undefined"!=typeof Promise&&Promise)?a:Object)],n.prototype,"unbindProvider",null),Jt([(0,Pt.catchErrorsDecorator)({title:"绑定邮箱地址失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindEmail() 的语法或参数是否正确"," 2 - 当前环境是否开通了邮箱密码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",["function"==typeof(s=void 0!==e&&e.BindEmailRequest)?s:Object]),Yt("design:returntype",void 0)],n.prototype,"bindEmail",null),Jt([(0,Pt.catchErrorsDecorator)({title:"验证码验证失败",messages:["请确认以下各项:"," 1 - 调用 auth().verify() 的语法或参数是否正确"," 2 - 当前环境是否开通了手机验证码/邮箱登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",["function"==typeof(c=void 0!==e&&e.VerifyRequest)?c:Object]),Yt("design:returntype","function"==typeof(u="undefined"!=typeof Promise&&Promise)?u:Object)],n.prototype,"verify",null),Jt([(0,Pt.catchErrorsDecorator)({title:"获取验证码失败",messages:["请确认以下各项:"," 1 - 调用 auth().getVerification() 的语法或参数是否正确"," 2 - 当前环境是否开通了手机验证码/邮箱登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",["function"==typeof(l=void 0!==e&&e.GetVerificationRequest)?l:Object,Object]),Yt("design:returntype","function"==typeof(p="undefined"!=typeof Promise&&Promise)?p:Object)],n.prototype,"getVerification",null),Jt([(0,Pt.catchErrorsDecorator)({title:"获取用户信息失败",messages:["请确认以下各项:"," 1 - 调用 auth().getCurrentUser() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[Object]),Yt("design:returntype","function"==typeof(d="undefined"!=typeof Promise&&Promise)?d:Object)],n.prototype,"getCurrentUser",null),Jt([(0,Pt.catchErrorsDecorator)({title:"小程序匿名登录失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了匿名登录"," 2 - 调用 auth().signInAnonymouslyInWx() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[Object]),Yt("design:returntype","function"==typeof(h="undefined"!=typeof Promise&&Promise)?h:Object)],n.prototype,"signInAnonymouslyInWx",null),Jt([(0,Pt.catchErrorsDecorator)({title:"小程序绑定OpenID失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序openId静默登录"," 2 - 调用 auth().bindOpenId() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[]),Yt("design:returntype","function"==typeof(f="undefined"!=typeof Promise&&Promise)?f:Object)],n.prototype,"bindOpenId",null),Jt([(0,Pt.catchErrorsDecorator)({title:"小程序unionId静默登录失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序unionId静默登录"," 2 - 调用 auth().signInWithUnionId() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[]),Yt("design:returntype","function"==typeof(m="undefined"!=typeof Promise&&Promise)?m:Object)],n.prototype,"signInWithUnionId",null),Jt([(0,Pt.catchErrorsDecorator)({title:"短信验证码登陆",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序短信验证码登陆"," 2 - 调用 auth().signInWithSms() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[Object]),Yt("design:returntype","function"==typeof(g="undefined"!=typeof Promise&&Promise)?g:Object)],n.prototype,"signInWithSms",null),Jt([(0,Pt.catchErrorsDecorator)({title:"邮箱验证码登陆",messages:["请确认以下各项:"," 1 - 当前环境是否开启了邮箱登陆"," 2 - 调用 auth().signInWithEmail() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[Object]),Yt("design:returntype","function"==typeof(y="undefined"!=typeof Promise&&Promise)?y:Object)],n.prototype,"signInWithEmail",null),Jt([(0,Pt.catchErrorsDecorator)({title:"获取用户是否被占用失败",messages:["请确认以下各项:"," 1 - 调用 auth().isUsernameRegistered() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[String]),Yt("design:returntype","function"==typeof(b="undefined"!=typeof Promise&&Promise)?b:Object)],n.prototype,"isUsernameRegistered",null),Jt([(0,Pt.catchErrorsDecorator)({title:"获取本地登录态失败",messages:["请确认以下各项:"," 1 - 调用 auth().getLoginState() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[]),Yt("design:returntype",Promise)],n.prototype,"getLoginState",null),Jt([(0,Pt.catchErrorsDecorator)({title:"获取用户信息失败",messages:["请确认以下各项:"," 1 - 是否已登录"," 2 - 调用 auth().getUserInfo() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[]),Yt("design:returntype","function"==typeof(x="undefined"!=typeof Promise&&Promise)?x:Object)],n.prototype,"getUserInfo",null),Jt([(0,Pt.catchErrorsDecorator)({title:"获取微搭插件用户信息失败",messages:["请确认以下各项:"," 1 - 是否已登录"," 2 - 调用 auth().getWedaUserInfo() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[]),Yt("design:returntype","function"==typeof(w="undefined"!=typeof Promise&&Promise)?w:Object)],n.prototype,"getWedaUserInfo",null),Jt([(0,Pt.catchErrorsDecorator)({title:"绑定第三方登录方式失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindWithProvider() 的语法或参数是否正确"," 2 - 此账户是否已经绑定此第三方","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",["function"==typeof(_=void 0!==e&&e.BindWithProviderRequest)?_:Object]),Yt("design:returntype","function"==typeof(I="undefined"!=typeof Promise&&Promise)?I:Object)],n.prototype,"bindWithProvider",null),Jt([(0,Pt.catchErrorsDecorator)({title:"获取身份源类型",messages:["请确认以下各项:"," 1 - 调用 auth().getProviderSubType() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[]),Yt("design:returntype","function"==typeof(E="undefined"!=typeof Promise&&Promise)?E:Object)],n.prototype,"getProviderSubType",null),n}(Ht),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:fe};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)||Ct.useDefaultAdapter.bind(t)(),h=d.runtime,f=d.adapter,m=t||{},v=m.env,g=m.clientId,y=m.debug,b=m.cache,x=m.app,w=m.getApiOrigin,_=(t||{}).apiOrigin;_||(_="https://".concat(v,".").concat(c,".tcb-api.tencentcloudapi.com"));var I={env:v,clientId:g,i18n:u,accessKey:l,useWxCloud:p,eventBus:new Xe.CloudbaseEventEmitter},E=new Tt(qt(Kt(Kt({},I),{apiOrigin:_,getApiOrigin:w,apiPath:(null==e?void 0:e.apiPath)||fe,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:Zt(I.eventBus),headers:Kt({"X-SDK-Version":"@cloudbase/js-sdk/".concat(e.sdkVersion)},e.headers||{}),detectSessionInUrl:e.detectSessionInUrl,debug:y,auth:null===(r=null===(n=t.app)||void 0===n?void 0:n.config)||void 0===r?void 0:r.auth}))),S=new nn(Kt(Kt({},I),{region:c,persistence:e.persistence,debug:y,cache:b||new Rt.CloudbaseCache({persistence:e.persistence,keys:{userInfoKey:"user_info_".concat(v)},platformInfo:d}),runtime:h||"web",_fromApp:x,oauthInstance:E,auth:null===(i=null===(o=t.app)||void 0===o?void 0:o.config)||void 0===i?void 0:i.auth}));return E.initializeSession((function(e,t){return $t(a,void 0,void 0,(function(){return Qt(this,(function(n){return e?(e.type===Ee?t?I.eventBus.fire(Ie,{event:ye,info:Kt(Kt({},e),{error:t})}):e.user&&S.createLoginState({},{userInfo:e.user}):e.type===Se&&I.eventBus.fire(Ie,{event:we,info:Kt(Kt({},e),{error:t})}),[2]):[2]}))}))})),{authInstance:S,oauthInstance:E}}(Kt(Kt({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=f(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,g;return ln(this,(function(y){switch(y.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 g=y.sent(),"node-sdk"===(null==t?void 0:t.from)?[2,g]:[4,g.data];case 2:return[2,y.sent()]}}))}))}var mn=new hn,vn={name:dn,entity:{callContainer:mn.callContainer}};try{cloudbase.registerComponent(vn)}catch(e){}function gn(e){try{e.registerComponent(vn)}catch(e){console.warn(e)}}try{window.registerCloudrun=gn}catch(e){}var yn=function(){return yn=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},yn.apply(this,arguments)},bn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},xn=r._G.eX,wn=r._G.Sg,_n=r._G.vM,In=r.P6.execCallback,En=r.BM.D,Sn="functions",On=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,g,y,b,x,w,_,I,E,S,O,T,A,P;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,g=void 0===v?{}:v,!s)throw new Error(JSON.stringify({code:wn.INVALID_PARAMS,msg:"[".concat(Sn,".callFunction] invalid function name")}));try{y=c?JSON.stringify(c):""}catch(e){throw new Error(JSON.stringify({code:wn.INVALID_PARAMS,msg:"[".concat(Sn,".callFunction] invalid data")}))}return"cloudrun"!==d?[3,2]:(b=r.P6.generateRequestId(),[4,fn.call(this,{name:s,data:y,path:f,method:m,header:yn(yn({},g),{"X-Request-Id":b})})]);case 1:return[2,{result:A=R.sent(),requestId:b}];case 2:w=(x=this).request,_=x.config,I="functions.invokeFunction",E={inQuery:u,parse:l,search:p,function_name:s,request_data:y},S={},O=!("GATEWAY"!==_.endPointMode||(C=s,"lcap-common-service"===C||"lcap-datasource-test"===C||C.startsWith("lcap-data")||C.startsWith("lowcode-datasource")||"cloudbase_module"===C)||function(e){return"lowcode-wx-datasource"===e}(s)),R.label=3;case 3:return R.trys.push([3,8,,9]),O?[4,w.gateWay(yn(yn({},e),{path:"functions"}),n)]:[3,5];case 4:return T=R.sent(),S=yn({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,w.send(I,E,{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)return[2,In(t,null,S)];if(A=S.data.response_data,l||O)return[2,In(t,null,{result:A,requestId:S.requestId})];try{return A=JSON.parse(S.data.response_data),[2,In(t,null,{result:A,requestId:S.requestId})]}catch(e){In(t,new Error("[".concat(xn(),"][").concat(wn.INVALID_PARAMS,"][").concat(Sn,".callFunction] response data must be json")))}return[3,9];case 8:return P=R.sent(),In(t,P),[3,9];case 9:return[2]}var C}))},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)}([En({customInfo:{className:"Cloudbase",methodName:"callFunction"},title:"函数调用失败",messages:["请确认以下各项:"," 1 - 调用 callFunction() 的语法或参数是否正确"," 2 - 当前环境下是否存在此函数"," 3 - 函数安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(_n)]}),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}(),Tn=new On,An={name:Sn,entity:{callFunction:Tn.callFunction}};try{cloudbase.registerComponent(An)}catch(e){}var Pn=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)}}(),Rn=function(e){function t(t){var n=e.call(this,t)||this;return n.__isStorageError=!0,n.name="StorageError",n}return Pn(t,e),t}(Error);function Cn(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}var Nn,kn=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 Pn(t,e),t.prototype.toJSON=function(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}},t}(Rn);function Un(){return globalThis.Buffer}function jn(e){var t=Un();return t?t.from(e).toString("base64"):btoa(e)}function Ln(e){return e.split("/").map((function(e){return encodeURIComponent(e)})).join("/")}Pn((function(e,t){var n=Nn.call(this,e)||this;return n.name="StorageUnknownError",n.originalError=t,n}),Nn=Rn);var 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)},qn=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())}))},Mn=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])}}},Fn="/v1/storages";function Bn(e,t){return qn(this,void 0,Promise,(function(){var n;return Mn(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 Cn(n)?[2,{data:null,error:n}]:[2,{data:null,error:new Rn((null==n?void 0:n.message)||String(n))}];case 3:return[2]}}))}))}var Wn=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(Fn).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(Fn).concat(e.startsWith("/")?"":"/").concat(e):e},e.prototype.send=function(e){return qn(this,void 0,Promise,(function(){var t,n,r,o,i,a;return Mn(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=Dn({},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(Dn(Dn(Dn(Dn({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 qn(this,void 0,Promise,(function(){var r,o,i,a;return Mn(this,(function(s){switch(s.label){case 0:return r=this.buildUrl(e.path,e.query),[4,this.request.fetch(Dn(Dn({url:r,method:"GET",headers:Dn({},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 kn("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 kn("Not Modified",i,"STORAGE_PG_NOT_MODIFIED");if(i>=400)throw new kn("Download failed with status ".concat(i),i,"STORAGE_PG_REQUEST_FAIL");if(!(a=null==o?void 0:o.response))throw new kn("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 qn(this,void 0,Promise,(function(){var o,i,a,s;return Mn(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 kn(s,o,a)}}))}))},e}(),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)},Gn=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])}}};function zn(e){return Cn(e)?e:new Rn((null==e?void 0:e.message)||String(e))}function Kn(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 Jn=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 Gn(this,void 0,Promise,(function(){var n,r,o,i,a;return Hn(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),n=Kn(this.ctx.options),r=n.headers,o=n.query,[4,this.ctx.http.download({path:"/object/".concat(this.ctx.bucketId,"/").concat(Ln(this.ctx.cleanName)),headers:Vn(Vn({},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 kn("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}(),Yn=function(){function e(e){this.ctx=e}return e.prototype.asStream=function(){return new Jn(this.ctx)},e.prototype.then=function(e,t){return this.execute().then(e,t)},e.prototype.execute=function(){var e,t;return Gn(this,void 0,Promise,(function(){var n,r,o,i,a,s;return Hn(this,(function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),n=Kn(this.ctx.options),r=n.headers,o=n.query,[4,this.ctx.http.download({path:"/object/".concat(this.ctx.bucketId,"/").concat(Ln(this.ctx.cleanName)),headers:Vn(Vn({},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}(),$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)},Qn=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())}))},Xn=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])}}},Zn="3600",er=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 Rn("setHeader requires a non-empty header name");if(/[\r\n]/.test(e)||"string"==typeof t&&/[\r\n]/.test(t))throw new Rn("setHeader does not allow CR/LF characters in header name or value");return this.headers=$n($n({},this.headers),((n={})[e]=String(t),n)),this},e.prototype.upload=function(e,t,n){return Qn(this,void 0,Promise,(function(){return Xn(this,(function(r){return[2,this.uploadOrUpdate("POST",e,t,n)]}))}))},e.prototype.update=function(e,t,n){return Qn(this,void 0,Promise,(function(){return Xn(this,(function(r){return[2,this.uploadOrUpdate("PUT",e,t,n)]}))}))},e.prototype.download=function(e,t,n){return new Yn({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 Qn(this,void 0,Promise,(function(){var r=this;return Xn(this,(function(o){return[2,Bn((function(){return Qn(r,void 0,void 0,(function(){var r;return Xn(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 Qn(this,void 0,Promise,(function(){var t=this;return Xn(this,(function(n){return[2,Bn((function(){return Qn(t,void 0,void 0,(function(){var t,n,r,o,i,a=this;return Xn(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 Qn(this,void 0,Promise,(function(){var r=this;return Xn(this,(function(o){return[2,Bn((function(){return Qn(r,void 0,void 0,(function(){var r;return Xn(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 Qn(this,void 0,Promise,(function(){var r=this;return Xn(this,(function(o){return[2,Bn((function(){return Qn(r,void 0,void 0,(function(){return Xn(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 Qn(this,void 0,Promise,(function(){var t=this;return Xn(this,(function(n){return[2,Bn((function(){return Qn(t,void 0,void 0,(function(){var t,n;return Xn(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 Qn(this,void 0,Promise,(function(){var t,n,r;return Xn(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 Rn?n:new Rn((null==n?void 0:n.message)||String(n))}];case 3:return[2]}}))}))},e.prototype.createSignedUrl=function(e,t,n){return Qn(this,void 0,Promise,(function(){var r=this;return Xn(this,(function(o){return[2,Bn((function(){return Qn(r,void 0,void 0,(function(){var r,o,i;return Xn(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 Qn(this,void 0,Promise,(function(){var r=this;return Xn(this,(function(o){return[2,Bn((function(){return Qn(r,void 0,void 0,(function(){var r,o,i,a,s=this;return Xn(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 Qn(this,void 0,Promise,(function(){var n=this;return Xn(this,(function(r){return[2,Bn((function(){return Qn(n,void 0,void 0,(function(){var n,r,o;return Xn(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 Qn(this,void 0,Promise,(function(){var o=this;return Xn(this,(function(i){return[2,Bn((function(){return Qn(o,void 0,void 0,(function(){var o,i,a,s,c;return Xn(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($n($n({},e),{headers:$n($n({},this.headers),e.headers||{})}))},e.prototype.uploadOrUpdate=function(e,t,n,r){return Qn(this,void 0,Promise,(function(){var o=this;return Xn(this,(function(i){return[2,Bn((function(){return Qn(o,void 0,void 0,(function(){var o,i,a,s,c;return Xn(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 Rn('invalid path: ".." segment is not allowed');return t},e.prototype.encodePath=function(e){return Ln(e)},e.prototype.buildUploadBody=function(e,t){var n,r,o,i,a,s=$n({},(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:Zn,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:Zn,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 Rn("FormData must contain a file");if(r>1)throw new Rn("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 jn(e)},e}(),tr=/[\x00-\x20\x7f/\\?#%]/;function nr(e,t){if("string"!=typeof e||0===e.length)throw new Rn("[storage.".concat(t,"] bucketId is required"));if(e.length>256)throw new Rn("[storage.".concat(t,"] invalid bucketId: length must be 1-").concat(256));var n=tr.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 Rn(r)}}var rr,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=function(){function e(e,t){void 0===t&&(t=!1),this.http=new Wn(e),this.shouldThrowOnError=t}return e.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},e.prototype.listBuckets=function(e){return or(this,void 0,Promise,(function(){var t=this;return ir(this,(function(n){return[2,Bn((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 or(this,void 0,Promise,(function(){var t=this;return ir(this,(function(n){return[2,Bn((function(){return nr(e,"getBucket"),t.http.send({method:"GET",path:"/bucket/".concat(e)})}),this.shouldThrowOnError)]}))}))},e.prototype.createBucket=function(e,t){return or(this,void 0,Promise,(function(){var n=this;return ir(this,(function(r){return[2,Bn((function(){var r;return nr(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 or(this,void 0,Promise,(function(){var n=this;return ir(this,(function(r){return[2,Bn((function(){return nr(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 or(this,void 0,Promise,(function(){var t=this;return ir(this,(function(n){return[2,Bn((function(){return nr(e,"deleteBucket"),t.http.send({method:"DELETE",path:"/bucket/".concat(e)})}),this.shouldThrowOnError)]}))}))},e}(),sr=function(){return sr=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},sr.apply(this,arguments)},cr=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},ur=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},lr=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())}))},pr=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"}(rr||(rr={}));var dr=r._G.eX,hr=r._G.Sg,fr=r._G.vM,mr=r.P6.isArray,vr=r.P6.isString,gr=r.P6.isPalinObject,yr=r.P6.execCallback,br=r.BM.D,xr="storage",wr=function(e,t,n){return lr(void 0,void 0,void 0,(function(){var r,o,i;return pr(this,(function(a){switch(a.label){case 0:return[4,e.gateWay({path:"storages",name:"get-objects-upload-info",data:[sr({objectId:t.path},t.signedHeader?{signedHeader:t.signedHeader}:{})]},n)];case 1:return r=a.sent(),o=(null===(i=r.data)||void 0===i?void 0:i[0])||{},[2,sr(sr({},r),{data:sr(sr({},o.code?sr({},o):{}),{authorization:o.authorization,token:o.token,url:o.uploadUrl,fileId:o.cloudObjectId,cosFileId:o.cloudObjectMeta,download_url:o.downloadUrl})})]}}))}))},_r=function(e,t,n){return lr(void 0,void 0,void 0,(function(){var r,o;return pr(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 r=i.sent(),[2,sr(sr({},r),{data:{download_list:null===(o=r.data)||void 0===o?void 0:o.map((function(e){return{code:e.code||"SUCCESS",message:e.message,fileid:e.cloudObjectId,download_url:e.downloadUrl,fileID:e.cloudObjectId,tempFileURL:e.downloadUrl}}))}})]}}))}))},Ir=function(e,t,n){return lr(void 0,void 0,void 0,(function(){var r,o;return pr(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 r=i.sent(),[2,sr(sr({},r),{data:{delete_list:null===(o=r.data)||void 0===o?void 0:o.map((function(e){return{code:e.code||"SUCCESS",fileID:e.cloudObjectId,message:e.message}}))}})]}}))}))},Er=function(e,t,n){return lr(void 0,void 0,void 0,(function(){var r,o;return pr(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 r=i.sent(),[2,sr(sr({},r),{data:{copy_list:null===(o=r.data)||void 0===o?void 0:o.map((function(e){return{code:e.code||"SUCCESS",fileID:e.cloudObjectId,message:e.message}}))}})]}}))}))},Sr={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 Or(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 Sr[r]||"application/octet-stream"}function Tr(e,t){var n=t.toLowerCase();return Object.keys(e).some((function(e){return e.toLowerCase()===n}))}function Ar(e){return Object.keys(e).reduce((function(t,n){var r;return sr(sr({},t),((r={})[n]=[e[n]],r))}),{})}var Pr=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 lr(this,void 0,Promise,(function(){var n,r,o,i,a,s,c,u,l,p,d,h,f,m,v,g,y,b,x,w,_,I,E,S,O,T,A,P,R,C,N;return pr(this,(function(k){switch(k.label){case 0:if(n=e.cloudPath,r=e.filePath,o=e.onUploadProgress,R=e.method,i=void 0===R?"put":R,C=e.headers,a=void 0===C?{}:C,s=e.fileContent,!vr(n)||!r&&!s)throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".uploadFile] invalid params")}));return c={put:rr.put,post:rr.post}[i.toLocaleLowerCase()]||rr.put,u=this.isGateWay(),l=sr({},a),p=Object.keys(a).reduce((function(e,t){return"content-length"!==t.toLowerCase()&&(e[t]=a[t]),e}),{}),c===rr.put&&u&&(Tr(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=Un())||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)),Tr(l,"content-type")||(l["content-type"]=Or(r,n)),Tr(p,"content-type")||(p["content-type"]=Or(r,n))),[4,this.getUploadMetadata({cloudPath:n,method:c,headers:c!==rr.put||u?void 0:p,signedHeader:c===rr.put&&u?Ar(l):void 0,customReqOpts:e.customReqOpts})];case 1:return h=k.sent(),f=h.data,m=h.requestId,(null==(v=f)?void 0:v.code)||!(null==v?void 0:v.url)?(g=(null==v?void 0:v.code)||hr.OPERATION_FAIL,y=(null==v?void 0:v.message)||"get upload info failed",[2,yr(t,new Error("[".concat(dr(),"][").concat(g,"][").concat(xr,"]:").concat(y)))]):(b=f.url,x=f.authorization,w=f.token,_=f.fileId,I=f.cosFileId,E=f.download_url,O=sr(sr({},S={url:b,file:r,name:n,onUploadProgress:o,fileContent:s,fileId:_,requestId:m}),{method:rr.put,headers:sr(sr({},p),{authorization:x,"x-cos-meta-fileid":I,"x-cos-security-token":w})}),T=sr(sr({},S),{method:rr.post,data:{key:n,signature:x,"x-cos-meta-fileid":I,success_action_status:"201","x-cos-security-token":w}}),(N={})[rr.put]={params:O,isSuccess:function(e){return e>=200&&e<300}},N[rr.post]={params:T,isSuccess:function(e){return 201===e}},A=N,[4,this.request.upload(A[c].params)]);case 2:return P=k.sent(),A[c].isSuccess(P.statusCode)?[2,yr(t,null,{fileID:_,download_url:E,requestId:m})]:[2,yr(t,new Error("[".concat(dr(),"][").concat(hr.OPERATION_FAIL,"][").concat(xr,"]:").concat(P.data)))]}}))}))},e.prototype.getUploadMetadata=function(e,t){return lr(this,void 0,Promise,(function(){var n,r,o,i,a,s,c,u,l,p;return pr(this,(function(d){switch(d.label){case 0:if(n=e.cloudPath,r=e.method,o=e.headers,i=e.signedHeader,!vr(n))throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".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===rr.put&&(l&&i?u.signedHeader=i:!l&&o&&(u.headers=o)),l?[4,wr(a,u,e.customReqOpts)]:[3,3];case 2:return c=d.sent(),[3,5];case 3:return[4,a.send(s,u,e.customReqOpts)];case 4:c=d.sent(),d.label=5;case 5:return[2,yr(t,null,c)];case 6:return p=d.sent(),[2,yr(t,p)];case 7:return[2]}}))}))},e.prototype.deleteFile=function(e,t){return lr(this,void 0,Promise,(function(){var n,r,o,i,a,s,c,u;return pr(this,(function(l){switch(l.label){case 0:if(!(n=e.fileList)||!mr(n)||0===n.length)throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".deleteFile] fileList must not be empty")}));for(r=0,o=n;r<o.length;r++)if(!(i=o[r])||!vr(i))throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".deleteFile] fileID must be string")}));return a="storage.batchDeleteFile",s=this.request,c={},this.isGateWay()?[4,Ir(s,{fileList:n},e.customReqOpts)]:[3,2];case 1:return c=l.sent(),[3,4];case 2:return[4,s.send(a,{fileid_list:n},e.customReqOpts)];case 3:c=l.sent(),l.label=4;case 4:return c.code?[2,yr(t,null,c)]:(u={fileList:c.data.delete_list,requestId:c.requestId},[2,yr(t,null,u)])}}))}))},e.prototype.getTempFileURL=function(e,t){return lr(this,void 0,Promise,(function(){var n,r,o,i,a,s,c,u;return pr(this,(function(l){switch(l.label){case 0:if(!(n=e.fileList)||!mr(n)||0===n.length)throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".getTempFileURL] fileList must not be empty")}));for(r=[],o=0,i=n;o<i.length;o++)if(a=i[o],gr(a)){if(!Object.prototype.hasOwnProperty.call(a,"fileID"))throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".getTempFileURL] file info must include fileID")}));r.push({fileid:a.fileID,max_age:a.maxAge||7200})}else{if(!vr(a))throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".getTempFileURL] invalid fileList")}));r.push({fileid:a})}return s="storage.batchGetDownloadUrl",c=this.request,u={},this.isGateWay()?[4,_r(c,{convertedFileList:r},e.customReqOpts)]:[3,2];case 1:return u=l.sent(),[3,4];case 2:return[4,c.send(s,{file_list:r},e.customReqOpts)];case 3:u=l.sent(),l.label=4;case 4:return u.code?[2,yr(t,null,u)]:[2,yr(t,null,{fileList:u.data.download_list,requestId:u.requestId})]}}))}))},e.prototype.downloadFile=function(e,t){return lr(this,void 0,Promise,(function(){var n,r,o,i,a,s;return pr(this,(function(c){switch(c.label){case 0:if(n=e.fileID,!vr(n))throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".getTempFileURL] fileID must be string")}));return[4,this.getTempFileURL.call(this,{fileList:[{fileID:n,maxAge:600}],customReqOpts:e.customReqOpts})];case 1:return r=c.sent(),"SUCCESS"!==(o=r.fileList[0]).code?[2,yr(t,o)]:(i=this.request,a=encodeURI(o.download_url),[4,i.download({url:a,tempFilePath:e.tempFilePath})]);case 2:return s=c.sent(),[2,yr(t,null,s)]}}))}))},e.prototype.copyFile=function(e,t){return lr(this,void 0,Promise,(function(){var n,r,o,i,a,s,c,u,l;return pr(this,(function(p){switch(p.label){case 0:if(!(n=e.fileList)||!mr(n)||0===n.length)throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".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)throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".copyFile] srcPath and dstPath may not be empty")}));if(s===c)throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".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,Er(u,{convertedFileList:r},e.customReqOpts)]:[3,2];case 1:return l=p.sent(),[3,4];case 2:return[4,u.send("storage.batchCopyFile",{file_list:r},e.customReqOpts)];case 3:l=p.sent(),p.label=4;case 4:return l.code?[2,yr(t,null,l)]:[2,yr(t,null,{fileList:l.data.copy_list,requestId:l.requestId})]}}))}))},e.prototype.getFileInfo=function(e){var t;return lr(this,void 0,Promise,(function(){var n,r=this;return pr(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 lr(r,void 0,void 0,(function(){var t,n,r,o,i,a,s;return pr(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}]}}))}))},cr([br({customInfo:{className:"Cloudbase",methodName:"uploadFile"},title:"上传文件失败",messages:["请确认以下各项:"," 1 - 调用 uploadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(fr)]}),ur("design:type",Function),ur("design:paramtypes",[Object,"function"==typeof(t="undefined"!=typeof Function&&Function)?t:Object]),ur("design:returntype","function"==typeof(n="undefined"!=typeof Promise&&Promise)?n:Object)],e.prototype,"uploadFile",null),cr([br({customInfo:{className:"Cloudbase",methodName:"getUploadMetadata"},title:"获取上传元信息失败",messages:["请确认以下各项:"," 1 - 调用 getUploadMetadata() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(fr)]}),ur("design:type",Function),ur("design:paramtypes",[Object,"function"==typeof(r="undefined"!=typeof Function&&Function)?r:Object]),ur("design:returntype","function"==typeof(o="undefined"!=typeof Promise&&Promise)?o:Object)],e.prototype,"getUploadMetadata",null),cr([br({customInfo:{className:"Cloudbase",methodName:"deleteFile"},title:"删除文件失败",messages:["请确认以下各项:"," 1 - 调用 deleteFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(fr)]}),ur("design:type",Function),ur("design:paramtypes",["function"==typeof(i=void 0!==sn.ICloudbaseDeleteFileParams&&sn.ICloudbaseDeleteFileParams)?i:Object,"function"==typeof(a="undefined"!=typeof Function&&Function)?a:Object]),ur("design:returntype","function"==typeof(s="undefined"!=typeof Promise&&Promise)?s:Object)],e.prototype,"deleteFile",null),cr([br({customInfo:{className:"Cloudbase",methodName:"getTempFileURL"},title:"获取文件下载链接",messages:["请确认以下各项:"," 1 - 调用 getTempFileURL() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(fr)]}),ur("design:type",Function),ur("design:paramtypes",["function"==typeof(c=void 0!==sn.ICloudbaseGetTempFileURLParams&&sn.ICloudbaseGetTempFileURLParams)?c:Object,"function"==typeof(u="undefined"!=typeof Function&&Function)?u:Object]),ur("design:returntype","function"==typeof(l="undefined"!=typeof Promise&&Promise)?l:Object)],e.prototype,"getTempFileURL",null),cr([br({customInfo:{className:"Cloudbase",methodName:"downloadFile"},title:"下载文件失败",messages:["请确认以下各项:"," 1 - 调用 downloadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(fr)]}),ur("design:type",Function),ur("design:paramtypes",["function"==typeof(p=void 0!==sn.ICloudbaseDownloadFileParams&&sn.ICloudbaseDownloadFileParams)?p:Object,"function"==typeof(d="undefined"!=typeof Function&&Function)?d:Object]),ur("design:returntype","function"==typeof(h="undefined"!=typeof Promise&&Promise)?h:Object)],e.prototype,"downloadFile",null),cr([br({customInfo:{className:"Cloudbase",methodName:"copyFile"},title:"批量复制文件",messages:["请确认以下各项:"," 1 - 调用 copyFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(fr)]}),ur("design:type",Function),ur("design:paramtypes",["function"==typeof(f=void 0!==sn.ICloudbaseCopyFileParams&&sn.ICloudbaseCopyFileParams)?f:Object,"function"==typeof(m="undefined"!=typeof Function&&Function)?m:Object]),ur("design:returntype","function"==typeof(v="undefined"!=typeof Promise&&Promise)?v:Object)],e.prototype,"copyFile",null),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)},Cr=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())}))},Nr=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])}}},kr=r._G.Sg,Ur=function(){function e(e,t){void 0===t&&(t=!1),this.shouldThrowOnError=!1,this.bucketId="",this.context=e,this.shouldThrowOnError=t,this.storage=new Pr(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 Cr(this,void 0,Promise,(function(){var r,o,i,a,s,c,u,l,p;return Nr(this,(function(d){switch(d.label){case 0:r=Rr({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:kr.OPERATION_FAIL,msg:"[".concat(xr,".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(Cn(p))return[2,{data:null,error:p}];throw p;case 4:return[2]}}))}))},e.prototype.uploadToSignedUrl=function(e,t,n,r){return Cr(this,void 0,Promise,(function(){return Nr(this,(function(t){return[2,this.upload(e,n,r)]}))}))},e.prototype.createSignedUploadUrl=function(e){return Cr(this,void 0,Promise,(function(){var t,n,r;return Nr(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 Rn?r:new Rn(r.message)}];case 3:return[2]}}))}))},e.prototype.update=function(e,t,n){return Cr(this,void 0,Promise,(function(){return Nr(this,(function(r){return[2,this.upload(e,t,Rr(Rr({},n),{upsert:!0}))]}))}))},e.prototype.move=function(e,t){return Cr(this,void 0,Promise,(function(){var n,r;return Nr(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 Rn(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(Cn(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}}))}))},e.prototype.copy=function(e,t){return Cr(this,void 0,Promise,(function(){var n,r;return Nr(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 Rn(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(Cn(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}}))}))},e.prototype.createSignedUrl=function(e,t,n){return Cr(this,void 0,Promise,(function(){var r,o,i,a,s,c,u;return Nr(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 Rn("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(Cn(u))return[2,{data:null,error:u}];throw u;case 3:return[2]}}))}))},e.prototype.createSignedUrls=function(e,t){return Cr(this,void 0,Promise,(function(){var n,r,o=this;return Nr(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(Cn(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}}))}))},e.prototype.download=function(e,t){return Cr(this,void 0,Promise,(function(){var n,r,o=this;return Nr(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r={},[4,Cr(o,void 0,void 0,(function(){var n,r,o,i;return Nr(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 Rn("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(Cn(n))return[2,{data:null,error:n}];throw n;case 3:return[2]}}))}))},e.prototype.info=function(e){return Cr(this,void 0,Promise,(function(){var t,n,r,o,i,a,s,c;return Nr(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 Rn(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 Rn?c:new Rn(c.message)}];case 3:return[2]}}))}))},e.prototype.exists=function(e){return Cr(this,void 0,Promise,(function(){var t,n,r;return Nr(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 Rn(n.message);return[2,{data:!0,error:null}];case 2:if(r=o.sent(),this.shouldThrowOnError)throw r;if(Cn(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}}))}))},e.prototype.getPublicUrl=function(e,t){return Cr(this,void 0,Promise,(function(){var n;return Nr(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 Cr(this,void 0,Promise,(function(){var t,n,r,o,i,a,s,c,u,l,p=this;return Nr(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 Rn("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(Cn(l))return[2,{data:null,error:l}];throw l;case 4:return[2]}}))}))},e.prototype.list=function(){return Cr(this,void 0,void 0,(function(){return Nr(this,(function(e){throw new Rn("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 Rn("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 jn(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}(),jr=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)}}(),Lr=new Pr,Dr={name:xr,entity:{uploadFile:Lr.uploadFile,deleteFile:Lr.deleteFile,getTempFileURL:Lr.getTempFileURL,downloadFile:Lr.downloadFile,getUploadMetadata:Lr.getUploadMetadata,copyFile:Lr.copyFile,getFileInfo:Lr.getFileInfo,isGateWay:Lr.isGateWay}},qr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jr(t,e),t.prototype.from=function(e){return e?(nr(e,"from"),new er(this.http,e,this.shouldThrowOnError)):new Ur(this.http.ctx,this.shouldThrowOnError)},t}(ar),Mr={name:"".concat(xr,"/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 qr(n);return e.set(this,r),r},configurable:!0,enumerable:!0})}};try{cloudbase.registerComponent(Dr),cloudbase.registerComponent(Mr)}catch(e){}function Fr(e){try{e.registerComponent(Dr),e.registerComponent(Mr)}catch(e){console.warn(e)}}try{window.registerStorage=Fr}catch(e){}var Br=f(6765),Wr=f.n(Br),Vr=f(7195),Gr=f.n(Vr),Hr=f(9850),zr=f.n(Hr);function Kr(e){return void 0===e&&(e=""),"".concat(e?"".concat(e,"_"):"").concat(+new Date,"_").concat(Math.random())}var Jr,Yr=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}})},$r=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}})},Qr=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)}}(),Xr=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 Qr(t,e),t}(Error),Zr=function(e){return null==e?void 0:e.isRealtimeErrorMessageError},eo=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 Qr(t,e),t}(Error),to=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 Qr(t,e),t}(Error),no=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(ro[this.errCode]||""," | errMsg: ").concat(this.errMsg)},set:function(e){this.errMsg=e}}}),n.errCode=t.errCode||"UNKNOWN_ERROR",n.errMsg=t.errMsg,n}return Qr(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),ro={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"},oo=function(e){return void 0===e&&(e=0),new Promise((function(t){return setTimeout(t,e)}))},io=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())}))},ao=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])}}},so=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"}(Jr||(Jr={}));var co=function(){function e(e){var t=this;this.watchStatus=Jr.INITING,this.wsLogin=function(e,n){return io(t,void 0,Promise,(function(){var t;return ao(this,(function(r){switch(r.label){case 0:return this.watchStatus=Jr.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 io(t,void 0,Promise,(function(){var t,n=this;return ao(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){io(n,void 0,void 0,(function(){var n,o,i,a,s,c,u,l,p,d;return ao(this,(function(h){switch(h.label){case 0:return h.trys.push([0,3,,4]),this.watchStatus===Jr.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===Jr.PAUSED?(console.log("[realtime] initWatch cancelled on pause"),[2,t()]):(this.watchStatus=Jr.INITING,o={watchId:this.watchId,requestId:Kr(),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 $r({id:c,docChanges:[],docs:[],type:"init"}),this.listener.onChange(p),this.scheduleSendACK();return this.onWatchStart(this,this.sessionInfo.queryID),this.watchStatus=Jr.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 io(t,void 0,Promise,(function(){var t,n=this;return ao(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){io(n,void 0,void 0,(function(){var n,o,i,a;return ao(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),this.watchStatus===Jr.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===Jr.PAUSED?(console.log("[realtime] rebuildWatch cancelled on pause"),[2,t()]):(this.watchStatus=Jr.REBUILDING,o={watchId:this.watchId,requestId:Kr(),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=Jr.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 io(t,void 0,void 0,(function(){var t,r,o,i=this;return ao(this,(function(a){return t="INIT_WATCH"===n.operationName,r=function(){i.closeWithError(new no({errCode:t?ro.SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL:ro.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(){io(i,void 0,void 0,(function(){var e,t=this;return ao(this,(function(r){switch(r.label){case 0:return r.trys.push([0,8,,9]),e=function(){return io(t,void 0,void 0,(function(){return ao(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,oo(100)];case 3:return r.sent(),this.watchStatus!==Jr.PAUSED?[3,4]:(n.reject(new to("".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 io(t,void 0,void 0,(function(){var e,t,n;return ao(this,(function(r){switch(r.label){case 0:if(e=this.sessionInfo?this.sessionInfo.queryID:"",this.watchStatus!==Jr.ACTIVE)return this.watchStatus=Jr.CLOSED,this.onWatchClose(this,e),[2];r.label=1;case 1:return r.trys.push([1,3,4,5]),this.watchStatus=Jr.CLOSING,t={watchId:this.watchId,requestId:Kr(),msgType:"CLOSE_WATCH",msgData:null},[4,this.send({msg:t})];case 2:return r.sent(),this.sessionInfo=void 0,this.watchStatus=Jr.CLOSED,[3,5];case 3:return n=r.sent(),this.closeWithError(new no({errCode:ro.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 io(t,void 0,Promise,(function(){var e,t,n;return ao(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this.watchStatus!==Jr.ACTIVE?(this.scheduleSendACK(),[2]):this.sessionInfo?(e={watchId:this.watchId,requestId:Kr(),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(),Zr(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 no({errCode:ro.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 no({errCode:ro.SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL,errMsg:t})),[3,3];case 3:return[2]}}))}))},this.handleCommonError=function(e,t){if(Zr(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 Yr({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 Jr.PAUSED:if("ERROR"!==e.msgType)return;break;case Jr.LOGGINGIN:case Jr.INITING:case Jr.REBUILDING:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received while ".concat(this.watchStatus));case Jr.CLOSED:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received when the watch has closed");case Jr.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 no({errCode:ro.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=Jr.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=Jr.PAUSED,console.log("[realtime] client paused (".concat(this.collectionName," ").concat(this.query,") (watchId ").concat(this.watchId,")"))},e.prototype.resume=function(){return io(this,void 0,Promise,(function(){var e;return ao(this,(function(t){switch(t.label){case 0:this.watchStatus=Jr.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 io(this,void 0,void 0,(function(){var t;return ao(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 io(this,void 0,void 0,(function(){var t,n,r,o,i,a,s,c,u,l,p,d;return ao(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(uo)}catch(e){return this.closeWithError(new no({errCode:ro.SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA,errMsg:e})),[2]}a=so([],o.currentDocs,!0),s=!1,c=function(n,c){var l,p,d,h,f,m,v,g,y,b,x,w;return ao(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=zr()(p),l.updatedFields&&Object.keys(l.updatedFields).forEach((function(e){Wr()(d,e,l.updatedFields[e])})),l.removedFields)for(h=0,f=l.removedFields;h<f.length;h++)m=f[h],Gr()(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 g=new no({errCode:ro.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(g),g}break;case"replace":if(!l.doc)throw g=new no({errCode:ro.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="replace" (requestId '.concat(e.requestId,")")}),u.closeWithError(g),g;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 g=new no({errCode:ro.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(g),g}}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":y=a.findIndex((function(e){return e._id===l.docId})),y>-1?a.splice(y,1):console.error("[realtime listener] internal non-fatal server error: unexpected dequeue event where no doc is associated.");break;case"update":y=a.findIndex((function(e){return e._id===l.docId})),y>-1?a[y]=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=so([],a,!0),x=i.slice(0,n+1).filter((function(e){return e.id===l.id})),u.sessionInfo.currentEventId=l.id,u.sessionInfo.currentDocs=a,w=new $r({id:l.id,docChanges:x,docs:b,msgType:r}),u.listener.onChange(w)),[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,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 uo(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 lo,po={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"}(lo||(lo={}));var ho=function(e,t){var n=po[e],r=n?"".concat(n.name,", code ").concat(e,", reason ").concat(t||n.description):"code ".concat(e);return new no({errCode:ro.SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED,errMsg:r})},fo=null,mo="web";function vo(){return fo}function go(){return mo}function yo(e){mo=e}var bo=function(){return bo=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},bo.apply(this,arguments)},xo=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())}))},wo=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(){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 xo(t,void 0,Promise,(function(){var t=this;return wo(this,(function(n){return[2,new Promise((function(n,r){xo(t,void 0,void 0,(function(){var t,o,i,a,s,c,u,l,p=this;return wo(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(){xo(p,void 0,void 0,(function(){return wo(this,(function(e){switch(e.label){case 0:return o&&i?[3,2]:[4,oo(0)];case 1:e.sent(),o&&i||s(new eo("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),xo(t,void 0,Promise,(function(){var t=this;return wo(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(lo.ReconnectWebSocket),this.wsInitPromise=new Promise((function(r,o){xo(t,void 0,void 0,(function(){var t,i,a=this;return wo(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=vo();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,oo(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 no({errCode:ro.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 no({errCode:ro.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 lo.ReconnectWebSocket:case lo.NoRealtimeListeners:break;case lo.HeartbeatPingError:case lo.HeartbeatPongTimeoutError:case lo.NormalClosure:case lo.AbnormalClosure:t.maxReconnect>0?t.initWebSocketConnection(!0,t.maxReconnect):t.closeAllClients(ho(e.code));break;case lo.NoAuthentication:t.closeAllClients(ho(e.code,e.reason));break;default:t.maxReconnect>0?t.initWebSocketConnection(!0,t.maxReconnect):t.closeAllClients(ho(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 Xr(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 xo(t,void 0,Promise,(function(){var e=this;return wo(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 xo(t,void 0,Promise,(function(){var t,r,o,i,a,s,c,u,l=this;return wo(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){xo(l,void 0,void 0,(function(){var n,r,o,i,a;return wo(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:Kr(),msgType:"LOGIN",msgData:r,exMsgData:{runtime:go(),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 xo(t,void 0,Promise,(function(){var e,t,n,r,o,i,a;return wo(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:go()})]);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 xo(t,void 0,void 0,(function(){var e;return wo(this,(function(t){switch(t.label){case 0:return e={watchId:void 0,requestId:Kr(),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(lo.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,po[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 co(bo(bo({},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(){xo(t,void 0,void 0,(function(){var e=this;return wo(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(lo.HeartbeatPingError),[3,3];case 3:return[2]}}))}))}),e?0:this.context.appConfig.realtimePingInterval)},e}(),Io={target:"database",entity:function(){var e,t=this.platform,n=t.adapter,r=t.runtime;e=n.wsClass,fo=e,yo(r)}},Eo={name:"realtime",IIFE:!0,entity:function(){this.prototype.wsClientClass=_o}};try{cloudbase.registerComponent(Eo),cloudbase.registerHook(Io)}catch(e){}const So=(e=>{var t={};return f.d(t,e),t})({generateHTTPClient:()=>c.generateHTTPClient,generateMySQLClient:()=>c.generateMySQLClient,generatePGClient:()=>c.generatePGClient});var Oo=function(){return Oo=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},Oo.apply(this,arguments)},To=r.U3.yE,Ao="models",Po=new WeakMap;function Ro(e){return new Proxy({},{get:function(t,n){var r=e.getEndPointWithKey("GATEWAY"),o=r.BASE_URL,i=r.PROTOCOL,a=Oo(Oo({},e),{BASE_URL:o,PROTOCOL:i}),s=Po.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,So.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(Oo(Oo({},e),{headers:Oo({"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),Po.set(a,s)),s[n]}})}var Co="cloudbase_init",No=new To;No.on(Co,(function(e){var t=e.data;Object.assign(t,{models:Ro(t)})}));var ko={name:Ao,namespace:Ao,entity:new Proxy({},{get:function(e,t){console.warn("【deprecated】Accessing Cloudbase.prototype.models.".concat(t,"."))}}),injectEvents:{bus:No,events:[Co]}};try{cloudbase.registerComponent(ko)}catch(e){}function Uo(e){try{e.registerComponent(ko)}catch(e){console.warn(e)}}try{window.registerModel=Uo}catch(e){}var jo=f(3408);const Lo=(e=>{var t={};return f.d(t,e),t})({createReadableStreamWrapper:()=>u.createReadableStreamWrapper});var Do=[239,187,191];const qo=(e=>{var t={};return f.d(t,e),t})({TextDecoder:()=>l.TextDecoder});var 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())}))},Fo=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])}}},Bo=jo.ReadableStream,Wo=jo.TransformStream,Vo=function(){var e;return new Wo({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 Do.every((function(t,n){return e.charCodeAt(n)===t}))}(n)&&(n=n.slice(Do.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)}})},Go=(0,Lo.createReadableStreamWrapper)(Bo),Ho=function(){function e(e,t){void 0===e&&(e="utf-8"),void 0===t&&(t={});var n=this;this.transform=new Wo({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 qo.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 zo(e){var t=e;return t[Symbol.asyncIterator]=function(){var t=e.getReader();return{next:function(){return Mo(this,void 0,Promise,(function(){var e,n,r;return Fo(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 Ko(e){return zo(e.pipeThrough(new Ho).pipeThrough(Vo()).pipeThrough(new Wo({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 Jo(e){var t,n,r,o;return Mo(this,void 0,void 0,(function(){var i,a,s,c,u,l;return Fo(this,(function(p){switch(p.label){case 0:i=function(e){return zo(Go(e).pipeThrough(new Ho))}(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 Yo(){var e,t;return{promise:new Promise((function(n,r){e=n,t=r})),res:e,rej:t}}function $o(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 Qo=function(){return Qo=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},Qo.apply(this,arguments)},Xo=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())}))},Zo=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])}}},ei=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},ti=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=ei(t,["headers"]);return e(Qo(Qo({},i),{headers:Qo(Qo({},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 Xo(this,void 0,void 0,(function(){return Zo(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=ei(e,["botId"]);return Xo(this,void 0,void 0,(function(){return Zo(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=ei(e,["pageSize","pageNumber","botId"]);return Xo(this,void 0,void 0,(function(){var e,n;return Zo(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:Qo(Qo({},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=ei(e,["botId","conversationId"]);return Xo(this,void 0,void 0,(function(){return Zo(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 Xo(this,void 0,void 0,(function(){return Zo(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 Xo(this,void 0,void 0,(function(){return Zo(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 Xo(this,void 0,void 0,(function(){return Zo(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 Xo(this,void 0,void 0,(function(){var n;return Zo(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 ni(n)]}}))}))},e.prototype.generateBot=function(e,t){return Xo(this,void 0,void 0,(function(){var n;return Zo(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 ni(n)]}}))}))},e.prototype.getPreview=function(e,t){return Xo(this,void 0,void 0,(function(){var n;return Zo(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 ni(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 Xo(this,void 0,void 0,(function(){var n;return Zo(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 ni(n)]}}))}))},e.prototype.join=function(e){return"".concat(this.baseUrl,"/").concat(e)},e}(),ni=function(){function e(e){var t=Go(e);this._eventSourceStream=t.pipeThrough(new Ho).pipeThrough(Vo())}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 zo(this.teeedStream)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataStream",{get:function(){return zo(this.eventSourceStream.pipeThrough(new Wo({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 zo(this.dataStream.pipeThrough(new Wo({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}(),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)},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())}))},ii=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 ai(e){var t=e.messages,n=e.model,r=e.temperature,o=e.tool_choice,i=e.tools,a=e.top_p;return ri(ri({},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 si=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 oi(this,void 0,Promise,(function(){var n,r;return ii(this,(function(o){switch(o.label){case 0:return n=ai(e),[4,this.req({url:this.url,data:ri(ri({},n),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return r=o.sent(),[2,ri(ri({},r),{rawResponse:r})]}}))}))},e.prototype.doStream=function(e,t){return oi(this,void 0,Promise,(function(){var n,r,o,i;return ii(this,(function(a){switch(a.label){case 0:return n=ai(e),r=null,[4,this.req({url:this.url,data:ri(ri({},n),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return o=a.sent(),i=Go(o),[2,zo(Ko(i).pipeThrough(new Wo({transform:function(e,t){var n=e.choices.map((function(e){var t=e.delta;return null==r&&(r=$o(t)),r?ri(ri({},e),{finish_reason:"tool_calls",delta:t}):e})),o=ri(ri({},e),{choices:n});t.enqueue(ri(ri({},o),{rawResponse:e}))}})))]}}))}))},e}(),ci=function(){return ci=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},ci.apply(this,arguments)};function ui(e){var t=e.messages,n=e.model,r=e.temperature,o=e.tool_choice,i=e.tools,a=e.top_p;return ci(ci({},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 li(e){return"object"!=typeof e||null==e?e:Array.isArray(e)?e.map((function(e){return li(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?li(o):o,e}),{})}var 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)},di=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())}))},hi=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])}}},fi=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 di(this,void 0,Promise,(function(){var n;return hi(this,(function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:pi(pi({},ui(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 di(this,void 0,Promise,(function(){var n,r,o;return hi(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:pi(pi({},ui(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=Go(r),[2,zo(Ko(o).pipeThrough(new Wo({transform:function(e,t){var r=e.choices.map((function(e){var t=e.delta;return null==n&&(n=$o(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}(),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)},vi=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())}))},gi=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])}}},yi=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 vi(this,void 0,Promise,(function(){var n,r;return gi(this,(function(o){switch(o.label){case 0:return[4,this.req({url:this.url,headers:{"X-Tc-Action":"ChatCompletions"},data:mi(mi({},ui(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=o.sent(),r=li(n.Response),[2,mi(mi({},r),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return vi(this,void 0,Promise,(function(){var n,r,o;return gi(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,headers:{"X-Tc-Action":"ChatCompletions"},data:mi(mi({},e),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=Go(r),[2,zo(Ko(o).pipeThrough(new Wo({transform:function(e,t){var r=li(e),o=r.choices.map((function(e){var t=e.delta;return null==n&&(n=$o(t)),n?mi(mi({},e),{finish_reason:"tool_calls",delta:t}):e})),i=mi(mi({},r),{choices:o});t.enqueue(mi(mi({},i),{rawResponse:e}))}})))]}}))}))},e}(),bi=function(){return bi=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},bi.apply(this,arguments)},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())}))},wi=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};function _i(e){var t=e.messages,n=e.model,r=e.temperature,o=e.tools,i=e.top_p;return bi(bi({},e),{messages:t,model:n,tools:o,top_p:i,temperature:r})}var Ii=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 xi(this,void 0,Promise,(function(){var n;return wi(this,(function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:bi(bi({},_i(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,bi(bi({},n),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return xi(this,void 0,Promise,(function(){var n,r,o;return wi(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:bi(bi({},_i(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=Go(r),[2,zo(Ko(o).pipeThrough(new Wo({transform:function(e,t){var r=e.choices.map((function(e){var t=e.delta;return null==n&&(n=$o(t)),n?bi(bi({},e),{finish_reason:"tool_calls",delta:t}):e})),o=bi(bi({},e),{choices:r});t.enqueue(bi(bi({},o),{rawResponse:e}))}})))]}}))}))},e}(),Ei=function(){return Ei=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},Ei.apply(this,arguments)},Si=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())}))},Oi=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 Ti(e){var t=e.messages,n=e.model,r=e.temperature,o=e.tools,i=e.top_p;return Ei(Ei({},e),{messages:t,model:n,tools:o,top_p:i,temperature:r})}var Ai=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 Si(this,void 0,Promise,(function(){var n;return Oi(this,(function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:Ei(Ei({},Ti(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,Ei(Ei({},n),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return Si(this,void 0,Promise,(function(){var n,r,o;return Oi(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:Ei(Ei({},Ti(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=Go(r),[2,zo(Ko(o).pipeThrough(new Wo({transform:function(e,t){var r=e.choices.map((function(e){var t=Object.assign(e.delta,{role:"assistant"});return null==n&&(n=$o(t)),Ei(Ei({},e),n?{finish_reason:"tool_calls",delta:t}:{delta:t})})),o=Ei(Ei({},e),{choices:r});t.enqueue(Ei(Ei({},o),{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="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 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,i,a;return Ci(this,(function(s){switch(s.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=s.sent(),o=Go(r),i=Ko(o),a=i.pipeThrough(new Wo({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=$o(t)),Pi(Pi({},e),n?{finish_reason:"tool_calls",delta:t}:{delta:t})})),l=Pi(Pi({},e),{choices:u});t.enqueue(Pi(Pi({},l),{rawResponse:e}))}}})),[2,zo(a)]}}))}))},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="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 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=Go(r),[2,zo(Ko(o).pipeThrough(new Wo({transform:function(e,t){var r=e.choices.map((function(e){var t=e.delta;return null==n&&(n=$o(t)),n?Ui(Ui({},e),{finish_reason:"tool_calls",delta:t}):e})),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])}}},Wi=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 Fi(this,void 0,Promise,(function(){var t;return Bi(this,(function(n){switch(n.label){case 0:return[4,this.req({url:this.url,data:Mi(Mi({},ui(e)),{stream:!1}),stream:!1})];case 1:return t=n.sent(),[2,Mi(Mi({},t),{rawResponse:t})]}}))}))},e.prototype.doStream=function(e){return Fi(this,void 0,Promise,(function(){var t,n,r;return Bi(this,(function(o){switch(o.label){case 0:return t=null,[4,this.req({url:this.url,data:Mi(Mi({},ui(e)),{stream:!0}),stream:!0})];case 1:return n=o.sent(),r=Go(n),[2,zo(Ko(r).pipeThrough(new Wo({transform:function(e,n){var r=e.choices.map((function(e){var n=e.delta;return null==t&&(t=$o(n)),t?Mi(Mi({},e),{finish_reason:"tool_calls",delta:n}):e})),o=Mi(Mi({},e),{choices:r});n.enqueue(Mi(Mi({},o),{rawResponse:e}))}})))]}}))}))},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)},Gi=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())}))},Hi=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])}}},zi=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 Gi(this,void 0,Promise,(function(){var n;return Hi(this,(function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:Vi(Vi({},ui(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 Gi(this,void 0,Promise,(function(){var n,r,o;return Hi(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:Vi(Vi({},ui(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=Go(r),[2,zo(Ko(o).pipeThrough(new Wo({transform:function(e,t){var r=e.choices.map((function(e){var t=e.delta;return null==n&&(n=$o(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}(),Ki=function(){return Ki=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},Ki.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())}))},Yi=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},$i=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 Ji(this,void 0,Promise,(function(){var n;return Yi(this,(function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:Ki(Ki({},e),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,Ki(Ki({},n),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return Ji(this,void 0,Promise,(function(){var n,r,o;return Yi(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:Ki(Ki({},e),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=Go(r),[2,zo(Ko(o).pipeThrough(new Wo({transform:function(e,t){var r=e.choices.map((function(e){var t=e.delta;return null==n&&(n=$o(t)),n?Ki(Ki({},e),{finish_reason:"tool_calls",delta:t}):e})),o=Ki(Ki({},e),{choices:r});t.enqueue(Ki(Ki({},o),{rawResponse:e}))}})))]}}))}))},e}(),Qi=function(){return Qi=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},Qi.apply(this,arguments)},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())}))},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])}}},ea=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 Xi(this,void 0,Promise,(function(){var t;return Zi(this,(function(n){switch(n.label){case 0:return[4,this.req({url:this.url,data:Qi(Qi({},e),{stream:!1}),stream:!1})];case 1:return t=n.sent(),[2,Qi(Qi({},t),{rawResponse:t})]}}))}))},e.prototype.doStream=function(e){return Xi(this,void 0,Promise,(function(){var t,n,r;return Zi(this,(function(o){switch(o.label){case 0:return t=null,[4,this.req({url:this.url,data:Qi(Qi({},e),{stream:!0}),stream:!0})];case 1:return n=o.sent(),r=Go(n),[2,zo(Ko(r).pipeThrough(new Wo({transform:function(e,n){var r=e.choices.map((function(e){var n=e.delta;return null==t&&(t=$o(n)),t?Qi(Qi({},e),{finish_reason:"tool_calls",delta:n}):e})),o=Qi(Qi({},e),{choices:r});n.enqueue(Qi(Qi({},o),{rawResponse:e}))}})))]}}))}))},e}(),ta=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;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:return t=this.defaultGenerateImageSubUrl,"object"==typeof e&&e&&"model"in e&&"string"==typeof e.model&&(n=this.getGenerateImageSubUrl(this.provider,e.model))&&(t=n),[4,this.req({url:this.getGenerateUrl(t),data:e,stream:!1})];case 1:return[2,r.sent()]}}))},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}(),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)},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=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 aa(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},na(na({},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 sa=function(){function e(e){this.model=e}return e.prototype.generateText=function(e,t){var n,r;return ra(this,void 0,Promise,(function(){var o,i,a,s,c,u,l,p,d,h,f,m,v,g,y,b,x,w,_,I,E,S=this;return oa(this,(function(O){switch(O.label){case 0:return o=[],i={completion_tokens:0,prompt_tokens:0,total_tokens:0},a=aa(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=ca(h))))return[3,9];v=da(h.usage),ha(i,v),O.label=3;case 3:return O.trys.push([3,7,,8]),[4,pa(m)];case 4:return g=O.sent(),y=h.choices[0],[4,null==c?void 0:c({finishReason:y.finish_reason,messages:p.messages.slice(),text:y.message.content,toolCall:m,toolResult:g,stepUsage:v,totalUsage:Object.assign({},i)})];case 5:return O.sent(),ua(p.messages,y.message,g),[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 x=null===(n=null==h?void 0:h.choices)||void 0===n?void 0:n[0],w=null==x?void 0:x.message,_=null!==(r=null==w?void 0:w.content)&&void 0!==r?r:"",I=w?ia(ia([],p.messages,!0),[w],!1):p.messages,E=da(h.usage),ha(i,E),[4,null==c?void 0:c({finishReason:x.finish_reason,messages:I.slice(),text:_,toolCall:ca(h),toolResult:null,stepUsage:E,totalUsage:Object.assign({},i)})];case 10:return O.sent(),[2,{text:_,messages:I,usage:i,rawResponses:o}]}}))}))},e.prototype.streamText=function(e,t){var n;return ra(this,void 0,Promise,(function(){var r,o,i,a,s,c,u,l,p,d,h,f,m,v,g,y,b,x,w,_,I,E,S,O,T,A,P,R,C,N,k,U,j,L,D,q,M=this;return oa(this,(function(F){switch(F.label){case 0:return r={completion_tokens:0,prompt_tokens:0,total_tokens:0},o=aa(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,h=null,f=function(){var e=p.tee(),t=e[0],n=e[1];return p=zo(t),function(e){var t,n,r,o,i,a,s,c,u,l;return ra(this,void 0,Promise,(function(){var p,d,h,f,m,v,g,y,b,x,w,_,I;return oa(this,(function(E){switch(E.label){case 0:p={completion_tokens:0,prompt_tokens:0,total_tokens:0},d=zo(e),f={role:"assistant",content:"",tool_calls:[h={id:"",function:{name:"",arguments:""},type:""}]},E.label=1;case 1:E.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),E.label=2;case 2:return[4,v.next()];case 3:if(g=E.sent(),t=g.done)return[3,5];o=g.value,m=!1;try{if(!(b=null==(y=o)?void 0:y.choices[0]))return[2,null];if(x=b.finish_reason,w=b.delta,"tool_calls"!==x)return[2,null];if(!w)return[3,4];if(w.content&&(f.content+=w.content),!("tool_calls"in w))return[3,4];(null==(_=null===(i=null==w?void 0:w.tool_calls)||void 0===i?void 0:i[0])?void 0:_.id)&&(h.id=_.id),(null==_?void 0:_.type)&&(h.type=_.type),(null===(a=null==_?void 0:_.function)||void 0===a?void 0:a.name)&&(h.function.name=_.function.name),(null===(s=null==_?void 0:_.function)||void 0===s?void 0:s.arguments)&&(h.function.arguments+=_.function.arguments),(null===(c=null==y?void 0:y.usage)||void 0===c?void 0:c.completion_tokens)&&(p.completion_tokens=y.usage.completion_tokens),(null===(u=null==y?void 0:y.usage)||void 0===u?void 0:u.prompt_tokens)&&(p.prompt_tokens=y.usage.prompt_tokens),(null===(l=null==y?void 0:y.usage)||void 0===l?void 0:l.total_tokens)&&(p.total_tokens=y.usage.total_tokens)}finally{m=!0}E.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return I=E.sent(),n={error:I},[3,12];case 7:return E.trys.push([7,,10,11]),m||t||!(r=v.return)?[3,9]:[4,r.call(v)];case 8:E.sent(),E.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)},F.label=2;case 2:return(m=d<c)?[4,f()]:[3,4];case 3:m=null!=(h=F.sent()),F.label=4;case 4:if(!m)return[3,11];v=h.message,g=h.usage,ha(r,g),y=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,pa(y)];case 6:return b=F.sent(),[4,null==a?void 0:a({finishReason:"tool_calls",messages:u.messages.slice(),text:v.content,toolCall:y,toolResult:b,stepUsage:g,totalUsage:Object.assign({},r)})];case 7:return F.sent(),ua(u.messages,v,b),[4,l()];case 8:return p=F.sent(),[3,10];case 9:return x=F.sent(),w=p.tee(),_=w[0],I=w[1],[2,{messages:Promise.resolve(u.messages),dataStream:zo(_),textStream:zo(I.pipeThrough(new Wo({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:x}];case 10:return[3,2];case 11:return[4,f()];case 12:return(h=F.sent())?(E=h.message,S=h.usage,ha(r,S),O=ia(ia([],u.messages,!0),[E],!1),a({messages:O.slice(),finishReason:"tool_call",stepUsage:S,text:E.content,toolCall:E.tool_calls[0],totalUsage:Object.assign({},r)}),T=p.tee(),A=T[0],P=T[1],[2,{messages:Promise.resolve(ia(ia([],u.messages,!0),[E],!1)),dataStream:zo(A),textStream:zo(P.pipeThrough(new Wo({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=Yo(),C=Yo(),N={role:"assistant",content:""},k="",U={completion_tokens:0,prompt_tokens:0,total_tokens:0},j=p.pipeThrough(new Wo({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(ia(ia([],u.messages,!0),[N],!1)),ha(r,U),C.res(Object.assign({},r)),null==a||a({messages:ia(ia([],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:zo(D),textStream:zo(q.pipeThrough(new Wo({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 ca(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&&$o(o)?o.tool_calls[0]:null}function ua(e,t,n){e.push(t,{role:"tool",tool_call_id:t.tool_calls[0].id,content:JSON.stringify(n)})}var la=new Map;function pa(e){return la.get(e.function.name)(JSON.parse(e.function.arguments))}function da(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 ha(e,t){e.completion_tokens+=t.completion_tokens,e.prompt_tokens+=t.prompt_tokens,e.total_tokens+=t.total_tokens}var fa={hunyuan:yi,"hunyuan-beta":fi,ark:Ii,dashscope:Ai,"01-ai":ki,moonshot:qi,zhipu:si,"hunyuan-exp":Wi,"hunyuan-open":zi,deepseek:$i},ma=function(){return ma=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},ma.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())}))},ga=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=fa,ba=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 va(i,void 0,void 0,(function(){var e,i,s,c,u,l,p;return ga(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:ma(ma((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 va(i,void 0,void 0,(function(){var e,r,i,u,l,p,d,h,f;return ga(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:ma(ma((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 ti(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 va(this,void 0,void 0,(function(){var o,i,a,s,c=this;return ga(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: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,Jo(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=ya[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 ea(this.modelRequest,this.aiBaseUrl,"".concat(e).concat(o))}return new sa(n)},e.prototype.registerModel=function(e,t){null==ya[e]?ya[e]=t:console.warn("AI model ".concat(e," already exists!"))},e.prototype.createImageModel=function(e){return new ta(this.modelRequest,this.aiBaseUrl,e)},e.prototype.registerFunctionTool=function(e){la.has(e.name)&&console.warn("AI function tool ".concat(e.name," already exists and will be overwritten!")),la.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}(),xa=function(){return xa=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},xa.apply(this,arguments)},wa=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},_a=(wa(t,["MODELS"]),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=wa(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(xa({headers:xa({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}}});function Ia(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 ba(function(){if(null==a){if(null==i)throw new Error("`getAccessToken` is required when `handleReqInstance` is not provided!");return _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)}var Ea={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)?Ia({req:n,baseUrl:e.baseUrl,handleReqInstance:function(e){return e.req},i18n:this.config.i18n}):Ia({req:n,baseUrl:r(),getBaseUrl:r,handleReqInstance:function(e){return e.req},i18n:this.config.i18n})}}};function Sa(e){try{e.registerComponent(Ea)}catch(e){console.warn(e)}}try{window.registerAi=Sa}catch(e){}var Oa=function(){return Oa=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},Oa.apply(this,arguments)};function Ta(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;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(v){switch(v.label){case 0:return r={},n.headers instanceof Headers?n.headers.forEach((function(e,t){r[t]=e})):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(Oa(Oa({url:i},n),{headers:Oa({"Content-Type":"application/json"},r),shouldThrowOnError:!1}))];case 1:d=v.sent(),f={},v.label=2;case 2:return v.trys.push([2,4,,5]),[4,d.data];case 3:return f=v.sent(),[3,5];case 4:if(!(m=v.sent()).message.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: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,So.generatePGClient)(e,{pgBaseUrl:m,fetch:f}):(0,So.generateMySQLClient)(e,{mysqlBaseUrl:m,fetch:f})}var Aa={name:"mysql",entity:{mysql:function(e){return Ta(this,e,!1)(e)}}},Pa={name:"rdb",entity:{rdb:function(e){return Ta(this,e,!0)(e)}}};try{cloudbase.registerComponent(Aa),cloudbase.registerComponent(Pa)}catch(e){}function Ra(e){try{e.registerComponent(Aa),e.registerComponent(Pa)}catch(e){console.warn(e)}}try{window.registerMySQL=Ra}catch(e){}var Ca=function(){return Ca=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},Ca.apply(this,arguments)},Na=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])}}};function Ua(e,t){var n,r,o,i;return Na(this,void 0,Promise,(function(){var a,s,c,u,l,p,d,h,f,m,v,g,y,b,x,w,_,I,E,S,O,T,A;return ka(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:At.ERRORS.INVALID_PARAMS,msg:"[apis] invalid api name"}));return g="",b=(y=this).gatewayOrigin,x=y.getAccessToken,w=y.env,b?g="".concat(b,"/v1"):this.getEndPointWithKey?(_=this.getEndPointWithKey("GATEWAY"),I=_.BASE_URL,E=_.PROTOCOL,g="".concat(E).concat(I)):g="https://".concat(w,".api.tcloudbasegateway.com/v1"),S="".concat(g,"/apis/").concat(s),O=l.startsWith("/")?l:"/".concat(l),x?[4,x()]:[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(Ca(Ca(Ca({url:"".concat(S).concat(O),method:d||"POST",headers:Ca({"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 ja=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH","REQUEST"];function La(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(!ja.includes(o))throw new Error("[apis] invalid method: ".concat(r));return function(n,r){return Na(t,void 0,void 0,(function(){return ka(this,(function(t){switch(t.label){case 0:return[4,Ua.call(this,Ca({name:e,method:("REQUEST"===o?n.method:o)||"POST"},n),r)];case 1:return[2,t.sent()]}}))}))}}})}function Da(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 La.call(t,n)}})}var qa,Ma,Fa="apis",Ba={name:Fa,IIFE:!0,entity:function(){Object.defineProperty(this.prototype,Fa,{get:function(){return Da.call(this)},configurable:!0,enumerable:!0})}};function Wa(e){try{e.registerComponent(Ba)}catch(e){console.warn(e)}}try{cloudbase.registerComponent(Ba)}catch(e){}try{window.registerApis=Wa}catch(e){}!function(e){e.DocIDError="文档ID不合法",e.CollNameError="集合名称不合法",e.OpStrError="操作符不合法",e.DirectionError="排序字符不合法",e.IntergerError="must be integer",e.QueryParamTypeError="查询参数必须为对象",e.QueryParamValueError="查询参数对象值不能均为undefined"}(Ma||(Ma={}));var Va,Ga,Ha="Object",za="GeoPoint",Ka="GeoLineString",Ja="GeoPolygon",Ya="GeoMultiPoint",$a="GeoMultiLineString",Qa="GeoMultiPolygon",Xa="Date",Za="ServerDate",es=["desc","asc"],ts=["<","<=","==",">=",">"];!function(e){e.lt="<",e.gt=">",e.lte="<=",e.gte=">=",e.eq="=="}(Va||(Va={})),(qa={})[Va.eq]="$eq",qa[Va.lt]="$lt",qa[Va.lte]="$lte",qa[Va.gt]="$gt",qa[Va.gte]="$gte",function(e){e.WHERE="WHERE",e.DOC="DOC"}(Ga||(Ga={}));var ns=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)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)}}(),rs=[],os={},is=function(e){function t(t,n){if(n!==os)throw new TypeError("InternalSymbol cannot be constructed with new operator");return e.call(this,t)||this}return ns(t,e),t.for=function(e){for(var n=0,r=rs.length;n<r;n++)if(rs[n].target===e)return rs[n].instance;var o=new t(e,os);return rs.push({target:e,instance:o}),o},t}((function(e){Object.defineProperties(this,{target:{enumerable:!1,writable:!1,configurable:!1,value:e}})}));const as=is;var ss=as.for("UNSET_FIELD_NAME"),cs=as.for("UPDATE_COMMAND"),us=as.for("QUERY_COMMAND"),ls=as.for("LOGIC_COMMAND"),ps=as.for("GEO_POINT"),ds=as.for("SYMBOL_GEO_LINE_STRING"),hs=as.for("SYMBOL_GEO_POLYGON"),fs=as.for("SYMBOL_GEO_MULTI_POINT"),ms=as.for("SYMBOL_GEO_MULTI_LINE_STRING"),vs=as.for("SYMBOL_GEO_MULTI_POLYGON"),gs=as.for("SERVER_DATE"),ys=as.for("REGEXP"),bs=function(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()},xs=function(e){return"object"===bs(e)},ws=function(e){return"number"===bs(e)},_s=function(e){return Array.isArray(e)},Is=function(e){return"date"===bs(e)},Es=function(e){return"regexp"===bs(e)},Ss=function(e){return e&&e._internalType instanceof is},Os=function(){function e(e){if(!_s(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 Fs))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||!_s(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(!ws(i[0])||!ws(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 ds},enumerable:!1,configurable:!0}),e}(),Ts=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.")},As=function(){function e(e){if(!_s(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 Os))throw new TypeError('"lines" must be of type LineString[]. Received type '.concat(typeof e,"[]"));if(!Os.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||!_s(e.coordinates))return!1;try{for(var i=Ts(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,Ts(s)),u=c.next();!u.done;u=c.next()){var l=u.value;if(!ws(l[0])||!ws(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 vs},enumerable:!1,configurable:!0}),e}(),Ps=function(){function e(e){if(!_s(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 Fs))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||!_s(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(!ws(i[0])||!ws(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 fs},enumerable:!1,configurable:!0}),e}(),Rs=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.")},Cs=function(){function e(e){if(!_s(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 Os))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||!_s(e.coordinates))return!1;try{for(var i=Rs(e.coordinates),a=i.next();!a.done;a=i.next()){var s=a.value;try{for(var c=(r=void 0,Rs(s)),u=c.next();!u.done;u=c.next()){var l=u.value;if(!ws(l[0])||!ws(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 ms},enumerable:!1,configurable:!0}),e}(),Ns=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.")},ks=function(){function e(e){var t,n;if(!_s(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=Ns(e),o=r.next();!o.done;o=r.next()){var i=o.value;if(!(i instanceof As))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||!_s(e.coordinates))return!1;try{for(var s=Ns(e.coordinates),c=s.next();!c.done;c=s.next()){var u=c.value;try{for(var l=(r=void 0,Ns(u)),p=l.next();!p.done;p=l.next()){var d=p.value;try{for(var h=(i=void 0,Ns(d)),f=h.next();!f.done;f=h.next()){var m=f.value;if(!ws(m[0])||!ws(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 hs},enumerable:!1,configurable:!0}),e}(),Us=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 gs},enumerable:!1,configurable:!0}),e.prototype.parse=function(){return{$date:{offset:this.offset}}},e}();function js(e){return new Us(e)}var Ls,Ds=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},qs=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 za:o=new Fs(i.coordinates[0],i.coordinates[1]);break;case Ka:o=new Os(i.coordinates.map((function(e){return new Fs(e[0],e[1])})));break;case Ja:o=new As(i.coordinates.map((function(e){return new Os(e.map((function(e){var t=Ds(e,2),n=t[0],r=t[1];return new Fs(n,r)})))})));break;case Ya:o=new Ps(i.coordinates.map((function(e){return new Fs(e[0],e[1])})));break;case $a:o=new Cs(i.coordinates.map((function(e){return new Os(e.map((function(e){var t=Ds(e,2),n=t[0],r=t[1];return new Fs(n,r)})))})));break;case Qa:o=new ks(i.coordinates.map((function(e){return new As(e.map((function(e){return new Os(e.map((function(e){var t=Ds(e,2),n=t[0],r=t[1];return new Fs(n,r)})))})))})));break;case Xa:o=new Date(1e3*i.$timestamp);break;case Ha:case"Array":o=e.formatField(i);break;case Za:o=new Date(i.$date);break;default:o=i}Array.isArray(r)?r.push(o):r[n]=o})),r},e.whichType=function(e){var t=Object.prototype.toString.call(e).slice(8,-1);if(t===Xa)return"BsonDate";if(t===Ha){if(e instanceof Fs)return za;if(e instanceof Date)return Xa;if(e instanceof Us)return Za;e.$timestamp?t=Xa:e.$date?t=Za:Fs.validate(e)?t=za:Os.validate(e)?t=Ka:As.validate(e)?t=Ja:Ps.validate(e)?t=Ya:Cs.validate(e)?t=$a:ks.validate(e)&&(t=Qa)}return t},e.generateDocId=function(){for(var e="",t=0;t<24;t++)e+="ABCDEFabcdef0123456789".charAt(Math.floor(22*Math.random()));return e},e}(),Ms=function(){function e(){}return e.isGeopoint=function(e,t){if("Number"!==qs.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+Ma.IntergerError);return!0},e.isFieldOrder=function(e){if(-1===es.indexOf(e))throw new Error(Ma.DirectionError);return!0},e.isFieldPath=function(e){if(!/^[a-zA-Z0-9-_\.]/.test(e))throw new Error;return!0},e.isOperator=function(e){if(-1===ts.indexOf(e))throw new Error(Ma.OpStrError);return!0},e.isCollName=function(e){if(!/^[a-zA-Z0-9]([a-zA-Z0-9-_]){1,32}$/.test(e))throw new Error(Ma.CollNameError);return!0},e.isDocID=function(e){if(!/^([a-fA-F0-9]){24}$/.test(e))throw new Error(Ma.DocIDError);return!0},e}(),Fs=function(){function e(e,t){Ms.isGeopoint("longitude",e),Ms.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&&_s(e.coordinates)&&Ms.isGeopoint("longitude",e.coordinates[0])&&Ms.isGeopoint("latitude",e.coordinates[1])},Object.defineProperty(e.prototype,"_internalType",{get:function(){return ps},enumerable:!1,configurable:!0}),e}(),Bs=function(){var e=function(){};if(!Promise){e.promise={};var t=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}var n=new Promise((function(t,n){e=function(e,r){return e?n(e):t(r)}}));return e.promise=n,e};!function(e){e.SET="set",e.REMOVE="remove",e.INC="inc",e.MUL="mul",e.PUSH="push",e.PULL="pull",e.PULL_ALL="pullAll",e.POP="pop",e.SHIFT="shift",e.UNSHIFT="unshift",e.ADD_TO_SET="addToSet",e.BIT="bit",e.RENAME="rename",e.MAX="max",e.MIN="min"}(Ls||(Ls={}));var Ws,Vs=function(){function e(e,t,n){this._internalType=cs,Object.defineProperties(this,{_internalType:{enumerable:!1,configurable:!1}}),this.operator=e,this.operands=t,this.fieldName=n||ss}return e.prototype._setFieldName=function(t){return new e(this.operator,this.operands,t)},e}();function Gs(e){return e&&e instanceof Vs&&e._internalType===cs}!function(e){e.AND="and",e.OR="or",e.NOT="not",e.NOR="nor"}(Ws||(Ws={}));var Hs=function(){function e(e,t,n){if(this._internalType=ls,Object.defineProperties(this,{_internalType:{enumerable:!1,configurable:!1}}),this.operator=e,this.operands=t,this.fieldName=n||ss,this.fieldName!==ss)if(Array.isArray(t)){t=t.slice(),this.operands=t;for(var r=0,o=t.length;r<o;r++)(zs(i=t[r])||$s(i))&&(t[r]=i._setFieldName(this.fieldName))}else{var i;(zs(i=t)||$s(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(Ws.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(Ws.OR,r,this.fieldName)},e}();function zs(e){return e&&e instanceof Hs&&e._internalType===ls}var Ks,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)}}();!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"}(Ks||(Ks={}));var Ys=function(e){function t(t,n,r){var o=e.call(this,t,n,r)||this;return o.operator=t,o._internalType=us,o}return Js(t,e),t.prototype.toJSON=function(){var e,t;switch(this.operator){case Ks.IN:case Ks.NIN:return(e={})["$"+this.operator]=this.operands,e;default:return(t={})["$"+this.operator]=this.operands[0],t}},t.prototype._setFieldName=function(e){return new t(this.operator,this.operands,e)},t.prototype.eq=function(e){var n=new t(Ks.EQ,[e],this.fieldName);return this.and(n)},t.prototype.neq=function(e){var n=new t(Ks.NEQ,[e],this.fieldName);return this.and(n)},t.prototype.gt=function(e){var n=new t(Ks.GT,[e],this.fieldName);return this.and(n)},t.prototype.gte=function(e){var n=new t(Ks.GTE,[e],this.fieldName);return this.and(n)},t.prototype.lt=function(e){var n=new t(Ks.LT,[e],this.fieldName);return this.and(n)},t.prototype.lte=function(e){var n=new t(Ks.LTE,[e],this.fieldName);return this.and(n)},t.prototype.in=function(e){var n=new t(Ks.IN,e,this.fieldName);return this.and(n)},t.prototype.nin=function(e){var n=new t(Ks.NIN,e,this.fieldName);return this.and(n)},t.prototype.geoNear=function(e){if(!(e.geometry instanceof Fs))throw new TypeError('"geometry" must be of type Point. Received type '.concat(typeof e.geometry));if(void 0!==e.maxDistance&&!ws(e.maxDistance))throw new TypeError('"maxDistance" must be of type Number. Received type '.concat(typeof e.maxDistance));if(void 0!==e.minDistance&&!ws(e.minDistance))throw new TypeError('"minDistance" must be of type Number. Received type '.concat(typeof e.minDistance));var n=new t(Ks.GEO_NEAR,[e],this.fieldName);return this.and(n)},t.prototype.geoWithin=function(e){if(!(e.geometry instanceof ks||e.geometry instanceof As))throw new TypeError('"geometry" must be of type Polygon or MultiPolygon. Received type '.concat(typeof e.geometry));var n=new t(Ks.GEO_WITHIN,[e],this.fieldName);return this.and(n)},t.prototype.geoIntersects=function(e){if(!(e.geometry instanceof Fs||e.geometry instanceof Os||e.geometry instanceof As||e.geometry instanceof Ps||e.geometry instanceof Cs||e.geometry instanceof ks))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(Ks.GEO_INTERSECTS,[e],this.fieldName);return this.and(n)},t}(Hs);function $s(e){return e&&e instanceof Ys&&e._internalType===us}function Qs(e){return $s(e)}var Xs={};for(var Zs in Ks)Xs[Zs]="$"+Zs;for(var Zs in Ws)Xs[Zs]="$"+Zs;for(var Zs in Ls)Xs[Zs]="$"+Zs;function ec(e){return Xs[e]||"$"+e}Xs[Ks.NEQ]="$ne",Xs[Ls.REMOVE]="$unset",Xs[Ls.SHIFT]="$pop",Xs[Ls.UNSHIFT]="$push";var tc=function(){return tc=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},tc.apply(this,arguments)},nc=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},rc=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 oc(e){return ic(e,[e])}function ic(e,t){if(!Ss(e)){if(Is(e))return{$date:+e};if(Es(e))return{$regex:e.source,$options:e.flags};if(_s(e))return e.map((function(e){if(t.indexOf(e)>-1)throw new Error("Cannot convert circular structure to JSON");return ic(e,rc(rc([],nc(t),!1),[e],!1))}));if(xs(e)){var n=tc({},e);for(var r in n){if(t.indexOf(n[r])>-1)throw new Error("Cannot convert circular structure to JSON");n[r]=ic(n[r],rc(rc([],nc(t),!1),[n[r]],!1))}return n}return e}switch(e._internalType){case ps:return e.toJSON();case gs:case ys:return e.parse();default:return e.toJSON?e.toJSON():e}}var ac=function(){return ac=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},ac.apply(this,arguments)},sc=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},cc=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 uc(e,t,n,r){var o=ac({},e);for(var i in e)if(!/^\$/.test(i)){var a=e[i];if(a&&xs(a)&&!t(a)){if(r.indexOf(a)>-1)throw new Error("Cannot convert circular structure to JSON");var s=uc(a,t,cc(cc([],sc(n),!1),[i],!1),cc(cc([],sc(r),!1),[a],!1));o[i]=s;var c=!1;for(var u in s)/^\$/.test(u)?c=!0:(o["".concat(i,".").concat(u)]=s[u],delete o[i][u]);c||delete o[i]}}return o}function lc(e){return uc(e,dc,[],[e])}function pc(e,t,n){for(var r in t[n]||delete e[n],t)e[r]?_s(e[r])?e[r].push(t[r]):xs(e[r])?xs(t[r])?Object.assign(e[r],t[r]):(console.warn("unmergable condition, query is object but condition is ".concat(bs(t),", can only overwrite"),t,n),e[r]=t[r]):(console.warn("to-merge query is of type ".concat(bs(e),", can only overwrite"),e,t,n),e[r]=t[r]):e[r]=t[r]}function dc(e){return Ss(e)||Is(e)||Es(e)}function hc(e){return oc(e)}var fc=function(){function e(){}return e.encode=function(t){return(new e).encodeUpdate(t)},e.prototype.encodeUpdate=function(e){return Gs(e)?this.encodeUpdateCommand(e):"object"===bs(e)?this.encodeUpdateObject(e):e},e.prototype.encodeUpdateCommand=function(e){if(e.fieldName===ss)throw new Error("Cannot encode a comparison command with unset field name");switch(e.operator){case Ls.PUSH:case Ls.PULL:case Ls.PULL_ALL:case Ls.POP:case Ls.SHIFT:case Ls.UNSHIFT:case Ls.ADD_TO_SET:return this.encodeArrayUpdateCommand(e);default:return this.encodeFieldUpdateCommand(e)}},e.prototype.encodeFieldUpdateCommand=function(e){var t,n,r,o,i=ec(e.operator);return e.operator===Ls.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=ec(e.operator);switch(e.operator){case Ls.PUSH:var d=void 0;return d=_s(e.operands)?{$each:e.operands.map(hc)}:e.operands,(t={})[p]=((n={})[e.fieldName]=d,n),t;case Ls.UNSHIFT:return d={$each:e.operands.map(hc),$position:0},(r={})[p]=((o={})[e.fieldName]=d,o),r;case Ls.POP:return(i={})[p]=((a={})[e.fieldName]=1,a),i;case Ls.SHIFT:return(s={})[p]=((c={})[e.fieldName]=-1,c),s;default:return(u={})[p]=((l={})[e.fieldName]=hc(e.operands),l),u}},e.prototype.encodeUpdateObject=function(e){var t=lc(e);for(var n in t)if(!/^\$/.test(n)){var r=t[n];if(Gs(r))t[n]=r._setFieldName(n),pc(t,this.encodeUpdateCommand(t[n]),n);else{t[n]=r=hc(r);var o=new Vs(Ls.SET,[r],n);pc(t,this.encodeUpdateCommand(o),n)}}return t},e}(),mc={};function vc(e){if(!Xc.wsClientClass)throw new Error("to use realtime you must import realtime module first");var t=e.config.env;return mc[t]||(mc[t]=new Xc.wsClientClass({context:{appConfig:{docSizeLimit:1e3,realtimePingInterval:1e4,realtimePongWaitTimeout:5e3,request:Xc.createRequest(e.config)}}})),mc[t]}var gc=function(){return gc=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},gc.apply(this,arguments)},yc=function(){function e(e,t,n,r){void 0===r&&(r={});var o=this;this.watch=function(e){return vc(o._db).watch(gc(gc({},e),{envId:o._db.config.env,collectionName:o._coll,query:JSON.stringify({_id:o.id})}))},this._db=e,this._coll=t,this.id=n,this.request=Xc.createRequest(this._db.config),this.projection=r}return e.prototype.create=function(e,t){t=t||Bs();var n=Array.isArray(e),r={collectionName:this._coll,data:n?e.map((function(e){return oc(e)})):oc(e)};return!n&&this.id&&(r._id=this.id),this.request.send("database.addDocument",r).then((function(e){var r;e.code?t(0,e):t(0,n?{ids:(null===(r=e.data)||void 0===r?void 0:r.insertedIds)||[],requestId:e.requestId}:{id:e.data._id,requestId:e.requestId})})).catch((function(e){t(e)})),t.promise},e.prototype.set=function(e,t){if(t=t||Bs(),!this.id)return Promise.resolve({code:"INVALID_PARAM",message:"docId不能为空"});if(!e||"object"!=typeof e)return Promise.resolve({code:"INVALID_PARAM",message:"参数必需是非空对象"});if(e.hasOwnProperty("_id"))return Promise.resolve({code:"INVALID_PARAM",message:"不能更新_id的值"});var n=!1,r=function(e){if("object"==typeof e)for(var t in e)e[t]instanceof Vs?n=!0:"object"==typeof e[t]&&r(e[t])};if(r(e),n)return Promise.resolve({code:"DATABASE_REQUEST_FAILED",message:"update operator complicit"});var o={collectionName:this._coll,queryType:Ga.DOC,data:oc(e),multi:!1,merge:!1,upsert:!0};return this.id&&(o.query={_id:this.id}),this.request.send("database.updateDocument",o).then((function(e){e.code?t(0,e):t(0,{updated:e.data.updated,upsertedId:e.data.upserted_id,requestId:e.requestId})})).catch((function(e){t(e)})),t.promise},e.prototype.update=function(e,t){if(t=t||Bs(),!e||"object"!=typeof e)return Promise.resolve({code:"INVALID_PARAM",message:"参数必需是非空对象"});if(e.hasOwnProperty("_id"))return Promise.resolve({code:"INVALID_PARAM",message:"不能更新_id的值"});var n={_id:this.id},r={collectionName:this._coll,data:fc.encode(e),query:n,queryType:Ga.DOC,multi:!1,merge:!0,upsert:!1};return this.request.send("database.updateDocument",r).then((function(e){e.code?t(0,e):t(0,{updated:e.data.updated,upsertedId:e.data.upserted_id,requestId:e.requestId})})).catch((function(e){t(e)})),t.promise},e.prototype.remove=function(e){e=e||Bs();var t={_id:this.id},n={collectionName:this._coll,query:t,queryType:Ga.DOC,multi:!1};return this.request.send("database.deleteDocument",n).then((function(t){t.code?e(0,t):e(0,{deleted:t.data.deleted,requestId:t.requestId})})).catch((function(t){e(t)})),e.promise},e.prototype.get=function(e){e=e||Bs();var t={_id:this.id},n={collectionName:this._coll,query:t,queryType:Ga.DOC,multi:!1,projection:this.projection};return this.request.send("database.queryDocument",n).then((function(t){if(t.code)e(0,t);else{var n=qs.formatResDocumentData(t.data.list);e(0,{data:n,requestId:t.requestId})}})).catch((function(t){e(t)})),e.promise},e.prototype.field=function(t){for(var n in t)t[n]?t[n]=1:t[n]=0;return new e(this._db,this._coll,this.id,t)},e}(),bc=function(){function e(){}return e.encode=function(e){return(new xc).encodeQuery(e)},e}(),xc=function(){function e(){}return e.prototype.encodeQuery=function(e,t){var n;return dc(e)?zs(e)?this.encodeLogicCommand(e):$s(e)?this.encodeQueryCommand(e):((n={})[t]=this.encodeQueryObject(e),n):xs(e)?this.encodeQueryObject(e):e},e.prototype.encodeRegExp=function(e){return{$regex:e.source,$options:e.flags}},e.prototype.encodeLogicCommand=function(e){var t,n,r,o,i,a,s,c=this;switch(e.operator){case Ws.NOR:case Ws.AND:case Ws.OR:var u=ec(e.operator),l=e.operands.map((function(t){return c.encodeQuery(t,e.fieldName)}));return(t={})[u]=l,t;case Ws.NOT:u=ec(e.operator);var p=e.operands[0];return Es(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=ec(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 Qs(e),this.encodeComparisonCommand(e)},e.prototype.encodeComparisonCommand=function(e){var t,n,r,o,i,a,s,c,u;if(e.fieldName===ss)throw new Error("Cannot encode a comparison command with unset field name");var l=ec(e.operator);switch(e.operator){case Ks.EQ:case Ks.NEQ:case Ks.LT:case Ks.LTE:case Ks.GT:case Ks.GTE:case Ks.ELEM_MATCH:case Ks.EXISTS:case Ks.SIZE:case Ks.MOD:return(t={})[e.fieldName]=((n={})[l]=hc(e.operands[0]),n),t;case Ks.IN:case Ks.NIN:case Ks.ALL:return(r={})[e.fieldName]=((o={})[l]=hc(e.operands),o),r;case Ks.GEO_NEAR:var p=e.operands[0];return(i={})[e.fieldName]={$nearSphere:{$geometry:p.geometry.toJSON(),$maxDistance:p.maxDistance,$minDistance:p.minDistance}},i;case Ks.GEO_WITHIN:return p=e.operands[0],(a={})[e.fieldName]={$geoWithin:{$geometry:p.geometry.toJSON()}},a;case Ks.GEO_INTERSECTS:return p=e.operands[0],(s={})[e.fieldName]={$geoIntersects:{$geometry:p.geometry.toJSON()}},s;default:return(c={})[e.fieldName]=((u={})[l]=hc(e.operands[0]),u),c}},e.prototype.encodeQueryObject=function(e){var t=lc(e);for(var n in t){var r=t[n];if(zs(r)){t[n]=r._setFieldName(n);var o=this.encodeLogicCommand(t[n]);this.mergeConditionAfterEncode(t,o,n)}else Qs(r)?(t[n]=r._setFieldName(n),o=this.encodeComparisonCommand(t[n]),this.mergeConditionAfterEncode(t,o,n)):dc(r)&&(t[n]=hc(r))}return t},e.prototype.mergeConditionAfterEncode=function(e,t,n){for(var r in t[n]||delete e[n],t)e[r]?_s(e[r])?e[r]=e[r].concat(t[r]):xs(e[r])?xs(t[r])?Object.assign(e,t):(console.warn("unmergable condition, query is object but condition is ".concat(bs(t),", can only overwrite"),t,n),e[r]=t[r]):(console.warn("to-merge query is of type ".concat(bs(e),", can only overwrite"),e,t,n),e[r]=t[r]):e[r]=t[r]},e}(),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)},_c=function(){function e(e,t,n,r,o){var i=this;this.watch=function(e){return vc(i._db).watch(wc(wc({},e),{envId:i._db.config.env,collectionName:i._coll,query:JSON.stringify(i._fieldFilters||{}),limit:i._queryOptions.limit,orderBy:i._fieldOrders?i._fieldOrders.reduce((function(e,t){return e[t.field]=t.direction,e}),{}):void 0}))},this._db=e,this._coll=t,this._fieldFilters=n,this._fieldOrders=r||[],this._queryOptions=o||{},this._request=Xc.createRequest(this._db.config)}return e.prototype.get=function(e){e=e||Bs();var t=[];this._fieldOrders&&this._fieldOrders.forEach((function(e){t.push(e)}));var n={collectionName:this._coll,queryType:Ga.WHERE};return this._fieldFilters&&(n.query=this._fieldFilters),t.length>0&&(n.order=t),this._queryOptions.offset&&(n.offset=this._queryOptions.offset),this._queryOptions.limit?n.limit=this._queryOptions.limit<1e3?this._queryOptions.limit:1e3:n.limit=100,this._queryOptions.projection&&(n.projection=this._queryOptions.projection),this._request.send("database.queryDocument",n).then((function(t){if(t.code)e(0,t);else{var n={data:qs.formatResDocumentData(t.data.list),requestId:t.requestId};void 0!==t.total&&(n.total=t.total),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.offset&&(n.offset=t.offset),e(0,n)}})).catch((function(t){e(t)})),e.promise},e.prototype.count=function(e){e=e||Bs();var t={collectionName:this._coll,queryType:Ga.WHERE};return this._fieldFilters&&(t.query=this._fieldFilters),this._request.send("database.countDocument",t).then((function(t){t.code?e(0,t):e(0,{requestId:t.requestId,total:t.data.total})})).catch((function(t){e(t)})),e.promise},e.prototype.where=function(t){if("Object"!==Object.prototype.toString.call(t).slice(8,-1))throw Error(Ma.QueryParamTypeError);var n=Object.keys(t),r=n.some((function(e){return void 0!==t[e]}));if(n.length&&!r)throw Error(Ma.QueryParamValueError);return new e(this._db,this._coll,bc.encode(t),this._fieldOrders,this._queryOptions)},e.prototype.orderBy=function(t,n){Ms.isFieldPath(t),Ms.isFieldOrder(n);var r={field:t,direction:n},o=this._fieldOrders.concat(r);return new e(this._db,this._coll,this._fieldFilters,o,this._queryOptions)},e.prototype.limit=function(t){Ms.isInteger("limit",t);var n=wc({},this._queryOptions);return n.limit=t,new e(this._db,this._coll,this._fieldFilters,this._fieldOrders,n)},e.prototype.skip=function(t){Ms.isInteger("offset",t);var n=wc({},this._queryOptions);return n.offset=t,new e(this._db,this._coll,this._fieldFilters,this._fieldOrders,n)},e.prototype.update=function(e,t){if(t=t||Bs(),!e||"object"!=typeof e)return Promise.resolve({code:"INVALID_PARAM",message:"参数必需是非空对象"});if(e.hasOwnProperty("_id"))return Promise.resolve({code:"INVALID_PARAM",message:"不能更新_id的值"});var n={collectionName:this._coll,query:this._fieldFilters,queryType:Ga.WHERE,multi:!0,merge:!0,upsert:!1,data:fc.encode(e)};return this._request.send("database.updateDocument",n).then((function(e){e.code?t(0,e):t(0,{requestId:e.requestId,updated:e.data.updated,upsertId:e.data.upsert_id})})).catch((function(e){t(e)})),t.promise},e.prototype.field=function(t){for(var n in t)t[n]?"object"!=typeof t[n]&&(t[n]=1):t[n]=0;var r=wc({},this._queryOptions);return r.projection=t,new e(this._db,this._coll,this._fieldFilters,this._fieldOrders,r)},e.prototype.remove=function(e){e=e||Bs(),Object.keys(this._queryOptions).length>0&&console.warn("`offset`, `limit` and `projection` are not supported in remove() operation"),this._fieldOrders.length>0&&console.warn("`orderBy` is not supported in remove() operation");var t={collectionName:this._coll,query:bc.encode(this._fieldFilters),queryType:Ga.WHERE,multi:!0};return this._request.send("database.deleteDocument",t).then((function(t){t.code?e(0,t):e(0,{requestId:t.requestId,deleted:t.data.deleted})})).catch((function(t){e(t)})),e.promise},e}();const Ic=(e=>{var t={};return f.d(t,e),t})({EJSON:()=>p.EJSON});var Ec=function(){function e(e,t){this._stages=[],e&&t&&(this._db=e,this._request=Xc.createRequest(this._db.config),this._collectionName=t)}return e.prototype.end=function(){return e=this,t=void 0,r=function(){var e;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}(this,(function(t){switch(t.label){case 0:if(!this._collectionName||!this._db)throw new Error("Aggregation pipeline cannot send request");return[4,this._request.send("database.aggregate",{collectionName:this._collectionName,stages:this._stages})];case 1:return(e=t.sent())&&e.data&&e.data.list?[2,{requestId:e.requestId,data:JSON.parse(e.data.list).map(Ic.EJSON.parse)}]:[2,e]}}))},new((n=void 0)||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}));var e,t,n,r},e.prototype.unwrap=function(){return this._stages},e.prototype.done=function(){return this._stages.map((function(e){var t,n=e.stageKey,r=e.stageValue;return(t={})[n]=JSON.parse(r),t}))},e.prototype._pipe=function(e,t){return this._stages.push({stageKey:"$".concat(e),stageValue:JSON.stringify(t)}),this},e.prototype.addFields=function(e){return this._pipe("addFields",e)},e.prototype.bucket=function(e){return this._pipe("bucket",e)},e.prototype.bucketAuto=function(e){return this._pipe("bucketAuto",e)},e.prototype.count=function(e){return this._pipe("count",e)},e.prototype.geoNear=function(e){return e.query&&(e.query=bc.encode(e.query)),e.distanceMultiplier&&"number"==typeof e.distanceMultiplier&&(e.distanceMultiplier=e.distanceMultiplier),e.near&&(e.near=new Fs(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",bc.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 Sc=Ec;var Oc=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)}}(),Tc=function(e){function t(t,n){return e.call(this,t,n)||this}return Oc(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 yc(this._db,this._coll,e)},t.prototype.add=function(e,t){return new yc(this._db,this._coll,void 0).create(e,t)},t.prototype.aggregate=function(){return new Sc(this._db,this._coll)},t}(_c),Ac={eq:function(e){return new Ys(Ks.EQ,[e])},neq:function(e){return new Ys(Ks.NEQ,[e])},lt:function(e){return new Ys(Ks.LT,[e])},lte:function(e){return new Ys(Ks.LTE,[e])},gt:function(e){return new Ys(Ks.GT,[e])},gte:function(e){return new Ys(Ks.GTE,[e])},in:function(e){return new Ys(Ks.IN,e)},nin:function(e){return new Ys(Ks.NIN,e)},all:function(e){return new Ys(Ks.ALL,e)},elemMatch:function(e){return new Ys(Ks.ELEM_MATCH,[e])},exists:function(e){return new Ys(Ks.EXISTS,[e])},size:function(e){return new Ys(Ks.SIZE,[e])},mod:function(e){return new Ys(Ks.MOD,[e])},geoNear:function(e){return new Ys(Ks.GEO_NEAR,[e])},geoWithin:function(e){return new Ys(Ks.GEO_WITHIN,[e])},geoIntersects:function(e){return new Ys(Ks.GEO_INTERSECTS,[e])},and:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=_s(arguments[0])?arguments[0]:Array.from(arguments);return new Hs(Ws.AND,n)},nor:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=_s(arguments[0])?arguments[0]:Array.from(arguments);return new Hs(Ws.NOR,n)},or:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=_s(arguments[0])?arguments[0]:Array.from(arguments);return new Hs(Ws.OR,n)},not:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=_s(arguments[0])?arguments[0]:Array.from(arguments);return new Hs(Ws.NOT,n)},set:function(e){return new Vs(Ls.SET,[e])},remove:function(){return new Vs(Ls.REMOVE,[])},inc:function(e){return new Vs(Ls.INC,[e])},mul:function(e){return new Vs(Ls.MUL,[e])},push:function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(xs(t[0])&&t[0].hasOwnProperty("each")){var r=t[0];e={$each:r.each,$position:r.position,$sort:r.sort,$slice:r.slice}}else e=_s(t[0])?t[0]:Array.from(t);return new Vs(Ls.PUSH,e)},pull:function(e){return new Vs(Ls.PULL,e)},pullAll:function(e){return new Vs(Ls.PULL_ALL,e)},pop:function(){return new Vs(Ls.POP,[])},shift:function(){return new Vs(Ls.SHIFT,[])},unshift:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=_s(arguments[0])?arguments[0]:Array.from(arguments);return new Vs(Ls.UNSHIFT,n)},addToSet:function(e){return new Vs(Ls.ADD_TO_SET,e)},rename:function(e){return new Vs(Ls.RENAME,[e])},bit:function(e){return new Vs(Ls.BIT,[e])},max:function(e){return new Vs(Ls.MAX,[e])},min:function(e){return new Vs(Ls.MIN,[e])},expr:function(e){return{$expr:e}},jsonSchema:function(e){return{$jsonSchema:e}},text:function(e){return function(e){return"string"===bs(e)}(e)?{$search:e.search}:{$search:e.search,$language:e.language,$caseSensitive:e.caseSensitive,$diacriticSensitive:e.diacriticSensitive}},aggregate:{pipeline:function(){return new Sc},abs:function(e){return new Pc("abs",e)},add:function(e){return new Pc("add",e)},ceil:function(e){return new Pc("ceil",e)},divide:function(e){return new Pc("divide",e)},exp:function(e){return new Pc("exp",e)},floor:function(e){return new Pc("floor",e)},ln:function(e){return new Pc("ln",e)},log:function(e){return new Pc("log",e)},log10:function(e){return new Pc("log10",e)},mod:function(e){return new Pc("mod",e)},multiply:function(e){return new Pc("multiply",e)},pow:function(e){return new Pc("pow",e)},sqrt:function(e){return new Pc("sqrt",e)},subtract:function(e){return new Pc("subtract",e)},trunc:function(e){return new Pc("trunc",e)},arrayElemAt:function(e){return new Pc("arrayElemAt",e)},arrayToObject:function(e){return new Pc("arrayToObject",e)},concatArrays:function(e){return new Pc("concatArrays",e)},filter:function(e){return new Pc("filter",e)},in:function(e){return new Pc("in",e)},indexOfArray:function(e){return new Pc("indexOfArray",e)},isArray:function(e){return new Pc("isArray",e)},map:function(e){return new Pc("map",e)},range:function(e){return new Pc("range",e)},reduce:function(e){return new Pc("reduce",e)},reverseArray:function(e){return new Pc("reverseArray",e)},size:function(e){return new Pc("size",e)},slice:function(e){return new Pc("slice",e)},zip:function(e){return new Pc("zip",e)},and:function(e){return new Pc("and",e)},not:function(e){return new Pc("not",e)},or:function(e){return new Pc("or",e)},cmp:function(e){return new Pc("cmp",e)},eq:function(e){return new Pc("eq",e)},gt:function(e){return new Pc("gt",e)},gte:function(e){return new Pc("gte",e)},lt:function(e){return new Pc("lt",e)},lte:function(e){return new Pc("lte",e)},neq:function(e){return new Pc("ne",e)},cond:function(e){return new Pc("cond",e)},ifNull:function(e){return new Pc("ifNull",e)},switch:function(e){return new Pc("switch",e)},dateFromParts:function(e){return new Pc("dateFromParts",e)},dateFromString:function(e){return new Pc("dateFromString",e)},dayOfMonth:function(e){return new Pc("dayOfMonth",e)},dayOfWeek:function(e){return new Pc("dayOfWeek",e)},dayOfYear:function(e){return new Pc("dayOfYear",e)},isoDayOfWeek:function(e){return new Pc("isoDayOfWeek",e)},isoWeek:function(e){return new Pc("isoWeek",e)},isoWeekYear:function(e){return new Pc("isoWeekYear",e)},millisecond:function(e){return new Pc("millisecond",e)},minute:function(e){return new Pc("minute",e)},month:function(e){return new Pc("month",e)},second:function(e){return new Pc("second",e)},hour:function(e){return new Pc("hour",e)},week:function(e){return new Pc("week",e)},year:function(e){return new Pc("year",e)},literal:function(e){return new Pc("literal",e)},mergeObjects:function(e){return new Pc("mergeObjects",e)},objectToArray:function(e){return new Pc("objectToArray",e)},allElementsTrue:function(e){return new Pc("allElementsTrue",e)},anyElementTrue:function(e){return new Pc("anyElementTrue",e)},setDifference:function(e){return new Pc("setDifference",e)},setEquals:function(e){return new Pc("setEquals",e)},setIntersection:function(e){return new Pc("setIntersection",e)},setIsSubset:function(e){return new Pc("setIsSubset",e)},setUnion:function(e){return new Pc("setUnion",e)},concat:function(e){return new Pc("concat",e)},dateToString:function(e){return new Pc("dateToString",e)},indexOfBytes:function(e){return new Pc("indexOfBytes",e)},indexOfCP:function(e){return new Pc("indexOfCP",e)},split:function(e){return new Pc("split",e)},strLenBytes:function(e){return new Pc("strLenBytes",e)},strLenCP:function(e){return new Pc("strLenCP",e)},strcasecmp:function(e){return new Pc("strcasecmp",e)},substr:function(e){return new Pc("substr",e)},substrBytes:function(e){return new Pc("substrBytes",e)},substrCP:function(e){return new Pc("substrCP",e)},toLower:function(e){return new Pc("toLower",e)},toUpper:function(e){return new Pc("toUpper",e)},meta:function(e){return new Pc("meta",e)},addToSet:function(e){return new Pc("addToSet",e)},avg:function(e){return new Pc("avg",e)},first:function(e){return new Pc("first",e)},last:function(e){return new Pc("last",e)},max:function(e){return new Pc("max",e)},min:function(e){return new Pc("min",e)},push:function(e){return new Pc("push",e)},stdDevPop:function(e){return new Pc("stdDevPop",e)},stdDevSamp:function(e){return new Pc("stdDevSamp",e)},sum:function(e){return new Pc("sum",e)},let:function(e){return new Pc("let",e)}},project:{slice:function(e){return new Rc("slice",e)},elemMatch:function(e){return new Rc("elemMatch",e)}}},Pc=function(e,t){this["$"+e]=t},Rc=function(e,t){this["$"+e]=t},Cc=function(){function e(e){var t=e.regexp,n=e.options;if(!t)throw new TypeError("regexp must be a string");this.$regex=t,this.$options=n}return e.prototype.parse=function(){return{$regex:this.$regex,$options:this.$options}},Object.defineProperty(e.prototype,"_internalType",{get:function(){return ys},enumerable:!1,configurable:!0}),e}();function Nc(e){return new Cc(e)}var kc="insert document failed",Uc="DATABASE_TRANSACTION_CONFLICT",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,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])}}},qc="database.updateDocInTransaction",Mc=function(){function e(e,t,n){this._coll=t,this.id=n,this._transaction=e,this._request=this._transaction.getRequestMethod(),this._transactionId=this._transaction.getTransactionId()}return e.prototype.create=function(e){return Lc(this,void 0,void 0,(function(){var t,n,r,o;return Dc(this,(function(i){switch(i.label){case 0:return t={collectionName:this._coll,transactionId:this._transactionId,data:Ic.EJSON.stringify(oc(e),{relaxed:!1})},this.id&&(t._id=this.id),[4,this._request.send("database.insertDocInTransaction",t)];case 1:if((n=i.sent()).code)throw n;if(r=Ic.EJSON.parse(n.inserted),1==(o=Ic.EJSON.parse(n.ok))&&1==r)return[2,jc(jc({},n),{ok:o,inserted:r})];throw new Error(kc)}}))}))},e.prototype.get=function(){return Lc(this,void 0,void 0,(function(){var e,t;return Dc(this,(function(n){switch(n.label){case 0:return e={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}}},[4,this._request.send("database.getInTransaction",e)];case 1:if((t=n.sent()).code)throw t;return[2,{data:"null"!==t.data?qs.formatField(Ic.EJSON.parse(t.data)):Ic.EJSON.parse(t.data),requestId:t.requestId}]}}))}))},e.prototype.set=function(e){return Lc(this,void 0,void 0,(function(){var t,n;return Dc(this,(function(r){switch(r.label){case 0:return t={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}},data:Ic.EJSON.stringify(oc(e),{relaxed:!1}),upsert:!0},[4,this._request.send(qc,t)];case 1:if((n=r.sent()).code)throw n;return[2,jc(jc({},n),{updated:Ic.EJSON.parse(n.updated),upserted:n.upserted?JSON.parse(n.upserted):null})]}}))}))},e.prototype.update=function(e){return Lc(this,void 0,void 0,(function(){var t,n;return Dc(this,(function(r){switch(r.label){case 0:return t={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}},data:Ic.EJSON.stringify(fc.encode(e),{relaxed:!1})},[4,this._request.send(qc,t)];case 1:if((n=r.sent()).code)throw n;return[2,jc(jc({},n),{updated:Ic.EJSON.parse(n.updated)})]}}))}))},e.prototype.delete=function(){return Lc(this,void 0,void 0,(function(){var e,t;return Dc(this,(function(n){switch(n.label){case 0:return e={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}}},[4,this._request.send("database.deleteDocInTransaction",e)];case 1:if((t=n.sent()).code)throw t;return[2,jc(jc({},t),{deleted:Ic.EJSON.parse(t.deleted)})]}}))}))},e}(),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)},Bc=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())}))},Wc=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])}}},Vc="database.getInTransaction",Gc=function(){function e(e,t,n,r,o){this._coll=t,this._transaction=e,this._fieldFilters=n,this._fieldOrders=r||[],this._queryOptions=o||{},this._request=this._transaction.getRequestMethod(),this._transactionId=this._transaction.getTransactionId()}return e.prototype.where=function(t){if("Object"!==Object.prototype.toString.call(t).slice(8,-1))throw Error(Ma.QueryParamTypeError);var n=Object.keys(t),r=n.some((function(e){return void 0!==t[e]}));if(n.length&&!r)throw Error(Ma.QueryParamValueError);return new e(this._transaction,this._coll,bc.encode(t),this._fieldOrders,this._queryOptions)},e.prototype.orderBy=function(t,n){Ms.isFieldPath(t),Ms.isFieldOrder(n);var r={field:t,direction:n},o=this._fieldOrders.concat(r);return new e(this._transaction,this._coll,this._fieldFilters,o,this._queryOptions)},e.prototype.limit=function(t){Ms.isInteger("limit",t);var n=Fc({},this._queryOptions);return n.limit=t,new e(this._transaction,this._coll,this._fieldFilters,this._fieldOrders,n)},e.prototype.skip=function(t){Ms.isInteger("offset",t);var n=Fc({},this._queryOptions);return n.offset=t,new e(this._transaction,this._coll,this._fieldFilters,this._fieldOrders,n)},e.prototype.field=function(t){for(var n in t)t[n]?"object"!=typeof t[n]&&(t[n]=1):t[n]=0;var r=Fc({},this._queryOptions);return r.projection=t,new e(this._transaction,this._coll,this._fieldFilters,this._fieldOrders,r)},e.prototype.get=function(){return Bc(this,void 0,void 0,(function(){var e,t,n,r,o,i;return Wc(this,(function(a){switch(a.label){case 0:return e=[],this._fieldOrders&&this._fieldOrders.forEach((function(t){e.push(t)})),t={collectionName:this._coll,transactionId:this._transactionId},this._fieldFilters&&(t.query=this._fieldFilters),e.length>0&&(t.order=e),this._queryOptions.offset&&(t.offset=this._queryOptions.offset),this._queryOptions.limit?t.limit=this._queryOptions.limit<1e3?this._queryOptions.limit:1e3:t.limit=100,this._queryOptions.projection&&(t.projection=this._queryOptions.projection),[4,this._request.send(Vc,t)];case 1:if((n=a.sent()).code)throw n;return r="null"!==n.data?Ic.EJSON.parse(n.data):null,o=r?Array.isArray(r)?qs.formatResDocumentData(r):[qs.formatField(r)]:[],i={data:o,requestId:n.requestId},void 0!==n.total&&(i.total=n.total),void 0!==n.limit&&(i.limit=n.limit),void 0!==n.offset&&(i.offset=n.offset),[2,i]}}))}))},e.prototype.count=function(){return Bc(this,void 0,void 0,(function(){var e,t,n,r;return Wc(this,(function(o){switch(o.label){case 0:return e={collectionName:this._coll,transactionId:this._transactionId},this._fieldFilters&&(e.query=this._fieldFilters),[4,this._request.send(Vc,e)];case 1:if((t=o.sent()).code)throw t;return n="null"!==t.data?Ic.EJSON.parse(t.data):null,r=Array.isArray(n)?n.length:n?1:0,[2,{requestId:t.requestId,total:void 0!==t.total?t.total:r}]}}))}))},e.prototype.update=function(e){return Bc(this,void 0,void 0,(function(){var t,n;return Wc(this,(function(r){switch(r.label){case 0:if(!e||"object"!=typeof e)throw new Error("参数必需是非空对象");if(e.hasOwnProperty("_id"))throw new Error("不能更新_id的值");return t={collectionName:this._coll,transactionId:this._transactionId,query:this._fieldFilters,data:Ic.EJSON.stringify(fc.encode(e),{relaxed:!1})},[4,this._request.send("database.updateDocInTransaction",t)];case 1:if((n=r.sent()).code)throw n;return[2,Fc(Fc({},n),{updated:Ic.EJSON.parse(n.updated)})]}}))}))},e.prototype.remove=function(){return Bc(this,void 0,void 0,(function(){var e,t;return Wc(this,(function(n){switch(n.label){case 0:return Object.keys(this._queryOptions).length>0&&console.warn("`offset`, `limit` and `projection` are not supported in remove() operation"),this._fieldOrders.length>0&&console.warn("`orderBy` is not supported in remove() operation"),e={collectionName:this._coll,transactionId:this._transactionId,query:this._fieldFilters},[4,this._request.send("database.deleteDocInTransaction",e)];case 1:if((t=n.sent()).code)throw t;return[2,Fc(Fc({},t),{deleted:Ic.EJSON.parse(t.deleted)})]}}))}))},e}(),Hc=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)}}(),zc=function(e){function t(t,n){return e.call(this,t,n)||this}return Hc(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 Mc(this._transaction,this._coll,e)},t.prototype.add=function(e){var t;return void 0!==e._id&&(t=e._id),new Mc(this._transaction,this._coll,t).create(e)},t}(Gc),Kc=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())}))},Jc=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])}}},Yc=function(){function e(e){this._db=e,this._request=Xc.createRequest(this._db.config),this.aborted=!1,this.commited=!1,this.inited=!1}return e.prototype.init=function(){return Kc(this,void 0,void 0,(function(){var e;return Jc(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 zc(this,e)},e.prototype.getTransactionId=function(){return this._id},e.prototype.getRequestMethod=function(){return this._request},e.prototype.commit=function(){return Kc(this,void 0,void 0,(function(){var e,t;return Jc(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 Kc(this,void 0,void 0,(function(){var t,n;return Jc(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 $c(){return Kc(this,void 0,void 0,(function(){var e;return Jc(this,(function(t){switch(t.label){case 0:return[4,(e=new Yc(this)).init()];case 1:return t.sent(),[2,e]}}))}))}function Qc(e,t){return void 0===t&&(t=3),Kc(this,void 0,void 0,(function(){var n,r,o,i,a=this;return Jc(this,(function(s){switch(s.label){case 0:return s.trys.push([0,4,,10]),[4,(n=new Yc(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 Kc(a,void 0,void 0,(function(){return Jc(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===Uc?[4,Qc.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 Xc=function(){function e(e){this.config=e,this.Geo=n,this.serverDate=js,this.command=Ac,this.RegExp=Nc,this.startTransaction=$c,this.runTransaction=Qc,this.logicCommand=Hs,this.updateCommand=Vs,this.queryCommand=Ys}return e.createRequest=function(t){var n=new e.reqClass(t),r=n.send;return n.send=function(e,n){return t.instance&&(n.instance=t.instance),t.database&&(n.database=t.database),r.call(this,e,n)},n},e.prototype.collection=function(e){if(!e)throw new Error("Collection name is required");return new Tc(this,e)},e.prototype.createCollection=function(t){var n={collectionName:t};return e.createRequest(this.config).send("database.addCollection",n)},e}(),Zc=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)}}(),eu=function(){return eu=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},eu.apply(this,arguments)},tu=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())}))},nu=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])}}},ru={filterRes:function(e){return delete e.header,delete e.statusCode,e},flattenResData:function(e){if("object"==typeof e.data&&null!==e.data){var t=eu(eu({},e),e.data);return delete t.data,t}return e},safeParseEJSON:function(e){if("string"!=typeof e)return e;try{return Ic.EJSON.parse(e)}catch(t){return e}},buildQueryParams:function(e){return Object.entries(e).filter((function(e){e[0];var t=e[1];return null!=t&&""!==t})).map((function(e){var t=e[0],n=e[1],r="object"==typeof n?JSON.stringify(n):String(n);return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(r))})).join("&")},getUrlPrefix:function(e){var t=(null==e?void 0:e.instance)||"(default)",n=(null==e?void 0:e.database)||"(default)";return"/database/instances/".concat(t,"/databases/").concat(n)},"database.queryDocument":function(e){var t,n,r,o,i,a,s,c;return tu(this,void 0,Promise,(function(){var u,l,p,d;return nu(this,(function(h){switch(h.label){case 0:return u=!!(null===(n=null===(t=e.query)||void 0===t?void 0:t._id)||void 0===n?void 0:n.$eq),l=ru.buildQueryParams(eu({projection:e.projection,transactionId:e.transactionId},u?{}:{offset:null!==(r=e.offset)&&void 0!==r?r:0,limit:null!==(o=e.limit)&&void 0!==o?o:100,order:e.order,query:e.query?Ic.EJSON.stringify(e.query,{relaxed:!1}):void 0})),p="".concat(ru.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents?").concat(l),u&&(p="".concat(ru.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents/").concat((null===(i=e.query._id)||void 0===i?void 0:i.$eq)||e.query._id,"?").concat(l)),[4,this.gateWay({url:p,method:"GET"})];case 1:return(d=h.sent()).data=ru.safeParseEJSON(JSON.stringify(d.data)),!u||d.code||(null===(a=d.data)||void 0===a?void 0:a.code)?(d.code||(null===(s=d.data)||void 0===s?void 0:s.code)?d=eu(eu({},d),{code:d.code||(null===(c=d.data)||void 0===c?void 0:c.code),data:eu(eu({},d.data),{list:[]})}):Array.isArray(d.data)?d=eu(eu({},d),{data:{list:d.data}}):d.data&&!Array.isArray(d.data.list)&&(d=eu(eu({},d),{data:eu(eu({},d.data),{list:[]})})),[2,ru.filterRes(d)]):[2,eu(eu({},d),{data:{list:[d.data]}})]}}))}))},"database.addDocument":function(e){var t,n,r;return tu(this,void 0,Promise,(function(){var o;return nu(this,(function(i){switch(i.label){case 0:return[4,this.gateWay({url:"".concat(ru.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents"),method:"POST",data:eu({data:Array.isArray(e.data)?e.data:[e.data]},e.transactionId&&{transactionId:e.transactionId})})];case 1:return o=i.sent(),Array.isArray(e.data)?o=eu(eu({},o),{data:eu({ids:(null===(t=o.data)||void 0===t?void 0:t.insertedIds)||[]},o.data)}):(null===(r=null===(n=o.data)||void 0===n?void 0:n.insertedIds)||void 0===r?void 0:r[0])&&(o=eu(eu({},o),{data:eu({_id:o.data.insertedIds[0]},o.data)})),[2,ru.filterRes(o)]}}))}))},"database.updateDocument":function(e){return tu(this,void 0,Promise,(function(){var t;return nu(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(ru.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents"),method:"PATCH",data:eu({query:e.query,data:e.data,multi:!!e.multi,upsert:!!e.upsert,replaceMode:!!e.replaceMode},e.transactionId&&{transactionId:e.transactionId})})];case 1:return t=n.sent(),[2,ru.filterRes(t)]}}))}))},"database.deleteDocument":function(e){return tu(this,void 0,Promise,(function(){var t;return nu(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(ru.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents/remove"),method:"POST",data:eu({query:e.query,multi:!!e.multi},e.transactionId&&{transactionId:e.transactionId})})];case 1:return t=n.sent(),[2,ru.filterRes(t)]}}))}))},"database.countDocument":function(e){return tu(this,void 0,Promise,(function(){var t,n;return nu(this,(function(r){switch(r.label){case 0:return t=ru.buildQueryParams({count:!0,query:e.query?Ic.EJSON.stringify(e.query,{relaxed:!1}):void 0}),[4,this.gateWay({url:"".concat(ru.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents?").concat(t),method:"GET"})];case 1:return n=r.sent(),[2,ru.filterRes(n)]}}))}))},"database.addCollection":function(e){return tu(this,void 0,Promise,(function(){var t;return nu(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(ru.getUrlPrefix(e),"/collections"),method:"POST",data:{collectionName:e.collectionName}})];case 1:return t=n.sent(),[2,ru.filterRes(t)]}}))}))},"database.aggregate":function(e){var t;return tu(this,void 0,Promise,(function(){var n,r;return nu(this,(function(o){switch(o.label){case 0:return n=e.stages.map((function(e){var t,n;try{var r="string"==typeof e.stageValue?JSON.parse(e.stageValue):e.stageValue;return(t={})[e.stageKey]=Ic.EJSON.serialize(r),t}catch(t){return(n={})[e.stageKey]=e.stageValue,n}})),[4,this.gateWay({url:"".concat(ru.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents/aggregations"),method:"POST",data:{pipeline:n}})];case 1:return r=o.sent(),Array.isArray(null===(t=r.data)||void 0===t?void 0:t.list)&&(r.data.list=JSON.stringify(r.data.list.map((function(e){return JSON.stringify(e)})))),[2,ru.filterRes(r)]}}))}))},"database.startTransaction":function(e){return tu(this,void 0,void 0,(function(){var t;return nu(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(ru.getUrlPrefix(e),"/transactions"),method:"POST"})];case 1:return t=n.sent(),[2,ru.filterRes(ru.flattenResData(t))]}}))}))},"database.commitTransaction":function(e){return tu(this,void 0,void 0,(function(){var t;return nu(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(ru.getUrlPrefix(e),"/transactions/").concat(e.transactionId,"/commit"),method:"POST"})];case 1:return t=n.sent(),[2,ru.filterRes(t)]}}))}))},"database.abortTransaction":function(e){return tu(this,void 0,void 0,(function(){var t;return nu(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(ru.getUrlPrefix(e),"/transactions/").concat(e.transactionId,"/rollback"),method:"POST"})];case 1:return t=n.sent(),[2,ru.filterRes(t)]}}))}))},"database.getInTransaction":function(e){var t;return tu(this,void 0,void 0,(function(){var n;return nu(this,(function(r){switch(r.label){case 0:return[4,ru["database.queryDocument"].call(this,e)];case 1:return"object"==typeof(n=r.sent()).data&&null!==n.data?(null===(t=n.data)||void 0===t?void 0:t.code)?[2,ru.flattenResData(n)]:[2,eu(eu({},n),{data:JSON.stringify(n.data)})]:[2,n]}}))}))},"database.updateDocInTransaction":function(e){return tu(this,void 0,void 0,(function(){var t;return nu(this,(function(n){switch(n.label){case 0:return e.data=ru.safeParseEJSON(e.data),[4,ru["database.updateDocument"].call(this,e)];case 1:return t=n.sent(),[2,ru.flattenResData(t)]}}))}))},"database.deleteDocInTransaction":function(e){return tu(this,void 0,void 0,(function(){var t;return nu(this,(function(n){switch(n.label){case 0:return[4,ru["database.deleteDocument"].call(this,e)];case 1:return t=n.sent(),[2,ru.flattenResData(t)]}}))}))},"database.insertDocInTransaction":function(e){var t;return tu(this,void 0,Promise,(function(){var n,r;return nu(this,(function(o){switch(o.label){case 0:return e.data=ru.safeParseEJSON(e.data),[4,ru["database.addDocument"].call(this,e)];case 1:return"object"==typeof(n=o.sent()).data&&null!==n.data?(r=!!(null===(t=n.data)||void 0===t?void 0:t._id),n=eu(eu(eu({},n),{inserted:r?1:0,ok:r?1:0}),n.data)):n=eu({inserted:0,ok:0},n),delete n.data,[2,n]}}))}))},"database.runCommands":function(e){return tu(this,void 0,Promise,(function(){var t;return nu(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(ru.getUrlPrefix(e),"/commands"),method:"POST",data:eu({commands:Ic.EJSON.serialize(e.commands)},e.transactionId&&{transactionId:e.transactionId})})];case 1:"object"==typeof(t=n.sent()).data&&null!==t.data&&(delete(t=eu(eu({},t),t.data)).data,delete t.request_id);try{t=Ic.EJSON.deserialize(t)}catch(e){}return[2,ru.filterRes(t)]}}))}))}},ou={name:"database",entity:{database:function(e){var t=this.platform,n=t.adapter,r=t.runtime,o=function(e){function t(t){return e.call(this,t)||this}return Zc(t,e),t.prototype.send=function(t,n){return tu(this,void 0,void 0,(function(){var r;return nu(this,(function(o){switch(o.label){case 0:return r=null,"GATEWAY"===this.config.endPointMode&&ru[t]?[4,ru[t].call(this,n)]:[3,2];case 1:return r=o.sent(),[3,4];case 2:return[4,e.prototype.send.call(this,t,n)];case 3:r=o.sent(),o.label=4;case 4:return[2,r]}}))}))},t}(this.request.constructor);return Xc.reqClass=o,Xc.getAccessToken=this.authInstance?this.authInstance.getAccessToken.bind(this.authInstance):function(){return""},Xc.runtime=r,this.wsClientClass&&(Xc.wsClass=n.wsClass,Xc.wsClientClass=this.wsClientClass),Xc.ws||(Xc.ws=null),new(function(e){function t(t){return e.call(this,t)||this}return Zc(t,e),t.prototype.runCommands=function(e){return tu(this,void 0,Promise,(function(){return nu(this,(function(t){return[2,Xc.createRequest(this.config).send("database.runCommands",e)]}))}))},t}(Xc))(eu(eu(eu({},this.config),{_fromApp:this}),e))}}};try{cloudbase.registerComponent(ou)}catch(e){}function iu(e){try{e.registerComponent(ou)}catch(e){console.warn(e)}}try{window.registerDatabase=iu}catch(e){}se.registerVersion("3.5.5-beta.1");try{var au=f(7922).mI,su=f(2301);se.useAdapters(su.default);var cu=se;cu.version=au(),cu.SYMBOL_CURRENT_ENV=su.SYMBOL_CURRENT_ENV,cu.SYMBOL_DEFAULT_ENV=su.SYMBOL_DEFAULT_ENV,cu.parseContext=su.parseContext,cu.getCloudbaseContext=su.getCloudbaseContext}catch(e){}try{!function(e){try{e.registerComponent(an)}catch(e){console.warn(e)}}(se),function(e){try{e.registerComponent(An)}catch(e){console.warn(e)}}(se),Fr(se),iu(se),function(e){try{e.registerComponent(Eo),e.registerHook(Io)}catch(e){console.warn(e)}}(se),Uo(se),Sa(se),gn(se),Ra(se),Wa(se)}catch(e){}try{window.cloudbase=se}catch(e){}const uu=se})();var v=m.Z;export{v as default};
2
+ import*as e from"jwt-decode";import*as t from"@cloudbase/adapter-interface";import*as n from"@cloudbase/signature-nodejs";import*as r from"jsonwebtoken";import*as o from"web-streams-polyfill";import*as i from"ws";import{createRequire as a}from"module";import*as s from"@cloudbase/adapter-wx_mp";import*as c from"@cloudbase/wx-cloud-client-sdk";import*as u from"@mattiasbuelens/web-streams-adapter";import*as l from"text-encoding-shim";import*as p from"bson";var d={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:()=>w,Bh:()=>g,Fy:()=>b,M4:()=>I,R1:()=>_,eX:()=>d,mI:()=>l,n0:()=>f,po:()=>u,tC:()=>p,vS:()=>x});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"],g="https:";function y(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=y(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:g})),"CLOUD_API"===e.endPointKey&&a(null!==(n=e.protocol)&&void 0!==n?n:g)}function x(e,t,n){return y({env:e,endPointKey:t,region:n})}function w(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 I(e,t){void 0===t&&(t="CLOUD_API");var n=x(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={}))},2301:(e,t,n)=>{n.r(t),n.d(t,{E:()=>M,NodeRequest:()=>ue,SYMBOL_CURRENT_ENV:()=>J,SYMBOL_DEFAULT_ENV:()=>Y,TcbError:()=>q,buildAdminUrl:()=>ye,callCompatibleWxOpenApi:()=>Oe,callWxOpenApi:()=>Ee,callWxPayApi:()=>Te,createWebStreamFromNodeReadableStream:()=>D,default:()=>Ve,filterUndefined:()=>B,filterValue:()=>F,getCloudbaseContext:()=>X,getSecretInfo:()=>ne,getServerInjectUrl:()=>ee,getTcbContextConfig:()=>Z,getWxCloudToken:()=>ve,getWxOptions:()=>Ie,isPageModuleName:()=>H,isValidEnvFormat:()=>K,parseContext:()=>Q,parseQueryString:()=>L,processReturn:()=>G,sendWxFormDataRequest:()=>we,sendWxRequest:()=>xe,setThrowOnCode:()=>V,wxCallContainerApi:()=>Ae});var r,o=n(7149),i=n(7147),a=n(1017),s={INVALID_PARAM:{code:"INVALID_PARAM",message:"invalid param"},SYS_ERR:{code:"SYS_ERR",message:"system error"},STORAGE_REQUEST_FAIL:{code:"STORAGE_REQUEST_FAIL",message:"storage request fail"},STORAGE_FILE_NONEXIST:{code:"STORAGE_FILE_NONEXIST",message:"storage file not exist"},TCB_CLS_UNOPEN:{code:"TCB_CLS_UNOPEN",message:"需要先开通日志检索功能"},INVALID_CONTEXT:{code:"INVALID_CONTEXT",message:"无效的context对象,请使用 云函数入口的context参数"}},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])}}},v="http://metadata.tencentyun.com",g="meta-data/app-id";function y(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(v,"/").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 b={appId:void 0};function x(){return f(this,void 0,Promise,(function(){var e;return m(this,(function(t){switch(t.label){case 0:if(void 0!==b.appId)return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,y(g,{timeout:30})];case 2:return e=t.sent(),/^[1-9][0-9]{4,64}$/gim.test(e)?b.appId=e:b.appId="",[3,4];case 3:return t.sent(),[3,4];case 4:return[2,b.appId||""]}}))}))}var w,_,I=(w=function(e,t){return w=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])},w(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}w(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)},S=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=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])}}},T=(_=d.P6).isFormData,A=_.toQueryString;function P(e){return"undefined"!=typeof process&&process.env?void 0!==e?process.env[e]:process.env:void 0!==e?void 0:{}}var R=function(){return"SCF"===P("TENCENTCLOUD_RUNENV")},C=new Set(["formal","pre","test"]);function N(){return S(this,void 0,Promise,(function(){var e;return O(this,(function(t){switch(t.label){case 0:return"true"===P("TENCENTCLOUD")?[2,!0]:[4,x()];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 U(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 D(e){var t=e[Symbol.asyncIterator]();return new h.ReadableStream({pull:function(e){return S(this,void 0,void 0,(function(){var n;return O(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 q=function(e){function t(t){var n=e.call(this,t.message)||this;return n.code=t.code||"",n.message=t.message||"",n.requestId=t.requestId||"",n}return I(t,e),t}(Error);function M(e){return new q(e)}function F(e,t){for(var n in e)e[n]===t&&delete e[n]}function B(e){F(e,void 0)}var W=!0;function V(e){W=e}function G(e){if(!W)return e;throw M(E({},e))}function H(e){return void 0===e&&(e=""),"string"==typeof e&&e.startsWith("$:")}var z=/^[a-z0-9_-]{1,40}$/;function K(e){return void 0===e&&(e=""),"string"==typeof e&&z.test(e)}var J=Symbol.for("SYMBOL_CURRENT_ENV"),Y=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 Q(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){R()&&(P("TENCENTCLOUD_REGION")||console.error("[TCB][ERROR] missing `TENCENTCLOUD_REGION` environment"),P("SCF_NAMESPACE")||console.error("[TCB][ERROR] missing `SCF_NAMESPACE` environment"));var t=P(),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},r={};if(e){var o=Q(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]||P(d)}}catch(e){}}var h=$($({},n),r);return Object.fromEntries(Object.entries(h).filter((function(e){return void 0!==e[1]})))};function Z(){try{var e=X().TCB_CONTEXT_CNFG;return e?JSON.parse(e):{}}catch(e){return console.error("[TCB][ERROR] parse context error: ",e),{}}}function ee(){return Z().URL||""}var te={},ne=function(e){var t,n,o,i,a;te=JSON.parse(JSON.stringify(e||te));var s=P(),c=s.TCB_ENV,u=s.SCF_NAMESPACE,l=s.TENCENTCLOUD_RUNENV,p=s.TENCENTCLOUD_SECRETID,d=s.TENCENTCLOUD_SECRETKEY,h=s.TENCENTCLOUD_SESSIONTOKEN,f=s.CLOUDBASE_APIKEY,m=$($({},te),e),v="";"local"===(v="symbol"!=typeof(null==e?void 0:e.env)&&(null==e?void 0:e.env)?e.env:c||u||"")&&"WX_LOCAL_SCF"===l&&(v="");var g={env:v,secretId:"",secretKey:"",sessionToken:"",accessKey:"",secretType:"",credentials:void 0,context:void 0};if((null==m?void 0:m.context)&&(g.context=m.context),(null==m?void 0:m.credentials)&&(g.credentials=m.credentials),(null==e?void 0:e.accessKey)||(null==m?void 0:m.accessKey))return g.accessKey=(null==e?void 0:e.accessKey)||(null==m?void 0:m.accessKey),g;if((null==m?void 0:m.secretId)&&(null==m?void 0:m.secretKey))return $($({},g),{secretId:m.secretId,secretKey:m.secretKey,sessionToken:h||"",secretType:m.sessionToken?r.SESSION_SECRET:r.SECRET});if((null===(t=null==e?void 0:e.auth)||void 0===t?void 0:t.secretId)&&(null===(n=null==e?void 0:e.auth)||void 0===n?void 0:n.secretKey))return $($({},g),{secretId:e.auth.secretId,secretKey:e.auth.secretKey,sessionToken:h||"",secretType:e.auth.secretType||r.SECRET});if(f)return $($({},g),{accessKey:f});if(p&&d)return $($({},g),{secretId:p,secretKey:d,sessionToken:h||"",secretType:r.SESSION_SECRET});var y=(null==m?void 0:m.context)||(null==e?void 0:e.context);if(null==y?void 0:y.extendedContext){var b=y.extendedContext;return v||(v=b.envId||""),$($({},g),{env:v,secretId:(null===(o=null==b?void 0:b.tmpSecret)||void 0===o?void 0:o.secretId)||"",secretKey:(null===(i=null==b?void 0:b.tmpSecret)||void 0===i?void 0:i.secretKey)||"",sessionToken:(null===(a=null==b?void 0:b.tmpSecret)||void 0===a?void 0:a.token)||""})}return $({},g)},re=n(7922),oe=function(){return oe=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},oe.apply(this,arguments)},ie=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())}))},ae=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])}}},se=null;function ce(){return ie(this,void 0,void 0,(function(){var e;return ae(this,(function(t){switch(t.label){case 0:if(se)return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Promise.resolve().then(n.bind(n,9143))];case 2:return e=t.sent(),se=e.sign,[3,4];case 3:return t.sent(),console.error("缺少依赖 @cloudbase/signature-nodejs,请执行以下命令安装:\n\n npm install @cloudbase/signature-nodejs\n\n该依赖用于 Node 环境下的请求签名。"),[3,4];case 4:return[2,se]}}))}))}var ue=function(){function e(e){var t=this;this.getReqOptions=function(e,n){return ie(t,void 0,void 0,(function(){var t,r,o,i,a,s,l,p,d,h,f,m,v,g,y,b,x,w,_,I,E,T,A,k,j,L,D,q,M,F,B,W,V,G,H;return ae(this,(function(z){switch(z.label){case 0:return t=new URL(e),r=X().TCB_SOURCE,a=(i="".concat((null===(M=null===(q=te.context)||void 0===q?void 0:q.extendedContext)||void 0===M?void 0:M.source)||r||"",",")).concat,[4,S(void 0,void 0,Promise,(function(){return O(this,(function(e){switch(e.label){case 0:return R()?[2,"scf"]:P("CBR_ENV_ID")?[2,"cbr"]:C.has(P("SUMERU_ENV")||"")?[2,"sumeru"]:[4,N()];case 1:return e.sent()?[2,"tencentcloud"]:[2,"unknown"]}}))}))];case 1:return o=a.apply(i,[z.sent()]),n.headers=oe(oe({},n.headers),{"User-Agent":"adapter-node/".concat((null===(F=n.headers)||void 0===F?void 0:F["X-SDK-Version"])||"@cloudbase/js-sdk/".concat((0,re.mI)())),"X-TCB-Source":o,"X-Client-Timestamp":(new Date).valueOf(),"X-TCB-Region":te.region||P("TENCENTCLOUD_REGION")||"",Host:t.host}),!1===n.withCredentials||(null===(W=null===(B=n.headers.Authorization)||void 0===B?void 0:B.replace("Bearer",""))||void 0===W?void 0:W.trim())||t.pathname.startsWith("/auth/")&&t.pathname!==u?[2,n]:(s=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 l=z.sent(),n.headers.Authorization="Bearer ".concat(l),[2,n];case 3:return p=(null===(V=this.config)||void 0===V?void 0:V.auth)||{},d=p.secretId,h=p.secretKey,f=p.sessionToken,m=((null===(G=this.config)||void 0===G?void 0:G.auth)||{}).secretType,v=n.method,g=n.body,y=JSON.parse(JSON.stringify(n.headers)),b=this.isNpmFormData(g),(x=b?g.__plainObj?oe({},g.__plainObj):{}:"object"==typeof g?g:U(g)||{}).envName=(null==x?void 0:x.env)||this.config.env||(null===(H=ne())||void 0===H?void 0:H.env)||"",x.access_token?[2,n]:("get"===v.toLowerCase()&&(x=void 0),d&&h&&"SESSION_SECRET"!==m||(w=ne(),d=w.secretId,h=w.secretKey,f=w.sessionToken),d&&h?(delete y.Authorization,y["content-type"]?y["content-type"]=y["content-type"].toLowerCase():y["Content-Type"]&&(y["Content-Type"]=y["Content-Type"].toLowerCase()),s&&f&&(x.sessionToken=f),_={secretId:d,secretKey:h,method:v,url:e,params:x,headers:y,withSignedParams:s,timestamp:Math.floor((new Date).getTime()/1e3)-1,isCloudApi:!s},y["content-type"]||y["Content-Type"]?[4,ce()]:[2,n]):[2,n]);case 4:return(I=z.sent())?(E=I(_),T=E.authorization,A=E.timestamp,"string"==typeof f&&""!==f?s?(y.Authorization="".concat(T),y["X-Timestamp"]=A,y["X-Signature-Expires"]=600):y.Authorization="".concat(T,", Timestamp=").concat(A,", Token=").concat(f):(y.Authorization="".concat(T,", Timestamp=").concat(A),s&&(y["X-Timestamp"]=A,y["X-Signature-Expires"]=600)),b?(k=g,j=new Set(Object.keys(k.__plainObj||{})),x.envName&&!j.has("envName")&&k.append("envName",x.envName),x.sessionToken&&!j.has("sessionToken")&&k.append("sessionToken",x.sessionToken),L=k.getBuffer(),D=k.getHeaders(),[2,oe(oe({},n),{headers:oe(oe(oe({},y),D),{"content-length":String(L.length)}),body:L})]):[2,oe(oe({},n),{headers:y,body:"object"==typeof x?JSON.stringify(x):x})]):[2,n]}}))}))},this.get=function(e){return t.request(oe(oe({},e),{method:"get"}),t.restrictedMethods.includes("get"))},this.post=function(e){return t.request(oe(oe({},e),{method:"post"}),t.restrictedMethods.includes("post"))},this.put=function(e){return t.request(oe(oe({},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(oe(oe({},e),{data:m,method:f}),t.restrictedMethods.includes("upload"))):t.request(oe(oe({},e),{method:"put",headers:l,body:p}),t.restrictedMethods.includes("upload"))},this.download=function(e){return ie(t,void 0,Promise,(function(){var t,n,r,o,s;return ae(this,(function(c){switch(c.label){case 0:return[4,fetch(e.url,{headers:{},signal:AbortSignal.timeout(this.timeout)})];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 ie(t,void 0,Promise,(function(){var t,n,r,o,i,a,s,c,u,l,p,d,h,f,m,v;return ae(this,(function(g){switch(g.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,oe(oe({},e),{headers:d,body:e.body,signal:l.signal}))];case 1:h=g.sent(),this.applyDuplexIfNeeded(h),g.label=2;case 2:return g.trys.push([2,,8,9]),[4,fetch(s,h)];case 3:return f=g.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=U,[4,f.text()];case 6:m=v.apply(void 0,[g.sent()]),g.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),ie(t,void 0,Promise,(function(){var t,r,i,a,s,c,u,l,p,d,h,f,m,v,g,y,b,x,w,_,I,E,S,O,P,R,C,N,k,L,D,q,M;return ae(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=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),g=v[0],y=v[1],b=T(a)?a:"application/x-www-form-urlencoded"===d["content-type"]?A(null!=a?a:{}):u||(a?JSON.stringify(a):void 0),x=this.getRealUrl((0,o.formatUrl)("https",null!=t?t:"","get"===h?a:{}),e.headers||{},b),[4,this.getReqOptions(x,{method:h,headers:d,body:b,credentials:c?"include":"same-origin",signal:g.signal})];case 1:w=F.sent(),this.applyDuplexIfNeeded(w),F.label=2;case 2:return F.trys.push([2,,19,20]),[4,fetch(x,w)];case 3:_=F.sent(),I={header:{},statusCode:_.status},F.label=4;case 4:return F.trys.push([4,11,,18]),"blob"!==s?[3,6]:(E=I,[4,_.blob()]);case 5:return E.data=F.sent(),[3,10];case 6:return"buffer"!==s?[3,8]:(S=I,P=(O=Buffer).from,[4,_.arrayBuffer()]);case 7:return S.data=P.apply(O,[F.sent()]),[3,10];case 8:return R=I,C=U,[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]:(k=I,[4,_.blob()]);case 12:return k.data=F.sent(),[3,17];case 13:return"buffer"!==s?[3,15]:(L=I,q=(D=Buffer).from,[4,_.arrayBuffer()]);case 14:return L.data=q.apply(D,[F.sent()]),[3,17];case 15:return M=I,[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 I.header[t.toLowerCase()]=e})),[2,I];case 19:return y(),[7];case 20:return[2]}}))}))};var n=e.timeout,r=e.restrictedMethods;this.timeout=n||15e3,this.restrictedMethods=r||["get","post","upload","download"],this.config=e}return e.prototype.getClientCredential=function(e){var t;return ie(this,void 0,Promise,(function(){var n;return ae(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,i,a;if(null===(o=null===(r=t.Authorization)||void 0===r?void 0:r.replace("Bearer",""))||void 0===o?void 0:o.trim())return e;if(("object"==typeof n?n:U(n)||"").access_token)return e;var s=new URL(e);return"/web"===s.pathname&&(null===(i=this.config.auth)||void 0===i?void 0:i.secretId)&&(null===(a=this.config.auth)||void 0===a?void 0:a.secretKey)&&(s.pathname=c),s.toString()},e.prototype.createAbortController=function(e,t,n){var r,o=new AbortController;return n&&(n.aborted?o.abort():n.addEventListener("abort",(function(){return o.abort()}),{once:!0})),(t||e)&&(r=setTimeout((function(){var t="请求在".concat(e/1e3,"s内未完成,已中断");console.warn(t),o.abort(new Error(t))}),e)),[o,function(){return clearTimeout(r)}]},e.prototype.applyDuplexIfNeeded=function(e){var t;e.body&&"function"==typeof(null===(t=e.body)||void 0===t?void 0:t.pipe)&&(e.duplex="half")},e.prototype.isNpmFormData=function(e){return e&&"object"==typeof e&&"function"==typeof e.getHeaders&&"function"==typeof e.getBuffer},e}(),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)},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="/.tencentcloudbase/wx/cloudbase_access_token",fe=6e5,me={token:"",timestamp:0};function ve(){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(me.token&&Date.now()-me.timestamp<fe)return me.token;try{if(("WX_LOCAL_SCF"===process.env.TENCENTCLOUD_RUNENV||"SCF"===process.env.TENCENTCLOUD_RUNENV)&&i.existsSync(he))return me.token=i.readFileSync(he).toString(),me.timestamp=Date.now(),me.token}catch(e){console.warn("[TCB][ERROR]: loadWxCloudbaseAccesstoken error: ",e)}return""}()),s}var ge=0;function ye(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(){ge+=1;var e="".concat(Date.now().toString(16),"_").concat(ge.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 be(e){var t=X(),n=ve(),r=n.wxCloudApiToken,o=n.wxCloudbaseAccesstoken;e.wxCloudApiToken=r,o&&(e.wxCloudbaseAccesstoken=o),e.tcb_sessionToken=t.TCB_SESSIONTOKEN||""}function xe(e,t,n,r){return pe(this,void 0,void 0,(function(){return de(this,(function(o){return be(n),[2,e.requestInstance.send(t,n,{pathname:"web",endPointMode:"GATEWAY"},r?{timeout:r.timeout}:void 0)]}))}))}function we(e,t,r,o){return pe(this,void 0,Promise,(function(){var i,a,s,c,u,l,p,d;return de(this,(function(h){switch(h.label){case 0:be(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=le({action:t},r),a.__plainObj=l,p=ye(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 _e(e,t){if(void 0===t&&(t={}),t.getCrossAccountInfo||e.getCrossAccountInfo)throw M(le(le({},s.INVALID_PARAM),{message:"invalid config: getCrossAccountInfo"}))}function Ie(e,t,n,r){return{requestInstance:r,config:e,scfContext:t,serviceUrl:n}}function Ee(e,t,n){var r=t.apiName,o=t.apiOptions,i=t.cgiName,a=t.requestData;return pe(this,void 0,void 0,(function(){var t,c,u;return de(this,(function(l){switch(l.label){case 0:try{t=a?JSON.stringify(a):""}catch(e){throw M(le(le({},e),{code:s.INVALID_PARAM.code,message:"对象出现了循环引用"}))}return _e(e.config,n),[4,xe(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 Se(e,t,n,r){var o=n.apiName,i=n.apiOptions,a=n.cgiName,s=n.requestData;return pe(this,void 0,void 0,(function(){return de(this,(function(n){return _e(t.config,r),[2,we(t,e,{apiName:o,apiOptions:i,cgiName:a,requestData:s},r)]}))}))}var Oe=function(e,t,n){return Se("wx.openApi",e,t,n)},Te=function(e,t,n){return Se("wx.wxPayApi",e,t,n)},Ae=function(e,t,n){return Se("wx.wxCallContainerApi",e,t,n)},Pe=function(){return Pe=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},Pe.apply(this,arguments)},Re=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])}}},Ne=null;function ke(){var e;return Re(this,void 0,void 0,(function(){var t;return Ce(this,(function(r){switch(r.label){case 0:if(Ne)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Promise.resolve().then(n.bind(n,9617))];case 2:return t=r.sent(),Ne=(null===(e=t.default)||void 0===e?void 0:e.sign)||t.sign,[3,4];case 3:return r.sent(),console.error("缺少依赖 jsonwebtoken,请执行以下命令安装:\n\n npm install jsonwebtoken\n\n该依赖用于 Node 环境下的自定义登录票据生成。"),[3,4];case 4:return[2,Ne]}}))}))}function Ue(){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 je(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 Le=null,De=function(e,t){var n=t;if(e.parseContext=function(e){var t=Q(e);return Le=t,t},e.getCloudbaseContext=function(e){return X(e)},e.auth){var r={getUserInfo:function(){return Ue()},getEndUserInfo:function(n){return Re(this,void 0,Promise,(function(){var r;return Ce(this,(function(o){return r=Ue(),void 0===n?[2,{userInfo:r}]:(k(n),[2,je(e,{uuid:n,envName:t.env}).then((function(e){return e.code?e:{userInfo:Pe(Pe({},r),e.data),requestId:e.requestId}}))])}))}))},createTicket:function(e,n){return void 0===n&&(n={}),Re(this,void 0,Promise,(function(){var r,o,i,a,c,u,l,p,d;return Ce(this,(function(h){switch(h.label){case 0:if(k(e),r=(new Date).getTime(),o=(t.auth||{}).credentials,!(i=t.env))throw Pe(Pe({},s.INVALID_PARAM),{message:"no env in config"});if(!(null==o?void 0:o.env_id))throw Pe(Pe({},s.INVALID_PARAM),{message:"当前私钥未包含env_id 信息, 请前往腾讯云云开发控制台,获取自定义登录最新私钥"});if(o.env_id!==i)throw Pe(Pe({},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,ke()];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 Re(this,void 0,Promise,(function(){var r,o,i;return Ce(this,(function(a){return r=n.uid,o=n.platform,i=n.platformId,[2,je(e,{uuid:r,platform:o,platformId:i,envName:t.env}).then((function(e){return e.code?e:{userInfo:Pe({},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(r){return Re(this,void 0,void 0,(function(){var o;return Ce(this,(function(i){switch(i.label){case 0:return n.accessKey||t.accessKey?[2,n.accessKey||t.accessKey]:(o=e.request.getBaseEndPoint("GATEWAY"),[4,e.request.post({url:"".concat(o).concat("/auth/v1/token/clientCredential"),data:{grant_type:"client_credentials"},headers:{"content-type":"application/json"}},r?{timeout:r.timeout}:void 0)]);case 1:return[2,i.sent().data]}}))}))}},o=e.auth;Object.keys(r).forEach((function(e){o[e]=r[e]})),e.auth=new Proxy(o,{apply:function(e,t,n){var o=Reflect.apply(e,t,n);return o&&"object"==typeof o&&Object.keys(r).forEach((function(e){e in o||(o[e]=r[e])})),o}})}function i(){var t=n.serviceUrl||ee()||void 0;return Ie(n,Le,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 Ee(i(),e,t)},e.callWxPayApi=function(e,t){return Te(i(),e,t)},e.wxCallContainerApi=function(e,t){return Ae(i(),e,t)},e.callCompatibleWxOpenApi=function(e,t){return Oe(i(),e,t)},e.getFileAuthority=function(t,n){var r=t.fileList;return Re(void 0,void 0,void 0,(function(){var t,o,i,a,c,u;return Ce(this,(function(l){switch(l.label){case 0:if(t=X().LOGINTYPE,!Array.isArray(r))throw M(Pe(Pe({},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 M(Pe(Pe({},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 M(Pe(Pe({},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 M(Pe(Pe({},u),{message:"[js-sdk] getCosFileAuthority failed: ".concat(u.code)}));return[2,u]}}))}))},e.callApis=function(t,n){return Re(void 0,void 0,void 0,(function(){var r,o,i,a,s,c,u,l,p,d,h,f;return Ce(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")}))}))}},qe=function(){return qe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},qe.apply(this,arguments)},Me=null;function Fe(){if(!Me)try{Me=n(9814)}catch(e){console.error("缺少依赖 ws,请执行以下命令安装:\n\n npm install ws\n\n该依赖用于 Node 环境下的 WebSocket 连接。")}return Me}var Be,We=(Be=new Map,{mode:"sync",setItem:function(e,t){Be.set(e,t)},getItem:function(e){return Be.get(e)},removeItem:function(e){Be.delete(e)},clear:function(){Be.clear()}});const Ve={genAdapter:function(e){return{nodeTool:De,getSecretInfo:ne,root:{globalThis:{}},reqClass:ue,wsClass:Fe(),sessionStorage:We,localStorage:We,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",qe(qe({},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"}},3171:(e,t,n)=>{var r;if(n.r(t),n.d(t,{getEncryptInfo:()=>M}),!globalThis.IS_MP_BUILD){var o="undefined"!=typeof globalThis?globalThis.navigator:window.globalThis,i="0123456789abcdefghijklmnopqrstuvwxyz";function F(e){return i.charAt(e)}function B(e,t){return e&t}function W(e,t){return e|t}function V(e,t){return e^t}function G(e,t){return e&~t}function H(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 z(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function K(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=a.charAt(n>>6)+a.charAt(63&n);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=a.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=a.charAt(n>>2)+a.charAt((3&n)<<4));(3&r.length)>0;)r+="=";return r}function J(e){var t,n="",r=0,o=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t){var i=a.indexOf(e.charAt(t));i<0||(0==r?(n+=F(i>>2),o=3&i,r=1):1==r?(n+=F(o<<2|i>>4),o=15&i,r=2):2==r?(n+=F(o),n+=F(i>>2),o=3&i,r=3):(n+=F(o<<2|i>>4),n+=F(15&i),r=0))}return 1==r&&(n+=F(o<<2)),n}var s,c,u={decode:function(e){var t;if(void 0===s){var n="0123456789ABCDEF";for(s={},t=0;t<16;++t)s[n.charAt(t)]=t;for(n=n.toLowerCase(),t=10;t<16;++t)s[n.charAt(t)]=t;for(t=0;t<8;++t)s[" \f\n\r\t \u2028\u2029".charAt(t)]=-1}var r=[],o=0,i=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if("="==a)break;if(-1!=(a=s[a])){if(void 0===a)throw new Error("Illegal character at offset "+t);o|=a,++i>=2?(r[r.length]=o,o=0,i=0):o<<=4}}if(i)throw new Error("Hex encoding incomplete: 4 bits missing");return r}},l={decode:function(e){var t;if(void 0===c){for(c=Object.create(null),t=0;t<64;++t)c["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(t=0;t<9;++t)c["= \f\n\r\t \u2028\u2029".charAt(t)]=-1}var n=[],r=0,o=0;for(t=0;t<e.length;++t){var i=e.charAt(t);if("="==i)break;if(-1!=(i=c[i])){if(void 0===i)throw new Error("Illegal character at offset "+t);r|=i,++o>=4?(n[n.length]=r>>16,n[n.length]=r>>8&255,n[n.length]=255&r,r=0,o=0):r<<=6}}switch(o){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=r>>10;break;case 3:n[n.length]=r>>16,n[n.length]=r>>8&255}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(e){var t=l.re.exec(e);if(t)if(t[1])e=t[1];else{if(!t[2])throw new Error("RegExp out of sync");e=t[2]}return l.decode(e)}},p=1e13;class Y{constructor(e){this.buf=[+e||0]}mulAdd(e,t){var n,r,o=this.buf,i=o.length;for(n=0;n<i;++n)(r=o[n]*e+t)<p?t=0:r-=(t=0|r/p)*p,o[n]=r;t>0&&(o[n]=t)}sub(e){var t,n,r=this.buf,o=r.length;for(t=0;t<o;++t)(n=r[t]-e)<0?(n+=p,e=1):e=0,r[t]=n;for(;0===r[r.length-1];)r.pop()}toString(e){if(10!=(e||10))throw new Error("only base 10 is supported");for(var t=this.buf,n=t[t.length-1].toString(),r=t.length-2;r>=0;--r)n+=(p+t[r]).toString().substring(1);return n}valueOf(){for(var e=this.buf,t=0,n=e.length-1;n>=0;--n)t=t*p+e[n];return t}simplify(){var e=this.buf;return 1==e.length?e[0]:this}}var d,h=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,f=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function $(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}class Q{constructor(e,t){this.hexDigits="0123456789ABCDEF",e instanceof Q?(this.enc=e.enc,this.pos=e.pos):(this.enc=e,this.pos=t)}get(e){if(void 0===e&&(e=this.pos++),e>=this.enc.length)throw new Error("Requesting byte offset "+e+" on a stream of length "+this.enc.length);return"string"==typeof this.enc?this.enc.charCodeAt(e):this.enc[e]}hexByte(e){return this.hexDigits.charAt(e>>4&15)+this.hexDigits.charAt(15&e)}hexDump(e,t,n){for(var r="",o=e;o<t;++o)if(r+=this.hexByte(this.get(o)),!0!==n)switch(15&o){case 7:r+=" ";break;case 15:r+="\n";break;default:r+=" "}return r}isASCII(e,t){for(var n=e;n<t;++n){var r=this.get(n);if(r<32||r>176)return!1}return!0}parseStringISO(e,t){for(var n="",r=e;r<t;++r)n+=String.fromCharCode(this.get(r));return n}parseStringUTF(e,t){for(var n="",r=e;r<t;){var o=this.get(r++);n+=o<128?String.fromCharCode(o):o>191&&o<224?String.fromCharCode((31&o)<<6|63&this.get(r++)):String.fromCharCode((15&o)<<12|(63&this.get(r++))<<6|63&this.get(r++))}return n}parseStringBMP(e,t){for(var n,r,o="",i=e;i<t;)n=this.get(i++),r=this.get(i++),o+=String.fromCharCode(n<<8|r);return o}parseTime(e,t,n){var r=this.parseStringISO(e,t),o=(n?h:f).exec(r);return o?(n&&(o[1]=+o[1],o[1]+=+o[1]<70?2e3:1900),r=o[1]+"-"+o[2]+"-"+o[3]+" "+o[4],o[5]&&(r+=":"+o[5],o[6]&&(r+=":"+o[6],o[7]&&(r+="."+o[7]))),o[8]&&(r+=" UTC","Z"!=o[8]&&(r+=o[8],o[9]&&(r+=":"+o[9]))),r):"Unrecognized time: "+r}parseInteger(e,t){for(var n,r=this.get(e),o=r>127,i=o?255:0,a="";r==i&&++e<t;)r=this.get(e);if(0==(n=t-e))return o?-1:0;if(n>4){for(a=r,n<<=3;!(128&(+a^i));)a=+a<<1,--n;a="("+n+" bit)\n"}o&&(r-=256);for(var s=new Y(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 Y,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 Y)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 Y,i=0}}return i>0&&(r+=".incomplete"),r}}class X{constructor(e,t,n,r,o){if(!(r instanceof Z))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 Q?e:new Q(e,0);var n=new Q(t),r=new Z(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 Z{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 Y;do{t=e.get(),n.mulAdd(128,127&t)}while(128&t);this.tagNumber=n.simplify()}}isUniversal(){return 0===this.tagClass}isEOC(){return 0===this.tagClass&&0===this.tagNumber}}var m=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],v=(1<<26)/m[m.length-1];class ee{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=F(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+=F(n));return o?i:"0"}negate(){var e=te();return ee.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)+ce(this[this.t-1]^this.s&this.DM)}mod(e){var t=te();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(ee.ZERO)>0&&e.subTo(t,t),t}modPowInt(e,t){var n;return n=e<256||t.isEven()?new y(t):new b(t),this.exp(e,n)}clone(){var e=te();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=te();return this.bitwiseTo(e,B,t),t}or(e){var t=te();return this.bitwiseTo(e,W,t),t}xor(e){var t=te();return this.bitwiseTo(e,V,t),t}andNot(e){var t=te();return this.bitwiseTo(e,G,t),t}not(){for(var e=te(),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=te();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}shiftRight(e){var t=te();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+H(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+=z(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,W)}clearBit(e){return this.changeBit(e,G)}flipBit(e){return this.changeBit(e,V)}add(e){var t=te();return this.addTo(e,t),t}subtract(e){var t=te();return this.subTo(e,t),t}multiply(e){var t=te();return this.multiplyTo(e,t),t}divide(e){var t=te();return this.divRemTo(e,t,null),t}remainder(e){var t=te();return this.divRemTo(e,null,t),t}divideAndRemainder(e){var t=te(),n=te();return this.divRemTo(e,t,n),[t,n]}modPow(e,t){var n,r,o=e.bitLength(),i=se(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 x(t):new b(t);var a=[],s=3,c=n-1,u=(1<<n)-1;if(a[1]=r.convert(this),n>1){var l=te();for(r.sqrTo(a[1],l);s<=u;)a[s]=te(),r.mulTo(l,a[s-2],a[s]),s+=2}var p,d,h=e.t-1,f=!0,m=te();for(o=ce(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 ee.ZERO;for(var n=e.clone(),r=this.clone(),o=se(1),i=se(0),a=se(0),s=se(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(ee.ONE)?ee.ZERO:s.compareTo(e)>=0?s.subtract(e):s.signum()<0?(s.addTo(e,s),s.signum()<0?s.add(e):s):s}pow(e){return this.exp(e,new g)}gcd(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var o=t.getLowestSetBit(),i=n.getLowestSetBit();if(i<0)return t;for(o<i&&(i=o),i>0&&(t.rShiftTo(i,t),n.rShiftTo(i,n));t.signum()>0;)(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return i>0&&n.lShiftTo(i,n),n}isProbablePrime(e){var t,n=this.abs();if(1==n.t&&n[0]<=m[m.length-1]){for(t=0;t<m.length;++t)if(n[0]==m[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<m.length;){for(var r=m[t],o=t+1;o<m.length&&r<v;)r*=m[o++];for(r=n.modInt(r);t<o;)if(r%m[t++]==0)return!1}return n.millerRabin(e)}copyTo(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}fromInt(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}fromString(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(256==t)n=8;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)return void this.fromRadix(e,t);n=2}this.t=0,this.s=0;for(var r=e.length,o=!1,i=0;--r>=0;){var a=8==n?255&+e[r]:ae(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&&ee.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&&ee.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=te());var i=te(),a=this.s,s=e.s,c=this.DB-ce(r[r.t-1]);c>0?(r.lShiftTo(c,i),o.lShiftTo(c,n)):(r.copyTo(i),o.copyTo(n));var u=i.t,l=i[u-1];if(0!=l){var p=l*(1<<this.F1)+(u>1?i[u-2]>>this.F2:0),d=this.FV/p,h=(1<<this.F1)/p,f=1<<this.F2,m=n.t,v=m-u,g=null==t?te():t;for(i.dlShiftTo(v,g),n.compareTo(g)>=0&&(n[n.t++]=1,n.subTo(g,n)),ee.ONE.dlShiftTo(u,g),g.subTo(i,i);i.t<u;)i[i.t++]=0;for(;--v>=0;){var y=n[--m]==l?this.DM:Math.floor(n[m]*d+(n[m-1]+f)*h);if((n[m]+=i.am(0,y,n,v,0,u))<y)for(i.dlShiftTo(v,g),n.subTo(g,n);n[m]<--y;)n.subTo(g,n)}null!=t&&(n.drShiftTo(u,t),a!=s&&ee.ZERO.subTo(t,t)),n.t=u,n.clamp(),c>0&&n.rShiftTo(c,n),a<0&&ee.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 ee.ONE;var n=te(),r=te(),o=t.convert(this),i=ce(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=se(n),o=te(),i=te(),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=ae(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&&ee.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(ee.ONE.shiftLeft(e-1),W,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(ee.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=ee.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(ee.ONE),n=t.getLowestSetBit();if(n<=0)return!1;var r=t.shiftRight(n);(e=e+1>>1)>m.length&&(e=m.length);for(var o=te(),i=0;i<e;++i){o.fromInt(m[Math.floor(Math.random()*m.length)]);var a=o.modPow(r,this);if(0!=a.compareTo(ee.ONE)&&0!=a.compareTo(t)){for(var s=1;s++<n&&0!=a.compareTo(t);)if(0==(a=a.modPowInt(2,this)).compareTo(ee.ONE))return!1;if(0!=a.compareTo(t))return!1}}return!0}square(){var e=te();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(ee.ONE.shiftLeft(e-1),W,this),this.isEven()&&this.dAddOffset(1,0);var o=this,i=function(){o.dAddOffset(2,0),o.bitLength()>e&&o.subTo(ee.ONE.shiftLeft(e-1),o),o.isProbablePrime(t)?setTimeout((function(){r()}),0):setTimeout(i,0)};setTimeout(i,0)}else{var a=[],s=7&e;a.length=1+(e>>3),t.nextBytes(a),s>0?a[0]&=(1<<s)-1:a[0]=0,this.fromString(a,256)}}}var g=function(){function e(){}return e.prototype.convert=function(e){return e},e.prototype.revert=function(e){return e},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n)},e.prototype.sqrTo=function(e,t){e.squareTo(t)},e}(),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}(),b=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=te();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(ee.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=te();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}(),x=function(){function e(e){this.m=e,this.r2=te(),this.q3=te(),ee.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=te();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 te(){return new ee(null)}function ne(e,t){return new ee(e,t)}function re(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 oe(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 ie(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)?(ee.prototype.am=oe,d=30):"Netscape"!=(null==o?void 0:o.appName)?(ee.prototype.am=re,d=26):(ee.prototype.am=ie,d=28),ee.prototype.DB=d,ee.prototype.DM=(1<<d)-1,ee.prototype.DV=1<<d,ee.prototype.FV=Math.pow(2,52),ee.prototype.F1=52-d,ee.prototype.F2=2*d-52;var w,_,I=[];for(w="0".charCodeAt(0),_=0;_<=9;++_)I[w++]=_;for(w="a".charCodeAt(0),_=10;_<36;++_)I[w++]=_;for(w="A".charCodeAt(0),_=10;_<36;++_)I[w++]=_;function ae(e,t){var n=I[e.charCodeAt(t)];return null==n?-1:n}function se(e){var t=te();return t.fromInt(e),t}function ce(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}ee.ZERO=se(0),ee.ONE=se(1);class ue{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,S,O=null;if(null==O){O=[],S=0;var T,A,P=void 0;if("undefined"!=typeof window&&null!==(T=window)&&void 0!==T&&T.crypto&&null!==(A=window)&&void 0!==A&&A.crypto.getRandomValues){var R,C=new Uint32Array(256);for(null===(R=window)||void 0===R||R.crypto.getRandomValues(C),P=0;P<C.length;++P)O[S++]=255&C[P]}var N,k,U,j=function(e){var t,n,r;if(this.count=this.count||0,this.count>=256||S>=256){if("undefined"!=typeof window)if(null!==(t=window)&&void 0!==t&&t.removeEventListener)null===(r=window)||void 0===r||r.removeEventListener("mousemove",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;O[S++]=255&i,this.count+=1}catch(e){}};if("undefined"!=typeof window)if(null!==(N=window)&&void 0!==N&&N.addEventListener)null===(U=window)||void 0===U||U.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 le(){if(null==E){for(E=new ue;S<256;){var e=Math.floor(65536*Math.random());O[S++]=255&e}for(E.init(O),S=0;S<O.length;++S)O[S]=0;S=0}return E.next()}class pe{constructor(){}nextBytes(e){for(var t=0;t<e.length;++t)e[t]=le()}}function de(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 pe,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 ee(n)}class he{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=ne(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")}encrypt(e){var t=de(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})),K(r)):K(this.encrypt(e))}catch(e){return!1}}decryptLong(e){var t=this,n=this.n.bitLength()+7>>3;e=J(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=ne(e,16),this.e=parseInt(t,16),this.d=ne(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=ne(e,16),this.e=parseInt(t,16),this.d=ne(n,16),this.p=ne(r,16),this.q=ne(o,16),this.dmp1=ne(i,16),this.dmq1=ne(a,16),this.coeff=ne(s,16)):console.error("Invalid RSA private key")}generate(e,t){var n=new pe,r=e>>1;this.e=parseInt(t,16);for(var o=new ee(t,16);;){for(;this.p=new ee(e-r,1,n),0!=this.p.subtract(ee.ONE).gcd(o).compareTo(ee.ONE)||!this.p.isProbablePrime(10););for(;this.q=new ee(r,1,n),0!=this.q.subtract(ee.ONE).gcd(o).compareTo(ee.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(ee.ONE),s=this.q.subtract(ee.ONE),c=a.multiply(s);if(0==c.gcd(o).compareTo(ee.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=ne(e,16),n=this.doPrivate(t);return null==n?null:fe(n,this.n.bitLength()+7>>3)}generateAsync(e,t,n){var r=new pe,o=e>>1;this.e=parseInt(t,16);var i=new ee(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(ee.ONE),r=a.q.subtract(ee.ONE),o=t.multiply(r);0==o.gcd(i).compareTo(ee.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=te(),a.q.fromNumberAsync(o,1,r,(function(){a.q.subtract(ee.ONE).gcda(i,(function(e){0==e.compareTo(ee.ONE)&&a.q.isProbablePrime(10)?setTimeout(t,0):setTimeout(c,0)}))}))},u=()=>{a.p=te(),a.p.fromNumberAsync(e-o,1,r,(function(){a.p.subtract(ee.ONE).gcda(i,(function(e){0==e.compareTo(ee.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 me extends he{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";super(),e&&("string"==typeof e?this.parseKey(e):(this.hasPrivateKeyProperty(e)||this.hasPublicKeyProperty(e))&&this.parsePropertiesFrom(e))}parseKey(e){try{var t=0,n=0,r=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(e)?u.decode(e):l.unarmor(e),o=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=ne(t,16),n=o.sub[2].getHexStringValue(),this.e=parseInt(n,16);var i=o.sub[3].getHexStringValue();this.d=ne(i,16);var a=o.sub[4].getHexStringValue();this.p=ne(a,16);var s=o.sub[5].getHexStringValue();this.q=ne(s,16);var c=o.sub[6].getHexStringValue();this.dmp1=ne(c,16);var p=o.sub[7].getHexStringValue();this.dmq1=ne(p,16);var d=o.sub[8].getHexStringValue();this.coeff=ne(d,16)}else{if(2!==o.sub.length)return!1;var h=o.sub[1].sub[0];t=h.sub[0].getHexStringValue(),this.n=ne(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 me(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(J(e))}catch(e){return!1}},r.prototype.encrypt=function(e){try{return K(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 me,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 D=r;var q=n(2631),M=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,q.I)(i),s=new D;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:(t,n,r)=>{r.d(n,{j$:()=>a,Fs:()=>s,_G:()=>o,U3:()=>c,BM:()=>l,RR:()=>u,P6:()=>i});var o={};r.r(o),r.d(o,{vM:()=>g,Sg:()=>y,Fk:()=>v,eX:()=>h,pM:()=>m,tC:()=>d});var i={};r.r(i),r.d(i,{createPromiseCallback:()=>j,execCallback:()=>L,formatUrl:()=>R,genSeqId:()=>A,generateRequestId:()=>P,getHash:()=>k,getQuery:()=>N,isArray:()=>w,isFormData:()=>T,isInstanceOf:()=>O,isNull:()=>S,isPalinObject:()=>E,isString:()=>_,isUndefined:()=>I,parseCaptcha:()=>H,parseQueryString:()=>G,printError:()=>q,printGroupLog:()=>B,printInfo:()=>M,printWarn:()=>D,removeParam:()=>U,sleep:()=>W,throwError:()=>F,toQueryString:()=>C,transformPhone:()=>V});var a={};r.r(a),r.d(a,{Fk:()=>ee,xY:()=>te});var s={};r.r(s),r.d(s,{q:()=>ae});var c={};r.r(c),r.d(c,{yE:()=>le});var u={};r.r(u),r.d(u,{P:()=>de,$:()=>pe});var l={};r.r(l),r.d(l,{D:()=>ye});var p="@cloudbase/js-sdk";function d(e){p=e}function h(){return p}var f="https:";function m(e){f=e}var v=("undefined"==typeof process||process.env,!1),g="https://support.qq.com/products/148793",y={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=r(7149),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 w(e){return"[object Array]"===Object.prototype.toString.call(e)}function _(e){return"string"==typeof e}function I(e){return void 0===e}function E(e){return"[object Object]"===Object.prototype.toString.call(e)}function S(e){return"[object Null]"===Object.prototype.toString.call(e)}function O(e,t){return e instanceof t}function T(e){return"[object FormData]"===Object.prototype.toString.call(e)}function A(){return Math.random().toString(16).slice(2)}function P(){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 R(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 C(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 N(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 k=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 j(){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 L(e,t,n){if(void 0===n&&(n=null),e&&"function"==typeof e)return e(t,n);if(t)throw t;return n}function D(e,t){console.warn("[".concat(h(),"][").concat(e,"]:").concat(t))}function q(e,t){console.error({code:e,msg:"[".concat(h(),"][").concat(e,"]:").concat(t)})}function M(e,t){console.log("[".concat(h(),"][").concat(e,"]:").concat(t))}function F(e,t){throw new Error(JSON.stringify({code:e,msg:"[".concat(h(),"][").concat(e,"]:").concat(t)}))}function B(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 W=function(e){return void 0===e&&(e=0),new Promise((function(t){return setTimeout(t,e)}))};function V(e){return"+86".concat(e)}var G=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 H(e){var t={},n=e.match(/^(data:.*?)(\?[^#\s]*)?$/);if(n){e=n[1];var r=n[2];r&&(t=G(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 z,K,J=(z=function(e,t){return z=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])},z(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}z(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),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,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())}))},Q=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])}}},X=function(e){function t(t){var n=e.call(this)||this,r=t.timeout,o=t.timeoutMsg,i=t.restrictedMethods;return n.timeout=r||0,n.timeoutMsg=o||"请求超时",n.restrictedMethods=i||["get","post","upload","download"],n}return J(t,e),t.prototype.get=function(e){return this.request(Y(Y({},e),{method:"get"}),this.restrictedMethods.includes("get"))},t.prototype.post=function(e){return this.request(Y(Y({},e),{method:"post"}),this.restrictedMethods.includes("post"))},t.prototype.put=function(e){return this.request(Y(Y({},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(Y(Y({},e),{data:c,method:s}),this.restrictedMethods.includes("upload"))):this.request(Y(Y({},e),{method:"put",headers:a,body:n}),this.restrictedMethods.includes("upload"))},t.prototype.download=function(e){return $(this,void 0,Promise,(function(){var t,n,r,o;return Q(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.get(Y(Y({},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 $(this,void 0,Promise,(function(){var n,r,o,i,a,s,c,u,l,p,d,h,f,m=this;return Q(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,Y(Y({},e),{signal:n.signal})).then((function(e){return $(m,void 0,void 0,(function(){var t,n,r;return Q(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,h=R(f,i,"get"===r?c:{}),m=new XMLHttpRequest;m.open(r,h),u&&(m.responseType=u);var v,g,y=e.signal;y&&(y.aborted?m.abort():y.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)),g=T(c)?c:"application/x-www-form-urlencoded"===s["content-type"]?C(c):p||(c?JSON.stringify(c):void 0),l&&(m.withCredentials=!0),m.send(g)}))},t}(b.AbstractSDKRequest),Z=function(){return Z=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},Z.apply(this,arguments)};function ee(e,t){for(var n=0,r=w(e)?e:[e];n<r.length;n++){var o=r[n],i=o.isMatch,a=o.genAdapter,s=o.runtime;if(i())return{adapter:Z({isMatch:i},a(t)),runtime:s}}}function te(){return{adapter:Z({},{type:"default",root:window,reqClass:X,wsClass:WebSocket,localStorage}),runtime:K.WEB}}!function(e){e.WEB="web",e.WX_MP="wx_mp"}(K||(K={}));var 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(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])}}},ie=function(e){function t(t){var n=e.call(this)||this;return n.root=t,t.tcbCacheObject||(t.tcbCacheObject={}),n}return ne(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),ae=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:(D(y.INVALID_PARAMS,"localStorage is not supported on current platform"),new ie(t.root));case"none":return new ie(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:y.OPERATION_FAIL,msg:"[".concat(h(),"][").concat(y.OPERATION_FAIL,"]setStore failed"),info:e}))}}else D(y.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},e.prototype.setStoreAsync=function(e,t,n){return re(this,void 0,void 0,(function(){var r;return oe(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:""}D(y.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},e.prototype.getStoreAsync=function(e,t){var n;return re(this,void 0,void 0,(function(){var r;return oe(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):D(y.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},e.prototype.removeStoreAsync=function(e){return re(this,void 0,void 0,(function(){return oe(this,(function(t){switch(t.label){case 0:return[4,this.storage.removeItem(e)];case 1:return t.sent(),[2]}}))}))},e}(),se=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)}}(),ce=function(e,t){this.data=t||null,this.name=e},ue=function(e){function t(t,n){var r=e.call(this,"error",{error:t,data:n})||this;return r.error=t,r}return se(t,e),t}(ce),le=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(O(e,ue))return console.error(e.error),this;var n=_(e)?new ce(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 le;var pe=new le,de="lang_change",he=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())}))},fe=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=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(me=-1!==navigator.userAgent.indexOf("Firefox"));var ve=me?/(\.js\/)?__decorate(\$\d+)?<@.*\d$/:/(\/\w+\.js\.)?__decorate(\$\d+)?\s*\(.*\)$/,ge=/https?:\/\/.+:\d*\/.*\.js:\d+:\d+/;function ye(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 ve.test(e)}));if(-1!==n){var r=ge.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=be({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}}))),B(h),r}}:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return he(this,void 0,void 0,(function(){var t,n,r,o,p,d,h,f;return fe(this,(function(m){switch(m.label){case 0:t=be({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}}))),B(h),r;case 4:return[2]}}))}))}}}}function be(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=me?/^catchErrorsDecorator\/<\/descriptor.value@.*\d$/:new RegExp("".concat(n,"\\.descriptor.value\\s*\\[as\\s").concat(r,"\\]\\s*\\(.*\\)$")),c=me?/^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(ge,o)),(i=new Error).stack="".concat(me?"@debugger":"Error","\n").concat(l.join("\n"))}return i}xe={default:()=>e.default},we={},r.d(we,xe);var xe,we},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,g,y=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(y.timeoutMsg),n.abort(new Error(y.timeoutMsg))}),m)),[4,fetch(r,i(i({},e),{signal:n.signal})).then((function(e){return a(y,void 0,void 0,(function(){var t,n,r;return s(this,(function(o){switch(o.label){case 0:return clearTimeout(v),f?e.ok?(t=e,[3,3]):[3,1]:[3,4];case 1:return r=(n=Promise).reject,[4,e.json()];case 2:t=r.apply(n,[o.sent()]),o.label=3;case 3:return[2,t];case 4:return[2,e]}}))}))})).catch((function(e){return clearTimeout(v),Promise.reject(e)}))];case 1:return g=b.sent(),[2,{data:l?g.body:(null===(t=g.headers.get("content-type"))||void 0===t?void 0:t.includes("application/json"))?g.json():g.text(),statusCode:g.status,header:g.headers,response:g}]}}))}))},t.prototype.request=function(e,t){var n=this;void 0===t&&(t=!1);var r=String(e.method).toLowerCase()||"get";return new Promise((function(o){var i=e.url,a=e.headers,s=void 0===a?{}:a,c=e.data,p=e.responseType,d=e.withCredentials,h=e.body,f=e.onUploadProgress,m=(0,u.formatUrl)((0,l.getProtocol)(),i,"get"===r?c:{}),v=new XMLHttpRequest;v.open(r,m),p&&(v.responseType=p);var g,y,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(g),o(e)}},t&&n.timeout&&(g=setTimeout((function(){console.warn(n.timeoutMsg),v.abort()}),n.timeout)),y=(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(y)}))},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,g=function(){var e="",t=(new Error).stack.split("\n"),n=t.findIndex((function(e){return c.test(e)}));if(-1!==n){var r=u.exec(t[n+1]||"");e=r?r[0]:""}return e}();s.value="sync"===n?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=l({err:new Error,className:h,methodName:m,sourceLink:g});try{return v.apply(this,e)}catch(e){var r=e,o=e.message,a=e.error,s=e.error_description,c={title:d||"".concat(h,".").concat(m," failed"),content:[{type:"error",body:e}]};if(o&&/^\{.*\}$/.test(o)){var u=JSON.parse(o);c.subtitle=o,u.code&&(n?(n.code=u.code,n.msg=u.msg):(e.code=u.code,e.message=u.msg),r=n||e,c.content=f.map((function(e){return{type:"info",body:e}})))}throw a&&s&&(c.subtitle=s,n?(n.code=a,n.msg=s):(e.code=a,e.message=s),r=n||e,c.content=f.map((function(e){return{type:"info",body:e}}))),(0,i.printGroupLog)(c),r}}:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r(this,void 0,void 0,(function(){var t,n,r,a,s,c,u,p;return o(this,(function(o){switch(o.label){case 0:t=l({err:new Error,className:h,methodName:m,sourceLink:g}),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,v.apply(this,e)];case 2:return[2,o.sent()];case 3:throw n=o.sent(),r=n,a=n.message,s=n.error,c=n.error_description,u={title:d||"".concat(h,".").concat(m," failed"),content:[{type:"error",body:n}]},a&&/^\{.*\}$/.test(a)&&(p=JSON.parse(a),u.subtitle=p,p.code&&(t?(t.code=p.code,t.message=p.msg):(n.code=p.code,n.message=p.msg),r=t||n,u.content=f.map((function(e){return{type:"info",body:e}})))),s&&c&&(u.subtitle=c,t?(t.code=s,t.msg=c):(n.code=s,n.message=c),r=t||n,u.content=f.map((function(e){return{type:"info",body:e}}))),(0,i.printGroupLog)(u),r;case 4:return[2]}}))}))}}}}},141:function(e,t,n){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=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.parseCaptcha=t.parseQueryString=t.transformPhone=t.sleep=t.printGroupLog=t.throwError=t.printInfo=t.printError=t.printWarn=t.execCallback=t.createPromiseCallback=t.removeParam=t.getHash=t.getQuery=t.toQueryString=t.formatUrl=t.generateRequestId=t.genSeqId=t.isFormData=t.isInstanceOf=t.isNull=t.isPalinObject=t.isUndefined=t.isString=t.isArray=void 0;var o=n(794);t.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},t.isString=function(e){return"string"==typeof e},t.isUndefined=function(e){return void 0===e},t.isPalinObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},t.isNull=function(e){return"[object Null]"===Object.prototype.toString.call(e)},t.isInstanceOf=function(e,t){return e instanceof t},t.isFormData=function(e){return"[object FormData]"===Object.prototype.toString.call(e)},t.genSeqId=function(){return Math.random().toString(16).slice(2)},t.generateRequestId=function(){var e=(new Date).getTime(),t=(null===Date||void 0===Date?void 0:Date.now)&&1e3*Date.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(n){var r=16*Math.random();return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),("x"===n?r:7&r|8).toString(16)}))},t.formatUrl=function(e,t,n){void 0===n&&(n={});var r=/\?/.test(t),o="";return Object.keys(n).forEach((function(e){""===o?!r&&(t+="?"):o+="&",o+="".concat(e,"=").concat(encodeURIComponent(n[e]))})),/^http(s)?:\/\//.test(t+=o)?t:"".concat(e).concat(t)},t.toQueryString=function(e){void 0===e&&(e={});var t=[];return Object.keys(e).forEach((function(n){t.push("".concat(n,"=").concat(encodeURIComponent(e[n])))})),t.join("&")},t.getQuery=function(e,t){if("undefined"==typeof window)return!1;var n=t||decodeURIComponent(window.location.search),r=new RegExp("(^|&)".concat(e,"=([^&]*)(&|$)")),o=n.substr(n.indexOf("?")+1).match(r);return null!=o?o[2]:""},t.getHash=function(e){if("undefined"==typeof window)return"";var t=window.location.hash.match(new RegExp("[#?&/]".concat(e,"=([^&#]*)")));return t?t[1]:""},t.removeParam=function(e,t){var n=t.split("?")[0],r=[],o=-1!==t.indexOf("?")?t.split("?")[1]:"";if(""!==o){for(var i=(r=o.split("&")).length-1;i>=0;i-=1)r[i].split("=")[0]===e&&r.splice(i,1);n="".concat(n,"?").concat(r.join("&"))}return n},t.createPromiseCallback=function(){var e={};if(!Promise){(e=function(){}).promise={};var t=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}var n=new Promise((function(t,n){e=function(e,r){return e?n(e):t(r)}}));return e.promise=n,e},t.execCallback=function(e,t,n){if(void 0===n&&(n=null),e&&"function"==typeof e)return e(t,n);if(t)throw t;return n},t.printWarn=function(e,t){console.warn("[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t))},t.printError=function(e,t){console.error({code:e,msg:"[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t)})},t.printInfo=function(e,t){console.log("[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t))},t.throwError=function(e,t){throw new Error(JSON.stringify({code:e,msg:"[".concat((0,o.getSdkName)(),"][").concat(e,"]:").concat(t)}))},t.printGroupLog=function(e){var t,n=e.title,r=e.subtitle,o=void 0===r?"":r,i=e.content,a=void 0===i?[]:i,s=e.printTrace,c=void 0!==s&&s,u=e.collapsed;void 0!==u&&u?(console.groupCollapsed||console.error)(n,o):(console.group||console.error)(n,o);for(var l=0,p=a;l<p.length;l++){var d=p[l],h=d.type,f=d.body;switch(h){case"info":console.log(f);break;case"warn":console.warn(f);break;case"error":console.error(f)}}c&&(console.trace||console.log)("stack trace:"),null===(t=console.groupEnd)||void 0===t||t.call(console)},t.sleep=function(e){return void 0===e&&(e=0),new Promise((function(t){return setTimeout(t,e)}))},t.transformPhone=function(e){return"+86".concat(e)},t.parseQueryString=function(e){e=e.replace(/^\?/,"");var t={};return e.split("&").forEach((function(e){var n=e.split("="),r=n[0],o=n[1];r=decodeURIComponent(r),o=decodeURIComponent(o),r&&(t[r]?Array.isArray(t[r])?t[r].push(o):t[r]=[t[r],o]:t[r]=o)})),t},t.parseCaptcha=function(e){var n={},o=e.match(/^(data:.*?)(\?[^#\s]*)?$/);if(o){e=o[1];var i=o[2];i&&(n=(0,t.parseQueryString)(i))}var a=n.token,s=r(n,["token"]);return/^data:/.test(e)&&!a?{error:"invalid_argument",error_description:"invalid captcha data: ".concat(e)}:a?{state:s.state,token:a,captchaData:e}:{error:"unimplemented",error_description:"need to impl captcha data"}}},6160:(e,t,n)=>{var r=n(3837),o=n(2781).Stream,i=n(8178);function a(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}e.exports=a,r.inherits(a,o),a.create=function(e){var t=new this;for(var n in e=e||{})t[n]=e[n];return t},a.isStreamLike=function(e){return"function"!=typeof e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&!Buffer.isBuffer(e)},a.prototype.append=function(e){if(a.isStreamLike(e)){if(!(e instanceof i)){var t=i.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=t}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this},a.prototype.pipe=function(e,t){return o.prototype.pipe.call(this,e,t),this.resume(),e},a.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop)this._pendingNext=!0;else{this._insideLoop=!0;try{do{this._pendingNext=!1,this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=!1}}},a.prototype._realGetNext=function(){var e=this._streams.shift();void 0!==e?"function"==typeof e?e(function(e){a.isStreamLike(e)&&(e.on("data",this._checkDataSize.bind(this)),this._handleErrors(e)),this._pipeNext(e)}.bind(this)):this._pipeNext(e):this.end()},a.prototype._pipeNext=function(e){if(this._currentStream=e,a.isStreamLike(e))return e.on("end",this._getNext.bind(this)),void e.pipe(this,{end:!1});var t=e;this.write(t),this._getNext()},a.prototype._handleErrors=function(e){var t=this;e.on("error",(function(e){t._emitError(e)}))},a.prototype.write=function(e){this.emit("data",e)},a.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.pause&&this._currentStream.pause(),this.emit("pause"))},a.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.resume&&this._currentStream.resume(),this.emit("resume")},a.prototype.end=function(){this._reset(),this.emit("end")},a.prototype.destroy=function(){this._reset(),this.emit("close")},a.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null},a.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}},a.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach((function(t){t.dataSize&&(e.dataSize+=t.dataSize)})),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)},a.prototype._emitError=function(e){this._reset(),this.emit("error",e)}},8178:(e,t,n)=>{var r=n(2781).Stream,o=n(3837);function i(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}e.exports=i,o.inherits(i,r),i.create=function(e,t){var n=new this;for(var r in t=t||{})n[r]=t[r];n.source=e;var o=e.emit;return e.emit=function(){return n._handleEmit(arguments),o.apply(e,arguments)},e.on("error",(function(){})),n.pauseStream&&e.pause(),n},Object.defineProperty(i.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),i.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},i.prototype.resume=function(){this._released||this.release(),this.source.resume()},i.prototype.pause=function(){this.source.pause()},i.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]},i.prototype.pipe=function(){var e=r.prototype.pipe.apply(this,arguments);return this.resume(),e},i.prototype._handleEmit=function(e){this._released?this.emit.apply(this,e):("data"===e[0]&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e))},i.prototype._checkIfMaxDataSizeExceeded=function(){if(!(this._maxDataSizeExceeded||this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}},1191:(e,t,n)=>{var r=n(6160),o=n(3837),i=n(1017),a=n(3685),s=n(5687),c=n(7310).parse,u=n(7147),l=n(2781).Stream,p=n(6856),d=n(9954),h=n(5488);function f(e){if(!(this instanceof f))return new f(e);for(var t in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],r.call(this),e=e||{})this[t]=e[t]}e.exports=f,o.inherits(f,r),f.LINE_BREAK="\r\n",f.DEFAULT_CONTENT_TYPE="application/octet-stream",f.prototype.append=function(e,t,n){"string"==typeof(n=n||{})&&(n={filename:n});var i=r.prototype.append.bind(this);if("number"==typeof t&&(t=""+t),o.isArray(t))this._error(new Error("Arrays are not supported."));else{var a=this._multiPartHeader(e,t,n),s=this._multiPartFooter();i(a),i(t),i(s),this._trackLength(a,t,n)}},f.prototype._trackLength=function(e,t,n){var r=0;null!=n.knownLength?r+=+n.knownLength:Buffer.isBuffer(t)?r=t.length:"string"==typeof t&&(r=Buffer.byteLength(t)),this._valueLength+=r,this._overheadLength+=Buffer.byteLength(e)+f.LINE_BREAK.length,t&&(t.path||t.readable&&t.hasOwnProperty("httpVersion")||t instanceof l)&&(n.knownLength||this._valuesToMeasure.push(t))},f.prototype._lengthRetriever=function(e,t){e.hasOwnProperty("fd")?null!=e.end&&e.end!=1/0&&null!=e.start?t(null,e.end+1-(e.start?e.start:0)):u.stat(e.path,(function(n,r){var o;n?t(n):(o=r.size-(e.start?e.start:0),t(null,o))})):e.hasOwnProperty("httpVersion")?t(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",(function(n){e.pause(),t(null,+n.headers["content-length"])})),e.resume()):t("Unknown stream")},f.prototype._multiPartHeader=function(e,t,n){if("string"==typeof n.header)return n.header;var r,o=this._getContentDisposition(t,n),i=this._getContentType(t,n),a="",s={"Content-Disposition":["form-data",'name="'+e+'"'].concat(o||[]),"Content-Type":[].concat(i||[])};for(var c in"object"==typeof n.header&&h(s,n.header),s)s.hasOwnProperty(c)&&null!=(r=s[c])&&(Array.isArray(r)||(r=[r]),r.length&&(a+=c+": "+r.join("; ")+f.LINE_BREAK));return"--"+this.getBoundary()+f.LINE_BREAK+a+f.LINE_BREAK},f.prototype._getContentDisposition=function(e,t){var n,r;return"string"==typeof t.filepath?n=i.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e.name||e.path?n=i.basename(t.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(n=i.basename(e.client._httpMessage.path||"")),n&&(r='filename="'+n+'"'),r},f.prototype._getContentType=function(e,t){var n=t.contentType;return!n&&e.name&&(n=p.lookup(e.name)),!n&&e.path&&(n=p.lookup(e.path)),!n&&e.readable&&e.hasOwnProperty("httpVersion")&&(n=e.headers["content-type"]),n||!t.filepath&&!t.filename||(n=p.lookup(t.filepath||t.filename)),n||"object"!=typeof e||(n=f.DEFAULT_CONTENT_TYPE),n},f.prototype._multiPartFooter=function(){return function(e){var t=f.LINE_BREAK;0===this._streams.length&&(t+=this._lastBoundary()),e(t)}.bind(this)},f.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+f.LINE_BREAK},f.prototype.getHeaders=function(e){var t,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)e.hasOwnProperty(t)&&(n[t.toLowerCase()]=e[t]);return n},f.prototype.setBoundary=function(e){this._boundary=e},f.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},f.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),n=0,r=this._streams.length;n<r;n++)"function"!=typeof this._streams[n]&&(e=Buffer.isBuffer(this._streams[n])?Buffer.concat([e,this._streams[n]]):Buffer.concat([e,Buffer.from(this._streams[n])]),"string"==typeof this._streams[n]&&this._streams[n].substring(2,t.length+2)===t||(e=Buffer.concat([e,Buffer.from(f.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},f.prototype._generateBoundary=function(){for(var e="--------------------------",t=0;t<24;t++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},f.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},f.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},f.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;this._streams.length&&(t+=this._lastBoundary().length),this._valuesToMeasure.length?d.parallel(this._valuesToMeasure,this._lengthRetriever,(function(n,r){n?e(n):(r.forEach((function(e){t+=e})),e(null,t))})):process.nextTick(e.bind(this,null,t))},f.prototype.submit=function(e,t){var n,r,o={method:"post"};return"string"==typeof e?(e=c(e),r=h({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(r=h(e,o)).port||(r.port="https:"==r.protocol?443:80),r.headers=this.getHeaders(e.headers),n="https:"==r.protocol?s.request(r):a.request(r),this.getLength(function(e,r){if(e&&"Unknown stream"!==e)this._error(e);else if(r&&n.setHeader("Content-Length",r),this.pipe(n),t){var o,i=function(e,r){return n.removeListener("error",i),n.removeListener("response",o),t.call(this,e,r)};o=i.bind(this,null),n.on("error",i),n.on("response",o)}}.bind(this)),n},f.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},f.prototype.toString=function(){return"[object FormData]"}},5488:e=>{e.exports=function(e,t){return Object.keys(t).forEach((function(n){e[n]=e[n]||t[n]})),e}},9515:(e,t,n)=>{var r=n(8761)(n(7772),"DataView");e.exports=r},9612:(e,t,n)=>{var r=n(2118),o=n(6909),i=n(8138),a=n(4174),s=n(7942);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},235:(e,t,n)=>{var r=n(3945),o=n(1846),i=n(2862),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),g=n(8725),y=n(6152),b=n(3226),x=n(4714),w=n(9259),_=n(3679),I=n(249),E=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,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(!w(t))return t;var D=y(t);if(D){if(k=m(t),!U)return u(t,k)}else{var q=f(t),M=q==O||"[object GeneratorFunction]"==q;if(b(t))return c(t,U);if(q==T||q==S||M&&!C){if(k=j||M?{}:g(t),!U)return j?p(t,s(k,t)):l(t,a(k,t))}else{if(!A[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))})):x(t)&&t.forEach((function(r,o){k.set(o,e(r,n,P,o,t,N))}));var B=D?void 0:(L?j?h:d:j?E:I)(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 h=s(t[u]),f=n;if("__proto__"===h||"constructor"===h||"prototype"===h)return e;if(u!=p){var m=d[h];void 0===(f=c?c(m,h,d):void 0)&&(f=a(m)?m:i(t[u+1])?[]:{})}r(d,h,f),d=d[h]}return e}},9872:e=>{e.exports=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}},6473:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},1054:(e,t,n)=>{var r=n(857),o=n(343),i=n(6152),a=n(4795),s=r?r.prototype:void 0,c=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(a(t))return c?c.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},7826:e=>{e.exports=function(e){return function(t){return e(t)}}},9078:(e,t,n)=>{var r=n(7297),o=n(6974),i=n(2721),a=n(3812);e.exports=function(e,t){return t=r(t,e),null==(e=i(e,t))||delete e[a(o(t))]}},7297:(e,t,n)=>{var r=n(6152),o=n(1401),i=n(4452),a=n(6188);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:i(a(e))}},9882:(e,t,n)=>{var r=n(9162);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},2175:(e,t,n)=>{e=n.nmd(e);var r=n(7772),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},4727:(e,t,n)=>{var r=n(9882);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},6058:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},169:(e,t,n)=>{var r=n(857),o=r?r.prototype:void 0,i=o?o.valueOf:void 0;e.exports=function(e){return i?Object(i.call(e)):{}}},6190:(e,t,n)=>{var r=n(9882);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},1522:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},752:(e,t,n)=>{var r=n(91),o=n(3940);e.exports=function(e,t,n,i){var a=!n;n||(n={});for(var s=-1,c=t.length;++s<c;){var u=t[s],l=i?i(n[u],e[u],u,n,e):void 0;void 0===l&&(l=e[u]),a?o(n,u,l):r(n,u,l)}return n}},7680:(e,t,n)=>{var r=n(752),o=n(633);e.exports=function(e,t){return r(e,o(e),t)}},9987:(e,t,n)=>{var r=n(752),o=n(2680);e.exports=function(e,t){return r(e,o(e),t)}},4019:(e,t,n)=>{var r=n(7772)["__core-js_shared__"];e.exports=r},3043:(e,t,n)=>{var r=n(8761),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},1242:e=>{var t="object"==typeof global&&global&&global.Object===Object&&global;e.exports=t},3483:(e,t,n)=>{var r=n(1897),o=n(633),i=n(249);e.exports=function(e){return r(e,i,o)}},6939:(e,t,n)=>{var r=n(1897),o=n(2680),i=n(8582);e.exports=function(e){return r(e,i,o)}},7937:(e,t,n)=>{var r=n(8304);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},8761:(e,t,n)=>{var r=n(6840),o=n(8109);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},7353:(e,t,n)=>{var r=n(241)(Object.getPrototypeOf,Object);e.exports=r},2107:(e,t,n)=>{var r=n(857),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[s]=n:delete e[s]),o}},633:(e,t,n)=>{var r=n(7552),o=n(981),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return i.call(e,t)})))}:o;e.exports=s},2680:(e,t,n)=>{var r=n(5067),o=n(7353),i=n(633),a=n(981),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:a;e.exports=s},940:(e,t,n)=>{var r=n(9515),o=n(326),i=n(2760),a=n(2143),s=n(3215),c=n(3366),u=n(7035),l="[object Map]",p="[object Promise]",d="[object Set]",h="[object WeakMap]",f="[object DataView]",m=u(r),v=u(o),g=u(i),y=u(a),b=u(s),x=c;(r&&x(new r(new ArrayBuffer(1)))!=f||o&&x(new o)!=l||i&&x(i.resolve())!=p||a&&x(new a)!=d||s&&x(new s)!=h)&&(x=function(e){var t=c(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case m:return f;case v:return l;case g:return p;case y:return d;case b:return h}return t}),e.exports=x},8109:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},2118:(e,t,n)=>{var r=n(9191);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},6909:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},8138:(e,t,n)=>{var r=n(9191),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},4174:(e,t,n)=>{var r=n(9191),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},7942:(e,t,n)=>{var r=n(9191);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},9917:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},8222:(e,t,n)=>{var r=n(9882),o=n(4727),i=n(6058),a=n(169),s=n(6190);e.exports=function(e,t,n){var c=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return o(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return i(e);case"[object Symbol]":return a(e)}}},8725:(e,t,n)=>{var r=n(9413),o=n(7353),i=n(6001);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:r(o(e))}},9045:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},1401:(e,t,n)=>{var r=n(6152),o=n(4795),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||a.test(e)||!i.test(e)||null!=t&&e in Object(t)}},8304:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7394:(e,t,n)=>{var r,o=n(4019),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},6001:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},3945:e=>{e.exports=function(){this.__data__=[],this.size=0}},1846:(e,t,n)=>{var r=n(2218),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}},2862:(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)}},9474:(e,t,n)=>{e.exports=n(7104)},6856:(e,t,n)=>{var r,o,i,a=n(9474),s=n(1017).extname,c=/^\s*([^;\s]*)(?:;|\s|$)/,u=/^text\//i;function l(e){if(!e||"string"!=typeof e)return!1;var t=c.exec(e),n=t&&a[t[1].toLowerCase()];return n&&n.charset?n.charset:!(!t||!u.test(t[1]))&&"UTF-8"}t.charset=l,t.charsets={lookup:l},t.contentType=function(e){if(!e||"string"!=typeof e)return!1;var n=-1===e.indexOf("/")?t.lookup(e):e;if(!n)return!1;if(-1===n.indexOf("charset")){var r=t.charset(n);r&&(n+="; charset="+r.toLowerCase())}return n},t.extension=function(e){if(!e||"string"!=typeof e)return!1;var n=c.exec(e),r=n&&t.extensions[n[1].toLowerCase()];return!(!r||!r.length)&&r[0]},t.extensions=Object.create(null),t.lookup=function(e){if(!e||"string"!=typeof e)return!1;var n=s("x."+e).toLowerCase().substr(1);return n&&t.types[n]||!1},t.types=Object.create(null),r=t.extensions,o=t.types,i=["nginx","apache",void 0,"iana"],Object.keys(a).forEach((function(e){var t=a[e],n=t.extensions;if(n&&n.length){r[e]=n;for(var s=0;s<n.length;s++){var c=n[s];if(o[c]){var u=i.indexOf(a[o[c]].source),l=i.indexOf(t.source);if("application/octet-stream"!==o[c]&&(u>l||u===l&&"application/"===o[c].substr(0,12)))continue}o[c]=e}}}))},7149:e=>{e.exports=t},9143:e=>{e.exports=n},9617:e=>{e.exports=r},3408:(e,t,n)=>{var r,i;e.exports=(r={ReadableStream:()=>o.ReadableStream,TransformStream:()=>o.TransformStream},i={},n.d(i,r),i)},9814:e=>{e.exports=i},7147:e=>{e.exports=a(import.meta.url)("fs")},3685:e=>{e.exports=a(import.meta.url)("http")},5687:e=>{e.exports=a(import.meta.url)("https")},1017:e=>{e.exports=a(import.meta.url)("path")},2781:e=>{e.exports=a(import.meta.url)("stream")},7310:e=>{e.exports=a(import.meta.url)("url")},3837:e=>{e.exports=a(import.meta.url)("util")},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}}')}},h={};function f(e){var t=h[e];if(void 0!==t)return t.exports;var n=h[e]={id:e,loaded:!1,exports:{}};return d[e].call(n.exports,n,n.exports,f),n.loaded=!0,n.exports}f.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return f.d(t,{a:t}),t},f.d=(e,t)=>{for(var n in t)f.o(t,n)&&!f.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},f.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),f.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var m={};(()=>{f.d(m,{Z:()=>uu});var e={};f.r(e);var t={};f.r(t),f.d(t,{ArkSimpleModel:()=>Ii,DSSimpleModel:()=>Ai,DefaultImageModel:()=>ta,DefaultSimpleModel:()=>ea,HunYuanBetaSimpleModel:()=>fi,HunYuanExpSimpleModel:()=>Wi,HunYuanOpenSimpleModel:()=>zi,HunYuanSimpleModel:()=>yi,MODELS:()=>fa,MoonshotSimpleModel:()=>qi,ReactModel:()=>sa,YiSimpleModel:()=>ki,ZhiPuSimpleModel:()=>si,toolMap:()=>la});var n={};f.r(n),f.d(n,{LineString:()=>Os,MultiLineString:()=>Cs,MultiPoint:()=>Ps,MultiPolygon:()=>ks,Point:()=>Fs,Polygon:()=>As});var r=f(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 d(e,t){var n=t.name,r=t.namespace,s=t.entity,c=t.injectEvents,u=t.IIFE,l=void 0!==u&&u;if(a[n]||r&&e[r])throw new Error(JSON.stringify({code:i.INVALID_OPERATION,msg:"Duplicate component ".concat(n)}));if(l){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:h(e.prototype,s),c){var p=c.bus,d=c.events;if(!p||!d||0===d.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),d,!0):e.prototype.events[n]={bus:p,events:d},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 h(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]=h(e[o],t[o]))}return e}const v=(g={WxMpWebSocket:()=>s.WxMpWebSocket,WxRequest:()=>s.WxRequest,default:()=>s.default,parseQueryString:()=>s.parseQueryString,wxMpStorage:()=>s.wxMpStorage},y={},f.d(y,g),y);var g,y,b=f(7149),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)},w={},_=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)},I=r.Fs.q,E={},S={};function O(e){var t=e.env,n=e.platformInfo,r={userInfoKey:"".concat("user_info","_").concat(t)};E[t]=E[t]||new I(_(_({},e),{keys:r,platformInfo:n})),S[t]=S[t]||new I(_(_({},e),{keys:r,platformInfo:n,persistence:"local"}))}function T(e){return S[e]}var A=f(7922),P=function(){return P=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},P.apply(this,arguments)},R=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},C=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])}}},N=r._G.Sg,k=r.P6.genSeqId,U=r.P6.isFormData,j=r.P6.formatUrl,L=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"];function D(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&&(U(a)?Object.keys(o).forEach((function(e){a.append(e,o[e])})):t.data=P(P({},a),o)),t.headers=P(P({},t.headers||{}),i),r.call(e,t)}}function q(){var e=k();return{data:{seqId:e},headers:{"X-SDK-Version":"@cloudbase/js-sdk/".concat((0,A.mI)()),"x-seqid":e}}}var M,F,B=function(){function e(e){var t=this;this.throwWhenRequestFail=!1,this.config=e;var n={timeout:this.config.timeout,timeoutMsg:"[@cloudbase/js-sdk] 请求在".concat(this.config.timeout/1e3,"s内未完成,已中断"),restrictedMethods:["post","put"],auth:e.auth};this.reqClass=new w.adapter.reqClass(n),this.throwWhenRequestFail=e.throw||!1,this.localCache=T(this.config.env),"GATEWAY"!==this.config.endPointMode&&(D(this.reqClass,"post",[q]),D(this.reqClass,"upload",[q]),D(this.reqClass,"download",[q])),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 e.prototype.getAccessToken=function(e){return void 0===e&&(e=null),R(this,void 0,void 0,(function(){var t,n,r;return C(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,A.mI)()),e},e.prototype.post=function(e,t){return R(this,void 0,Promise,(function(){return C(this,(function(n){switch(n.label){case 0:return[4,this.reqClass.post(P(P({},e),{headers:P(P({},e.headers),this.getDefaultHeaders()),customReqOpts:t}))];case 1:return[2,n.sent()]}}))}))},e.prototype.upload=function(e){return R(this,void 0,Promise,(function(){return C(this,(function(t){switch(t.label){case 0:return[4,this.reqClass.upload(P(P({},e),{headers:P(P({},e.headers),this.getDefaultHeaders())}))];case 1:return[2,t.sent()]}}))}))},e.prototype.download=function(e){return R(this,void 0,Promise,(function(){return C(this,(function(t){switch(t.label){case 0:return[4,this.reqClass.download(P(P({},e),{headers:P(P({},e.headers),this.getDefaultHeaders())}))];case 1:return[2,t.sent()]}}))}))},e.prototype.getBaseEndPoint=function(e){return void 0===e&&(e="CLOUD_API"),(0,A.M4)(this.config.env,e)},e.prototype.getOauthAccessTokenV2=function(e){return R(this,void 0,Promise,(function(){var t,n;return C(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 R(this,void 0,Promise,(function(){var a,s,c,u,l,p,d,h,f,m,v,g,y,b,x,w,_,I,E,S,O,T,R;return C(this,(function(C){switch(C.label){case 0:if(C.trys.push([0,4,,5]),a="x-tcb-trace_".concat(this.config.env),s="application/x-www-form-urlencoded",c=P({action:e,dataVersion:A.n0,env:this.config.env},t),-1!==L.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=C.sent().accessToken,C.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:P(P({"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,g=void 0!==(null==n?void 0:n.inQuery)?n.inQuery:t.inQuery,y=void 0!==(null==n?void 0:n.search)?n.search:t.search,b=P(P({},(null==n?void 0:n.defaultQuery)||{}),{env:this.config.env}),v&&(b.parse=!0),g&&(b=P(P({},g),b)),x=(null==n?void 0:n.endPointMode)||this.config.endPointMode||"CLOUD_API",w=(0,A.vS)(this.config.env,x),_=w.baseUrl,I=w.protocol,"GATEWAY"===x&&/^((database)\.)|(auth\.wsWebSign)/.test(e)&&(E=(0,A.vS)(this.config.env,"CLOUD_API"),_="".concat(E.baseUrl.match(/\/\/([^/?#]*)/)[0],"/web")),S=void 0,S=n.pathname?j(I,"".concat(null===(o=(0,A.M4)(this.config.env,x))||void 0===o?void 0:o.replace(/^https?:/,""),"/").concat(n.pathname),b):j(I,_,b),y&&(S+=y),[4,this.post(P({url:S,data:h},f),r)];case 3:if(O=C.sent(),(T=null===(i=O.header)||void 0===i?void 0:i["x-tcb-trace"])&&this.localCache.setStore(a,T),200!==Number(O.status)&&200!==Number(O.statusCode)||!O.data)throw new Error("network request error");return[2,O];case 4:R=C.sent();try{R.requestId=R.requestId||(null==n?void 0:n.headers["x-request-id"])||(null==n?void 0:n.headers["X-Request-Id"])||""}catch(e){}throw R;case 5:return[2]}}))}))},e.prototype.fetch=function(e){var t,n,r,o,i,a,s,c;return R(this,void 0,Promise,(function(){var u,l,p,d,h,f,m,v,g=this;return C(this,(function(y){switch(y.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 R(g,void 0,void 0,(function(){var e,t,n,r;return C(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=P({headers:P(P(P({"X-SDK-Version":"@cloudbase/js-sdk/".concat((0,A.mI)())},e),this.getDefaultHeaders()),p),withCredentials:h},f),[2,this.reqClass.fetch(r)]}}))}))},y.label=1;case 1:return y.trys.push([1,3,,6]),[4,m()];case 2:return[2,y.sent()];case 3:v=y.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 y.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={}),R(this,void 0,Promise,(function(){var o;return C(this,(function(i){switch(i.label){case 0:return[4,this.request(e,t,P(P({},n),{onUploadProgress:t.onUploadProgress}),r)];case 1:if((o=i.sent()).data.code&&this.throwWhenRequestFail)throw new Error(JSON.stringify({code:N.OPERATION_FAIL,msg:"[".concat(o.data.code,"] ").concat(o.data.message)}));return[2,o.data]}}))}))},e.prototype.gateWay=function(e,t){var n;return R(this,void 0,void 0,(function(){var o,i,a,s,c,u,l,p,d,h,f,m,v,g,y,b,x,w,_;return C(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:N.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:N.INVALID_PARAMS,msg:"[gateWay] invalid data"}))}if(h=r.P6.generateRequestId(),f=(0,A.vS)(this.config.env,"GATEWAY"),m=f.baseUrl,v=f.protocol,g="".concat(v).concat(m).concat(o||"/".concat(c,"/").concat(i)),y=["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||{}}g="".concat(g).concat(g.includes("?")?"&":"?").concat(Object.keys(b).map((function(e){return"".concat(e,"=").concat(b[e])})).join("&"))}catch(e){}return[4,this.fetch(P(P({method:u||"POST",headers:P({"Content-Type":"application/json; charset=utf-8","X-Request-Id":h},p)},y?{}:{body:d}),{url:g,customReqOpts:t}))];case 1:return x=I.sent(),w=[P({requestId:h},x)],_={},[4,x.data];case 2:return[2,P.apply(void 0,w.concat([(_.data=I.sent(),_)]))]}}))}))},e}(),W={};!function(e){e.ZH="zh-CN",e.EN="en-US"}(F||(F={}));var V=((M={})[F.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"},M),G=function(e,t){var n;return(null===(n=V[t])||void 0===n?void 0:n[e])||e},H=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))||F.ZH;return null===(o=null==a?void 0:a.setItem)||void 0===o||o.call(a,i,s),new Proxy({t:function(e){return G(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 G(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}})},z=function(){return z=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},z.apply(this,arguments)},K=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},J=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Y=r.j$.Fk,$=r.j$.xY,Q=r._G.Sg,X=r._G.vM,Z=r.P6.printWarn,ee=r.BM.D,te={timeout:15e3,persistence:"local"},ne=6e5,re={},oe=function(){function e(e){this.cloudbaseConfig=e||this.cloudbaseConfig,this.authInstance=null,this.oauthInstance=null,this.version=(0,A.mI)()}return Object.defineProperty(e.prototype,"config",{get:function(){return this.cloudbaseConfig},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"platform",{get:function(){return w},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cache",{get:function(){return e=this.cloudbaseConfig.env,E[e];var e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localCache",{get:function(){return T(this.cloudbaseConfig.env)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){return e=this.cloudbaseConfig.env,W[e];var e},enumerable:!1,configurable:!0}),e.prototype.init=function(t){var n,r,o;if(void 0===t&&(t={env:""}),t.endPointMode=t.endPointMode||"GATEWAY",w.adapter||this.useDefaultAdapter(),!(t=this.dealNodeAdapterConfig(t)).env)throw new Error(JSON.stringify({code:Q.INVALID_PARAMS,msg:"env must not be specified"}));this.isInitialized(t);var i={timeout:t.timeout||15e3,timeoutMsg:"[".concat((0,A.eX)(),"][REQUEST TIMEOUT] request had been abort since didn't finished within").concat(t.timeout/1e3,"s"),auth:t.auth};this.requestClient=new w.adapter.reqClass(i),this.cloudbaseConfig=z(z(z({},te),t),{i18n:H(w,t)}),delete this.cloudbaseConfig.lang,this.cloudbaseConfig.timeout=this.formatTimeout(this.cloudbaseConfig.timeout);var a=this.cloudbaseConfig,s=a.env,c=a.persistence,u=a.debug,l=a.timeout,p=a.oauthClient,d=a.i18n;O({env:s,persistence:c,debug:u,platformInfo:this.platform}),(0,A.R1)(s,t.region||""),(0,A.$R)(s,A.Bh,t.intl);var h=new e(this.cloudbaseConfig);return function(e){W[e.env]=new B(P(P({},e),{throw:!0}))}({env:s,region:t.region||"",timeout:l,oauthClient:p,_fromApp:h,i18n:d,endPointMode:t.endPointMode,auth:t.auth}),h.requestClient=this.requestClient,null===(n=null==this?void 0:this.fire)||void 0===n||n.call(this,"cloudbase_init",h),this.try2InitAuth(h),(null===(r=w.adapter)||void 0===r?void 0:r.nodeTool)&&(null===(o=w.adapter)||void 0===o||o.nodeTool(h,this.cloudbaseConfig)),h},e.prototype.updateConfig=function(e){var t=e.persistence,n=e.debug;this.cloudbaseConfig.persistence=t,this.cloudbaseConfig.debug=n,O({env:this.cloudbaseConfig.env,persistence:t,debug:n,platformInfo:this.platform})},e.prototype.updateLang=function(e){var t;e&&e!==(null===(t=this.cloudbaseConfig.i18n)||void 0===t?void 0:t.lang)&&(this.cloudbaseConfig.i18n.lang=e)},e.prototype.registerExtension=function(e){re[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=re[e]))throw new Error(JSON.stringify({code:Q.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=Y(e,t)||{},r=n.adapter,o=n.runtime;r&&(w.adapter=r),o&&(w.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){d(e,t)},e.prototype.registerVersion=function(e){(0,A.po)(e),this.version=e},e.prototype.registerSdkName=function(e){(0,A.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()}))&&Z(Q.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,A.Fy)({baseUrl:e,protocol:t,env:this.config.env,endPointKey:"CLOUD_API"})},e.prototype.registerEndPointWithKey=function(e){(0,A.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,A.Fy)({baseUrl:"".concat(r,"/web"),protocol:t,env:this.config.env,endPointKey:"CLOUD_API"}),(0,A.Fy)({baseUrl:"".concat(r,"/v1"),protocol:t,env:this.config.env,endPointKey:"GATEWAY"})},e.prototype.getEndPointWithKey=function(e){var t=(0,A.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=$.bind(this)(),t=e.adapter,n=e.runtime;w.adapter=t,w.runtime=n},e.prototype.formatTimeout=function(e){switch(!0){case e>ne:return Z(Q.INVALID_PARAMS,"timeout is greater than maximum value[10min]"),ne;case e<100:return Z(Q.INVALID_PARAMS,"timeout is less than maximum value[100ms]"),100;default:return e}},e.prototype.try2InitAuth=function(e){try{e.auth()}catch(e){console.log("try2InitAuth error:",e)}},e.prototype.dealNodeAdapterConfig=function(e){var t,n;if("undefined"!=typeof process&&void 0!==process.env&&(null===(t=w.adapter)||void 0===t?void 0:t.getSecretInfo)){var r=null===(n=w.adapter)||void 0===n?void 0:n.getSecretInfo(e);e.auth=z(z({},e.auth),{secretId:r.secretId,secretKey:r.secretKey,sessionToken:r.sessionToken,secretType:r.secretType}),e.env&&"symbol"!=typeof e.env||(e.env=r.env),!e.accessKey&&r.accessKey&&(e.accessKey=r.accessKey)}return e},K([ee({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(X)]}),J("design:type",Function),J("design:paramtypes",[Object]),J("design:returntype",e)],e.prototype,"init",null),K([ee({title:"调用扩展能力失败",messages:["请确认以下各项:"," 1 - 调用 invokeExtension() 的语法或参数是否正确"," 2 - 被调用的扩展能力是否已经安装并通过 registerExtension() 注册","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(X)]}),J("design:type",Function),J("design:paramtypes",[String,Object]),J("design:returntype",Promise)],e.prototype,"invokeExtension",null),e}(),ie=new oe,ae=void 0===v.WxRequest?null:(v.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:x({"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){}}}})}))},v.default.genAdapter=function(e){return{root:{globalThis:{}},reqClass:v.WxRequest,wsClass:v.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,v.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",x(x({},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:v.wxMpStorage,primaryStorage:b.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:""}}},v.default);ae&&ie.useAdapters(ae);const se=ie;var ce,ue,le,pe,de,he,fe="/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"}(ce||(ce={})),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"}(ue||(ue={})),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"}(le||(le={})),(he=pe||(pe={})).UNREACHABLE="unreachable",he.LOCAL="local",he.CANCELLED="cancelled",he.UNKNOWN="unknown",he.UNAUTHENTICATED="unauthenticated",he.RESOURCE_EXHAUSTED="resource_exhausted",he.FAILED_PRECONDITION="failed_precondition",he.INVALID_ARGUMENT="invalid_argument",he.DEADLINE_EXCEEDED="deadline_exceeded",he.NOT_FOUND="not_found",he.ALREADY_EXISTS="already_exists",he.PERMISSION_DENIED="permission_denied",he.ABORTED="aborted",he.OUT_OF_RANGE="out_of_range",he.UNIMPLEMENTED="unimplemented",he.INTERNAL="internal",he.UNAVAILABLE="unavailable",he.DATA_LOSS="data_loss",he.INVALID_PASSWORD="invalid_password",he.PASSWORD_NOT_SET="password_not_set",he.INVALID_STATUS="invalid_status",he.USER_PENDING="user_pending",he.USER_BLOCKED="user_blocked",he.INVALID_VERIFICATION_CODE="invalid_verification_code",he.TWO_FACTOR_REQUIRED="two_factor_required",he.INVALID_TWO_FACTOR="invalid_two_factor",he.INVALID_TWO_FACTOR_RECOVERY="invalid_two_factor_recovery",he.UNDER_REVIEW="under_review",he.INVALID_REQUEST="invalid_request",he.UNAUTHORIZED_CLIENT="unauthorized_client",he.ACCESS_DENIED="access_denied",he.UNSUPPORTED_RESPONSE_TYPE="unsupported_response_type",he.INVALID_SCOPE="invalid_scope",he.INVALID_GRANT="invalid_grant",he.SERVER_ERROR="server_error",he.TEMPORARILY_UNAVAILABLE="temporarily_unavailable",he.INTERACTION_REQUIRED="interaction_required",he.LOGIN_REQUIRED="login_required",he.ACCOUNT_SELECTION_REQUIRED="account_selection_required",he.CONSENT_REQUIRED="consent_required",he.INVALID_REQUEST_URI="invalid_request_uri",he.INVALID_REQUEST_OBJECT="invalid_request_object",he.REQUEST_NOT_SUPPORTED="request_not_supported",he.REQUEST_URI_NOT_SUPPORTED="request_uri_not_supported",he.REGISTRATION_NOT_SUPPORTED="registration_not_supported",he.CAPTCHA_REQUIRED="captcha_required",he.CAPTCHA_INVALID="captcha_invalid",he.PROVIDER_NOT_ENABLED="provider_not_enabled",he.LOGIN_METHOD_DISABLED="login_method_disabled",he.INVALID_USERNAME_OR_PASSWORD="invalid_username_or_password",he.INVALID_CREDENTIALS="invalid_credentials",he.WRONG_PASSWORD="wrong_password",he.USER_NOT_FOUND="user_not_found",he.MFA_PHONE_REQUIRED="mfa_phone_required",he.LOGIN_TYPE_DISABLED="login_type_disabled",he.PROVIDER_ERROR="provider_error",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.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"}(de||(de={}));var me,ve="credentials_error",ge="SIGNED_OUT",ye="SIGNED_IN",be="TOKEN_REFRESHED",xe="USER_UPDATED",we="BIND_IDENTITY",_e="loginStateChanged",Ie="authStateChanged",Ee="sign_in",Se="bind_identity",Oe="node-sdk-scope";function Te(){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.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"}(me||(me={}));var Ae=f(2631),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())}))},Re=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])}}},Ce=new Map,Ne=function(){function e(e){this.clientId=(null==e?void 0:e.clientId)||"",Ce=Ce||new Map}return e.prototype.run=function(e,t){return Pe(this,void 0,Promise,(function(){var n,r=this;return Re(this,(function(o){return e="".concat(this.clientId,"_").concat(e),(n=Ce.get(e))||(n=new Promise((function(n,o){Pe(r,void 0,void 0,(function(){var r,i,a;return Re(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,4,5]),[4,this.runIdlePromise()];case 1:return s.sent(),r=t(),i=n,[4,r];case 2:return i.apply(void 0,[s.sent()]),[3,5];case 3:return a=s.sent(),o(a),[3,5];case 4:return Ce.delete(e),[7];case 5:return[2]}}))}))})),Ce.set(e,n)),[2,n]}))}))},e.prototype.runIdlePromise=function(){return Promise.resolve()},e}(),ke="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Ue=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/,je=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!Ue.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=ke.indexOf(e.charAt(i++))<<18|ke.indexOf(e.charAt(i++))<<12|(n=ke.indexOf(e.charAt(i++)))<<6|(r=ke.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 Le(){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 De=!1;function qe(){De=De||void 0!==typeof window&&"miniprogram"===window.__wxjs_environment}try{Le()||(De=De||!!navigator.userAgent.match(/miniprogram/i)||"miniprogram"===window.__wxjs_environment,window&&window.WeixinJSBridge&&window.WeixinJSBridge.invoke?qe():"undefined"!=typeof document&&document.addEventListener("WeixinJSBridgeReady",qe,!1))}catch(e){}var Me=function(){return Me=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},Me.apply(this,arguments)},Fe=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=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))},Ve="x-request-id",Ge="x-device-id",He="device_id",ze=function(e,t){return Fe(this,void 0,Promise,(function(){var n,r,o,i,a;return Be(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:pe.UNREACHABLE,error_description:a.message,error_uri:new URL(e).pathname},[3,5];case 5:if(r)throw r;return[2,n]}}))}))},Ke=function(){function e(e){this._env=(null==e?void 0:e.env)||""}return e.prototype.getItem=function(e){return Fe(this,void 0,Promise,(function(){return Be(this,(function(t){return[2,window.localStorage.getItem("".concat(e).concat(this._env))]}))}))},e.prototype.removeItem=function(e){return Fe(this,void 0,Promise,(function(){return Be(this,(function(t){return window.localStorage.removeItem("".concat(e).concat(this._env)),[2]}))}))},e.prototype.setItem=function(e,t){return Fe(this,void 0,Promise,(function(){return Be(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}(),Je=new Ke;function Ye(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}var $e=function(){function e(e){this.credentials=null,this.accessKeyCredentials=null,this.singlePromise=null,this.tokenSectionName=e.tokenSectionName,this.storage=e.storage,this.clientId=e.clientId,this.singlePromise=new Ne({clientId:this.clientId}),this.credentials=e.credentials||null}return e.prototype.getStorageCredentialsSync=function(){var e=null,t=this.storage.getItemSync(this.tokenSectionName);if(null!=t)try{(null==(e=JSON.parse(t))?void 0:e.expires_at)&&(e.expires_at=new Date(e.expires_at))}catch(t){this.storage.removeItem(this.tokenSectionName),e=null}return e},e.prototype.setCredentials=function(e){return Fe(this,void 0,Promise,(function(){var t;return Be(this,(function(n){switch(n.label){case 0:return(null==e?void 0:e.expires_in)?((null==e?void 0:e.expires_at)||(e.expires_at=new Date(Date.now()+1e3*(e.expires_in-30))),this.storage?(t=JSON.stringify(e),[4,this.storage.setItem(this.tokenSectionName,t)]):[3,2]):[3,3];case 1:n.sent(),n.label=2;case 2:return this.credentials=e,[3,6];case 3:return this.storage?[4,this.storage.removeItem(this.tokenSectionName)]:[3,5];case 4:n.sent(),n.label=5;case 5:this.credentials=null,n.label=6;case 6:return[2]}}))}))},e.prototype.setAccessKeyCredentials=function(e){this.accessKeyCredentials=e,e.scope===Oe&&(this.credentials=e)},e.prototype.getCredentials=function(){return Fe(this,void 0,Promise,(function(){var e=this;return Be(this,(function(t){return[2,this.singlePromise.run("getCredentials",(function(){return Fe(e,void 0,void 0,(function(){var e,t;return Be(this,(function(n){switch(n.label){case 0:return Ye(this.credentials)?[4,this.getStorageCredentials()]:[3,2];case 1:if(e=n.sent(),t=e.credentials,e.isAccessKeyCredentials)return[2,t];this.credentials=t,n.label=2;case 2:return[2,this.credentials]}}))}))}))]}))}))},e.prototype.getStorageCredentials=function(){return Fe(this,void 0,Promise,(function(){var e=this;return Be(this,(function(t){return[2,this.singlePromise.run("_getStorageCredentials",(function(){return Fe(e,void 0,void 0,(function(){var e,t,n;return Be(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}(),Qe=function(){function e(t){var n,o=this;this.initializePromise=null,this.lockAcquired=!1,this.pendingInLock=[],this.singlePromise=null,t.clientSecret||(t.clientSecret=""),!t.clientId&&t.env&&(t.clientId=t.env),this.apiOrigin=t.apiOrigin,this.getApiOriginFunc=t.getApiOrigin,this.apiPath=t.apiPath||fe,this.clientId=t.clientId,this.i18n=t.i18n,this.eventBus=t.eventBus,this.singlePromise=new Ne({clientId:this.clientId}),this.retry=this.formatRetry(t.retry,e.defaultRetry),t.baseRequest?this.baseRequest=t.baseRequest:this.baseRequest=ze,this.tokenInURL=t.tokenInURL,this.headers=t.headers,this.storage=t.storage||Je,this.localCredentials=new $e({tokenSectionName:"credentials_".concat(t.clientId),storage:this.storage,clientId:t.clientId}),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+=ke.charAt((t=n<<16|r<<8|o)>>18&63)+ke.charAt(t>>12&63)+ke.charAt(t>>6&63)+ke.charAt(63&t)}return s?i.slice(0,s-3)+"===".substring(s):i}("".concat(t.clientId,":").concat(this.clientSecret)))),this.wxCloud=t.wxCloud;try{Le()&&(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}))}return e.prototype.setGetInitialSession=function(e){this.getInitialSession=e},e.prototype.setOnInitialSessionObtained=function(e){this.onInitialSessionObtained=e},e.prototype.initialize=function(e){return Fe(this,void 0,Promise,(function(){var t=this;return Be(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=Fe(t,void 0,void 0,(function(){var e=this;return Be(this,(function(t){switch(t.label){case 0:return[4,this._acquireLock(-1,(function(){return Fe(e,void 0,void 0,(function(){return Be(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 Fe(this,void 0,Promise,(function(){var t=this;return Be(this,(function(n){switch(n.label){case 0:return[4,this.initializePromise];case 1:return n.sent(),[2,this._acquireLock(-1,(function(){return Fe(t,void 0,void 0,(function(){return Be(this,(function(t){return[2,this.localCredentials.setCredentials(e)]}))}))}))]}}))}))},e.prototype.setAccessKeyCredentials=function(e){return this.localCredentials.setAccessKeyCredentials(e)},e.prototype.getAccessToken=function(){return Fe(this,void 0,Promise,(function(){var e,t;return Be(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)===Oe||(null==e?void 0:e.access_token)?[2,Promise.resolve(e.access_token)]:(t={error:pe.UNAUTHENTICATED},[2,Promise.reject(t)])}}))}))},e.prototype.request=function(t,n){var r,o;return Fe(this,void 0,Promise,(function(){var i,a,s,c,u,l,p,d,h,f;return Be(this,(function(m){switch(m.label){case 0:return n||(n={}),i=this.formatRetry(n.retry,this.retry),n.headers=Me(Me({},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=Me(Me({},this.headers),n.headers)),n.headers[Ve]||(n.headers[Ve]=Te()),n.headers[Ge]?[3,2]:[4,this.getDeviceId()];case 1:a=m.sent(),n.headers[Ge]=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[Ve]||""}catch(e){}return n.withCredentials&&h&&h.error===pe.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 Fe(this,void 0,Promise,(function(){var r,o,i,a,s;return Be(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:Me({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,Ae.y)(e):r=null==a?void 0:a.body,[3,8];case 7:return s=c.sent(),o={error:pe.UNREACHABLE,error_description:s.message,error_uri:(0,Ae.y)(e)},[3,8];case 8:if(o)throw o;return[2,r]}}))}))},e.prototype.getCredentials=function(){return Fe(this,void 0,Promise,(function(){var e=this;return Be(this,(function(t){switch(t.label){case 0:return[4,this.initializePromise];case 1:return t.sent(),[2,this._acquireLock(-1,(function(){return Fe(e,void 0,void 0,(function(){return Be(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 Fe(this,void 0,Promise,(function(){var t,n;return Be(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 Fe(this,void 0,Promise,(function(){var t,n;return Be(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 Fe(this,void 0,Promise,(function(){var n=this;return Be(this,(function(r){switch(r.label){case 0:return[4,this.initializePromise];case 1:return r.sent(),[2,this._acquireLock(-1,(function(){return Fe(n,void 0,void 0,(function(){return Be(this,(function(n){return[2,this._refreshToken(e,t)]}))}))}))]}}))}))},e.prototype._refreshToken=function(e,t){return Fe(this,void 0,Promise,(function(){var n=this;return Be(this,(function(r){return[2,this.singlePromise.run("_refreshToken",(function(){return Fe(n,void 0,void 0,(function(){var n,r,o,i,a,s,c;return Be(this,(function(u){switch(u.label){case 0:if((null==e?void 0:e.scope)===Oe)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)];u.label=1;case 1:return u.trys.push([1,4,,7]),[4,this.refreshTokenFunc(e.refresh_token,e)];case 2:return n=u.sent(),[4,this.localCredentials.setCredentials(n)];case 3:return u.sent(),null===(a=this.eventBus)||void 0===a||a.fire(Ie,{event:be}),[2,n];case 4:if(r=u.sent(),null==t?void 0:t.throwError)throw r;return r.error!==pe.INVALID_GRANT?[3,6]:[4,this.localCredentials.setCredentials(null)];case 5:return u.sent(),o=r.error_description,null===(s=this.onCredentialsError)||void 0===s||s.call(this,{msg:o}),[2,this.unAuthenticatedError(o)];case 6:return null===(c=this.onCredentialsError)||void 0===c||c.call(this,{msg:r.error_description}),[2,Promise.reject(r)];case 7:return[2]}}))}))}))]}))}))},e.prototype.anonymousLogin=function(e){return Fe(this,void 0,void 0,(function(){var t=this;return Be(this,(function(n){return[2,this.singlePromise.run("_anonymousLogin",(function(){return Fe(t,void 0,void 0,(function(){var t,n;return Be(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:pe.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 Fe(this,void 0,Promise,(function(){return Be(this,(function(t){return[2,new Promise((function(t){setTimeout((function(){t()}),e)}))]}))}))},e.prototype.anonymousSignIn=function(e){return Fe(this,void 0,Promise,(function(){var t=this;return Be(this,(function(n){return[2,this.singlePromise.run("_anonymous",(function(){return Fe(t,void 0,void 0,(function(){var t,n;return Be(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(ce.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!==pe.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 Fe(this,void 0,Promise,(function(){var r,o,i;return Be(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=ce.AUTH_TOKEN_URL,"v2"===(null==t?void 0:t.version)&&(o=ue.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,Me(Me({},i),{version:(null==t?void 0:t.version)||"v1"})]}}))}))},e.prototype.getDeviceId=function(){return Fe(this,void 0,Promise,(function(){var e;return Be(this,(function(t){switch(t.label){case 0:return this.deviceID?[2,this.deviceID]:[4,this.storage.getItem(He)];case 1:return"string"==typeof(e=t.sent())&&e.length>=16&&e.length<=48?[3,3]:(e=Te(),[4,this.storage.setItem(He,e)]);case 2:t.sent(),t.label=3;case 3:return this.deviceID=e,[2,e]}}))}))},e.prototype.unAuthenticatedError=function(e){var t={error:pe.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,We(["[OAuth2Client]"],e,!1))},e.prototype._initialize=function(){return Fe(this,void 0,Promise,(function(){var e,t,n,r,o,i;return Be(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),[4,this.localCredentials.setCredentials(null==e?void 0:e.session)]):[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 Fe(this,void 0,Promise,(function(){var n,r,o,i,a=this;return Be(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=Fe(a,void 0,void 0,(function(){return Be(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(Fe(a,void 0,void 0,(function(){return Be(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(Fe(a,void 0,void 0,(function(){return Be(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=We([],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 Fe(this,void 0,Promise,(function(){var r,o,i;return Be(this,(function(a){switch(a.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:if((null==(r=a.sent())?void 0:r.scope)===Oe)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(!Ye(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.defaultRetry=2,e.minRetry=0,e.maxRetry=5,e.retryInterval=1e3,e}(),Xe=f(9689),Ze=f(3616),et=function(){return et=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},et.apply(this,arguments)},tt=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())}))},nt=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(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)}},ot=new Xe.CloudbaseEventEmitter,it="resolveCaptchaData",at="padding:10px 8px;background:#007bff;color:#fff;border:none;border-radius:4px;cursor:pointer;flex:1;white-space:nowrap;margin-left:10px",st="width:100%;padding:10px;background:#007bff;color:#fff;border:none;border-radius:4px;cursor:pointer",ct="background:#6c757d;cursor:not-allowed",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())}))},lt=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])}}},pt=function(){function e(e){e.openURIWithCallback||(e.openURIWithCallback=this.getDefaultOpenURIWithCallback()),e.storage||(e.storage=Je),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))||Le()},e.prototype.request=function(e,t){return ut(this,void 0,Promise,(function(){var n,r,o,i;return lt(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!==pe.CAPTCHA_REQUIRED&&i.error!==pe.CAPTCHA_INVALID?[3,6]:[4,this.appendCaptchaTokenToURL(e,n,i.error===pe.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 tt(void 0,void 0,Promise,(function(){var n,r,o,i;return nt(this,(function(a){return n=(0,Ze.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 tt(void 0,void 0,void 0,(function(){var e,o;return nt(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=et(et({},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",at,"刷新");l.onclick=rt((function(){return tt(void 0,void 0,void 0,(function(){return nt(this,(function(e){switch(e.label){case 0:l.textContent="加载中...",l.disabled=!0,l.style.cssText="".concat(at,";").concat(ct),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=at,[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",st,"确定");f.onclick=rt((function(){return tt(void 0,void 0,void 0,(function(){var e,r,i,c;return nt(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(st,";").concat(ct),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(),ot.fire(it,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=st,[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("等待图形验证码校验结果..."),ot.on(it,(function(t){e(null==t?void 0:t.data)}))}))]}))}))}(t,e.config.oauthInstance)}},e.prototype.getCaptchaToken=function(e,t){return ut(this,void 0,Promise,(function(){var n,r,o,i;return lt(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(ce.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 ut(this,void 0,Promise,(function(){var r;return lt(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 ut(this,void 0,void 0,(function(){var t;return lt(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 ut(this,void 0,Promise,(function(){var e,t;return lt(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}(),dt=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 ht=dt;var ft,mt,vt=(ft=function(e,t){return ft=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])},ft(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}ft(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"}(mt||(mt={}));var gt="https://tcb.cloud.tencent.com/dev?envId=#/identity/login-manage",yt="https://docs.cloudbase.net/api-reference/webv3-next/initialization",bt=function(e){function t(t,n){var r,o=this,i=t.error_description||t.message;return(o=e.call(this,i)||this).__isAuthError=!0,o.name="AuthError",o.status=t.error,o.code=String(t.error||t.error_code||"unknown").toLowerCase(),o.errorCode="number"==typeof t.error_code?t.error_code:"string"==typeof t.error_code&&parseInt(t.error_code,10)||void 0,o.requestId=t.requestId,o.category=function(e,t,n){if(!e&&!t&&!n)return mt.UNKNOWN;try{var r=(e||"").toLowerCase(),o="string"==typeof n?parseInt(n,10):n;return o===de.CAPTCHA_REQUIRED||t===pe.CAPTCHA_REQUIRED?mt.CAPTCHA_REQUIRED:o===de.CAPTCHA_INVALID||t===pe.CAPTCHA_INVALID?mt.CAPTCHA_INVALID:o===de.MFA_PHONE_REQUIRED||t===pe.MFA_PHONE_REQUIRED?mt.MFA_REQUIRED:o===de.LOGIN_TYPE_DISABLED||t===pe.LOGIN_TYPE_DISABLED?mt.PROVIDER_NOT_ENABLED:o===de.RESOURCE_EXHAUSTED||t===pe.RESOURCE_EXHAUSTED?mt.RATE_LIMITED:o===de.INTERNAL||o===de.UNAVAILABLE||o===de.UNIMPLEMENTED||o===de.ABORTED?mt.SERVICE_ERROR:o===de.NOT_FOUND?mt.USER_NOT_FOUND:o===de.UNAUTHENTICATED?mt.INVALID_CREDENTIALS:o===de.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("过期"))?mt.VERIFICATION_FAILED:t===pe.PROVIDER_NOT_ENABLED||t===pe.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("匿名登录未开启")?mt.PROVIDER_NOT_ENABLED:t===pe.FAILED_PRECONDITION||o===de.FAILED_PRECONDITION&&!r.includes("请联系开发者")?r.includes("不存在")||r.includes("not found")||r.includes("未注册")?mt.USER_NOT_FOUND:mt.PRECONDITION_FAILED:t===pe.INVALID_PASSWORD||t===pe.INVALID_GRANT||t===pe.INVALID_VERIFICATION_CODE||t===pe.INVALID_USERNAME_OR_PASSWORD||t===pe.INVALID_CREDENTIALS||t===pe.WRONG_PASSWORD||t===pe.UNAUTHENTICATED||t===pe.INVALID_TWO_FACTOR||t===pe.INVALID_TWO_FACTOR_RECOVERY||t===pe.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")?mt.INVALID_CREDENTIALS:t===pe.NOT_FOUND||t===pe.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")?mt.USER_NOT_FOUND:t===pe.USER_BLOCKED||t===pe.USER_PENDING||t===pe.UNDER_REVIEW||t===pe.INVALID_STATUS||r.includes("被封禁")||r.includes("blocked")||r.includes("pending")||r.includes("审核")||r.includes("review")||r.includes("locked")||r.includes("已锁定")?mt.USER_STATUS_ABNORMAL:t===pe.SERVER_ERROR||t===pe.UNAVAILABLE||t===pe.TEMPORARILY_UNAVAILABLE||t===pe.INTERNAL||t===pe.UNREACHABLE||t===pe.DEADLINE_EXCEEDED||t===pe.DATA_LOSS||t===pe.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")?mt.SERVICE_ERROR:t===pe.INVALID_ARGUMENT||t===pe.INVALID_REQUEST||t===pe.INVALID_SCOPE||t===pe.INVALID_REQUEST_URI||t===pe.INVALID_REQUEST_OBJECT||o===de.INVALID_ARGUMENT?mt.INVALID_PARAMS:t===pe.PERMISSION_DENIED||t===pe.ACCESS_DENIED||t===pe.UNAUTHORIZED_CLIENT?mt.PROVIDER_NOT_ENABLED:mt.UNKNOWN}catch(e){return t}}(i,o.status,o.errorCode),o.helpMessage=function(e,t){var n=(null==t?void 0:t.method)||"signIn",r={signInWithPassword:"「用户名密码登录」",signInAnonymously:"「匿名登录」",signInWithOtp:"「短信验证码登录」或「邮箱验证码登录」",signUp:"「短信验证码登录」或「邮箱验证码登录」",signInWithOAuth:"对应的第三方身份源",signInWithIdToken:"对应的第三方身份源",signInWithOpenId:"「微信小程序 OpenID 登录」",signInWithPhoneAuth:"「微信小程序手机号授权登录」",signInWithCustomTicket:"「自定义登录」",getVerification:"「短信验证码登录」或「邮箱验证码登录」",verify:"「短信验证码登录」或「邮箱验证码登录」",verifyOtp:"「短信验证码登录」或「邮箱验证码登录」",resetPasswordForEmail:"「邮箱验证码登录」",reauthenticate:"「短信验证码登录」或「邮箱验证码登录」"}[n]||"对应的登录方式";switch(e){case mt.PROVIDER_NOT_ENABLED:return"[CloudBase Auth] 登录方式未开启\n\n"+" 当前调用的 ".concat(n,"() 所需的登录方式尚未在云开发控制台启用。\n")+" 需要开启的登录方式:".concat(r,"\n")+"\n 请按以下步骤开启:\n"+" 1. 打开云开发控制台:".concat(gt,"\n")+" 2. 选择对应的云开发环境\n 3. 进入「登录授权」页面,在「登录方式」或「身份源列表」中开启所需的登录方式\n\n 各登录方法与所需登录方式的对应关系:\n - signInWithPassword → 「用户名密码登录」\n - signInAnonymously → 「匿名登录」\n - signInWithOtp/signUp → 「短信验证码登录」或「邮箱验证码登录」\n - signInWithOAuth/signInWithIdToken → 对应的第三方身份源\n\n 如使用 CLI/MCP 工具,可通过 auth 工具查询和配置身份源状态。\n"+" 更多帮助请参考文档:".concat(yt);case mt.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 mt.USER_NOT_FOUND:return"[CloudBase Auth] 用户不存在\n\n 请检查以下项目:\n 1. 确认用户名/邮箱/手机号是否正确\n 2. 确认是在正确的云开发环境(envId)下操作\n 3. 如果是新用户,请先通过 auth.signUp() 注册\n"+" 4. 也可在云开发控制台手动创建用户:".concat(gt,"\n")+"\n 提示:不同环境(开发/测试/生产)的用户库是隔离的,请确认 envId 正确。";case mt.USER_STATUS_ABNORMAL:return"[CloudBase Auth] 用户状态异常\n\n 当前用户账号可能处于以下状态之一:\n - 账号已被封禁\n - 账号正在审核中\n - 账号已被锁定(多次密码错误)\n\n"+" 请联系管理员在云开发控制台检查用户状态:".concat(gt);case mt.SERVICE_ERROR:return"[CloudBase Auth] 服务异常\n\n 请检查以下项目:\n 1. 网络连接是否正常\n 2. 云开发环境是否正常运行\n 3. 稍后重试,如持续失败请联系技术支持\n\n 提示:如果是超时错误,请检查网络环境和请求频率。\n 常见服务端错误:smtp 未配置、短信服务未配置、wedaapis 未设置等。";case mt.INVALID_PARAMS:return"[CloudBase Auth] 参数错误\n\n 请检查传入的参数是否符合要求:\n - 不能同时输入手机号和邮箱\n - 手机号格式需正确(如 +86 开头)\n - 必须提供手机号或邮箱\n\n"+" 参考 API 文档确认各参数的格式和约束:".concat(yt);case mt.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(gt);case mt.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 mt.CAPTCHA_REQUIRED:return"[CloudBase Auth] 需要滑块验证码\n\n 当前操作触发了风控策略,需要完成滑块验证。\n\n 处理方式:\n 1. 调用滑块验证码 SDK 展示验证组件\n 2. 用户完成验证后,将 captcha_token 附带到请求中重新发送\n 3. 可通过 getVerification 的 options.withCaptcha 参数自动携带验证码";case mt.CAPTCHA_INVALID:return"[CloudBase Auth] 滑块验证码校验失败\n\n 提交的验证码 token 校验未通过(可能已过期或 client_id 不匹配)。\n\n 处理方式:\n 1. 刷新滑块验证码,让用户重新验证\n 2. 确认 captcha 组件初始化的 client_id 与认证配置一致";case mt.MFA_REQUIRED:return"[CloudBase Auth] 需要 MFA 验证\n\n 当前操作要求用户绑定手机号进行多因素认证 (MFA)。\n\n 处理方式:\n 1. 引导用户进入手机号绑定流程\n 2. 绑定完成后重新执行原操作\n 3. error 中可能包含 MFA 详情信息";case mt.PRECONDITION_FAILED:return"[CloudBase Auth] 前置条件不满足\n\n 当前操作的前置条件不满足,常见原因:\n - 该手机号/邮箱已被其他账号绑定\n - 目标用户不存在或已存在(与 target 参数冲突)\n - 当前邮箱/手机号未注册用户\n\n 请根据 error.message 中的具体描述处理。";case mt.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(gt,"\n")+" 2. 到官方问答社区提问:https://cnb.cool/tencent/cloud/cloudbase/community/-/issues\n"+" 3. 查阅文档:".concat(yt)}}(o.category,n),o.loginMethodHint=(r=null==n?void 0:n.method)&&{signInWithPassword:"当前使用「用户名密码登录」,需确保:\n ✓ 控制台已开启「用户名密码登录」\n ✓ 用户已注册且凭据正确\n 如果不需要用户系统,建议改用 auth.signInAnonymously()",signInAnonymously:"当前使用「匿名登录」,需确保:\n ✓ 控制台已开启「匿名登录」\n 注意:匿名用户无需用户名密码,适用于快速体验或临时访问场景",signInWithOtp:"当前使用「OTP 验证码登录」,需确保:\n ✓ 控制台已开启「短信验证码登录」或「邮箱验证码登录」",signInWithOAuth:"当前使用「第三方 OAuth 登录」,需确保:\n ✓ 控制台已配置并开启对应的第三方身份源"}[r]||"",o.category===mt.RATE_LIMITED&&(o.retryAfter=t.retry_after||t.retryAfter||void 0),o}return vt(t,e),t}(Error),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)},wt=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())}))},_t=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 It(e,t){var n;return wt(this,void 0,void 0,(function(){var r,o=this;return _t(this,(function(i){r=function(){return wt(o,void 0,void 0,(function(){return _t(this,(function(e){switch(e.label){case 0:return e.trys.push([0,1,,6]),[2,f(3171)];case 1:e.sent(),e.label=2;case 2:return e.trys.push([2,4,,5]),[4,Promise.resolve().then(f.bind(f,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 Et,St=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 Qe(r)}if(!t){var o=n.request.bind(n),i=new pt(xt({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||Je,adapter:e.adapter}}return e.parseParamsToSearch=function(e){return Object.keys(e).forEach((function(t){e[t]||delete e[t]})),new ht(e).toString()},e.prototype.getParamsByVersion=function(e,t){var n,r=(0,Ae.I)(e),o=(null===(n={v2:ue}[null==r?void 0:r.version])||void 0===n?void 0:n[t])||ce[t];return r&&delete r.version,{params:r,url:o}},e.prototype.signIn=function(e){return wt(this,void 0,Promise,(function(){var t,n,r,o;return _t(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(xt(xt({},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),wt(this,void 0,Promise,(function(){var n;return _t(this,(function(r){switch(r.label){case 0:return[4,this.config.request(ce.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 wt(this,void 0,Promise,(function(){var t;return _t(this,(function(n){switch(n.label){case 0:return[4,this.config.request(ce.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 wt(this,void 0,Promise,(function(){var t,n,r,o;return _t(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(ce.AUTH_SIGNOUT_URL,{method:"POST",withCredentials:!0,body:e})];case 2:return t=i.sent(),[3,4];case 3:return(n=i.sent()).error!==pe.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(ce.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 wt(this,void 0,Promise,(function(){return _t(this,(function(e){switch(e.label){case 0:return[4,this.config.request(ce.AUTH_REVOKE_ALL_URL,{method:"DELETE",withCredentials:!0})];case 1:return e.sent(),[2]}}))}))},e.prototype.revokeDevice=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){switch(t.label){case 0:return[4,this.config.request(ce.AUTHORIZED_DEVICES_DELETE_URL+e.device_id,{method:"DELETE",withCredentials:!0})];case 1:return t.sent(),[2]}}))}))},e.prototype.getVerification=function(e,t){return wt(this,void 0,Promise,(function(){var n,r;return _t(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,Ae.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(ce.VERIFICATION_URL,{method:"POST",body:r,withCaptcha:(null==t?void 0:t.withCaptcha)||!1,withCredentials:n})]}}))}))},e.prototype.verify=function(e){return wt(this,void 0,Promise,(function(){var t,n;return _t(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(xt(xt({},n),{version:"v2"}))];case 2:r.sent(),r.label=3;case 3:return[2,n]}}))}))},e.prototype.genProviderRedirectUri=function(t){return wt(this,void 0,Promise,(function(){var n,r,o,i,a;return _t(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(ce.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),wt(this,void 0,Promise,(function(){return _t(this,(function(n){return[2,this.config.request(ce.PROVIDER_TOKEN_URL,{method:"POST",body:e,useWxCloud:t})]}))}))},e.prototype.patchProviderToken=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.PROVIDER_TOKEN_URL,{method:"PATCH",body:e})]}))}))},e.prototype.signInWithProvider=function(e,t){return void 0===t&&(t=!1),wt(this,void 0,Promise,(function(){var n,r;return _t(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(xt(xt({},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 wt(this,void 0,void 0,(function(){var r,o,i,a;return _t(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:Se,provider:e.provider},error:null},[3,6];case 5:return a=s.sent(),i={data:{type:Se},error:new bt(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,Ie,{event:we,info:i})),[2,i]}}))}))},e.prototype.getInitialSession=function(){return wt(this,void 0,Promise,(function(){var e,t,n,r,o,i,a,s,c,u,l,p,d,h,f;return _t(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 bt({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 bt({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!==Se?[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!==Ee?[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:xt(xt({},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 bt(f)}];case 13:return[2]}}))}))},e.prototype.signInCustom=function(e){return wt(this,void 0,Promise,(function(){var t;return _t(this,(function(n){switch(n.label){case 0:return[4,this.config.request(ce.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={}),wt(this,void 0,Promise,(function(){var t;return _t(this,(function(n){switch(n.label){case 0:return[4,this.config.request(ce.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 wt(this,void 0,Promise,(function(){return _t(this,(function(n){return[2,this.config.request(ce.PROVIDER_BIND_URL,{method:"POST",body:e,withCredentials:!0,getCredentials:t?function(){return t}:void 0})]}))}))},e.prototype.getUserProfile=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.getUserInfo(e)]}))}))},e.prototype.getUserInfo=function(e){var t,n,r;return void 0===e&&(e={}),wt(this,void 0,Promise,(function(){var o,i,a,s,c;return _t(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 ht(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 wt(this,void 0,Promise,(function(){return _t(this,(function(e){switch(e.label){case 0:return[4,this.config.request(ce.WEDA_USER_URL,{method:"GET",withCredentials:!0})];case 1:return[2,e.sent()]}}))}))},e.prototype.deleteMe=function(t){return wt(this,void 0,Promise,(function(){var n,r;return _t(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 wt(this,void 0,Promise,(function(){return _t(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 wt(this,void 0,Promise,(function(){return _t(this,(function(e){return[2,this.config.credentialsClient.getCredentialsAsync()]}))}))},e.prototype.transByProvider=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.USER_TRANS_BY_PROVIDER_URL,{method:"PATCH",body:e,withCredentials:!0})]}))}))},e.prototype.grantToken=function(e){return wt(this,void 0,Promise,(function(){var t;return _t(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 wt(this,void 0,Promise,(function(){return _t(this,(function(e){return[2,this.config.request(ce.PROVIDER_LIST,{method:"GET",withCredentials:!0})]}))}))},e.prototype.unbindProvider=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request("".concat(ce.PROVIDER_UNBIND_URL,"/").concat(e.provider_id),{method:"DELETE",withCredentials:!0})]}))}))},e.prototype.checkPassword=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request("".concat(ce.CHECK_PWD_URL),{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.editContact=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request("".concat(ce.BIND_CONTACT_URL),{method:"PATCH",withCredentials:!0,body:e})]}))}))},e.prototype.setPassword=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request("".concat(ce.AUTH_SET_PASSWORD),{method:"PATCH",withCredentials:!0,body:e})]}))}))},e.prototype.updatePasswordByOld=function(e){return wt(this,void 0,Promise,(function(){var t;return _t(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 wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request("".concat(ce.SUDO_URL),{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.sendVerificationCodeToCurrentUser=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return e.target="CUR_USER",[2,this.config.request(ce.VERIFICATION_URL,{method:"POST",body:e,withCredentials:!0,withCaptcha:!0})]}))}))},e.prototype.changeBoundProvider=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request("".concat(ce.PROVIDER_LIST,"/").concat(e.provider_id,"/trans"),{method:"POST",body:{provider_trans_token:e.trans_token},withCredentials:!0})]}))}))},e.prototype.setUserProfile=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.USER_PRIFILE_URL,{method:"PATCH",body:e,withCredentials:!0})]}))}))},e.prototype.updateUserBasicInfo=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.USER_BASIC_EDIT_URL,{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.queryUserProfile=function(e){return wt(this,void 0,Promise,(function(){var t;return _t(this,(function(n){return t=new ht(e),[2,this.config.request("".concat(ce.USER_QUERY_URL,"?").concat(t.toString()),{method:"GET",withCredentials:!0})]}))}))},e.prototype.setCustomSignFunc=function(e){this.getCustomSignTicketFn=e},e.prototype.signInWithCustomTicket=function(){return wt(this,void 0,Promise,(function(){var e,t;return _t(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 wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.AUTH_RESET_PASSWORD,{method:"POST",body:e})]}))}))},e.prototype.authorize=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.AUTHORIZE_URL,{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.authorizeDevice=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.AUTHORIZE_DEVICE_URL,{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.deviceAuthorize=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.AUTH_GET_DEVICE_CODE,{method:"POST",body:e})]}))}))},e.prototype.authorizeInfo=function(t){return wt(this,void 0,Promise,(function(){var n,r,o;return _t(this,(function(i){switch(i.label){case 0:return n="".concat(ce.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 wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.CHECK_USERNAME,{method:"GET",body:e,withCredentials:!0})]}))}))},e.prototype.checkIfUserExist=function(e){return wt(this,void 0,Promise,(function(){var t;return _t(this,(function(n){return t=new ht(e),[2,this.config.request("".concat(ce.CHECK_IF_USER_EXIST,"?").concat(t.toString()),{method:"GET"})]}))}))},e.prototype.loginScope=function(){return wt(this,void 0,Promise,(function(){return _t(this,(function(e){return[2,this.config.credentialsClient.getScope()]}))}))},e.prototype.loginGroups=function(){return wt(this,void 0,Promise,(function(){return _t(this,(function(e){return[2,this.config.credentialsClient.getGroups()]}))}))},e.prototype.refreshTokenForce=function(e){return wt(this,void 0,void 0,(function(){var t;return _t(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(xt(xt({},t),{version:(null==e?void 0:e.version)||"v1"}))];case 2:return[2,n.sent()]}}))}))},e.prototype.getCredentials=function(){return wt(this,void 0,void 0,(function(){return _t(this,(function(e){return[2,this.config.credentialsClient.getCredentials()]}))}))},e.prototype.getPublicKey=function(){return wt(this,void 0,Promise,(function(){return _t(this,(function(e){return[2,this.config.request(ue.AUTH_PUBLIC_KEY,{method:"POST",body:{}})]}))}))},e.prototype.getEncryptParams=function(e){return wt(this,void 0,Promise,(function(){var t,n,r,o,i,a;return _t(this,(function(s){switch(s.label){case 0:return t=e.isEncrypt,delete e.isEncrypt,n=(0,Ae.I)(e),[4,It(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 wt(this,void 0,Promise,(function(){return _t(this,(function(e){return[2,this.config.request(ce.GET_PROVIDER_TYPE,{method:"POST",body:{provider_id:"weda"}})]}))}))},e.prototype.verifyCaptchaData=function(e){var t=e.token,n=e.key;return wt(this,void 0,void 0,(function(){return _t(this,(function(e){return[2,this.config.request(ce.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 wt(this,void 0,void 0,(function(){return _t(this,(function(e){return[2,this.config.request(ce.CAPTCHA_DATA_URL,{method:"POST",body:{state:t,redirect_uri:r},withCredentials:!1})]}))}))},e.prototype.getMiniProgramCode=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.GET_MINIPROGRAM_QRCODE,{method:"POST",body:e})]}))}))},e.prototype.getMiniProgramQrCodeStatus=function(e){return wt(this,void 0,Promise,(function(){return _t(this,(function(t){return[2,this.config.request(ce.GET_MINIPROGRAM_QRCODE_STATUS,{method:"POST",body:e})]}))}))},e.prototype.getUserBehaviorLog=function(e){return wt(this,void 0,Promise,(function(){var t,n;return _t(this,(function(r){return t={LOGIN:"query[action]=USER_LOGIN",MODIFY:"ne_query[action]=USER_LOGIN"},n="".concat(ce.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 wt(this,void 0,Promise,(function(){var t,n,r,o,i,a;return _t(this,(function(s){switch(s.label){case 0:return t="",n="",[4,It(!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(ce.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 wt(this,void 0,Promise,(function(){var t,n,r,o,i,a;return _t(this,(function(s){switch(s.label){case 0:return t="",n="",[4,It(!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(ue.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}(),Ot=function(){return Ot=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ot.apply(this,arguments)},Tt=function(){function e(e){var t=e.apiOrigin,n=e.getApiOrigin,r=e.apiPath,o=void 0===r?fe: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,g=e.eventBus,y=e.detectSessionInUrl,b=e.debug;if(this.detectSessionInUrl=null!=y&&y,this.oauth2client=new Qe({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:g,debug:b}),this.authApi=new St(Ot(Ot({credentialsClient:this.oauth2client},e),{request:c?this.oauth2client.request.bind(this.oauth2client):void 0,adapter:d})),y)this.oauth2client.setGetInitialSession(this.authApi.getInitialSession.bind(this.authApi));else try{var x=new URL(window.location.href),w=x.searchParams.get("code"),_=x.searchParams.get("state"),I=JSON.parse(sessionStorage.getItem(_)||"null");w&&_&&(null==I?void 0:I.hash)&&(x.hash=I.hash,window.history.replaceState(null,"",x.toString()),window.location.replace(x.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}(),At=f(794),Pt=f(141),Rt=f(6197),Ct=f(8182),Nt=function(){return Nt=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},Nt.apply(this,arguments)},kt=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())}))},Ut=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(){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 kt(this,void 0,Promise,(function(){return Ut(this,(function(t){return[2,this.localStorage.getItem(e)]}))}))},e.prototype.removeItem=function(e){return kt(this,void 0,void 0,(function(){return Ut(this,(function(t){return this.localStorage.removeItem(e),[2]}))}))},e.prototype.setItem=function(e,t){return kt(this,void 0,Promise,(function(){return Ut(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}(),Lt=/^[^:]+:\/\/[^/]+(\/[^?#]+)/,Dt=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,Lt.test(i)?RegExp.$1:i),e):(null==e?void 0:e.data)||{}},qt=function(e){return e.adapter&&"default"!==e.adapter.type?function(e,t){var n=Nt({},e);try{if(!(null==e?void 0:e.storage)&&(null==t?void 0:t.localStorage)&&(n.storage=new jt({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 kt(this,void 0,void 0,(function(){var c,u,l,p;return Ut(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(Nt({url:e},t))];case 2:return c=d.sent(),c=Dt(c,Nt(Nt({},t),{url:e})),[3,4];case 3:throw p=d.sent(),c=Nt(Nt({},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=Nt({},e),r={};if((null==t?void 0:t.captchaOptions)&&(n.captchaOptions=t.captchaOptions),!v.default.isMatch()||e.storage&&e.baseRequest)return n;try{var o=v.default.genAdapter({}),i=o.localStorage,a=o.reqClass;if(i&&(r.storage=new jt({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 kt(this,void 0,void 0,(function(){return Ut(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=Dt(e,Nt(Nt({},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),Nt(Nt({},n),r)}catch(e){console.error("adapter generate fail:",e)}return n}(e,e.adapter)},Mt=function(){return Mt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Mt.apply(this,arguments)},Ft=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])}}},Wt=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 Ft(this,void 0,Promise,(function(){return Bt(this,(function(e){throw new Error("[v1 兼容] WeixinAuthProvider.getRedirectResult() 在当前版本中无法实现。 建议使用 auth.verifyOAuth({ code, state, provider }) 替代。")}))}))},e.prototype.getLinkRedirectResult=function(e){return Ft(this,void 0,Promise,(function(){return Bt(this,(function(e){throw new Error("[v1 兼容] WeixinAuthProvider.getLinkRedirectResult() 在当前版本中无法实现。 建议使用 auth.linkIdentity({ provider: 'providerId' }) 替代。")}))}))},e}(),Vt=function(){function e(e){this.authInstance=e.authInstance}return e.prototype.signIn=function(e){return Ft(this,void 0,Promise,(function(){return Bt(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}(),Gt=function(){function e(e){this.authInstance=e.authInstance}return e.prototype.signIn=function(){return Ft(this,void 0,Promise,(function(){return Bt(this,(function(e){switch(e.label){case 0:return[4,this.authInstance.signInAnonymously({})];case 1:return e.sent(),[2]}}))}))},e}(),Ht=function(){function e(){}return e.prototype.weixinAuthProvider=function(e){return new Wt({authInstance:this,appid:e.appid,scope:e.scope})},e.prototype.customAuthProvider=function(){return new Vt({authInstance:this})},e.prototype.anonymousAuthProvider=function(){return new Gt({authInstance:this})},e.prototype.signUpWithEmailAndPassword=function(e,t){return Ft(this,void 0,Promise,(function(){return Bt(this,(function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,Ze.throwError)(At.ERRORS.INVALID_PARAMS,"email must be a string"),"string"!=typeof t&&(0,Ze.throwError)(At.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 Ft(this,void 0,Promise,(function(){return Bt(this,(function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,Ze.throwError)(At.ERRORS.INVALID_PARAMS,"email must be a string"),"string"!=typeof t&&(0,Ze.throwError)(At.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 Ft(this,void 0,Promise,(function(){return Bt(this,(function(t){switch(t.label){case 0:return"string"!=typeof e&&(0,Ze.throwError)(At.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 Ft(this,void 0,Promise,(function(){return Bt(this,(function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,Ze.throwError)(At.ERRORS.INVALID_PARAMS,"username must be a string"),"string"!=typeof t&&(0,Ze.throwError)(At.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 Ft(this,void 0,Promise,(function(){var t;return Bt(this,(function(n){switch(n.label){case 0:return"string"!=typeof e&&(0,Ze.throwError)(At.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 Ft(this,void 0,Promise,(function(){var r;return Bt(this,(function(o){switch(o.label){case 0:return"string"!=typeof e&&(0,Ze.throwError)(At.ERRORS.INVALID_PARAMS,"phoneNumber must be a string"),"string"!=typeof t&&(0,Ze.throwError)(At.ERRORS.INVALID_PARAMS,"phoneCode must be a string"),r=this.formatPhone(e),[4,this.signUp(Mt({phone_number:r,verification_code:t},n?{password:n}:{}))];case 1:return o.sent(),[2,this.createLoginState()]}}))}))},e.prototype.signInWithPhoneCodeOrPassword=function(e){return Ft(this,void 0,Promise,(function(){var t,n,r,o;return Bt(this,(function(i){switch(i.label){case 0:return t=e.phoneNumber,n=e.phoneCode,r=e.password,"string"!=typeof t&&(0,Ze.throwError)(At.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,Ze.throwError)(At.ERRORS.INVALID_PARAMS,"phoneCode or password must be provided"),i.label=5;case 5:return[2,this.createLoginState()]}}))}))},e.prototype.forceResetPwdByPhoneCode=function(e){return Ft(this,void 0,Promise,(function(){var t,n,r,o;return Bt(this,(function(i){switch(i.label){case 0:return t=e.phoneNumber,n=e.phoneCode,r=e.password,"string"!=typeof t&&(0,Ze.throwError)(At.ERRORS.INVALID_PARAMS,"phoneNumber must be a string"),"string"!=typeof n&&(0,Ze.throwError)(At.ERRORS.INVALID_PARAMS,"phoneCode must be a string"),"string"!=typeof r&&(0,Ze.throwError)(At.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)===ve&&e.call(t)}))},e.prototype.onAccessTokenRefreshed=function(e){var t=this;this.onAuthStateChange((function(n){n===be&&e.call(t)}))},e.prototype.onAnonymousConverted=function(e){var t=this;this.onAuthStateChange((function(n){n===ye&&e.call(t)}))},e.prototype.onLoginTypeChanged=function(e){var t=this;this.onAuthStateChange((function(n){n!==ye&&n!==ge||e.call(t)}))},e}(),zt=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)}}(),Kt=function(){return Kt=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},Kt.apply(this,arguments)},Jt=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},Yt=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},$t=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())}))},Qt=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])}}},Xt=function(){return"undefined"!=typeof window&&"undefined"!=typeof document},Zt=function(e){return function(t){e.fire(_e,Kt(Kt({},t),{eventType:ve}))}},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 $t(this,void 0,void 0,(function(){return Qt(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 $t(this,void 0,void 0,(function(){var e,t,n,r;return Qt(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 $t(this,void 0,Promise,(function(){var t;return Qt(this,(function(n){switch(n.label){case 0:return[4,this.oauthInstance.authApi.setUserProfile(Kt({},e))];case 1:return t=n.sent(),this.setLocalUserInfo(t),[2]}}))}))},t.prototype.updateUserBasicInfo=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.updateUserBasicInfo(Kt({},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,Ze.throwError)(At.ERRORS.INVALID_PARAMS,"username must be a string"),this.update({username:e})},t.prototype.refresh=function(e){return $t(this,void 0,Promise,(function(){var t;return Qt(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 $t(this,void 0,Promise,(function(){var t;return Qt(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]}))},Jt([(0,Pt.catchErrorsDecorator)({title:"更新用户信息失败",messages:["请确认以下各项:"," 1 - 调用 User.update() 的语法或参数是否正确"," 2 - 用户信息中是否包含非法值","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",["function"==typeof(n=void 0!==e&&e.UserProfile)?n:Object]),Yt("design:returntype","function"==typeof(r="undefined"!=typeof Promise&&Promise)?r:Object)],t.prototype,"update",null),Jt([(0,Pt.catchErrorsDecorator)({title:"更新密码失败",messages:["请确认以下各项:"," 1 - 调用 User.updatePassword() 的语法或参数是否正确"," 3 - 新密码中是否包含非法字符","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[String,String]),Yt("design:returntype",void 0)],t.prototype,"updatePassword",null),Jt([(0,Pt.catchErrorsDecorator)({title:"更新用户名失败",messages:["请确认以下各项:"," 1 - 调用 User.updateUsername() 的语法或参数是否正确"," 2 - 当前环境是否开通了用户名密码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[String]),Yt("design:returntype",void 0)],t.prototype,"updateUsername",null),Jt([(0,Pt.catchErrorsDecorator)({title:"刷新本地用户信息失败",messages:["请确认以下各项:"," 1 - 调用 User.refresh() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[Object]),Yt("design:returntype","function"==typeof(o="undefined"!=typeof Promise&&Promise)?o:Object)],t.prototype,"refresh",null),t}();(Et=en).prototype.linkWithTicket=function(e){return Ft(this,void 0,Promise,(function(){return Bt(this,(function(e){throw new Error("[v1 兼容] User.linkWithTicket() 在当前版本中无法实现。 建议使用 auth.signInWithCustomTicket(() => Promise.resolve(ticket)) 替代。")}))}))},Et.prototype.linkWithRedirect=function(e){throw new Error("[v1 兼容] User.linkWithRedirect() 在当前版本中无法实现。 建议使用 auth.linkIdentity({ provider: 'providerId' }) 替代。")},Et.prototype.updateEmail=function(e,t){return Ft(this,void 0,Promise,(function(){return Bt(this,(function(t){switch(t.label){case 0:return"string"!=typeof e&&(0,Ze.throwError)(At.ERRORS.INVALID_PARAMS,"newEmail must be a string"),[4,this.updateUserBasicInfo({email:e})];case 1:return t.sent(),[2]}}))}))},Et.prototype.linkWithPhoneNumber=function(e,t){return Ft(this,void 0,Promise,(function(){return Bt(this,(function(e){throw new Error("[v1 兼容] User.linkWithPhoneNumber() 在当前版本中无法实现。 建议使用 auth.bindPhoneNumber({ phone_number, verification_token, sudo_token }) 替代。")}))}))},Et.prototype.updatePhoneNumber=function(e,t){return Ft(this,void 0,Promise,(function(){return Bt(this,(function(e){throw new Error("[v1 兼容] User.updatePhoneNumber() 在当前版本中无法实现。 建议使用 auth.updateUser({ phone: newPhoneNumber }) 替代。")}))}))},Et.prototype.unlink=function(e){return Ft(this,void 0,Promise,(function(){return Bt(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,Ze.throwError)(At.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 $t(this,void 0,void 0,(function(){return Qt(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,u,l,p,d,h,f,m,g,y,b,x,w,_,I,E;return zt(n,t),n.prototype.signInAnonymously=function(e){return $t(this,void 0,Promise,(function(){var t,n,r,o,i;return Qt(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,Kt(Kt({},t),{data:{user:r.user,session:r},error:null})];case 4:return o=a.sent(),(i=new bt(o,{method:"signInAnonymously"})).category===mt.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 $t(this,void 0,Promise,(function(){var t,n,r=this;return Qt(this,(function(o){switch(o.label){case 0:return e.phone_number||e.verification_code||e.verification_token||e.provider_token?(e.phone_number&&(e.phone_number=this.formatPhone(e.phone_number)),[4,this.oauthInstance.authApi.signUp(e)]):[3,2];case 1:return o.sent(),[2,this.createLoginState()];case 2:return o.trys.push([2,4,,5]),this.validateAtLeastOne(e,[["email"],["phone"]],"You must provide either an email or phone number"),[4,this.getVerification(e.email?{email:e.email}:{phone_number:this.formatPhone(e.phone)})];case 3:return t=o.sent(),[2,{data:{verifyOtp:function(n){var o=n.token,i=n.messageId,a=void 0===i?t.verification_id:i;return $t(r,void 0,Promise,(function(){var n,r,i,s,c;return Qt(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(Kt(Kt(Kt({},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 bt(c,{method:"signUp"})}];case 9:return[2]}}))}))}},error:null}];case 4:return n=o.sent(),[2,{data:{user:null,session:null},error:new bt(n,{method:"signUp"})}];case 5:return[2]}}))}))},n.prototype.signOut=function(e){var t,n;return $t(this,void 0,Promise,(function(){var r,o,i;return Qt(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),r=this.cache.keys.userInfoKey,[4,this.oauthInstance.authApi.signOut(e)];case 1:return o=a.sent(),[4,this.cache.removeStoreAsync(r)];case 2:return a.sent(),this.setAccessKey(),null===(t=this.config.eventBus)||void 0===t||t.fire(_e,{eventType:"sign_out"}),null===(n=this.config.eventBus)||void 0===n||n.fire(Ie,{event:ge}),[2,Kt(Kt({},o),{data:{},error:null})];case 3:return i=a.sent(),[2,{data:{},error:new bt(i,{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){return $t(this,void 0,Promise,(function(){var t,n,r,o;return Qt(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),this.validateAtLeastOne(e,[["username"],["email"],["phone"]],"You must provide either username, email, or phone"),this.validateParams(e,{password:{required:!0,message:"Password is required"}}),[4,this.signIn(Kt({username:e.username||e.email||this.formatPhone(e.phone),password:e.password},e.is_encrypt?{isEncrypt:!0,version:"v2"}:{}))];case 1:return i.sent(),[4,this.getSession()];case 2:return t=i.sent().data,[2,{data:{user:(n=(void 0===t?{}:t).session).user,session:n},error:null}];case 3:return r=i.sent(),(o=new bt(r,{method:"signInWithPassword"})).category===mt.PROVIDER_NOT_ENABLED?console.error(o.helpMessage):o.category===mt.INVALID_CREDENTIALS||o.category===mt.USER_NOT_FOUND?console.warn(o.helpMessage):console.warn("[CloudBase Auth] signInWithPassword 失败 [".concat(o.category,"]: ").concat(o.message)),o.loginMethodHint&&console.info(o.loginMethodHint),[2,{data:{user:null,session:null},error:o}];case 4:return[2]}}))}))},n.prototype.signInWithIdToken=function(e){return $t(this,void 0,Promise,(function(){var t,n,r;return Qt(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),this.validateParams(e,{token:{required:!0,message:"Token is required"}}),[4,this.signInWithProvider({provider_token:e.token})];case 1:return o.sent(),[4,this.getSession()];case 2:return t=o.sent().data,[2,{data:{user:(n=(void 0===t?{}:t).session).user,session:n},error:null}];case 3:return r=o.sent(),[2,{data:{user:null,session:null},error:new bt(r,{method:"signInWithIdToken"})}];case 4:return[2]}}))}))},n.prototype.signInWithOtp=function(e){var t,n,r,o;return $t(this,void 0,Promise,(function(){var i,a,s=this;return Qt(this,(function(c){switch(c.label){case 0:if(!(null===(t=e.options)||void 0===t?void 0:t.emailRedirectTo)&&(void 0===(null===(n=e.options)||void 0===n?void 0:n.shouldCreateUser)||(null===(r=e.options)||void 0===r?void 0:r.shouldCreateUser)))return[2,this.signUp({email:e.email,phone:e.phone})];c.label=1;case 1:return c.trys.push([1,3,,4]),this.validateAtLeastOne(e,[["email"],["phone"]],"You must provide either an email or phone number"),[4,this.getVerification(Kt(Kt({email_redirect_to:null===(o=e.options)||void 0===o?void 0:o.emailRedirectTo},e.email?{email:e.email}:{phone_number:this.formatPhone(e.phone)}),{target:"USER"}))];case 2:return i=c.sent(),[2,{data:{user:null,session:null,verifyOtp:function(t){var n=t.token,r=t.messageId,o=void 0===r?i.verification_id:r;return $t(s,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.verifyOtp({email:e.email,phone:e.phone,token:String(n),messageId:o})]}))}))}},error:null}];case 3:return a=c.sent(),[2,{data:{user:null,session:null},error:new bt(a,{method:"signInWithOtp"})}];case 4:return[2]}}))}))},n.prototype.verifyOAuth=function(e){return $t(this,void 0,Promise,(function(){var t,n,o,i,a,s,c,u,l;return Qt(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:Kt(Kt({},t),{user:null,session:null,redirectUrl:null}),error:new bt({message:"Provider is required"})}]):[2,{data:{user:null,session:null,redirectUrl:null},error:new bt({message:"State is required"})}]:[2,{data:{user:null,session:null,redirectUrl:null},error:new bt({message:"Code is required"})}];case 2:return s=p.sent().provider_token,c=void 0,i.type!==Se?[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=Kt(Kt({},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:Kt(Kt({},t),{user:null,session:null,redirectUrl:null}),error:new bt(l,{method:"verifyOAuth"})}];case 8:return[2]}}))}))},n.prototype.signInWithOAuth=function(e){var t,n,r,o,i;return $t(this,void 0,Promise,(function(){var a,s,c,u,l,p,d,h,f;return Qt(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"}}),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)||Ee}),Xt()&&!(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 bt(f,{method:"signInWithOAuth"})}];case 3:return[2]}}))}))},n.prototype.getClaims=function(){return $t(this,void 0,Promise,(function(){var e;return Qt(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(je(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 je(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 bt(e,{method:"getClaims"})}];case 3:return[2]}}))}))},n.prototype.resetPasswordForEmail=function(e,t){return $t(this,void 0,Promise,(function(){var n,r,o,i,a,s,c=this;return Qt(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"}}),n=(t||{}).redirectTo,r=e.includes("@"),o=void 0,r?o={email:e}:(i=this.formatPhone(e),o={phone_number:i}),[4,this.getVerification(Kt(Kt({},o),{target:"USER"}))];case 1:return a=u.sent(),[2,{data:{updateUser:function(t){return $t(c,void 0,Promise,(function(){var o,i,s,c;return Qt(this,(function(u){switch(u.label){case 0:this.validateParams(t,{nonce:{required:!0,message:"Nonce is required"},password:{required:!0,message:"Password is required"}}),u.label=1;case 1:return u.trys.push([1,5,,6]),[4,this.verify({verification_id: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(Ie,{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&&Xt()&&window.location.assign(n),[2,i];case 5:return s=u.sent(),[2,{data:{user:null,session:null},error:new bt(s,{method:"resetPasswordForEmail"})}];case 6:return[2]}}))}))}},error:null}];case 2:return s=u.sent(),[2,{data:{updateUser:null},error:new bt(s,{method:"resetPasswordForEmail"})}];case 3:return[2]}}))}))},n.prototype.resetPasswordForOld=function(e){return $t(this,void 0,void 0,(function(){var t,n,r;return Qt(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 bt(r,{method:"resetPasswordForOld"})}];case 4:return[2]}}))}))},n.prototype.verifyOtp=function(e){return $t(this,void 0,Promise,(function(){var t,n,r,o,i;return Qt(this,(function(a){switch(a.label){case 0:return a.trys.push([0,6,,7]),t=e.type,n=String(e.token),this.validateParams(e,{token:{required:!0,message:"Token is required"},messageId:{required:!0,message:"messageId is required"}}),["phone_change","email_change"].includes(t)?[4,this.verify({verification_id:e.messageId,verification_code:n})]:[3,2];case 1:return a.sent(),[3,4];case 2:return[4,this.signInWithUsername({verificationInfo:{verification_id:e.messageId,is_user:!0},verificationCode:n,username:e.email||this.formatPhone(e.phone)||"",loginType:e.email?"email":"phone"})];case 3:a.sent(),a.label=4;case 4:return[4,this.getSession()];case 5:return r=a.sent().data,[2,{data:{user:(o=(void 0===r?{}:r).session).user,session:o},error:null}];case 6:return i=a.sent(),[2,{data:{user:null,session:null},error:new bt(i,{method:"verifyOtp"})}];case 7:return[2]}}))}))},n.prototype.getSession=function(){return $t(this,void 0,Promise,(function(){var e,t,n,r;return Qt(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:Kt(Kt({},e),{user:n}),user:n},error:null}];case 3:return r=o.sent(),[2,{data:{session:null,user:null},error:new bt(r,{method:"getSession"})}];case 4:return[2]}}))}))},n.prototype.refreshSession=function(e){return $t(this,void 0,Promise,(function(){var t,n,r,o,i;return Qt(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:Kt(Kt({},n),{user:o})},error:null}];case 4:return i=a.sent(),[2,{data:{user:null,session:null},error:new bt(i,{method:"refreshSession"})}];case 5:return[2]}}))}))},n.prototype.getUser=function(e){return void 0===e&&(e=!0),$t(this,void 0,Promise,(function(){var t,n,r;return Qt(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 bt(r,{method:"getUser"})}];case 4:return[2]}}))}))},n.prototype.refreshUser=function(){return $t(this,void 0,Promise,(function(){var e,t,n;return Qt(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 bt(n,{method:"refreshUser"})}];case 4:return[2]}}))}))},n.prototype.updateUser=function(e){var t;return $t(this,void 0,Promise,(function(){var n,r,o,i,a,s,c,u,l,p,d,h,f,m=this;return Qt(this,(function(v){switch(v.label){case 0:if(v.trys.push([0,8,,9]),n=Object.keys(e).some((function(t){return void 0!==e[t]&&null!==e[t]&&""!==e[t]})),!n)throw new bt({message:"At least one field must be provided for update"});return r=e.email,o=e.phone,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}(e,["email","phone"]),s=void 0!==o,c={},(a=void 0!==r)||s?(u=void 0,a?(u={email:e.email},l="email_change"):(p=this.formatPhone(e.phone),u={phone_number:p},l="phone_change"),[4,this.getVerification(Kt({},u))]):[3,4];case 1:return d=v.sent(),Object.keys(i).length>0?[4,this.updateUserBasicInfo(i)]:[3,3];case 2:v.sent(),v.label=3;case 3:return c={messageId:d.verification_id,verifyOtp:function(t){return $t(m,void 0,Promise,(function(){var n,r,o,i;return Qt(this,(function(s){switch(s.label){case 0:return s.trys.push([0,11,,12]),t.email&&e.email===t.email?[4,this.verifyOtp({type:"email_change",email:e.email,token:t.token,messageId:d.verification_id})]:[3,3];case 1:return(n=s.sent()).error?[2,n]:[4,this.updateUserBasicInfo({email:e.email})];case 2:return s.sent(),[3,9];case 3:return t.phone&&e.phone===t.phone?[4,this.verifyOtp({type:"phone_change",phone:e.phone,token:t.token,messageId:d.verification_id})]:[3,6];case 4:return(n=s.sent()).error?[2,n]:[4,this.updateUserBasicInfo({phone:this.formatPhone(e.phone)})];case 5:return s.sent(),[3,9];case 6:return[4,this.verifyOtp({type:l,email:a?e.email:void 0,phone:a?void 0:e.phone,token:t.token,messageId:d.verification_id})];case 7:return(n=s.sent()).error?[2,n]:[4,this.updateUserBasicInfo(e)];case 8:s.sent(),s.label=9;case 9:return[4,this.getUser(!1)];case 10:return r=s.sent().data.user,null===(i=this.config.eventBus)||void 0===i||i.fire(Ie,{event:xe}),[2,{data:{user:r},error:null}];case 11:return o=s.sent(),[2,{data:{user:null},error:new bt(o,{method:"updateUser"})}];case 12:return[2]}}))}))}},[3,6];case 4:return[4,this.updateUserBasicInfo(e)];case 5:v.sent(),v.label=6;case 6:return[4,this.getUser(!1)];case 7:return h=v.sent().data.user,Object.keys(i).length>0&&(null===(t=this.config.eventBus)||void 0===t||t.fire(Ie,{event:xe})),[2,{data:Kt({user:h},c),error:null}];case 8:return f=v.sent(),[2,{data:{user:null},error:new bt(f,{method:"updateUser"})}];case 9:return[2]}}))}))},n.prototype.getUserIdentities=function(){var e;return $t(this,void 0,Promise,(function(){var t,n;return Qt(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 bt(n,{method:"getUserIdentities"})}];case 3:return[2]}}))}))},n.prototype.linkIdentity=function(e){return $t(this,void 0,Promise,(function(){var t;return Qt(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.validateParams(e,{provider:{required:!0,message:"Provider is required"}}),[4,this.signInWithOAuth({provider:e.provider,options:{type:Se}})];case 1:return n.sent(),[2,{data:{provider:e.provider},error:null}];case 2:return t=n.sent(),[2,{data:{provider:null},error:new bt(t,{method:"linkIdentity"})}];case 3:return[2]}}))}))},n.prototype.unlinkIdentity=function(e){return $t(this,void 0,Promise,(function(){var t;return Qt(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.validateParams(e,{provider:{required:!0,message:"Provider is required"}}),[4,this.oauthInstance.authApi.unbindProvider({provider_id:e.provider})];case 1:return n.sent(),[2,{data:{},error:null}];case 2:return t=n.sent(),[2,{data:{},error:new bt(t,{method:"unlinkIdentity"})}];case 3:return[2]}}))}))},n.prototype.reauthenticate=function(){return $t(this,void 0,Promise,(function(){var e,t,n,r,o=this;return Qt(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"]],"You must provide either an email or phone number"),t=e.email?{email:e.email}:{phone_number:this.formatPhone(e.phone)},[4,this.getVerification(t)];case 2:return n=i.sent(),[2,{data:{updateUser:function(e){return $t(o,void 0,Promise,(function(){var r,o,i,a,s;return Qt(this,(function(c){switch(c.label){case 0:this.validateParams(e,{nonce:{required:!0,message:"Nonce is required"}}),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(Kt(Kt({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 bt(s,{method:"reauthenticate"})}];case 10:return[2]}}))}))}},error:null}];case 3:return r=i.sent(),[2,{data:{updateUser:null},error:new bt(r,{method:"reauthenticate"})}];case 4:return[2]}}))}))},n.prototype.resend=function(e){return $t(this,void 0,Promise,(function(){var t,n,r;return Qt(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.validateAtLeastOne(e,[["email"],["phone"]],"You must provide either an email or phone number"),t="signup"===e.type?"ANY":"USER",n={target:t},"email"in e&&(n.email=e.email),"phone"in e&&(n.phone_number=this.formatPhone(e.phone)),[4,this.oauthInstance.authApi.getVerification(n)];case 1:return[2,{data:{messageId:o.sent().verification_id},error:null}];case 2:return r=o.sent(),[2,{data:{messageId:null},error:new bt(r,{method:"resend"})}];case 3:return[2]}}))}))},n.prototype.setSession=function(e){var t;return $t(this,void 0,Promise,(function(){var n,r,o;return Qt(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),this.validateParams(e,{access_token:{required:!0,message:"Access token is required"},refresh_token:{required:!0,message:"Refresh token is required"}}),[4,this.oauthInstance.oauth2client.refreshToken(e,{throwError:!0})];case 1:return i.sent(),[4,this.getSession()];case 2:return n=i.sent().data,r=(void 0===n?{}:n).session,null===(t=this.config.eventBus)||void 0===t||t.fire(Ie,{event:ye}),[2,{data:{user:r.user,session:r},error:null}];case 3:return o=i.sent(),[2,{data:{user:null,session:null},error:new bt(o,{method:"setSession"})}];case 4:return[2]}}))}))},n.prototype.exchangeCodeForSession=function(){return $t(this,void 0,void 0,(function(){return Qt(this,(function(e){return[2]}))}))},n.prototype.deleteUser=function(e){return $t(this,void 0,Promise,(function(){var t,n;return Qt(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),this.validateParams(e,{password:{required:!0,message:"Password is required"}}),[4,this.oauthInstance.authApi.sudo(e)];case 1:return t=r.sent().sudo_token,[4,this.oauthInstance.authApi.deleteMe({sudo_token:t})];case 2:return r.sent(),[2,{data:{},error:null}];case 3:return n=r.sent(),[2,{data:{},error:new bt(n,{method:"deleteUser"})}];case 4:return[2]}}))}))},n.prototype.toDefaultLoginPage=function(e){return void 0===e&&(e={}),$t(this,void 0,Promise,(function(){var t,n,r,o,i;return Qt(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("&"),v.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 bt(e,{method:"toDefaultLoginPage"})}]}return[2]}))}))},n.prototype.signInWithCustomTicket=function(e){return $t(this,void 0,Promise,(function(){var t,n,r,o;return Qt(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,Kt(Kt({},t),{data:{user:r.user,session:r},error:null})];case 5:return o=i.sent(),[2,{data:{user:null,session:null},error:new bt(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 $t(this,void 0,Promise,(function(){var e,t,r,o,i,a,s=this;return Qt(this,(function(c){switch(c.label){case 0:if(!v.default.isMatch())throw Error("wx api undefined");e=wx.getAccountInfoSync().miniProgram,t=function(t){return $t(s,void 0,void 0,(function(){var r,o;return Qt(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 $t(s,void 0,void 0,(function(){var o;return Qt(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,Kt(Kt({},r),{data:{user:i.user,session:i},error:null})];case 5:return a=c.sent(),[2,{data:{user:null,session:null},error:new bt(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 $t(this,void 0,Promise,(function(){var e,t,r,i,a,s,c,u,l;return Qt(this,(function(p){switch(p.label){case 0:return v.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 bt({message:"wx api undefined"})}];case 1:r=p.sent().code,t.provider_code=r,p.label=2;case 2:return p.trys.push([2,5,,6]),[4,this.oauthInstance.authApi.grantProviderToken(t,o)];case 3:if((i=p.sent()).error_code)throw i;return[4,this.oauthInstance.authApi.signInWithProvider({provider_token:i.provider_token},o)];case 4:if(null==(a=p.sent())?void 0:a.error_code)throw a;return[3,6];case 5:return s=p.sent(),[2,{data:{user:null,session:null},error:new bt(s,{method:"signInWithPhoneAuth"})}];case 6:return[4,this.createLoginState()];case 7:return c=p.sent(),[4,this.getSession()];case 8:return u=p.sent().data,l=(void 0===u?{}:u).session,[2,Kt(Kt({},c),{data:{user:l.user,session:l},error:null})]}}))}))},n.prototype.bindPhoneNumber=function(e){return $t(this,void 0,void 0,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.editContact(e)]}))}))},n.prototype.unbindProvider=function(e){return $t(this,void 0,Promise,(function(){return Qt(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 $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.verify(e)]}))}))},n.prototype.getVerification=function(e,t){return $t(this,void 0,Promise,(function(){return Qt(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,Ze.printWarn)(At.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),$t(this,void 0,Promise,(function(){var t,n,r;return Qt(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,Kt(Kt({},n.user),r)];case 8:return[2,null]}}))}))},n.prototype.signInAnonymouslyInWx=function(e){var t=(void 0===e?{}:e).useWxCloud;return $t(this,void 0,Promise,(function(){var e,n,r=this;return Qt(this,(function(o){switch(o.label){case 0:if(!v.default.isMatch())throw Error("wx api undefined");return e=wx.getAccountInfoSync().miniProgram,n=function(n){return $t(r,void 0,void 0,(function(){var r,o;return Qt(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 $t(r,void 0,void 0,(function(){var r;return Qt(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 $t(this,void 0,Promise,(function(){var e,t,n=this;return Qt(this,(function(r){switch(r.label){case 0:if(!v.default.isMatch())throw Error("wx api undefined");return e=wx.getAccountInfoSync().miniProgram,t=function(t){return $t(n,void 0,void 0,(function(){var n;return Qt(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 $t(n,void 0,void 0,(function(){var n;return Qt(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 $t(this,void 0,Promise,(function(){var e=this;return Qt(this,(function(t){switch(t.label){case 0:if(!v.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 $t(e,void 0,void 0,(function(){var e,i,a,s,c;return Qt(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 $t(this,void 0,Promise,(function(){return Qt(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 $t(this,void 0,Promise,(function(){return Qt(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 $t(this,void 0,Promise,(function(){return Qt(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 $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.setPassword(e)]}))}))},n.prototype.isUsernameRegistered=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){switch(t.label){case 0:return"string"!=typeof e&&(0,Ze.throwError)(At.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,Ze.printWarn)(At.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getLoginState instead")},n.prototype.getLoginState=function(){return $t(this,void 0,void 0,(function(){var e;return Qt(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 $t(this,void 0,Promise,(function(){return Qt(this,(function(e){return[2,this.getCurrentUser()]}))}))},n.prototype.getWedaUserInfo=function(){return $t(this,void 0,Promise,(function(){return Qt(this,(function(e){return[2,this.oauthInstance.authApi.getWedaUserInfo()]}))}))},n.prototype.updateUserBasicInfo=function(e){return $t(this,void 0,void 0,(function(){var t;return Qt(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 $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.bindWithProvider(e)]}))}))},n.prototype.queryUser=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.queryUserProfile(e)]}))}))},n.prototype.getAccessToken=function(){return $t(this,void 0,void 0,(function(){return Qt(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 $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.grantProviderToken(e)]}))}))},n.prototype.patchProviderToken=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.patchProviderToken(e)]}))}))},n.prototype.signInWithProvider=function(e){return $t(this,void 0,Promise,(function(){return Qt(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={}),$t(this,void 0,void 0,(function(){return Qt(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 $t(this,void 0,Promise,(function(){return Qt(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 $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.genProviderRedirectUri(e)]}))}))},n.prototype.resetPassword=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.resetPassword(e)]}))}))},n.prototype.deviceAuthorize=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.deviceAuthorize(e)]}))}))},n.prototype.sudo=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.sudo(e)]}))}))},n.prototype.deleteMe=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.deleteMe(e)]}))}))},n.prototype.getProviders=function(){return $t(this,void 0,Promise,(function(){return Qt(this,(function(e){return[2,this.oauthInstance.authApi.getProviders()]}))}))},n.prototype.loginScope=function(){return $t(this,void 0,Promise,(function(){return Qt(this,(function(e){return[2,this.oauthInstance.authApi.loginScope()]}))}))},n.prototype.loginGroups=function(){return $t(this,void 0,Promise,(function(){return Qt(this,(function(e){return[2,this.oauthInstance.authApi.loginGroups()]}))}))},n.prototype.onLoginStateChanged=function(e){var t;return $t(this,void 0,void 0,(function(){var n,r=this;return Qt(this,(function(o){switch(o.label){case 0:return null===(t=this.config.eventBus)||void 0===t||t.on(_e,(function(t){return $t(r,void 0,void 0,(function(){var n,r,o;return Qt(this,(function(i){switch(i.label){case 0:return(null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.eventType)===ve?[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,Kt(Kt({},t),n)),[2]}}))}))})),[4,this.getLoginState()];case 1:return n=o.sent(),e.call(this,n),[2]}}))}))},n.prototype.refreshTokenForce=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.refreshTokenForce(e)]}))}))},n.prototype.getCredentials=function(){return $t(this,void 0,Promise,(function(){return Qt(this,(function(e){return[2,this.oauthInstance.authApi.getCredentials()]}))}))},n.prototype.setCredentials=function(e){return $t(this,void 0,void 0,(function(){return Qt(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 $t(this,void 0,Promise,(function(){return Qt(this,(function(e){return[2,this.oauthInstance.authApi.getProviderSubType()]}))}))},n.prototype.createCaptchaData=function(e){return $t(this,void 0,void 0,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.createCaptchaData(e)]}))}))},n.prototype.verifyCaptchaData=function(e){return $t(this,void 0,void 0,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.verifyCaptchaData(e)]}))}))},n.prototype.getMiniProgramQrCode=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.getMiniProgramCode(e)]}))}))},n.prototype.getMiniProgramQrCodeStatus=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.getMiniProgramQrCodeStatus(e)]}))}))},n.prototype.modifyPassword=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.modifyPassword(e)]}))}))},n.prototype.modifyPasswordWithoutLogin=function(e){return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){return[2,this.oauthInstance.authApi.modifyPasswordWithoutLogin(e)]}))}))},n.prototype.getUserBehaviorLog=function(e){return $t(this,void 0,Promise,(function(){return Qt(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 $t(this,void 0,Promise,(function(){var e,t,r,i,s,u,p;return Qt(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(Kt(Kt({},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){var n,r;return $t(this,void 0,Promise,(function(){var o;return Qt(this,(function(i){switch(i.label){case 0:return[4,(o=new tn({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance})).checkLocalStateAsync()];case 1:return i.sent(),(null==t?void 0:t.userInfo)?(o.user.setLocalUserInfo(t.userInfo),[3,5]):[3,2];case 2:return(null==t?void 0:t.asyncRefreshUser)?(o.user.refresh(e),[3,5]):[3,3];case 3:return[4,o.user.refresh(e)];case 4:i.sent(),i.label=5;case 5:return null===(n=this.config.eventBus)||void 0===n||n.fire(_e,{eventType:"sign_in"}),null===(r=this.config.eventBus)||void 0===r||r.fire(Ie,{event:ye}),[2,o]}}))}))},n.prototype.setAccessKey=function(){var e,t;return $t(this,void 0,void 0,(function(){var n,r;return Qt(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=Oe),!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(Ie,(function(e){return $t(t,void 0,void 0,(function(){var t,n,r,o,i;return Qt(this,(function(a){switch(a.label){case 0:return t=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.event,n=null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.info,[4,this.getSession()];case 1:return r=a.sent().data.session,this.notifyListeners(t,r,n),[2]}}))}))}))},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.validateParams=function(e,t){for(var n=0,r=Object.entries(t);n<r.length;n++){var o=r[n],i=o[0],a=o[1];if(a.required&&(void 0===(null==e?void 0:e[i])||null===(null==e?void 0:e[i])||""===(null==e?void 0:e[i])))throw new bt({message:a.message})}},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 new bt({message:n})},n.prototype.init=function(){var e;return $t(this,void 0,Promise,(function(){return Qt(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.oauthInstance.oauth2client.localCredentials.getCredentials()];case 1:return t.sent()&&(null===(e=this.config.eventBus)||void 0===e||e.fire(Ie,{event:"INITIAL_SESSION"})),[3,3];case 2:return t.sent(),[3,3];case 3:return[2,{error:null}]}}))}))},Jt([(0,Pt.catchErrorsDecorator)({title:"绑定手机号失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindPhoneNumber() 的语法或参数是否正确"," 2 - 当前环境是否开通了短信验证码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",["function"==typeof(o=void 0!==e&&e.BindPhoneRequest)?o:Object]),Yt("design:returntype",Promise)],n.prototype,"bindPhoneNumber",null),Jt([(0,Pt.catchErrorsDecorator)({title:"解除三方绑定失败",messages:["请确认以下各项:"," 1 - 调用 auth().unbindProvider() 的语法或参数是否正确"," 2 - 当前账户是否已经与此登录方式解绑","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",["function"==typeof(i=void 0!==e&&e.UnbindProviderRequest)?i:Object]),Yt("design:returntype","function"==typeof(a="undefined"!=typeof Promise&&Promise)?a:Object)],n.prototype,"unbindProvider",null),Jt([(0,Pt.catchErrorsDecorator)({title:"绑定邮箱地址失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindEmail() 的语法或参数是否正确"," 2 - 当前环境是否开通了邮箱密码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",["function"==typeof(s=void 0!==e&&e.BindEmailRequest)?s:Object]),Yt("design:returntype",void 0)],n.prototype,"bindEmail",null),Jt([(0,Pt.catchErrorsDecorator)({title:"验证码验证失败",messages:["请确认以下各项:"," 1 - 调用 auth().verify() 的语法或参数是否正确"," 2 - 当前环境是否开通了手机验证码/邮箱登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",["function"==typeof(c=void 0!==e&&e.VerifyRequest)?c:Object]),Yt("design:returntype","function"==typeof(u="undefined"!=typeof Promise&&Promise)?u:Object)],n.prototype,"verify",null),Jt([(0,Pt.catchErrorsDecorator)({title:"获取验证码失败",messages:["请确认以下各项:"," 1 - 调用 auth().getVerification() 的语法或参数是否正确"," 2 - 当前环境是否开通了手机验证码/邮箱登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",["function"==typeof(l=void 0!==e&&e.GetVerificationRequest)?l:Object,Object]),Yt("design:returntype","function"==typeof(p="undefined"!=typeof Promise&&Promise)?p:Object)],n.prototype,"getVerification",null),Jt([(0,Pt.catchErrorsDecorator)({title:"获取用户信息失败",messages:["请确认以下各项:"," 1 - 调用 auth().getCurrentUser() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[Object]),Yt("design:returntype","function"==typeof(d="undefined"!=typeof Promise&&Promise)?d:Object)],n.prototype,"getCurrentUser",null),Jt([(0,Pt.catchErrorsDecorator)({title:"小程序匿名登录失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了匿名登录"," 2 - 调用 auth().signInAnonymouslyInWx() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[Object]),Yt("design:returntype","function"==typeof(h="undefined"!=typeof Promise&&Promise)?h:Object)],n.prototype,"signInAnonymouslyInWx",null),Jt([(0,Pt.catchErrorsDecorator)({title:"小程序绑定OpenID失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序openId静默登录"," 2 - 调用 auth().bindOpenId() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[]),Yt("design:returntype","function"==typeof(f="undefined"!=typeof Promise&&Promise)?f:Object)],n.prototype,"bindOpenId",null),Jt([(0,Pt.catchErrorsDecorator)({title:"小程序unionId静默登录失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序unionId静默登录"," 2 - 调用 auth().signInWithUnionId() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[]),Yt("design:returntype","function"==typeof(m="undefined"!=typeof Promise&&Promise)?m:Object)],n.prototype,"signInWithUnionId",null),Jt([(0,Pt.catchErrorsDecorator)({title:"短信验证码登陆",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序短信验证码登陆"," 2 - 调用 auth().signInWithSms() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[Object]),Yt("design:returntype","function"==typeof(g="undefined"!=typeof Promise&&Promise)?g:Object)],n.prototype,"signInWithSms",null),Jt([(0,Pt.catchErrorsDecorator)({title:"邮箱验证码登陆",messages:["请确认以下各项:"," 1 - 当前环境是否开启了邮箱登陆"," 2 - 调用 auth().signInWithEmail() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[Object]),Yt("design:returntype","function"==typeof(y="undefined"!=typeof Promise&&Promise)?y:Object)],n.prototype,"signInWithEmail",null),Jt([(0,Pt.catchErrorsDecorator)({title:"获取用户是否被占用失败",messages:["请确认以下各项:"," 1 - 调用 auth().isUsernameRegistered() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[String]),Yt("design:returntype","function"==typeof(b="undefined"!=typeof Promise&&Promise)?b:Object)],n.prototype,"isUsernameRegistered",null),Jt([(0,Pt.catchErrorsDecorator)({title:"获取本地登录态失败",messages:["请确认以下各项:"," 1 - 调用 auth().getLoginState() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[]),Yt("design:returntype",Promise)],n.prototype,"getLoginState",null),Jt([(0,Pt.catchErrorsDecorator)({title:"获取用户信息失败",messages:["请确认以下各项:"," 1 - 是否已登录"," 2 - 调用 auth().getUserInfo() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[]),Yt("design:returntype","function"==typeof(x="undefined"!=typeof Promise&&Promise)?x:Object)],n.prototype,"getUserInfo",null),Jt([(0,Pt.catchErrorsDecorator)({title:"获取微搭插件用户信息失败",messages:["请确认以下各项:"," 1 - 是否已登录"," 2 - 调用 auth().getWedaUserInfo() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[]),Yt("design:returntype","function"==typeof(w="undefined"!=typeof Promise&&Promise)?w:Object)],n.prototype,"getWedaUserInfo",null),Jt([(0,Pt.catchErrorsDecorator)({title:"绑定第三方登录方式失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindWithProvider() 的语法或参数是否正确"," 2 - 此账户是否已经绑定此第三方","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",["function"==typeof(_=void 0!==e&&e.BindWithProviderRequest)?_:Object]),Yt("design:returntype","function"==typeof(I="undefined"!=typeof Promise&&Promise)?I:Object)],n.prototype,"bindWithProvider",null),Jt([(0,Pt.catchErrorsDecorator)({title:"获取身份源类型",messages:["请确认以下各项:"," 1 - 调用 auth().getProviderSubType() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(At.COMMUNITY_SITE_URL)]}),Yt("design:type",Function),Yt("design:paramtypes",[]),Yt("design:returntype","function"==typeof(E="undefined"!=typeof Promise&&Promise)?E:Object)],n.prototype,"getProviderSubType",null),n}(Ht),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:fe};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)||Ct.useDefaultAdapter.bind(t)(),h=d.runtime,f=d.adapter,m=t||{},v=m.env,g=m.clientId,y=m.debug,b=m.cache,x=m.app,w=m.getApiOrigin,_=(t||{}).apiOrigin;_||(_="https://".concat(v,".").concat(c,".tcb-api.tencentcloudapi.com"));var I={env:v,clientId:g,i18n:u,accessKey:l,useWxCloud:p,eventBus:new Xe.CloudbaseEventEmitter},E=new Tt(qt(Kt(Kt({},I),{apiOrigin:_,getApiOrigin:w,apiPath:(null==e?void 0:e.apiPath)||fe,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:Zt(I.eventBus),headers:Kt({"X-SDK-Version":"@cloudbase/js-sdk/".concat(e.sdkVersion)},e.headers||{}),detectSessionInUrl:e.detectSessionInUrl,debug:y,auth:null===(r=null===(n=t.app)||void 0===n?void 0:n.config)||void 0===r?void 0:r.auth}))),S=new nn(Kt(Kt({},I),{region:c,persistence:e.persistence,debug:y,cache:b||new Rt.CloudbaseCache({persistence:e.persistence,keys:{userInfoKey:"user_info_".concat(v)},platformInfo:d}),runtime:h||"web",_fromApp:x,oauthInstance:E,auth:null===(i=null===(o=t.app)||void 0===o?void 0:o.config)||void 0===i?void 0:i.auth}));return E.initializeSession((function(e,t){return $t(a,void 0,void 0,(function(){return Qt(this,(function(n){return e?(e.type===Ee?t?I.eventBus.fire(Ie,{event:ye,info:Kt(Kt({},e),{error:t})}):e.user&&S.createLoginState({},{userInfo:e.user}):e.type===Se&&I.eventBus.fire(Ie,{event:we,info:Kt(Kt({},e),{error:t})}),[2]):[2]}))}))})),{authInstance:S,oauthInstance:E}}(Kt(Kt({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=f(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,g;return ln(this,(function(y){switch(y.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 g=y.sent(),"node-sdk"===(null==t?void 0:t.from)?[2,g]:[4,g.data];case 2:return[2,y.sent()]}}))}))}var mn=new hn,vn={name:dn,entity:{callContainer:mn.callContainer}};try{cloudbase.registerComponent(vn)}catch(e){}function gn(e){try{e.registerComponent(vn)}catch(e){console.warn(e)}}try{window.registerCloudrun=gn}catch(e){}var yn=function(){return yn=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},yn.apply(this,arguments)},bn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},xn=r._G.eX,wn=r._G.Sg,_n=r._G.vM,In=r.P6.execCallback,En=r.BM.D,Sn="functions",On=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,g,y,b,x,w,_,I,E,S,O,T,A,P;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,g=void 0===v?{}:v,!s)throw new Error(JSON.stringify({code:wn.INVALID_PARAMS,msg:"[".concat(Sn,".callFunction] invalid function name")}));try{y=c?JSON.stringify(c):""}catch(e){throw new Error(JSON.stringify({code:wn.INVALID_PARAMS,msg:"[".concat(Sn,".callFunction] invalid data")}))}return"cloudrun"!==d?[3,2]:(b=r.P6.generateRequestId(),[4,fn.call(this,{name:s,data:y,path:f,method:m,header:yn(yn({},g),{"X-Request-Id":b})})]);case 1:return[2,{result:A=R.sent(),requestId:b}];case 2:w=(x=this).request,_=x.config,I="functions.invokeFunction",E={inQuery:u,parse:l,search:p,function_name:s,request_data:y},S={},O=!("GATEWAY"!==_.endPointMode||(C=s,"lcap-common-service"===C||"lcap-datasource-test"===C||C.startsWith("lcap-data")||C.startsWith("lowcode-datasource")||"cloudbase_module"===C)||function(e){return"lowcode-wx-datasource"===e}(s)),R.label=3;case 3:return R.trys.push([3,8,,9]),O?[4,w.gateWay(yn(yn({},e),{path:"functions"}),n)]:[3,5];case 4:return T=R.sent(),S=yn({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,w.send(I,E,{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)return[2,In(t,null,S)];if(A=S.data.response_data,l||O)return[2,In(t,null,{result:A,requestId:S.requestId})];try{return A=JSON.parse(S.data.response_data),[2,In(t,null,{result:A,requestId:S.requestId})]}catch(e){In(t,new Error("[".concat(xn(),"][").concat(wn.INVALID_PARAMS,"][").concat(Sn,".callFunction] response data must be json")))}return[3,9];case 8:return P=R.sent(),In(t,P),[3,9];case 9:return[2]}var C}))},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)}([En({customInfo:{className:"Cloudbase",methodName:"callFunction"},title:"函数调用失败",messages:["请确认以下各项:"," 1 - 调用 callFunction() 的语法或参数是否正确"," 2 - 当前环境下是否存在此函数"," 3 - 函数安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(_n)]}),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}(),Tn=new On,An={name:Sn,entity:{callFunction:Tn.callFunction}};try{cloudbase.registerComponent(An)}catch(e){}var Pn=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)}}(),Rn=function(e){function t(t){var n=e.call(this,t)||this;return n.__isStorageError=!0,n.name="StorageError",n}return Pn(t,e),t}(Error);function Cn(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}var Nn,kn=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 Pn(t,e),t.prototype.toJSON=function(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}},t}(Rn);function Un(){return globalThis.Buffer}function jn(e){var t=Un();return t?t.from(e).toString("base64"):btoa(e)}function Ln(e){return e.split("/").map((function(e){return encodeURIComponent(e)})).join("/")}Pn((function(e,t){var n=Nn.call(this,e)||this;return n.name="StorageUnknownError",n.originalError=t,n}),Nn=Rn);var 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)},qn=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())}))},Mn=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])}}},Fn="/v1/storages";function Bn(e,t){return qn(this,void 0,Promise,(function(){var n;return Mn(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 Cn(n)?[2,{data:null,error:n}]:[2,{data:null,error:new Rn((null==n?void 0:n.message)||String(n))}];case 3:return[2]}}))}))}var Wn=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(Fn).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(Fn).concat(e.startsWith("/")?"":"/").concat(e):e},e.prototype.send=function(e){return qn(this,void 0,Promise,(function(){var t,n,r,o,i,a;return Mn(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=Dn({},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(Dn(Dn(Dn(Dn({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 qn(this,void 0,Promise,(function(){var r,o,i,a;return Mn(this,(function(s){switch(s.label){case 0:return r=this.buildUrl(e.path,e.query),[4,this.request.fetch(Dn(Dn({url:r,method:"GET",headers:Dn({},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 kn("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 kn("Not Modified",i,"STORAGE_PG_NOT_MODIFIED");if(i>=400)throw new kn("Download failed with status ".concat(i),i,"STORAGE_PG_REQUEST_FAIL");if(!(a=null==o?void 0:o.response))throw new kn("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 qn(this,void 0,Promise,(function(){var o,i,a,s;return Mn(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 kn(s,o,a)}}))}))},e}(),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)},Gn=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])}}};function zn(e){return Cn(e)?e:new Rn((null==e?void 0:e.message)||String(e))}function Kn(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 Jn=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 Gn(this,void 0,Promise,(function(){var n,r,o,i,a;return Hn(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),n=Kn(this.ctx.options),r=n.headers,o=n.query,[4,this.ctx.http.download({path:"/object/".concat(this.ctx.bucketId,"/").concat(Ln(this.ctx.cleanName)),headers:Vn(Vn({},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 kn("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}(),Yn=function(){function e(e){this.ctx=e}return e.prototype.asStream=function(){return new Jn(this.ctx)},e.prototype.then=function(e,t){return this.execute().then(e,t)},e.prototype.execute=function(){var e,t;return Gn(this,void 0,Promise,(function(){var n,r,o,i,a,s;return Hn(this,(function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),n=Kn(this.ctx.options),r=n.headers,o=n.query,[4,this.ctx.http.download({path:"/object/".concat(this.ctx.bucketId,"/").concat(Ln(this.ctx.cleanName)),headers:Vn(Vn({},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}(),$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)},Qn=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())}))},Xn=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])}}},Zn="3600",er=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 Rn("setHeader requires a non-empty header name");if(/[\r\n]/.test(e)||"string"==typeof t&&/[\r\n]/.test(t))throw new Rn("setHeader does not allow CR/LF characters in header name or value");return this.headers=$n($n({},this.headers),((n={})[e]=String(t),n)),this},e.prototype.upload=function(e,t,n){return Qn(this,void 0,Promise,(function(){return Xn(this,(function(r){return[2,this.uploadOrUpdate("POST",e,t,n)]}))}))},e.prototype.update=function(e,t,n){return Qn(this,void 0,Promise,(function(){return Xn(this,(function(r){return[2,this.uploadOrUpdate("PUT",e,t,n)]}))}))},e.prototype.download=function(e,t,n){return new Yn({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 Qn(this,void 0,Promise,(function(){var r=this;return Xn(this,(function(o){return[2,Bn((function(){return Qn(r,void 0,void 0,(function(){var r;return Xn(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 Qn(this,void 0,Promise,(function(){var t=this;return Xn(this,(function(n){return[2,Bn((function(){return Qn(t,void 0,void 0,(function(){var t,n,r,o,i,a=this;return Xn(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 Qn(this,void 0,Promise,(function(){var r=this;return Xn(this,(function(o){return[2,Bn((function(){return Qn(r,void 0,void 0,(function(){var r;return Xn(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 Qn(this,void 0,Promise,(function(){var r=this;return Xn(this,(function(o){return[2,Bn((function(){return Qn(r,void 0,void 0,(function(){return Xn(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 Qn(this,void 0,Promise,(function(){var t=this;return Xn(this,(function(n){return[2,Bn((function(){return Qn(t,void 0,void 0,(function(){var t,n;return Xn(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 Qn(this,void 0,Promise,(function(){var t,n,r;return Xn(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 Rn?n:new Rn((null==n?void 0:n.message)||String(n))}];case 3:return[2]}}))}))},e.prototype.createSignedUrl=function(e,t,n){return Qn(this,void 0,Promise,(function(){var r=this;return Xn(this,(function(o){return[2,Bn((function(){return Qn(r,void 0,void 0,(function(){var r,o,i;return Xn(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 Qn(this,void 0,Promise,(function(){var r=this;return Xn(this,(function(o){return[2,Bn((function(){return Qn(r,void 0,void 0,(function(){var r,o,i,a,s=this;return Xn(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 Qn(this,void 0,Promise,(function(){var n=this;return Xn(this,(function(r){return[2,Bn((function(){return Qn(n,void 0,void 0,(function(){var n,r,o;return Xn(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 Qn(this,void 0,Promise,(function(){var o=this;return Xn(this,(function(i){return[2,Bn((function(){return Qn(o,void 0,void 0,(function(){var o,i,a,s,c;return Xn(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($n($n({},e),{headers:$n($n({},this.headers),e.headers||{})}))},e.prototype.uploadOrUpdate=function(e,t,n,r){return Qn(this,void 0,Promise,(function(){var o=this;return Xn(this,(function(i){return[2,Bn((function(){return Qn(o,void 0,void 0,(function(){var o,i,a,s,c;return Xn(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 Rn('invalid path: ".." segment is not allowed');return t},e.prototype.encodePath=function(e){return Ln(e)},e.prototype.buildUploadBody=function(e,t){var n,r,o,i,a,s=$n({},(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:Zn,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:Zn,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 Rn("FormData must contain a file");if(r>1)throw new Rn("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 jn(e)},e}(),tr=/[\x00-\x20\x7f/\\?#%]/;function nr(e,t){if("string"!=typeof e||0===e.length)throw new Rn("[storage.".concat(t,"] bucketId is required"));if(e.length>256)throw new Rn("[storage.".concat(t,"] invalid bucketId: length must be 1-").concat(256));var n=tr.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 Rn(r)}}var rr,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=function(){function e(e,t){void 0===t&&(t=!1),this.http=new Wn(e),this.shouldThrowOnError=t}return e.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},e.prototype.listBuckets=function(e){return or(this,void 0,Promise,(function(){var t=this;return ir(this,(function(n){return[2,Bn((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 or(this,void 0,Promise,(function(){var t=this;return ir(this,(function(n){return[2,Bn((function(){return nr(e,"getBucket"),t.http.send({method:"GET",path:"/bucket/".concat(e)})}),this.shouldThrowOnError)]}))}))},e.prototype.createBucket=function(e,t){return or(this,void 0,Promise,(function(){var n=this;return ir(this,(function(r){return[2,Bn((function(){var r;return nr(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 or(this,void 0,Promise,(function(){var n=this;return ir(this,(function(r){return[2,Bn((function(){return nr(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 or(this,void 0,Promise,(function(){var t=this;return ir(this,(function(n){return[2,Bn((function(){return nr(e,"deleteBucket"),t.http.send({method:"DELETE",path:"/bucket/".concat(e)})}),this.shouldThrowOnError)]}))}))},e}(),sr=function(){return sr=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},sr.apply(this,arguments)},cr=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},ur=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},lr=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())}))},pr=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"}(rr||(rr={}));var dr=r._G.eX,hr=r._G.Sg,fr=r._G.vM,mr=r.P6.isArray,vr=r.P6.isString,gr=r.P6.isPalinObject,yr=r.P6.execCallback,br=r.BM.D,xr="storage",wr=function(e,t,n){return lr(void 0,void 0,void 0,(function(){var r,o,i;return pr(this,(function(a){switch(a.label){case 0:return[4,e.gateWay({path:"storages",name:"get-objects-upload-info",data:[sr({objectId:t.path},t.signedHeader?{signedHeader:t.signedHeader}:{})]},n)];case 1:return r=a.sent(),o=(null===(i=r.data)||void 0===i?void 0:i[0])||{},[2,sr(sr({},r),{data:sr(sr({},o.code?sr({},o):{}),{authorization:o.authorization,token:o.token,url:o.uploadUrl,fileId:o.cloudObjectId,cosFileId:o.cloudObjectMeta,download_url:o.downloadUrl})})]}}))}))},_r=function(e,t,n){return lr(void 0,void 0,void 0,(function(){var r,o;return pr(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 r=i.sent(),[2,sr(sr({},r),{data:{download_list:null===(o=r.data)||void 0===o?void 0:o.map((function(e){return{code:e.code||"SUCCESS",message:e.message,fileid:e.cloudObjectId,download_url:e.downloadUrl,fileID:e.cloudObjectId,tempFileURL:e.downloadUrl}}))}})]}}))}))},Ir=function(e,t,n){return lr(void 0,void 0,void 0,(function(){var r,o;return pr(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 r=i.sent(),[2,sr(sr({},r),{data:{delete_list:null===(o=r.data)||void 0===o?void 0:o.map((function(e){return{code:e.code||"SUCCESS",fileID:e.cloudObjectId,message:e.message}}))}})]}}))}))},Er=function(e,t,n){return lr(void 0,void 0,void 0,(function(){var r,o;return pr(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 r=i.sent(),[2,sr(sr({},r),{data:{copy_list:null===(o=r.data)||void 0===o?void 0:o.map((function(e){return{code:e.code||"SUCCESS",fileID:e.cloudObjectId,message:e.message}}))}})]}}))}))},Sr={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 Or(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 Sr[r]||"application/octet-stream"}function Tr(e,t){var n=t.toLowerCase();return Object.keys(e).some((function(e){return e.toLowerCase()===n}))}function Ar(e){return Object.keys(e).reduce((function(t,n){var r;return sr(sr({},t),((r={})[n]=[e[n]],r))}),{})}var Pr=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 lr(this,void 0,Promise,(function(){var n,r,o,i,a,s,c,u,l,p,d,h,f,m,v,g,y,b,x,w,_,I,E,S,O,T,A,P,R,C,N;return pr(this,(function(k){switch(k.label){case 0:if(n=e.cloudPath,r=e.filePath,o=e.onUploadProgress,R=e.method,i=void 0===R?"put":R,C=e.headers,a=void 0===C?{}:C,s=e.fileContent,!vr(n)||!r&&!s)throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".uploadFile] invalid params")}));return c={put:rr.put,post:rr.post}[i.toLocaleLowerCase()]||rr.put,u=this.isGateWay(),l=sr({},a),p=Object.keys(a).reduce((function(e,t){return"content-length"!==t.toLowerCase()&&(e[t]=a[t]),e}),{}),c===rr.put&&u&&(Tr(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=Un())||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)),Tr(l,"content-type")||(l["content-type"]=Or(r,n)),Tr(p,"content-type")||(p["content-type"]=Or(r,n))),[4,this.getUploadMetadata({cloudPath:n,method:c,headers:c!==rr.put||u?void 0:p,signedHeader:c===rr.put&&u?Ar(l):void 0,customReqOpts:e.customReqOpts})];case 1:return h=k.sent(),f=h.data,m=h.requestId,(null==(v=f)?void 0:v.code)||!(null==v?void 0:v.url)?(g=(null==v?void 0:v.code)||hr.OPERATION_FAIL,y=(null==v?void 0:v.message)||"get upload info failed",[2,yr(t,new Error("[".concat(dr(),"][").concat(g,"][").concat(xr,"]:").concat(y)))]):(b=f.url,x=f.authorization,w=f.token,_=f.fileId,I=f.cosFileId,E=f.download_url,O=sr(sr({},S={url:b,file:r,name:n,onUploadProgress:o,fileContent:s,fileId:_,requestId:m}),{method:rr.put,headers:sr(sr({},p),{authorization:x,"x-cos-meta-fileid":I,"x-cos-security-token":w})}),T=sr(sr({},S),{method:rr.post,data:{key:n,signature:x,"x-cos-meta-fileid":I,success_action_status:"201","x-cos-security-token":w}}),(N={})[rr.put]={params:O,isSuccess:function(e){return e>=200&&e<300}},N[rr.post]={params:T,isSuccess:function(e){return 201===e}},A=N,[4,this.request.upload(A[c].params)]);case 2:return P=k.sent(),A[c].isSuccess(P.statusCode)?[2,yr(t,null,{fileID:_,download_url:E,requestId:m})]:[2,yr(t,new Error("[".concat(dr(),"][").concat(hr.OPERATION_FAIL,"][").concat(xr,"]:").concat(P.data)))]}}))}))},e.prototype.getUploadMetadata=function(e,t){return lr(this,void 0,Promise,(function(){var n,r,o,i,a,s,c,u,l,p;return pr(this,(function(d){switch(d.label){case 0:if(n=e.cloudPath,r=e.method,o=e.headers,i=e.signedHeader,!vr(n))throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".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===rr.put&&(l&&i?u.signedHeader=i:!l&&o&&(u.headers=o)),l?[4,wr(a,u,e.customReqOpts)]:[3,3];case 2:return c=d.sent(),[3,5];case 3:return[4,a.send(s,u,e.customReqOpts)];case 4:c=d.sent(),d.label=5;case 5:return[2,yr(t,null,c)];case 6:return p=d.sent(),[2,yr(t,p)];case 7:return[2]}}))}))},e.prototype.deleteFile=function(e,t){return lr(this,void 0,Promise,(function(){var n,r,o,i,a,s,c,u;return pr(this,(function(l){switch(l.label){case 0:if(!(n=e.fileList)||!mr(n)||0===n.length)throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".deleteFile] fileList must not be empty")}));for(r=0,o=n;r<o.length;r++)if(!(i=o[r])||!vr(i))throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".deleteFile] fileID must be string")}));return a="storage.batchDeleteFile",s=this.request,c={},this.isGateWay()?[4,Ir(s,{fileList:n},e.customReqOpts)]:[3,2];case 1:return c=l.sent(),[3,4];case 2:return[4,s.send(a,{fileid_list:n},e.customReqOpts)];case 3:c=l.sent(),l.label=4;case 4:return c.code?[2,yr(t,null,c)]:(u={fileList:c.data.delete_list,requestId:c.requestId},[2,yr(t,null,u)])}}))}))},e.prototype.getTempFileURL=function(e,t){return lr(this,void 0,Promise,(function(){var n,r,o,i,a,s,c,u;return pr(this,(function(l){switch(l.label){case 0:if(!(n=e.fileList)||!mr(n)||0===n.length)throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".getTempFileURL] fileList must not be empty")}));for(r=[],o=0,i=n;o<i.length;o++)if(a=i[o],gr(a)){if(!Object.prototype.hasOwnProperty.call(a,"fileID"))throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".getTempFileURL] file info must include fileID")}));r.push({fileid:a.fileID,max_age:a.maxAge||7200})}else{if(!vr(a))throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".getTempFileURL] invalid fileList")}));r.push({fileid:a})}return s="storage.batchGetDownloadUrl",c=this.request,u={},this.isGateWay()?[4,_r(c,{convertedFileList:r},e.customReqOpts)]:[3,2];case 1:return u=l.sent(),[3,4];case 2:return[4,c.send(s,{file_list:r},e.customReqOpts)];case 3:u=l.sent(),l.label=4;case 4:return u.code?[2,yr(t,null,u)]:[2,yr(t,null,{fileList:u.data.download_list,requestId:u.requestId})]}}))}))},e.prototype.downloadFile=function(e,t){return lr(this,void 0,Promise,(function(){var n,r,o,i,a,s;return pr(this,(function(c){switch(c.label){case 0:if(n=e.fileID,!vr(n))throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".getTempFileURL] fileID must be string")}));return[4,this.getTempFileURL.call(this,{fileList:[{fileID:n,maxAge:600}],customReqOpts:e.customReqOpts})];case 1:return r=c.sent(),"SUCCESS"!==(o=r.fileList[0]).code?[2,yr(t,o)]:(i=this.request,a=encodeURI(o.download_url),[4,i.download({url:a,tempFilePath:e.tempFilePath})]);case 2:return s=c.sent(),[2,yr(t,null,s)]}}))}))},e.prototype.copyFile=function(e,t){return lr(this,void 0,Promise,(function(){var n,r,o,i,a,s,c,u,l;return pr(this,(function(p){switch(p.label){case 0:if(!(n=e.fileList)||!mr(n)||0===n.length)throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".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)throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".copyFile] srcPath and dstPath may not be empty")}));if(s===c)throw new Error(JSON.stringify({code:hr.INVALID_PARAMS,msg:"[".concat(xr,".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,Er(u,{convertedFileList:r},e.customReqOpts)]:[3,2];case 1:return l=p.sent(),[3,4];case 2:return[4,u.send("storage.batchCopyFile",{file_list:r},e.customReqOpts)];case 3:l=p.sent(),p.label=4;case 4:return l.code?[2,yr(t,null,l)]:[2,yr(t,null,{fileList:l.data.copy_list,requestId:l.requestId})]}}))}))},e.prototype.getFileInfo=function(e){var t;return lr(this,void 0,Promise,(function(){var n,r=this;return pr(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 lr(r,void 0,void 0,(function(){var t,n,r,o,i,a,s;return pr(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}]}}))}))},cr([br({customInfo:{className:"Cloudbase",methodName:"uploadFile"},title:"上传文件失败",messages:["请确认以下各项:"," 1 - 调用 uploadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(fr)]}),ur("design:type",Function),ur("design:paramtypes",[Object,"function"==typeof(t="undefined"!=typeof Function&&Function)?t:Object]),ur("design:returntype","function"==typeof(n="undefined"!=typeof Promise&&Promise)?n:Object)],e.prototype,"uploadFile",null),cr([br({customInfo:{className:"Cloudbase",methodName:"getUploadMetadata"},title:"获取上传元信息失败",messages:["请确认以下各项:"," 1 - 调用 getUploadMetadata() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(fr)]}),ur("design:type",Function),ur("design:paramtypes",[Object,"function"==typeof(r="undefined"!=typeof Function&&Function)?r:Object]),ur("design:returntype","function"==typeof(o="undefined"!=typeof Promise&&Promise)?o:Object)],e.prototype,"getUploadMetadata",null),cr([br({customInfo:{className:"Cloudbase",methodName:"deleteFile"},title:"删除文件失败",messages:["请确认以下各项:"," 1 - 调用 deleteFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(fr)]}),ur("design:type",Function),ur("design:paramtypes",["function"==typeof(i=void 0!==sn.ICloudbaseDeleteFileParams&&sn.ICloudbaseDeleteFileParams)?i:Object,"function"==typeof(a="undefined"!=typeof Function&&Function)?a:Object]),ur("design:returntype","function"==typeof(s="undefined"!=typeof Promise&&Promise)?s:Object)],e.prototype,"deleteFile",null),cr([br({customInfo:{className:"Cloudbase",methodName:"getTempFileURL"},title:"获取文件下载链接",messages:["请确认以下各项:"," 1 - 调用 getTempFileURL() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(fr)]}),ur("design:type",Function),ur("design:paramtypes",["function"==typeof(c=void 0!==sn.ICloudbaseGetTempFileURLParams&&sn.ICloudbaseGetTempFileURLParams)?c:Object,"function"==typeof(u="undefined"!=typeof Function&&Function)?u:Object]),ur("design:returntype","function"==typeof(l="undefined"!=typeof Promise&&Promise)?l:Object)],e.prototype,"getTempFileURL",null),cr([br({customInfo:{className:"Cloudbase",methodName:"downloadFile"},title:"下载文件失败",messages:["请确认以下各项:"," 1 - 调用 downloadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(fr)]}),ur("design:type",Function),ur("design:paramtypes",["function"==typeof(p=void 0!==sn.ICloudbaseDownloadFileParams&&sn.ICloudbaseDownloadFileParams)?p:Object,"function"==typeof(d="undefined"!=typeof Function&&Function)?d:Object]),ur("design:returntype","function"==typeof(h="undefined"!=typeof Promise&&Promise)?h:Object)],e.prototype,"downloadFile",null),cr([br({customInfo:{className:"Cloudbase",methodName:"copyFile"},title:"批量复制文件",messages:["请确认以下各项:"," 1 - 调用 copyFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(fr)]}),ur("design:type",Function),ur("design:paramtypes",["function"==typeof(f=void 0!==sn.ICloudbaseCopyFileParams&&sn.ICloudbaseCopyFileParams)?f:Object,"function"==typeof(m="undefined"!=typeof Function&&Function)?m:Object]),ur("design:returntype","function"==typeof(v="undefined"!=typeof Promise&&Promise)?v:Object)],e.prototype,"copyFile",null),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)},Cr=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())}))},Nr=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])}}},kr=r._G.Sg,Ur=function(){function e(e,t){void 0===t&&(t=!1),this.shouldThrowOnError=!1,this.bucketId="",this.context=e,this.shouldThrowOnError=t,this.storage=new Pr(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 Cr(this,void 0,Promise,(function(){var r,o,i,a,s,c,u,l,p;return Nr(this,(function(d){switch(d.label){case 0:r=Rr({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:kr.OPERATION_FAIL,msg:"[".concat(xr,".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(Cn(p))return[2,{data:null,error:p}];throw p;case 4:return[2]}}))}))},e.prototype.uploadToSignedUrl=function(e,t,n,r){return Cr(this,void 0,Promise,(function(){return Nr(this,(function(t){return[2,this.upload(e,n,r)]}))}))},e.prototype.createSignedUploadUrl=function(e){return Cr(this,void 0,Promise,(function(){var t,n,r;return Nr(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 Rn?r:new Rn(r.message)}];case 3:return[2]}}))}))},e.prototype.update=function(e,t,n){return Cr(this,void 0,Promise,(function(){return Nr(this,(function(r){return[2,this.upload(e,t,Rr(Rr({},n),{upsert:!0}))]}))}))},e.prototype.move=function(e,t){return Cr(this,void 0,Promise,(function(){var n,r;return Nr(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 Rn(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(Cn(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}}))}))},e.prototype.copy=function(e,t){return Cr(this,void 0,Promise,(function(){var n,r;return Nr(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 Rn(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(Cn(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}}))}))},e.prototype.createSignedUrl=function(e,t,n){return Cr(this,void 0,Promise,(function(){var r,o,i,a,s,c,u;return Nr(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 Rn("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(Cn(u))return[2,{data:null,error:u}];throw u;case 3:return[2]}}))}))},e.prototype.createSignedUrls=function(e,t){return Cr(this,void 0,Promise,(function(){var n,r,o=this;return Nr(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(Cn(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}}))}))},e.prototype.download=function(e,t){return Cr(this,void 0,Promise,(function(){var n,r,o=this;return Nr(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r={},[4,Cr(o,void 0,void 0,(function(){var n,r,o,i;return Nr(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 Rn("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(Cn(n))return[2,{data:null,error:n}];throw n;case 3:return[2]}}))}))},e.prototype.info=function(e){return Cr(this,void 0,Promise,(function(){var t,n,r,o,i,a,s,c;return Nr(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 Rn(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 Rn?c:new Rn(c.message)}];case 3:return[2]}}))}))},e.prototype.exists=function(e){return Cr(this,void 0,Promise,(function(){var t,n,r;return Nr(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 Rn(n.message);return[2,{data:!0,error:null}];case 2:if(r=o.sent(),this.shouldThrowOnError)throw r;if(Cn(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}}))}))},e.prototype.getPublicUrl=function(e,t){return Cr(this,void 0,Promise,(function(){var n;return Nr(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 Cr(this,void 0,Promise,(function(){var t,n,r,o,i,a,s,c,u,l,p=this;return Nr(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 Rn("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(Cn(l))return[2,{data:null,error:l}];throw l;case 4:return[2]}}))}))},e.prototype.list=function(){return Cr(this,void 0,void 0,(function(){return Nr(this,(function(e){throw new Rn("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 Rn("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 jn(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}(),jr=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)}}(),Lr=new Pr,Dr={name:xr,entity:{uploadFile:Lr.uploadFile,deleteFile:Lr.deleteFile,getTempFileURL:Lr.getTempFileURL,downloadFile:Lr.downloadFile,getUploadMetadata:Lr.getUploadMetadata,copyFile:Lr.copyFile,getFileInfo:Lr.getFileInfo,isGateWay:Lr.isGateWay}},qr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jr(t,e),t.prototype.from=function(e){return e?(nr(e,"from"),new er(this.http,e,this.shouldThrowOnError)):new Ur(this.http.ctx,this.shouldThrowOnError)},t}(ar),Mr={name:"".concat(xr,"/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 qr(n);return e.set(this,r),r},configurable:!0,enumerable:!0})}};try{cloudbase.registerComponent(Dr),cloudbase.registerComponent(Mr)}catch(e){}function Fr(e){try{e.registerComponent(Dr),e.registerComponent(Mr)}catch(e){console.warn(e)}}try{window.registerStorage=Fr}catch(e){}var Br=f(6765),Wr=f.n(Br),Vr=f(7195),Gr=f.n(Vr),Hr=f(9850),zr=f.n(Hr);function Kr(e){return void 0===e&&(e=""),"".concat(e?"".concat(e,"_"):"").concat(+new Date,"_").concat(Math.random())}var Jr,Yr=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}})},$r=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}})},Qr=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)}}(),Xr=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 Qr(t,e),t}(Error),Zr=function(e){return null==e?void 0:e.isRealtimeErrorMessageError},eo=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 Qr(t,e),t}(Error),to=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 Qr(t,e),t}(Error),no=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(ro[this.errCode]||""," | errMsg: ").concat(this.errMsg)},set:function(e){this.errMsg=e}}}),n.errCode=t.errCode||"UNKNOWN_ERROR",n.errMsg=t.errMsg,n}return Qr(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),ro={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"},oo=function(e){return void 0===e&&(e=0),new Promise((function(t){return setTimeout(t,e)}))},io=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())}))},ao=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])}}},so=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"}(Jr||(Jr={}));var co=function(){function e(e){var t=this;this.watchStatus=Jr.INITING,this.wsLogin=function(e,n){return io(t,void 0,Promise,(function(){var t;return ao(this,(function(r){switch(r.label){case 0:return this.watchStatus=Jr.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 io(t,void 0,Promise,(function(){var t,n=this;return ao(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){io(n,void 0,void 0,(function(){var n,o,i,a,s,c,u,l,p,d;return ao(this,(function(h){switch(h.label){case 0:return h.trys.push([0,3,,4]),this.watchStatus===Jr.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===Jr.PAUSED?(console.log("[realtime] initWatch cancelled on pause"),[2,t()]):(this.watchStatus=Jr.INITING,o={watchId:this.watchId,requestId:Kr(),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 $r({id:c,docChanges:[],docs:[],type:"init"}),this.listener.onChange(p),this.scheduleSendACK();return this.onWatchStart(this,this.sessionInfo.queryID),this.watchStatus=Jr.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 io(t,void 0,Promise,(function(){var t,n=this;return ao(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){io(n,void 0,void 0,(function(){var n,o,i,a;return ao(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),this.watchStatus===Jr.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===Jr.PAUSED?(console.log("[realtime] rebuildWatch cancelled on pause"),[2,t()]):(this.watchStatus=Jr.REBUILDING,o={watchId:this.watchId,requestId:Kr(),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=Jr.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 io(t,void 0,void 0,(function(){var t,r,o,i=this;return ao(this,(function(a){return t="INIT_WATCH"===n.operationName,r=function(){i.closeWithError(new no({errCode:t?ro.SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL:ro.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(){io(i,void 0,void 0,(function(){var e,t=this;return ao(this,(function(r){switch(r.label){case 0:return r.trys.push([0,8,,9]),e=function(){return io(t,void 0,void 0,(function(){return ao(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,oo(100)];case 3:return r.sent(),this.watchStatus!==Jr.PAUSED?[3,4]:(n.reject(new to("".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 io(t,void 0,void 0,(function(){var e,t,n;return ao(this,(function(r){switch(r.label){case 0:if(e=this.sessionInfo?this.sessionInfo.queryID:"",this.watchStatus!==Jr.ACTIVE)return this.watchStatus=Jr.CLOSED,this.onWatchClose(this,e),[2];r.label=1;case 1:return r.trys.push([1,3,4,5]),this.watchStatus=Jr.CLOSING,t={watchId:this.watchId,requestId:Kr(),msgType:"CLOSE_WATCH",msgData:null},[4,this.send({msg:t})];case 2:return r.sent(),this.sessionInfo=void 0,this.watchStatus=Jr.CLOSED,[3,5];case 3:return n=r.sent(),this.closeWithError(new no({errCode:ro.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 io(t,void 0,Promise,(function(){var e,t,n;return ao(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this.watchStatus!==Jr.ACTIVE?(this.scheduleSendACK(),[2]):this.sessionInfo?(e={watchId:this.watchId,requestId:Kr(),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(),Zr(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 no({errCode:ro.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 no({errCode:ro.SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL,errMsg:t})),[3,3];case 3:return[2]}}))}))},this.handleCommonError=function(e,t){if(Zr(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 Yr({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 Jr.PAUSED:if("ERROR"!==e.msgType)return;break;case Jr.LOGGINGIN:case Jr.INITING:case Jr.REBUILDING:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received while ".concat(this.watchStatus));case Jr.CLOSED:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received when the watch has closed");case Jr.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 no({errCode:ro.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=Jr.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=Jr.PAUSED,console.log("[realtime] client paused (".concat(this.collectionName," ").concat(this.query,") (watchId ").concat(this.watchId,")"))},e.prototype.resume=function(){return io(this,void 0,Promise,(function(){var e;return ao(this,(function(t){switch(t.label){case 0:this.watchStatus=Jr.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 io(this,void 0,void 0,(function(){var t;return ao(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 io(this,void 0,void 0,(function(){var t,n,r,o,i,a,s,c,u,l,p,d;return ao(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(uo)}catch(e){return this.closeWithError(new no({errCode:ro.SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA,errMsg:e})),[2]}a=so([],o.currentDocs,!0),s=!1,c=function(n,c){var l,p,d,h,f,m,v,g,y,b,x,w;return ao(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=zr()(p),l.updatedFields&&Object.keys(l.updatedFields).forEach((function(e){Wr()(d,e,l.updatedFields[e])})),l.removedFields)for(h=0,f=l.removedFields;h<f.length;h++)m=f[h],Gr()(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 g=new no({errCode:ro.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(g),g}break;case"replace":if(!l.doc)throw g=new no({errCode:ro.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="replace" (requestId '.concat(e.requestId,")")}),u.closeWithError(g),g;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 g=new no({errCode:ro.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(g),g}}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":y=a.findIndex((function(e){return e._id===l.docId})),y>-1?a.splice(y,1):console.error("[realtime listener] internal non-fatal server error: unexpected dequeue event where no doc is associated.");break;case"update":y=a.findIndex((function(e){return e._id===l.docId})),y>-1?a[y]=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=so([],a,!0),x=i.slice(0,n+1).filter((function(e){return e.id===l.id})),u.sessionInfo.currentEventId=l.id,u.sessionInfo.currentDocs=a,w=new $r({id:l.id,docChanges:x,docs:b,msgType:r}),u.listener.onChange(w)),[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,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 uo(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 lo,po={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"}(lo||(lo={}));var ho=function(e,t){var n=po[e],r=n?"".concat(n.name,", code ").concat(e,", reason ").concat(t||n.description):"code ".concat(e);return new no({errCode:ro.SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED,errMsg:r})},fo=null,mo="web";function vo(){return fo}function go(){return mo}function yo(e){mo=e}var bo=function(){return bo=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},bo.apply(this,arguments)},xo=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())}))},wo=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(){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 xo(t,void 0,Promise,(function(){var t=this;return wo(this,(function(n){return[2,new Promise((function(n,r){xo(t,void 0,void 0,(function(){var t,o,i,a,s,c,u,l,p=this;return wo(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(){xo(p,void 0,void 0,(function(){return wo(this,(function(e){switch(e.label){case 0:return o&&i?[3,2]:[4,oo(0)];case 1:e.sent(),o&&i||s(new eo("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),xo(t,void 0,Promise,(function(){var t=this;return wo(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(lo.ReconnectWebSocket),this.wsInitPromise=new Promise((function(r,o){xo(t,void 0,void 0,(function(){var t,i,a=this;return wo(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=vo();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,oo(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 no({errCode:ro.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 no({errCode:ro.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 lo.ReconnectWebSocket:case lo.NoRealtimeListeners:break;case lo.HeartbeatPingError:case lo.HeartbeatPongTimeoutError:case lo.NormalClosure:case lo.AbnormalClosure:t.maxReconnect>0?t.initWebSocketConnection(!0,t.maxReconnect):t.closeAllClients(ho(e.code));break;case lo.NoAuthentication:t.closeAllClients(ho(e.code,e.reason));break;default:t.maxReconnect>0?t.initWebSocketConnection(!0,t.maxReconnect):t.closeAllClients(ho(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 Xr(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 xo(t,void 0,Promise,(function(){var e=this;return wo(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 xo(t,void 0,Promise,(function(){var t,r,o,i,a,s,c,u,l=this;return wo(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){xo(l,void 0,void 0,(function(){var n,r,o,i,a;return wo(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:Kr(),msgType:"LOGIN",msgData:r,exMsgData:{runtime:go(),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 xo(t,void 0,Promise,(function(){var e,t,n,r,o,i,a;return wo(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:go()})]);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 xo(t,void 0,void 0,(function(){var e;return wo(this,(function(t){switch(t.label){case 0:return e={watchId:void 0,requestId:Kr(),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(lo.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,po[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 co(bo(bo({},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(){xo(t,void 0,void 0,(function(){var e=this;return wo(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(lo.HeartbeatPingError),[3,3];case 3:return[2]}}))}))}),e?0:this.context.appConfig.realtimePingInterval)},e}(),Io={target:"database",entity:function(){var e,t=this.platform,n=t.adapter,r=t.runtime;e=n.wsClass,fo=e,yo(r)}},Eo={name:"realtime",IIFE:!0,entity:function(){this.prototype.wsClientClass=_o}};try{cloudbase.registerComponent(Eo),cloudbase.registerHook(Io)}catch(e){}const So=(e=>{var t={};return f.d(t,e),t})({generateHTTPClient:()=>c.generateHTTPClient,generateMySQLClient:()=>c.generateMySQLClient,generatePGClient:()=>c.generatePGClient});var Oo=function(){return Oo=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},Oo.apply(this,arguments)},To=r.U3.yE,Ao="models",Po=new WeakMap;function Ro(e){return new Proxy({},{get:function(t,n){var r=e.getEndPointWithKey("GATEWAY"),o=r.BASE_URL,i=r.PROTOCOL,a=Oo(Oo({},e),{BASE_URL:o,PROTOCOL:i}),s=Po.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,So.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(Oo(Oo({},e),{headers:Oo({"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),Po.set(a,s)),s[n]}})}var Co="cloudbase_init",No=new To;No.on(Co,(function(e){var t=e.data;Object.assign(t,{models:Ro(t)})}));var ko={name:Ao,namespace:Ao,entity:new Proxy({},{get:function(e,t){console.warn("【deprecated】Accessing Cloudbase.prototype.models.".concat(t,"."))}}),injectEvents:{bus:No,events:[Co]}};try{cloudbase.registerComponent(ko)}catch(e){}function Uo(e){try{e.registerComponent(ko)}catch(e){console.warn(e)}}try{window.registerModel=Uo}catch(e){}var jo=f(3408);const Lo=(e=>{var t={};return f.d(t,e),t})({createReadableStreamWrapper:()=>u.createReadableStreamWrapper});var Do=[239,187,191];const qo=(e=>{var t={};return f.d(t,e),t})({TextDecoder:()=>l.TextDecoder});var 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())}))},Fo=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])}}},Bo=jo.ReadableStream,Wo=jo.TransformStream,Vo=function(){var e;return new Wo({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 Do.every((function(t,n){return e.charCodeAt(n)===t}))}(n)&&(n=n.slice(Do.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)}})},Go=(0,Lo.createReadableStreamWrapper)(Bo),Ho=function(){function e(e,t){void 0===e&&(e="utf-8"),void 0===t&&(t={});var n=this;this.transform=new Wo({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 qo.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 zo(e){var t=e;return t[Symbol.asyncIterator]=function(){var t=e.getReader();return{next:function(){return Mo(this,void 0,Promise,(function(){var e,n,r;return Fo(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 Ko(e){return zo(e.pipeThrough(new Ho).pipeThrough(Vo()).pipeThrough(new Wo({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 Jo(e){var t,n,r,o;return Mo(this,void 0,void 0,(function(){var i,a,s,c,u,l;return Fo(this,(function(p){switch(p.label){case 0:i=function(e){return zo(Go(e).pipeThrough(new Ho))}(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 Yo(){var e,t;return{promise:new Promise((function(n,r){e=n,t=r})),res:e,rej:t}}function $o(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 Qo=function(){return Qo=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},Qo.apply(this,arguments)},Xo=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())}))},Zo=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])}}},ei=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},ti=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=ei(t,["headers"]);return e(Qo(Qo({},i),{headers:Qo(Qo({},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 Xo(this,void 0,void 0,(function(){return Zo(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=ei(e,["botId"]);return Xo(this,void 0,void 0,(function(){return Zo(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=ei(e,["pageSize","pageNumber","botId"]);return Xo(this,void 0,void 0,(function(){var e,n;return Zo(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:Qo(Qo({},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=ei(e,["botId","conversationId"]);return Xo(this,void 0,void 0,(function(){return Zo(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 Xo(this,void 0,void 0,(function(){return Zo(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 Xo(this,void 0,void 0,(function(){return Zo(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 Xo(this,void 0,void 0,(function(){return Zo(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 Xo(this,void 0,void 0,(function(){var n;return Zo(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 ni(n)]}}))}))},e.prototype.generateBot=function(e,t){return Xo(this,void 0,void 0,(function(){var n;return Zo(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 ni(n)]}}))}))},e.prototype.getPreview=function(e,t){return Xo(this,void 0,void 0,(function(){var n;return Zo(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 ni(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 Xo(this,void 0,void 0,(function(){var n;return Zo(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 ni(n)]}}))}))},e.prototype.join=function(e){return"".concat(this.baseUrl,"/").concat(e)},e}(),ni=function(){function e(e){var t=Go(e);this._eventSourceStream=t.pipeThrough(new Ho).pipeThrough(Vo())}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 zo(this.teeedStream)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataStream",{get:function(){return zo(this.eventSourceStream.pipeThrough(new Wo({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 zo(this.dataStream.pipeThrough(new Wo({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}(),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)},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())}))},ii=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 ai(e){var t=e.messages,n=e.model,r=e.temperature,o=e.tool_choice,i=e.tools,a=e.top_p;return ri(ri({},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 si=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 oi(this,void 0,Promise,(function(){var n,r;return ii(this,(function(o){switch(o.label){case 0:return n=ai(e),[4,this.req({url:this.url,data:ri(ri({},n),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return r=o.sent(),[2,ri(ri({},r),{rawResponse:r})]}}))}))},e.prototype.doStream=function(e,t){return oi(this,void 0,Promise,(function(){var n,r,o,i;return ii(this,(function(a){switch(a.label){case 0:return n=ai(e),r=null,[4,this.req({url:this.url,data:ri(ri({},n),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return o=a.sent(),i=Go(o),[2,zo(Ko(i).pipeThrough(new Wo({transform:function(e,t){var n=e.choices.map((function(e){var t=e.delta;return null==r&&(r=$o(t)),r?ri(ri({},e),{finish_reason:"tool_calls",delta:t}):e})),o=ri(ri({},e),{choices:n});t.enqueue(ri(ri({},o),{rawResponse:e}))}})))]}}))}))},e}(),ci=function(){return ci=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},ci.apply(this,arguments)};function ui(e){var t=e.messages,n=e.model,r=e.temperature,o=e.tool_choice,i=e.tools,a=e.top_p;return ci(ci({},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 li(e){return"object"!=typeof e||null==e?e:Array.isArray(e)?e.map((function(e){return li(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?li(o):o,e}),{})}var 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)},di=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())}))},hi=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])}}},fi=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 di(this,void 0,Promise,(function(){var n;return hi(this,(function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:pi(pi({},ui(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 di(this,void 0,Promise,(function(){var n,r,o;return hi(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:pi(pi({},ui(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=Go(r),[2,zo(Ko(o).pipeThrough(new Wo({transform:function(e,t){var r=e.choices.map((function(e){var t=e.delta;return null==n&&(n=$o(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}(),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)},vi=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())}))},gi=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])}}},yi=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 vi(this,void 0,Promise,(function(){var n,r;return gi(this,(function(o){switch(o.label){case 0:return[4,this.req({url:this.url,headers:{"X-Tc-Action":"ChatCompletions"},data:mi(mi({},ui(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=o.sent(),r=li(n.Response),[2,mi(mi({},r),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return vi(this,void 0,Promise,(function(){var n,r,o;return gi(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,headers:{"X-Tc-Action":"ChatCompletions"},data:mi(mi({},e),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=Go(r),[2,zo(Ko(o).pipeThrough(new Wo({transform:function(e,t){var r=li(e),o=r.choices.map((function(e){var t=e.delta;return null==n&&(n=$o(t)),n?mi(mi({},e),{finish_reason:"tool_calls",delta:t}):e})),i=mi(mi({},r),{choices:o});t.enqueue(mi(mi({},i),{rawResponse:e}))}})))]}}))}))},e}(),bi=function(){return bi=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},bi.apply(this,arguments)},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())}))},wi=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};function _i(e){var t=e.messages,n=e.model,r=e.temperature,o=e.tools,i=e.top_p;return bi(bi({},e),{messages:t,model:n,tools:o,top_p:i,temperature:r})}var Ii=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 xi(this,void 0,Promise,(function(){var n;return wi(this,(function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:bi(bi({},_i(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,bi(bi({},n),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return xi(this,void 0,Promise,(function(){var n,r,o;return wi(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:bi(bi({},_i(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=Go(r),[2,zo(Ko(o).pipeThrough(new Wo({transform:function(e,t){var r=e.choices.map((function(e){var t=e.delta;return null==n&&(n=$o(t)),n?bi(bi({},e),{finish_reason:"tool_calls",delta:t}):e})),o=bi(bi({},e),{choices:r});t.enqueue(bi(bi({},o),{rawResponse:e}))}})))]}}))}))},e}(),Ei=function(){return Ei=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},Ei.apply(this,arguments)},Si=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())}))},Oi=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 Ti(e){var t=e.messages,n=e.model,r=e.temperature,o=e.tools,i=e.top_p;return Ei(Ei({},e),{messages:t,model:n,tools:o,top_p:i,temperature:r})}var Ai=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 Si(this,void 0,Promise,(function(){var n;return Oi(this,(function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:Ei(Ei({},Ti(e)),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,Ei(Ei({},n),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return Si(this,void 0,Promise,(function(){var n,r,o;return Oi(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:Ei(Ei({},Ti(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=Go(r),[2,zo(Ko(o).pipeThrough(new Wo({transform:function(e,t){var r=e.choices.map((function(e){var t=Object.assign(e.delta,{role:"assistant"});return null==n&&(n=$o(t)),Ei(Ei({},e),n?{finish_reason:"tool_calls",delta:t}:{delta:t})})),o=Ei(Ei({},e),{choices:r});t.enqueue(Ei(Ei({},o),{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="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 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,i,a;return Ci(this,(function(s){switch(s.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=s.sent(),o=Go(r),i=Ko(o),a=i.pipeThrough(new Wo({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=$o(t)),Pi(Pi({},e),n?{finish_reason:"tool_calls",delta:t}:{delta:t})})),l=Pi(Pi({},e),{choices:u});t.enqueue(Pi(Pi({},l),{rawResponse:e}))}}})),[2,zo(a)]}}))}))},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="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 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=Go(r),[2,zo(Ko(o).pipeThrough(new Wo({transform:function(e,t){var r=e.choices.map((function(e){var t=e.delta;return null==n&&(n=$o(t)),n?Ui(Ui({},e),{finish_reason:"tool_calls",delta:t}):e})),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])}}},Wi=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 Fi(this,void 0,Promise,(function(){var t;return Bi(this,(function(n){switch(n.label){case 0:return[4,this.req({url:this.url,data:Mi(Mi({},ui(e)),{stream:!1}),stream:!1})];case 1:return t=n.sent(),[2,Mi(Mi({},t),{rawResponse:t})]}}))}))},e.prototype.doStream=function(e){return Fi(this,void 0,Promise,(function(){var t,n,r;return Bi(this,(function(o){switch(o.label){case 0:return t=null,[4,this.req({url:this.url,data:Mi(Mi({},ui(e)),{stream:!0}),stream:!0})];case 1:return n=o.sent(),r=Go(n),[2,zo(Ko(r).pipeThrough(new Wo({transform:function(e,n){var r=e.choices.map((function(e){var n=e.delta;return null==t&&(t=$o(n)),t?Mi(Mi({},e),{finish_reason:"tool_calls",delta:n}):e})),o=Mi(Mi({},e),{choices:r});n.enqueue(Mi(Mi({},o),{rawResponse:e}))}})))]}}))}))},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)},Gi=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())}))},Hi=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])}}},zi=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 Gi(this,void 0,Promise,(function(){var n;return Hi(this,(function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:Vi(Vi({},ui(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 Gi(this,void 0,Promise,(function(){var n,r,o;return Hi(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:Vi(Vi({},ui(e)),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=Go(r),[2,zo(Ko(o).pipeThrough(new Wo({transform:function(e,t){var r=e.choices.map((function(e){var t=e.delta;return null==n&&(n=$o(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}(),Ki=function(){return Ki=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},Ki.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())}))},Yi=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},$i=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 Ji(this,void 0,Promise,(function(){var n;return Yi(this,(function(r){switch(r.label){case 0:return[4,this.req({url:this.url,data:Ki(Ki({},e),{stream:!1}),stream:!1,timeout:null==t?void 0:t.timeout})];case 1:return n=r.sent(),[2,Ki(Ki({},n),{rawResponse:n})]}}))}))},e.prototype.doStream=function(e,t){return Ji(this,void 0,Promise,(function(){var n,r,o;return Yi(this,(function(i){switch(i.label){case 0:return n=null,[4,this.req({url:this.url,data:Ki(Ki({},e),{stream:!0}),stream:!0,timeout:null==t?void 0:t.timeout})];case 1:return r=i.sent(),o=Go(r),[2,zo(Ko(o).pipeThrough(new Wo({transform:function(e,t){var r=e.choices.map((function(e){var t=e.delta;return null==n&&(n=$o(t)),n?Ki(Ki({},e),{finish_reason:"tool_calls",delta:t}):e})),o=Ki(Ki({},e),{choices:r});t.enqueue(Ki(Ki({},o),{rawResponse:e}))}})))]}}))}))},e}(),Qi=function(){return Qi=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},Qi.apply(this,arguments)},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())}))},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])}}},ea=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 Xi(this,void 0,Promise,(function(){var t;return Zi(this,(function(n){switch(n.label){case 0:return[4,this.req({url:this.url,data:Qi(Qi({},e),{stream:!1}),stream:!1})];case 1:return t=n.sent(),[2,Qi(Qi({},t),{rawResponse:t})]}}))}))},e.prototype.doStream=function(e){return Xi(this,void 0,Promise,(function(){var t,n,r;return Zi(this,(function(o){switch(o.label){case 0:return t=null,[4,this.req({url:this.url,data:Qi(Qi({},e),{stream:!0}),stream:!0})];case 1:return n=o.sent(),r=Go(n),[2,zo(Ko(r).pipeThrough(new Wo({transform:function(e,n){var r=e.choices.map((function(e){var n=e.delta;return null==t&&(t=$o(n)),t?Qi(Qi({},e),{finish_reason:"tool_calls",delta:n}):e})),o=Qi(Qi({},e),{choices:r});n.enqueue(Qi(Qi({},o),{rawResponse:e}))}})))]}}))}))},e}(),ta=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;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:return t=this.defaultGenerateImageSubUrl,"object"==typeof e&&e&&"model"in e&&"string"==typeof e.model&&(n=this.getGenerateImageSubUrl(this.provider,e.model))&&(t=n),[4,this.req({url:this.getGenerateUrl(t),data:e,stream:!1})];case 1:return[2,r.sent()]}}))},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}(),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)},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=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 aa(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},na(na({},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 sa=function(){function e(e){this.model=e}return e.prototype.generateText=function(e,t){var n,r;return ra(this,void 0,Promise,(function(){var o,i,a,s,c,u,l,p,d,h,f,m,v,g,y,b,x,w,_,I,E,S=this;return oa(this,(function(O){switch(O.label){case 0:return o=[],i={completion_tokens:0,prompt_tokens:0,total_tokens:0},a=aa(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=ca(h))))return[3,9];v=da(h.usage),ha(i,v),O.label=3;case 3:return O.trys.push([3,7,,8]),[4,pa(m)];case 4:return g=O.sent(),y=h.choices[0],[4,null==c?void 0:c({finishReason:y.finish_reason,messages:p.messages.slice(),text:y.message.content,toolCall:m,toolResult:g,stepUsage:v,totalUsage:Object.assign({},i)})];case 5:return O.sent(),ua(p.messages,y.message,g),[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 x=null===(n=null==h?void 0:h.choices)||void 0===n?void 0:n[0],w=null==x?void 0:x.message,_=null!==(r=null==w?void 0:w.content)&&void 0!==r?r:"",I=w?ia(ia([],p.messages,!0),[w],!1):p.messages,E=da(h.usage),ha(i,E),[4,null==c?void 0:c({finishReason:x.finish_reason,messages:I.slice(),text:_,toolCall:ca(h),toolResult:null,stepUsage:E,totalUsage:Object.assign({},i)})];case 10:return O.sent(),[2,{text:_,messages:I,usage:i,rawResponses:o}]}}))}))},e.prototype.streamText=function(e,t){var n;return ra(this,void 0,Promise,(function(){var r,o,i,a,s,c,u,l,p,d,h,f,m,v,g,y,b,x,w,_,I,E,S,O,T,A,P,R,C,N,k,U,j,L,D,q,M=this;return oa(this,(function(F){switch(F.label){case 0:return r={completion_tokens:0,prompt_tokens:0,total_tokens:0},o=aa(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,h=null,f=function(){var e=p.tee(),t=e[0],n=e[1];return p=zo(t),function(e){var t,n,r,o,i,a,s,c,u,l;return ra(this,void 0,Promise,(function(){var p,d,h,f,m,v,g,y,b,x,w,_,I;return oa(this,(function(E){switch(E.label){case 0:p={completion_tokens:0,prompt_tokens:0,total_tokens:0},d=zo(e),f={role:"assistant",content:"",tool_calls:[h={id:"",function:{name:"",arguments:""},type:""}]},E.label=1;case 1:E.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),E.label=2;case 2:return[4,v.next()];case 3:if(g=E.sent(),t=g.done)return[3,5];o=g.value,m=!1;try{if(!(b=null==(y=o)?void 0:y.choices[0]))return[2,null];if(x=b.finish_reason,w=b.delta,"tool_calls"!==x)return[2,null];if(!w)return[3,4];if(w.content&&(f.content+=w.content),!("tool_calls"in w))return[3,4];(null==(_=null===(i=null==w?void 0:w.tool_calls)||void 0===i?void 0:i[0])?void 0:_.id)&&(h.id=_.id),(null==_?void 0:_.type)&&(h.type=_.type),(null===(a=null==_?void 0:_.function)||void 0===a?void 0:a.name)&&(h.function.name=_.function.name),(null===(s=null==_?void 0:_.function)||void 0===s?void 0:s.arguments)&&(h.function.arguments+=_.function.arguments),(null===(c=null==y?void 0:y.usage)||void 0===c?void 0:c.completion_tokens)&&(p.completion_tokens=y.usage.completion_tokens),(null===(u=null==y?void 0:y.usage)||void 0===u?void 0:u.prompt_tokens)&&(p.prompt_tokens=y.usage.prompt_tokens),(null===(l=null==y?void 0:y.usage)||void 0===l?void 0:l.total_tokens)&&(p.total_tokens=y.usage.total_tokens)}finally{m=!0}E.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return I=E.sent(),n={error:I},[3,12];case 7:return E.trys.push([7,,10,11]),m||t||!(r=v.return)?[3,9]:[4,r.call(v)];case 8:E.sent(),E.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)},F.label=2;case 2:return(m=d<c)?[4,f()]:[3,4];case 3:m=null!=(h=F.sent()),F.label=4;case 4:if(!m)return[3,11];v=h.message,g=h.usage,ha(r,g),y=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,pa(y)];case 6:return b=F.sent(),[4,null==a?void 0:a({finishReason:"tool_calls",messages:u.messages.slice(),text:v.content,toolCall:y,toolResult:b,stepUsage:g,totalUsage:Object.assign({},r)})];case 7:return F.sent(),ua(u.messages,v,b),[4,l()];case 8:return p=F.sent(),[3,10];case 9:return x=F.sent(),w=p.tee(),_=w[0],I=w[1],[2,{messages:Promise.resolve(u.messages),dataStream:zo(_),textStream:zo(I.pipeThrough(new Wo({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:x}];case 10:return[3,2];case 11:return[4,f()];case 12:return(h=F.sent())?(E=h.message,S=h.usage,ha(r,S),O=ia(ia([],u.messages,!0),[E],!1),a({messages:O.slice(),finishReason:"tool_call",stepUsage:S,text:E.content,toolCall:E.tool_calls[0],totalUsage:Object.assign({},r)}),T=p.tee(),A=T[0],P=T[1],[2,{messages:Promise.resolve(ia(ia([],u.messages,!0),[E],!1)),dataStream:zo(A),textStream:zo(P.pipeThrough(new Wo({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=Yo(),C=Yo(),N={role:"assistant",content:""},k="",U={completion_tokens:0,prompt_tokens:0,total_tokens:0},j=p.pipeThrough(new Wo({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(ia(ia([],u.messages,!0),[N],!1)),ha(r,U),C.res(Object.assign({},r)),null==a||a({messages:ia(ia([],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:zo(D),textStream:zo(q.pipeThrough(new Wo({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 ca(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&&$o(o)?o.tool_calls[0]:null}function ua(e,t,n){e.push(t,{role:"tool",tool_call_id:t.tool_calls[0].id,content:JSON.stringify(n)})}var la=new Map;function pa(e){return la.get(e.function.name)(JSON.parse(e.function.arguments))}function da(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 ha(e,t){e.completion_tokens+=t.completion_tokens,e.prompt_tokens+=t.prompt_tokens,e.total_tokens+=t.total_tokens}var fa={hunyuan:yi,"hunyuan-beta":fi,ark:Ii,dashscope:Ai,"01-ai":ki,moonshot:qi,zhipu:si,"hunyuan-exp":Wi,"hunyuan-open":zi,deepseek:$i},ma=function(){return ma=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},ma.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())}))},ga=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=fa,ba=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 va(i,void 0,void 0,(function(){var e,i,s,c,u,l,p;return ga(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:ma(ma((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 va(i,void 0,void 0,(function(){var e,r,i,u,l,p,d,h,f;return ga(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:ma(ma((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 ti(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 va(this,void 0,void 0,(function(){var o,i,a,s,c=this;return ga(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: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,Jo(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=ya[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 ea(this.modelRequest,this.aiBaseUrl,"".concat(e).concat(o))}return new sa(n)},e.prototype.registerModel=function(e,t){null==ya[e]?ya[e]=t:console.warn("AI model ".concat(e," already exists!"))},e.prototype.createImageModel=function(e){return new ta(this.modelRequest,this.aiBaseUrl,e)},e.prototype.registerFunctionTool=function(e){la.has(e.name)&&console.warn("AI function tool ".concat(e.name," already exists and will be overwritten!")),la.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}(),xa=function(){return xa=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},xa.apply(this,arguments)},wa=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},_a=(wa(t,["MODELS"]),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=wa(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(xa({headers:xa({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}}});function Ia(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 ba(function(){if(null==a){if(null==i)throw new Error("`getAccessToken` is required when `handleReqInstance` is not provided!");return _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)}var Ea={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)?Ia({req:n,baseUrl:e.baseUrl,handleReqInstance:function(e){return e.req},i18n:this.config.i18n}):Ia({req:n,baseUrl:r(),getBaseUrl:r,handleReqInstance:function(e){return e.req},i18n:this.config.i18n})}}};function Sa(e){try{e.registerComponent(Ea)}catch(e){console.warn(e)}}try{window.registerAi=Sa}catch(e){}var Oa=function(){return Oa=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},Oa.apply(this,arguments)};function Ta(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;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(v){switch(v.label){case 0:return r={},n.headers instanceof Headers?n.headers.forEach((function(e,t){r[t]=e})):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(Oa(Oa({url:i},n),{headers:Oa({"Content-Type":"application/json"},r),shouldThrowOnError:!1}))];case 1:d=v.sent(),f={},v.label=2;case 2:return v.trys.push([2,4,,5]),[4,d.data];case 3:return f=v.sent(),[3,5];case 4:if(!(m=v.sent()).message.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: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,So.generatePGClient)(e,{pgBaseUrl:m,fetch:f}):(0,So.generateMySQLClient)(e,{mysqlBaseUrl:m,fetch:f})}var Aa={name:"mysql",entity:{mysql:function(e){return Ta(this,e,!1)(e)}}},Pa={name:"rdb",entity:{rdb:function(e){return Ta(this,e,!0)(e)}}};try{cloudbase.registerComponent(Aa),cloudbase.registerComponent(Pa)}catch(e){}function Ra(e){try{e.registerComponent(Aa),e.registerComponent(Pa)}catch(e){console.warn(e)}}try{window.registerMySQL=Ra}catch(e){}var Ca=function(){return Ca=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},Ca.apply(this,arguments)},Na=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])}}};function Ua(e,t){var n,r,o,i;return Na(this,void 0,Promise,(function(){var a,s,c,u,l,p,d,h,f,m,v,g,y,b,x,w,_,I,E,S,O,T,A;return ka(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:At.ERRORS.INVALID_PARAMS,msg:"[apis] invalid api name"}));return g="",b=(y=this).gatewayOrigin,x=y.getAccessToken,w=y.env,b?g="".concat(b,"/v1"):this.getEndPointWithKey?(_=this.getEndPointWithKey("GATEWAY"),I=_.BASE_URL,E=_.PROTOCOL,g="".concat(E).concat(I)):g="https://".concat(w,".api.tcloudbasegateway.com/v1"),S="".concat(g,"/apis/").concat(s),O=l.startsWith("/")?l:"/".concat(l),x?[4,x()]:[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(Ca(Ca(Ca({url:"".concat(S).concat(O),method:d||"POST",headers:Ca({"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 ja=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH","REQUEST"];function La(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(!ja.includes(o))throw new Error("[apis] invalid method: ".concat(r));return function(n,r){return Na(t,void 0,void 0,(function(){return ka(this,(function(t){switch(t.label){case 0:return[4,Ua.call(this,Ca({name:e,method:("REQUEST"===o?n.method:o)||"POST"},n),r)];case 1:return[2,t.sent()]}}))}))}}})}function Da(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 La.call(t,n)}})}var qa,Ma,Fa="apis",Ba={name:Fa,IIFE:!0,entity:function(){Object.defineProperty(this.prototype,Fa,{get:function(){return Da.call(this)},configurable:!0,enumerable:!0})}};function Wa(e){try{e.registerComponent(Ba)}catch(e){console.warn(e)}}try{cloudbase.registerComponent(Ba)}catch(e){}try{window.registerApis=Wa}catch(e){}!function(e){e.DocIDError="文档ID不合法",e.CollNameError="集合名称不合法",e.OpStrError="操作符不合法",e.DirectionError="排序字符不合法",e.IntergerError="must be integer",e.QueryParamTypeError="查询参数必须为对象",e.QueryParamValueError="查询参数对象值不能均为undefined"}(Ma||(Ma={}));var Va,Ga,Ha="Object",za="GeoPoint",Ka="GeoLineString",Ja="GeoPolygon",Ya="GeoMultiPoint",$a="GeoMultiLineString",Qa="GeoMultiPolygon",Xa="Date",Za="ServerDate",es=["desc","asc"],ts=["<","<=","==",">=",">"];!function(e){e.lt="<",e.gt=">",e.lte="<=",e.gte=">=",e.eq="=="}(Va||(Va={})),(qa={})[Va.eq]="$eq",qa[Va.lt]="$lt",qa[Va.lte]="$lte",qa[Va.gt]="$gt",qa[Va.gte]="$gte",function(e){e.WHERE="WHERE",e.DOC="DOC"}(Ga||(Ga={}));var ns=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)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)}}(),rs=[],os={},is=function(e){function t(t,n){if(n!==os)throw new TypeError("InternalSymbol cannot be constructed with new operator");return e.call(this,t)||this}return ns(t,e),t.for=function(e){for(var n=0,r=rs.length;n<r;n++)if(rs[n].target===e)return rs[n].instance;var o=new t(e,os);return rs.push({target:e,instance:o}),o},t}((function(e){Object.defineProperties(this,{target:{enumerable:!1,writable:!1,configurable:!1,value:e}})}));const as=is;var ss=as.for("UNSET_FIELD_NAME"),cs=as.for("UPDATE_COMMAND"),us=as.for("QUERY_COMMAND"),ls=as.for("LOGIC_COMMAND"),ps=as.for("GEO_POINT"),ds=as.for("SYMBOL_GEO_LINE_STRING"),hs=as.for("SYMBOL_GEO_POLYGON"),fs=as.for("SYMBOL_GEO_MULTI_POINT"),ms=as.for("SYMBOL_GEO_MULTI_LINE_STRING"),vs=as.for("SYMBOL_GEO_MULTI_POLYGON"),gs=as.for("SERVER_DATE"),ys=as.for("REGEXP"),bs=function(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()},xs=function(e){return"object"===bs(e)},ws=function(e){return"number"===bs(e)},_s=function(e){return Array.isArray(e)},Is=function(e){return"date"===bs(e)},Es=function(e){return"regexp"===bs(e)},Ss=function(e){return e&&e._internalType instanceof is},Os=function(){function e(e){if(!_s(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 Fs))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||!_s(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(!ws(i[0])||!ws(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 ds},enumerable:!1,configurable:!0}),e}(),Ts=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.")},As=function(){function e(e){if(!_s(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 Os))throw new TypeError('"lines" must be of type LineString[]. Received type '.concat(typeof e,"[]"));if(!Os.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||!_s(e.coordinates))return!1;try{for(var i=Ts(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,Ts(s)),u=c.next();!u.done;u=c.next()){var l=u.value;if(!ws(l[0])||!ws(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 vs},enumerable:!1,configurable:!0}),e}(),Ps=function(){function e(e){if(!_s(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 Fs))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||!_s(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(!ws(i[0])||!ws(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 fs},enumerable:!1,configurable:!0}),e}(),Rs=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.")},Cs=function(){function e(e){if(!_s(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 Os))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||!_s(e.coordinates))return!1;try{for(var i=Rs(e.coordinates),a=i.next();!a.done;a=i.next()){var s=a.value;try{for(var c=(r=void 0,Rs(s)),u=c.next();!u.done;u=c.next()){var l=u.value;if(!ws(l[0])||!ws(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 ms},enumerable:!1,configurable:!0}),e}(),Ns=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.")},ks=function(){function e(e){var t,n;if(!_s(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=Ns(e),o=r.next();!o.done;o=r.next()){var i=o.value;if(!(i instanceof As))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||!_s(e.coordinates))return!1;try{for(var s=Ns(e.coordinates),c=s.next();!c.done;c=s.next()){var u=c.value;try{for(var l=(r=void 0,Ns(u)),p=l.next();!p.done;p=l.next()){var d=p.value;try{for(var h=(i=void 0,Ns(d)),f=h.next();!f.done;f=h.next()){var m=f.value;if(!ws(m[0])||!ws(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 hs},enumerable:!1,configurable:!0}),e}(),Us=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 gs},enumerable:!1,configurable:!0}),e.prototype.parse=function(){return{$date:{offset:this.offset}}},e}();function js(e){return new Us(e)}var Ls,Ds=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},qs=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 za:o=new Fs(i.coordinates[0],i.coordinates[1]);break;case Ka:o=new Os(i.coordinates.map((function(e){return new Fs(e[0],e[1])})));break;case Ja:o=new As(i.coordinates.map((function(e){return new Os(e.map((function(e){var t=Ds(e,2),n=t[0],r=t[1];return new Fs(n,r)})))})));break;case Ya:o=new Ps(i.coordinates.map((function(e){return new Fs(e[0],e[1])})));break;case $a:o=new Cs(i.coordinates.map((function(e){return new Os(e.map((function(e){var t=Ds(e,2),n=t[0],r=t[1];return new Fs(n,r)})))})));break;case Qa:o=new ks(i.coordinates.map((function(e){return new As(e.map((function(e){return new Os(e.map((function(e){var t=Ds(e,2),n=t[0],r=t[1];return new Fs(n,r)})))})))})));break;case Xa:o=new Date(1e3*i.$timestamp);break;case Ha:case"Array":o=e.formatField(i);break;case Za:o=new Date(i.$date);break;default:o=i}Array.isArray(r)?r.push(o):r[n]=o})),r},e.whichType=function(e){var t=Object.prototype.toString.call(e).slice(8,-1);if(t===Xa)return"BsonDate";if(t===Ha){if(e instanceof Fs)return za;if(e instanceof Date)return Xa;if(e instanceof Us)return Za;e.$timestamp?t=Xa:e.$date?t=Za:Fs.validate(e)?t=za:Os.validate(e)?t=Ka:As.validate(e)?t=Ja:Ps.validate(e)?t=Ya:Cs.validate(e)?t=$a:ks.validate(e)&&(t=Qa)}return t},e.generateDocId=function(){for(var e="",t=0;t<24;t++)e+="ABCDEFabcdef0123456789".charAt(Math.floor(22*Math.random()));return e},e}(),Ms=function(){function e(){}return e.isGeopoint=function(e,t){if("Number"!==qs.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+Ma.IntergerError);return!0},e.isFieldOrder=function(e){if(-1===es.indexOf(e))throw new Error(Ma.DirectionError);return!0},e.isFieldPath=function(e){if(!/^[a-zA-Z0-9-_\.]/.test(e))throw new Error;return!0},e.isOperator=function(e){if(-1===ts.indexOf(e))throw new Error(Ma.OpStrError);return!0},e.isCollName=function(e){if(!/^[a-zA-Z0-9]([a-zA-Z0-9-_]){1,32}$/.test(e))throw new Error(Ma.CollNameError);return!0},e.isDocID=function(e){if(!/^([a-fA-F0-9]){24}$/.test(e))throw new Error(Ma.DocIDError);return!0},e}(),Fs=function(){function e(e,t){Ms.isGeopoint("longitude",e),Ms.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&&_s(e.coordinates)&&Ms.isGeopoint("longitude",e.coordinates[0])&&Ms.isGeopoint("latitude",e.coordinates[1])},Object.defineProperty(e.prototype,"_internalType",{get:function(){return ps},enumerable:!1,configurable:!0}),e}(),Bs=function(){var e=function(){};if(!Promise){e.promise={};var t=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}var n=new Promise((function(t,n){e=function(e,r){return e?n(e):t(r)}}));return e.promise=n,e};!function(e){e.SET="set",e.REMOVE="remove",e.INC="inc",e.MUL="mul",e.PUSH="push",e.PULL="pull",e.PULL_ALL="pullAll",e.POP="pop",e.SHIFT="shift",e.UNSHIFT="unshift",e.ADD_TO_SET="addToSet",e.BIT="bit",e.RENAME="rename",e.MAX="max",e.MIN="min"}(Ls||(Ls={}));var Ws,Vs=function(){function e(e,t,n){this._internalType=cs,Object.defineProperties(this,{_internalType:{enumerable:!1,configurable:!1}}),this.operator=e,this.operands=t,this.fieldName=n||ss}return e.prototype._setFieldName=function(t){return new e(this.operator,this.operands,t)},e}();function Gs(e){return e&&e instanceof Vs&&e._internalType===cs}!function(e){e.AND="and",e.OR="or",e.NOT="not",e.NOR="nor"}(Ws||(Ws={}));var Hs=function(){function e(e,t,n){if(this._internalType=ls,Object.defineProperties(this,{_internalType:{enumerable:!1,configurable:!1}}),this.operator=e,this.operands=t,this.fieldName=n||ss,this.fieldName!==ss)if(Array.isArray(t)){t=t.slice(),this.operands=t;for(var r=0,o=t.length;r<o;r++)(zs(i=t[r])||$s(i))&&(t[r]=i._setFieldName(this.fieldName))}else{var i;(zs(i=t)||$s(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(Ws.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(Ws.OR,r,this.fieldName)},e}();function zs(e){return e&&e instanceof Hs&&e._internalType===ls}var Ks,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)}}();!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"}(Ks||(Ks={}));var Ys=function(e){function t(t,n,r){var o=e.call(this,t,n,r)||this;return o.operator=t,o._internalType=us,o}return Js(t,e),t.prototype.toJSON=function(){var e,t;switch(this.operator){case Ks.IN:case Ks.NIN:return(e={})["$"+this.operator]=this.operands,e;default:return(t={})["$"+this.operator]=this.operands[0],t}},t.prototype._setFieldName=function(e){return new t(this.operator,this.operands,e)},t.prototype.eq=function(e){var n=new t(Ks.EQ,[e],this.fieldName);return this.and(n)},t.prototype.neq=function(e){var n=new t(Ks.NEQ,[e],this.fieldName);return this.and(n)},t.prototype.gt=function(e){var n=new t(Ks.GT,[e],this.fieldName);return this.and(n)},t.prototype.gte=function(e){var n=new t(Ks.GTE,[e],this.fieldName);return this.and(n)},t.prototype.lt=function(e){var n=new t(Ks.LT,[e],this.fieldName);return this.and(n)},t.prototype.lte=function(e){var n=new t(Ks.LTE,[e],this.fieldName);return this.and(n)},t.prototype.in=function(e){var n=new t(Ks.IN,e,this.fieldName);return this.and(n)},t.prototype.nin=function(e){var n=new t(Ks.NIN,e,this.fieldName);return this.and(n)},t.prototype.geoNear=function(e){if(!(e.geometry instanceof Fs))throw new TypeError('"geometry" must be of type Point. Received type '.concat(typeof e.geometry));if(void 0!==e.maxDistance&&!ws(e.maxDistance))throw new TypeError('"maxDistance" must be of type Number. Received type '.concat(typeof e.maxDistance));if(void 0!==e.minDistance&&!ws(e.minDistance))throw new TypeError('"minDistance" must be of type Number. Received type '.concat(typeof e.minDistance));var n=new t(Ks.GEO_NEAR,[e],this.fieldName);return this.and(n)},t.prototype.geoWithin=function(e){if(!(e.geometry instanceof ks||e.geometry instanceof As))throw new TypeError('"geometry" must be of type Polygon or MultiPolygon. Received type '.concat(typeof e.geometry));var n=new t(Ks.GEO_WITHIN,[e],this.fieldName);return this.and(n)},t.prototype.geoIntersects=function(e){if(!(e.geometry instanceof Fs||e.geometry instanceof Os||e.geometry instanceof As||e.geometry instanceof Ps||e.geometry instanceof Cs||e.geometry instanceof ks))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(Ks.GEO_INTERSECTS,[e],this.fieldName);return this.and(n)},t}(Hs);function $s(e){return e&&e instanceof Ys&&e._internalType===us}function Qs(e){return $s(e)}var Xs={};for(var Zs in Ks)Xs[Zs]="$"+Zs;for(var Zs in Ws)Xs[Zs]="$"+Zs;for(var Zs in Ls)Xs[Zs]="$"+Zs;function ec(e){return Xs[e]||"$"+e}Xs[Ks.NEQ]="$ne",Xs[Ls.REMOVE]="$unset",Xs[Ls.SHIFT]="$pop",Xs[Ls.UNSHIFT]="$push";var tc=function(){return tc=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},tc.apply(this,arguments)},nc=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},rc=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 oc(e){return ic(e,[e])}function ic(e,t){if(!Ss(e)){if(Is(e))return{$date:+e};if(Es(e))return{$regex:e.source,$options:e.flags};if(_s(e))return e.map((function(e){if(t.indexOf(e)>-1)throw new Error("Cannot convert circular structure to JSON");return ic(e,rc(rc([],nc(t),!1),[e],!1))}));if(xs(e)){var n=tc({},e);for(var r in n){if(t.indexOf(n[r])>-1)throw new Error("Cannot convert circular structure to JSON");n[r]=ic(n[r],rc(rc([],nc(t),!1),[n[r]],!1))}return n}return e}switch(e._internalType){case ps:return e.toJSON();case gs:case ys:return e.parse();default:return e.toJSON?e.toJSON():e}}var ac=function(){return ac=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},ac.apply(this,arguments)},sc=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},cc=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 uc(e,t,n,r){var o=ac({},e);for(var i in e)if(!/^\$/.test(i)){var a=e[i];if(a&&xs(a)&&!t(a)){if(r.indexOf(a)>-1)throw new Error("Cannot convert circular structure to JSON");var s=uc(a,t,cc(cc([],sc(n),!1),[i],!1),cc(cc([],sc(r),!1),[a],!1));o[i]=s;var c=!1;for(var u in s)/^\$/.test(u)?c=!0:(o["".concat(i,".").concat(u)]=s[u],delete o[i][u]);c||delete o[i]}}return o}function lc(e){return uc(e,dc,[],[e])}function pc(e,t,n){for(var r in t[n]||delete e[n],t)e[r]?_s(e[r])?e[r].push(t[r]):xs(e[r])?xs(t[r])?Object.assign(e[r],t[r]):(console.warn("unmergable condition, query is object but condition is ".concat(bs(t),", can only overwrite"),t,n),e[r]=t[r]):(console.warn("to-merge query is of type ".concat(bs(e),", can only overwrite"),e,t,n),e[r]=t[r]):e[r]=t[r]}function dc(e){return Ss(e)||Is(e)||Es(e)}function hc(e){return oc(e)}var fc=function(){function e(){}return e.encode=function(t){return(new e).encodeUpdate(t)},e.prototype.encodeUpdate=function(e){return Gs(e)?this.encodeUpdateCommand(e):"object"===bs(e)?this.encodeUpdateObject(e):e},e.prototype.encodeUpdateCommand=function(e){if(e.fieldName===ss)throw new Error("Cannot encode a comparison command with unset field name");switch(e.operator){case Ls.PUSH:case Ls.PULL:case Ls.PULL_ALL:case Ls.POP:case Ls.SHIFT:case Ls.UNSHIFT:case Ls.ADD_TO_SET:return this.encodeArrayUpdateCommand(e);default:return this.encodeFieldUpdateCommand(e)}},e.prototype.encodeFieldUpdateCommand=function(e){var t,n,r,o,i=ec(e.operator);return e.operator===Ls.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=ec(e.operator);switch(e.operator){case Ls.PUSH:var d=void 0;return d=_s(e.operands)?{$each:e.operands.map(hc)}:e.operands,(t={})[p]=((n={})[e.fieldName]=d,n),t;case Ls.UNSHIFT:return d={$each:e.operands.map(hc),$position:0},(r={})[p]=((o={})[e.fieldName]=d,o),r;case Ls.POP:return(i={})[p]=((a={})[e.fieldName]=1,a),i;case Ls.SHIFT:return(s={})[p]=((c={})[e.fieldName]=-1,c),s;default:return(u={})[p]=((l={})[e.fieldName]=hc(e.operands),l),u}},e.prototype.encodeUpdateObject=function(e){var t=lc(e);for(var n in t)if(!/^\$/.test(n)){var r=t[n];if(Gs(r))t[n]=r._setFieldName(n),pc(t,this.encodeUpdateCommand(t[n]),n);else{t[n]=r=hc(r);var o=new Vs(Ls.SET,[r],n);pc(t,this.encodeUpdateCommand(o),n)}}return t},e}(),mc={};function vc(e){if(!Xc.wsClientClass)throw new Error("to use realtime you must import realtime module first");var t=e.config.env;return mc[t]||(mc[t]=new Xc.wsClientClass({context:{appConfig:{docSizeLimit:1e3,realtimePingInterval:1e4,realtimePongWaitTimeout:5e3,request:Xc.createRequest(e.config)}}})),mc[t]}var gc=function(){return gc=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},gc.apply(this,arguments)},yc=function(){function e(e,t,n,r){void 0===r&&(r={});var o=this;this.watch=function(e){return vc(o._db).watch(gc(gc({},e),{envId:o._db.config.env,collectionName:o._coll,query:JSON.stringify({_id:o.id})}))},this._db=e,this._coll=t,this.id=n,this.request=Xc.createRequest(this._db.config),this.projection=r}return e.prototype.create=function(e,t){t=t||Bs();var n=Array.isArray(e),r={collectionName:this._coll,data:n?e.map((function(e){return oc(e)})):oc(e)};return!n&&this.id&&(r._id=this.id),this.request.send("database.addDocument",r).then((function(e){var r;e.code?t(0,e):t(0,n?{ids:(null===(r=e.data)||void 0===r?void 0:r.insertedIds)||[],requestId:e.requestId}:{id:e.data._id,requestId:e.requestId})})).catch((function(e){t(e)})),t.promise},e.prototype.set=function(e,t){if(t=t||Bs(),!this.id)return Promise.resolve({code:"INVALID_PARAM",message:"docId不能为空"});if(!e||"object"!=typeof e)return Promise.resolve({code:"INVALID_PARAM",message:"参数必需是非空对象"});if(e.hasOwnProperty("_id"))return Promise.resolve({code:"INVALID_PARAM",message:"不能更新_id的值"});var n=!1,r=function(e){if("object"==typeof e)for(var t in e)e[t]instanceof Vs?n=!0:"object"==typeof e[t]&&r(e[t])};if(r(e),n)return Promise.resolve({code:"DATABASE_REQUEST_FAILED",message:"update operator complicit"});var o={collectionName:this._coll,queryType:Ga.DOC,data:oc(e),multi:!1,merge:!1,upsert:!0};return this.id&&(o.query={_id:this.id}),this.request.send("database.updateDocument",o).then((function(e){e.code?t(0,e):t(0,{updated:e.data.updated,upsertedId:e.data.upserted_id,requestId:e.requestId})})).catch((function(e){t(e)})),t.promise},e.prototype.update=function(e,t){if(t=t||Bs(),!e||"object"!=typeof e)return Promise.resolve({code:"INVALID_PARAM",message:"参数必需是非空对象"});if(e.hasOwnProperty("_id"))return Promise.resolve({code:"INVALID_PARAM",message:"不能更新_id的值"});var n={_id:this.id},r={collectionName:this._coll,data:fc.encode(e),query:n,queryType:Ga.DOC,multi:!1,merge:!0,upsert:!1};return this.request.send("database.updateDocument",r).then((function(e){e.code?t(0,e):t(0,{updated:e.data.updated,upsertedId:e.data.upserted_id,requestId:e.requestId})})).catch((function(e){t(e)})),t.promise},e.prototype.remove=function(e){e=e||Bs();var t={_id:this.id},n={collectionName:this._coll,query:t,queryType:Ga.DOC,multi:!1};return this.request.send("database.deleteDocument",n).then((function(t){t.code?e(0,t):e(0,{deleted:t.data.deleted,requestId:t.requestId})})).catch((function(t){e(t)})),e.promise},e.prototype.get=function(e){e=e||Bs();var t={_id:this.id},n={collectionName:this._coll,query:t,queryType:Ga.DOC,multi:!1,projection:this.projection};return this.request.send("database.queryDocument",n).then((function(t){if(t.code)e(0,t);else{var n=qs.formatResDocumentData(t.data.list);e(0,{data:n,requestId:t.requestId})}})).catch((function(t){e(t)})),e.promise},e.prototype.field=function(t){for(var n in t)t[n]?t[n]=1:t[n]=0;return new e(this._db,this._coll,this.id,t)},e}(),bc=function(){function e(){}return e.encode=function(e){return(new xc).encodeQuery(e)},e}(),xc=function(){function e(){}return e.prototype.encodeQuery=function(e,t){var n;return dc(e)?zs(e)?this.encodeLogicCommand(e):$s(e)?this.encodeQueryCommand(e):((n={})[t]=this.encodeQueryObject(e),n):xs(e)?this.encodeQueryObject(e):e},e.prototype.encodeRegExp=function(e){return{$regex:e.source,$options:e.flags}},e.prototype.encodeLogicCommand=function(e){var t,n,r,o,i,a,s,c=this;switch(e.operator){case Ws.NOR:case Ws.AND:case Ws.OR:var u=ec(e.operator),l=e.operands.map((function(t){return c.encodeQuery(t,e.fieldName)}));return(t={})[u]=l,t;case Ws.NOT:u=ec(e.operator);var p=e.operands[0];return Es(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=ec(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 Qs(e),this.encodeComparisonCommand(e)},e.prototype.encodeComparisonCommand=function(e){var t,n,r,o,i,a,s,c,u;if(e.fieldName===ss)throw new Error("Cannot encode a comparison command with unset field name");var l=ec(e.operator);switch(e.operator){case Ks.EQ:case Ks.NEQ:case Ks.LT:case Ks.LTE:case Ks.GT:case Ks.GTE:case Ks.ELEM_MATCH:case Ks.EXISTS:case Ks.SIZE:case Ks.MOD:return(t={})[e.fieldName]=((n={})[l]=hc(e.operands[0]),n),t;case Ks.IN:case Ks.NIN:case Ks.ALL:return(r={})[e.fieldName]=((o={})[l]=hc(e.operands),o),r;case Ks.GEO_NEAR:var p=e.operands[0];return(i={})[e.fieldName]={$nearSphere:{$geometry:p.geometry.toJSON(),$maxDistance:p.maxDistance,$minDistance:p.minDistance}},i;case Ks.GEO_WITHIN:return p=e.operands[0],(a={})[e.fieldName]={$geoWithin:{$geometry:p.geometry.toJSON()}},a;case Ks.GEO_INTERSECTS:return p=e.operands[0],(s={})[e.fieldName]={$geoIntersects:{$geometry:p.geometry.toJSON()}},s;default:return(c={})[e.fieldName]=((u={})[l]=hc(e.operands[0]),u),c}},e.prototype.encodeQueryObject=function(e){var t=lc(e);for(var n in t){var r=t[n];if(zs(r)){t[n]=r._setFieldName(n);var o=this.encodeLogicCommand(t[n]);this.mergeConditionAfterEncode(t,o,n)}else Qs(r)?(t[n]=r._setFieldName(n),o=this.encodeComparisonCommand(t[n]),this.mergeConditionAfterEncode(t,o,n)):dc(r)&&(t[n]=hc(r))}return t},e.prototype.mergeConditionAfterEncode=function(e,t,n){for(var r in t[n]||delete e[n],t)e[r]?_s(e[r])?e[r]=e[r].concat(t[r]):xs(e[r])?xs(t[r])?Object.assign(e,t):(console.warn("unmergable condition, query is object but condition is ".concat(bs(t),", can only overwrite"),t,n),e[r]=t[r]):(console.warn("to-merge query is of type ".concat(bs(e),", can only overwrite"),e,t,n),e[r]=t[r]):e[r]=t[r]},e}(),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)},_c=function(){function e(e,t,n,r,o){var i=this;this.watch=function(e){return vc(i._db).watch(wc(wc({},e),{envId:i._db.config.env,collectionName:i._coll,query:JSON.stringify(i._fieldFilters||{}),limit:i._queryOptions.limit,orderBy:i._fieldOrders?i._fieldOrders.reduce((function(e,t){return e[t.field]=t.direction,e}),{}):void 0}))},this._db=e,this._coll=t,this._fieldFilters=n,this._fieldOrders=r||[],this._queryOptions=o||{},this._request=Xc.createRequest(this._db.config)}return e.prototype.get=function(e){e=e||Bs();var t=[];this._fieldOrders&&this._fieldOrders.forEach((function(e){t.push(e)}));var n={collectionName:this._coll,queryType:Ga.WHERE};return this._fieldFilters&&(n.query=this._fieldFilters),t.length>0&&(n.order=t),this._queryOptions.offset&&(n.offset=this._queryOptions.offset),this._queryOptions.limit?n.limit=this._queryOptions.limit<1e3?this._queryOptions.limit:1e3:n.limit=100,this._queryOptions.projection&&(n.projection=this._queryOptions.projection),this._request.send("database.queryDocument",n).then((function(t){if(t.code)e(0,t);else{var n={data:qs.formatResDocumentData(t.data.list),requestId:t.requestId};void 0!==t.total&&(n.total=t.total),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.offset&&(n.offset=t.offset),e(0,n)}})).catch((function(t){e(t)})),e.promise},e.prototype.count=function(e){e=e||Bs();var t={collectionName:this._coll,queryType:Ga.WHERE};return this._fieldFilters&&(t.query=this._fieldFilters),this._request.send("database.countDocument",t).then((function(t){t.code?e(0,t):e(0,{requestId:t.requestId,total:t.data.total})})).catch((function(t){e(t)})),e.promise},e.prototype.where=function(t){if("Object"!==Object.prototype.toString.call(t).slice(8,-1))throw Error(Ma.QueryParamTypeError);var n=Object.keys(t),r=n.some((function(e){return void 0!==t[e]}));if(n.length&&!r)throw Error(Ma.QueryParamValueError);return new e(this._db,this._coll,bc.encode(t),this._fieldOrders,this._queryOptions)},e.prototype.orderBy=function(t,n){Ms.isFieldPath(t),Ms.isFieldOrder(n);var r={field:t,direction:n},o=this._fieldOrders.concat(r);return new e(this._db,this._coll,this._fieldFilters,o,this._queryOptions)},e.prototype.limit=function(t){Ms.isInteger("limit",t);var n=wc({},this._queryOptions);return n.limit=t,new e(this._db,this._coll,this._fieldFilters,this._fieldOrders,n)},e.prototype.skip=function(t){Ms.isInteger("offset",t);var n=wc({},this._queryOptions);return n.offset=t,new e(this._db,this._coll,this._fieldFilters,this._fieldOrders,n)},e.prototype.update=function(e,t){if(t=t||Bs(),!e||"object"!=typeof e)return Promise.resolve({code:"INVALID_PARAM",message:"参数必需是非空对象"});if(e.hasOwnProperty("_id"))return Promise.resolve({code:"INVALID_PARAM",message:"不能更新_id的值"});var n={collectionName:this._coll,query:this._fieldFilters,queryType:Ga.WHERE,multi:!0,merge:!0,upsert:!1,data:fc.encode(e)};return this._request.send("database.updateDocument",n).then((function(e){e.code?t(0,e):t(0,{requestId:e.requestId,updated:e.data.updated,upsertId:e.data.upsert_id})})).catch((function(e){t(e)})),t.promise},e.prototype.field=function(t){for(var n in t)t[n]?"object"!=typeof t[n]&&(t[n]=1):t[n]=0;var r=wc({},this._queryOptions);return r.projection=t,new e(this._db,this._coll,this._fieldFilters,this._fieldOrders,r)},e.prototype.remove=function(e){e=e||Bs(),Object.keys(this._queryOptions).length>0&&console.warn("`offset`, `limit` and `projection` are not supported in remove() operation"),this._fieldOrders.length>0&&console.warn("`orderBy` is not supported in remove() operation");var t={collectionName:this._coll,query:bc.encode(this._fieldFilters),queryType:Ga.WHERE,multi:!0};return this._request.send("database.deleteDocument",t).then((function(t){t.code?e(0,t):e(0,{requestId:t.requestId,deleted:t.data.deleted})})).catch((function(t){e(t)})),e.promise},e}();const Ic=(e=>{var t={};return f.d(t,e),t})({EJSON:()=>p.EJSON});var Ec=function(){function e(e,t){this._stages=[],e&&t&&(this._db=e,this._request=Xc.createRequest(this._db.config),this._collectionName=t)}return e.prototype.end=function(){return e=this,t=void 0,r=function(){var e;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}(this,(function(t){switch(t.label){case 0:if(!this._collectionName||!this._db)throw new Error("Aggregation pipeline cannot send request");return[4,this._request.send("database.aggregate",{collectionName:this._collectionName,stages:this._stages})];case 1:return(e=t.sent())&&e.data&&e.data.list?[2,{requestId:e.requestId,data:JSON.parse(e.data.list).map(Ic.EJSON.parse)}]:[2,e]}}))},new((n=void 0)||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}));var e,t,n,r},e.prototype.unwrap=function(){return this._stages},e.prototype.done=function(){return this._stages.map((function(e){var t,n=e.stageKey,r=e.stageValue;return(t={})[n]=JSON.parse(r),t}))},e.prototype._pipe=function(e,t){return this._stages.push({stageKey:"$".concat(e),stageValue:JSON.stringify(t)}),this},e.prototype.addFields=function(e){return this._pipe("addFields",e)},e.prototype.bucket=function(e){return this._pipe("bucket",e)},e.prototype.bucketAuto=function(e){return this._pipe("bucketAuto",e)},e.prototype.count=function(e){return this._pipe("count",e)},e.prototype.geoNear=function(e){return e.query&&(e.query=bc.encode(e.query)),e.distanceMultiplier&&"number"==typeof e.distanceMultiplier&&(e.distanceMultiplier=e.distanceMultiplier),e.near&&(e.near=new Fs(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",bc.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 Sc=Ec;var Oc=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)}}(),Tc=function(e){function t(t,n){return e.call(this,t,n)||this}return Oc(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 yc(this._db,this._coll,e)},t.prototype.add=function(e,t){return new yc(this._db,this._coll,void 0).create(e,t)},t.prototype.aggregate=function(){return new Sc(this._db,this._coll)},t}(_c),Ac={eq:function(e){return new Ys(Ks.EQ,[e])},neq:function(e){return new Ys(Ks.NEQ,[e])},lt:function(e){return new Ys(Ks.LT,[e])},lte:function(e){return new Ys(Ks.LTE,[e])},gt:function(e){return new Ys(Ks.GT,[e])},gte:function(e){return new Ys(Ks.GTE,[e])},in:function(e){return new Ys(Ks.IN,e)},nin:function(e){return new Ys(Ks.NIN,e)},all:function(e){return new Ys(Ks.ALL,e)},elemMatch:function(e){return new Ys(Ks.ELEM_MATCH,[e])},exists:function(e){return new Ys(Ks.EXISTS,[e])},size:function(e){return new Ys(Ks.SIZE,[e])},mod:function(e){return new Ys(Ks.MOD,[e])},geoNear:function(e){return new Ys(Ks.GEO_NEAR,[e])},geoWithin:function(e){return new Ys(Ks.GEO_WITHIN,[e])},geoIntersects:function(e){return new Ys(Ks.GEO_INTERSECTS,[e])},and:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=_s(arguments[0])?arguments[0]:Array.from(arguments);return new Hs(Ws.AND,n)},nor:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=_s(arguments[0])?arguments[0]:Array.from(arguments);return new Hs(Ws.NOR,n)},or:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=_s(arguments[0])?arguments[0]:Array.from(arguments);return new Hs(Ws.OR,n)},not:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=_s(arguments[0])?arguments[0]:Array.from(arguments);return new Hs(Ws.NOT,n)},set:function(e){return new Vs(Ls.SET,[e])},remove:function(){return new Vs(Ls.REMOVE,[])},inc:function(e){return new Vs(Ls.INC,[e])},mul:function(e){return new Vs(Ls.MUL,[e])},push:function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(xs(t[0])&&t[0].hasOwnProperty("each")){var r=t[0];e={$each:r.each,$position:r.position,$sort:r.sort,$slice:r.slice}}else e=_s(t[0])?t[0]:Array.from(t);return new Vs(Ls.PUSH,e)},pull:function(e){return new Vs(Ls.PULL,e)},pullAll:function(e){return new Vs(Ls.PULL_ALL,e)},pop:function(){return new Vs(Ls.POP,[])},shift:function(){return new Vs(Ls.SHIFT,[])},unshift:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=_s(arguments[0])?arguments[0]:Array.from(arguments);return new Vs(Ls.UNSHIFT,n)},addToSet:function(e){return new Vs(Ls.ADD_TO_SET,e)},rename:function(e){return new Vs(Ls.RENAME,[e])},bit:function(e){return new Vs(Ls.BIT,[e])},max:function(e){return new Vs(Ls.MAX,[e])},min:function(e){return new Vs(Ls.MIN,[e])},expr:function(e){return{$expr:e}},jsonSchema:function(e){return{$jsonSchema:e}},text:function(e){return function(e){return"string"===bs(e)}(e)?{$search:e.search}:{$search:e.search,$language:e.language,$caseSensitive:e.caseSensitive,$diacriticSensitive:e.diacriticSensitive}},aggregate:{pipeline:function(){return new Sc},abs:function(e){return new Pc("abs",e)},add:function(e){return new Pc("add",e)},ceil:function(e){return new Pc("ceil",e)},divide:function(e){return new Pc("divide",e)},exp:function(e){return new Pc("exp",e)},floor:function(e){return new Pc("floor",e)},ln:function(e){return new Pc("ln",e)},log:function(e){return new Pc("log",e)},log10:function(e){return new Pc("log10",e)},mod:function(e){return new Pc("mod",e)},multiply:function(e){return new Pc("multiply",e)},pow:function(e){return new Pc("pow",e)},sqrt:function(e){return new Pc("sqrt",e)},subtract:function(e){return new Pc("subtract",e)},trunc:function(e){return new Pc("trunc",e)},arrayElemAt:function(e){return new Pc("arrayElemAt",e)},arrayToObject:function(e){return new Pc("arrayToObject",e)},concatArrays:function(e){return new Pc("concatArrays",e)},filter:function(e){return new Pc("filter",e)},in:function(e){return new Pc("in",e)},indexOfArray:function(e){return new Pc("indexOfArray",e)},isArray:function(e){return new Pc("isArray",e)},map:function(e){return new Pc("map",e)},range:function(e){return new Pc("range",e)},reduce:function(e){return new Pc("reduce",e)},reverseArray:function(e){return new Pc("reverseArray",e)},size:function(e){return new Pc("size",e)},slice:function(e){return new Pc("slice",e)},zip:function(e){return new Pc("zip",e)},and:function(e){return new Pc("and",e)},not:function(e){return new Pc("not",e)},or:function(e){return new Pc("or",e)},cmp:function(e){return new Pc("cmp",e)},eq:function(e){return new Pc("eq",e)},gt:function(e){return new Pc("gt",e)},gte:function(e){return new Pc("gte",e)},lt:function(e){return new Pc("lt",e)},lte:function(e){return new Pc("lte",e)},neq:function(e){return new Pc("ne",e)},cond:function(e){return new Pc("cond",e)},ifNull:function(e){return new Pc("ifNull",e)},switch:function(e){return new Pc("switch",e)},dateFromParts:function(e){return new Pc("dateFromParts",e)},dateFromString:function(e){return new Pc("dateFromString",e)},dayOfMonth:function(e){return new Pc("dayOfMonth",e)},dayOfWeek:function(e){return new Pc("dayOfWeek",e)},dayOfYear:function(e){return new Pc("dayOfYear",e)},isoDayOfWeek:function(e){return new Pc("isoDayOfWeek",e)},isoWeek:function(e){return new Pc("isoWeek",e)},isoWeekYear:function(e){return new Pc("isoWeekYear",e)},millisecond:function(e){return new Pc("millisecond",e)},minute:function(e){return new Pc("minute",e)},month:function(e){return new Pc("month",e)},second:function(e){return new Pc("second",e)},hour:function(e){return new Pc("hour",e)},week:function(e){return new Pc("week",e)},year:function(e){return new Pc("year",e)},literal:function(e){return new Pc("literal",e)},mergeObjects:function(e){return new Pc("mergeObjects",e)},objectToArray:function(e){return new Pc("objectToArray",e)},allElementsTrue:function(e){return new Pc("allElementsTrue",e)},anyElementTrue:function(e){return new Pc("anyElementTrue",e)},setDifference:function(e){return new Pc("setDifference",e)},setEquals:function(e){return new Pc("setEquals",e)},setIntersection:function(e){return new Pc("setIntersection",e)},setIsSubset:function(e){return new Pc("setIsSubset",e)},setUnion:function(e){return new Pc("setUnion",e)},concat:function(e){return new Pc("concat",e)},dateToString:function(e){return new Pc("dateToString",e)},indexOfBytes:function(e){return new Pc("indexOfBytes",e)},indexOfCP:function(e){return new Pc("indexOfCP",e)},split:function(e){return new Pc("split",e)},strLenBytes:function(e){return new Pc("strLenBytes",e)},strLenCP:function(e){return new Pc("strLenCP",e)},strcasecmp:function(e){return new Pc("strcasecmp",e)},substr:function(e){return new Pc("substr",e)},substrBytes:function(e){return new Pc("substrBytes",e)},substrCP:function(e){return new Pc("substrCP",e)},toLower:function(e){return new Pc("toLower",e)},toUpper:function(e){return new Pc("toUpper",e)},meta:function(e){return new Pc("meta",e)},addToSet:function(e){return new Pc("addToSet",e)},avg:function(e){return new Pc("avg",e)},first:function(e){return new Pc("first",e)},last:function(e){return new Pc("last",e)},max:function(e){return new Pc("max",e)},min:function(e){return new Pc("min",e)},push:function(e){return new Pc("push",e)},stdDevPop:function(e){return new Pc("stdDevPop",e)},stdDevSamp:function(e){return new Pc("stdDevSamp",e)},sum:function(e){return new Pc("sum",e)},let:function(e){return new Pc("let",e)}},project:{slice:function(e){return new Rc("slice",e)},elemMatch:function(e){return new Rc("elemMatch",e)}}},Pc=function(e,t){this["$"+e]=t},Rc=function(e,t){this["$"+e]=t},Cc=function(){function e(e){var t=e.regexp,n=e.options;if(!t)throw new TypeError("regexp must be a string");this.$regex=t,this.$options=n}return e.prototype.parse=function(){return{$regex:this.$regex,$options:this.$options}},Object.defineProperty(e.prototype,"_internalType",{get:function(){return ys},enumerable:!1,configurable:!0}),e}();function Nc(e){return new Cc(e)}var kc="insert document failed",Uc="DATABASE_TRANSACTION_CONFLICT",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,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])}}},qc="database.updateDocInTransaction",Mc=function(){function e(e,t,n){this._coll=t,this.id=n,this._transaction=e,this._request=this._transaction.getRequestMethod(),this._transactionId=this._transaction.getTransactionId()}return e.prototype.create=function(e){return Lc(this,void 0,void 0,(function(){var t,n,r,o;return Dc(this,(function(i){switch(i.label){case 0:return t={collectionName:this._coll,transactionId:this._transactionId,data:Ic.EJSON.stringify(oc(e),{relaxed:!1})},this.id&&(t._id=this.id),[4,this._request.send("database.insertDocInTransaction",t)];case 1:if((n=i.sent()).code)throw n;if(r=Ic.EJSON.parse(n.inserted),1==(o=Ic.EJSON.parse(n.ok))&&1==r)return[2,jc(jc({},n),{ok:o,inserted:r})];throw new Error(kc)}}))}))},e.prototype.get=function(){return Lc(this,void 0,void 0,(function(){var e,t;return Dc(this,(function(n){switch(n.label){case 0:return e={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}}},[4,this._request.send("database.getInTransaction",e)];case 1:if((t=n.sent()).code)throw t;return[2,{data:"null"!==t.data?qs.formatField(Ic.EJSON.parse(t.data)):Ic.EJSON.parse(t.data),requestId:t.requestId}]}}))}))},e.prototype.set=function(e){return Lc(this,void 0,void 0,(function(){var t,n;return Dc(this,(function(r){switch(r.label){case 0:return t={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}},data:Ic.EJSON.stringify(oc(e),{relaxed:!1}),upsert:!0},[4,this._request.send(qc,t)];case 1:if((n=r.sent()).code)throw n;return[2,jc(jc({},n),{updated:Ic.EJSON.parse(n.updated),upserted:n.upserted?JSON.parse(n.upserted):null})]}}))}))},e.prototype.update=function(e){return Lc(this,void 0,void 0,(function(){var t,n;return Dc(this,(function(r){switch(r.label){case 0:return t={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}},data:Ic.EJSON.stringify(fc.encode(e),{relaxed:!1})},[4,this._request.send(qc,t)];case 1:if((n=r.sent()).code)throw n;return[2,jc(jc({},n),{updated:Ic.EJSON.parse(n.updated)})]}}))}))},e.prototype.delete=function(){return Lc(this,void 0,void 0,(function(){var e,t;return Dc(this,(function(n){switch(n.label){case 0:return e={collectionName:this._coll,transactionId:this._transactionId,query:{_id:{$eq:this.id}}},[4,this._request.send("database.deleteDocInTransaction",e)];case 1:if((t=n.sent()).code)throw t;return[2,jc(jc({},t),{deleted:Ic.EJSON.parse(t.deleted)})]}}))}))},e}(),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)},Bc=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())}))},Wc=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])}}},Vc="database.getInTransaction",Gc=function(){function e(e,t,n,r,o){this._coll=t,this._transaction=e,this._fieldFilters=n,this._fieldOrders=r||[],this._queryOptions=o||{},this._request=this._transaction.getRequestMethod(),this._transactionId=this._transaction.getTransactionId()}return e.prototype.where=function(t){if("Object"!==Object.prototype.toString.call(t).slice(8,-1))throw Error(Ma.QueryParamTypeError);var n=Object.keys(t),r=n.some((function(e){return void 0!==t[e]}));if(n.length&&!r)throw Error(Ma.QueryParamValueError);return new e(this._transaction,this._coll,bc.encode(t),this._fieldOrders,this._queryOptions)},e.prototype.orderBy=function(t,n){Ms.isFieldPath(t),Ms.isFieldOrder(n);var r={field:t,direction:n},o=this._fieldOrders.concat(r);return new e(this._transaction,this._coll,this._fieldFilters,o,this._queryOptions)},e.prototype.limit=function(t){Ms.isInteger("limit",t);var n=Fc({},this._queryOptions);return n.limit=t,new e(this._transaction,this._coll,this._fieldFilters,this._fieldOrders,n)},e.prototype.skip=function(t){Ms.isInteger("offset",t);var n=Fc({},this._queryOptions);return n.offset=t,new e(this._transaction,this._coll,this._fieldFilters,this._fieldOrders,n)},e.prototype.field=function(t){for(var n in t)t[n]?"object"!=typeof t[n]&&(t[n]=1):t[n]=0;var r=Fc({},this._queryOptions);return r.projection=t,new e(this._transaction,this._coll,this._fieldFilters,this._fieldOrders,r)},e.prototype.get=function(){return Bc(this,void 0,void 0,(function(){var e,t,n,r,o,i;return Wc(this,(function(a){switch(a.label){case 0:return e=[],this._fieldOrders&&this._fieldOrders.forEach((function(t){e.push(t)})),t={collectionName:this._coll,transactionId:this._transactionId},this._fieldFilters&&(t.query=this._fieldFilters),e.length>0&&(t.order=e),this._queryOptions.offset&&(t.offset=this._queryOptions.offset),this._queryOptions.limit?t.limit=this._queryOptions.limit<1e3?this._queryOptions.limit:1e3:t.limit=100,this._queryOptions.projection&&(t.projection=this._queryOptions.projection),[4,this._request.send(Vc,t)];case 1:if((n=a.sent()).code)throw n;return r="null"!==n.data?Ic.EJSON.parse(n.data):null,o=r?Array.isArray(r)?qs.formatResDocumentData(r):[qs.formatField(r)]:[],i={data:o,requestId:n.requestId},void 0!==n.total&&(i.total=n.total),void 0!==n.limit&&(i.limit=n.limit),void 0!==n.offset&&(i.offset=n.offset),[2,i]}}))}))},e.prototype.count=function(){return Bc(this,void 0,void 0,(function(){var e,t,n,r;return Wc(this,(function(o){switch(o.label){case 0:return e={collectionName:this._coll,transactionId:this._transactionId},this._fieldFilters&&(e.query=this._fieldFilters),[4,this._request.send(Vc,e)];case 1:if((t=o.sent()).code)throw t;return n="null"!==t.data?Ic.EJSON.parse(t.data):null,r=Array.isArray(n)?n.length:n?1:0,[2,{requestId:t.requestId,total:void 0!==t.total?t.total:r}]}}))}))},e.prototype.update=function(e){return Bc(this,void 0,void 0,(function(){var t,n;return Wc(this,(function(r){switch(r.label){case 0:if(!e||"object"!=typeof e)throw new Error("参数必需是非空对象");if(e.hasOwnProperty("_id"))throw new Error("不能更新_id的值");return t={collectionName:this._coll,transactionId:this._transactionId,query:this._fieldFilters,data:Ic.EJSON.stringify(fc.encode(e),{relaxed:!1})},[4,this._request.send("database.updateDocInTransaction",t)];case 1:if((n=r.sent()).code)throw n;return[2,Fc(Fc({},n),{updated:Ic.EJSON.parse(n.updated)})]}}))}))},e.prototype.remove=function(){return Bc(this,void 0,void 0,(function(){var e,t;return Wc(this,(function(n){switch(n.label){case 0:return Object.keys(this._queryOptions).length>0&&console.warn("`offset`, `limit` and `projection` are not supported in remove() operation"),this._fieldOrders.length>0&&console.warn("`orderBy` is not supported in remove() operation"),e={collectionName:this._coll,transactionId:this._transactionId,query:this._fieldFilters},[4,this._request.send("database.deleteDocInTransaction",e)];case 1:if((t=n.sent()).code)throw t;return[2,Fc(Fc({},t),{deleted:Ic.EJSON.parse(t.deleted)})]}}))}))},e}(),Hc=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)}}(),zc=function(e){function t(t,n){return e.call(this,t,n)||this}return Hc(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 Mc(this._transaction,this._coll,e)},t.prototype.add=function(e){var t;return void 0!==e._id&&(t=e._id),new Mc(this._transaction,this._coll,t).create(e)},t}(Gc),Kc=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())}))},Jc=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])}}},Yc=function(){function e(e){this._db=e,this._request=Xc.createRequest(this._db.config),this.aborted=!1,this.commited=!1,this.inited=!1}return e.prototype.init=function(){return Kc(this,void 0,void 0,(function(){var e;return Jc(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 zc(this,e)},e.prototype.getTransactionId=function(){return this._id},e.prototype.getRequestMethod=function(){return this._request},e.prototype.commit=function(){return Kc(this,void 0,void 0,(function(){var e,t;return Jc(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 Kc(this,void 0,void 0,(function(){var t,n;return Jc(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 $c(){return Kc(this,void 0,void 0,(function(){var e;return Jc(this,(function(t){switch(t.label){case 0:return[4,(e=new Yc(this)).init()];case 1:return t.sent(),[2,e]}}))}))}function Qc(e,t){return void 0===t&&(t=3),Kc(this,void 0,void 0,(function(){var n,r,o,i,a=this;return Jc(this,(function(s){switch(s.label){case 0:return s.trys.push([0,4,,10]),[4,(n=new Yc(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 Kc(a,void 0,void 0,(function(){return Jc(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===Uc?[4,Qc.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 Xc=function(){function e(e){this.config=e,this.Geo=n,this.serverDate=js,this.command=Ac,this.RegExp=Nc,this.startTransaction=$c,this.runTransaction=Qc,this.logicCommand=Hs,this.updateCommand=Vs,this.queryCommand=Ys}return e.createRequest=function(t){var n=new e.reqClass(t),r=n.send;return n.send=function(e,n){return t.instance&&(n.instance=t.instance),t.database&&(n.database=t.database),r.call(this,e,n)},n},e.prototype.collection=function(e){if(!e)throw new Error("Collection name is required");return new Tc(this,e)},e.prototype.createCollection=function(t){var n={collectionName:t};return e.createRequest(this.config).send("database.addCollection",n)},e}(),Zc=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)}}(),eu=function(){return eu=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},eu.apply(this,arguments)},tu=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())}))},nu=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])}}},ru={filterRes:function(e){return delete e.header,delete e.statusCode,e},flattenResData:function(e){if("object"==typeof e.data&&null!==e.data){var t=eu(eu({},e),e.data);return delete t.data,t}return e},safeParseEJSON:function(e){if("string"!=typeof e)return e;try{return Ic.EJSON.parse(e)}catch(t){return e}},buildQueryParams:function(e){return Object.entries(e).filter((function(e){e[0];var t=e[1];return null!=t&&""!==t})).map((function(e){var t=e[0],n=e[1],r="object"==typeof n?JSON.stringify(n):String(n);return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(r))})).join("&")},getUrlPrefix:function(e){var t=(null==e?void 0:e.instance)||"(default)",n=(null==e?void 0:e.database)||"(default)";return"/database/instances/".concat(t,"/databases/").concat(n)},"database.queryDocument":function(e){var t,n,r,o,i,a,s,c;return tu(this,void 0,Promise,(function(){var u,l,p,d;return nu(this,(function(h){switch(h.label){case 0:return u=!!(null===(n=null===(t=e.query)||void 0===t?void 0:t._id)||void 0===n?void 0:n.$eq),l=ru.buildQueryParams(eu({projection:e.projection,transactionId:e.transactionId},u?{}:{offset:null!==(r=e.offset)&&void 0!==r?r:0,limit:null!==(o=e.limit)&&void 0!==o?o:100,order:e.order,query:e.query?Ic.EJSON.stringify(e.query,{relaxed:!1}):void 0})),p="".concat(ru.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents?").concat(l),u&&(p="".concat(ru.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents/").concat((null===(i=e.query._id)||void 0===i?void 0:i.$eq)||e.query._id,"?").concat(l)),[4,this.gateWay({url:p,method:"GET"})];case 1:return(d=h.sent()).data=ru.safeParseEJSON(JSON.stringify(d.data)),!u||d.code||(null===(a=d.data)||void 0===a?void 0:a.code)?(d.code||(null===(s=d.data)||void 0===s?void 0:s.code)?d=eu(eu({},d),{code:d.code||(null===(c=d.data)||void 0===c?void 0:c.code),data:eu(eu({},d.data),{list:[]})}):Array.isArray(d.data)?d=eu(eu({},d),{data:{list:d.data}}):d.data&&!Array.isArray(d.data.list)&&(d=eu(eu({},d),{data:eu(eu({},d.data),{list:[]})})),[2,ru.filterRes(d)]):[2,eu(eu({},d),{data:{list:[d.data]}})]}}))}))},"database.addDocument":function(e){var t,n,r;return tu(this,void 0,Promise,(function(){var o;return nu(this,(function(i){switch(i.label){case 0:return[4,this.gateWay({url:"".concat(ru.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents"),method:"POST",data:eu({data:Array.isArray(e.data)?e.data:[e.data]},e.transactionId&&{transactionId:e.transactionId})})];case 1:return o=i.sent(),Array.isArray(e.data)?o=eu(eu({},o),{data:eu({ids:(null===(t=o.data)||void 0===t?void 0:t.insertedIds)||[]},o.data)}):(null===(r=null===(n=o.data)||void 0===n?void 0:n.insertedIds)||void 0===r?void 0:r[0])&&(o=eu(eu({},o),{data:eu({_id:o.data.insertedIds[0]},o.data)})),[2,ru.filterRes(o)]}}))}))},"database.updateDocument":function(e){return tu(this,void 0,Promise,(function(){var t;return nu(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(ru.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents"),method:"PATCH",data:eu({query:e.query,data:e.data,multi:!!e.multi,upsert:!!e.upsert,replaceMode:!!e.replaceMode},e.transactionId&&{transactionId:e.transactionId})})];case 1:return t=n.sent(),[2,ru.filterRes(t)]}}))}))},"database.deleteDocument":function(e){return tu(this,void 0,Promise,(function(){var t;return nu(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(ru.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents/remove"),method:"POST",data:eu({query:e.query,multi:!!e.multi},e.transactionId&&{transactionId:e.transactionId})})];case 1:return t=n.sent(),[2,ru.filterRes(t)]}}))}))},"database.countDocument":function(e){return tu(this,void 0,Promise,(function(){var t,n;return nu(this,(function(r){switch(r.label){case 0:return t=ru.buildQueryParams({count:!0,query:e.query?Ic.EJSON.stringify(e.query,{relaxed:!1}):void 0}),[4,this.gateWay({url:"".concat(ru.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents?").concat(t),method:"GET"})];case 1:return n=r.sent(),[2,ru.filterRes(n)]}}))}))},"database.addCollection":function(e){return tu(this,void 0,Promise,(function(){var t;return nu(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(ru.getUrlPrefix(e),"/collections"),method:"POST",data:{collectionName:e.collectionName}})];case 1:return t=n.sent(),[2,ru.filterRes(t)]}}))}))},"database.aggregate":function(e){var t;return tu(this,void 0,Promise,(function(){var n,r;return nu(this,(function(o){switch(o.label){case 0:return n=e.stages.map((function(e){var t,n;try{var r="string"==typeof e.stageValue?JSON.parse(e.stageValue):e.stageValue;return(t={})[e.stageKey]=Ic.EJSON.serialize(r),t}catch(t){return(n={})[e.stageKey]=e.stageValue,n}})),[4,this.gateWay({url:"".concat(ru.getUrlPrefix(e),"/collections/").concat(e.collectionName,"/documents/aggregations"),method:"POST",data:{pipeline:n}})];case 1:return r=o.sent(),Array.isArray(null===(t=r.data)||void 0===t?void 0:t.list)&&(r.data.list=JSON.stringify(r.data.list.map((function(e){return JSON.stringify(e)})))),[2,ru.filterRes(r)]}}))}))},"database.startTransaction":function(e){return tu(this,void 0,void 0,(function(){var t;return nu(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(ru.getUrlPrefix(e),"/transactions"),method:"POST"})];case 1:return t=n.sent(),[2,ru.filterRes(ru.flattenResData(t))]}}))}))},"database.commitTransaction":function(e){return tu(this,void 0,void 0,(function(){var t;return nu(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(ru.getUrlPrefix(e),"/transactions/").concat(e.transactionId,"/commit"),method:"POST"})];case 1:return t=n.sent(),[2,ru.filterRes(t)]}}))}))},"database.abortTransaction":function(e){return tu(this,void 0,void 0,(function(){var t;return nu(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(ru.getUrlPrefix(e),"/transactions/").concat(e.transactionId,"/rollback"),method:"POST"})];case 1:return t=n.sent(),[2,ru.filterRes(t)]}}))}))},"database.getInTransaction":function(e){var t;return tu(this,void 0,void 0,(function(){var n;return nu(this,(function(r){switch(r.label){case 0:return[4,ru["database.queryDocument"].call(this,e)];case 1:return"object"==typeof(n=r.sent()).data&&null!==n.data?(null===(t=n.data)||void 0===t?void 0:t.code)?[2,ru.flattenResData(n)]:[2,eu(eu({},n),{data:JSON.stringify(n.data)})]:[2,n]}}))}))},"database.updateDocInTransaction":function(e){return tu(this,void 0,void 0,(function(){var t;return nu(this,(function(n){switch(n.label){case 0:return e.data=ru.safeParseEJSON(e.data),[4,ru["database.updateDocument"].call(this,e)];case 1:return t=n.sent(),[2,ru.flattenResData(t)]}}))}))},"database.deleteDocInTransaction":function(e){return tu(this,void 0,void 0,(function(){var t;return nu(this,(function(n){switch(n.label){case 0:return[4,ru["database.deleteDocument"].call(this,e)];case 1:return t=n.sent(),[2,ru.flattenResData(t)]}}))}))},"database.insertDocInTransaction":function(e){var t;return tu(this,void 0,Promise,(function(){var n,r;return nu(this,(function(o){switch(o.label){case 0:return e.data=ru.safeParseEJSON(e.data),[4,ru["database.addDocument"].call(this,e)];case 1:return"object"==typeof(n=o.sent()).data&&null!==n.data?(r=!!(null===(t=n.data)||void 0===t?void 0:t._id),n=eu(eu(eu({},n),{inserted:r?1:0,ok:r?1:0}),n.data)):n=eu({inserted:0,ok:0},n),delete n.data,[2,n]}}))}))},"database.runCommands":function(e){return tu(this,void 0,Promise,(function(){var t;return nu(this,(function(n){switch(n.label){case 0:return[4,this.gateWay({url:"".concat(ru.getUrlPrefix(e),"/commands"),method:"POST",data:eu({commands:Ic.EJSON.serialize(e.commands)},e.transactionId&&{transactionId:e.transactionId})})];case 1:"object"==typeof(t=n.sent()).data&&null!==t.data&&(delete(t=eu(eu({},t),t.data)).data,delete t.request_id);try{t=Ic.EJSON.deserialize(t)}catch(e){}return[2,ru.filterRes(t)]}}))}))}},ou={name:"database",entity:{database:function(e){var t=this.platform,n=t.adapter,r=t.runtime,o=function(e){function t(t){return e.call(this,t)||this}return Zc(t,e),t.prototype.send=function(t,n){return tu(this,void 0,void 0,(function(){var r;return nu(this,(function(o){switch(o.label){case 0:return r=null,"GATEWAY"===this.config.endPointMode&&ru[t]?[4,ru[t].call(this,n)]:[3,2];case 1:return r=o.sent(),[3,4];case 2:return[4,e.prototype.send.call(this,t,n)];case 3:r=o.sent(),o.label=4;case 4:return[2,r]}}))}))},t}(this.request.constructor);return Xc.reqClass=o,Xc.getAccessToken=this.authInstance?this.authInstance.getAccessToken.bind(this.authInstance):function(){return""},Xc.runtime=r,this.wsClientClass&&(Xc.wsClass=n.wsClass,Xc.wsClientClass=this.wsClientClass),Xc.ws||(Xc.ws=null),new(function(e){function t(t){return e.call(this,t)||this}return Zc(t,e),t.prototype.runCommands=function(e){return tu(this,void 0,Promise,(function(){return nu(this,(function(t){return[2,Xc.createRequest(this.config).send("database.runCommands",e)]}))}))},t}(Xc))(eu(eu(eu({},this.config),{_fromApp:this}),e))}}};try{cloudbase.registerComponent(ou)}catch(e){}function iu(e){try{e.registerComponent(ou)}catch(e){console.warn(e)}}try{window.registerDatabase=iu}catch(e){}se.registerVersion("3.5.5-beta.2");try{var au=f(7922).mI,su=f(2301);se.useAdapters(su.default);var cu=se;cu.version=au(),cu.SYMBOL_CURRENT_ENV=su.SYMBOL_CURRENT_ENV,cu.SYMBOL_DEFAULT_ENV=su.SYMBOL_DEFAULT_ENV,cu.parseContext=su.parseContext,cu.getCloudbaseContext=su.getCloudbaseContext}catch(e){}try{!function(e){try{e.registerComponent(an)}catch(e){console.warn(e)}}(se),function(e){try{e.registerComponent(An)}catch(e){console.warn(e)}}(se),Fr(se),iu(se),function(e){try{e.registerComponent(Eo),e.registerHook(Io)}catch(e){console.warn(e)}}(se),Uo(se),Sa(se),gn(se),Ra(se),Wa(se)}catch(e){}try{window.cloudbase=se}catch(e){}const uu=se})();var v=m.Z;export{v as default};
3
3
  //# sourceMappingURL=index.node.esm.js.map