import{aS as e,aT as t,aM as i,aU as o,aV as a,$ as n,a1 as r,aW as s,aA as l,aX as c,aY as h,aZ as d,a_ as u,s as p,af as g,a$ as f,b0 as x,b1 as y,ar as m,n as v,b2 as b,am as S,b3 as w,b4 as T,b5 as A,b6 as _,b7 as P,o as C,c as k,w as D,d as L,i as I,an as M,m as F,e as O,t as E,b8 as R,b9 as N,at as z,ba as B,bb as U,b as W,bc as j,P as q,bd as $,be as H}from"./index-IX2tYR8R.js";import{_ as G}from"./_plugin-vue_export-helper.BCo6x5W8.js";import{r as J}from"./uni-app.es.Bc5t55A8.js";const K={pages:[{path:"pages/index/index",style:{navigationBarTitleText:"",enablePullDownRefresh:!0,navigationStyle:"custom"}},{path:"pages/index/comp/city",style:{navigationBarTitleText:"选择城市",enablePullDownRefresh:!1}}],subPackages:[{root:"pages/vip",pages:[{path:"vipEntry/vipEntry",style:{navigationBarTitleText:"vip",enablePullDownRefresh:!0,navigationStyle:"custom"}},{path:"paymentOrder/paymentOrder",style:{navigationBarTitleText:"vip",enablePullDownRefresh:!0,navigationStyle:"custom"}},{path:"vipQuestions/vipQuestions",style:{navigationBarTitleText:"VIP常见问题说明",enablePullDownRefresh:!1,backgroundTextStyle:"dark"}}]},{root:"pages/exercises",pages:[{path:"chapter/chapter",style:{navigationBarTitleText:"章节练习",enablePullDownRefresh:!1,backgroundTextStyle:"dark"}},{path:"webView/webView",style:{navigationBarTitleText:"",enablePullDownRefresh:!1,backgroundTextStyle:"dark"}},{path:"brushQuestions/brushQuestions",style:{navigationBarTitleText:"刷题",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"brushQuestions/examQuestions",style:{navigationBarTitleText:"模拟考试",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"brushQuestions/wrongQuestions",style:{navigationBarTitleText:"刷错题",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"exam/exam",style:{navigationBarTitleText:"考试",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"examIntroduction/examIntroduction",style:{navigationBarTitleText:"考试简介",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"beforeExam/beforeExam",style:{navigationBarTitleText:"考试须知",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"examResults/examResults",style:{navigationBarTitleText:"模拟考试成绩",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"wrongQuestion/wrongQuestion",style:{navigationBarTitleText:"模拟考试成绩",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"theoryStudy/theoryStudy",style:{navigationBarTitleText:"理论学习",enablePullDownRefresh:!0,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"categoryExercises/categoryExercises",style:{navigationBarTitleText:"分类练习",enablePullDownRefresh:!1,backgroundTextStyle:"dark"}},{path:"queTypeExercises/queTypeExercises",style:{navigationBarTitleText:"题型练习",enablePullDownRefresh:!1,backgroundTextStyle:"dark"}},{path:"myStudy/myStudy",style:{navigationBarTitleText:"我的学习",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"lastPage/lastPage",style:{navigationBarTitleText:"顺序练习成绩",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"examSubjiect1/examSubjiect1",style:{navigationBarTitleText:"科目一成绩单",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"examSubjiect1/examResultsOne",style:{navigationBarTitleText:"模拟考试成绩",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}}]}],globalStyle:{navigationBarTextStyle:"black",navigationBarTitleText:"习题题库",navigationBarBackgroundColor:"#F8F8F8",backgroundColor:"#F8F8F8"},uniIdRouter:{},easycom:{autoscan:!0,custom:{"^u--(.*)":"@/uni_modules/uview-plus/components/u-$1/u-$1.vue","^up-(.*)":"@/uni_modules/uview-plus/components/u-$1/u-$1.vue","^u-([^-].*)":"@/uni_modules/uview-plus/components/u-$1/u-$1.vue"}}};function X(e,t,i){return e(i={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&i.path)}},i.exports),i.exports}var V=X((function(e,t){var i;e.exports=(i=i||function(e,t){var i=Object.create||function(){function e(){}return function(t){var i;return e.prototype=t,i=new e,e.prototype=null,i}}(),o={},a=o.lib={},n=a.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},r=a.WordArray=n.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,i=e.words,o=this.sigBytes,a=e.sigBytes;if(this.clamp(),o%4)for(var n=0;n>>2]>>>24-n%4*8&255;t[o+n>>>2]|=r<<24-(o+n)%4*8}else for(n=0;n>>2]=i[n>>>2];return this.sigBytes+=a,this},clamp:function(){var t=this.words,i=this.sigBytes;t[i>>>2]&=4294967295<<32-i%4*8,t.length=e.ceil(i/4)},clone:function(){var e=n.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var i,o=[],a=function(t){var i=987654321,o=4294967295;return function(){var a=((i=36969*(65535&i)+(i>>16)&o)<<16)+(t=18e3*(65535&t)+(t>>16)&o)&o;return a/=4294967296,(a+=.5)*(e.random()>.5?1:-1)}},n=0;n>>2]>>>24-a%4*8&255;o.push((n>>>4).toString(16)),o.push((15&n).toString(16))}return o.join("")},parse:function(e){for(var t=e.length,i=[],o=0;o>>3]|=parseInt(e.substr(o,2),16)<<24-o%8*4;return new r.init(i,t/2)}},c=s.Latin1={stringify:function(e){for(var t=e.words,i=e.sigBytes,o=[],a=0;a>>2]>>>24-a%4*8&255;o.push(String.fromCharCode(n))}return o.join("")},parse:function(e){for(var t=e.length,i=[],o=0;o>>2]|=(255&e.charCodeAt(o))<<24-o%4*8;return new r.init(i,t)}},h=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},d=a.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=new r.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var i=this._data,o=i.words,a=i.sigBytes,n=this.blockSize,s=a/(4*n),l=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*n,c=e.min(4*l,a);if(l){for(var h=0;h>>24)|4278255360&(a<<24|a>>>8)}var n=this._hash.words,r=e[t+0],l=e[t+1],p=e[t+2],g=e[t+3],f=e[t+4],x=e[t+5],y=e[t+6],m=e[t+7],v=e[t+8],b=e[t+9],S=e[t+10],w=e[t+11],T=e[t+12],A=e[t+13],_=e[t+14],P=e[t+15],C=n[0],k=n[1],D=n[2],L=n[3];C=c(C,k,D,L,r,7,s[0]),L=c(L,C,k,D,l,12,s[1]),D=c(D,L,C,k,p,17,s[2]),k=c(k,D,L,C,g,22,s[3]),C=c(C,k,D,L,f,7,s[4]),L=c(L,C,k,D,x,12,s[5]),D=c(D,L,C,k,y,17,s[6]),k=c(k,D,L,C,m,22,s[7]),C=c(C,k,D,L,v,7,s[8]),L=c(L,C,k,D,b,12,s[9]),D=c(D,L,C,k,S,17,s[10]),k=c(k,D,L,C,w,22,s[11]),C=c(C,k,D,L,T,7,s[12]),L=c(L,C,k,D,A,12,s[13]),D=c(D,L,C,k,_,17,s[14]),C=h(C,k=c(k,D,L,C,P,22,s[15]),D,L,l,5,s[16]),L=h(L,C,k,D,y,9,s[17]),D=h(D,L,C,k,w,14,s[18]),k=h(k,D,L,C,r,20,s[19]),C=h(C,k,D,L,x,5,s[20]),L=h(L,C,k,D,S,9,s[21]),D=h(D,L,C,k,P,14,s[22]),k=h(k,D,L,C,f,20,s[23]),C=h(C,k,D,L,b,5,s[24]),L=h(L,C,k,D,_,9,s[25]),D=h(D,L,C,k,g,14,s[26]),k=h(k,D,L,C,v,20,s[27]),C=h(C,k,D,L,A,5,s[28]),L=h(L,C,k,D,p,9,s[29]),D=h(D,L,C,k,m,14,s[30]),C=d(C,k=h(k,D,L,C,T,20,s[31]),D,L,x,4,s[32]),L=d(L,C,k,D,v,11,s[33]),D=d(D,L,C,k,w,16,s[34]),k=d(k,D,L,C,_,23,s[35]),C=d(C,k,D,L,l,4,s[36]),L=d(L,C,k,D,f,11,s[37]),D=d(D,L,C,k,m,16,s[38]),k=d(k,D,L,C,S,23,s[39]),C=d(C,k,D,L,A,4,s[40]),L=d(L,C,k,D,r,11,s[41]),D=d(D,L,C,k,g,16,s[42]),k=d(k,D,L,C,y,23,s[43]),C=d(C,k,D,L,b,4,s[44]),L=d(L,C,k,D,T,11,s[45]),D=d(D,L,C,k,P,16,s[46]),C=u(C,k=d(k,D,L,C,p,23,s[47]),D,L,r,6,s[48]),L=u(L,C,k,D,m,10,s[49]),D=u(D,L,C,k,_,15,s[50]),k=u(k,D,L,C,x,21,s[51]),C=u(C,k,D,L,T,6,s[52]),L=u(L,C,k,D,g,10,s[53]),D=u(D,L,C,k,S,15,s[54]),k=u(k,D,L,C,l,21,s[55]),C=u(C,k,D,L,v,6,s[56]),L=u(L,C,k,D,P,10,s[57]),D=u(D,L,C,k,y,15,s[58]),k=u(k,D,L,C,A,21,s[59]),C=u(C,k,D,L,f,6,s[60]),L=u(L,C,k,D,w,10,s[61]),D=u(D,L,C,k,p,15,s[62]),k=u(k,D,L,C,b,21,s[63]),n[0]=n[0]+C|0,n[1]=n[1]+k|0,n[2]=n[2]+D|0,n[3]=n[3]+L|0},_doFinalize:function(){var t=this._data,i=t.words,o=8*this._nDataBytes,a=8*t.sigBytes;i[a>>>5]|=128<<24-a%32;var n=e.floor(o/4294967296),r=o;i[15+(a+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),i[14+(a+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(i.length+1),this._process();for(var s=this._hash,l=s.words,c=0;c<4;c++){var h=l[c];l[c]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8)}return s},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,i,o,a,n,r){var s=e+(t&i|~t&o)+a+r;return(s<>>32-n)+t}function h(e,t,i,o,a,n,r){var s=e+(t&o|i&~o)+a+r;return(s<>>32-n)+t}function d(e,t,i,o,a,n,r){var s=e+(t^i^o)+a+r;return(s<>>32-n)+t}function u(e,t,i,o,a,n,r){var s=e+(i^(t|~o))+a+r;return(s<>>32-n)+t}t.MD5=n._createHelper(l),t.HmacMD5=n._createHmacHelper(l)}(Math),i.MD5)})),X((function(e,t){var i,o,a;e.exports=(o=(i=Y).lib.Base,a=i.enc.Utf8,void(i.algo.HMAC=o.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var i=e.blockSize,o=4*i;t.sigBytes>o&&(t=e.finalize(t)),t.clamp();for(var n=this._oKey=t.clone(),r=this._iKey=t.clone(),s=n.words,l=r.words,c=0;c>>2]>>>24-n%4*8&255)<<16|(t[n+1>>>2]>>>24-(n+1)%4*8&255)<<8|t[n+2>>>2]>>>24-(n+2)%4*8&255,s=0;s<4&&n+.75*s>>6*(3-s)&63));var l=o.charAt(64);if(l)for(;a.length%4;)a.push(l);return a.join("")},parse:function(e){var t=e.length,i=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var n=0;n>>6-r%4*2;o[n>>>2]|=(s|l)<<24-n%4*8,n++}return a.create(o,n)}(e,t,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},i.enc.Base64)}));const te="FUNCTION",ie="pending",oe="rejected";function ae(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function ne(e){return"object"===ae(e)}function re(e){return"function"==typeof e}function se(e){return function(){try{return e.apply(e,arguments)}catch(t){console.error(t)}}}const le="REJECTED",ce="NOT_PENDING";class he{constructor({createPromise:e,retryRule:t=le}={}){this.createPromise=e,this.status=null,this.promise=null,this.retryRule=t}get needRetry(){if(!this.status)return!0;switch(this.retryRule){case le:return this.status===oe;case ce:return this.status!==ie}}exec(){return this.needRetry?(this.status=ie,this.promise=this.createPromise().then((e=>(this.status="fulfilled",Promise.resolve(e))),(e=>(this.status=oe,Promise.reject(e)))),this.promise):this.promise}}function de(e){return e&&"string"==typeof e?JSON.parse(e):e}const ue=de([]);de("");const pe=de("[]")||[];let ge="";try{ge="__UNI__445D057"}catch(it){}let fe={};function xe(e,t={}){var i,o;return i=fe,o=e,Object.prototype.hasOwnProperty.call(i,o)||(fe[e]=t),fe[e]}const ye=["invoke","success","fail","complete"],me=xe("_globalUniCloudInterceptor");function ve(e,t){me[e]||(me[e]={}),ne(t)&&Object.keys(t).forEach((i=>{ye.indexOf(i)>-1&&function(e,t,i){let o=me[e][t];o||(o=me[e][t]=[]),-1===o.indexOf(i)&&re(i)&&o.push(i)}(e,i,t[i])}))}function be(e,t){me[e]||(me[e]={}),ne(t)?Object.keys(t).forEach((i=>{ye.indexOf(i)>-1&&function(e,t,i){const o=me[e][t];if(!o)return;const a=o.indexOf(i);a>-1&&o.splice(a,1)}(e,i,t[i])})):delete me[e]}function Se(e,t){return e&&0!==e.length?e.reduce(((e,i)=>e.then((()=>i(t)))),Promise.resolve()):Promise.resolve()}function we(e,t){return me[e]&&me[e][t]||[]}function Te(e){ve("callObject",e)}const Ae=xe("_globalUniCloudListener"),_e="response",Pe="needLogin",Ce="refreshToken",ke="clientdb",De="cloudfunction",Le="cloudobject";function Ie(e){return Ae[e]||(Ae[e]=[]),Ae[e]}function Me(e,t){const i=Ie(e);i.includes(t)||i.push(t)}function Fe(e,t){const i=Ie(e),o=i.indexOf(t);-1!==o&&i.splice(o,1)}function Oe(e,t){const i=Ie(e);for(let o=0;o{Re&&e(),function t(){if("function"==typeof i){const t=i();t&&t[0]&&(Re=!0,e())}Re||setTimeout((()=>{t()}),30)}()})),Ee)}function ze(e){const t={};for(const i in e){const o=e[i];re(o)&&(t[i]=se(o))}return t}class Be extends Error{constructor(e){super(e.message),this.errMsg=e.message||e.errMsg||"unknown system error",this.code=this.errCode=e.code||e.errCode||"SYSTEM_ERROR",this.errSubject=this.subject=e.subject||e.errSubject,this.cause=e.cause,this.requestId=e.requestId}toJson(e=0){if(!(e>=10))return e++,{errCode:this.errCode,errMsg:this.errMsg,errSubject:this.errSubject,cause:this.cause&&this.cause.toJson?this.cause.toJson(e):this.cause}}}var Ue={request:e=>d(e),uploadFile:e=>u(e),setStorageSync:(e,t)=>p(e,t),getStorageSync:e=>g(e),removeStorageSync:e=>f(e),clearStorageSync:()=>x(),connectSocket:e=>y(e)};function We(e){return e&&We(e.__v_raw)||e}function je(){return{token:Ue.getStorageSync("uni_id_token")||Ue.getStorageSync("uniIdToken"),tokenExpired:Ue.getStorageSync("uni_id_token_expired")}}function qe({token:e,tokenExpired:t}={}){e&&Ue.setStorageSync("uni_id_token",e),t&&Ue.setStorageSync("uni_id_token_expired",t)}let $e,He;function Ge(){return $e||($e=m()),$e}function Je(){let e,t;try{if(P){if(P.toString().indexOf("not yet implemented")>-1)return;const{scene:i,channel:o}=P();e=o,t=i}}catch(i){}return{channel:e,scene:t}}let Ke={};function Xe(){const e=_&&_()||"en";if(He)return{...Ke,...He,locale:e,LOCALE:e};const t=Ge(),{deviceId:i,osName:o,uniPlatform:a,appId:n}=t,r=["appId","appLanguage","appName","appVersion","appVersionCode","appWgtVersion","browserName","browserVersion","deviceBrand","deviceId","deviceModel","deviceType","osName","osVersion","romName","romVersion","ua","hostName","hostVersion","uniPlatform","uniRuntimeVersion","uniRuntimeVersionCode","uniCompilerVersion","uniCompilerVersionCode"];for(const s in t)Object.hasOwnProperty.call(t,s)&&-1===r.indexOf(s)&&delete t[s];return He={PLATFORM:a,OS:o,APPID:n,DEVICEID:i,...Je(),...t},{...Ke,...He,locale:e,LOCALE:e}}var Ve=function(e,t){let i="";return Object.keys(e).sort().forEach((function(t){e[t]&&(i=i+"&"+t+"="+e[t])})),i=i.slice(1),Q(i,t).toString()},Ye=function(e,t){return new Promise(((i,o)=>{t(Object.assign(e,{complete(e){e||(e={});const t=e.data&&e.data.header&&e.data.header["x-serverless-request-id"]||e.header&&e.header["request-id"];if(!e.statusCode||e.statusCode>=400){const i=e.data&&e.data.error&&e.data.error.code||"SYS_ERR",a=e.data&&e.data.error&&e.data.error.message||e.errMsg||"request:fail";return o(new Be({code:i,message:a,requestId:t}))}const a=e.data;if(a.error)return o(new Be({code:a.error.code,message:a.error.message,requestId:t}));a.result=a.data,a.requestId=t,delete a.data,i(a)}}))}))},Qe=function(e){return ee.stringify(Z.parse(e))},Ze={init(e){const t=new class{constructor(e){["spaceId","clientSecret"].forEach((t=>{if(!Object.prototype.hasOwnProperty.call(e,t))throw new Error(`${t} required`)})),this.config=Object.assign({},{endpoint:0===e.spaceId.indexOf("mp-")?"https://api.next.bspapp.com":"https://api.bspapp.com"},e),this.config.provider="aliyun",this.config.requestUrl=this.config.endpoint+"/client",this.config.envType=this.config.envType||"public",this.config.accessTokenKey="access_token_"+this.config.spaceId,this.adapter=Ue,this._getAccessTokenPromiseHub=new he({createPromise:()=>this.requestAuth(this.setupRequest({method:"serverless.auth.user.anonymousAuthorize",params:"{}"},"auth")).then((e=>{if(!e.result||!e.result.accessToken)throw new Be({code:"AUTH_FAILED",message:"获取accessToken失败"});this.setAccessToken(e.result.accessToken)})),retryRule:ce})}get hasAccessToken(){return!!this.accessToken}setAccessToken(e){this.accessToken=e}requestWrapped(e){return Ye(e,this.adapter.request)}requestAuth(e){return this.requestWrapped(e)}request(e,t){return Promise.resolve().then((()=>this.hasAccessToken?t?this.requestWrapped(e):this.requestWrapped(e).catch((t=>new Promise(((e,i)=>{!t||"GATEWAY_INVALID_TOKEN"!==t.code&&"InvalidParameter.InvalidToken"!==t.code?i(t):e()})).then((()=>this.getAccessToken())).then((()=>{const t=this.rebuildRequest(e);return this.request(t,!0)})))):this.getAccessToken().then((()=>{const t=this.rebuildRequest(e);return this.request(t,!0)}))))}rebuildRequest(e){const t=Object.assign({},e);return t.data.token=this.accessToken,t.header["x-basement-token"]=this.accessToken,t.header["x-serverless-sign"]=Ve(t.data,this.config.clientSecret),t}setupRequest(e,t){const i=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now()}),o={"Content-Type":"application/json"};return"auth"!==t&&(i.token=this.accessToken,o["x-basement-token"]=this.accessToken),o["x-serverless-sign"]=Ve(i,this.config.clientSecret),{url:this.config.requestUrl,method:"POST",data:i,dataType:"json",header:o}}getAccessToken(){return this._getAccessTokenPromiseHub.exec()}async authorize(){await this.getAccessToken()}callFunction(e){const t={method:"serverless.function.runtime.invoke",params:JSON.stringify({functionTarget:e.name,functionArgs:e.data||{}})};return this.request({...this.setupRequest(t),timeout:e.timeout})}getOSSUploadOptionsFromPath(e){const t={method:"serverless.file.resource.generateProximalSign",params:JSON.stringify(e)};return this.request(this.setupRequest(t))}uploadFileToOSS({url:e,formData:t,name:i,filePath:o,fileType:a,onUploadProgress:n}){return new Promise(((r,s)=>{const l=this.adapter.uploadFile({url:e,formData:t,name:i,filePath:o,fileType:a,header:{"X-OSS-server-side-encrpytion":"AES256"},success(e){e&&e.statusCode<400?r(e):s(new Be({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){s(new Be({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeof n&&l&&"function"==typeof l.onProgressUpdate&&l.onProgressUpdate((e=>{n({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))}reportOSSUpload(e){const t={method:"serverless.file.resource.report",params:JSON.stringify(e)};return this.request(this.setupRequest(t))}async uploadFile({filePath:e,cloudPath:t,fileType:i="image",cloudPathAsRealPath:o=!1,onUploadProgress:a,config:n}){if("string"!==ae(t))throw new Be({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(t=t.trim()))throw new Be({code:"INVALID_PARAM",message:"cloudPath不可为空"});if(/:\/\//.test(t))throw new Be({code:"INVALID_PARAM",message:"cloudPath不合法"});const r=n&&n.envType||this.config.envType;if(o&&("/"!==t[0]&&(t="/"+t),t.indexOf("\\")>-1))throw new Be({code:"INVALID_PARAM",message:"使用cloudPath作为路径时,cloudPath不可包含“\\”"});const s=(await this.getOSSUploadOptionsFromPath({env:r,filename:o?t.split("/").pop():t,fileId:o?t:void 0})).result,l="https://"+s.cdnDomain+"/"+s.ossPath,{securityToken:c,accessKeyId:h,signature:d,host:u,ossPath:p,id:g,policy:f,ossCallbackUrl:x}=s,y={"Cache-Control":"max-age=2592000","Content-Disposition":"attachment",OSSAccessKeyId:h,Signature:d,host:u,id:g,key:p,policy:f,success_action_status:200};if(c&&(y["x-oss-security-token"]=c),x){const e=JSON.stringify({callbackUrl:x,callbackBody:JSON.stringify({fileId:g,spaceId:this.config.spaceId}),callbackBodyType:"application/json"});y.callback=Qe(e)}const m={url:"https://"+s.host,formData:y,fileName:"file",name:"file",filePath:e,fileType:i};if(await this.uploadFileToOSS(Object.assign({},m,{onUploadProgress:a})),x)return{success:!0,filePath:e,fileID:l};if((await this.reportOSSUpload({id:g})).success)return{success:!0,filePath:e,fileID:l};throw new Be({code:"UPLOAD_FAILED",message:"文件上传失败"})}getTempFileURL({fileList:e}={}){return new Promise(((t,i)=>{Array.isArray(e)&&0!==e.length||i(new Be({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"})),t({fileList:e.map((e=>({fileID:e,tempFileURL:e})))})}))}async getFileInfo({fileList:e}={}){if(!Array.isArray(e)||0===e.length)throw new Be({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});const t={method:"serverless.file.resource.info",params:JSON.stringify({id:e.map((e=>e.split("?")[0])).join(",")})};return{fileList:(await this.request(this.setupRequest(t))).result}}}(e),i={signInAnonymously:function(){return t.authorize()},getLoginState:function(){return Promise.resolve(!1)}};return t.auth=function(){return i},t.customAuth=t.auth,t}};const et="undefined"!=typeof location&&"http:"===location.protocol?"http:":"https:";var tt,it;(it=tt||(tt={})).local="local",it.none="none",it.session="session";var ot=function(){},at=X((function(e,t){var i;e.exports=(i=Y,function(e){var t=i,o=t.lib,a=o.WordArray,n=o.Hasher,r=t.algo,s=[],l=[];!function(){function t(t){for(var i=e.sqrt(t),o=2;o<=i;o++)if(!(t%o))return!1;return!0}function i(e){return 4294967296*(e-(0|e))|0}for(var o=2,a=0;a<64;)t(o)&&(a<8&&(s[a]=i(e.pow(o,.5))),l[a]=i(e.pow(o,1/3)),a++),o++}();var c=[],h=r.SHA256=n.extend({_doReset:function(){this._hash=new a.init(s.slice(0))},_doProcessBlock:function(e,t){for(var i=this._hash.words,o=i[0],a=i[1],n=i[2],r=i[3],s=i[4],h=i[5],d=i[6],u=i[7],p=0;p<64;p++){if(p<16)c[p]=0|e[t+p];else{var g=c[p-15],f=(g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3,x=c[p-2],y=(x<<15|x>>>17)^(x<<13|x>>>19)^x>>>10;c[p]=f+c[p-7]+y+c[p-16]}var m=o&a^o&n^a&n,v=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),b=u+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&h^~s&d)+l[p]+c[p];u=d,d=h,h=s,s=r+b|0,r=n,n=a,a=o,o=b+(v+m)|0}i[0]=i[0]+o|0,i[1]=i[1]+a|0,i[2]=i[2]+n|0,i[3]=i[3]+r|0,i[4]=i[4]+s|0,i[5]=i[5]+h|0,i[6]=i[6]+d|0,i[7]=i[7]+u|0},_doFinalize:function(){var t=this._data,i=t.words,o=8*this._nDataBytes,a=8*t.sigBytes;return i[a>>>5]|=128<<24-a%32,i[14+(a+64>>>9<<4)]=e.floor(o/4294967296),i[15+(a+64>>>9<<4)]=o,t.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=n._createHelper(h),t.HmacSHA256=n._createHmacHelper(h)}(Math),i.SHA256)})),nt=at,rt=X((function(e,t){e.exports=Y.HmacSHA256}));const st=()=>{let e;if(!Promise){e=()=>{},e.promise={};const t=()=>{throw new Be({message:'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}const t=new Promise(((t,i)=>{e=(e,o)=>e?i(e):t(o)}));return e.promise=t,e};function lt(e){return void 0===e}function ct(e){return"[object Null]"===Object.prototype.toString.call(e)}var ht;!function(e){e.WEB="web",e.WX_MP="wx_mp"}(ht||(ht={}));const dt={adapter:null,runtime:void 0},ut=["anonymousUuidKey"];class pt extends ot{constructor(){super(),dt.adapter.root.tcbObject||(dt.adapter.root.tcbObject={})}setItem(e,t){dt.adapter.root.tcbObject[e]=t}getItem(e){return dt.adapter.root.tcbObject[e]}removeItem(e){delete dt.adapter.root.tcbObject[e]}clear(){delete dt.adapter.root.tcbObject}}function gt(e,t){switch(e){case"local":return t.localStorage||new pt;case"none":return new pt;default:return t.sessionStorage||new pt}}class ft{constructor(e){if(!this._storage){this._persistence=dt.adapter.primaryStorage||e.persistence,this._storage=gt(this._persistence,dt.adapter);const t=`access_token_${e.env}`,i=`access_token_expire_${e.env}`,o=`refresh_token_${e.env}`,a=`anonymous_uuid_${e.env}`,n=`login_type_${e.env}`,r=`user_info_${e.env}`;this.keys={accessTokenKey:t,accessTokenExpireKey:i,refreshTokenKey:o,anonymousUuidKey:a,loginTypeKey:n,userInfoKey:r}}}updatePersistence(e){if(e===this._persistence)return;const t="local"===this._persistence;this._persistence=e;const i=gt(e,dt.adapter);for(const o in this.keys){const e=this.keys[o];if(t&&ut.includes(o))continue;const a=this._storage.getItem(e);lt(a)||ct(a)||(i.setItem(e,a),this._storage.removeItem(e))}this._storage=i}setStore(e,t,i){if(!this._storage)return;const o={version:i||"localCachev1",content:t},a=JSON.stringify(o);try{this._storage.setItem(e,a)}catch(n){throw n}}getStore(e,t){try{if(!this._storage)return}catch(o){return""}t=t||"localCachev1";const i=this._storage.getItem(e);return i&&i.indexOf(t)>=0?JSON.parse(i).content:""}removeStore(e){this._storage.removeItem(e)}}const xt={},yt={};function mt(e){return xt[e]}class vt{constructor(e,t){this.data=t||null,this.name=e}}class bt extends vt{constructor(e,t){super("error",{error:e,data:t}),this.error=e}}const St=new class{constructor(){this._listeners={}}on(e,t){return i=e,o=t,(a=this._listeners)[i]=a[i]||[],a[i].push(o),this;var i,o,a}off(e,t){return function(e,t,i){if(i&&i[e]){const o=i[e].indexOf(t);-1!==o&&i[e].splice(o,1)}}(e,t,this._listeners),this}fire(e,t){if(e instanceof bt)return console.error(e.error),this;const i="string"==typeof e?new vt(e,t||{}):e,o=i.name;if(this._listens(o)){i.target=this;const e=this._listeners[o]?[...this._listeners[o]]:[];for(const t of e)t.call(this,i)}return this}_listens(e){return this._listeners[e]&&this._listeners[e].length>0}};function wt(e,t){St.on(e,t)}function Tt(e,t={}){St.fire(e,t)}function At(e,t){St.off(e,t)}const _t="loginStateChanged",Pt="loginStateExpire",Ct="loginTypeChanged",kt="anonymousConverted",Dt="refreshAccessToken";var Lt;!function(e){e.ANONYMOUS="ANONYMOUS",e.WECHAT="WECHAT",e.WECHAT_PUBLIC="WECHAT-PUBLIC",e.WECHAT_OPEN="WECHAT-OPEN",e.CUSTOM="CUSTOM",e.EMAIL="EMAIL",e.USERNAME="USERNAME",e.NULL="NULL"}(Lt||(Lt={}));const It=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"],Mt={"X-SDK-Version":"1.3.5"};function Ft(e,t,i){const o=e[t];e[t]=function(t){const a={},n={};i.forEach((i=>{const{data:o,headers:r}=i.call(e,t);Object.assign(a,o),Object.assign(n,r)}));const r=t.data;return r&&(()=>{var e;if(e=r,"[object FormData]"!==Object.prototype.toString.call(e))t.data={...r,...a};else for(const t in a)r.append(t,a[t])})(),t.headers={...t.headers||{},...n},o.call(e,t)}}function Ot(){const e=Math.random().toString(16).slice(2);return{data:{seqId:e},headers:{...Mt,"x-seqid":e}}}class Et{constructor(e={}){var t;this.config=e,this._reqClass=new dt.adapter.reqClass({timeout:this.config.timeout,timeoutMsg:`请求在${this.config.timeout/1e3}s内未完成,已中断`,restrictedMethods:["post"]}),this._cache=mt(this.config.env),this._localCache=(t=this.config.env,yt[t]),Ft(this._reqClass,"post",[Ot]),Ft(this._reqClass,"upload",[Ot]),Ft(this._reqClass,"download",[Ot])}async post(e){return await this._reqClass.post(e)}async upload(e){return await this._reqClass.upload(e)}async download(e){return await this._reqClass.download(e)}async refreshAccessToken(){let e,t;this._refreshAccessTokenPromise||(this._refreshAccessTokenPromise=this._refreshAccessToken());try{e=await this._refreshAccessTokenPromise}catch(i){t=i}if(this._refreshAccessTokenPromise=null,this._shouldRefreshAccessTokenHook=null,t)throw t;return e}async _refreshAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:i,loginTypeKey:o,anonymousUuidKey:a}=this._cache.keys;this._cache.removeStore(e),this._cache.removeStore(t);let n=this._cache.getStore(i);if(!n)throw new Be({message:"未登录CloudBase"});const r={refresh_token:n},s=await this.request("auth.fetchAccessTokenWithRefreshToken",r);if(s.data.code){const{code:e}=s.data;if("SIGN_PARAM_INVALID"===e||"REFRESH_TOKEN_EXPIRED"===e||"INVALID_REFRESH_TOKEN"===e){if(this._cache.getStore(o)===Lt.ANONYMOUS&&"INVALID_REFRESH_TOKEN"===e){const e=this._cache.getStore(a),t=this._cache.getStore(i),o=await this.send("auth.signInAnonymously",{anonymous_uuid:e,refresh_token:t});return this.setRefreshToken(o.refresh_token),this._refreshAccessToken()}Tt(Pt),this._cache.removeStore(i)}throw new Be({code:s.data.code,message:`刷新access token失败:${s.data.code}`})}if(s.data.access_token)return Tt(Dt),this._cache.setStore(e,s.data.access_token),this._cache.setStore(t,s.data.access_token_expire+Date.now()),{accessToken:s.data.access_token,accessTokenExpire:s.data.access_token_expire};s.data.refresh_token&&(this._cache.removeStore(i),this._cache.setStore(i,s.data.refresh_token),this._refreshAccessToken())}async getAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:i}=this._cache.keys;if(!this._cache.getStore(i))throw new Be({message:"refresh token不存在,登录状态异常"});let o=this._cache.getStore(e),a=this._cache.getStore(t),n=!0;return this._shouldRefreshAccessTokenHook&&!(await this._shouldRefreshAccessTokenHook(o,a))&&(n=!1),(!o||!a||a{e.wxOpenId&&e.wxPublicId&&(t=!0)})),{users:i,hasPrimaryUid:t}}setPrimaryUid(e){return this._request.send("auth.setPrimaryUid",{uid:e})}unlink(e){return this._request.send("auth.unlink",{platform:e})}async update(e){const{nickName:t,gender:i,avatarUrl:o,province:a,country:n,city:r}=e,{data:s}=await this._request.send("auth.updateUserInfo",{nickName:t,gender:i,avatarUrl:o,province:a,country:n,city:r});this.setLocalUserInfo(s)}async refresh(){const{data:e}=await this._request.send("auth.getUserInfo",{});return this.setLocalUserInfo(e),e}setUserInfo(){const{userInfoKey:e}=this._cache.keys,t=this._cache.getStore(e);["uid","loginType","openid","wxOpenId","wxPublicId","unionId","qqMiniOpenId","email","hasPassword","customUserId","nickName","gender","avatarUrl"].forEach((e=>{this[e]=t[e]})),this.location={country:t.country,province:t.province,city:t.city}}setLocalUserInfo(e){const{userInfoKey:t}=this._cache.keys;this._cache.setStore(t,e),this.setUserInfo()}}class Ut{constructor(e){if(!e)throw new Be({code:"PARAM_ERROR",message:"envId is not defined"});this._cache=mt(e);const{refreshTokenKey:t,accessTokenKey:i,accessTokenExpireKey:o}=this._cache.keys,a=this._cache.getStore(t),n=this._cache.getStore(i),r=this._cache.getStore(o);this.credential={refreshToken:a,accessToken:n,accessTokenExpire:r},this.user=new Bt(e)}get isAnonymousAuth(){return this.loginType===Lt.ANONYMOUS}get isCustomAuth(){return this.loginType===Lt.CUSTOM}get isWeixinAuth(){return this.loginType===Lt.WECHAT||this.loginType===Lt.WECHAT_OPEN||this.loginType===Lt.WECHAT_PUBLIC}get loginType(){return this._cache.getStore(this._cache.keys.loginTypeKey)}}class Wt extends zt{async signIn(){this._cache.updatePersistence("local");const{anonymousUuidKey:e,refreshTokenKey:t}=this._cache.keys,i=this._cache.getStore(e)||void 0,o=this._cache.getStore(t)||void 0,a=await this._request.send("auth.signInAnonymously",{anonymous_uuid:i,refresh_token:o});if(a.uuid&&a.refresh_token){this._setAnonymousUUID(a.uuid),this.setRefreshToken(a.refresh_token),await this._request.refreshAccessToken(),Tt(_t),Tt(Ct,{env:this.config.env,loginType:Lt.ANONYMOUS,persistence:"local"});const e=new Ut(this.config.env);return await e.user.refresh(),e}throw new Be({message:"匿名登录失败"})}async linkAndRetrieveDataWithTicket(e){const{anonymousUuidKey:t,refreshTokenKey:i}=this._cache.keys,o=this._cache.getStore(t),a=this._cache.getStore(i),n=await this._request.send("auth.linkAndRetrieveDataWithTicket",{anonymous_uuid:o,refresh_token:a,ticket:e});if(n.refresh_token)return this._clearAnonymousUUID(),this.setRefreshToken(n.refresh_token),await this._request.refreshAccessToken(),Tt(kt,{env:this.config.env}),Tt(Ct,{loginType:Lt.CUSTOM,persistence:"local"}),{credential:{refreshToken:n.refresh_token}};throw new Be({message:"匿名转化失败"})}_setAnonymousUUID(e){const{anonymousUuidKey:t,loginTypeKey:i}=this._cache.keys;this._cache.removeStore(t),this._cache.setStore(t,e),this._cache.setStore(i,Lt.ANONYMOUS)}_clearAnonymousUUID(){this._cache.removeStore(this._cache.keys.anonymousUuidKey)}}class jt extends zt{async signIn(e){if("string"!=typeof e)throw new Be({code:"PARAM_ERROR",message:"ticket must be a string"});const{refreshTokenKey:t}=this._cache.keys,i=await this._request.send("auth.signInWithTicket",{ticket:e,refresh_token:this._cache.getStore(t)||""});if(i.refresh_token)return this.setRefreshToken(i.refresh_token),await this._request.refreshAccessToken(),Tt(_t),Tt(Ct,{env:this.config.env,loginType:Lt.CUSTOM,persistence:this.config.persistence}),await this.refreshUserInfo(),new Ut(this.config.env);throw new Be({message:"自定义登录失败"})}}class qt extends zt{async signIn(e,t){if("string"!=typeof e)throw new Be({code:"PARAM_ERROR",message:"email must be a string"});const{refreshTokenKey:i}=this._cache.keys,o=await this._request.send("auth.signIn",{loginType:"EMAIL",email:e,password:t,refresh_token:this._cache.getStore(i)||""}),{refresh_token:a,access_token:n,access_token_expire:r}=o;if(a)return this.setRefreshToken(a),n&&r?this.setAccessToken(n,r):await this._request.refreshAccessToken(),await this.refreshUserInfo(),Tt(_t),Tt(Ct,{env:this.config.env,loginType:Lt.EMAIL,persistence:this.config.persistence}),new Ut(this.config.env);throw o.code?new Be({code:o.code,message:`邮箱登录失败: ${o.message}`}):new Be({message:"邮箱登录失败"})}async activate(e){return this._request.send("auth.activateEndUserMail",{token:e})}async resetPasswordWithToken(e,t){return this._request.send("auth.resetPasswordWithToken",{token:e,newPassword:t})}}class $t extends zt{async signIn(e,t){if("string"!=typeof e)throw new Be({code:"PARAM_ERROR",message:"username must be a string"});"string"!=typeof t&&(t="",console.warn("password is empty"));const{refreshTokenKey:i}=this._cache.keys,o=await this._request.send("auth.signIn",{loginType:Lt.USERNAME,username:e,password:t,refresh_token:this._cache.getStore(i)||""}),{refresh_token:a,access_token_expire:n,access_token:r}=o;if(a)return this.setRefreshToken(a),r&&n?this.setAccessToken(r,n):await this._request.refreshAccessToken(),await this.refreshUserInfo(),Tt(_t),Tt(Ct,{env:this.config.env,loginType:Lt.USERNAME,persistence:this.config.persistence}),new Ut(this.config.env);throw o.code?new Be({code:o.code,message:`用户名密码登录失败: ${o.message}`}):new Be({message:"用户名密码登录失败"})}}class Ht{constructor(e){this.config=e,this._cache=mt(e.env),this._request=Nt(e.env),this._onAnonymousConverted=this._onAnonymousConverted.bind(this),this._onLoginTypeChanged=this._onLoginTypeChanged.bind(this),wt(Ct,this._onLoginTypeChanged)}get currentUser(){const e=this.hasLoginState();return e&&e.user||null}get loginType(){return this._cache.getStore(this._cache.keys.loginTypeKey)}anonymousAuthProvider(){return new Wt(this.config)}customAuthProvider(){return new jt(this.config)}emailAuthProvider(){return new qt(this.config)}usernameAuthProvider(){return new $t(this.config)}async signInAnonymously(){return new Wt(this.config).signIn()}async signInWithEmailAndPassword(e,t){return new qt(this.config).signIn(e,t)}signInWithUsernameAndPassword(e,t){return new $t(this.config).signIn(e,t)}async linkAndRetrieveDataWithTicket(e){return this._anonymousAuthProvider||(this._anonymousAuthProvider=new Wt(this.config)),wt(kt,this._onAnonymousConverted),await this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e)}async signOut(){if(this.loginType===Lt.ANONYMOUS)throw new Be({message:"匿名用户不支持登出操作"});const{refreshTokenKey:e,accessTokenKey:t,accessTokenExpireKey:i}=this._cache.keys,o=this._cache.getStore(e);if(!o)return;const a=await this._request.send("auth.logout",{refresh_token:o});return this._cache.removeStore(e),this._cache.removeStore(t),this._cache.removeStore(i),Tt(_t),Tt(Ct,{env:this.config.env,loginType:Lt.NULL,persistence:this.config.persistence}),a}async signUpWithEmailAndPassword(e,t){return this._request.send("auth.signUpWithEmailAndPassword",{email:e,password:t})}async sendPasswordResetEmail(e){return this._request.send("auth.sendPasswordResetEmail",{email:e})}onLoginStateChanged(e){wt(_t,(()=>{const t=this.hasLoginState();e.call(this,t)}));const t=this.hasLoginState();e.call(this,t)}onLoginStateExpired(e){wt(Pt,e.bind(this))}onAccessTokenRefreshed(e){wt(Dt,e.bind(this))}onAnonymousConverted(e){wt(kt,e.bind(this))}onLoginTypeChanged(e){wt(Ct,(()=>{const t=this.hasLoginState();e.call(this,t)}))}async getAccessToken(){return{accessToken:(await this._request.getAccessToken()).accessToken,env:this.config.env}}hasLoginState(){const{refreshTokenKey:e}=this._cache.keys;return this._cache.getStore(e)?new Ut(this.config.env):null}async isUsernameRegistered(e){if("string"!=typeof e)throw new Be({code:"PARAM_ERROR",message:"username must be a string"});const{data:t}=await this._request.send("auth.isUsernameRegistered",{username:e});return t&&t.isRegistered}getLoginState(){return Promise.resolve(this.hasLoginState())}async signInWithTicket(e){return new jt(this.config).signIn(e)}shouldRefreshAccessToken(e){this._request._shouldRefreshAccessTokenHook=e.bind(this)}getUserInfo(){return this._request.send("auth.getUserInfo",{}).then((e=>e.code?e:{...e.data,requestId:e.seqId}))}getAuthHeader(){const{refreshTokenKey:e,accessTokenKey:t}=this._cache.keys,i=this._cache.getStore(e);return{"x-cloudbase-credentials":this._cache.getStore(t)+"/@@/"+i}}_onAnonymousConverted(e){const{env:t}=e.data;t===this.config.env&&this._cache.updatePersistence(this.config.persistence)}_onLoginTypeChanged(e){const{loginType:t,persistence:i,env:o}=e.data;o===this.config.env&&(this._cache.updatePersistence(i),this._cache.setStore(this._cache.keys.loginTypeKey,t))}}const Gt=function(e,t){t=t||st();const i=Nt(this.config.env),{cloudPath:o,filePath:a,onUploadProgress:n,fileType:r="image"}=e;return i.send("storage.getUploadMetadata",{path:o}).then((e=>{const{data:{url:s,authorization:l,token:c,fileId:h,cosFileId:d},requestId:u}=e,p={key:o,signature:l,"x-cos-meta-fileid":d,success_action_status:"201","x-cos-security-token":c};i.upload({url:s,data:p,file:a,name:o,fileType:r,onUploadProgress:n}).then((e=>{201===e.statusCode?t(null,{fileID:h,requestId:u}):t(new Be({code:"STORAGE_REQUEST_FAIL",message:`STORAGE_REQUEST_FAIL: ${e.data}`}))})).catch((e=>{t(e)}))})).catch((e=>{t(e)})),t.promise},Jt=function(e,t){t=t||st();const i=Nt(this.config.env),{cloudPath:o}=e;return i.send("storage.getUploadMetadata",{path:o}).then((e=>{t(null,e)})).catch((e=>{t(e)})),t.promise},Kt=function({fileList:e},t){if(t=t||st(),!e||!Array.isArray(e))return{code:"INVALID_PARAM",message:"fileList必须是非空的数组"};for(let o of e)if(!o||"string"!=typeof o)return{code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"};const i={fileid_list:e};return Nt(this.config.env).send("storage.batchDeleteFile",i).then((e=>{e.code?t(null,e):t(null,{fileList:e.data.delete_list,requestId:e.requestId})})).catch((e=>{t(e)})),t.promise},Xt=function({fileList:e},t){t=t||st(),e&&Array.isArray(e)||t(null,{code:"INVALID_PARAM",message:"fileList必须是非空的数组"});let i=[];for(let a of e)"object"==typeof a?(a.hasOwnProperty("fileID")&&a.hasOwnProperty("maxAge")||t(null,{code:"INVALID_PARAM",message:"fileList的元素必须是包含fileID和maxAge的对象"}),i.push({fileid:a.fileID,max_age:a.maxAge})):"string"==typeof a?i.push({fileid:a}):t(null,{code:"INVALID_PARAM",message:"fileList的元素必须是字符串"});const o={file_list:i};return Nt(this.config.env).send("storage.batchGetDownloadUrl",o).then((e=>{e.code?t(null,e):t(null,{fileList:e.data.download_list,requestId:e.requestId})})).catch((e=>{t(e)})),t.promise},Vt=async function({fileID:e},t){const i=(await Xt.call(this,{fileList:[{fileID:e,maxAge:600}]})).fileList[0];if("SUCCESS"!==i.code)return t?t(i):new Promise((e=>{e(i)}));const o=Nt(this.config.env);let a=i.download_url;if(a=encodeURI(a),!t)return o.download({url:a});t(await o.download({url:a}))},Yt=function({name:e,data:t,query:i,parse:o,search:a,timeout:n},r){const s=r||st();let l;try{l=t?JSON.stringify(t):""}catch(h){return Promise.reject(h)}if(!e)return Promise.reject(new Be({code:"PARAM_ERROR",message:"函数名不能为空"}));const c={inQuery:i,parse:o,search:a,function_name:e,request_data:l};return Nt(this.config.env).send("functions.invokeFunction",c,{timeout:n}).then((e=>{if(e.code)s(null,e);else{let i=e.data.response_data;if(o)s(null,{result:i,requestId:e.requestId});else try{i=JSON.parse(e.data.response_data),s(null,{result:i,requestId:e.requestId})}catch(t){s(new Be({message:"response data must be json"}))}}return s.promise})).catch((e=>{s(e)})),s.promise},Qt={timeout:15e3,persistence:"session"},Zt={};class ei{constructor(e){this.config=e||this.config,this.authObj=void 0}init(e){switch(dt.adapter||(this.requestClient=new dt.adapter.reqClass({timeout:e.timeout||5e3,timeoutMsg:`请求在${(e.timeout||5e3)/1e3}s内未完成,已中断`})),this.config={...Qt,...e},!0){case this.config.timeout>6e5:console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"),this.config.timeout=6e5;break;case this.config.timeout<100:console.warn("timeout小于可配置下限[100ms],已重置为下限数值"),this.config.timeout=100}return new ei(this.config)}auth({persistence:e}={}){if(this.authObj)return this.authObj;const t=e||dt.adapter.primaryStorage||Qt.persistence;var i;return t!==this.config.persistence&&(this.config.persistence=t),function(e){const{env:t}=e;xt[t]=new ft(e),yt[t]=new ft({...e,persistence:"local"})}(this.config),i=this.config,Rt[i.env]=new Et(i),this.authObj=new Ht(this.config),this.authObj}on(e,t){return wt.apply(this,[e,t])}off(e,t){return At.apply(this,[e,t])}callFunction(e,t){return Yt.apply(this,[e,t])}deleteFile(e,t){return Kt.apply(this,[e,t])}getTempFileURL(e,t){return Xt.apply(this,[e,t])}downloadFile(e,t){return Vt.apply(this,[e,t])}uploadFile(e,t){return Gt.apply(this,[e,t])}getUploadMetadata(e,t){return Jt.apply(this,[e,t])}registerExtension(e){Zt[e.name]=e}async invokeExtension(e,t){const i=Zt[e];if(!i)throw new Be({message:`扩展${e} 必须先注册`});return await i.invoke(t,this)}useAdapters(e){const{adapter:t,runtime:i}=function(e){const t=(i=e,"[object Array]"===Object.prototype.toString.call(i)?e:[e]);var i;for(const o of t){const{isMatch:e,genAdapter:t,runtime:i}=o;if(e())return{adapter:t(),runtime:i}}}(e)||{};t&&(dt.adapter=t),i&&(dt.runtime=i)}}var ti=new ei;function ii(e,t,i){void 0===i&&(i={});var o=/\?/.test(t),a="";for(var n in i)""===a?!o&&(t+="?"):a+="&",a+=n+"="+encodeURIComponent(i[n]);return/^http(s)?:\/\//.test(t+=a)?t:""+e+t}class oi{post(e){const{url:t,data:i,headers:o,timeout:a}=e;return new Promise(((e,n)=>{Ue.request({url:ii("https:",t),data:i,method:"POST",header:o,timeout:a,success(t){e(t)},fail(e){n(e)}})}))}upload(e){return new Promise(((t,i)=>{const{url:o,file:a,data:n,headers:r,fileType:s}=e,l=Ue.uploadFile({url:ii("https:",o),name:"file",formData:Object.assign({},n),filePath:a,fileType:s,header:r,success(e){const i={statusCode:e.statusCode,data:e.data||{}};200===e.statusCode&&n.success_action_status&&(i.statusCode=parseInt(n.success_action_status,10)),t(i)},fail(e){i(new Error(e.errMsg||"uploadFile:fail"))}});"function"==typeof e.onUploadProgress&&l&&"function"==typeof l.onProgressUpdate&&l.onProgressUpdate((t=>{e.onUploadProgress({loaded:t.totalBytesSent,total:t.totalBytesExpectedToSend})}))}))}}const ai={setItem(e,t){Ue.setStorageSync(e,t)},getItem:e=>Ue.getStorageSync(e),removeItem(e){Ue.removeStorageSync(e)},clear(){Ue.clearStorageSync()}};var ni={genAdapter:function(){return{root:{},reqClass:oi,localStorage:ai,primaryStorage:"local"}},isMatch:function(){return!0},runtime:"uni_app"};ti.useAdapters(ni);const ri=ti,si=ri.init;ri.init=function(e){e.env=e.spaceId;const t=si.call(this,e);t.config.provider="tencent",t.config.spaceId=e.spaceId;const i=t.auth;return t.auth=function(e){const t=i.call(this,e);return["linkAndRetrieveDataWithTicket","signInAnonymously","signOut","getAccessToken","getLoginState","signInWithTicket","getUserInfo"].forEach((e=>{var i;t[e]=(i=t[e],function(e){e=e||{};const{success:t,fail:o,complete:a}=ze(e);if(!(t||o||a))return i.call(this,e);i.call(this,e).then((e=>{t&&t(e),a&&a(e)}),(e=>{o&&o(e),a&&a(e)}))}).bind(t)})),t},t.customAuth=t.auth,t};var li=ri;async function ci(e,t){const i=`http://${e}:${t}/system/ping`;try{const e=await(o={url:i,timeout:500},new Promise(((e,t)=>{Ue.request({...o,success(t){e(t)},fail(e){t(e)}})})));return!(!e.data||0!==e.data.code)}catch(a){return!1}var o}const hi={"serverless.file.resource.generateProximalSign":"storage/generate-proximal-sign","serverless.file.resource.report":"storage/report","serverless.file.resource.delete":"storage/delete","serverless.file.resource.getTempFileURL":"storage/get-temp-file-url"};var di={init(e){const t=new class{constructor(e){if(["spaceId","clientSecret"].forEach((t=>{if(!Object.prototype.hasOwnProperty.call(e,t))throw new Error(`${t} required`)})),!e.endpoint)throw new Error("集群空间未配置ApiEndpoint,配置后需要重新关联服务空间后生效");this.config=Object.assign({},e),this.config.provider="dcloud",this.config.requestUrl=this.config.endpoint+"/client",this.config.envType=this.config.envType||"public",this.adapter=Ue}async request(e,t=!0){return e=this.setupRequest(e),Promise.resolve().then((()=>Ye(e,this.adapter.request)))}requestLocal(e){return new Promise(((t,i)=>{this.adapter.request(Object.assign(e,{complete(e){if(e||(e={}),!e.statusCode||e.statusCode>=400){const t=e.data&&e.data.code||"SYS_ERR",o=e.data&&e.data.message||"request:fail";return i(new Be({code:t,message:o}))}t({success:!0,result:e.data})}}))}))}setupRequest(e){const t=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now()}),i={"Content-Type":"application/json"};i["x-serverless-sign"]=Ve(t,this.config.clientSecret);const o=Xe();i["x-client-info"]=encodeURIComponent(JSON.stringify(o));const{token:a}=je();return i["x-client-token"]=a,{url:this.config.requestUrl,method:"POST",data:t,dataType:"json",header:JSON.parse(JSON.stringify(i))}}async setupLocalRequest(e){const t=Xe(),{token:i}=je(),o=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now(),clientInfo:t,token:i}),{address:a,servePort:n}=this.__dev__&&this.__dev__.debugInfo||{},{address:r}=await async function(e,t){let i;for(let o=0;o{const{url:n,formData:r,name:s}=t.result;return a=t.result.fileUrl,new Promise(((t,a)=>{const l=this.adapter.uploadFile({url:n,formData:r,name:s,filePath:e,fileType:i,success(e){e&&e.statusCode<400?t(e):a(new Be({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){a(new Be({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeof o&&l&&"function"==typeof l.onProgressUpdate&&l.onProgressUpdate((e=>{o({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))})).then((()=>this.reportUploadFile({cloudPath:t}))).then((t=>new Promise(((i,o)=>{t.success?i({success:!0,filePath:e,fileID:a}):o(new Be({code:"UPLOAD_FAILED",message:"文件上传失败"}))}))))}deleteFile({fileList:e}){const t={method:"serverless.file.resource.delete",params:JSON.stringify({fileList:e})};return this.request(t).then((e=>{if(e.success)return e.result;throw new Be({code:"DELETE_FILE_FAILED",message:"删除文件失败"})}))}getTempFileURL({fileList:e,maxAge:t}={}){if(!Array.isArray(e)||0===e.length)throw new Be({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});const i={method:"serverless.file.resource.getTempFileURL",params:JSON.stringify({fileList:e,maxAge:t})};return this.request(i).then((e=>{if(e.success)return{fileList:e.result.fileList.map((e=>({fileID:e.fileID,tempFileURL:e.tempFileURL})))};throw new Be({code:"GET_TEMP_FILE_URL_FAILED",message:"获取临时文件链接失败"})}))}}(e),i={signInAnonymously:function(){return Promise.resolve()},getLoginState:function(){return Promise.resolve(!1)}};return t.auth=function(){return i},t.customAuth=t.auth,t}},ui=X((function(e,t){e.exports=Y.enc.Hex}));function pi(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function gi(e="",t={}){const{data:i,functionName:o,method:a,headers:n,signHeaderKeys:r=[],config:s}=t,l=Date.now(),c=pi(),h=Object.assign({},n,{"x-from-app-id":s.spaceAppId,"x-from-env-id":s.spaceId,"x-to-env-id":s.spaceId,"x-from-instance-id":l,"x-from-function-name":o,"x-client-timestamp":l,"x-alipay-source":"client","x-request-id":c,"x-alipay-callid":c,"x-trace-id":c}),d=["x-from-app-id","x-from-env-id","x-to-env-id","x-from-instance-id","x-from-function-name","x-client-timestamp"].concat(r),[u="",p=""]=e.split("?")||[],g=function(e){const t=e.signedHeaders.join(";"),i=e.signedHeaders.map((t=>`${t.toLowerCase()}:${e.headers[t]}\n`)).join(""),o=nt(e.body).toString(ui),a=`${e.method.toUpperCase()}\n${e.path}\n${e.query}\n${i}\n${t}\n${o}\n`,n=nt(a).toString(ui),r=`HMAC-SHA256\n${e.timestamp}\n${n}\n`,s=rt(r,e.secretKey).toString(ui);return`HMAC-SHA256 Credential=${e.secretId}, SignedHeaders=${t}, Signature=${s}`}({path:u,query:p,method:a,headers:h,timestamp:l,body:JSON.stringify(i),secretId:s.accessKey,secretKey:s.secretKey,signedHeaders:d.sort()});return{url:`${s.endpoint}${e}`,headers:Object.assign({},h,{Authorization:g})}}function fi({url:e,data:t,method:i="POST",headers:o={},timeout:a}){return new Promise(((n,r)=>{Ue.request({url:e,method:i,data:"object"==typeof t?JSON.stringify(t):t,header:o,dataType:"json",timeout:a,complete:(e={})=>{const t=o["x-trace-id"]||"";if(!e.statusCode||e.statusCode>=400){const{message:i,errMsg:o,trace_id:a}=e.data||{};return r(new Be({code:"SYS_ERR",message:i||o||"request:fail",requestId:a||t}))}n({status:e.statusCode,data:e.data,headers:e.header,requestId:t})}})}))}function xi(e,t){const{path:i,data:o,method:a="GET"}=e,{url:n,headers:r}=gi(i,{functionName:"",data:o,method:a,headers:{"x-alipay-cloud-mode":"oss","x-data-api-type":"oss","x-expire-timestamp":Date.now()+6e4},signHeaderKeys:["x-data-api-type","x-expire-timestamp"],config:t});return fi({url:n,data:o,method:a,headers:r}).then((e=>{const t=e.data||{};if(!t.success)throw new Be({code:e.errCode,message:e.errMsg,requestId:e.requestId});return t.data||{}})).catch((e=>{throw new Be({code:e.errCode,message:e.errMsg,requestId:e.requestId})}))}function yi(e=""){const t=e.trim().replace(/^cloud:\/\//,""),i=t.indexOf("/");if(i<=0)throw new Be({code:"INVALID_PARAM",message:"fileID不合法"});const o=t.substring(0,i),a=t.substring(i+1);return o!==this.config.spaceId&&console.warn("file ".concat(e," does not belong to env ").concat(this.config.spaceId)),a}function mi(e=""){return"cloud://".concat(this.config.spaceId,"/").concat(e.replace(/^\/+/,""))}class vi{constructor(e){this.config=e}signedURL(e,t={}){const i=`/ws/function/${e}`,o=this.config.wsEndpoint.replace(/^ws(s)?:\/\//,""),a=Object.assign({},t,{accessKeyId:this.config.accessKey,signatureNonce:pi(),timestamp:""+Date.now()}),n=[i,["accessKeyId","authorization","signatureNonce","timestamp"].sort().map((function(e){return a[e]?"".concat(e,"=").concat(a[e]):null})).filter(Boolean).join("&"),`host:${o}`].join("\n"),r=["HMAC-SHA256",nt(n).toString(ui)].join("\n"),s=rt(r,this.config.secretKey).toString(ui),l=Object.keys(a).map((e=>`${e}=${encodeURIComponent(a[e])}`)).join("&");return`${this.config.wsEndpoint}${i}?${l}&signature=${s}`}}var bi={init:e=>{e.provider="alipay";const t=new class{constructor(e){if(["spaceId","spaceAppId","accessKey","secretKey"].forEach((t=>{if(!Object.prototype.hasOwnProperty.call(e,t))throw new Error(`${t} required`)})),e.endpoint){if("string"!=typeof e.endpoint)throw new Error("endpoint must be string");if(!/^https:\/\//.test(e.endpoint))throw new Error("endpoint must start with https://");e.endpoint=e.endpoint.replace(/\/$/,"")}this.config=Object.assign({},e,{endpoint:e.endpoint||`https://${e.spaceId}.api-hz.cloudbasefunction.cn`,wsEndpoint:e.wsEndpoint||`wss://${e.spaceId}.api-hz.cloudbasefunction.cn`}),this._websocket=new vi(this.config)}callFunction(e){return function(e,t){const{name:i,data:o,async:a=!1,timeout:n}=e,r="POST",s={"x-to-function-name":i};a&&(s["x-function-invoke-type"]="async");const{url:l,headers:c}=gi("/functions/invokeFunction",{functionName:i,data:o,method:r,headers:s,signHeaderKeys:["x-to-function-name"],config:t});return fi({url:l,data:o,method:r,headers:c,timeout:n}).then((e=>{let t=0;if(a){const i=e.data||{};t="200"===i.errCode?0:i.errCode,e.data=i.data||{},e.errMsg=i.errMsg}if(0!==t)throw new Be({code:t,message:e.errMsg,requestId:e.requestId});return{errCode:t,success:0===t,requestId:e.requestId,result:e.data}})).catch((e=>{throw new Be({code:e.errCode,message:e.errMsg,requestId:e.requestId})}))}(e,this.config)}uploadFileToOSS({url:e,filePath:t,fileType:i,formData:o,onUploadProgress:a}){return new Promise(((n,r)=>{const s=Ue.uploadFile({url:e,filePath:t,fileType:i,formData:o,name:"file",success(e){e&&e.statusCode<400?n(e):r(new Be({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){r(new Be({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeof a&&s&&"function"==typeof s.onProgressUpdate&&s.onProgressUpdate((e=>{a({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))}async uploadFile({filePath:e,cloudPath:t="",fileType:i="image",onUploadProgress:o}){if("string"!==ae(t))throw new Be({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(t=t.trim()))throw new Be({code:"INVALID_PARAM",message:"cloudPath不可为空"});if(/:\/\//.test(t))throw new Be({code:"INVALID_PARAM",message:"cloudPath不合法"});const a=await xi({path:"/".concat(t.replace(/^\//,""),"?post_url")},this.config),{file_id:n,upload_url:r,form_data:s}=a,l=s&&s.reduce(((e,t)=>(e[t.key]=t.value,e)),{});return this.uploadFileToOSS({url:r,filePath:e,fileType:i,formData:l,onUploadProgress:o}).then((()=>({fileID:n})))}async getTempFileURL({fileList:e}){return new Promise(((t,i)=>{(!e||e.length<0)&&i(new Be({errCode:"INVALID_PARAM",errMsg:"fileList不能为空数组"})),e.length>50&&i(new Be({errCode:"INVALID_PARAM",errMsg:"fileList数组长度不能超过50"}));const o=[];for(const a of e){"string"!==ae(a)&&i(new Be({errCode:"INVALID_PARAM",errMsg:"fileList的元素必须是非空的字符串"}));const e=yi.call(this,a);o.push({file_id:e,expire:600})}xi({path:"/?download_url",data:{file_list:o},method:"POST"},this.config).then((e=>{const{file_list:i=[]}=e;t({fileList:i.map((e=>({fileID:mi.call(this,e.file_id),tempFileURL:e.download_url})))})})).catch((e=>i(e)))}))}async connectWebSocket(e){const{name:t,query:i}=e;return Ue.connectSocket({url:this._websocket.signedURL(t,i),complete:()=>{}})}}(e);return t.auth=function(){return{signInAnonymously:function(){return Promise.resolve()},getLoginState:function(){return Promise.resolve(!0)}}},t}};function Si({data:e}){let t;t=Xe();const i=JSON.parse(JSON.stringify(e||{}));if(Object.assign(i,{clientInfo:t}),!i.uniIdToken){const{token:e}=je();e&&(i.uniIdToken=e)}return i}const wi=[{rule:/fc_function_not_found|FUNCTION_NOT_FOUND/,content:",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",mode:"append"}];var Ti=/[\\^$.*+?()[\]{}|]/g,Ai=RegExp(Ti.source);function _i(e,t,i){return e.replace(new RegExp((o=t)&&Ai.test(o)?o.replace(Ti,"\\$&"):o,"g"),i);var o}const Pi=2e4,Ci={code:20101,message:"Invalid client"};function ki(e){const{errSubject:t,subject:i,errCode:o,errMsg:a,code:n,message:r,cause:s}=e||{};return new Be({subject:t||i||"uni-secure-network",code:o||n||Pi,message:a||r,cause:s})}let Di;function Li({secretType:e}={}){return"request"===e||"response"===e||"both"===e}function Ii({functionName:e,result:t,logPvd:i}){}function Mi(e){const t=e.callFunction,i=function(i){const o=i.name;i.data=Si.call(e,{data:i.data});const a={aliyun:"aliyun",tencent:"tcb",tcb:"tcb",alipay:"alipay",dcloud:"dcloud"}[this.config.provider],n=Li(i)||false;return t.call(this,i).then((e=>(e.errCode=0,!n&&Ii.call(this,{functionName:o,result:e,logPvd:a}),Promise.resolve(e))),(e=>(!n&&Ii.call(this,{functionName:o,result:e,logPvd:a}),e&&e.message&&(e.message=function({message:e="",extraInfo:t={},formatter:i=[]}={}){for(let o=0;oi.provider===e&&i.spaceId===t));return o&&o.config}({provider:e,spaceId:t});if(!s||!s.accessControl||!s.accessControl.enable)return!1;const l=s.accessControl.function||{},c=Object.keys(l);if(0===c.length)return!0;const h=function(e,t){let i,o,a;for(let n=0;ne.trim())).indexOf(t)>-1&&(o=r):a=r:i=r}return i||o||a}(c,i);if(!h)return!1;if((l[h]||[]).find(((e={})=>e.appId===o&&(e.platform||"").toLowerCase()===r.toLowerCase())))return!0;throw console.error(`此应用[appId: ${o}, platform: ${r}]不在云端配置的允许访问的应用列表内,参考:https://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client`),ki(Ci)}({provider:o,spaceId:a,functionName:n})?new Di({secretType:t.secretType,uniCloudIns:e}).wrapVerifyClientCallFunction(i.bind(e))(t):r(t),Object.defineProperty(s,"result",{get:()=>(console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"),{})}),s.then((e=>("undefined"!=typeof UTSJSONObject&&(e.result=new UTSJSONObject(e.result)),e)))}}Di=class{constructor(){throw ki({message:"Platform web is not supported by secure network"})}};const Fi=Symbol("CLIENT_DB_INTERNAL");function Oi(e,t){return e.then="DoNotReturnProxyWithAFunctionNamedThen",e._internalType=Fi,e.inspect=null,e.__v_raw=void 0,new Proxy(e,{get(e,i,o){if("_uniClient"===i)return null;if("symbol"==typeof i)return e[i];if(i in e||"string"!=typeof i){const t=e[i];return"function"==typeof t?t.bind(e):t}return t.get(e,i,o)}})}function Ei(e){return{on:(t,i)=>{e[t]=e[t]||[],e[t].indexOf(i)>-1||e[t].push(i)},off:(t,i)=>{e[t]=e[t]||[];const o=e[t].indexOf(i);-1!==o&&e[t].splice(o,1)}}}const Ri=["db.Geo","db.command","command.aggregate"];function Ni(e,t){return Ri.indexOf(`${e}.${t}`)>-1}function zi(e){switch(ae(e=We(e))){case"array":return e.map((e=>zi(e)));case"object":return e._internalType===Fi||Object.keys(e).forEach((t=>{e[t]=zi(e[t])})),e;case"regexp":return{$regexp:{source:e.source,flags:e.flags}};case"date":return{$date:e.toISOString()};default:return e}}function Bi(e){return e&&e.content&&e.content.$method}class Ui{constructor(e,t,i){this.content=e,this.prevStage=t||null,this.udb=null,this._database=i}toJSON(){let e=this;const t=[e.content];for(;e.prevStage;)e=e.prevStage,t.push(e.content);return{$db:t.reverse().map((e=>({$method:e.$method,$param:zi(e.$param)})))}}toString(){return JSON.stringify(this.toJSON())}getAction(){const e=this.toJSON().$db.find((e=>"action"===e.$method));return e&&e.$param&&e.$param[0]}getCommand(){return{$db:this.toJSON().$db.filter((e=>"action"!==e.$method))}}get isAggregate(){let e=this;for(;e;){const t=Bi(e),i=Bi(e.prevStage);if("aggregate"===t&&"collection"===i||"pipeline"===t)return!0;e=e.prevStage}return!1}get isCommand(){let e=this;for(;e;){if("command"===Bi(e))return!0;e=e.prevStage}return!1}get isAggregateCommand(){let e=this;for(;e;){const t=Bi(e),i=Bi(e.prevStage);if("aggregate"===t&&"command"===i)return!0;e=e.prevStage}return!1}getNextStageFn(e){const t=this;return function(){return Wi({$method:e,$param:zi(Array.from(arguments))},t,t._database)}}get count(){return this.isAggregate?this.getNextStageFn("count"):function(){return this._send("count",Array.from(arguments))}}get remove(){return this.isCommand?this.getNextStageFn("remove"):function(){return this._send("remove",Array.from(arguments))}}get(){return this._send("get",Array.from(arguments))}get add(){return this.isCommand?this.getNextStageFn("add"):function(){return this._send("add",Array.from(arguments))}}update(){return this._send("update",Array.from(arguments))}end(){return this._send("end",Array.from(arguments))}get set(){return this.isCommand?this.getNextStageFn("set"):function(){throw new Error("JQL禁止使用set方法")}}_send(e,t){const i=this.getAction(),o=this.getCommand();return o.$db.push({$method:e,$param:zi(t)}),this._database._callCloudFunction({action:i,command:o})}}function Wi(e,t,i){return Oi(new Ui(e,t,i),{get(e,t){let o="db";return e&&e.content&&(o=e.content.$method),Ni(o,t)?Wi({$method:t},e,i):function(){return Wi({$method:t,$param:zi(Array.from(arguments))},e,i)}}})}function ji({path:e,method:t}){return class{constructor(){this.param=Array.from(arguments)}toJSON(){return{$newDb:[...e.map((e=>({$method:e}))),{$method:t,$param:this.param}]}}toString(){return JSON.stringify(this.toJSON())}}}function qi(e,t={}){return Oi(new e(t),{get:(e,t)=>Ni("db",t)?Wi({$method:t},null,e):function(){return Wi({$method:t,$param:zi(Array.from(arguments))},null,e)}})}class $i extends class{constructor({uniClient:e={},isJQL:t=!1}={}){this._uniClient=e,this._authCallBacks={},this._dbCallBacks={},e._isDefault&&(this._dbCallBacks=xe("_globalUniCloudDatabaseCallback")),t||(this.auth=Ei(this._authCallBacks)),this._isJQL=t,Object.assign(this,Ei(this._dbCallBacks)),this.env=Oi({},{get:(e,t)=>({$env:t})}),this.Geo=Oi({},{get:(e,t)=>ji({path:["Geo"],method:t})}),this.serverDate=ji({path:[],method:"serverDate"}),this.RegExp=ji({path:[],method:"RegExp"})}getCloudEnv(e){if("string"!=typeof e||!e.trim())throw new Error("getCloudEnv参数错误");return{$env:e.replace("$cloudEnv_","")}}_callback(e,t){const i=this._dbCallBacks;i[e]&&i[e].forEach((e=>{e(...t)}))}_callbackAuth(e,t){const i=this._authCallBacks;i[e]&&i[e].forEach((e=>{e(...t)}))}multiSend(){const e=Array.from(arguments),t=e.map((e=>{const t=e.getAction(),i=e.getCommand();if("getTemp"!==i.$db[i.$db.length-1].$method)throw new Error("multiSend只支持子命令内使用getTemp");return{action:t,command:i}}));return this._callCloudFunction({multiCommand:t,queryList:e})}}{_parseResult(e){return this._isJQL?e.result:e}_callCloudFunction({action:e,command:t,multiCommand:i,queryList:o}){function a(e,t){if(i&&o)for(let i=0;iSe(we(r,"complete"),e))).then((()=>(a(null,e),Oe(_e,{type:ke,content:e}),Promise.reject(e))))}const l=Se(we(r,"invoke")),c=this._uniClient;return l.then((()=>c.callFunction({name:"DCloud-clientDB",type:"CLIENT_DB",data:{action:e,command:t,multiCommand:i}}))).then((e=>{const{code:t,message:i,token:o,tokenExpired:l,systemInfo:c=[]}=e.result;if(c)for(let a=0;a(console.warn(i),o)})}}return d=e,Se(we(r,"success"),d).then((()=>Se(we(r,"complete"),d))).then((()=>{a(d,null);const e=n._parseResult(d);return Oe(_e,{type:ke,content:e}),Promise.resolve(e)}));var d}),(e=>(/fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message)&&console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB"),s(new Be({code:e.code||"SYSTEM_ERROR",message:e.message,requestId:e.requestId})))))}}const Hi="token无效,跳转登录页面",Gi="token过期,跳转登录页面",Ji={TOKEN_INVALID_TOKEN_EXPIRED:Gi,TOKEN_INVALID_INVALID_CLIENTID:Hi,TOKEN_INVALID:Hi,TOKEN_INVALID_WRONG_TOKEN:Hi,TOKEN_INVALID_ANONYMOUS_USER:Hi},Ki={"uni-id-token-expired":Gi,"uni-id-check-token-failed":Hi,"uni-id-token-not-exist":Hi,"uni-id-check-device-feature-failed":Hi};function Xi(e,t){let i="";return i=e?`${e}/${t}`:t,i.replace(/^\//,"")}function Vi(e=[],t=""){const i=[],o=[];return e.forEach((e=>{!0===e.needLogin?i.push(Xi(t,e.path)):!1===e.needLogin&&o.push(Xi(t,e.path))})),{needLoginPage:i,notNeedLoginPage:o}}function Yi(e){return e.split("?")[0].replace(/^\//,"")}function Qi(){return function(e){let t=e&&e.$page&&e.$page.fullPath||"";return t?("/"!==t.charAt(0)&&(t="/"+t),t):t}(function(){const e=i();return e[e.length-1]}())}function Zi(){return Yi(Qi())}function eo(e="",t={}){if(!e)return!1;if(!(t&&t.list&&t.list.length))return!1;const i=t.list,o=Yi(e);return i.some((e=>e.pagePath===o))}const to=!!K.uniIdRouter,{loginPage:io,routerNeedLogin:oo,resToLogin:ao,needLoginPage:no,notNeedLoginPage:ro,loginPageInTabBar:so}=function({pages:e=[],subPackages:t=[],uniIdRouter:i={},tabBar:o={}}=K){const{loginPage:a,needLogin:n=[],resToLogin:r=!0}=i,{needLoginPage:s,notNeedLoginPage:l}=Vi(e),{needLoginPage:c,notNeedLoginPage:h}=function(e=[]){const t=[],i=[];return e.forEach((e=>{const{root:o,pages:a=[]}=e,{needLoginPage:n,notNeedLoginPage:r}=Vi(a,o);t.push(...n),i.push(...r)})),{needLoginPage:t,notNeedLoginPage:i}}(t);return{loginPage:a,routerNeedLogin:n,resToLogin:r,needLoginPage:[...s,...c],notNeedLoginPage:[...l,...h],loginPageInTabBar:eo(a,o)}}();if(no.indexOf(io)>-1)throw new Error(`Login page [${io}] should not be "needLogin", please check your pages.json`);function lo(e){const t=Zi();if("/"===e.charAt(0))return e;const[i,o]=e.split("?"),a=i.replace(/^\//,"").split("/"),n=t.split("/");n.pop();for(let r=0;r-1?o+`&uniIdRedirectUrl=${encodeURIComponent(a)}`:o+`?uniIdRedirectUrl=${encodeURIComponent(a)}`:o);var o,a;so?"navigateTo"!==e&&"redirectTo"!==e||(e="switchTab"):"switchTab"===e&&(e="navigateTo");const n={navigateTo:v,redirectTo:b,switchTab:S,reLaunch:w};setTimeout((()=>{n[e]({url:i})}),0)}function uo({url:e}={}){const t={abortLoginPageJump:!1,autoToLoginPage:!1},i=function(){const{token:e,tokenExpired:t}=je();let i;if(e){if(t-1)&&(no.indexOf(t)>-1||oo.some((t=>{return i=e,new RegExp(t).test(i);var i})))}(e)&&i){if(i.uniIdRedirectUrl=e,Ie(Pe).length>0)return setTimeout((()=>{Oe(Pe,i)}),0),t.abortLoginPageJump=!0,t;t.autoToLoginPage=!0}return t}function po(){!function(){const e=Qi(),{abortLoginPageJump:t,autoToLoginPage:i}=uo({url:e});t||i&&ho({api:"redirectTo",redirect:e})}();const e=["navigateTo","redirectTo","reLaunch","switchTab"];for(let t=0;t{const{type:t,content:i}=e;let o=!1;switch(t){case"cloudobject":o=function(e){if("object"!=typeof e)return!1;const{errCode:t}=e||{};return t in Ki}(i);break;case"clientdb":o=function(e){if("object"!=typeof e)return!1;const{errCode:t}=e||{};return t in Ji}(i)}o&&function(e={}){const t=Ie(Pe);Ne().then((()=>{const i=Qi();if(i&&co({redirect:i}))return t.length>0?Oe(Pe,Object.assign({uniIdRedirectUrl:i},e)):void(io&&ho({api:"navigateTo",redirect:i}))}))}(i)}))}function fo(e){var t;(t=e).onResponse=function(e){Me(_e,e)},t.offResponse=function(e){Fe(_e,e)},function(e){e.onNeedLogin=function(e){Me(Pe,e)},e.offNeedLogin=function(e){Fe(Pe,e)},to&&(xe("_globalUniCloudStatus").needLoginInit||(xe("_globalUniCloudStatus").needLoginInit=!0,Ne().then((()=>{po.call(e)})),ao&&go.call(e)))}(e),function(e){e.onRefreshToken=function(e){Me(Ce,e)},e.offRefreshToken=function(e){Fe(Ce,e)}}(e)}let xo;const yo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",mo=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;function vo(){const e=je().token||"",t=e.split(".");if(!e||3!==t.length)return{uid:null,role:[],permission:[],tokenExpired:0};let i;try{i=JSON.parse((o=t[1],decodeURIComponent(xo(o).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(a){throw new Error("获取当前用户信息出错,详细错误信息为:"+a.message)}var o;return i.tokenExpired=1e3*i.exp,delete i.exp,delete i.iat,i}xo="function"!=typeof atob?function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!mo.test(e))throw new Error("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 i,o,a="",n=0;n>16&255):64===o?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return a}:atob;var bo=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(X((function(i,o){Object.defineProperty(o,"__esModule",{value:!0});const n="chooseAndUploadFile:ok",r="chooseAndUploadFile:fail";function s(e,t){return e.tempFiles.forEach(((e,i)=>{e.name||(e.name=e.path.substring(e.path.lastIndexOf("/")+1)),t&&(e.fileType=t),e.cloudPath=Date.now()+"_"+i+e.name.substring(e.name.lastIndexOf("."))})),e.tempFilePaths||(e.tempFilePaths=e.tempFiles.map((e=>e.path))),e}function l(e,t,{onChooseFile:i,onUploadProgress:o}){return t.then((e=>{if(i){const t=i(e);if(void 0!==t)return Promise.resolve(t).then((t=>void 0===t?e:t))}return e})).then((t=>!1===t?{errMsg:n,tempFilePaths:[],tempFiles:[]}:function(e,t,i=5,o){(t=Object.assign({},t)).errMsg=n;const a=t.tempFiles,r=a.length;let s=0;return new Promise((n=>{for(;s=r)return void(!a.find((e=>!e.url&&!e.errMsg))&&n(t));const c=a[i];e.uploadFile({provider:c.provider,filePath:c.path,cloudPath:c.cloudPath,fileType:c.fileType,cloudPathAsRealPath:c.cloudPathAsRealPath,onUploadProgress(e){e.index=i,e.tempFile=c,e.tempFilePath=c.path,o&&o(e)}}).then((e=>{c.url=e.fileID,i{c.errMsg=e.errMsg||e.message,i{e({count:i,sizeType:o,sourceType:a,extension:n,success(e){t(s(e,"image"))},fail(e){l({errMsg:e.errMsg.replace("chooseImage:fail",r)})}})}))}(o),o):"video"===o.type?l(i,function(e){const{camera:i,compressed:o,maxDuration:a,sourceType:n=["album","camera"],extension:l}=e;return new Promise(((e,c)=>{t({camera:i,compressed:o,maxDuration:a,sourceType:n,extension:l,success(t){const{tempFilePath:i,duration:o,size:a,height:n,width:r}=t;e(s({errMsg:"chooseVideo:ok",tempFilePaths:[i],tempFiles:[{name:t.tempFile&&t.tempFile.name||"",path:i,size:a,type:t.tempFile&&t.tempFile.type||"",width:r,height:n,duration:o,fileType:"video",cloudPath:""}]},"video"))},fail(e){c({errMsg:e.errMsg.replace("chooseVideo:fail",r)})}})}))}(o),o):l(i,function(e){const{count:t,extension:i}=e;return new Promise(((e,o)=>{let n=a;if("undefined"!=typeof wx&&"function"==typeof wx.chooseMessageFile&&(n=wx.chooseMessageFile),"function"!=typeof n)return o({errMsg:r+" 请指定 type 类型,该平台仅支持选择 image 或 video。"});n({type:"all",count:t,extension:i,success(t){e(s(t))},fail(e){o({errMsg:e.errMsg.replace("chooseFile:fail",r)})}})}))}(o),o)}}})));function So(e){return{props:{localdata:{type:Array,default:()=>[]},options:{type:[Object,Array],default:()=>({})},spaceInfo:{type:Object,default:()=>({})},collection:{type:[String,Array],default:""},action:{type:String,default:""},field:{type:String,default:""},orderby:{type:String,default:""},where:{type:[String,Object],default:""},pageData:{type:String,default:"add"},pageCurrent:{type:Number,default:1},pageSize:{type:Number,default:20},getcount:{type:[Boolean,String],default:!1},gettree:{type:[Boolean,String],default:!1},gettreepath:{type:[Boolean,String],default:!1},startwith:{type:String,default:""},limitlevel:{type:Number,default:10},groupby:{type:String,default:""},groupField:{type:String,default:""},distinct:{type:[Boolean,String],default:!1},foreignKey:{type:String,default:""},loadtime:{type:String,default:"auto"},manual:{type:Boolean,default:!1}},data:()=>({mixinDatacomLoading:!1,mixinDatacomHasMore:!1,mixinDatacomResData:[],mixinDatacomErrorMessage:"",mixinDatacomPage:{},mixinDatacomError:null}),created(){this.mixinDatacomPage={current:this.pageCurrent,size:this.pageSize,count:0},this.$watch((()=>{var e=[];return["pageCurrent","pageSize","localdata","collection","action","field","orderby","where","getont","getcount","gettree","groupby","groupField","distinct"].forEach((t=>{e.push(this[t])})),e}),((e,t)=>{if("manual"===this.loadtime)return;let i=!1;const o=[];for(let a=2;a{this.mixinDatacomLoading=!1;const{data:o,count:a}=i.result;this.getcount&&(this.mixinDatacomPage.count=a),this.mixinDatacomHasMore=o.length{this.mixinDatacomLoading=!1,this.mixinDatacomErrorMessage=e,this.mixinDatacomError=e,i&&i(e)})))},mixinDatacomGet(t={}){let i;t=t||{},i="undefined"!=typeof __uniX&&__uniX?e.databaseForJQL(this.spaceInfo):e.database(this.spaceInfo);const o=t.action||this.action;o&&(i=i.action(o));const a=t.collection||this.collection;i=Array.isArray(a)?i.collection(...a):i.collection(a);const n=t.where||this.where;n&&Object.keys(n).length&&(i=i.where(n));const r=t.field||this.field;r&&(i=i.field(r));const s=t.foreignKey||this.foreignKey;s&&(i=i.foreignKey(s));const l=t.groupby||this.groupby;l&&(i=i.groupBy(l));const c=t.groupField||this.groupField;c&&(i=i.groupField(c)),!0===(void 0!==t.distinct?t.distinct:this.distinct)&&(i=i.distinct());const h=t.orderby||this.orderby;h&&(i=i.orderBy(h));const d=void 0!==t.pageCurrent?t.pageCurrent:this.mixinDatacomPage.current,u=void 0!==t.pageSize?t.pageSize:this.mixinDatacomPage.size,p=void 0!==t.getcount?t.getcount:this.getcount,g=void 0!==t.gettree?t.gettree:this.gettree,f=void 0!==t.gettreepath?t.gettreepath:this.gettreepath,x={getCount:p},y={limitLevel:void 0!==t.limitlevel?t.limitlevel:this.limitlevel,startWith:void 0!==t.startwith?t.startwith:this.startwith};return g&&(x.getTree=y),f&&(x.getTreePath=y),i=i.skip(u*(d-1)).limit(u).get(x),i}}}}function wo(e){return xe("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}",e.config.spaceId))}async function To({openid:e,callLoginByWeixin:t=!1}={}){throw wo(this),new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `web`")}async function Ao(e){const t=wo(this);return t.initPromise||(t.initPromise=To.call(this,e).then((e=>e)).catch((e=>{throw delete t.initPromise,e}))),t.initPromise}function _o(e){Ke=e}function Po(e){const t={getSystemInfo:T,getPushClientId:A};return function(i){return new Promise(((o,a)=>{t[e]({...i,success(e){o(e)},fail(e){a(e)}})}))}}class Co extends class{constructor(){this._callback={}}addListener(e,t){this._callback[e]||(this._callback[e]=[]),this._callback[e].push(t)}on(e,t){return this.addListener(e,t)}removeListener(e,t){if(!t)throw new Error('The "listener" argument must be of type function. Received undefined');const i=this._callback[e];if(!i)return;const o=function(e,t){for(let i=e.length-1;i>=0;i--)if(e[i]===t)return i;return-1}(i,t);i.splice(o,1)}off(e,t){return this.removeListener(e,t)}removeAllListener(e){delete this._callback[e]}emit(e,...t){const i=this._callback[e];if(i)for(let o=0;o{if(!e)throw new Error("Invalid appId, please check the manifest.json file");if(!t)throw new Error("Invalid push client id");this._appId=e,this._pushClientId=t,this._seqId=Date.now()+"-"+Math.floor(9e5*Math.random()+1e5),this.emit("open"),this._initMessageListener()}),(e=>{throw this.emit("error",e),this.close(),e}))}async open(){return this.init()}_isUniCloudSSE(e){if("receive"!==e.type)return!1;const t=e&&e.data&&e.data.payload;return!(!t||"UNI_CLOUD_SSE"!==t.channel||t.seqId!==this._seqId)}_receivePushMessage(e){if(!this._isUniCloudSSE(e))return;const t=e&&e.data&&e.data.payload,{action:i,messageId:o,message:a}=t;this._payloadQueue.push({action:i,messageId:o,message:a}),this._consumMessage()}_consumMessage(){for(;;){const e=this._payloadQueue.find((e=>e.messageId===this._currentMessageId+1));if(!e)break;this._currentMessageId++,this._parseMessagePayload(e)}}_parseMessagePayload(e){const{action:t,messageId:i,message:o}=e;"end"===t?this._end({messageId:i,message:o}):"message"===t&&this._appendMessage({messageId:i,message:o})}_appendMessage({messageId:e,message:t}={}){this.emit("message",t)}_end({messageId:e,message:t}={}){this.emit("end",t),this.close()}_initMessageListener(){c(this._uniPushMessageCallback)}_destroy(){h(this._uniPushMessageCallback)}toJSON(){return{appId:this._appId,pushClientId:this._pushClientId,seqId:this._seqId}}close(){this._destroy(),this.emit("close")}}const ko={tcb:li,tencent:li,aliyun:Ze,private:di,dcloud:di,alipay:bi};let Do=new class{init(e){let t={};const i=ko[e.provider];if(!i)throw new Error("未提供正确的provider参数");var o;return t=i.init(e),function(e){e._initPromiseHub||(e._initPromiseHub=new he({createPromise:function(){let t=Promise.resolve();t=new Promise((e=>{setTimeout((()=>{e()}),1)}));const i=e.auth();return t.then((()=>i.getLoginState())).then((e=>e?Promise.resolve():i.signInAnonymously()))}}))}(t),Mi(t),function(e){const t=e.uploadFile;e.uploadFile=function(e){return t.call(this,e)}}(t),(o=t).database=function(e){if(e&&Object.keys(e).length>0)return o.init(e).database();if(this._database)return this._database;const t=qi($i,{uniClient:o});return this._database=t,t},o.databaseForJQL=function(e){if(e&&Object.keys(e).length>0)return o.init(e).databaseForJQL();if(this._databaseForJQL)return this._databaseForJQL;const t=qi($i,{uniClient:o,isJQL:!0});return this._databaseForJQL=t,t},function(e){e.getCurrentUserInfo=vo,e.chooseAndUploadFile=bo.initChooseAndUploadFile(e),Object.assign(e,{get mixinDatacom(){return So(e)}}),e.SSEChannel=Co,e.initSecureNetworkByWeixin=function(e){return function({openid:t,callLoginByWeixin:i=!1}={}){return Ao.call(e,{openid:t,callLoginByWeixin:i})}}(e),e.setCustomClientInfo=_o,e.importObject=function(t){return function(i,o={}){o=function(e,t={}){return e.customUI=t.customUI||e.customUI,e.parseSystemError=t.parseSystemError||e.parseSystemError,Object.assign(e.loadingOptions,t.loadingOptions),Object.assign(e.errorOptions,t.errorOptions),"object"==typeof t.secretMethods&&(e.secretMethods=t.secretMethods),e}({customUI:!1,loadingOptions:{title:"加载中...",mask:!0},errorOptions:{type:"modal",retry:!1}},o);const{customUI:a,loadingOptions:c,errorOptions:h,parseSystemError:d}=o,u=!a;return new Proxy({},{get(a,p){switch(p){case"toString":return"[object UniCloudObject]";case"toJSON":return{}}return function({fn:e,interceptorName:t,getCallbackArgs:i}={}){return async function(...o){const a=i?i({params:o}):{};let n,r;try{return await Se(we(t,"invoke"),{...a}),n=await e(...o),await Se(we(t,"success"),{...a,result:n}),n}catch(s){throw r=s,await Se(we(t,"fail"),{...a,error:r}),r}finally{await Se(we(t,"complete"),r?{...a,error:r}:{...a,result:n})}}}({fn:async function a(...g){let f;u&&n({title:c.title,mask:c.mask});const x={name:i,type:"OBJECT",data:{method:p,params:g}};"object"==typeof o.secretMethods&&function(e,t){const i=t.data.method,o=e.secretMethods||{},a=o[i]||o["*"];a&&(t.secretType=a)}(o,x);let y=!1;try{f=await t.callFunction(x)}catch(e){y=!0,f={result:new Be(e)}}const{errSubject:m,errCode:v,errMsg:b,newToken:S}=f.result||{};if(u&&r(),S&&S.token&&S.tokenExpired&&(qe(S),Oe(Ce,{...S})),v){let e=b;if(y&&d&&(e=(await d({objectName:i,methodName:p,params:g,errSubject:m,errCode:v,errMsg:b})).errMsg||b),u)if("toast"===h.type)s({title:e,icon:"none"});else{if("modal"!==h.type)throw new Error(`Invalid errorOptions.type: ${h.type}`);{const{confirm:t}=await async function({title:e,content:t,showCancel:i,cancelText:o,confirmText:a}={}){return new Promise(((n,r)=>{l({title:e,content:t,showCancel:i,cancelText:o,confirmText:a,success(e){n(e)},fail(){n({confirm:!1,cancel:!0})}})}))}({title:"提示",content:e,showCancel:h.retry,cancelText:"取消",confirmText:h.retry?"重试":"确定"});if(h.retry&&t)return a(...g)}}const t=new Be({subject:m,code:v,message:b,requestId:f.requestId});throw t.detail=f.result,Oe(_e,{type:Le,content:t}),t}return Oe(_e,{type:Le,content:f.result}),f.result},interceptorName:"callObject",getCallbackArgs:function({params:e}={}){return{objectName:i,methodName:p,params:e}}})}})}}(e)}(t),["callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile","chooseAndUploadFile"].forEach((e=>{if(!t[e])return;const i=t[e];t[e]=function(){return i.apply(t,Array.from(arguments))},t[e]=function(e,t){return function(i){let o=!1;if("callFunction"===t){const e=i&&i.type||te;o=e!==te}const a="callFunction"===t&&!o,n=this._initPromiseHub.exec();i=i||{};const{success:r,fail:s,complete:l}=ze(i),c=n.then((()=>o?Promise.resolve():Se(we(t,"invoke"),i))).then((()=>e.call(this,i))).then((e=>o?Promise.resolve(e):Se(we(t,"success"),e).then((()=>Se(we(t,"complete"),e))).then((()=>(a&&Oe(_e,{type:De,content:e}),Promise.resolve(e))))),(e=>o?Promise.reject(e):Se(we(t,"fail"),e).then((()=>Se(we(t,"complete"),e))).then((()=>(Oe(_e,{type:De,content:e}),Promise.reject(e))))));if(!(r||s||l))return c;c.then((e=>{r&&r(e),l&&l(e),a&&Oe(_e,{type:De,content:e})}),(e=>{s&&s(e),l&&l(e),a&&Oe(_e,{type:De,content:e})}))}}(t[e],e).bind(t)})),t.init=this.init,t}};(()=>{const e=pe;let t={};if(e&&1===e.length)t=e[0],Do=Do.init(t),Do._isDefault=!0;else{const t=["auth","callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile","database","getCurrentUSerInfo","importObject"];let i;i=e&&e.length>0?"应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间":"应用未关联服务空间,请在uniCloud目录右键关联服务空间",t.forEach((e=>{Do[e]=function(){return console.error(i),Promise.reject(new Be({code:"SYS_ERR",message:i}))}}))}Object.assign(Do,{get mixinDatacom(){return So(Do)}}),fo(Do),Do.addInterceptor=ve,Do.removeInterceptor=be,Do.interceptObject=Te})();var Lo=Do;const Io=G({components:{Loading1:G({name:"loading1",data:()=>({})},[["render",function(e,t,i,o,a,n){const r=I;return C(),k(r,{class:"container loading1"},{default:D((()=>[L(r,{class:"shape shape1"}),L(r,{class:"shape shape2"}),L(r,{class:"shape shape3"}),L(r,{class:"shape shape4"})])),_:1})}],["__scopeId","data-v-a16ea79e"]]),Loading2:G({name:"loading2",data:()=>({})},[["render",function(e,t,i,o,a,n){const r=I;return C(),k(r,{class:"container loading2"},{default:D((()=>[L(r,{class:"shape shape1"}),L(r,{class:"shape shape2"}),L(r,{class:"shape shape3"}),L(r,{class:"shape shape4"})])),_:1})}],["__scopeId","data-v-51d40d8b"]]),Loading3:G({name:"loading3",data:()=>({})},[["render",function(e,t,i,o,a,n){const r=I;return C(),k(r,{class:"container loading3"},{default:D((()=>[L(r,{class:"shape shape1"}),L(r,{class:"shape shape2"}),L(r,{class:"shape shape3"}),L(r,{class:"shape shape4"})])),_:1})}],["__scopeId","data-v-47408335"]]),Loading4:G({name:"loading5",data:()=>({})},[["render",function(e,t,i,o,a,n){const r=I;return C(),k(r,{class:"container loading5"},{default:D((()=>[L(r,{class:"shape shape1"}),L(r,{class:"shape shape2"}),L(r,{class:"shape shape3"}),L(r,{class:"shape shape4"})])),_:1})}],["__scopeId","data-v-49a6258a"]]),Loading5:G({name:"loading6",data:()=>({})},[["render",function(e,t,i,o,a,n){const r=I;return C(),k(r,{class:"container loading6"},{default:D((()=>[L(r,{class:"shape shape1"}),L(r,{class:"shape shape2"}),L(r,{class:"shape shape3"}),L(r,{class:"shape shape4"})])),_:1})}],["__scopeId","data-v-08a06125"]])},name:"qiun-loading",props:{loadingType:{type:Number,default:2}},data:()=>({})},[["render",function(e,t,i,o,a,n){const r=M("Loading1"),s=M("Loading2"),l=M("Loading3"),c=M("Loading4"),h=M("Loading5"),d=I;return C(),k(d,null,{default:D((()=>[1==i.loadingType?(C(),k(r,{key:0})):F("",!0),2==i.loadingType?(C(),k(s,{key:1})):F("",!0),3==i.loadingType?(C(),k(l,{key:2})):F("",!0),4==i.loadingType?(C(),k(c,{key:3})):F("",!0),5==i.loadingType?(C(),k(h,{key:4})):F("",!0)])),_:1})}]]);const Mo=G({name:"qiun-error",props:{errorMessage:{type:String,default:null}},data:()=>({})},[["render",function(e,t,i,o,a,n){const r=I;return C(),k(r,{class:"chartsview"},{default:D((()=>[L(r,{class:"charts-error"}),L(r,{class:"charts-font"},{default:D((()=>[O(E(null==i.errorMessage?"请点击重试":i.errorMessage),1)])),_:1})])),_:1})}],["__scopeId","data-v-af32de60"]]);var Fo={version:"v2.5.0-20230101",yAxisWidth:15,xAxisHeight:22,padding:[10,10,10,10],rotate:!1,fontSize:13,fontColor:"#666666",dataPointShape:["circle","circle","circle","circle"],color:["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],linearColor:["#0EE2F8","#2BDCA8","#FA7D8D","#EB88E2","#2AE3A0","#0EE2F8","#EB88E2","#6773E3","#F78A85"],pieChartLinePadding:15,pieChartTextPadding:5,titleFontSize:20,subtitleFontSize:15,radarLabelTextMargin:13},Oo=function(e,...t){if(null==e)throw new TypeError("[uCharts] Cannot convert undefined or null to object");if(!t||t.length<=0)return e;function i(e,t){for(let o in t)e[o]=e[o]&&"[object Object]"===e[o].toString()?i(e[o],t[o]):e[o]=t[o];return e}return t.forEach((t=>{e=i(e,t)})),e},Eo={toFixed:function(e,t){return t=t||2,this.isFloat(e)&&(e=e.toFixed(t)),e},isFloat:function(e){return e%1!=0},approximatelyEqual:function(e,t){return Math.abs(e-t)<1e-10},isSameSign:function(e,t){return Math.abs(e)===e&&Math.abs(t)===t||Math.abs(e)!==e&&Math.abs(t)!==t},isSameXCoordinateArea:function(e,t){return this.isSameSign(e.x,t.x)},isCollision:function(e,t){return e.end={},e.end.x=e.start.x+e.width,e.end.y=e.start.y-e.height,t.end={},t.end.x=t.start.x+t.width,t.end.y=t.start.y-t.height,!(t.start.x>e.end.x||t.end.xe.start.y||t.start.y1&&(a.extra.mount.widthRatio>2&&(a.extra.mount.widthRatio=2),r+=(a.extra.mount.widthRatio-1)*i.eachSpacing);var s=t;return t>=0?(s=0,e.uevent.trigger("scrollLeft"),e.scrollOption.position="left",a.xAxis.scrollPosition="left"):Math.abs(t)>=r-n?(s=n-r,e.uevent.trigger("scrollRight"),e.scrollOption.position="right",a.xAxis.scrollPosition="right"):(e.scrollOption.position=t,a.xAxis.scrollPosition=t),s}function Bo(e,t,i){function o(e){for(;e<0;)e+=2*Math.PI;for(;e>2*Math.PI;)e-=2*Math.PI;return e}return e=o(e),(t=o(t))>(i=o(i))&&(i+=2*Math.PI,e=t&&e<=i}function Uo(e,t){function i(e,t){return!(!e[t-1]||!e[t+1])&&(e[t].y>=Math.max(e[t-1].y,e[t+1].y)||e[t].y<=Math.min(e[t-1].y,e[t+1].y))}function o(e,t){return!(!e[t-1]||!e[t+1])&&(e[t].x>=Math.max(e[t-1].x,e[t+1].x)||e[t].x<=Math.min(e[t-1].x,e[t+1].x))}var a=.2,n=.2,r=null,s=null,l=null,c=null;if(t<1?(r=e[0].x+(e[1].x-e[0].x)*a,s=e[0].y+(e[1].y-e[0].y)*a):(r=e[t].x+(e[t+1].x-e[t-1].x)*a,s=e[t].y+(e[t+1].y-e[t-1].y)*a),t>e.length-3){var h=e.length-1;l=e[h].x-(e[h].x-e[h-1].x)*n,c=e[h].y-(e[h].y-e[h-1].y)*n}else l=e[t+1].x-(e[t+2].x-e[t].x)*n,c=e[t+1].y-(e[t+2].y-e[t].y)*n;return i(e,t+1)&&(c=e[t+1].y),i(e,t)&&(s=e[t].y),o(e,t+1)&&(l=e[t+1].x),o(e,t)&&(r=e[t].x),(s>=Math.max(e[t].y,e[t+1].y)||s<=Math.min(e[t].y,e[t+1].y))&&(s=e[t].y),(c>=Math.max(e[t].y,e[t+1].y)||c<=Math.min(e[t].y,e[t+1].y))&&(c=e[t+1].y),(r>=Math.max(e[t].x,e[t+1].x)||r<=Math.min(e[t].x,e[t+1].x))&&(r=e[t].x),(l>=Math.max(e[t].x,e[t+1].x)||l<=Math.min(e[t].x,e[t+1].x))&&(l=e[t+1].x),{ctrA:{x:r,y:s},ctrB:{x:l,y:c}}}function Wo(e,t,i){return{x:i.x+e,y:i.y-t}}function jo(e,t){if(t)for(;Eo.isCollision(e,t);)e.start.x>0?e.start.y--:e.start.x<0||e.start.y>0?e.start.y++:e.start.y--;return e}function qo(e,t,i){for(var o=0,a=0;a-1;if(n){let t=ta(e);for(var r=0;r5&&void 0!==arguments[5]?arguments[5]:{},r=t.chartData.calPoints?t.chartData.calPoints:[];let s={};if(o.length>0){let e=[];for(let t=0;t0&&(o=a[i]),{text:n.formatter?n.formatter(e,o,i,t):e.name+": "+e.data,color:e.color,legendShape:"auto"==t.extra.tooltip.legendShape?e.legendShape:t.extra.tooltip.legendShape}})),c={x:Math.round(s.x),y:Math.round(s.y)};return{textList:l,offset:c}}function Zo(e,t,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},n=t.chartData.xAxisPoints[i]+t.chartData.eachSpacing/2,r=e.map((function(e){return{text:a.formatter?a.formatter(e,o[i],i,t):e.name+": "+e.data,color:e.color,disableLegend:!!e.disableLegend,legendShape:"auto"==t.extra.tooltip.legendShape?e.legendShape:t.extra.tooltip.legendShape}}));r=r.filter((function(e){if(!0!==e.disableLegend)return e}));var s={x:Math.round(n),y:0};return{textList:r,offset:s}}function ea(e,t,i,o,a,n){var r=i.chartData.calPoints;let s=n.color.upFill,l=n.color.downFill,c=[s,s,l,s];var h=[];t.map((function(t){0==o?t.data[1]-t.data[0]<0?c[1]=l:c[1]=s:(t.data[0]e[o-1][1]&&(c[2]=s),t.data[3]=t.area[3]-10&&e.y>=t.area[0]&&e.y<=t.height-t.area[2]}function oa(e,t,i){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<=Math.pow(i,2)}function aa(e,t){var i=[],o=[];return e.forEach((function(e,a){t.connectNulls?null!==e&&o.push(e):null!==e?o.push(e):(o.length&&i.push(o),o=[])})),o.length&&i.push(o),i}function na(e,t,i,o,a){var n={angle:0,xAxisHeight:t.xAxis.lineHeight*t.pix+t.xAxis.marginTop*t.pix},r=t.xAxis.fontSize*t.pix,s=e.map((function(e,i){var o=t.xAxis.formatter?t.xAxis.formatter(e,i,t):e;return Ho(String(o),r,a)})),l=Math.max.apply(this,s);if(1==t.xAxis.rotateLabel){n.angle=t.xAxis.rotateAngle*Math.PI/180;let e=t.xAxis.marginTop*t.pix*2+Math.abs(l*Math.sin(n.angle));e=e4&&void 0!==arguments[4]?arguments[4]:-1;a="stack"==o?Jo(e,t.categories.length):Go(e);var r=[];(a=a.filter((function(e){return"object"==typeof e&&null!==e?e.constructor.toString().indexOf("Array")>-1?null!==e:null!==e.value:null!==e}))).map((function(e){"object"==typeof e?e.constructor.toString().indexOf("Array")>-1?"candle"==t.type?e.map((function(e){r.push(e)})):r.push(e[0]):r.push(e.value):r.push(e)}));var s=0,l=0;if(r.length>0&&(s=Math.min.apply(this,r),l=Math.max.apply(this,r)),n>-1?("number"==typeof t.xAxis.data[n].min&&(s=Math.min(t.xAxis.data[n].min,s)),"number"==typeof t.xAxis.data[n].max&&(l=Math.max(t.xAxis.data[n].max,l))):("number"==typeof t.xAxis.min&&(s=Math.min(t.xAxis.min,s)),"number"==typeof t.xAxis.max&&(l=Math.max(t.xAxis.max,l))),s===l){l+=l||10}for(var c=s,h=[],d=(l-c)/t.xAxis.splitNumber,u=0;u<=t.xAxis.splitNumber;u++)h.push(c+d*u);return h}(e,t,i,a.type),n.rangesFormat=n.ranges.map((function(e){return e=Eo.toFixed(e,2)}));var r=n.ranges.map((function(e){return e=Eo.toFixed(e,2)}));return(n=Object.assign(n,ba(r,t))).eachSpacing,r.map((function(e){return Ho(e,t.xAxis.fontSize*t.pix,o)})),!0===t.xAxis.disabled&&(n.xAxisHeight=0),n}function sa(e,t,i,o,a){var n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,r=a.extra.radar||{};r.max=r.max||0;var s=Math.max(r.max,Math.max.apply(null,Go(o))),l=[];for(let c=0;c2&&void 0!==arguments[2]?arguments[2]:1,o=0,a=0;for(let n=0;n4&&void 0!==arguments[4]?arguments[4]:1;for(let n=0;n4&&void 0!==arguments[4]?arguments[4]:1,n=0,r=0,s=[];for(let d=0;d2&&void 0!==arguments[2]?arguments[2]:1;1==i&&(i=.999999);for(let o=0;o=2&&(n._proportion_=n._proportion_%2)}return e}function ua(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;1==i&&(i=.999999);for(let o=0;o=2&&(n._proportion_=n._proportion_%2)}return e}function pa(e,t,i){let o;o=i=2&&(e[n]._endAngle_=e[n]._endAngle_%2),a=e[n]._endAngle_;return e}function ga(e,t,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;for(let a=0;a=i.oldData?r._proportion_=(r._endAngle_-r._oldAngle_)*o+i.oldAngle:r._proportion_=r._oldAngle_-(r._oldAngle_-r._endAngle_)*o,r._proportion_>=2&&(r._proportion_=r._proportion_%2)}return e}function fa(e,t,i,o,a,n){return e.map((function(e){if(null===e)return null;var a=0,r=0;return"mix"==n.type?(a=n.extra.mix.column.seriesGap*n.pix||0,r=n.extra.mix.column.categoryGap*n.pix||0):(a=n.extra.column.seriesGap*n.pix||0,r=n.extra.column.categoryGap*n.pix||0),a=Math.min(a,t/i),r=Math.min(r,t/i),e.width=Math.ceil((t-2*r-a*(i-1))/i),n.extra.mix&&n.extra.mix.column.width&&+n.extra.mix.column.width>0&&(e.width=Math.min(e.width,+n.extra.mix.column.width*n.pix)),n.extra.column&&n.extra.column.width&&+n.extra.column.width>0&&(e.width=Math.min(e.width,+n.extra.column.width*n.pix)),e.width<=0&&(e.width=1),e.x+=(o+.5-i/2)*(e.width+a),e}))}function xa(e,t,i,o,a,n){return e.map((function(e){if(null===e)return null;var a=0,r=0;return a=n.extra.bar.seriesGap*n.pix||0,r=n.extra.bar.categoryGap*n.pix||0,a=Math.min(a,t/i),r=Math.min(r,t/i),e.width=Math.ceil((t-2*r-a*(i-1))/i),n.extra.bar&&n.extra.bar.width&&+n.extra.bar.width>0&&(e.width=Math.min(e.width,+n.extra.bar.width*n.pix)),e.width<=0&&(e.width=1),e.y+=(o+.5-i/2)*(e.width+a),e}))}function ya(e,t,i,o,a,n,r){var s=n.extra.column.categoryGap*n.pix||0;return e.map((function(e){return null===e?null:(e.width=t-2*s,n.extra.column&&n.extra.column.width&&+n.extra.column.width>0&&(e.width=Math.min(e.width,+n.extra.column.width*n.pix)),o>0&&(e.width-=r),e)}))}function ma(e,t,i,o,a,n,r){var s=n.extra.column.categoryGap*n.pix||0;return e.map((function(e,i){return null===e?null:(e.width=Math.ceil(t-2*s),n.extra.column&&n.extra.column.width&&+n.extra.column.width>0&&(e.width=Math.min(e.width,+n.extra.column.width*n.pix)),e.width<=0&&(e.width=1),e)}))}function va(e,t,i,o,a,n,r){var s=n.extra.bar.categoryGap*n.pix||0;return e.map((function(e,i){return null===e?null:(e.width=Math.ceil(t-2*s),n.extra.bar&&n.extra.bar.width&&+n.extra.bar.width>0&&(e.width=Math.min(e.width,+n.extra.bar.width*n.pix)),e.width<=0&&(e.width=1),e)}))}function ba(e,t,i){var o=t.width-t.area[1]-t.area[3],a=t.enableScroll?Math.min(t.xAxis.itemCount,e.length):e.length;("line"==t.type||"area"==t.type||"scatter"==t.type||"bubble"==t.type||"bar"==t.type)&&a>1&&"justify"==t.xAxis.boundaryGap&&(a-=1);var n=0;"mount"==t.type&&t.extra&&t.extra.mount&&t.extra.mount.widthRatio&&t.extra.mount.widthRatio>1&&(t.extra.mount.widthRatio>2&&(t.extra.mount.widthRatio=2),a+=n=t.extra.mount.widthRatio-1);var r=o/a,s=[],l=t.area[3],c=t.width-t.area[1];return e.forEach((function(e,t){s.push(l+n/2*r+t*r)})),"justify"!==t.xAxis.boundaryGap&&(!0===t.enableScroll?s.push(l+n*r+e.length*r):s.push(c)),{xAxisPoints:s,startX:l,endX:c,eachSpacing:r}}function Sa(e,t,i,o,a,n,r){var s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1,l=[],c=n.height-n.area[0]-n.area[2];return e.forEach((function(e,r){if(null===e)l.push(null);else{var h=[];e.forEach((function(e,l){var d={};d.x=o[r]+Math.round(a/2);var u=e.value||e,p=c*(u-t)/(i-t);p*=s,d.y=n.height-Math.round(p)-n.area[2],h.push(d)})),l.push(h)}})),l}function wa(e,t,i,o,a,n,r){var s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1,l="center";"line"!=n.type&&"area"!=n.type&&"scatter"!=n.type&&"bubble"!=n.type||(l=n.xAxis.boundaryGap);var c=[],h=n.height-n.area[0]-n.area[2],d=n.width-n.area[1]-n.area[3];return e.forEach((function(e,r){if(null===e)c.push(null);else{var u={};u.color=e.color,u.x=o[r];var p=e;if("object"==typeof e&&null!==e)if(e.constructor.toString().indexOf("Array")>-1){let t,i,o;t=[].concat(n.chartData.xAxisData.ranges),i=t.shift(),o=t.pop(),p=e[1],u.x=n.area[3]+d*(e[0]-i)/(o-i),"bubble"==n.type&&(u.r=e[2],u.t=e[3])}else p=e.value;"center"==l&&(u.x+=a/2);var g=h*(p-t)/(i-t);g*=s,u.y=n.height-g-n.area[2],c.push(u)}})),c}function Ta(e,t,i,o,a,n,r,s,l){l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1;var c=n.xAxis.boundaryGap,h=[],d=n.height-n.area[0]-n.area[2],u=n.width-n.area[1]-n.area[3];return e.forEach((function(e,r){if(null===e)h.push(null);else{var p={};if(p.color=e.color,"vertical"==s.animation){p.x=o[r];var g=e;if("object"==typeof e&&null!==e)if(e.constructor.toString().indexOf("Array")>-1){let t,i,o;t=[].concat(n.chartData.xAxisData.ranges),i=t.shift(),o=t.pop(),g=e[1],p.x=n.area[3]+u*(e[0]-i)/(o-i)}else g=e.value;"center"==c&&(p.x+=a/2);var f=d*(g-t)/(i-t);f*=l,p.y=n.height-f-n.area[2],h.push(p)}else{p.x=o[0]+a*r*l;g=e;"center"==c&&(p.x+=a/2);f=d*(g-t)/(i-t);p.y=n.height-f-n.area[2],h.push(p)}}})),h}function Aa(e,t,i,o,a,n,r,s,l){l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1;var c=[],h=n.height-n.area[0]-n.area[2],d=n.width-n.area[1]-n.area[3];return e.forEach((function(e,r){if(null===e)c.push(null);else{var s={};s.color=e.color,s.x=o[r];var u=e;if("object"==typeof e&&null!==e)if(e.constructor.toString().indexOf("Array")>-1){let t,i,o;t=[].concat(n.chartData.xAxisData.ranges),i=t.shift(),o=t.pop(),u=e[1],s.x=n.area[3]+d*(e[0]-i)/(o-i)}else u=e.value;s.x+=a/2;var p=h*(u*l-t)/(i-t);s.y=n.height-p-n.area[2],c.push(s)}})),c}function _a(e,t,i,o,a,n,r,s){var l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1,c=[],h=n.height-n.area[0]-n.area[2];n.width,n.area[1],n.area[3];var d=a*r.widthRatio;return e.forEach((function(e,r){if(null===e)c.push(null);else{var s={};s.color=e.color,s.x=o[r],s.x+=a/2;var u=e.data,p=h*(u*l-t)/(i-t);s.y=n.height-p-n.area[2],s.value=u,s.width=d,c.push(s)}})),c}function Pa(e,t,i,o,a,n,r){var s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1,l=[];n.height,n.area[0],n.area[2];var c=n.width-n.area[1]-n.area[3];return e.forEach((function(e,a){if(null===e)l.push(null);else{var r={};r.color=e.color,r.y=o[a];var h=e;"object"==typeof e&&null!==e&&(h=e.value);var d=c*(h-t)/(i-t);d*=s,r.height=d,r.value=h,r.x=d+n.area[3],l.push(r)}})),l}function Ca(e,t,i,o,a,n,r,s,l){var c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:1,h=[],d=n.height-n.area[0]-n.area[2];return e.forEach((function(e,r){if(null===e)h.push(null);else{var u={};if(u.color=e.color,u.x=o[r]+Math.round(a/2),s>0){var p=0;for(let e=0;e<=s;e++)p+=l[e].data[r];var g=d*(p-t)/(i-t),f=d*(p-e-t)/(i-t)}else{p=e;"object"==typeof e&&null!==e&&(p=e.value);g=d*(p-t)/(i-t),f=0}var x=f;g*=c,x*=c,u.y=n.height-Math.round(g)-n.area[2],u.y0=n.height-Math.round(x)-n.area[2],h.push(u)}})),h}function ka(e,t,i,o,a,n,r,s,l){var c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:1,h=[],d=n.width-n.area[1]-n.area[3];return e.forEach((function(e,a){if(null===e)h.push(null);else{var r={};if(r.color=e.color,r.y=o[a],s>0){var u=0;for(let e=0;e<=s;e++)u+=l[e].data[a];var p=d*(u-t)/(i-t),g=d*(u-e-t)/(i-t)}else{u=e;"object"==typeof e&&null!==e&&(u=e.value);p=d*(u-t)/(i-t),g=0}var f=g;p*=c,f*=c,r.height=p-f,r.x=n.area[3]+p,r.x0=n.area[3]+f,h.push(r)}})),h}function Da(e,t,i,o,a){var n;n="stack"==o?Jo(e,t.categories.length):Go(e);var r=[];(n=n.filter((function(e){return"object"==typeof e&&null!==e?e.constructor.toString().indexOf("Array")>-1?null!==e:null!==e.value:null!==e}))).map((function(e){"object"==typeof e?e.constructor.toString().indexOf("Array")>-1?"candle"==t.type?e.map((function(e){r.push(e)})):r.push(e[1]):r.push(e.value):r.push(e)}));var s=a.min||0,l=a.max||0;r.length>0&&(s=Math.min.apply(this,r),l=Math.max.apply(this,r)),s===l&&(0==l?l=10:s=0);for(var c=function(e,t){var i=0,o=t-e;return{minRange:No(e,"lower",i=o>=1e4?1e3:o>=1e3?100:o>=100?10:o>=10?5:o>=1?1:o>=.1?.1:o>=.01?.01:o>=.001?.001:o>=1e-4?1e-4:o>=1e-5?1e-5:1e-6),maxRange:No(t,"upper",i)}}(s,l),h=void 0===a.min||null===a.min?c.minRange:a.min,d=((void 0===a.max||null===a.max?c.maxRange:a.max)-h)/t.yAxis.splitNumber,u=[],p=0;p<=t.yAxis.splitNumber;p++)u.push(h+d*p);return u.reverse()}function La(e,t,i,o){var a=Oo({},{type:""},t.extra.column),n=t.yAxis.data.length,r=new Array(n);if(n>0){for(let t=0;te+(n.unit||"")),n.categories=n.categories||t.categories,s[e]=n.categories):(n.formatter||(n.formatter=(e,t,i)=>Eo.toFixed(e,n.tofix||0)+(n.unit||"")),s[e]=Da(r[e],t,0,a.type,n));let h=n.fontSize*t.pix||i.fontSize;c[e]={position:n.position?n.position:"left",width:0},l[e]=s[e].map((function(i,a){return i=n.formatter(i,a,t),c[e].width=Math.max(c[e].width,Ho(i,h,o)+5),i}));let d=n.calibration?4*t.pix:0;c[e].width+=d+3*t.pix,!0===n.disabled&&(c[e].width=0)}}else{s=new Array(1),l=new Array(1),c=new Array(1);"bar"===t.type?(s[0]=t.categories,t.yAxis.formatter||(t.yAxis.formatter=(e,t,i)=>e+(i.yAxis.unit||""))):(t.yAxis.formatter||(t.yAxis.formatter=(e,t,i)=>e.toFixed(i.yAxis.tofix)+(i.yAxis.unit||"")),s[0]=Da(e,t,0,a.type,{})),c[0]={position:"left",width:0};var h=t.yAxis.fontSize*t.pix||i.fontSize;l[0]=s[0].map((function(e,i){return e=t.yAxis.formatter(e,i,t),c[0].width=Math.max(c[0].width,Ho(e,h,o)+5),e})),c[0].width+=3*t.pix,!0===t.yAxis.disabled?(c[0]={position:"left",width:0},t.yAxis.data[0]={disabled:!0}):(t.yAxis.data[0]={disabled:!1,position:"left",max:t.yAxis.max,min:t.yAxis.min,formatter:t.yAxis.formatter},"bar"===t.type&&(t.yAxis.data[0].categories=t.categories,t.yAxis.data[0].type="categories"))}return{rangesFormat:l,ranges:s,yAxisWidth:c}}function Ia(e,t){!0!==t.rotateLock?(e.translate(t.height,0),e.rotate(90*Math.PI/180)):!0!==t._rotate_&&(e.translate(t.height,0),e.rotate(90*Math.PI/180),t._rotate_=!0)}function Ma(e,t,i,o,a){if(o.beginPath(),"hollow"==a.dataPointShapeType?(o.setStrokeStyle(t),o.setFillStyle(a.background),o.setLineWidth(2*a.pix)):(o.setStrokeStyle("#ffffff"),o.setFillStyle(t),o.setLineWidth(1*a.pix)),"diamond"===i)e.forEach((function(e,t){null!==e&&(o.moveTo(e.x,e.y-4.5),o.lineTo(e.x-4.5,e.y),o.lineTo(e.x,e.y+4.5),o.lineTo(e.x+4.5,e.y),o.lineTo(e.x,e.y-4.5))}));else if("circle"===i)e.forEach((function(e,t){null!==e&&(o.moveTo(e.x+2.5*a.pix,e.y),o.arc(e.x,e.y,3*a.pix,0,2*Math.PI,!1))}));else if("square"===i)e.forEach((function(e,t){null!==e&&(o.moveTo(e.x-3.5,e.y-3.5),o.rect(e.x-3.5,e.y-3.5,7,7))}));else if("triangle"===i)e.forEach((function(e,t){null!==e&&(o.moveTo(e.x,e.y-4.5),o.lineTo(e.x-4.5,e.y+4.5),o.lineTo(e.x+4.5,e.y+4.5),o.lineTo(e.x,e.y-4.5))}));else if("none"===i)return;o.closePath(),o.fill(),o.stroke()}function Fa(e,t,i,o,a,n,r){if(a.tooltip&&!(a.tooltip.group.length>0&&0==a.tooltip.group.includes(r))){var s="number"==typeof a.tooltip.index?a.tooltip.index:a.tooltip.index[a.tooltip.group.indexOf(r)];if(o.beginPath(),"hollow"==n.activeType?(o.setStrokeStyle(t),o.setFillStyle(a.background),o.setLineWidth(2*a.pix)):(o.setStrokeStyle("#ffffff"),o.setFillStyle(t),o.setLineWidth(1*a.pix)),"diamond"===i)e.forEach((function(e,t){null!==e&&s==t&&(o.moveTo(e.x,e.y-4.5),o.lineTo(e.x-4.5,e.y),o.lineTo(e.x,e.y+4.5),o.lineTo(e.x+4.5,e.y),o.lineTo(e.x,e.y-4.5))}));else if("circle"===i)e.forEach((function(e,t){null!==e&&s==t&&(o.moveTo(e.x+2.5*a.pix,e.y),o.arc(e.x,e.y,3*a.pix,0,2*Math.PI,!1))}));else if("square"===i)e.forEach((function(e,t){null!==e&&s==t&&(o.moveTo(e.x-3.5,e.y-3.5),o.rect(e.x-3.5,e.y-3.5,7,7))}));else if("triangle"===i)e.forEach((function(e,t){null!==e&&s==t&&(o.moveTo(e.x,e.y-4.5),o.lineTo(e.x-4.5,e.y+4.5),o.lineTo(e.x+4.5,e.y+4.5),o.lineTo(e.x,e.y-4.5))}));else if("none"===i)return;o.closePath(),o.fill(),o.stroke()}}function Oa(e,t,i,o){var a=e.title.fontSize||t.titleFontSize,n=e.subtitle.fontSize||t.subtitleFontSize,r=e.title.name||"",s=e.subtitle.name||"",l=e.title.color||e.fontColor,c=e.subtitle.color||e.fontColor,h=r?a:0,d=s?n:0;if(s){var u=Ho(s,n*e.pix,i),p=o.x-u/2+(e.subtitle.offsetX||0)*e.pix,g=o.y+n*e.pix/2+(e.subtitle.offsetY||0)*e.pix;r&&(g+=(h*e.pix+5)/2),i.beginPath(),i.setFontSize(n*e.pix),i.setFillStyle(c),i.fillText(s,p,g),i.closePath(),i.stroke()}if(r){var f=Ho(r,a*e.pix,i),x=o.x-f/2+(e.title.offsetX||0),y=o.y+a*e.pix/2+(e.title.offsetY||0)*e.pix;s&&(y-=(d*e.pix+5)/2),i.beginPath(),i.setFontSize(a*e.pix),i.setFillStyle(l),i.fillText(r,x,y),i.closePath(),i.stroke()}}function Ea(e,t,i,o,a){var n=t.data,r=t.textOffset?t.textOffset:0;e.forEach((function(e,s){if(null!==e){o.beginPath();var l=t.textSize?t.textSize*a.pix:i.fontSize;o.setFontSize(l),o.setFillStyle(t.textColor||a.fontColor);var c=n[s];"object"==typeof n[s]&&null!==n[s]&&(c=n[s].constructor.toString().indexOf("Array")>-1?n[s][1]:n[s].value);var h=t.formatter?t.formatter(c,s,t,a):c;o.setTextAlign("center"),o.fillText(String(h),e.x,e.y-4+r*a.pix),o.closePath(),o.stroke(),o.setTextAlign("left")}}))}function Ra(e,t,i,o,a){var n=t.data,r=t.textOffset?t.textOffset:0,s=a.extra.column.labelPosition;e.forEach((function(e,l){if(null!==e){o.beginPath();var c=t.textSize?t.textSize*a.pix:i.fontSize;o.setFontSize(c),o.setFillStyle(t.textColor||a.fontColor);var h=n[l];"object"==typeof n[l]&&null!==n[l]&&(h=n[l].constructor.toString().indexOf("Array")>-1?n[l][1]:n[l].value);var d=t.formatter?t.formatter(h,l,t,a):h;o.setTextAlign("center");var u=e.y-4*a.pix+r*a.pix;e.y>t.zeroPoints&&(u=e.y+r*a.pix+c),"insideTop"==s&&(u=e.y+c+r*a.pix,e.y>t.zeroPoints&&(u=e.y-r*a.pix-4*a.pix)),"center"==s&&(u=e.y+r*a.pix+(a.height-a.area[2]-e.y+c)/2,t.zeroPointst.zeroPoints&&(u=e.y-r*a.pix-(e.y-t.zeroPoints-c)/2),"stack"==a.extra.column.type&&(u=e.y+r*a.pix+(e.y0-e.y+c)/2)),"bottom"==s&&(u=a.height-a.area[2]+r*a.pix-4*a.pix,t.zeroPointst.zeroPoints&&(u=t.zeroPoints-r*a.pix+c+2*a.pix),"stack"==a.extra.column.type&&(u=e.y0+r*a.pix-4*a.pix)),o.fillText(String(d),e.x,u),o.closePath(),o.stroke(),o.setTextAlign("left")}}))}function Na(e,t,i,o,a,n){t.data;var r=t.textOffset?t.textOffset:0;a.extra.mount.labelPosition,e.forEach((function(e,s){if(null!==e){o.beginPath();var l=t[s].textSize?t[s].textSize*a.pix:i.fontSize;o.setFontSize(l),o.setFillStyle(t[s].textColor||a.fontColor);var c=e.value,h=t[s].formatter?t[s].formatter(c,s,t,a):c;o.setTextAlign("center");var d=e.y-4*a.pix+r*a.pix;e.y>n&&(d=e.y+r*a.pix+l),o.fillText(String(h),e.x,d),o.closePath(),o.stroke(),o.setTextAlign("left")}}))}function za(e,t,i,o,a){var n=t.data;t.textOffset&&t.textOffset,e.forEach((function(e,r){if(null!==e){o.beginPath();var s=t.textSize?t.textSize*a.pix:i.fontSize;o.setFontSize(s),o.setFillStyle(t.textColor||a.fontColor);var l=n[r];"object"==typeof n[r]&&null!==n[r]&&(l=n[r].value);var c=t.formatter?t.formatter(l,r,t,a):l;o.setTextAlign("left"),o.fillText(String(c),e.x+4*a.pix,e.y+s/2-3),o.closePath(),o.stroke()}}))}function Ba(e,t,i,o,a,n){let r;t=(t-=e.width/2+e.labelOffset*o.pix)<10?10:t,r=e.endAngle=2&&(c%=2),h+=l}}function Ua(e,t,i,o,a,n){var r=o.extra.radar||{};e.forEach((function(e,s){if(!0===r.labelPointShow&&""!==o.categories[s]){var l={x:t*Math.cos(e),y:t*Math.sin(e)},c=Wo(l.x,l.y,i);n.setFillStyle(r.labelPointColor),n.beginPath(),n.arc(c.x,c.y,r.labelPointRadius*o.pix,0,2*Math.PI,!1),n.closePath(),n.fill()}if(!0===r.labelShow){var h={x:(t+a.radarLabelTextMargin*o.pix)*Math.cos(e),y:(t+a.radarLabelTextMargin*o.pix)*Math.sin(e)},d=Wo(h.x,h.y,i),u=d.x,p=d.y;Eo.approximatelyEqual(h.x,0)?u-=Ho(o.categories[s]||"",a.fontSize,n)/2:h.x<0&&(u-=Ho(o.categories[s]||"",a.fontSize,n)),n.beginPath(),n.setFontSize(a.fontSize),n.setFillStyle(r.labelColor||o.fontColor),n.fillText(o.categories[s]||"",u,p+a.fontSize/2),n.closePath(),n.stroke()}}))}function Wa(e,t,i,o,a,n){var r=i.pieChartLinePadding,s=[],l=null,c=e.map((function(i,o){var a=i.formatter?i.formatter(i,o,e,t):Eo.toFixed(100*i._proportion_.toFixed(4))+"%";a=i.labelText?i.labelText:a;var n=2*Math.PI-(i._start_+2*Math.PI*i._proportion_/2);return i._rose_proportion_&&(n=2*Math.PI-(i._start_+2*Math.PI*i._rose_proportion_/2)),{arc:n,text:a,color:i.color,radius:i._radius_,textColor:i.textColor,textSize:i.textSize,labelShow:i.labelShow}}));for(let h=0;h=0?a+i.pieChartTextPadding:a-i.pieChartTextPadding,g=n,f=Ho(e.text,e.textSize*t.pix||i.fontSize,o),x=g;l&&Eo.isSameXCoordinateArea(l.start,{x:p})&&(x=p>0?Math.min(g,l.start.y):a<0||g>0?Math.max(g,l.start.y):Math.min(g,l.start.y)),p<0&&(p-=f),l=jo({lineStart:{x:d,y:u},lineEnd:{x:a,y:n},start:{x:p,y:x},width:f,height:i.fontSize,text:e.text,color:e.color,textColor:e.textColor,textSize:e.textSize},l),s.push(l)}for(let h=0;ha?a:n.activeWidth;var r=t.area[0],s=t.height-t.area[2];o.beginPath(),o.setFillStyle(Ro(n.activeBgColor,n.activeBgOpacity)),o.rect(e-n.activeWidth/2,r,n.activeWidth,s-r),o.closePath(),o.fill(),o.setFillStyle("#FFFFFF")}function Ha(e,t,i,o,a){var n=Oo({},{activeBgColor:"#000000",activeBgOpacity:.08},t.extra.bar),r=t.area[3],s=t.width-t.area[1];o.beginPath(),o.setFillStyle(Ro(n.activeBgColor,n.activeBgOpacity)),o.rect(r,e-a/2,s-r,a),o.closePath(),o.fill(),o.setFillStyle("#FFFFFF")}function Ga(e,t,i,o,a,n,r){var s=Oo({},{showBox:!0,showArrow:!0,showCategory:!1,bgColor:"#000000",bgOpacity:.7,borderColor:"#000000",borderWidth:0,borderRadius:0,borderOpacity:.7,boxPadding:3,fontColor:"#FFFFFF",fontSize:13,lineHeight:20,legendShow:!0,legendShape:"auto",splitLine:!0},i.extra.tooltip);1==s.showCategory&&i.categories&&e.unshift({text:i.categories[i.tooltip.index],color:null});var l=s.fontSize*i.pix,c=s.lineHeight*i.pix,h=s.boxPadding*i.pix,d=l,u=5*i.pix;0==s.legendShow&&(d=0,u=0);var p=s.showArrow?8*i.pix:0,g=!1;"line"!=i.type&&"mount"!=i.type&&"area"!=i.type&&"candle"!=i.type&&"mix"!=i.type||1==s.splitLine&&function(e,t,i,o){var a=t.extra.tooltip||{};a.gridType=null==a.gridType?"solid":a.gridType,a.dashLength=null==a.dashLength?4:a.dashLength;var n=t.area[0],r=t.height-t.area[2];if("dash"==a.gridType&&o.setLineDash([a.dashLength,a.dashLength]),o.setStrokeStyle(a.gridColor||"#cccccc"),o.setLineWidth(1*t.pix),o.beginPath(),o.moveTo(e,n),o.lineTo(e,r),o.stroke(),o.setLineDash([]),a.xAxisLabel){let n=t.categories[t.tooltip.index];o.setFontSize(i.fontSize);let s=Ho(n,i.fontSize,o),l=e-.5*s,c=r+2*t.pix;o.beginPath(),o.setFillStyle(Ro(a.labelBgColor||i.toolTipBackground,a.labelBgOpacity||i.toolTipOpacity)),o.setStrokeStyle(a.labelBgColor||i.toolTipBackground),o.setLineWidth(1*t.pix),o.rect(l-a.boxPadding*t.pix,c,s+2*a.boxPadding*t.pix,i.fontSize+2*a.boxPadding*t.pix),o.closePath(),o.stroke(),o.fill(),o.beginPath(),o.setFontSize(i.fontSize),o.setFillStyle(a.labelFontColor||t.fontColor),o.fillText(String(n),l,c+a.boxPadding*t.pix+i.fontSize),o.closePath(),o.stroke()}}(i.tooltip.offset.x,i,o,a),(t=Oo({x:0,y:0},t)).y-=8*i.pix;var f=e.map((function(e){return Ho(e.text,l,a)})),x=d+u+4*h+Math.max.apply(null,f),y=2*h+e.length*c;if(0!=s.showBox){t.x-Math.abs(i._scrollDistance_||0)+p+x>i.width&&(g=!0),y+t.y>i.height&&(t.y=i.height-y),a.beginPath(),a.setFillStyle(Ro(s.bgColor,s.bgOpacity)),a.setLineWidth(s.borderWidth*i.pix),a.setStrokeStyle(Ro(s.borderColor,s.borderOpacity));var m=s.borderRadius;g?(x+p>i.width&&(t.x=i.width+Math.abs(i._scrollDistance_||0)+p+(x-i.width)),x>t.x&&(t.x=i.width+Math.abs(i._scrollDistance_||0)+p+(x-i.width)),s.showArrow&&(a.moveTo(t.x,t.y+10*i.pix),a.lineTo(t.x-p,t.y+10*i.pix+5*i.pix)),a.arc(t.x-p-m,t.y+y-m,m,0,Math.PI/2,!1),a.arc(t.x-p-Math.round(x)+m,t.y+y-m,m,Math.PI/2,Math.PI,!1),a.arc(t.x-p-Math.round(x)+m,t.y+m,m,-Math.PI,-Math.PI/2,!1),a.arc(t.x-p-m,t.y+m,m,-Math.PI/2,0,!1),s.showArrow&&(a.lineTo(t.x-p,t.y+10*i.pix-5*i.pix),a.lineTo(t.x,t.y+10*i.pix))):(s.showArrow&&(a.moveTo(t.x,t.y+10*i.pix),a.lineTo(t.x+p,t.y+10*i.pix-5*i.pix)),a.arc(t.x+p+m,t.y+m,m,-Math.PI,-Math.PI/2,!1),a.arc(t.x+p+Math.round(x)-m,t.y+m,m,-Math.PI/2,0,!1),a.arc(t.x+p+Math.round(x)-m,t.y+y-m,m,0,Math.PI/2,!1),a.arc(t.x+p+m,t.y+y-m,m,Math.PI/2,Math.PI,!1),s.showArrow&&(a.lineTo(t.x+p,t.y+10*i.pix+5*i.pix),a.lineTo(t.x,t.y+10*i.pix))),a.closePath(),a.fill(),s.borderWidth>0&&a.stroke(),s.legendShow&&e.forEach((function(e,o){if(null!==e.color){a.beginPath(),a.setFillStyle(e.color);var n=t.x+p+2*h,r=t.y+(c-l)/2+c*o+h+1;switch(g&&(n=t.x-x-p+2*h),e.legendShape){case"line":a.moveTo(n,r+.5*d-2*i.pix),a.fillRect(n,r+.5*d-2*i.pix,d,4*i.pix);break;case"triangle":a.moveTo(n+7.5*i.pix,r+.5*d-5*i.pix),a.lineTo(n+2.5*i.pix,r+.5*d+5*i.pix),a.lineTo(n+12.5*i.pix,r+.5*d+5*i.pix),a.lineTo(n+7.5*i.pix,r+.5*d-5*i.pix);break;case"diamond":a.moveTo(n+7.5*i.pix,r+.5*d-5*i.pix),a.lineTo(n+2.5*i.pix,r+.5*d),a.lineTo(n+7.5*i.pix,r+.5*d+5*i.pix),a.lineTo(n+12.5*i.pix,r+.5*d),a.lineTo(n+7.5*i.pix,r+.5*d-5*i.pix);break;case"circle":a.moveTo(n+7.5*i.pix,r+.5*d),a.arc(n+7.5*i.pix,r+.5*d,5*i.pix,0,2*Math.PI);break;case"rect":default:a.moveTo(n,r+.5*d-5*i.pix),a.fillRect(n,r+.5*d-5*i.pix,15*i.pix,10*i.pix);break;case"square":a.moveTo(n+2*i.pix,r+.5*d-5*i.pix),a.fillRect(n+2*i.pix,r+.5*d-5*i.pix,10*i.pix,10*i.pix)}a.closePath(),a.fill()}})),e.forEach((function(e,i){var o=t.x+p+2*h+d+u;g&&(o=t.x-x-p+2*h+d+u);var n=t.y+c*i+(c-l)/2-1+h+l;a.beginPath(),a.setFontSize(l),a.setTextBaseline("normal"),a.setFillStyle(s.fontColor),a.fillText(e.text,o,n),a.closePath(),a.stroke()}))}}function Ja(e,t,i,o,a,n){(e.extra.tooltip||{}).horizentalLine&&e.tooltip&&1===o&&("line"==e.type||"area"==e.type||"column"==e.type||"mount"==e.type||"candle"==e.type||"mix"==e.type)&&qa(e,t,i),i.save(),e._scrollDistance_&&0!==e._scrollDistance_&&!0===e.enableScroll&&i.translate(e._scrollDistance_,0),e.tooltip&&e.tooltip.textList&&e.tooltip.textList.length&&1===o&&Ga(e.tooltip.textList,e.tooltip.offset,e,t,i),i.restore()}function Ka(e,t,i,o){let a=t.chartData.xAxisData,n=a.xAxisPoints,r=a.startX,s=a.endX,l=a.eachSpacing;var c="center";"bar"!=t.type&&"line"!=t.type&&"area"!=t.type&&"scatter"!=t.type&&"bubble"!=t.type||(c=t.xAxis.boundaryGap);var h=t.height-t.area[2],d=t.area[0];if(t.enableScroll&&t.xAxis.scrollShow){var u=t.height-t.area[2]+i.xAxisHeight,p=s-r,g=l*(n.length-1);"mount"==t.type&&t.extra&&t.extra.mount&&t.extra.mount.widthRatio&&t.extra.mount.widthRatio>1&&(t.extra.mount.widthRatio>2&&(t.extra.mount.widthRatio=2),g+=(t.extra.mount.widthRatio-1)*l);var f=p*p/g,x=0;t._scrollDistance_&&(x=-t._scrollDistance_*p/g),o.beginPath(),o.setLineCap("round"),o.setLineWidth(6*t.pix),o.setStrokeStyle(t.xAxis.scrollBackgroundColor||"#EFEBEF"),o.moveTo(r,u),o.lineTo(s,u),o.stroke(),o.closePath(),o.beginPath(),o.setLineCap("round"),o.setLineWidth(6*t.pix),o.setStrokeStyle(t.xAxis.scrollColor||"#A6A6A6"),o.moveTo(r+x,u),o.lineTo(r+x+f,u),o.stroke(),o.closePath(),o.setLineCap("butt")}if(o.save(),t._scrollDistance_&&0!==t._scrollDistance_&&o.translate(t._scrollDistance_,0),!0===t.xAxis.calibration&&(o.setStrokeStyle(t.xAxis.gridColor||"#cccccc"),o.setLineCap("butt"),o.setLineWidth(1*t.pix),n.forEach((function(e,i){i>0&&(o.beginPath(),o.moveTo(e-l/2,h),o.lineTo(e-l/2,h+3*t.pix),o.closePath(),o.stroke())}))),!0!==t.xAxis.disableGrid&&(o.setStrokeStyle(t.xAxis.gridColor||"#cccccc"),o.setLineCap("butt"),o.setLineWidth(1*t.pix),"dash"==t.xAxis.gridType&&o.setLineDash([t.xAxis.dashLength*t.pix,t.xAxis.dashLength*t.pix]),t.xAxis.gridEval=t.xAxis.gridEval||1,n.forEach((function(e,i){i%t.xAxis.gridEval==0&&(o.beginPath(),o.moveTo(e,h),o.lineTo(e,d),o.stroke())})),o.setLineDash([])),!0!==t.xAxis.disabled){let a=e.length;t.xAxis.labelCount&&(a=t.xAxis.itemCount?Math.ceil(e.length/t.xAxis.itemCount*t.xAxis.labelCount):t.xAxis.labelCount,a-=1);let r=Math.ceil(e.length/a),s=[],d=e.length;for(let t=0;t=t.area[3]-1&&d-Math.abs(s)<=t.width-t.area[1]+1&&(o.beginPath(),o.setFontSize(y),o.setFillStyle(t.xAxis.fontColor||t.fontColor),o.fillText(String(a),n[i]+r,h+t.xAxis.marginTop*t.pix+(t.xAxis.lineHeight-t.xAxis.fontSize)*t.pix/2+t.xAxis.fontSize*t.pix),o.closePath(),o.stroke())})):s.forEach((function(e,a){var r=t.xAxis.formatter?t.xAxis.formatter(e):e,s=t._scrollDistance_||0,d="center"==c?n[a]+l/2:n[a];if(d-Math.abs(s)>=t.area[3]-1&&d-Math.abs(s)<=t.width-t.area[1]+1){o.save(),o.beginPath(),o.setFontSize(y),o.setFillStyle(t.xAxis.fontColor||t.fontColor);var u=Ho(String(r),y,o),p=n[a];"center"==c&&(p=n[a]+l/2),t.xAxis.scrollShow&&t.pix;var g=h+t.xAxis.marginTop*t.pix+y-y*Math.abs(Math.sin(i._xAxisTextAngle_));t.xAxis.rotateAngle<0?(p-=y/2,u=0):(p+=y/2,u=-u),o.translate(p,g),o.rotate(-1*i._xAxisTextAngle_),o.fillText(String(r),u,0),o.closePath(),o.stroke(),o.restore()}}))}o.restore(),t.xAxis.title&&(o.beginPath(),o.setFontSize(t.xAxis.titleFontSize*t.pix),o.setFillStyle(t.xAxis.titleFontColor),o.fillText(String(t.xAxis.title),t.width-t.area[1]+t.xAxis.titleOffsetX*t.pix,t.height-t.area[2]+t.xAxis.marginTop*t.pix+(t.xAxis.lineHeight-t.xAxis.titleFontSize)*t.pix/2+(t.xAxis.titleFontSize+t.xAxis.titleOffsetY)*t.pix),o.closePath(),o.stroke()),t.xAxis.axisLine&&(o.beginPath(),o.setStrokeStyle(t.xAxis.axisLineColor),o.setLineWidth(1*t.pix),o.moveTo(r,t.height-t.area[2]),o.lineTo(s,t.height-t.area[2]),o.stroke())}function Xa(e,t,i,o){if(!0===t.yAxis.disableGrid)return;let a=(t.height-t.area[0]-t.area[2])/t.yAxis.splitNumber,n=t.area[3],r=t.chartData.xAxisData.xAxisPoints,s=t.chartData.xAxisData.eachSpacing,l=s*(r.length-1);"mount"==t.type&&t.extra&&t.extra.mount&&t.extra.mount.widthRatio&&t.extra.mount.widthRatio>1&&(t.extra.mount.widthRatio>2&&(t.extra.mount.widthRatio=2),l+=(t.extra.mount.widthRatio-1)*s);let c=n+l,h=[],d=1;!1===t.xAxis.axisLine&&(d=0);for(let u=d;u4&&void 0!==arguments[4]?arguments[4]:1,n=Oo({},{activeOpacity:.5,activeRadius:10,offsetAngle:0,labelWidth:15,ringWidth:30,customRadius:0,border:!1,borderWidth:2,borderColor:"#FFFFFF",centerColor:"#FFFFFF",linearType:"none",customColor:[]},"pie"==t.type?t.extra.pie:t.extra.ring),r={x:t.area[3]+(t.width-t.area[1]-t.area[3])/2,y:t.area[0]+(t.height-t.area[0]-t.area[2])/2};0==i.pieChartLinePadding&&(i.pieChartLinePadding=n.activeRadius*t.pix);var s=Math.min((t.width-t.area[1]-t.area[3])/2-i.pieChartLinePadding-i.pieChartTextPadding-i._pieTextMaxLength_,(t.height-t.area[0]-t.area[2])/2-i.pieChartLinePadding-i.pieChartTextPadding);s=s<10?10:s,n.customRadius>0&&(s=n.customRadius*t.pix),e=la(e,s,a);var l=n.activeRadius*t.pix;if(n.customColor=$o(n.linearType,n.customColor,e,i),(e=e.map((function(e){return e._start_+=n.offsetAngle*Math.PI/180,e}))).forEach((function(e,i){t.tooltip&&t.tooltip.index==i&&(o.beginPath(),o.setFillStyle(Ro(e.color,n.activeOpacity||.5)),o.moveTo(r.x,r.y),o.arc(r.x,r.y,e._radius_+l,e._start_,e._start_+2*e._proportion_*Math.PI),o.closePath(),o.fill()),o.beginPath(),o.setLineWidth(n.borderWidth*t.pix),o.lineJoin="round",o.setStrokeStyle(n.borderColor);var a,s=e.color;"custom"==n.linearType&&((a=o.createCircularGradient?o.createCircularGradient(r.x,r.y,e._radius_):o.createRadialGradient(r.x,r.y,0,r.x,r.y,e._radius_)).addColorStop(0,Ro(n.customColor[e.linearIndex],1)),a.addColorStop(1,Ro(e.color,1)),s=a);o.setFillStyle(s),o.moveTo(r.x,r.y),o.arc(r.x,r.y,e._radius_,e._start_,e._start_+2*e._proportion_*Math.PI),o.closePath(),o.fill(),1==n.border&&o.stroke()})),"ring"===t.type){var c=.6*s;"number"==typeof n.ringWidth&&n.ringWidth>0&&(c=Math.max(0,s-n.ringWidth*t.pix)),o.beginPath(),o.setFillStyle(n.centerColor),o.moveTo(r.x,r.y),o.arc(r.x,r.y,c,0,2*Math.PI),o.closePath(),o.fill()}return!1!==t.dataLabel&&1===a&&Wa(e,t,i,o,0,r),1===a&&"ring"===t.type&&Oa(t,i,o,r),{center:r,radius:s,series:e}}function Za(e,t){var i=Array(2),o=20037508.34*e/180,a=Math.log(Math.tan((90+t)*Math.PI/360))/(Math.PI/180);return a=20037508.34*a/180,i[0]=o,i[1]=a,i}function en(e,t,i,o,a,n){return{x:(t-i.xMin)*o+a,y:(i.yMax-e)*o+n}}function tn(e,t,i){if(t[1]==i[1])return!1;if(t[1]>e[1]&&i[1]>e[1])return!1;if(t[1]e[1])return!1;if(i[1]==e[1]&&t[1]>e[1])return!1;if(t[0]t[n].area[2]||e[1]>t[n].area[3]||e[2]i||e[3]>o){a=!0;break}a=!1}return a}function rn(e,t,i){let o=e.series;switch(t){case"normal":for(let a=0;a.7};for(let a=0;a0&&e[0].data.constructor.toString().indexOf("Array")>-1){t._pieSeries_=e;let i=e[0].data;for(var a=0;at.width-t.area[1]-t.area[3]?(i.push(p),u.push(o-t.legend.itemGap*t.pix),o=s,p=[r]):(o+=s,p.push(r))}if(p.length){i.push(p),u.push(o-t.legend.itemGap*t.pix),n.widthArr=u;let e=Math.max.apply(null,u);switch(t.legend.float){case"left":n.area.start.x=t.area[3],n.area.end.x=t.area[3]+e+2*r;break;case"right":n.area.start.x=t.width-t.area[1]-e-2*r,n.area.end.x=t.width-t.area[1];break;default:n.area.start.x=(t.width-e)/2-r,n.area.end.x=(t.width+e)/2+r}n.area.width=e+2*r,n.area.wholeWidth=e+2*r,n.area.height=i.length*d+2*r,n.area.wholeHeight=i.length*d+2*r+2*s,n.points=i}}else{let i=e.length,o=t.height-t.area[0]-t.area[2]-2*s-2*r,u=Math.min(Math.floor(o/d),i);switch(n.area.height=u*d+2*r,n.area.wholeHeight=u*d+2*r,t.legend.float){case"top":n.area.start.y=t.area[0]+s,n.area.end.y=t.area[0]+s+n.area.height;break;case"bottom":n.area.start.y=t.height-t.area[2]-s-n.area.height,n.area.end.y=t.height-t.area[2]-s;break;default:n.area.start.y=(t.height-n.area.height)/2,n.area.end.y=(t.height+n.area.height)/2}let p=i%u==0?i/u:Math.floor(i/u+1),g=[];for(let t=0;to&&(o=n)}n.widthArr.push(o),n.heightArr.push(e.length*d+2*r)}let e=0;for(let t=0;t0?p[i].width+t.yAxis.padding*t.pix:p[i].width,a+=1):"right"==p[i].position&&(t.area[1]+=e>0?p[i].width+t.yAxis.padding*t.pix:p[i].width,e+=1)}else i.yAxisWidth=p;if(t.chartData.yAxisData=u,t.categories&&t.categories.length&&"radar"!==t.type&&"gauge"!==t.type&&"bar"!==t.type){t.chartData.xAxisData=ba(t.categories,t);let e=na(t.categories,t,0,t.chartData.xAxisData.eachSpacing,o),a=e.xAxisHeight,n=e.angle;i.xAxisHeight=a,i._xAxisTextAngle_=n,t.area[2]+=a,t.chartData.categoriesData=e}else if("line"===t.type||"area"===t.type||"scatter"===t.type||"bubble"===t.type||"bar"===t.type){t.chartData.xAxisData=ra(n,t,i,o);let e=na(r=t.chartData.xAxisData.rangesFormat,t,0,t.chartData.xAxisData.eachSpacing,o),a=e.xAxisHeight,s=e.angle;i.xAxisHeight=a,i._xAxisTextAngle_=s,t.area[2]+=a,t.chartData.categoriesData=e}else t.chartData.xAxisData={xAxisPoints:[]};if(t.enableScroll&&"right"==t.xAxis.scrollAlign&&void 0===t._scrollDistance_){let e=0,i=t.chartData.xAxisData.xAxisPoints,o=t.chartData.xAxisData.startX;e=t.chartData.xAxisData.endX-o-t.chartData.xAxisData.eachSpacing*(i.length-1),a.scrollOption.currentOffset=e,a.scrollOption.startTouchX=e,a.scrollOption.distance=0,a.scrollOption.lastMoveTime=0,t._scrollDistance_=e}switch("pie"!==e&&"ring"!==e&&"rose"!==e||(i._pieTextMaxLength_=!1===t.dataLabel?0:function(e,t,i,o){e=la(e);let a=0;for(let n=0;n4&&void 0!==arguments[4]?arguments[4]:1,n=Oo({},{type:"normal",autoColors:!0},t.extra.word);t.chartData.wordCloudData||(t.chartData.wordCloudData=rn(t,n.type,o)),o.beginPath(),o.setFillStyle(t.background),o.rect(0,0,t.width,t.height),o.fill(),o.save();let r=t.chartData.wordCloudData;o.translate(t.width/2,t.height/2);for(let s=0;s0&&(t.tooltip&&t.tooltip.index==s?o.strokeText(e,(r[s].areav[0]+5-t.width/2)*a-n*(1-a)/2,(r[s].areav[1]+5+i-t.height/2)*a):o.fillText(e,(r[s].areav[0]+5-t.width/2)*a-n*(1-a)/2,(r[s].areav[1]+5+i-t.height/2)*a)):r[s].area[0]>0&&(t.tooltip&&t.tooltip.index==s?o.strokeText(e,(r[s].area[0]+5-t.width/2)*a-n*(1-a)/2,(r[s].area[1]+5+i-t.height/2)*a):o.fillText(e,(r[s].area[0]+5-t.width/2)*a-n*(1-a)/2,(r[s].area[1]+5+i-t.height/2)*a)),o.stroke(),o.restore()}o.restore()}(n,t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}});break;case"map":o.clearRect(0,0,t.width,t.height),function(e,t,i,o){var a,n,r=Oo({},{border:!0,mercator:!1,borderWidth:1,active:!0,borderColor:"#666666",fillOpacity:.6,activeBorderColor:"#f04864",activeFillColor:"#facc14",activeFillOpacity:1},t.extra.map),s=e,l=function(e){for(var t,i={xMin:180,xMax:0,yMin:90,yMax:0},o=0;os.x?i.xMax:s.x,i.yMin=i.yMins.y?i.yMax:s.y}}return i}(s);if(r.mercator){var c=Za(l.xMax,l.yMax),h=Za(l.xMin,l.yMin);l.xMax=c[0],l.yMax=c[1],l.xMin=h[0],l.yMin=h[1]}for(var d=t.width/Math.abs(l.xMax-l.xMin),u=t.height/Math.abs(l.yMax-l.yMin),p=d{this.uevent.trigger("renderComplete")}),50);break;case"funnel":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),t.chartData.funnelData=function(e,t,i,o){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,n=Oo({},{type:"funnel",activeWidth:10,activeOpacity:.3,border:!1,borderWidth:2,borderColor:"#FFFFFF",fillOpacity:1,minSize:0,labelAlign:"right",linearType:"none",customColor:[]},t.extra.funnel),r=(t.height-t.area[0]-t.area[2])/e.length,s={x:t.area[3]+(t.width-t.area[1]-t.area[3])/2,y:t.height-t.area[2]},l=n.activeWidth*t.pix,c=Math.min((t.width-t.area[1]-t.area[3])/2-l,(t.height-t.area[0]-t.area[2])/2-l),h=ca(e,c,n,r,a);if(o.save(),o.translate(s.x,s.y),n.customColor=$o(n.linearType,n.customColor,e,i),"pyramid"==n.type)for(let p=0;p4&&void 0!==arguments[4]?arguments[4]:1,n=Oo({},{type:"straight",width:2,activeType:"none",linearType:"none",onShadow:!1,animation:"vertical"},t.extra.line);n.width*=t.pix;let r=t.chartData.xAxisData,s=r.xAxisPoints,l=r.eachSpacing;var c=[];o.save();let h=0,d=t.width+l;return t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&(o.translate(t._scrollDistance_,0),h=-t._scrollDistance_-2*l+t.area[3],d=h+(t.xAxis.itemCount+4)*l),e.forEach((function(e,r){let u,p,g;o.beginPath(),o.setStrokeStyle(e.color),o.moveTo(-1e4,-1e4),o.lineTo(-10001,-10001),o.stroke(),u=[].concat(t.chartData.yAxisData.ranges[e.index]),p=u.pop(),g=u.shift();var f=Ta(e.data,p,g,s,l,t,i,n,a);c.push(f);var x=aa(f,e);if("dash"==e.lineType){let i=e.dashLength?e.dashLength:8;i*=t.pix,o.setLineDash([i,i])}o.beginPath();var y=e.color;if("none"!==n.linearType&&e.linearColor&&e.linearColor.length>0){for(var m=o.createLinearGradient(t.chartData.xAxisData.startX,t.height/2,t.chartData.xAxisData.endX,t.height/2),v=0;v0?o.setShadow(e.setShadow[0],e.setShadow[1],e.setShadow[2],e.setShadow[3]):o.setShadow(0,0,0,"rgba(0,0,0,0)"),o.setLineWidth(n.width),x.forEach((function(e,t){if(1===e.length)o.moveTo(e[0].x,e[0].y);else{o.moveTo(e[0].x,e[0].y);let t=0;if("curve"===n.type)for(let a=0;ah&&(o.moveTo(n.x,n.y),t=1),a>0&&n.x>h&&n.xh&&(o.moveTo(a.x,a.y),t=1),i>0&&a.x>h&&a.xh&&(o.moveTo(a.x,a.y),t=1),i>0&&a.x>h&&a.x4&&void 0!==arguments[4]?arguments[4]:1;Oo({},{type:"circle"},t.extra.scatter);let n=t.chartData.xAxisData,r=n.xAxisPoints,s=n.eachSpacing;var l=[];o.save();let c=0;return t.width,t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&(o.translate(t._scrollDistance_,0),c=-t._scrollDistance_-2*s+t.area[3],t.xAxis.itemCount),e.forEach((function(e,n){let l,c,h;l=[].concat(t.chartData.yAxisData.ranges[e.index]),c=l.pop(),h=l.shift();var d=wa(e.data,c,h,r,s,t,i,a);o.beginPath(),o.setStrokeStyle(e.color),o.setFillStyle(e.color),o.setLineWidth(1*t.pix);var u=e.pointShape;if("diamond"===u)d.forEach((function(e,t){null!==e&&(o.moveTo(e.x,e.y-4.5),o.lineTo(e.x-4.5,e.y),o.lineTo(e.x,e.y+4.5),o.lineTo(e.x+4.5,e.y),o.lineTo(e.x,e.y-4.5))}));else if("circle"===u)d.forEach((function(e,i){null!==e&&(o.moveTo(e.x+2.5*t.pix,e.y),o.arc(e.x,e.y,3*t.pix,0,2*Math.PI,!1))}));else if("square"===u)d.forEach((function(e,t){null!==e&&(o.moveTo(e.x-3.5,e.y-3.5),o.rect(e.x-3.5,e.y-3.5,7,7))}));else if("triangle"===u)d.forEach((function(e,t){null!==e&&(o.moveTo(e.x,e.y-4.5),o.lineTo(e.x-4.5,e.y+4.5),o.lineTo(e.x+4.5,e.y+4.5),o.lineTo(e.x,e.y-4.5))}));else if("triangle"===u)return;o.closePath(),o.fill(),o.stroke()})),!1!==t.dataLabel&&1===a&&e.forEach((function(e,n){let l,c,h;l=[].concat(t.chartData.yAxisData.ranges[e.index]),c=l.pop(),h=l.shift(),Ea(wa(e.data,c,h,r,s,t,i,a),e,i,o,t)})),o.restore(),{xAxisPoints:r,calPoints:l,eachSpacing:s}}(n,t,i,o,e),s=a.xAxisPoints,l=a.calPoints,c=a.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=l,t.chartData.eachSpacing=c,Va(0,t,i,o),!1!==t.enableMarkLine&&1===e&&ja(t,0,o),Ya(t.series,t,i,o,t.chartData),Ja(t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}});break;case"bubble":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),Xa(0,t,0,o),Ka(r,t,i,o);var a=function(e,t,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,n=Oo({},{opacity:1,border:2},t.extra.bubble);let r=t.chartData.xAxisData,s=r.xAxisPoints,l=r.eachSpacing;var c=[];o.save();let h=0;return t.width,t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&(o.translate(t._scrollDistance_,0),h=-t._scrollDistance_-2*l+t.area[3],t.xAxis.itemCount),e.forEach((function(e,r){let c,h,d;c=[].concat(t.chartData.yAxisData.ranges[e.index]),h=c.pop(),d=c.shift();var u=wa(e.data,h,d,s,l,t,i,a);o.beginPath(),o.setStrokeStyle(e.color),o.setLineWidth(n.border*t.pix),o.setFillStyle(Ro(e.color,n.opacity)),u.forEach((function(e,i){o.moveTo(e.x+e.r,e.y),o.arc(e.x,e.y,e.r*t.pix,0,2*Math.PI,!1)})),o.closePath(),o.fill(),o.stroke(),!1!==t.dataLabel&&1===a&&u.forEach((function(a,n){o.beginPath();var r=e.textSize*t.pix||i.fontSize;o.setFontSize(r),o.setFillStyle(e.textColor||"#FFFFFF"),o.setTextAlign("center"),o.fillText(String(a.t),a.x,a.y+r/2),o.closePath(),o.stroke(),o.setTextAlign("left")}))})),o.restore(),{xAxisPoints:s,calPoints:c,eachSpacing:l}}(n,t,i,o,e),s=a.xAxisPoints,l=a.calPoints,c=a.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=l,t.chartData.eachSpacing=c,Va(0,t,i,o),!1!==t.enableMarkLine&&1===e&&ja(t,0,o),Ya(t.series,t,i,o,t.chartData),Ja(t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}});break;case"mix":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),Xa(0,t,0,o),Ka(r,t,i,o);var a=function(e,t,i,o){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,n=t.chartData.xAxisData,r=n.xAxisPoints,s=n.eachSpacing,l=Oo({},{width:s/2,barBorderCircle:!1,barBorderRadius:[],seriesGap:2,linearType:"none",linearOpacity:1,customColor:[],colorStop:0},t.extra.mix.column),c=Oo({},{opacity:.2,gradient:!1},t.extra.mix.area),h=Oo({},{width:2},t.extra.mix.line),d=t.height-t.area[2],u=[];var p=0,g=0;e.forEach((function(e,t){"column"==e.type&&(g+=1)})),o.save();let f=-2,x=r.length+2,y=0,m=t.width+s;t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&(o.translate(t._scrollDistance_,0),f=Math.floor(-t._scrollDistance_/s)-2,x=f+t.xAxis.itemCount+4,y=-t._scrollDistance_-2*s+t.area[3],m=y+(t.xAxis.itemCount+4)*s),l.customColor=$o(l.linearType,l.customColor,e,i),e.forEach((function(e,n){let v,b,S;v=[].concat(t.chartData.yAxisData.ranges[e.index]),b=v.pop(),S=v.shift();var w=wa(e.data,b,S,r,s,t,i,a);if(u.push(w),"column"==e.type){w=fa(w,s,g,p,0,t);for(let i=0;if&&iu?u:s,c=c>u?u:c,h=h>u?u:h,d=d>u?u:d,s=s<0?0:s,c=c<0?0:c,h=h<0?0:h,d=d<0?0:d,o.arc(e+s,i+s,s,-Math.PI,-Math.PI/2),o.arc(e+n-c,i+c,c,-Math.PI/2,0),o.arc(e+n-h,i+r-h,h,0,Math.PI/2),o.arc(e+d,i+r-d,d,Math.PI/2,Math.PI)}else o.moveTo(T,a.y),o.lineTo(T+a.width,a.y),o.lineTo(T+a.width,t.height-t.area[2]),o.lineTo(T,t.height-t.area[2]),o.lineTo(T,a.y),o.setLineWidth(1),o.setStrokeStyle(_);o.setFillStyle(A),o.closePath(),o.fill()}}p+=1}if("area"==e.type){let i=aa(w,e);for(let a=0;a1){var C=n[0];let t=n[n.length-1];o.moveTo(C.x,C.y);let i=0;if("curve"===e.style)for(let e=0;ey&&(o.moveTo(t.x,t.y),i=1),e>0&&t.x>y&&t.xy&&(o.moveTo(t.x,t.y),i=1),e>0&&t.x>y&&t.xy&&(o.moveTo(a.x,a.y),t=1),e>0&&a.x>y&&a.xy&&(o.moveTo(a.x,a.y),t=1),e>0&&a.x>y&&a.x4&&void 0!==arguments[4]?arguments[4]:1,n=t.chartData.xAxisData,r=n.xAxisPoints,s=n.eachSpacing,l=Oo({},{type:"group",width:s/2,meterBorder:4,meterFillColor:"#FFFFFF",barBorderCircle:!1,barBorderRadius:[],seriesGap:2,linearType:"none",linearOpacity:1,customColor:[],colorStop:0,labelPosition:"outside"},t.extra.column),c=[];o.save();let h=-2,d=r.length+2;return t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&(o.translate(t._scrollDistance_,0),h=Math.floor(-t._scrollDistance_/s)-2,d=h+t.xAxis.itemCount+4),t.tooltip&&t.tooltip.textList&&t.tooltip.textList.length&&1===a&&$a(t.tooltip.offset.x,t,0,o,s),l.customColor=$o(l.linearType,l.customColor,e,i),e.forEach((function(n,u){let p,g,f;p=[].concat(t.chartData.yAxisData.ranges[n.index]),g=p.pop(),f=p.shift();let x=(t.height-t.area[0]-t.area[2])*(0-g)/(f-g),y=t.height-Math.round(x)-t.area[2];n.zeroPoints=y;var m=n.data;switch(l.type){case"group":var v=Aa(m,g,f,r,s,t,i,y,a),b=Ca(m,g,f,r,s,t,i,u,e,a);c.push(b),v=fa(v,s,e.length,u,0,t);for(let e=0;eh&&ey?y:i.y,a=i.width,n=Math.abs(y-i.y);l.barBorderCircle&&(l.barBorderRadius=[a/2,a/2,0,0]),i.y>y&&(l.barBorderRadius=[0,0,a/2,a/2]);let[r,s,c,h]=l.barBorderRadius,d=Math.min(a/2,n/2);r=r>d?d:r,s=s>d?d:s,c=c>d?d:c,h=h>d?d:h,r=r<0?0:r,s=s<0?0:s,c=c<0?0:c,h=h<0?0:h,o.arc(e+r,t+r,r,-Math.PI,-Math.PI/2),o.arc(e+a-s,t+s,s,-Math.PI/2,0),o.arc(e+a-c,t+n-c,c,0,Math.PI/2),o.arc(e+h,t+n-h,h,Math.PI/2,Math.PI)}else o.moveTo(S,i.y),o.lineTo(S+i.width,i.y),o.lineTo(S+i.width,y),o.lineTo(S,y),o.lineTo(S,i.y),o.setLineWidth(1),o.setStrokeStyle(A);o.setFillStyle(T),o.closePath(),o.fill()}}break;case"stack":v=Ca(m,g,f,r,s,t,i,u,e,a),c.push(v),v=ma(v,s,e.length,0,0,t);for(let e=0;eh&&e0&&(w-=P),o.setFillStyle(T),o.moveTo(S,i.y),o.fillRect(S,i.y,i.width,w),o.closePath(),o.fill()}}break;case"meter":v=wa(m,g,f,r,s,t,i,a),c.push(v),v=ya(v,s,e.length,u,0,t,l.meterBorder);for(let e=0;eh&&e0&&(o.setStrokeStyle(n.color),o.setLineWidth(l.meterBorder*t.pix)),0==u?o.setFillStyle(l.meterFillColor):o.setFillStyle(i.color||n.color),S=i.x-i.width/2,w=t.height-i.y-t.area[2],l.barBorderRadius&&4===l.barBorderRadius.length||!0===l.barBorderCircle){const e=S,t=i.y,a=i.width,n=y-i.y;l.barBorderCircle&&(l.barBorderRadius=[a/2,a/2,0,0]);let[r,s,c,h]=l.barBorderRadius,d=Math.min(a/2,n/2);r=r>d?d:r,s=s>d?d:s,c=c>d?d:c,h=h>d?d:h,r=r<0?0:r,s=s<0?0:s,c=c<0?0:c,h=h<0?0:h,o.arc(e+r,t+r,r,-Math.PI,-Math.PI/2),o.arc(e+a-s,t+s,s,-Math.PI/2,0),o.arc(e+a-c,t+n-c,c,0,Math.PI/2),o.arc(e+h,t+n-h,h,Math.PI/2,Math.PI),o.fill()}else o.moveTo(S,i.y),o.lineTo(S+i.width,i.y),o.lineTo(S+i.width,y),o.lineTo(S,y),o.lineTo(S,i.y),o.fill();0==u&&l.meterBorder>0&&(o.closePath(),o.stroke())}}}})),!1!==t.dataLabel&&1===a&&e.forEach((function(n,c){let h,d,u;h=[].concat(t.chartData.yAxisData.ranges[n.index]),d=h.pop(),u=h.shift();var p=n.data;switch(l.type){case"group":Ra(fa(Aa(p,d,u,r,s,t,i,a),s,e.length,c,0,t),n,i,o,t);break;case"stack":Ra(Ca(p,d,u,r,s,t,i,c,e,a),n,i,o,t);break;case"meter":Ra(wa(p,d,u,r,s,t,i,a),n,i,o,t)}})),o.restore(),{xAxisPoints:r,calPoints:c,eachSpacing:s}}(n,t,i,o,e),s=a.xAxisPoints,l=a.calPoints,c=a.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=l,t.chartData.eachSpacing=c,Va(0,t,i,o),!1!==t.enableMarkLine&&1===e&&ja(t,0,o),Ya(t.series,t,i,o,t.chartData),Ja(t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}});break;case"mount":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),Xa(0,t,0,o),Ka(r,t,i,o);var a=function(e,t,i,o){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,n=t.chartData.xAxisData,r=n.xAxisPoints,s=n.eachSpacing,l=Oo({},{type:"mount",widthRatio:1,borderWidth:1,barBorderCircle:!1,barBorderRadius:[],linearType:"none",linearOpacity:1,customColor:[],colorStop:0},t.extra.mount);l.widthRatio=l.widthRatio<=0?0:l.widthRatio,l.widthRatio=l.widthRatio>=2?2:l.widthRatio,o.save();let c,h,d,u=-2,p=r.length+2;t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&(o.translate(t._scrollDistance_,0),u=Math.floor(-t._scrollDistance_/s)-2,p=u+t.xAxis.itemCount+4),l.customColor=$o(l.linearType,l.customColor,e,i),c=[].concat(t.chartData.yAxisData.ranges[0]),h=c.pop(),d=c.shift();let g=(t.height-t.area[0]-t.area[2])*(0-h)/(d-h),f=t.height-Math.round(g)-t.area[2];var x=_a(e,h,d,r,s,t,l,f,a);switch(l.type){case"bar":for(let i=0;iu&&if?f:a.y,i=a.width,n=Math.abs(f-a.y);l.barBorderCircle&&(l.barBorderRadius=[i/2,i/2,0,0]),a.y>f&&(l.barBorderRadius=[0,0,i/2,i/2]);let[r,s,c,h]=l.barBorderRadius,d=Math.min(i/2,n/2);r=r>d?d:r,s=s>d?d:s,c=c>d?d:c,h=h>d?d:h,r=r<0?0:r,s=s<0?0:s,c=c<0?0:c,h=h<0?0:h,o.arc(e+r,t+r,r,-Math.PI,-Math.PI/2),o.arc(e+i-s,t+s,s,-Math.PI/2,0),o.arc(e+i-c,t+n-c,c,0,Math.PI/2),o.arc(e+h,t+n-h,h,Math.PI/2,Math.PI)}else o.moveTo(y,a.y),o.lineTo(y+a.width,a.y),o.lineTo(y+a.width,f),o.lineTo(y,f),o.lineTo(y,a.y);o.setStrokeStyle(b),o.setFillStyle(v),l.borderWidth>0&&(o.setLineWidth(l.borderWidth*t.pix),o.closePath(),o.stroke()),o.fill()}}break;case"triangle":for(let i=0;iu&&i0&&(o.setLineWidth(l.borderWidth*t.pix),o.stroke()),o.fill())}break;case"mount":for(let i=0;iu&&i0&&(o.setLineWidth(l.borderWidth*t.pix),o.stroke()),o.fill())}break;case"sharp":for(let i=0;iu&&i0&&(o.setLineWidth(l.borderWidth*t.pix),o.stroke()),o.fill())}}if(!1!==t.dataLabel&&1===a){let n,c,h;n=[].concat(t.chartData.yAxisData.ranges[0]),c=n.pop(),h=n.shift(),Na(x=_a(e,c,h,r,s,t,l,f,a),e,i,o,t,f)}return o.restore(),{xAxisPoints:r,calPoints:x,eachSpacing:s}}(n,t,i,o,e),s=a.xAxisPoints,l=a.calPoints,c=a.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=l,t.chartData.eachSpacing=c,Va(0,t,i,o),!1!==t.enableMarkLine&&1===e&&ja(t,0,o),Ya(t.series,t,i,o,t.chartData),Ja(t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}});break;case"bar":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),Ka(r,t,i,o);var a=function(e,t,i,o){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,n=[],r=(t.height-t.area[0]-t.area[2])/t.categories.length;for(let d=0;dc&&ed?d:r,l=l>d?d:l,c=c>d?d:c,h=h>d?d:h,r=r<0?0:r,l=l<0?0:l,c=c<0?0:c,h=h<0?0:h,o.arc(e+h,a+h,h,-Math.PI,-Math.PI/2),o.arc(i.x-r,a+r,r,-Math.PI/2,0),o.arc(i.x-l,a+t-l,l,0,Math.PI/2),o.arc(e+c,a+t-c,c,Math.PI/2,Math.PI)}else o.moveTo(v,b),o.lineTo(i.x,b),o.lineTo(i.x,b+i.width),o.lineTo(v,b+i.width),o.lineTo(v,b),o.setLineWidth(1),o.setStrokeStyle(w);o.setFillStyle(S),o.closePath(),o.fill()}}break;case"stack":y=ka(x,g,f,n,r,t,i,u,e,a),l.push(y),y=va(y,r,e.length,0,0,t);for(let e=0;ec&&e4&&void 0!==arguments[4]?arguments[4]:1,n=Oo({},{type:"straight",opacity:.2,addLine:!1,width:2,gradient:!1,activeType:"none"},t.extra.area);let r=t.chartData.xAxisData,s=r.xAxisPoints,l=r.eachSpacing,c=t.height-t.area[2],h=[];o.save();let d=0,u=t.width+l;return t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&(o.translate(t._scrollDistance_,0),d=-t._scrollDistance_-2*l+t.area[3],u=d+(t.xAxis.itemCount+4)*l),e.forEach((function(e,r){let p,g,f;p=[].concat(t.chartData.yAxisData.ranges[e.index]),g=p.pop(),f=p.shift();let x=wa(e.data,g,f,s,l,t,i,a);h.push(x);let y=aa(x,e);for(let i=0;i1){let e=a[0],t=a[a.length-1];o.moveTo(e.x,e.y);let i=0;if("curve"===n.type)for(let n=0;nd&&(o.moveTo(e.x,e.y),i=1),n>0&&e.x>d&&e.xd&&(o.moveTo(e.x,e.y),i=1),n>0&&e.x>d&&e.xd&&(o.moveTo(e.x,e.y),i=1),n>0&&e.x>d&&e.xd&&(o.moveTo(i.x,i.y),e=1),t>0&&i.x>d&&i.xd&&(o.moveTo(i.x,i.y),e=1),t>0&&i.x>d&&i.xd&&(o.moveTo(i.x,i.y),e=1),t>0&&i.x>d&&i.x4&&void 0!==arguments[4]?arguments[4]:1,n=Oo({},{type:"area",activeOpacity:.5,activeRadius:10,offsetAngle:0,labelWidth:15,border:!1,borderWidth:2,borderColor:"#FFFFFF",linearType:"none",customColor:[]},t.extra.rose);0==i.pieChartLinePadding&&(i.pieChartLinePadding=n.activeRadius*t.pix);var r={x:t.area[3]+(t.width-t.area[1]-t.area[3])/2,y:t.area[0]+(t.height-t.area[0]-t.area[2])/2},s=Math.min((t.width-t.area[1]-t.area[3])/2-i.pieChartLinePadding-i.pieChartTextPadding-i._pieTextMaxLength_,(t.height-t.area[0]-t.area[2])/2-i.pieChartLinePadding-i.pieChartTextPadding);s=s<10?10:s;var l=n.minRadius||.5*s;s4&&void 0!==arguments[4]?arguments[4]:1,n=Oo({},{gridColor:"#cccccc",gridType:"radar",gridEval:1,axisLabel:!1,axisLabelTofix:0,labelShow:!0,labelColor:"#666666",labelPointShow:!1,labelPointRadius:3,labelPointColor:"#cccccc",opacity:.2,gridCount:3,border:!1,borderWidth:2,linearType:"none",customColor:[]},t.extra.radar),r=Yo(t.categories.length),s={x:t.area[3]+(t.width-t.area[1]-t.area[3])/2,y:t.area[0]+(t.height-t.area[0]-t.area[2])/2},l=(t.width-t.area[1]-t.area[3])/2,c=(t.height-t.area[0]-t.area[2])/2,h=Math.min(l-(Vo(t.categories,i.fontSize,o)+i.radarLabelTextMargin),c-i.radarLabelTextMargin);h=(h-=i.radarLabelTextMargin*t.pix)<10?10:h,h=n.radius?n.radius:h,o.beginPath(),o.setLineWidth(1*t.pix),o.setStrokeStyle(n.gridColor),r.forEach((function(e,t){var i=Wo(h*Math.cos(e),h*Math.sin(e),s);o.moveTo(s.x,s.y),t%n.gridEval==0&&o.lineTo(i.x,i.y)})),o.stroke(),o.closePath();for(var d=function(e){var i={};if(o.beginPath(),o.setLineWidth(1*t.pix),o.setStrokeStyle(n.gridColor),"radar"==n.gridType)r.forEach((function(t,a){var r=Wo(h/n.gridCount*e*Math.cos(t),h/n.gridCount*e*Math.sin(t),s);0===a?(i=r,o.moveTo(r.x,r.y)):o.lineTo(r.x,r.y)})),o.lineTo(i.x,i.y);else{var a=Wo(h/n.gridCount*e*Math.cos(1.5),h/n.gridCount*e*Math.sin(1.5),s);o.arc(s.x,s.y,s.y-a.y,0,2*Math.PI,!1)}o.stroke(),o.closePath()},u=1;u<=n.gridCount;u++)d(u);n.customColor=$o(n.linearType,n.customColor,e,i);var p=sa(r,s,h,e,t,a);if(p.forEach((function(i,a){o.beginPath(),o.setLineWidth(n.borderWidth*t.pix),o.setStrokeStyle(i.color);var r,l=Ro(i.color,n.opacity);"custom"==n.linearType&&((r=o.createCircularGradient?o.createCircularGradient(s.x,s.y,h):o.createRadialGradient(s.x,s.y,0,s.x,s.y,h)).addColorStop(0,Ro(n.customColor[e[a].linearIndex],n.opacity)),r.addColorStop(1,Ro(i.color,n.opacity)),l=r),o.setFillStyle(l),i.data.forEach((function(e,t){0===t?o.moveTo(e.position.x,e.position.y):o.lineTo(e.position.x,e.position.y)})),o.closePath(),o.fill(),!0===n.border&&o.stroke(),o.closePath(),!1!==t.dataPointShape&&Ma(i.data.map((function(e){return e.position})),i.color,i.pointShape,o,t)})),!0===n.axisLabel){const i=Math.max(n.max,Math.max.apply(null,Go(e))),a=h/n.gridCount,r=t.fontSize*t.pix;for(o.setFontSize(r),o.setFillStyle(t.fontColor),o.setTextAlign("left"),u=0;u4&&void 0!==arguments[4]?arguments[4]:1,s=Oo({},{startAngle:.75,endAngle:.25,type:"default",direction:"cw",lineCap:"round",width:12,gap:2,linearType:"none",customColor:[]},t.extra.arcbar);e=da(e,s,r),a=s.centerX||s.centerY?{x:s.centerX?s.centerX:t.width/2,y:s.centerY?s.centerY:t.height/2}:{x:t.width/2,y:t.height/2},s.radius?n=s.radius:(n=Math.min(a.x,a.y),n-=5*t.pix,n-=s.width/2),n=n<10?10:n,s.customColor=$o(s.linearType,s.customColor,e,i);for(let h=0;h5&&void 0!==arguments[5]?arguments[5]:1,r=Oo({},{type:"default",startAngle:.75,endAngle:.25,width:15,labelOffset:13,splitLine:{fixRadius:0,splitNumber:10,width:15,color:"#FFFFFF",childNumber:5,childWidth:5},pointer:{width:15,color:"auto"}},i.extra.gauge);null==r.oldAngle&&(r.oldAngle=r.startAngle),null==r.oldData&&(r.oldData=0),e=pa(e,r.startAngle,r.endAngle);var s={x:i.width/2,y:i.height/2},l=Math.min(s.x,s.y);l-=5*i.pix;var c=(l=(l-=r.width/2)<10?10:l)-r.width,h=0;if("progress"==r.type){var d=l-3*r.width;a.beginPath();let e=a.createLinearGradient(s.x,s.y-d,s.x,s.y+d);e.addColorStop("0",Ro(t[0].color,.3)),e.addColorStop("1.0",Ro("#FFFFFF",.1)),a.setFillStyle(e),a.arc(s.x,s.y,d,0,2*Math.PI,!1),a.fill(),a.setLineWidth(r.width),a.setStrokeStyle(Ro(t[0].color,.3)),a.setLineCap("round"),a.beginPath(),a.arc(s.x,s.y,c,r.startAngle*Math.PI,r.endAngle*Math.PI,!1),a.stroke(),h=r.endAnglen/g?a.setStrokeStyle(Ro(t[0].color,1)):a.setStrokeStyle(Ro(t[0].color,.3)),a.setLineWidth(3*i.pix),a.moveTo(u,0),a.lineTo(p,0),a.stroke(),a.rotate(o*Math.PI);a.restore(),t=ua(t,r,n),a.setLineWidth(r.width),a.setStrokeStyle(t[0].color),a.setLineCap("round"),a.beginPath(),a.arc(s.x,s.y,c,r.startAngle*Math.PI,t[0]._proportion_*Math.PI,!1),a.stroke();let x=l-2.5*r.width;a.save(),a.translate(s.x,s.y),a.rotate((t[0]._proportion_-1)*Math.PI),a.beginPath(),a.setLineWidth(r.width/3);let y=a.createLinearGradient(0,.6*-x,0,.6*x);y.addColorStop("0",Ro("#FFFFFF",0)),y.addColorStop("0.5",Ro(t[0].color,1)),y.addColorStop("1.0",Ro("#FFFFFF",0)),a.setStrokeStyle(y),a.arc(0,0,x,.85*Math.PI,1.15*Math.PI,!1),a.stroke(),a.beginPath(),a.setLineWidth(1),a.setStrokeStyle(t[0].color),a.setFillStyle(t[0].color),a.moveTo(-x-r.width/3/2,-4),a.lineTo(-x-r.width/3/2-4,0),a.lineTo(-x-r.width/3/2,4),a.lineTo(-x-r.width/3/2,-4),a.stroke(),a.fill(),a.restore()}else{a.setLineWidth(r.width),a.setLineCap("butt");for(let t=0;t5&&void 0!==arguments[5]?arguments[5]:1,r=Oo({},{color:{},average:{}},i.extra.candle);r.color=Oo({},{upLine:"#f04864",upFill:"#f04864",downLine:"#2fc25b",downFill:"#2fc25b"},r.color),r.average=Oo({},{show:!1,name:[],day:[],color:o.color},r.average),i.extra.candle=r;let s=i.chartData.xAxisData,l=s.xAxisPoints,c=s.eachSpacing,h=[];a.save();let d=-2,u=l.length+2,p=0,g=i.width+c;return i._scrollDistance_&&0!==i._scrollDistance_&&!0===i.enableScroll&&(a.translate(i._scrollDistance_,0),d=Math.floor(-i._scrollDistance_/c)-2,u=d+i.xAxis.itemCount+4,p=-i._scrollDistance_-2*c+i.area[3],g=p+(i.xAxis.itemCount+4)*c),(r.average.show||t)&&t.forEach((function(e,t){let r,s,h;r=[].concat(i.chartData.yAxisData.ranges[e.index]),s=r.pop(),h=r.shift();var d=aa(wa(e.data,s,h,l,c,i,o,n),e);for(let i=0;ip&&(a.moveTo(o.x,o.y),e=1),i>0&&o.x>p&&o.xd&&o0?(a.setStrokeStyle(r.color.upLine),a.setFillStyle(r.color.upFill),a.setLineWidth(1*i.pix),a.moveTo(e[3].x,e[3].y),a.lineTo(e[1].x,e[1].y),a.lineTo(e[1].x-c/4,e[1].y),a.lineTo(e[0].x-c/4,e[0].y),a.lineTo(e[0].x,e[0].y),a.lineTo(e[2].x,e[2].y),a.lineTo(e[0].x,e[0].y),a.lineTo(e[0].x+c/4,e[0].y),a.lineTo(e[1].x+c/4,e[1].y),a.lineTo(e[1].x,e[1].y),a.moveTo(e[3].x,e[3].y)):(a.setStrokeStyle(r.color.downLine),a.setFillStyle(r.color.downFill),a.setLineWidth(1*i.pix),a.moveTo(e[3].x,e[3].y),a.lineTo(e[0].x,e[0].y),a.lineTo(e[0].x-c/4,e[0].y),a.lineTo(e[1].x-c/4,e[1].y),a.lineTo(e[1].x,e[1].y),a.lineTo(e[2].x,e[2].y),a.lineTo(e[1].x,e[1].y),a.lineTo(e[1].x+c/4,e[1].y),a.lineTo(e[0].x+c/4,e[0].y),a.lineTo(e[0].x,e[0].y),a.moveTo(e[3].x,e[3].y)),a.closePath(),a.fill(),a.stroke()}})),a.restore(),{xAxisPoints:l,calPoints:h,eachSpacing:c}}(n,l,t,i,o,e),s=a.xAxisPoints,c=a.calPoints,h=a.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=c,t.chartData.eachSpacing=h,Va(0,t,i,o),!1!==t.enableMarkLine&&1===e&&ja(t,0,o),Ya(l?0:t.series,t,i,o,t.chartData),Ja(t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}})}}function pn(){this.events={}}dn.prototype.stop=function(){this.isStop=!0},pn.prototype.addEventListener=function(e,t){this.events[e]=this.events[e]||[],this.events[e].push(t)},pn.prototype.delEventListener=function(e){this.events[e]=[]},pn.prototype.trigger=function(){for(var e=arguments.length,t=Array(e),i=0;i0&&void 0!==arguments[0]?arguments[0]:{};this.opts=Oo({},this.opts,e),this.opts.updateData=!0;let t=e.scrollPosition||"current";switch(t){case"current":this.opts._scrollDistance_=this.scrollOption.currentOffset;break;case"left":this.opts._scrollDistance_=0,this.scrollOption={currentOffset:0,startTouchX:0,distance:0,lastMoveTime:0};break;case"right":let e=La(this.opts.series,this.opts,this.config,this.context).yAxisWidth;this.config.yAxisWidth=e;let t=0,i=ba(this.opts.categories,this.opts,this.config),o=i.xAxisPoints,a=i.startX;t=i.endX-a-i.eachSpacing*(o.length-1),this.scrollOption={currentOffset:t,startTouchX:t,distance:0,lastMoveTime:0},this.opts._scrollDistance_=t}un.call(this,this.opts.type,this.opts,this.config,this.context)},gn.prototype.zoom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.opts.xAxis.itemCount;if(!0!==this.opts.enableScroll)return void console.log("[uCharts] 请启用滚动条后使用");let t=Math.round(Math.abs(this.scrollOption.currentOffset)/this.opts.chartData.eachSpacing)+Math.round(this.opts.xAxis.itemCount/2);this.opts.animation=!1,this.opts.xAxis.itemCount=e.itemCount;let i=La(this.opts.series,this.opts,this.config,this.context),o=i.yAxisWidth;this.config.yAxisWidth=o;let a=0,n=ba(this.opts.categories,this.opts,this.config),r=n.xAxisPoints,s=n.startX,l=n.endX,c=n.eachSpacing,h=c*t,d=l-s,u=d-c*(r.length-1);a=d/2-h,a>0&&(a=0),a=this.opts.categories.length?this.opts.categories.length:r,this.opts.animation=!1,this.opts.xAxis.itemCount=r;let s=0,l=ba(this.opts.categories,this.opts,this.config),c=l.xAxisPoints,h=l.startX,d=l.endX,u=l.eachSpacing,p=u*this.scrollOption.moveCurrent1,g=d-h-u*(c.length-1);s=-p+Math.min(o[0].x,o[1].x)-this.opts.area[3]-u,s>0&&(s=0),s2*Math.PI&&(e-=2*Math.PI),e},r=Math.atan2(t.center.y-e.y,e.x-t.center.x);(r*=-1)<0&&(r+=2*Math.PI),t.angleList.map((function(e){return n(-1*e)})).forEach((function(e,t){var i=n(e-o/2),s=n(e+o/2);s=i&&r<=s||r+2*Math.PI>=i&&r+2*Math.PI<=s)&&(a=t)}))}return a}({x:i.x,y:i.y},this.opts.chartData.radarData,this.opts.categories.length):"funnel"===this.opts.type?function(e,t){for(var i=-1,o=0,a=t.series.length;on.funnelArea[0]&&e.xn.funnelArea[1]&&e.yn.area[0]&&e.xn.area[1]&&e.y4&&void 0!==arguments[4]?arguments[4]:0,n={index:-1,group:[]},r=i.chartData.eachSpacing/2;let s=i.chartData.yAxisPoints;return t&&t.length>0&&ia(e,i)&&s.forEach((function(t,i){e.y+a+r>t&&(n.index=i)})),n}({x:i.x,y:i.y},this.opts.chartData.calPoints,this.opts,this.config,Math.abs(this.scrollOption.currentOffset)):function(e,t,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,n={index:-1,group:[]},r=i.chartData.eachSpacing/2;let s=[];if(t&&t.length>0){if(i.categories){for(let e=1;et&&(n.index=i)}));else{let i=Array(t.length);for(let n=0;nt.start.x&&e.xt.start.y&&e.yi[0]-0&&e.xi[1]-0&&e.y1&&void 0!==arguments[1]?arguments[1]:{},i=null;if(i=e.changedTouches?e.changedTouches[0]:e.mp.changedTouches[0]){Ko(i,this.opts,e);var o=this.getLegendDataIndex(e);o>=0&&("candle"==this.opts.type?this.opts.seriesMA[o].show=!this.opts.seriesMA[o].show:this.opts.series[o].show=!this.opts.series[o].show,this.opts.animation=!!t.animation,this.opts._scrollDistance_=this.scrollOption.currentOffset,un.call(this,this.opts.type,this.opts,this.config,this.context))}},gn.prototype.showToolTip=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null;(i=e.changedTouches?e.changedTouches[0]:e.mp.changedTouches[0])||console.log("[uCharts] 未获取到event坐标信息");var o=Ko(i,this.opts,e),a=this.scrollOption.currentOffset,n=Oo({},this.opts,{_scrollDistance_:a,animation:!1});if("line"===this.opts.type||"area"===this.opts.type||"column"===this.opts.type||"scatter"===this.opts.type||"bubble"===this.opts.type){var r=this.getCurrentDataIndex(e);if((u=null==t.index?r.index:t.index)>-1||u.length>0)if(0!==(l=Xo(this.opts.series,u,r.group)).length){var s=(d=Qo(l,this.opts,u,r.group,this.opts.categories,t)).textList;(c=d.offset).y=o.y,n.tooltip={textList:void 0!==t.textList?t.textList:s,offset:void 0!==t.offset?t.offset:c,option:t,index:u,group:r.group}}un.call(this,n.type,n,this.config,this.context)}if("mount"===this.opts.type){if((u=null==t.index?this.getCurrentDataIndex(e).index:t.index)>-1){n=Oo({},this.opts,{animation:!1});var l=Oo({},n._series_[u]),c=(s=[{text:t.formatter?t.formatter(l,void 0,u,n):l.name+": "+l.data,color:l.color,legendShape:"auto"==this.opts.extra.tooltip.legendShape?l.legendShape:this.opts.extra.tooltip.legendShape}],{x:n.chartData.calPoints[u].x,y:o.y});n.tooltip={textList:t.textList?t.textList:s,offset:void 0!==t.offset?t.offset:c,option:t,index:u}}un.call(this,n.type,n,this.config,this.context)}if("bar"===this.opts.type){r=this.getCurrentDataIndex(e);if((u=null==t.index?r.index:t.index)>-1||u.length>0)if(0!==(l=Xo(this.opts.series,u,r.group)).length){s=(d=Qo(l,this.opts,u,r.group,this.opts.categories,t)).textList;(c=d.offset).x=o.x,n.tooltip={textList:void 0!==t.textList?t.textList:s,offset:void 0!==t.offset?t.offset:c,option:t,index:u}}un.call(this,n.type,n,this.config,this.context)}if("mix"===this.opts.type){r=this.getCurrentDataIndex(e);if((u=null==t.index?r.index:t.index)>-1){a=this.scrollOption.currentOffset,n=Oo({},this.opts,{_scrollDistance_:a,animation:!1});if(0!==(l=Xo(this.opts.series,u)).length){var h=Zo(l,this.opts,u,this.opts.categories,t);s=h.textList;(c=h.offset).y=o.y,n.tooltip={textList:t.textList?t.textList:s,offset:void 0!==t.offset?t.offset:c,option:t,index:u}}}un.call(this,n.type,n,this.config,this.context)}if("candle"===this.opts.type){r=this.getCurrentDataIndex(e);if((u=null==t.index?r.index:t.index)>-1){a=this.scrollOption.currentOffset,n=Oo({},this.opts,{_scrollDistance_:a,animation:!1});if(0!==(l=Xo(this.opts.series,u)).length){var d;s=(d=ea(this.opts.series[0].data,l,this.opts,u,this.opts.categories,this.opts.extra.candle)).textList;(c=d.offset).y=o.y,n.tooltip={textList:t.textList?t.textList:s,offset:void 0!==t.offset?t.offset:c,option:t,index:u}}}un.call(this,n.type,n,this.config,this.context)}if("pie"===this.opts.type||"ring"===this.opts.type||"rose"===this.opts.type||"funnel"===this.opts.type){if((u=null==t.index?this.getCurrentDataIndex(e):t.index)>-1){n=Oo({},this.opts,{animation:!1}),l=Oo({},n._series_[u]),s=[{text:t.formatter?t.formatter(l,void 0,u,n):l.name+": "+l.data,color:l.color,legendShape:"auto"==this.opts.extra.tooltip.legendShape?l.legendShape:this.opts.extra.tooltip.legendShape}],c={x:o.x,y:o.y};n.tooltip={textList:t.textList?t.textList:s,offset:void 0!==t.offset?t.offset:c,option:t,index:u}}un.call(this,n.type,n,this.config,this.context)}if("map"===this.opts.type){if((u=null==t.index?this.getCurrentDataIndex(e):t.index)>-1){n=Oo({},this.opts,{animation:!1});(l=Oo({},this.opts.series[u])).name=l.properties.name;s=[{text:t.formatter?t.formatter(l,void 0,u,this.opts):l.name,color:l.color,legendShape:"auto"==this.opts.extra.tooltip.legendShape?l.legendShape:this.opts.extra.tooltip.legendShape}],c={x:o.x,y:o.y};n.tooltip={textList:t.textList?t.textList:s,offset:void 0!==t.offset?t.offset:c,option:t,index:u}}n.updateData=!1,un.call(this,n.type,n,this.config,this.context)}if("word"===this.opts.type){if((u=null==t.index?this.getCurrentDataIndex(e):t.index)>-1){n=Oo({},this.opts,{animation:!1}),l=Oo({},this.opts.series[u]),s=[{text:t.formatter?t.formatter(l,void 0,u,this.opts):l.name,color:l.color,legendShape:"auto"==this.opts.extra.tooltip.legendShape?l.legendShape:this.opts.extra.tooltip.legendShape}],c={x:o.x,y:o.y};n.tooltip={textList:t.textList?t.textList:s,offset:void 0!==t.offset?t.offset:c,option:t,index:u}}n.updateData=!1,un.call(this,n.type,n,this.config,this.context)}if("radar"===this.opts.type){var u;if((u=null==t.index?this.getCurrentDataIndex(e):t.index)>-1){n=Oo({},this.opts,{animation:!1});if(0!==(l=Xo(this.opts.series,u)).length){s=l.map((e=>({text:t.formatter?t.formatter(e,this.opts.categories[u],u,this.opts):e.name+": "+e.data,color:e.color,legendShape:"auto"==this.opts.extra.tooltip.legendShape?e.legendShape:this.opts.extra.tooltip.legendShape}))),c={x:o.x,y:o.y};n.tooltip={textList:t.textList?t.textList:s,offset:void 0!==t.offset?t.offset:c,option:t,index:u}}}un.call(this,n.type,n,this.config,this.context)}},gn.prototype.translate=function(e){this.scrollOption={currentOffset:e,startTouchX:e,distance:0,lastMoveTime:0};let t=Oo({},this.opts,{_scrollDistance_:e,animation:!1});un.call(this,this.opts.type,t,this.config,this.context)},gn.prototype.scrollStart=function(e){var t=null,i=Ko(t=e.changedTouches?e.changedTouches[0]:e.mp.changedTouches[0],this.opts,e);t&&!0===this.opts.enableScroll&&(this.scrollOption.startTouchX=i.x)},gn.prototype.scroll=function(e){0===this.scrollOption.lastMoveTime&&(this.scrollOption.lastMoveTime=Date.now());let t=this.opts.touchMoveLimit||60,i=Date.now();if(!(i-this.scrollOption.lastMoveTime{var i=new Date;i.setTime(1e3*e);var o=i.getFullYear(),a=i.getMonth()+1;a=a<10?"0"+a:a;var n=i.getDate();n=n<10?"0"+n:n;var r=i.getHours();r=r<10?"0"+r:r;var s=i.getMinutes(),l=i.getSeconds();return s=s<10?"0"+s:s,l=l<10?"0"+l:l,"full"==t?o+"-"+a+"-"+n+" "+r+":"+s+":"+l:"y-m-d"==t?o+"-"+a+"-"+n:"h:m"==t?r+":"+s:"h:m:s"==t?r+":"+s+":"+l:[o,a,n,r,s,l]})(e,"h:m")},seriesDemo1:function(e,t,i,o){return e+"元"},tooltipDemo1:function(e,t,i,o){return 0==i?"随便用"+e.data+"年":"其他我没改"+e.data+"天"},pieDemo:function(e,t,i,o){if(void 0!==t)return i[t].name+":"+i[t].data+"元"}},demotype:{type:"line",color:fn,padding:[15,10,0,15],xAxis:{disableGrid:!0},yAxis:{gridType:"dash",dashLength:2},legend:{},extra:{line:{type:"curve",width:2}}},pie:{type:"pie",color:fn,padding:[5,5,5,5],extra:{pie:{activeOpacity:.5,activeRadius:10,offsetAngle:0,labelWidth:15,border:!0,borderWidth:3,borderColor:"#FFFFFF"}}},ring:{type:"ring",color:fn,padding:[5,5,5,5],rotate:!1,dataLabel:!0,legend:{show:!0,position:"right",lineHeight:25},title:{name:"收益率",fontSize:15,color:"#666666"},subtitle:{name:"70%",fontSize:25,color:"#7cb5ec"},extra:{ring:{ringWidth:30,activeOpacity:.5,activeRadius:10,offsetAngle:0,labelWidth:15,border:!0,borderWidth:3,borderColor:"#FFFFFF"}}},rose:{type:"rose",color:fn,padding:[5,5,5,5],legend:{show:!0,position:"left",lineHeight:25},extra:{rose:{type:"area",minRadius:50,activeOpacity:.5,activeRadius:10,offsetAngle:0,labelWidth:15,border:!1,borderWidth:2,borderColor:"#FFFFFF"}}},word:{type:"word",color:fn,extra:{word:{type:"normal",autoColors:!1}}},funnel:{type:"funnel",color:fn,padding:[15,15,0,15],extra:{funnel:{activeOpacity:.3,activeWidth:10,border:!0,borderWidth:2,borderColor:"#FFFFFF",fillOpacity:1,labelAlign:"right"}}},map:{type:"map",color:fn,padding:[0,0,0,0],dataLabel:!0,extra:{map:{border:!0,borderWidth:1,borderColor:"#666666",fillOpacity:.6,activeBorderColor:"#F04864",activeFillColor:"#FACC14",activeFillOpacity:1}}},arcbar:{type:"arcbar",color:fn,title:{name:"百分比",fontSize:25,color:"#00FF00"},subtitle:{name:"默认标题",fontSize:15,color:"#666666"},extra:{arcbar:{type:"default",width:12,backgroundColor:"#E9E9E9",startAngle:.75,endAngle:.25,gap:2}}},line:{type:"line",color:fn,padding:[15,10,0,15],xAxis:{disableGrid:!0},yAxis:{gridType:"dash",dashLength:2},legend:{},extra:{line:{type:"straight",width:2,activeType:"hollow"}}},tline:{type:"line",color:fn,padding:[15,10,0,15],xAxis:{disableGrid:!1,boundaryGap:"justify"},yAxis:{gridType:"dash",dashLength:2,data:[{min:0,max:80}]},legend:{},extra:{line:{type:"curve",width:2,activeType:"hollow"}}},tarea:{type:"area",color:fn,padding:[15,10,0,15],xAxis:{disableGrid:!0,boundaryGap:"justify"},yAxis:{gridType:"dash",dashLength:2,data:[{min:0,max:80}]},legend:{},extra:{area:{type:"curve",opacity:.2,addLine:!0,width:2,gradient:!0,activeType:"hollow"}}},column:{type:"column",color:fn,padding:[15,15,0,5],xAxis:{disableGrid:!0},yAxis:{data:[{min:0}]},legend:{},extra:{column:{type:"group",width:30,activeBgColor:"#000000",activeBgOpacity:.08}}},mount:{type:"mount",color:fn,padding:[15,15,0,5],xAxis:{disableGrid:!0},yAxis:{data:[{min:0}]},legend:{},extra:{mount:{type:"mount",widthRatio:1.5}}},bar:{type:"bar",color:fn,padding:[15,30,0,5],xAxis:{boundaryGap:"justify",disableGrid:!1,min:0,axisLine:!1},yAxis:{},legend:{},extra:{bar:{type:"group",width:30,meterBorde:1,meterFillColor:"#FFFFFF",activeBgColor:"#000000",activeBgOpacity:.08}}},area:{type:"area",color:fn,padding:[15,15,0,15],xAxis:{disableGrid:!0},yAxis:{gridType:"dash",dashLength:2},legend:{},extra:{area:{type:"straight",opacity:.2,addLine:!0,width:2,gradient:!1,activeType:"hollow"}}},radar:{type:"radar",color:fn,padding:[5,5,5,5],dataLabel:!1,legend:{show:!0,position:"right",lineHeight:25},extra:{radar:{gridType:"radar",gridColor:"#CCCCCC",gridCount:3,opacity:.2,max:200,labelShow:!0}}},gauge:{type:"gauge",color:fn,title:{name:"66Km/H",fontSize:25,color:"#2fc25b",offsetY:50},subtitle:{name:"实时速度",fontSize:15,color:"#1890ff",offsetY:-50},extra:{gauge:{type:"default",width:30,labelColor:"#666666",startAngle:.75,endAngle:.25,startNumber:0,endNumber:100,labelFormat:"",splitLine:{fixRadius:0,splitNumber:10,width:30,color:"#FFFFFF",childNumber:5,childWidth:12},pointer:{width:24,color:"auto"}}}},candle:{type:"candle",color:fn,padding:[15,15,0,15],enableScroll:!0,enableMarkLine:!0,dataLabel:!1,xAxis:{labelCount:4,itemCount:40,disableGrid:!0,gridColor:"#CCCCCC",gridType:"solid",dashLength:4,scrollShow:!0,scrollAlign:"left",scrollColor:"#A6A6A6",scrollBackgroundColor:"#EFEBEF"},yAxis:{},legend:{},extra:{candle:{color:{upLine:"#f04864",upFill:"#f04864",downLine:"#2fc25b",downFill:"#2fc25b"},average:{show:!0,name:["MA5","MA10","MA30"],day:[5,10,20],color:["#1890ff","#2fc25b","#facc14"]}},markLine:{type:"dash",dashLength:5,data:[{value:2150,lineColor:"#f04864",showLabel:!0},{value:2350,lineColor:"#f04864",showLabel:!0}]}}},mix:{type:"mix",color:fn,padding:[15,15,0,15],xAxis:{disableGrid:!0},yAxis:{disabled:!1,disableGrid:!1,splitNumber:5,gridType:"dash",dashLength:4,gridColor:"#CCCCCC",padding:10,showTitle:!0,data:[]},legend:{},extra:{mix:{column:{width:20}}}},scatter:{type:"scatter",color:fn,padding:[15,15,0,15],dataLabel:!1,xAxis:{disableGrid:!1,gridType:"dash",splitNumber:5,boundaryGap:"justify",min:0},yAxis:{disableGrid:!1,gridType:"dash"},legend:{},extra:{scatter:{}}},bubble:{type:"bubble",color:fn,padding:[15,15,0,15],xAxis:{disableGrid:!1,gridType:"dash",splitNumber:5,boundaryGap:"justify",min:0,max:250},yAxis:{disableGrid:!1,gridType:"dash",data:[{min:0,max:150}]},legend:{},extra:{bubble:{border:2,opacity:.5}}}},yn=["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],mn={type:["pie","ring","rose","funnel","line","column","area","radar","gauge","candle","demotype"],categories:["line","column","area","radar","gauge","candle","demotype"],instance:{},option:{},formatter:{tooltipDemo1:function(e){let t="";for(let i in e){0==i&&(t+=e[i].axisValueLabel+"年销售额");let o="--";null!==e[i].data&&(o=e[i].data),t+="\n"+e[i].seriesName+":"+o+" 万元"}return t},legendFormat:function(e){return"自定义图例+"+e},yAxisFormatDemo:function(e,t){return e+"元"},seriesFormatDemo:function(e){return e.name+"年"+e.value+"元"}},demotype:{color:yn},column:{color:yn,title:{text:""},tooltip:{trigger:"axis"},grid:{top:30,bottom:50,right:15,left:40},legend:{bottom:"left"},toolbox:{show:!1},xAxis:{type:"category",axisLabel:{color:"#666666"},axisLine:{lineStyle:{color:"#CCCCCC"}},boundaryGap:!0,data:[]},yAxis:{type:"value",axisTick:{show:!1},axisLabel:{color:"#666666"},axisLine:{lineStyle:{color:"#CCCCCC"}}},seriesTemplate:{name:"",type:"bar",data:[],barwidth:20,label:{show:!0,color:"#666666",position:"top"}}},line:{color:yn,title:{text:""},tooltip:{trigger:"axis"},grid:{top:30,bottom:50,right:15,left:40},legend:{bottom:"left"},toolbox:{show:!1},xAxis:{type:"category",axisLabel:{color:"#666666"},axisLine:{lineStyle:{color:"#CCCCCC"}},boundaryGap:!0,data:[]},yAxis:{type:"value",axisTick:{show:!1},axisLabel:{color:"#666666"},axisLine:{lineStyle:{color:"#CCCCCC"}}},seriesTemplate:{name:"",type:"line",data:[],barwidth:20,label:{show:!0,color:"#666666",position:"top"}}},area:{color:yn,title:{text:""},tooltip:{trigger:"axis"},grid:{top:30,bottom:50,right:15,left:40},legend:{bottom:"left"},toolbox:{show:!1},xAxis:{type:"category",axisLabel:{color:"#666666"},axisLine:{lineStyle:{color:"#CCCCCC"}},boundaryGap:!0,data:[]},yAxis:{type:"value",axisTick:{show:!1},axisLabel:{color:"#666666"},axisLine:{lineStyle:{color:"#CCCCCC"}}},seriesTemplate:{name:"",type:"line",data:[],areaStyle:{},label:{show:!0,color:"#666666",position:"top"}}},pie:{color:yn,title:{text:""},tooltip:{trigger:"item"},grid:{top:40,bottom:30,right:15,left:15},legend:{bottom:"left"},seriesTemplate:{name:"",type:"pie",data:[],radius:"50%",label:{show:!0,color:"#666666",position:"top"}}},ring:{color:yn,title:{text:""},tooltip:{trigger:"item"},grid:{top:40,bottom:30,right:15,left:15},legend:{bottom:"left"},seriesTemplate:{name:"",type:"pie",data:[],radius:["40%","70%"],avoidLabelOverlap:!1,label:{show:!0,color:"#666666",position:"top"},labelLine:{show:!0}}},rose:{color:yn,title:{text:""},tooltip:{trigger:"item"},legend:{top:"bottom"},seriesTemplate:{name:"",type:"pie",data:[],radius:"55%",center:["50%","50%"],roseType:"area"}},funnel:{color:yn,title:{text:""},tooltip:{trigger:"item",formatter:"{b} : {c}%"},legend:{top:"bottom"},seriesTemplate:{name:"",type:"funnel",left:"10%",top:60,bottom:60,width:"80%",min:0,max:100,minSize:"0%",maxSize:"100%",sort:"descending",gap:2,label:{show:!0,position:"inside"},labelLine:{length:10,lineStyle:{width:1,type:"solid"}},itemStyle:{bordercolor:"#fff",borderwidth:1},emphasis:{label:{fontSize:20}},data:[]}},gauge:{color:yn,tooltip:{formatter:"{a}
{b} : {c}%"},seriesTemplate:{name:"业务指标",type:"gauge",detail:{formatter:"{value}%"},data:[{value:50,name:"完成率"}]}},candle:{xAxis:{data:[]},yAxis:{},color:yn,title:{text:""},dataZoom:[{type:"inside",xAxisIndex:[0,1],start:10,end:100},{show:!0,xAxisIndex:[0,1],type:"slider",bottom:10,start:10,end:100}],seriesTemplate:{name:"",type:"k",data:[]}}};var vn={},bn=null;function Sn(e={},...t){for(let i in t)for(let o in t[i])t[i].hasOwnProperty(o)&&(e[o]=t[i][o]&&"object"==typeof t[i][o]?Sn(Array.isArray(t[i][o])?[]:{},e[o],t[i][o]):t[i][o]);return e}function wn(e,t){for(let i in e)e.hasOwnProperty(i)&&null!==e[i]&&"object"==typeof e[i]?wn(e[i],t):"format"===i&&"string"==typeof e[i]&&(e.formatter=t[e[i]]?t[e[i]]:void 0);return e}const Tn={data:()=>({rid:null}),mounted(){bn={top:0,left:0};let e=document.querySelectorAll("uni-main")[0];void 0===e&&(e=document.querySelectorAll("uni-page-wrapper")[0]),bn={top:e.offsetTop,left:e.offsetLeft},setTimeout((()=>{null===this.rid&&this.$ownerInstance&&this.$ownerInstance.callMethod("getRenderType")}),200)},destroyed(){delete xn.option[this.rid],delete xn.instance[this.rid],delete mn.option[this.rid],delete mn.instance[this.rid]},methods:{ecinit(e,t,i,o){let a=JSON.stringify(e.id);this.rid=a,vn[a]=this.$ownerInstance||o;let n=JSON.parse(JSON.stringify(e)),r=n.type;r&&mn.type.includes(r)?mn.option[a]=Sn({},mn[r],n):mn.option[a]=Sn({},n);let s=n.chartData;if(s){mn.option[a].xAxis&&mn.option[a].xAxis.type&&"category"===mn.option[a].xAxis.type&&(mn.option[a].xAxis.data=s.categories),mn.option[a].yAxis&&mn.option[a].yAxis.type&&"category"===mn.option[a].yAxis.type&&(mn.option[a].yAxis.data=s.categories),mn.option[a].series=[];for(var l=0;l{let i=JSON.parse(JSON.stringify({x:t.event.offsetX,y:t.event.offsetY}));vn[e].callMethod("emitMsg",{name:"getIndex",params:{type:"getIndex",event:i,currentIndex:t.dataIndex,value:t.data,seriesName:t.seriesName,id:e}})})),mn.instance[e].on("highlight",(t=>{vn[e].callMethod("emitMsg",{name:"getHighlight",params:{type:"highlight",res:t,id:e}})}))),this.updataEChart(e,mn.option[e])):this.updataEChart(e,mn.option[e])},updataEChart(e,t){if((t=wn(t,mn.formatter)).tooltip&&(t.tooltip.show=!!t.tooltipShow,t.tooltip.position=this.tooltipPosition(),"string"==typeof t.tooltipFormat&&mn.formatter[t.tooltipFormat]&&(t.tooltip.formatter=t.tooltip.formatter?t.tooltip.formatter:mn.formatter[t.tooltipFormat])),t.series)for(let i in t.series){let e=t.series[i].linearGradient;e&&(t.series[i].color=new echarts.graphic.LinearGradient(e[0],e[1],e[2],e[3],e[4]))}mn.instance[e].setOption(t,t.notMerge),mn.instance[e].on("finished",(function(){vn[e].callMethod("emitMsg",{name:"complete",params:{type:"complete",complete:!0,id:e}}),mn.instance[e]&&mn.instance[e].off("finished")})),void 0!==vn[e].$el.children[0].clientWidth&&(Math.abs(vn[e].$el.children[0].clientWidth-mn.instance[e].getWidth())>3||Math.abs(vn[e].$el.children[0].clientHeight-mn.instance[e].getHeight())>3)&&this.ecresize()},tooltipPosition:()=>(e,t,i,o,a)=>{let n=e[0],r=e[1],s=a.viewSize[0],l=a.viewSize[1],c=a.contentSize[0],h=a.contentSize[1],d=n+30,u=r+30;return d+c>s&&(d=n-c-30),u+h>l&&(u=r-h-30),[d,u]},ucinit(e,t,i,o){if(JSON.stringify(e)==JSON.stringify(t))return;if(!e.canvasId)return;let a=JSON.parse(JSON.stringify(e.canvasId));this.rid=a,vn[a]=this.$ownerInstance||o,xn.option[a]=JSON.parse(JSON.stringify(e)),xn.option[a]=wn(xn.option[a],xn.formatter);let n=document.getElementById(a);n&&n.children[0]&&(xn.option[a].context=n.children[0].getContext("2d"),xn.instance[a]&&xn.option[a]&&!0===xn.option[a].update?this.updataUChart():setTimeout((()=>{xn.option[a].context.restore(),xn.option[a].context.save(),this.newUChart()}),100))},newUChart(){let e=this.rid;xn.instance[e]=new gn(xn.option[e]),xn.instance[e].addEventListener("renderComplete",(()=>{vn[e].callMethod("emitMsg",{name:"complete",params:{type:"complete",complete:!0,id:e,opts:xn.instance[e].opts}}),xn.instance[e].delEventListener("renderComplete")})),xn.instance[e].addEventListener("scrollLeft",(()=>{vn[e].callMethod("emitMsg",{name:"scrollLeft",params:{type:"scrollLeft",scrollLeft:!0,id:e,opts:xn.instance[e].opts}})})),xn.instance[e].addEventListener("scrollRight",(()=>{vn[e].callMethod("emitMsg",{name:"scrollRight",params:{type:"scrollRight",scrollRight:!0,id:e,opts:xn.instance[e].opts}})}))},updataUChart(){let e=this.rid;xn.instance[e].updateData(xn.option[e])},tooltipDefault(e,t,i,o){if(t){let i=e.data;return"object"==typeof e.data&&(i=e.data.value),t+" "+e.name+":"+i}return e.properties&&e.properties.name?e.properties.name:e.name+":"+e.data},showTooltip(e,t){let i=xn.option[t].tooltipCustom;if(i&&null!=i){let o;i.x>=0&&i.y>=0&&(o={x:i.x,y:i.y+10}),xn.instance[t].showToolTip(e,{index:i.index,offset:o,textList:i.textList,formatter:(e,i,o,a)=>"string"==typeof xn.option[t].tooltipFormat&&xn.formatter[xn.option[t].tooltipFormat]?xn.formatter[xn.option[t].tooltipFormat](e,i,o,a):this.tooltipDefault(e,i,o,a)})}else xn.instance[t].showToolTip(e,{formatter:(e,i,o,a)=>"string"==typeof xn.option[t].tooltipFormat&&xn.formatter[xn.option[t].tooltipFormat]?xn.formatter[xn.option[t].tooltipFormat](e,i,o,a):this.tooltipDefault(e,i,o,a)})},tap(e){let t=this.rid,i=xn.option[t].ontap,o=xn.option[t].tooltipShow,a=xn.option[t].tapLegend;if(0==i)return;let n=null,r=null,s=document.getElementById("UC"+t).getBoundingClientRect(),l={};l=e.detail.x?{x:e.detail.x-s.left,y:e.detail.y-s.top+bn.top}:{x:e.clientX-s.left,y:e.clientY-s.top+bn.top},e.changedTouches=[],e.changedTouches.unshift(l),n=xn.instance[t].getCurrentDataIndex(e),r=xn.instance[t].getLegendDataIndex(e),!0===a&&xn.instance[t].touchLegend(e),1==o&&this.showTooltip(e,t),vn[t].callMethod("emitMsg",{name:"getIndex",params:{type:"getIndex",event:l,currentIndex:n,legendIndex:r,id:t,opts:xn.instance[t].opts}})},touchStart(e){let t=this.rid;0!=xn.option[t].ontouch&&(!0===xn.option[t].enableScroll&&1==e.touches.length&&xn.instance[t].scrollStart(e),vn[t].callMethod("emitMsg",{name:"getTouchStart",params:{type:"touchStart",event:e.changedTouches[0],id:t,opts:xn.instance[t].opts}}))},touchMove(e){let t=this.rid,i=xn.option[t].ontouch;if(0!=i){if(!0===xn.option[t].enableScroll&&1==e.changedTouches.length&&xn.instance[t].scroll(e),!0===xn.option[t].ontap&&!1===xn.option[t].enableScroll&&!0===xn.option[t].onmovetip){let i=document.getElementById("UC"+t).getBoundingClientRect(),o={x:e.changedTouches[0].clientX-i.left,y:e.changedTouches[0].clientY-i.top+bn.top};e.changedTouches.unshift(o),!0===xn.option[t].tooltipShow&&this.showTooltip(e,t)}!0===i&&!0===xn.option[t].enableScroll&&!0===xn.option[t].onzoom&&2==e.changedTouches.length&&xn.instance[t].dobuleZoom(e),vn[t].callMethod("emitMsg",{name:"getTouchMove",params:{type:"touchMove",event:e.changedTouches[0],id:t,opts:xn.instance[t].opts}})}},touchEnd(e){let t=this.rid;0!=xn.option[t].ontouch&&(!0===xn.option[t].enableScroll&&0==e.touches.length&&xn.instance[t].scrollEnd(e),vn[t].callMethod("emitMsg",{name:"getTouchEnd",params:{type:"touchEnd",event:e.changedTouches[0],id:t,opts:xn.instance[t].opts}}))},mouseDown(e){let t=this.rid;if(0==xn.option[t].onmouse)return;let i=document.getElementById("UC"+t).getBoundingClientRect(),o={};o={x:e.clientX-i.left,y:e.clientY-i.top+bn.top},e.changedTouches=[],e.changedTouches.unshift(o),xn.instance[t].scrollStart(e),xn.option[t].mousedown=!0,vn[t].callMethod("emitMsg",{name:"getTouchStart",params:{type:"mouseDown",event:o,id:t,opts:xn.instance[t].opts}})},mouseMove(e){let t=this.rid,i=xn.option[t].onmouse,o=xn.option[t].tooltipShow;if(0==i)return;let a=document.getElementById("UC"+t).getBoundingClientRect(),n={};n={x:e.clientX-a.left,y:e.clientY-a.top+bn.top},e.changedTouches=[],e.changedTouches.unshift(n),xn.option[t].mousedown?(xn.instance[t].scroll(e),vn[t].callMethod("emitMsg",{name:"getTouchMove",params:{type:"mouseMove",event:n,id:t,opts:xn.instance[t].opts}})):xn.instance[t]&&1==o&&this.showTooltip(e,t)},mouseUp(e){let t=this.rid;if(0==xn.option[t].onmouse)return;let i=document.getElementById("UC"+t).getBoundingClientRect(),o={};o={x:e.clientX-i.left,y:e.clientY-i.top+bn.top},e.changedTouches=[],e.changedTouches.unshift(o),xn.instance[t].scrollEnd(e),xn.option[t].mousedown=!1,vn[t].callMethod("emitMsg",{name:"getTouchEnd",params:{type:"mouseUp",event:o,id:t,opts:xn.instance[t].opts}})}}},An=e=>{e.$renderjs||(e.$renderjs=[]),e.$renderjs.push("rdcharts"),e.mixins||(e.mixins=[]),e.mixins.push({beforeCreate(){this.rdcharts=this},mounted(){this.$ownerInstance=this.$gcd(this,!0)}}),e.mixins.push(Tn)};function _n(e={},...t){for(let i in t)for(let o in t[i])t[i].hasOwnProperty(o)&&(e[o]=t[i][o]&&"object"==typeof t[i][o]?_n(Array.isArray(t[i][o])?[]:{},e[o],t[i][o]):t[i][o]);return e}function Pn(e,t){for(let i in e)e.hasOwnProperty(i)&&null!==e[i]&&"object"==typeof e[i]?Pn(e[i],t):"format"===i&&"string"==typeof e[i]&&(e.formatter=t[e[i]]?t[e[i]]:void 0);return e}const Cn={name:"qiun-data-charts",mixins:[Lo.mixinDatacom],props:{type:{type:String,default:null},canvasId:{type:String,default:"uchartsid"},canvas2d:{type:Boolean,default:!1},background:{type:String,default:"rgba(0,0,0,0)"},animation:{type:Boolean,default:!0},chartData:{type:Object,default:()=>({categories:[],series:[]})},opts:{type:Object,default:()=>({})},eopts:{type:Object,default:()=>({})},loadingType:{type:Number,default:2},errorShow:{type:Boolean,default:!0},errorReload:{type:Boolean,default:!0},errorMessage:{type:String,default:null},inScrollView:{type:Boolean,default:!1},reshow:{type:Boolean,default:!1},reload:{type:Boolean,default:!1},disableScroll:{type:Boolean,default:!1},optsWatch:{type:Boolean,default:!0},onzoom:{type:Boolean,default:!1},ontap:{type:Boolean,default:!0},ontouch:{type:Boolean,default:!1},onmouse:{type:Boolean,default:!0},onmovetip:{type:Boolean,default:!1},echartsH5:{type:Boolean,default:!1},echartsApp:{type:Boolean,default:!1},tooltipShow:{type:Boolean,default:!0},tooltipFormat:{type:String,default:void 0},tooltipCustom:{type:Object,default:void 0},startDate:{type:String,default:void 0},endDate:{type:String,default:void 0},textEnum:{type:Array,default:()=>[]},groupEnum:{type:Array,default:()=>[]},pageScrollTop:{type:Number,default:0},directory:{type:String,default:"/"},tapLegend:{type:Boolean,default:!0},menus:{type:Array,default:()=>[]}},data:()=>({cid:"uchartsid",inWx:!1,inAli:!1,inTt:!1,inBd:!1,inH5:!1,inApp:!1,inWin:!1,type2d:!0,disScroll:!1,openmouse:!1,pixel:1,cWidth:375,cHeight:250,showchart:!1,echarts:!1,echartsResize:{state:!1},uchartsOpts:{},echartsOpts:{},drawData:{},lastDrawTime:null}),created(){if(this.cid=this.canvasId,"uchartsid"==this.canvasId||""==this.canvasId){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",t=e.length,i="";for(let o=0;o<32;o++)i+=e.charAt(Math.floor(Math.random()*t));this.cid=i}const e=m();"windows"!==e.platform&&"mac"!==e.platform||(this.inWin=!0),this.type2d=!1,this.disScroll=this.disableScroll},mounted(){this.inH5=!0,!0===this.inWin&&(this.openmouse=this.onmouse),!0===this.echartsH5&&(this.echarts=!0),this.$nextTick((()=>{this.beforeInit()}));const e=this.inH5?500:200,t=this;R(function(e,t){let i=!1;return function(){clearTimeout(i),i&&clearTimeout(i),i=setTimeout((()=>{i=!1,e.apply(this,arguments)}),t)}}((function(e){if(1==t.mixinDatacomLoading)return;let i=t.mixinDatacomErrorMessage;null!==i&&"null"!==i&&""!==i||(t.echarts?t.echartsResize.state=!t.echartsResize.state:t.resizeHandler())}),e))},destroyed(){!0===this.echarts?(delete mn.option[this.cid],delete mn.instance[this.cid]):(delete xn.option[this.cid],delete xn.instance[this.cid]),N((()=>{}))},watch:{chartDataProps:{handler(e,t){"object"==typeof e?JSON.stringify(e)!==JSON.stringify(t)&&(this._clearChart(),e.series&&e.series.length>0?this.beforeInit():(this.mixinDatacomLoading=!0,this.showchart=!1,this.mixinDatacomErrorMessage=null)):(this.mixinDatacomLoading=!1,this._clearChart(),this.showchart=!1,this.mixinDatacomErrorMessage="参数错误:chartData数据类型错误")},immediate:!1,deep:!0},localdata:{handler(e,t){JSON.stringify(e)!==JSON.stringify(t)&&(e.length>0?this.beforeInit():(this.mixinDatacomLoading=!0,this._clearChart(),this.showchart=!1,this.mixinDatacomErrorMessage=null))},immediate:!1,deep:!0},optsProps:{handler(e,t){"object"==typeof e?JSON.stringify(e)!==JSON.stringify(t)&&!1===this.echarts&&1==this.optsWatch&&this.checkData(this.drawData):(this.mixinDatacomLoading=!1,this._clearChart(),this.showchart=!1,this.mixinDatacomErrorMessage="参数错误:opts数据类型错误")},immediate:!1,deep:!0},eoptsProps:{handler(e,t){"object"==typeof e?JSON.stringify(e)!==JSON.stringify(t)&&!0===this.echarts&&this.checkData(this.drawData):(this.mixinDatacomLoading=!1,this.showchart=!1,this.mixinDatacomErrorMessage="参数错误:eopts数据类型错误")},immediate:!1,deep:!0},reshow(e,t){!0===e&&!1===this.mixinDatacomLoading&&setTimeout((()=>{this.mixinDatacomErrorMessage=null,this.echartsResize.state=!this.echartsResize.state,this.checkData(this.drawData)}),200)},reload(e,t){!0===e&&(this.showchart=!1,this.mixinDatacomErrorMessage=null,this.reloading())},mixinDatacomErrorMessage(e,t){e&&(this.emitMsg({name:"error",params:{type:"error",errorShow:this.errorShow,msg:e,id:this.cid}}),this.errorShow&&console.log("[秋云图表组件]"+e))},errorMessage(e,t){e&&this.errorShow&&null!==e&&"null"!==e&&""!==e?(this.showchart=!1,this.mixinDatacomLoading=!1,this.mixinDatacomErrorMessage=e):(this.showchart=!1,this.mixinDatacomErrorMessage=null,this.reloading())}},computed:{optsProps(){return JSON.parse(JSON.stringify(this.opts))},eoptsProps(){return JSON.parse(JSON.stringify(this.eopts))},chartDataProps(){return JSON.parse(JSON.stringify(this.chartData))}},methods:{beforeInit(){this.mixinDatacomErrorMessage=null,"object"==typeof this.chartData&&null!=this.chartData&&void 0!==this.chartData.series&&this.chartData.series.length>0?(this.drawData=_n({},this.chartData),this.mixinDatacomLoading=!1,this.showchart=!0,this.checkData(this.chartData)):this.localdata.length>0?(this.mixinDatacomLoading=!1,this.showchart=!0,this.localdataInit(this.localdata)):""!==this.collection?(this.mixinDatacomLoading=!1,this.getCloudData()):this.mixinDatacomLoading=!0},localdataInit(e){if(this.groupEnum.length>0)for(let h=0;h0)for(let h=0;h0)o=this.chartData.categories;else if(this.startDate&&this.endDate){let e=new Date(this.startDate),t=new Date(this.endDate);for(;e<=t;)o.push((r=void 0,s=void 0,l=void 0,r=(n=e).getFullYear(),s=n.getMonth()+1,l=n.getDate(),s>=1&&s<=9&&(s="0"+s),l>=0&&l<=9&&(l="0"+l),r+"-"+s+"-"+l)),e=e.setDate(e.getDate()+1),e=new Date(e)}else{let t={};e.map((function(e,i){null==e.text||t[e.text]||(o.push(e.text),t[e.text]=!0)}))}i.categories=o}var n,r,s,l;let c={};if(e.map((function(e,t){null==e.group||c[e.group]||(a.push({name:e.group,data:[]}),c[e.group]=!0)})),0==a.length)if(a=[{name:"默认分组",data:[]}],!0===t)for(let h=0;h0)for(let t=0;t0&&(this.mixinDatacomErrorMessage=null,!0===this.echarts?(mn.option[t].chartData=i,this.$nextTick((()=>{this.init()}))):(xn.option[t].categories=i.categories,xn.option[t].series=i.series,this.$nextTick((()=>{this.init()}))))},resizeHandler(){let e=Date.now();e-(this.lastDrawTime?this.lastDrawTime:e-3e3)<1e3||z().in(this).select("#ChartBoxId"+this.cid).boundingClientRect((e=>{this.showchart=!0,e.width>0&&e.height>0&&(e.width===this.cWidth&&e.height===this.cHeight||this.checkData(this.drawData))})).exec()},getCloudData(){1!=this.mixinDatacomLoading&&(this.mixinDatacomLoading=!0,this.mixinDatacomGet().then((e=>{this.mixinDatacomResData=e.result.data,this.localdataInit(this.mixinDatacomResData)})).catch((e=>{this.mixinDatacomLoading=!1,this.showchart=!1,this.mixinDatacomErrorMessage="请求错误:"+e})))},onMixinDatacomPropsChange(e,t){1==e&&""!==this.collection&&(this.showchart=!1,this.mixinDatacomErrorMessage=null,this._clearChart(),this.getCloudData())},_clearChart(){let e=this.cid;if(!0!==this.echarts&&xn.option[e]&&xn.option[e].context){const t=xn.option[e].context;"object"!=typeof t||xn.option[e].update||(t.clearRect(0,0,this.cWidth*this.pixel,this.cHeight*this.pixel),t.draw())}},init(){let e=this.cid;z().in(this).select("#ChartBoxId"+e).boundingClientRect((t=>{t.width>0&&t.height>0?(this.mixinDatacomLoading=!1,this.showchart=!0,this.lastDrawTime=Date.now(),this.cWidth=t.width,this.cHeight=t.height,!0!==this.echarts&&(xn.option[e].background="rgba(0,0,0,0)"==this.background?"#FFFFFF":this.background,xn.option[e].canvas2d=this.type2d,xn.option[e].pixelRatio=this.pixel,xn.option[e].animation=this.animation,xn.option[e].width=t.width*this.pixel,xn.option[e].height=t.height*this.pixel,xn.option[e].onzoom=this.onzoom,xn.option[e].ontap=this.ontap,xn.option[e].ontouch=this.ontouch,xn.option[e].onmouse=this.openmouse,xn.option[e].onmovetip=this.onmovetip,xn.option[e].tooltipShow=this.tooltipShow,xn.option[e].tooltipFormat=this.tooltipFormat,xn.option[e].tooltipCustom=this.tooltipCustom,xn.option[e].inScrollView=this.inScrollView,xn.option[e].lastDrawTime=this.lastDrawTime,xn.option[e].tapLegend=this.tapLegend),this.inH5||this.inApp?1==this.echarts?(mn.option[e].ontap=this.ontap,mn.option[e].onmouse=this.openmouse,mn.option[e].tooltipShow=this.tooltipShow,mn.option[e].tooltipFormat=this.tooltipFormat,mn.option[e].tooltipCustom=this.tooltipCustom,mn.option[e].lastDrawTime=this.lastDrawTime,this.echartsOpts=_n({},mn.option[e])):(xn.option[e].rotateLock=xn.option[e].rotate,this.uchartsOpts=_n({},xn.option[e])):(xn.option[e]=Pn(xn.option[e],xn.formatter),this.mixinDatacomErrorMessage=null,this.mixinDatacomLoading=!1,this.showchart=!0,this.$nextTick((()=>{if(!0===this.type2d){z().in(this).select("#"+e).fields({node:!0,size:!0}).exec((i=>{if(i[0]){const o=i[0].node,a=o.getContext("2d");xn.option[e].context=a,xn.option[e].rotateLock=xn.option[e].rotate,xn.instance[e]&&xn.option[e]&&!0===xn.option[e].update?this._updataUChart(e):(o.width=t.width*this.pixel,o.height=t.height*this.pixel,o._width=t.width*this.pixel,o._height=t.height*this.pixel,setTimeout((()=>{xn.option[e].context.restore(),xn.option[e].context.save(),this._newChart(e)}),100))}else this.showchart=!1,this.mixinDatacomErrorMessage="参数错误:开启2d模式后,未获取到dom节点,canvas-id:"+e}))}else this.inAli&&(xn.option[e].rotateLock=xn.option[e].rotate),xn.option[e].context=B(e,this),xn.instance[e]&&xn.option[e]&&!0===xn.option[e].update?this._updataUChart(e):setTimeout((()=>{xn.option[e].context.restore(),xn.option[e].context.save(),this._newChart(e)}),100)})))):(this.mixinDatacomLoading=!1,this.showchart=!1,1==this.reshow&&(this.mixinDatacomErrorMessage="布局错误:未获取到父元素宽高尺寸!canvas-id:"+e))})).exec()},saveImage(){U({canvasId:this.cid,success:e=>{var t=document.createElement("a");t.href=e.tempFilePath,t.download=this.cid,t.target="_blank",t.click()}},this)},getImage(){if(0==this.type2d)U({canvasId:this.cid,success:e=>{this.emitMsg({name:"getImage",params:{type:"getImage",base64:e.tempFilePath}})}},this);else{z().in(this).select("#"+this.cid).fields({node:!0,size:!0}).exec((e=>{if(e[0]){const t=e[0].node;this.emitMsg({name:"getImage",params:{type:"getImage",base64:t.toDataURL("image/png")}})}}))}},_error(e){this.mixinDatacomErrorMessage=e.detail.errMsg},emitMsg(e){this.$emit(e.name,e.params)},getRenderType(){!0===this.echarts&&!1===this.mixinDatacomLoading&&this.beforeInit()},toJSON(){return this}}};An(Cn);const kn=G(Cn,[["render",function(e,t,i,o,a,n){const r=J(W("qiun-loading"),Io),s=I,l=J(W("qiun-error"),Mo),c=H;return C(),k(s,{class:"chartsview",id:"ChartBoxId"+a.cid},{default:D((()=>[e.mixinDatacomLoading?(C(),k(s,{key:0},{default:D((()=>[L(r,{loadingType:i.loadingType},null,8,["loadingType"])])),_:1})):F("",!0),e.mixinDatacomErrorMessage&&i.errorShow?(C(),k(s,{key:1,onClick:n.reloading},{default:D((()=>[L(l,{errorMessage:i.errorMessage},null,8,["errorMessage"])])),_:1},8,["onClick"])):F("",!0),a.echarts?j((C(),k(s,{key:2,style:q([{background:i.background},{width:"100%",height:"100%"}]),"data-directory":i.directory,id:"EC"+a.cid,prop:a.echartsOpts,"change:prop":e.rdcharts.ecinit,resize:a.echartsResize,"change:resize":e.rdcharts.ecresize},null,8,["style","data-directory","id","prop","change:prop","resize","change:resize"])),[[$,a.showchart]]):(C(),k(s,{key:3,onClick:e.rdcharts.tap,onMousemove:e.rdcharts.mouseMove,onMousedown:e.rdcharts.mouseDown,onMouseup:e.rdcharts.mouseUp,onTouchstart:e.rdcharts.touchStart,onTouchmove:e.rdcharts.touchMove,onTouchend:e.rdcharts.touchEnd,id:"UC"+a.cid,prop:a.uchartsOpts,"change:prop":e.rdcharts.ucinit},{default:D((()=>[j(L(c,{id:a.cid,canvasId:a.cid,style:q({width:a.cWidth+"px",height:a.cHeight+"px",background:i.background}),"disable-scroll":i.disableScroll,onError:n._error},null,8,["id","canvasId","style","disable-scroll","onError"]),[[$,a.showchart]])])),_:1},8,["onClick","onMousemove","onMousedown","onMouseup","onTouchstart","onTouchmove","onTouchend","id","prop","change:prop"]))])),_:1},8,["id"])}],["__scopeId","data-v-d3533eac"]]);export{kn as _};