var f7=Object.defineProperty,d7=Object.defineProperties;var p7=Object.getOwnPropertyDescriptors;var Hg=Object.getOwnPropertySymbols;var aL=Object.prototype.hasOwnProperty,oL=Object.prototype.propertyIsEnumerable;var ux=(r,e)=>{if(e=Symbol[r])return e;throw Error("Symbol."+r+" is not defined")},cu=Math.pow,cx=(r,e,t)=>e in r?f7(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Re=(r,e)=>{for(var t in e||(e={}))aL.call(e,t)&&cx(r,t,e[t]);if(Hg)for(var t of Hg(e))oL.call(e,t)&&cx(r,t,e[t]);return r},Xe=(r,e)=>d7(r,p7(e));var sL=(r,e)=>{var t={};for(var n in r)aL.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&Hg)for(var n of Hg(r))e.indexOf(n)<0&&oL.call(r,n)&&(t[n]=r[n]);return t};var bt=(r,e,t)=>(cx(r,typeof e!="symbol"?e+"":e,t),t);var Ge=(r,e,t)=>new Promise((n,i)=>{var a=l=>{try{s(t.next(l))}catch(u){i(u)}},o=l=>{try{s(t.throw(l))}catch(u){i(u)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(a,o);s((t=t.apply(r,e)).next())}),v7=function(r,e){this[0]=r,this[1]=e};var lL=r=>{var e=r[ux("asyncIterator")],t=!1,n,i={};return e==null?(e=r[ux("iterator")](),n=a=>i[a]=o=>e[a](o)):(e=e.call(r),n=a=>i[a]=o=>{if(t){if(t=!1,a==="throw")throw o;return o}return t=!0,{done:!1,value:new v7(new Promise(s=>{var l=e[a](o);if(!(l instanceof Object))throw TypeError("Object expected");s(l)}),1)}}),i[ux("iterator")]=()=>i,n("next"),"throw"in e?n("throw"):i.throw=a=>{throw a},"return"in e&&n("return"),i};import{_ as OM,o as ie,c as oe,a as G,t as Te,r as Df,b as $e,d as tt,w as ni,p as uL,i as sf,n as Vt,u as _n,e as Se,f as uo,g as Tt,h as Ko,j as QB,k as fc,l as un,s as Ap,F as it,m as vt,q as Ji,v as Zn,x as Xt,y as ul,z as JB,A as Kw,B as Nc,C as no,D as g7,E as cL,G as hL,H as m7,I as y7,J as _7,K as x7,L as ih}from"./index-1782613078975.js";const _0=""+new URL("bottom-menu-arrow-big-180b7071-balabala-1782613078975.svg",import.meta.url).href,x0=""+new URL("bottom-menu-arrow-small-19304179-balabala-1782613078975.svg",import.meta.url).href;/** * @name: autofit.js * @author: Larry Zhu * @version: 3.2.8 * @description: autofit.js 是迄今为止最易用的自适应工具 * @license: MIT */let hx=null,vv="",Zw="",Qw="",fx=null,fL=null,Dr=1,yf=!1;const Y_={isAutofitRunning:!1,init(r={},e=!0){e&&console.log("autofit.js is running");const{dw:t=1920,dh:n=1080,el:i=typeof r=="string"?r:"body",resize:a=!0,ignore:o=[],transition:s="none",delay:l=0,limit:u=.1,cssMode:c="scale",allowScroll:h=!1}=r;hx=i;const f=document.querySelector(i);if(!f){console.error(`autofit: '${i}' is not exist`);return}const d=document.createElement("style"),p=document.createElement("style");d.lang="text/css",p.lang="text/css",d.id="autofit-style",p.id="ignoreStyle",!h&&(d.innerHTML="body {overflow: hidden;}");const g=document.querySelector("body");g.appendChild(d),g.appendChild(p),f.style.height=`${n}px`,f.style.width=`${t}px`,f.style.transformOrigin="0 0",!h&&(f.style.overflow="hidden"),dx(t,n,f,o,u,c),fx=()=>{clearTimeout(fL),l!=0?fL=setTimeout(()=>{dx(t,n,f,o,u,c),yf&&Jw(vv,Qw,Zw)},l):(dx(t,n,f,o,u,c),yf&&Jw(vv,Qw,Zw))},a&&window.addEventListener("resize",fx),this.isAutofitRunning=!0,setTimeout(()=>{f.style.transition=`${s}s`})},off(r="body"){try{window.removeEventListener("resize",fx);const e=document.querySelector("#autofit-style");e&&e.remove();const t=document.querySelector("#ignoreStyle");t&&t.remove();const n=document.querySelector(hx||r);n&&(n.style.cssText=""),yf&&e5()}catch(e){console.error("autofit: Failed to remove normally",e)}this.isAutofitRunning=!1,console.log("autofit.js is off")},elRectification:null,scale:Dr};function Jw(r,e=!0,t=1){if(!Y_.isAutofitRunning){console.error("autofit.js:(elRectification): autofit has not been initialized yet");return}e5(),!r&&console.error(`autofit.js:elRectification bad selector: ${r}`),vv=r,Zw=t,Qw=e;const n=Array.from(document.querySelectorAll(r));if(n.length==0){console.error(`autofit.js:elRectification found no element by selector: "${r}"`);return}for(const i of n){const a=Dr==1?1:Number(Dr)*Number(t);yf||(i.originalWidth=i.clientWidth,i.originalHeight=i.clientHeight),e?(i.style.width=`${i.originalWidth*a}px`,i.style.height=`${i.originalHeight*a}px`):(i.style.width=`${100*a}%`,i.style.height=`${100*a}%`),i.style.transform=`translateZ(0) scale(${1/Number(Dr)})`,i.style.transformOrigin="0 0"}yf=!0}function e5(){if(vv){yf=!1;for(const r of Array.from(document.querySelectorAll(vv)))r.style.width="",r.style.height="",r.style.transform=""}}function dx(r,e,t,n,i,a="scale"){const o=document.documentElement.clientHeight,s=document.documentElement.clientWidth;Dr=s/oi?Dr:1,Y_.scale=+Dr;const l=Math.round(o/Number(Dr)),u=Math.round(s/Number(Dr));t.style.height=`${l}px`,t.style.width=`${u}px`,a==="zoom"?t.style.zoom=`${Dr}`:t.style.transform=`translateZ(0) scale(${Dr})`;const c=document.querySelector("#ignoreStyle");c.innerHTML="";for(const h of n){const f=h;let d=f.el||f.dom;if(typeof f=="string"&&(d=f),!d||typeof d=="object"&&!Object.keys(d).length){console.error(`autofit: found invalid or empty selector/object: ${d}`);continue}const p=f.scale?f.scale:1/Number(Dr),g=p!=Dr&&f.fontSize,v=p!=Dr&&f.width,m=p!=Dr&&f.height;c.innerHTML+=` ${d} { transform: scale(${p})!important; transform-origin: 0 0; ${v?`width: ${v}!important;`:""} ${m?`height: ${m}!important;`:""} }`,g&&(c.innerHTML+=` ${d} div ,${d} span,${d} a,${d} * { font-size: ${g}px; }`)}}Y_.elRectification=Jw;function fs(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function t5(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e}/*! * GSAP 3.14.2 * https://gsap.com * * @license Copyright 2008-2025, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license * @author: Jack Doyle, jack@greensock.com */var ea={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},If={duration:.5,overwrite:!1,delay:0},FM,kr,In,Ea=1e8,An=1/Ea,eb=Math.PI*2,S7=eb/4,A7=0,n5=Math.sqrt,w7=Math.cos,b7=Math.sin,Er=function(e){return typeof e=="string"},Xn=function(e){return typeof e=="function"},Ms=function(e){return typeof e=="number"},BM=function(e){return typeof e=="undefined"},Wo=function(e){return typeof e=="object"},Ei=function(e){return e!==!1},zM=function(){return typeof window!="undefined"},Wg=function(e){return Xn(e)||Er(e)},r5=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},ri=Array.isArray,T7=/random\([^)]+\)/g,M7=/,\s*/g,dL=/(?:-?\.?\d|\.)+/gi,i5=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,lf=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,px=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,a5=/[+-]=-?[.\d]+/,C7=/[^,'"\[\]\s]+/gi,E7=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Bn,To,tb,UM,ia={},S0={},o5,s5=function(e){return(S0=Nf(e,ia))&&ki},VM=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},gv=function(e,t){return!t&&console.warn(e)},l5=function(e,t){return e&&(ia[e]=t)&&S0&&(S0[e]=t)||ia},mv=function(){return 0},L7={suppressEvents:!0,isStart:!0,kill:!1},Gy={suppressEvents:!0,kill:!1},P7={suppressEvents:!0},GM={},Il=[],nb={},u5,Xi={},vx={},pL=30,Hy=[],HM="",WM=function(e){var t=e[0],n,i;if(Wo(t)||Xn(t)||(e=[e]),!(n=(t._gsap||{}).harness)){for(i=Hy.length;i--&&!Hy[i].targetTest(t););n=Hy[i]}for(i=e.length;i--;)e[i]&&(e[i]._gsap||(e[i]._gsap=new I5(e[i],n)))||e.splice(i,1);return e},dc=function(e){return e._gsap||WM(La(e))[0]._gsap},c5=function(e,t,n){return(n=e[t])&&Xn(n)?e[t]():BM(n)&&e.getAttribute&&e.getAttribute(t)||n},Li=function(e,t){return(e=e.split(",")).forEach(t)||e},Jn=function(e){return Math.round(e*1e5)/1e5||0},Fn=function(e){return Math.round(e*1e7)/1e7||0},_f=function(e,t){var n=t.charAt(0),i=parseFloat(t.substr(2));return e=parseFloat(e),n==="+"?e+i:n==="-"?e-i:n==="*"?e*i:e/i},R7=function(e,t){for(var n=t.length,i=0;e.indexOf(t[i])<0&&++is;)o=o._prev;return o?(t._next=o._next,o._next=t):(t._next=e[n],e[n]=t),t._next?t._next._prev=t:e[i]=t,t._prev=o,t.parent=t._dp=e,t},q_=function(e,t,n,i){n===void 0&&(n="_first"),i===void 0&&(i="_last");var a=t._prev,o=t._next;a?a._next=o:e[n]===t&&(e[n]=o),o?o._prev=a:e[i]===t&&(e[i]=a),t._next=t._prev=t.parent=null},Wl=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},pc=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var n=e;n;)n._dirty=1,n=n.parent;return e},N7=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},rb=function(e,t,n,i){return e._startAt&&(kr?e._startAt.revert(Gy):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,i))},k7=function r(e){return!e||e._ts&&r(e.parent)},gL=function(e){return e._repeat?kf(e._tTime,e=e.duration()+e._rDelay)*e:0},kf=function(e,t){var n=Math.floor(e=Fn(e/t));return e&&n===e?n-1:n},b0=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},j_=function(e){return e._end=Fn(e._start+(e._tDur/Math.abs(e._ts||e._rts||An)||0))},K_=function(e,t){var n=e._dp;return n&&n.smoothChildTiming&&e._ts&&(e._start=Fn(n._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),j_(e),n._dirty||pc(n,e)),e},v5=function(e,t){var n;if((t._time||!t._dur&&t._initted||t._startAn)&&t.render(n,!0)),pc(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur=0&&n.totalTime(n._tTime),n=n._dp;e._zTime=-An}},Po=function(e,t,n,i){return t.parent&&Wl(t),t._start=Fn((Ms(n)?n:n||e!==Bn?pa(e,n,t):e._time)+t._delay),t._end=Fn(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),p5(e,t,"_first","_last",e._sort?"_start":0),ib(t)||(e._recent=t),i||v5(e,t),e._ts<0&&K_(e,e._tTime),e},g5=function(e,t){return(ia.ScrollTrigger||VM("scrollTrigger",t))&&ia.ScrollTrigger.create(t,e)},m5=function(e,t,n,i,a){if(YM(e,t,a),!e._initted)return 1;if(!n&&e._pt&&!kr&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&u5!==qi.frame)return Il.push(e),e._lazy=[a,i],1},O7=function r(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||r(t))},ib=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},F7=function(e,t,n,i){var a=e.ratio,o=t<0||!t&&(!e._start&&O7(e)&&!(!e._initted&&ib(e))||(e._ts<0||e._dp._ts<0)&&!ib(e))?0:1,s=e._rDelay,l=0,u,c,h;if(s&&e._repeat&&(l=dg(0,e._tDur,t),c=kf(l,s),e._yoyo&&c&1&&(o=1-o),c!==kf(e._tTime,s)&&(a=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==a||kr||i||e._zTime===An||!t&&e._zTime){if(!e._initted&&m5(e,t,i,n,l))return;for(h=e._zTime,e._zTime=t||(n?An:0),n||(n=t&&!h),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=l,u=e._pt;u;)u.r(o,u.d),u=u._next;t<0&&rb(e,t,n,!0),e._onUpdate&&!n&&Ki(e,"onUpdate"),l&&e._repeat&&!n&&e.parent&&Ki(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===o&&(o&&Wl(e,1),!n&&!kr&&(Ki(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},B7=function(e,t,n){var i;if(n>t)for(i=e._first;i&&i._start<=n;){if(i.data==="isPause"&&i._start>t)return i;i=i._next}else for(i=e._last;i&&i._start>=n;){if(i.data==="isPause"&&i._start0&&!i&&K_(e,e._tTime=e._tDur*s),e.parent&&j_(e),n||pc(e.parent,e),e},mL=function(e){return e instanceof pi?pc(e):Of(e,e._dur)},z7={_start:0,endTime:mv,totalDuration:mv},pa=function r(e,t,n){var i=e.labels,a=e._recent||z7,o=e.duration()>=Ea?a.endTime(!1):e._dur,s,l,u;return Er(t)&&(isNaN(t)||t in i)?(l=t.charAt(0),u=t.substr(-1)==="%",s=t.indexOf("="),l==="<"||l===">"?(s>=0&&(t=t.replace(/=/,"")),(l==="<"?a._start:a.endTime(a._repeat>=0))+(parseFloat(t.substr(1))||0)*(u?(s<0?a:n).totalDuration()/100:1)):s<0?(t in i||(i[t]=o),i[t]):(l=parseFloat(t.charAt(s-1)+t.substr(s+1)),u&&n&&(l=l/100*(ri(n)?n[0]:n).totalDuration()),s>1?r(e,t.substr(0,s-1),n)+l:o+l)):t==null?o:+t},Wp=function(e,t,n){var i=Ms(t[1]),a=(i?2:1)+(e<2?0:1),o=t[a],s,l;if(i&&(o.duration=t[1]),o.parent=n,e){for(s=o,l=n;l&&!("immediateRender"in s);)s=l.vars.defaults||{},l=Ei(l.vars.inherit)&&l.parent;o.immediateRender=Ei(s.immediateRender),e<2?o.runBackwards=1:o.startAt=t[a-1]}return new sr(t[0],o,t[a+1])},ru=function(e,t){return e||e===0?t(e):t},dg=function(e,t,n){return nt?t:n},ei=function(e,t){return!Er(e)||!(t=E7.exec(e))?"":t[1]},U7=function(e,t,n){return ru(n,function(i){return dg(e,t,i)})},ab=[].slice,y5=function(e,t){return e&&Wo(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&Wo(e[0]))&&!e.nodeType&&e!==To},V7=function(e,t,n){return n===void 0&&(n=[]),e.forEach(function(i){var a;return Er(i)&&!t||y5(i,1)?(a=n).push.apply(a,La(i)):n.push(i)})||n},La=function(e,t,n){return In&&!t&&In.selector?In.selector(e):Er(e)&&!n&&(tb||!Ff())?ab.call((t||UM).querySelectorAll(e),0):ri(e)?V7(e,n):y5(e)?ab.call(e,0):e?[e]:[]},ob=function(e){return e=La(e)[0]||gv("Invalid scope")||{},function(t){var n=e.current||e.nativeElement||e;return La(t,n.querySelectorAll?n:n===e?gv("Invalid scope")||UM.createElement("div"):e)}},_5=function(e){return e.sort(function(){return .5-Math.random()})},x5=function(e){if(Xn(e))return e;var t=Wo(e)?e:{each:e},n=vc(t.ease),i=t.from||0,a=parseFloat(t.base)||0,o={},s=i>0&&i<1,l=isNaN(i)||s,u=t.axis,c=i,h=i;return Er(i)?c=h={center:.5,edges:.5,end:1}[i]||0:!s&&l&&(c=i[0],h=i[1]),function(f,d,p){var g=(p||t).length,v=o[g],m,y,_,x,S,A,w,M,C;if(!v){if(C=t.grid==="auto"?0:(t.grid||[1,Ea])[1],!C){for(w=-Ea;w<(w=p[C++].getBoundingClientRect().left)&&Cw&&(w=S),Sg?g-1:u?u==="y"?g/C:C:Math.max(C,g/C))||0)*(i==="edges"?-1:1),v.b=g<0?a-g:a,v.u=ei(t.amount||t.each)||0,n=n&&g<0?P5(n):n}return g=(v[f]-v.min)/v.max||0,Fn(v.b+(n?n(g):g)*v.v)+v.u}},sb=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(n){var i=Fn(Math.round(parseFloat(n)/e)*e*t);return(i-i%1)/t+(Ms(n)?0:ei(n))}},S5=function(e,t){var n=ri(e),i,a;return!n&&Wo(e)&&(i=n=e.radius||Ea,e.values?(e=La(e.values),(a=!Ms(e[0]))&&(i*=i)):e=sb(e.increment)),ru(t,n?Xn(e)?function(o){return a=e(o),Math.abs(a-o)<=i?a:o}:function(o){for(var s=parseFloat(a?o.x:o),l=parseFloat(a?o.y:0),u=Ea,c=0,h=e.length,f,d;h--;)a?(f=e[h].x-s,d=e[h].y-l,f=f*f+d*d):f=Math.abs(e[h]-s),fi?a-o:o)})},yv=function(e){return e.replace(T7,function(t){var n=t.indexOf("[")+1,i=t.substring(n||7,n?t.indexOf("]"):t.length-1).split(M7);return A5(n?i:+i[0],n?0:+i[1],+i[2]||1e-5)})},b5=function(e,t,n,i,a){var o=t-e,s=i-n;return ru(a,function(l){return n+((l-e)/o*s||0)})},Y7=function r(e,t,n,i){var a=isNaN(e+t)?0:function(d){return(1-d)*e+d*t};if(!a){var o=Er(e),s={},l,u,c,h,f;if(n===!0&&(i=1)&&(n=null),o)e={p:e},t={p:t};else if(ri(e)&&!ri(t)){for(c=[],h=e.length,f=h-2,u=1;u(s=Math.abs(s))&&(l=o,a=s);return l},Ki=function(e,t,n){var i=e.vars,a=i[t],o=In,s=e._ctx,l,u,c;if(a)return l=i[t+"Params"],u=i.callbackScope||e,n&&Il.length&&A0(),s&&(In=s),c=l?a.apply(u,l):a.call(u),In=o,c},wp=function(e){return Wl(e),e.scrollTrigger&&e.scrollTrigger.kill(!!kr),e.progress()<1&&Ki(e,"onInterrupt"),e},uf,T5=[],M5=function(e){if(e)if(e=!e.name&&e.default||e,zM()||e.headless){var t=e.name,n=Xn(e),i=t&&!n&&e.init?function(){this._props=[]}:e,a={init:mv,render:KM,add:XM,kill:u9,modifier:l9,rawVars:0},o={targetTest:0,get:0,getSetter:jM,aliases:{},register:0};if(Ff(),e!==i){if(Xi[t])return;aa(i,aa(w0(e,a),o)),Nf(i.prototype,Nf(a,w0(e,o))),Xi[i.prop=t]=i,e.targetTest&&(Hy.push(i),GM[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}l5(t,i),e.register&&e.register(ki,i,Pi)}else T5.push(e)},xn=255,bp={aqua:[0,xn,xn],lime:[0,xn,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,xn],navy:[0,0,128],white:[xn,xn,xn],olive:[128,128,0],yellow:[xn,xn,0],orange:[xn,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[xn,0,0],pink:[xn,192,203],cyan:[0,xn,xn],transparent:[xn,xn,xn,0]},gx=function(e,t,n){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(n-t)*e*6:e<.5?n:e*3<2?t+(n-t)*(2/3-e)*6:t)*xn+.5|0},C5=function(e,t,n){var i=e?Ms(e)?[e>>16,e>>8&xn,e&xn]:0:bp.black,a,o,s,l,u,c,h,f,d,p;if(!i){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),bp[e])i=bp[e];else if(e.charAt(0)==="#"){if(e.length<6&&(a=e.charAt(1),o=e.charAt(2),s=e.charAt(3),e="#"+a+a+o+o+s+s+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return i=parseInt(e.substr(1,6),16),[i>>16,i>>8&xn,i&xn,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),i=[e>>16,e>>8&xn,e&xn]}else if(e.substr(0,3)==="hsl"){if(i=p=e.match(dL),!t)l=+i[0]%360/360,u=+i[1]/100,c=+i[2]/100,o=c<=.5?c*(u+1):c+u-c*u,a=c*2-o,i.length>3&&(i[3]*=1),i[0]=gx(l+1/3,a,o),i[1]=gx(l,a,o),i[2]=gx(l-1/3,a,o);else if(~e.indexOf("="))return i=e.match(i5),n&&i.length<4&&(i[3]=1),i}else i=e.match(dL)||bp.transparent;i=i.map(Number)}return t&&!p&&(a=i[0]/xn,o=i[1]/xn,s=i[2]/xn,h=Math.max(a,o,s),f=Math.min(a,o,s),c=(h+f)/2,h===f?l=u=0:(d=h-f,u=c>.5?d/(2-h-f):d/(h+f),l=h===a?(o-s)/d+(oe||m<0)&&(n+=m-t),i+=m,S=i-n,_=S-o,(_>0||y)&&(A=++h.frame,f=S-h.time*1e3,h.time=S=S/1e3,o+=_+(_>=a?4:a-_),x=1),y||(l=u(g)),x)for(d=0;d=m&&d--},_listeners:s},h}(),Ff=function(){return!_v&&qi.wake()},Zt={},j7=/^[\d.\-M][\d.\-,\s]/,K7=/["']/g,Z7=function(e){for(var t={},n=e.substr(1,e.length-3).split(":"),i=n[0],a=1,o=n.length,s,l,u;a1&&n.config?n.config.apply(null,~e.indexOf("{")?[Z7(t[1])]:Q7(e).split(",").map(f5)):Zt._CE&&j7.test(e)?Zt._CE("",e):n},P5=function(e){return function(t){return 1-e(1-t)}},R5=function r(e,t){for(var n=e._first,i;n;)n instanceof pi?r(n,t):n.vars.yoyoEase&&(!n._yoyo||!n._repeat)&&n._yoyo!==t&&(n.timeline?r(n.timeline,t):(i=n._ease,n._ease=n._yEase,n._yEase=i,n._yoyo=t)),n=n._next},vc=function(e,t){return e&&(Xn(e)?e:Zt[e]||J7(e))||t},Xc=function(e,t,n,i){n===void 0&&(n=function(l){return 1-t(1-l)}),i===void 0&&(i=function(l){return l<.5?t(l*2)/2:1-t((1-l)*2)/2});var a={easeIn:t,easeOut:n,easeInOut:i},o;return Li(e,function(s){Zt[s]=ia[s]=a,Zt[o=s.toLowerCase()]=n;for(var l in a)Zt[o+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=Zt[s+"."+l]=a[l]}),a},D5=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},mx=function r(e,t,n){var i=t>=1?t:1,a=(n||(e?.3:.45))/(t<1?t:1),o=a/eb*(Math.asin(1/i)||0),s=function(c){return c===1?1:i*Math.pow(2,-10*c)*b7((c-o)*a)+1},l=e==="out"?s:e==="in"?function(u){return 1-s(1-u)}:D5(s);return a=eb/a,l.config=function(u,c){return r(e,u,c)},l},yx=function r(e,t){t===void 0&&(t=1.70158);var n=function(o){return o?--o*o*((t+1)*o+t)+1:0},i=e==="out"?n:e==="in"?function(a){return 1-n(1-a)}:D5(n);return i.config=function(a){return r(e,a)},i};Li("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,e){var t=e<5?e+1:e;Xc(r+",Power"+(t-1),e?function(n){return Math.pow(n,t)}:function(n){return n},function(n){return 1-Math.pow(1-n,t)},function(n){return n<.5?Math.pow(n*2,t)/2:1-Math.pow((1-n)*2,t)/2})});Zt.Linear.easeNone=Zt.none=Zt.Linear.easeIn;Xc("Elastic",mx("in"),mx("out"),mx());(function(r,e){var t=1/e,n=2*t,i=2.5*t,a=function(s){return s0?n+(n+this._rDelay)*this._repeat:n):this.totalDuration()&&this._dur},e.totalDuration=function(n){return arguments.length?(this._dirty=0,Of(this,this._repeat<0?n:(n-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(n,i){if(Ff(),!arguments.length)return this._tTime;var a=this._dp;if(a&&a.smoothChildTiming&&this._ts){for(K_(this,n),!a._dp||a.parent||v5(a,this);a&&a.parent;)a.parent._time!==a._start+(a._ts>=0?a._tTime/a._ts:(a.totalDuration()-a._tTime)/-a._ts)&&a.totalTime(a._tTime,!0),a=a.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&n0||!this._tDur&&!n)&&Po(this._dp,this,this._start-this._delay)}return(this._tTime!==n||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===An||!this._initted&&this._dur&&n||!n&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=n),h5(this,n,i)),this},e.time=function(n,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),n+gL(this))%(this._dur+this._rDelay)||(n?this._dur:0),i):this._time},e.totalProgress=function(n,i){return arguments.length?this.totalTime(this.totalDuration()*n,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(n,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-n:n)+gL(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(n,i){var a=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(n-1)*a,i):this._repeat?kf(this._tTime,a)+1:1},e.timeScale=function(n,i){if(!arguments.length)return this._rts===-An?0:this._rts;if(this._rts===n)return this;var a=this.parent&&this._ts?b0(this.parent._time,this):this._tTime;return this._rts=+n||0,this._ts=this._ps||n===-An?0:this._rts,this.totalTime(dg(-Math.abs(this._delay),this.totalDuration(),a),i!==!1),j_(this),N7(this)},e.paused=function(n){return arguments.length?(this._ps!==n&&(this._ps=n,n?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Ff(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==An&&(this._tTime-=An)))),this):this._ps},e.startTime=function(n){if(arguments.length){this._start=Fn(n);var i=this.parent||this._dp;return i&&(i._sort||!this.parent)&&Po(i,this,this._start-this._delay),this}return this._start},e.endTime=function(n){return this._start+(Ei(n)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(n){var i=this.parent||this._dp;return i?n&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?b0(i.rawTime(n),this):this._tTime:this._tTime},e.revert=function(n){n===void 0&&(n=P7);var i=kr;return kr=n,$M(this)&&(this.timeline&&this.timeline.revert(n),this.totalTime(-.01,n.suppressEvents)),this.data!=="nested"&&n.kill!==!1&&this.kill(),kr=i,this},e.globalTime=function(n){for(var i=this,a=arguments.length?n:i.rawTime();i;)a=i._start+a/(Math.abs(i._ts)||1),i=i._dp;return!this.parent&&this._sat?this._sat.globalTime(n):a},e.repeat=function(n){return arguments.length?(this._repeat=n===1/0?-2:n,mL(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(n){if(arguments.length){var i=this._time;return this._rDelay=n,mL(this),i?this.time(i):this}return this._rDelay},e.yoyo=function(n){return arguments.length?(this._yoyo=n,this):this._yoyo},e.seek=function(n,i){return this.totalTime(pa(this,n),Ei(i))},e.restart=function(n,i){return this.play().totalTime(n?-this._delay:0,Ei(i)),this._dur||(this._zTime=-An),this},e.play=function(n,i){return n!=null&&this.seek(n,i),this.reversed(!1).paused(!1)},e.reverse=function(n,i){return n!=null&&this.seek(n||this.totalDuration(),i),this.reversed(!0).paused(!1)},e.pause=function(n,i){return n!=null&&this.seek(n,i),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(n){return arguments.length?(!!n!==this.reversed()&&this.timeScale(-this._rts||(n?-An:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-An,this},e.isActive=function(){var n=this.parent||this._dp,i=this._start,a;return!!(!n||this._ts&&this._initted&&n.isActive()&&(a=n.rawTime(!0))>=i&&a1?(i?(o[n]=i,a&&(o[n+"Params"]=a),n==="onUpdate"&&(this._onUpdate=i)):delete o[n],this):o[n]},e.then=function(n){var i=this,a=i._prom;return new Promise(function(o){var s=Xn(n)?n:d5,l=function(){var c=i.then;i.then=null,a&&a(),Xn(s)&&(s=s(i))&&(s.then||s===i)&&(i.then=c),o(s),i.then=c};i._initted&&i.totalProgress()===1&&i._ts>=0||!i._tTime&&i._ts<0?l():i._prom=l})},e.kill=function(){wp(this)},r}();aa(xv.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-An,_prom:0,_ps:!1,_rts:1});var pi=function(r){t5(e,r);function e(n,i){var a;return n===void 0&&(n={}),a=r.call(this,n)||this,a.labels={},a.smoothChildTiming=!!n.smoothChildTiming,a.autoRemoveChildren=!!n.autoRemoveChildren,a._sort=Ei(n.sortChildren),Bn&&Po(n.parent||Bn,fs(a),i),n.reversed&&a.reverse(),n.paused&&a.paused(!0),n.scrollTrigger&&g5(fs(a),n.scrollTrigger),a}var t=e.prototype;return t.to=function(i,a,o){return Wp(0,arguments,this),this},t.from=function(i,a,o){return Wp(1,arguments,this),this},t.fromTo=function(i,a,o,s){return Wp(2,arguments,this),this},t.set=function(i,a,o){return a.duration=0,a.parent=this,Hp(a).repeatDelay||(a.repeat=0),a.immediateRender=!!a.immediateRender,new sr(i,a,pa(this,o),1),this},t.call=function(i,a,o){return Po(this,sr.delayedCall(0,i,a),o)},t.staggerTo=function(i,a,o,s,l,u,c){return o.duration=a,o.stagger=o.stagger||s,o.onComplete=u,o.onCompleteParams=c,o.parent=this,new sr(i,o,pa(this,l)),this},t.staggerFrom=function(i,a,o,s,l,u,c){return o.runBackwards=1,Hp(o).immediateRender=Ei(o.immediateRender),this.staggerTo(i,a,o,s,l,u,c)},t.staggerFromTo=function(i,a,o,s,l,u,c,h){return s.startAt=o,Hp(s).immediateRender=Ei(s.immediateRender),this.staggerTo(i,a,s,l,u,c,h)},t.render=function(i,a,o){var s=this._time,l=this._dirty?this.totalDuration():this._tDur,u=this._dur,c=i<=0?0:Fn(i),h=this._zTime<0!=i<0&&(this._initted||!u),f,d,p,g,v,m,y,_,x,S,A,w;if(this!==Bn&&c>l&&i>=0&&(c=l),c!==this._tTime||o||h){if(s!==this._time&&u&&(c+=this._time-s,i+=this._time-s),f=c,x=this._start,_=this._ts,m=!_,h&&(u||(s=this._zTime),(i||!a)&&(this._zTime=i)),this._repeat){if(A=this._yoyo,v=u+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(v*100+i,a,o);if(f=Fn(c%v),c===l?(g=this._repeat,f=u):(S=Fn(c/v),g=~~S,g&&g===S&&(f=u,g--),f>u&&(f=u)),S=kf(this._tTime,v),!s&&this._tTime&&S!==g&&this._tTime-S*v-this._dur<=0&&(S=g),A&&g&1&&(f=u-f,w=1),g!==S&&!this._lock){var M=A&&S&1,C=M===(A&&g&1);if(g=s&&i>=0)for(d=this._first;d;){if(p=d._next,(d._act||f>=d._start)&&d._ts&&y!==d){if(d.parent!==this)return this.render(i,a,o);if(d.render(d._ts>0?(f-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(f-d._start)*d._ts,a,o),f!==this._time||!this._ts&&!m){y=0,p&&(c+=this._zTime=-An);break}}d=p}else{d=this._last;for(var b=i<0?i:f;d;){if(p=d._prev,(d._act||b<=d._end)&&d._ts&&y!==d){if(d.parent!==this)return this.render(i,a,o);if(d.render(d._ts>0?(b-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(b-d._start)*d._ts,a,o||kr&&$M(d)),f!==this._time||!this._ts&&!m){y=0,p&&(c+=this._zTime=b?-An:An);break}}d=p}}if(y&&!a&&(this.pause(),y.render(f>=s?0:-An)._zTime=f>=s?1:-1,this._ts))return this._start=x,j_(this),this.render(i,a,o);this._onUpdate&&!a&&Ki(this,"onUpdate",!0),(c===l&&this._tTime>=this.totalDuration()||!c&&s)&&(x===this._start||Math.abs(_)!==Math.abs(this._ts))&&(this._lock||((i||!u)&&(c===l&&this._ts>0||!c&&this._ts<0)&&Wl(this,1),!a&&!(i<0&&!s)&&(c||s||!l)&&(Ki(this,c===l&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c0)&&this._prom())))}return this},t.add=function(i,a){var o=this;if(Ms(a)||(a=pa(this,a,i)),!(i instanceof xv)){if(ri(i))return i.forEach(function(s){return o.add(s,a)}),this;if(Er(i))return this.addLabel(i,a);if(Xn(i))i=sr.delayedCall(0,i);else return this}return this!==i?Po(this,i,a):this},t.getChildren=function(i,a,o,s){i===void 0&&(i=!0),a===void 0&&(a=!0),o===void 0&&(o=!0),s===void 0&&(s=-Ea);for(var l=[],u=this._first;u;)u._start>=s&&(u instanceof sr?a&&l.push(u):(o&&l.push(u),i&&l.push.apply(l,u.getChildren(!0,a,o)))),u=u._next;return l},t.getById=function(i){for(var a=this.getChildren(1,1,1),o=a.length;o--;)if(a[o].vars.id===i)return a[o]},t.remove=function(i){return Er(i)?this.removeLabel(i):Xn(i)?this.killTweensOf(i):(i.parent===this&&q_(this,i),i===this._recent&&(this._recent=this._last),pc(this))},t.totalTime=function(i,a){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Fn(qi.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))),r.prototype.totalTime.call(this,i,a),this._forcing=0,this):this._tTime},t.addLabel=function(i,a){return this.labels[i]=pa(this,a),this},t.removeLabel=function(i){return delete this.labels[i],this},t.addPause=function(i,a,o){var s=sr.delayedCall(0,a||mv,o);return s.data="isPause",this._hasPause=1,Po(this,s,pa(this,i))},t.removePause=function(i){var a=this._first;for(i=pa(this,i);a;)a._start===i&&a.data==="isPause"&&Wl(a),a=a._next},t.killTweensOf=function(i,a,o){for(var s=this.getTweensOf(i,o),l=s.length;l--;)ml!==s[l]&&s[l].kill(i,a);return this},t.getTweensOf=function(i,a){for(var o=[],s=La(i),l=this._first,u=Ms(a),c;l;)l instanceof sr?R7(l._targets,s)&&(u?(!ml||l._initted&&l._ts)&&l.globalTime(0)<=a&&l.globalTime(l.totalDuration())>a:!a||l.isActive())&&o.push(l):(c=l.getTweensOf(s,a)).length&&o.push.apply(o,c),l=l._next;return o},t.tweenTo=function(i,a){a=a||{};var o=this,s=pa(o,i),l=a,u=l.startAt,c=l.onStart,h=l.onStartParams,f=l.immediateRender,d,p=sr.to(o,aa({ease:a.ease||"none",lazy:!1,immediateRender:!1,time:s,overwrite:"auto",duration:a.duration||Math.abs((s-(u&&"time"in u?u.time:o._time))/o.timeScale())||An,onStart:function(){if(o.pause(),!d){var v=a.duration||Math.abs((s-(u&&"time"in u?u.time:o._time))/o.timeScale());p._dur!==v&&Of(p,v,0,1).render(p._time,!0,!0),d=1}c&&c.apply(p,h||[])}},a));return f?p.render(0):p},t.tweenFromTo=function(i,a,o){return this.tweenTo(a,aa({startAt:{time:pa(this,i)}},o))},t.recent=function(){return this._recent},t.nextLabel=function(i){return i===void 0&&(i=this._time),yL(this,pa(this,i))},t.previousLabel=function(i){return i===void 0&&(i=this._time),yL(this,pa(this,i),1)},t.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+An)},t.shiftChildren=function(i,a,o){o===void 0&&(o=0);var s=this._first,l=this.labels,u;for(i=Fn(i);s;)s._start>=o&&(s._start+=i,s._end+=i),s=s._next;if(a)for(u in l)l[u]>=o&&(l[u]+=i);return pc(this)},t.invalidate=function(i){var a=this._first;for(this._lock=0;a;)a.invalidate(i),a=a._next;return r.prototype.invalidate.call(this,i)},t.clear=function(i){i===void 0&&(i=!0);for(var a=this._first,o;a;)o=a._next,this.remove(a),a=o;return this._dp&&(this._time=this._tTime=this._pTime=0),i&&(this.labels={}),pc(this)},t.totalDuration=function(i){var a=0,o=this,s=o._last,l=Ea,u,c,h;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-i:i));if(o._dirty){for(h=o.parent;s;)u=s._prev,s._dirty&&s.totalDuration(),c=s._start,c>l&&o._sort&&s._ts&&!o._lock?(o._lock=1,Po(o,s,c-s._delay,1)._lock=0):l=c,c<0&&s._ts&&(a-=c,(!h&&!o._dp||h&&h.smoothChildTiming)&&(o._start+=Fn(c/o._ts),o._time-=c,o._tTime-=c),o.shiftChildren(-c,!1,-1/0),l=0),s._end>a&&s._ts&&(a=s._end),s=u;Of(o,o===Bn&&o._time>a?o._time:a,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(i){if(Bn._ts&&(h5(Bn,b0(i,Bn)),u5=qi.frame),qi.frame>=pL){pL+=ea.autoSleep||120;var a=Bn._first;if((!a||!a._ts)&&ea.autoSleep&&qi._listeners.length<2){for(;a&&!a._ts;)a=a._next;a||qi.sleep()}}},e}(xv);aa(pi.prototype,{_lock:0,_hasPause:0,_forcing:0});var e9=function(e,t,n,i,a,o,s){var l=new Pi(this._pt,e,t,0,1,z5,null,a),u=0,c=0,h,f,d,p,g,v,m,y;for(l.b=n,l.e=i,n+="",i+="",(m=~i.indexOf("random("))&&(i=yv(i)),o&&(y=[n,i],o(y,e,t),n=y[0],i=y[1]),f=n.match(px)||[];h=px.exec(i);)p=h[0],g=i.substring(u,h.index),d?d=(d+1)%5:g.substr(-5)==="rgba("&&(d=1),p!==f[c++]&&(v=parseFloat(f[c-1])||0,l._pt={_next:l._pt,p:g||c===1?g:",",s:v,c:p.charAt(1)==="="?_f(v,p)-v:parseFloat(p)-v,m:d&&d<4?Math.round:0},u=px.lastIndex);return l.c=u")}),x.duration();else{A={};for(M in p)M==="ease"||M==="easeEach"||i9(M,p[M],A,p.easeEach);for(M in A)for(D=A[M].sort(function(I,N){return I.t-N.t}),P=0,S=0;Sl-An&&!c?l:iu&&(f=u)),m=this._yoyo&&p&1,m&&(x=this._yEase,f=u-f),v=kf(this._tTime,g),f===s&&!o&&this._initted&&p===v)return this._tTime=h,this;p!==v&&(_&&this._yEase&&R5(_,m),this.vars.repeatRefresh&&!m&&!this._lock&&f!==g&&this._initted&&(this._lock=o=1,this.render(Fn(g*p),!0).invalidate()._lock=0))}if(!this._initted){if(m5(this,c?i:f,o,a,h))return this._tTime=0,this;if(s!==this._time&&!(o&&this.vars.repeatRefresh&&p!==v))return this;if(u!==this._dur)return this.render(i,a,o)}if(this._tTime=h,this._time=f,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=y=(x||this._ease)(f/u),this._from&&(this.ratio=y=1-y),!s&&h&&!a&&!v&&(Ki(this,"onStart"),this._tTime!==h))return this;for(d=this._pt;d;)d.r(y,d.d),d=d._next;_&&_.render(i<0?i:_._dur*_._ease(f/this._dur),a,o)||this._startAt&&(this._zTime=i),this._onUpdate&&!a&&(c&&rb(this,i,a,o),Ki(this,"onUpdate")),this._repeat&&p!==v&&this.vars.onRepeat&&!a&&this.parent&&Ki(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(c&&!this._onUpdate&&rb(this,i,!0,!0),(i||!u)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&Wl(this,1),!a&&!(c&&!s)&&(h||s||m)&&(Ki(this,h===l?"onComplete":"onReverseComplete",!0),this._prom&&!(h0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(i){return(!i||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(i),r.prototype.invalidate.call(this,i)},t.resetTo=function(i,a,o,s,l){_v||qi.wake(),this._ts||this.play();var u=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||YM(this,u),c=this._ease(u/this._dur),n9(this,i,a,o,s,c,u,l)?this.resetTo(i,a,o,s,1):(K_(this,0),this.parent||p5(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(i,a){if(a===void 0&&(a="all"),!i&&(!a||a==="all"))return this._lazy=this._pt=0,this.parent?wp(this):this.scrollTrigger&&this.scrollTrigger.kill(!!kr),this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(i,a,ml&&ml.vars.overwrite!==!0)._first||wp(this),this.parent&&o!==this.timeline.totalDuration()&&Of(this,this._dur*this.timeline._tDur/o,0,1),this}var s=this._targets,l=i?La(i):s,u=this._ptLookup,c=this._pt,h,f,d,p,g,v,m;if((!a||a==="all")&&I7(s,l))return a==="all"&&(this._pt=0),wp(this);for(h=this._op=this._op||[],a!=="all"&&(Er(a)&&(g={},Li(a,function(y){return g[y]=1}),a=g),a=r9(s,a)),m=s.length;m--;)if(~l.indexOf(s[m])){f=u[m],a==="all"?(h[m]=a,p=f,d={}):(d=h[m]=h[m]||{},p=a);for(g in p)v=f&&f[g],v&&((!("kill"in v.d)||v.d.kill(g)===!0)&&q_(this,v,"_pt"),delete f[g]),d!=="all"&&(d[g]=1)}return this._initted&&!this._pt&&c&&wp(this),this},e.to=function(i,a){return new e(i,a,arguments[2])},e.from=function(i,a){return Wp(1,arguments)},e.delayedCall=function(i,a,o,s){return new e(a,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:i,onComplete:a,onReverseComplete:a,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:s})},e.fromTo=function(i,a,o){return Wp(2,arguments)},e.set=function(i,a){return a.duration=0,a.repeatDelay||(a.repeat=0),new e(i,a)},e.killTweensOf=function(i,a,o){return Bn.killTweensOf(i,a,o)},e}(xv);aa(sr.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Li("staggerTo,staggerFrom,staggerFromTo",function(r){sr[r]=function(){var e=new pi,t=ab.call(arguments,0);return t.splice(r==="staggerFromTo"?5:4,0,0),e[r].apply(e,t)}});var qM=function(e,t,n){return e[t]=n},F5=function(e,t,n){return e[t](n)},a9=function(e,t,n,i){return e[t](i.fp,n)},o9=function(e,t,n){return e.setAttribute(t,n)},jM=function(e,t){return Xn(e[t])?F5:BM(e[t])&&e.setAttribute?o9:qM},B5=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},s9=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},z5=function(e,t){var n=t._pt,i="";if(!e&&t.b)i=t.b;else if(e===1&&t.e)i=t.e;else{for(;n;)i=n.p+(n.m?n.m(n.s+n.c*e):Math.round((n.s+n.c*e)*1e4)/1e4)+i,n=n._next;i+=t.c}t.set(t.t,t.p,i,t)},KM=function(e,t){for(var n=t._pt;n;)n.r(e,n.d),n=n._next},l9=function(e,t,n,i){for(var a=this._pt,o;a;)o=a._next,a.p===i&&a.modifier(e,t,n),a=o},u9=function(e){for(var t=this._pt,n,i;t;)i=t._next,t.p===e&&!t.op||t.op===e?q_(this,t,"_pt"):t.dep||(n=1),t=i;return!n},c9=function(e,t,n,i){i.mSet(e,t,i.m.call(i.tween,n,i.mt),i)},U5=function(e){for(var t=e._pt,n,i,a,o;t;){for(n=t._next,i=a;i&&i.pr>t.pr;)i=i._next;(t._prev=i?i._prev:o)?t._prev._next=t:a=t,(t._next=i)?i._prev=t:o=t,t=n}e._pt=a},Pi=function(){function r(t,n,i,a,o,s,l,u,c){this.t=n,this.s=a,this.c=o,this.p=i,this.r=s||B5,this.d=l||this,this.set=u||qM,this.pr=c||0,this._next=t,t&&(t._prev=this)}var e=r.prototype;return e.modifier=function(n,i,a){this.mSet=this.mSet||this.set,this.set=c9,this.m=n,this.mt=a,this.tween=i},r}();Li(HM+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(r){return GM[r]=1});ia.TweenMax=ia.TweenLite=sr;ia.TimelineLite=ia.TimelineMax=pi;Bn=new pi({sortChildren:!1,defaults:If,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});ea.stringFilter=L5;var gc=[],Wy={},h9=[],xL=0,f9=0,_x=function(e){return(Wy[e]||h9).map(function(t){return t()})},ub=function(){var e=Date.now(),t=[];e-xL>2&&(_x("matchMediaInit"),gc.forEach(function(n){var i=n.queries,a=n.conditions,o,s,l,u;for(s in i)o=To.matchMedia(i[s]).matches,o&&(l=1),o!==a[s]&&(a[s]=o,u=1);u&&(n.revert(),l&&t.push(n))}),_x("matchMediaRevert"),t.forEach(function(n){return n.onMatch(n,function(i){return n.add(null,i)})}),xL=e,_x("matchMedia"))},V5=function(){function r(t,n){this.selector=n&&ob(n),this.data=[],this._r=[],this.isReverted=!1,this.id=f9++,t&&this.add(t)}var e=r.prototype;return e.add=function(n,i,a){Xn(n)&&(a=i,i=n,n=Xn);var o=this,s=function(){var u=In,c=o.selector,h;return u&&u!==o&&u.data.push(o),a&&(o.selector=ob(a)),In=o,h=i.apply(o,arguments),Xn(h)&&o._r.push(h),In=u,o.selector=c,o.isReverted=!1,h};return o.last=s,n===Xn?s(o,function(l){return o.add(null,l)}):n?o[n]=s:s},e.ignore=function(n){var i=In;In=null,n(this),In=i},e.getTweens=function(){var n=[];return this.data.forEach(function(i){return i instanceof r?n.push.apply(n,i.getTweens()):i instanceof sr&&!(i.parent&&i.parent.data==="nested")&&n.push(i)}),n},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(n,i){var a=this;if(n?function(){for(var s=a.getTweens(),l=a.data.length,u;l--;)u=a.data[l],u.data==="isFlip"&&(u.revert(),u.getChildren(!0,!0,!1).forEach(function(c){return s.splice(s.indexOf(c),1)}));for(s.map(function(c){return{g:c._dur||c._delay||c._sat&&!c._sat.vars.immediateRender?c.globalTime(0):-1/0,t:c}}).sort(function(c,h){return h.g-c.g||-1/0}).forEach(function(c){return c.t.revert(n)}),l=a.data.length;l--;)u=a.data[l],u instanceof pi?u.data!=="nested"&&(u.scrollTrigger&&u.scrollTrigger.revert(),u.kill()):!(u instanceof sr)&&u.revert&&u.revert(n);a._r.forEach(function(c){return c(n,a)}),a.isReverted=!0}():this.data.forEach(function(s){return s.kill&&s.kill()}),this.clear(),i)for(var o=gc.length;o--;)gc[o].id===this.id&&gc.splice(o,1)},e.revert=function(n){this.kill(n||{})},r}(),d9=function(){function r(t){this.contexts=[],this.scope=t,In&&In.data.push(this)}var e=r.prototype;return e.add=function(n,i,a){Wo(n)||(n={matches:n});var o=new V5(0,a||this.scope),s=o.conditions={},l,u,c;In&&!o.selector&&(o.selector=In.selector),this.contexts.push(o),i=o.add("onMatch",i),o.queries=n;for(u in n)u==="all"?c=1:(l=To.matchMedia(n[u]),l&&(gc.indexOf(o)<0&&gc.push(o),(s[u]=l.matches)&&(c=1),l.addListener?l.addListener(ub):l.addEventListener("change",ub)));return c&&i(o,function(h){return o.add(null,h)}),this},e.revert=function(n){this.kill(n||{})},e.kill=function(n){this.contexts.forEach(function(i){return i.kill(n,!0)})},r}(),T0={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),n=0;n1){var i=e.map(function(c){return ki.quickSetter(c,t,n)}),a=i.length;return function(c){for(var h=a;h--;)i[h](c)}}e=e[0]||{};var o=Xi[t],s=dc(e),l=s.harness&&(s.harness.aliases||{})[t]||t,u=o?function(c){var h=new o;uf._pt=0,h.init(e,n?c+n:c,uf,0,[e]),h.render(1,h),uf._pt&&KM(1,uf)}:s.set(e,l);return o?u:function(c){return u(e,l,n?c+n:c,s,1)}},quickTo:function(e,t,n){var i,a=ki.to(e,aa((i={},i[t]="+=0.1",i.paused=!0,i.stagger=0,i),n||{})),o=function(l,u,c){return a.resetTo(t,l,u,c)};return o.tween=a,o},isTweening:function(e){return Bn.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=vc(e.ease,If.ease)),vL(If,e||{})},config:function(e){return vL(ea,e||{})},registerEffect:function(e){var t=e.name,n=e.effect,i=e.plugins,a=e.defaults,o=e.extendTimeline;(i||"").split(",").forEach(function(s){return s&&!Xi[s]&&!ia[s]&&gv(t+" effect requires "+s+" plugin.")}),vx[t]=function(s,l,u){return n(La(s),aa(l||{},a),u)},o&&(pi.prototype[t]=function(s,l,u){return this.add(vx[t](s,Wo(l)?l:(u=l)&&{},this),u)})},registerEase:function(e,t){Zt[e]=vc(t)},parseEase:function(e,t){return arguments.length?vc(e,t):Zt},getById:function(e){return Bn.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var n=new pi(e),i,a;for(n.smoothChildTiming=Ei(e.smoothChildTiming),Bn.remove(n),n._dp=0,n._time=n._tTime=Bn._time,i=Bn._first;i;)a=i._next,(t||!(!i._dur&&i instanceof sr&&i.vars.onComplete===i._targets[0]))&&Po(n,i,i._start-i._delay),i=a;return Po(Bn,n,0),n},context:function(e,t){return e?new V5(e,t):In},matchMedia:function(e){return new d9(e)},matchMediaRefresh:function(){return gc.forEach(function(e){var t=e.conditions,n,i;for(i in t)t[i]&&(t[i]=!1,n=1);n&&e.revert()})||ub()},addEventListener:function(e,t){var n=Wy[e]||(Wy[e]=[]);~n.indexOf(t)||n.push(t)},removeEventListener:function(e,t){var n=Wy[e],i=n&&n.indexOf(t);i>=0&&n.splice(i,1)},utils:{wrap:$7,wrapYoyo:X7,distribute:x5,random:A5,snap:S5,normalize:W7,getUnit:ei,clamp:U7,splitColor:C5,toArray:La,selector:ob,mapRange:b5,pipe:G7,unitize:H7,interpolate:Y7,shuffle:_5},install:s5,effects:vx,ticker:qi,updateRoot:pi.updateRoot,plugins:Xi,globalTimeline:Bn,core:{PropTween:Pi,globals:l5,Tween:sr,Timeline:pi,Animation:xv,getCache:dc,_removeLinkedListItem:q_,reverting:function(){return kr},context:function(e){return e&&In&&(In.data.push(e),e._ctx=In),In},suppressOverwrites:function(e){return FM=e}}};Li("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return T0[r]=sr[r]});qi.add(pi.updateRoot);uf=T0.to({},{duration:0});var p9=function(e,t){for(var n=e._pt;n&&n.p!==t&&n.op!==t&&n.fp!==t;)n=n._next;return n},v9=function(e,t){var n=e._targets,i,a,o;for(i in t)for(a=n.length;a--;)o=e._ptLookup[a][i],o&&(o=o.d)&&(o._pt&&(o=p9(o,i)),o&&o.modifier&&o.modifier(t[i],e,n[a],i))},xx=function(e,t){return{name:e,headless:1,rawVars:1,init:function(i,a,o){o._onInit=function(s){var l,u;if(Er(a)&&(l={},Li(a,function(c){return l[c]=1}),a=l),t){l={};for(u in a)l[u]=t(a[u]);a=l}v9(s,a)}}}},ki=T0.registerPlugin({name:"attr",init:function(e,t,n,i,a){var o,s,l;this.tween=n;for(o in t)l=e.getAttribute(o)||"",s=this.add(e,"setAttribute",(l||0)+"",t[o],i,a,0,0,o),s.op=o,s.b=l,this._props.push(o)},render:function(e,t){for(var n=t._pt;n;)kr?n.set(n.t,n.p,n.b,n):n.r(e,n.d),n=n._next}},{name:"endArray",headless:1,init:function(e,t){for(var n=t.length;n--;)this.add(e,n,e[n]||0,t[n],0,0,0,0,0,1)}},xx("roundProps",sb),xx("modifiers"),xx("snap",S5))||T0;sr.version=pi.version=ki.version="3.14.2";o5=1;zM()&&Ff();Zt.Power0;Zt.Power1;Zt.Power2;Zt.Power3;Zt.Power4;Zt.Linear;Zt.Quad;Zt.Cubic;Zt.Quart;Zt.Quint;Zt.Strong;Zt.Elastic;Zt.Back;Zt.SteppedEase;Zt.Bounce;Zt.Sine;Zt.Expo;Zt.Circ;/*! * CSSPlugin 3.14.2 * https://gsap.com * * Copyright 2008-2025, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license * @author: Jack Doyle, jack@greensock.com */var SL,yl,xf,ZM,nc,AL,QM,g9=function(){return typeof window!="undefined"},Cs={},Gu=180/Math.PI,Sf=Math.PI/180,ah=Math.atan2,wL=1e8,JM=/([A-Z])/g,m9=/(left|right|width|margin|padding|x)/i,y9=/[\s,\(]\S/,ko={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},cb=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},_9=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},x9=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},S9=function(e,t){return t.set(t.t,t.p,e===1?t.e:e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},A9=function(e,t){var n=t.s+t.c*e;t.set(t.t,t.p,~~(n+(n<0?-.5:.5))+t.u,t)},G5=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},H5=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},w9=function(e,t,n){return e.style[t]=n},b9=function(e,t,n){return e.style.setProperty(t,n)},T9=function(e,t,n){return e._gsap[t]=n},M9=function(e,t,n){return e._gsap.scaleX=e._gsap.scaleY=n},C9=function(e,t,n,i,a){var o=e._gsap;o.scaleX=o.scaleY=n,o.renderTransform(a,o)},E9=function(e,t,n,i,a){var o=e._gsap;o[t]=n,o.renderTransform(a,o)},zn="transform",Ri=zn+"Origin",L9=function r(e,t){var n=this,i=this.target,a=i.style,o=i._gsap;if(e in Cs&&a){if(this.tfm=this.tfm||{},e!=="transform")e=ko[e]||e,~e.indexOf(",")?e.split(",").forEach(function(s){return n.tfm[s]=vs(i,s)}):this.tfm[e]=o.x?o[e]:vs(i,e),e===Ri&&(this.tfm.zOrigin=o.zOrigin);else return ko.transform.split(",").forEach(function(s){return r.call(n,s,t)});if(this.props.indexOf(zn)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Ri,t,"")),e=zn}(a||t)&&this.props.push(e,t,a[e])},W5=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},P9=function(){var e=this.props,t=this.target,n=t.style,i=t._gsap,a,o;for(a=0;a=0?bL[o]:"")+e},fb=function(){g9()&&window.document&&(SL=window,yl=SL.document,xf=yl.documentElement,nc=hb("div")||{style:{}},hb("div"),zn=Bf(zn),Ri=zn+"Origin",nc.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",X5=!!Bf("perspective"),QM=ki.core.reverting,ZM=1)},TL=function(e){var t=e.ownerSVGElement,n=hb("svg",t&&t.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=e.cloneNode(!0),a;i.style.display="block",n.appendChild(i),xf.appendChild(n);try{a=i.getBBox()}catch(o){}return n.removeChild(i),xf.removeChild(n),a},ML=function(e,t){for(var n=t.length;n--;)if(e.hasAttribute(t[n]))return e.getAttribute(t[n])},Y5=function(e){var t,n;try{t=e.getBBox()}catch(i){t=TL(e),n=1}return t&&(t.width||t.height)||n||(t=TL(e)),t&&!t.width&&!t.x&&!t.y?{x:+ML(e,["x","cx","x1"])||0,y:+ML(e,["y","cy","y1"])||0,width:0,height:0}:t},q5=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&Y5(e))},$l=function(e,t){if(t){var n=e.style,i;t in Cs&&t!==Ri&&(t=zn),n.removeProperty?(i=t.substr(0,2),(i==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),n.removeProperty(i==="--"?t:t.replace(JM,"-$1").toLowerCase())):n.removeAttribute(t)}},_l=function(e,t,n,i,a,o){var s=new Pi(e._pt,t,n,0,1,o?H5:G5);return e._pt=s,s.b=i,s.e=a,e._props.push(n),s},CL={deg:1,rad:1,turn:1},R9={grid:1,flex:1},Xl=function r(e,t,n,i){var a=parseFloat(n)||0,o=(n+"").trim().substr((a+"").length)||"px",s=nc.style,l=m9.test(t),u=e.tagName.toLowerCase()==="svg",c=(u?"client":"offset")+(l?"Width":"Height"),h=100,f=i==="px",d=i==="%",p,g,v,m;if(i===o||!a||CL[i]||CL[o])return a;if(o!=="px"&&!f&&(a=r(e,t,n,"px")),m=e.getCTM&&q5(e),(d||o==="%")&&(Cs[t]||~t.indexOf("adius")))return p=m?e.getBBox()[l?"width":"height"]:e[c],Jn(d?a/p*h:a/100*p);if(s[l?"width":"height"]=h+(f?o:i),g=i!=="rem"&&~t.indexOf("adius")||i==="em"&&e.appendChild&&!u?e:e.parentNode,m&&(g=(e.ownerSVGElement||{}).parentNode),(!g||g===yl||!g.appendChild)&&(g=yl.body),v=g._gsap,v&&d&&v.width&&l&&v.time===qi.time&&!v.uncache)return Jn(a/v.width*h);if(d&&(t==="height"||t==="width")){var y=e.style[t];e.style[t]=h+i,p=e[c],y?e.style[t]=y:$l(e,t)}else(d||o==="%")&&!R9[Zi(g,"display")]&&(s.position=Zi(e,"position")),g===e&&(s.position="static"),g.appendChild(nc),p=nc[c],g.removeChild(nc),s.position="absolute";return l&&d&&(v=dc(g),v.time=qi.time,v.width=g[c]),Jn(f?p*a/h:p&&a?h/p*a:0)},vs=function(e,t,n,i){var a;return ZM||fb(),t in ko&&t!=="transform"&&(t=ko[t],~t.indexOf(",")&&(t=t.split(",")[0])),Cs[t]&&t!=="transform"?(a=Av(e,i),a=t!=="transformOrigin"?a[t]:a.svg?a.origin:C0(Zi(e,Ri))+" "+a.zOrigin+"px"):(a=e.style[t],(!a||a==="auto"||i||~(a+"").indexOf("calc("))&&(a=M0[t]&&M0[t](e,t,n)||Zi(e,t)||c5(e,t)||(t==="opacity"?1:0))),n&&!~(a+"").trim().indexOf(" ")?Xl(e,t,a,n)+n:a},D9=function(e,t,n,i){if(!n||n==="none"){var a=Bf(t,e,1),o=a&&Zi(e,a,1);o&&o!==n?(t=a,n=o):t==="borderColor"&&(n=Zi(e,"borderTopColor"))}var s=new Pi(this._pt,e.style,t,0,1,z5),l=0,u=0,c,h,f,d,p,g,v,m,y,_,x,S;if(s.b=n,s.e=i,n+="",i+="",i.substring(0,6)==="var(--"&&(i=Zi(e,i.substring(4,i.indexOf(")")))),i==="auto"&&(g=e.style[t],e.style[t]=i,i=Zi(e,t)||i,g?e.style[t]=g:$l(e,t)),c=[n,i],L5(c),n=c[0],i=c[1],f=n.match(lf)||[],S=i.match(lf)||[],S.length){for(;h=lf.exec(i);)v=h[0],y=i.substring(l,h.index),p?p=(p+1)%5:(y.substr(-5)==="rgba("||y.substr(-5)==="hsla(")&&(p=1),v!==(g=f[u++]||"")&&(d=parseFloat(g)||0,x=g.substr((d+"").length),v.charAt(1)==="="&&(v=_f(d,v)+x),m=parseFloat(v),_=v.substr((m+"").length),l=lf.lastIndex-_.length,_||(_=_||ea.units[t]||x,l===i.length&&(i+=_,s.e+=_)),x!==_&&(d=Xl(e,t,g,_)||0),s._pt={_next:s._pt,p:y||u===1?y:",",s:d,c:m-d,m:p&&p<4||t==="zIndex"?Math.round:0});s.c=l-1;)s=a[u],Cs[s]&&(l=1,s=s==="transformOrigin"?Ri:zn),$l(n,s);l&&($l(n,zn),o&&(o.svg&&n.removeAttribute("transform"),i.scale=i.rotate=i.translate="none",Av(n,1),o.uncache=1,W5(i)))}},M0={clearProps:function(e,t,n,i,a){if(a.data!=="isFromStart"){var o=e._pt=new Pi(e._pt,t,n,0,0,N9);return o.u=i,o.pr=-10,o.tween=a,e._props.push(n),1}}},Sv=[1,0,0,1,0,0],j5={},K5=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},LL=function(e){var t=Zi(e,zn);return K5(t)?Sv:t.substr(7).match(i5).map(Jn)},eC=function(e,t){var n=e._gsap||dc(e),i=e.style,a=LL(e),o,s,l,u;return n.svg&&e.getAttribute("transform")?(l=e.transform.baseVal.consolidate().matrix,a=[l.a,l.b,l.c,l.d,l.e,l.f],a.join(",")==="1,0,0,1,0,0"?Sv:a):(a===Sv&&!e.offsetParent&&e!==xf&&!n.svg&&(l=i.display,i.display="block",o=e.parentNode,(!o||!e.offsetParent&&!e.getBoundingClientRect().width)&&(u=1,s=e.nextElementSibling,xf.appendChild(e)),a=LL(e),l?i.display=l:$l(e,"display"),u&&(s?o.insertBefore(e,s):o?o.appendChild(e):xf.removeChild(e))),t&&a.length>6?[a[0],a[1],a[4],a[5],a[12],a[13]]:a)},db=function(e,t,n,i,a,o){var s=e._gsap,l=a||eC(e,!0),u=s.xOrigin||0,c=s.yOrigin||0,h=s.xOffset||0,f=s.yOffset||0,d=l[0],p=l[1],g=l[2],v=l[3],m=l[4],y=l[5],_=t.split(" "),x=parseFloat(_[0])||0,S=parseFloat(_[1])||0,A,w,M,C;n?l!==Sv&&(w=d*v-p*g)&&(M=x*(v/w)+S*(-g/w)+(g*y-v*m)/w,C=x*(-p/w)+S*(d/w)-(d*y-p*m)/w,x=M,S=C):(A=Y5(e),x=A.x+(~_[0].indexOf("%")?x/100*A.width:x),S=A.y+(~(_[1]||_[0]).indexOf("%")?S/100*A.height:S)),i||i!==!1&&s.smooth?(m=x-u,y=S-c,s.xOffset=h+(m*d+y*g)-m,s.yOffset=f+(m*p+y*v)-y):s.xOffset=s.yOffset=0,s.xOrigin=x,s.yOrigin=S,s.smooth=!!i,s.origin=t,s.originIsAbsolute=!!n,e.style[Ri]="0px 0px",o&&(_l(o,s,"xOrigin",u,x),_l(o,s,"yOrigin",c,S),_l(o,s,"xOffset",h,s.xOffset),_l(o,s,"yOffset",f,s.yOffset)),e.setAttribute("data-svg-origin",x+" "+S)},Av=function(e,t){var n=e._gsap||new I5(e);if("x"in n&&!t&&!n.uncache)return n;var i=e.style,a=n.scaleX<0,o="px",s="deg",l=getComputedStyle(e),u=Zi(e,Ri)||"0",c,h,f,d,p,g,v,m,y,_,x,S,A,w,M,C,b,T,P,D,L,E,I,N,R,F,O,V,H,Q,W,Z;return c=h=f=g=v=m=y=_=x=0,d=p=1,n.svg=!!(e.getCTM&&q5(e)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(i[zn]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[zn]!=="none"?l[zn]:"")),i.scale=i.rotate=i.translate="none"),w=eC(e,n.svg),n.svg&&(n.uncache?(R=e.getBBox(),u=n.xOrigin-R.x+"px "+(n.yOrigin-R.y)+"px",N=""):N=!t&&e.getAttribute("data-svg-origin"),db(e,N||u,!!N||n.originIsAbsolute,n.smooth!==!1,w)),S=n.xOrigin||0,A=n.yOrigin||0,w!==Sv&&(T=w[0],P=w[1],D=w[2],L=w[3],c=E=w[4],h=I=w[5],w.length===6?(d=Math.sqrt(T*T+P*P),p=Math.sqrt(L*L+D*D),g=T||P?ah(P,T)*Gu:0,y=D||L?ah(D,L)*Gu+g:0,y&&(p*=Math.abs(Math.cos(y*Sf))),n.svg&&(c-=S-(S*T+A*D),h-=A-(S*P+A*L))):(Z=w[6],Q=w[7],O=w[8],V=w[9],H=w[10],W=w[11],c=w[12],h=w[13],f=w[14],M=ah(Z,H),v=M*Gu,M&&(C=Math.cos(-M),b=Math.sin(-M),N=E*C+O*b,R=I*C+V*b,F=Z*C+H*b,O=E*-b+O*C,V=I*-b+V*C,H=Z*-b+H*C,W=Q*-b+W*C,E=N,I=R,Z=F),M=ah(-D,H),m=M*Gu,M&&(C=Math.cos(-M),b=Math.sin(-M),N=T*C-O*b,R=P*C-V*b,F=D*C-H*b,W=L*b+W*C,T=N,P=R,D=F),M=ah(P,T),g=M*Gu,M&&(C=Math.cos(M),b=Math.sin(M),N=T*C+P*b,R=E*C+I*b,P=P*C-T*b,I=I*C-E*b,T=N,E=R),v&&Math.abs(v)+Math.abs(g)>359.9&&(v=g=0,m=180-m),d=Jn(Math.sqrt(T*T+P*P+D*D)),p=Jn(Math.sqrt(I*I+Z*Z)),M=ah(E,I),y=Math.abs(M)>2e-4?M*Gu:0,x=W?1/(W<0?-W:W):0),n.svg&&(N=e.getAttribute("transform"),n.forceCSS=e.setAttribute("transform","")||!K5(Zi(e,zn)),N&&e.setAttribute("transform",N))),Math.abs(y)>90&&Math.abs(y)<270&&(a?(d*=-1,y+=g<=0?180:-180,g+=g<=0?180:-180):(p*=-1,y+=y<=0?180:-180)),t=t||n.uncache,n.x=c-((n.xPercent=c&&(!t&&n.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-c)?-50:0)))?e.offsetWidth*n.xPercent/100:0)+o,n.y=h-((n.yPercent=h&&(!t&&n.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-h)?-50:0)))?e.offsetHeight*n.yPercent/100:0)+o,n.z=f+o,n.scaleX=Jn(d),n.scaleY=Jn(p),n.rotation=Jn(g)+s,n.rotationX=Jn(v)+s,n.rotationY=Jn(m)+s,n.skewX=y+s,n.skewY=_+s,n.transformPerspective=x+o,(n.zOrigin=parseFloat(u.split(" ")[2])||!t&&n.zOrigin||0)&&(i[Ri]=C0(u)),n.xOffset=n.yOffset=0,n.force3D=ea.force3D,n.renderTransform=n.svg?O9:X5?Z5:k9,n.uncache=0,n},C0=function(e){return(e=e.split(" "))[0]+" "+e[1]},Sx=function(e,t,n){var i=ei(t);return Jn(parseFloat(t)+parseFloat(Xl(e,"x",n+"px",i)))+i},k9=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,Z5(e,t)},hu="0deg",Dd="0px",fu=") ",Z5=function(e,t){var n=t||this,i=n.xPercent,a=n.yPercent,o=n.x,s=n.y,l=n.z,u=n.rotation,c=n.rotationY,h=n.rotationX,f=n.skewX,d=n.skewY,p=n.scaleX,g=n.scaleY,v=n.transformPerspective,m=n.force3D,y=n.target,_=n.zOrigin,x="",S=m==="auto"&&e&&e!==1||m===!0;if(_&&(h!==hu||c!==hu)){var A=parseFloat(c)*Sf,w=Math.sin(A),M=Math.cos(A),C;A=parseFloat(h)*Sf,C=Math.cos(A),o=Sx(y,o,w*C*-_),s=Sx(y,s,-Math.sin(A)*-_),l=Sx(y,l,M*C*-_+_)}v!==Dd&&(x+="perspective("+v+fu),(i||a)&&(x+="translate("+i+"%, "+a+"%) "),(S||o!==Dd||s!==Dd||l!==Dd)&&(x+=l!==Dd||S?"translate3d("+o+", "+s+", "+l+") ":"translate("+o+", "+s+fu),u!==hu&&(x+="rotate("+u+fu),c!==hu&&(x+="rotateY("+c+fu),h!==hu&&(x+="rotateX("+h+fu),(f!==hu||d!==hu)&&(x+="skew("+f+", "+d+fu),(p!==1||g!==1)&&(x+="scale("+p+", "+g+fu),y.style[zn]=x||"translate(0, 0)"},O9=function(e,t){var n=t||this,i=n.xPercent,a=n.yPercent,o=n.x,s=n.y,l=n.rotation,u=n.skewX,c=n.skewY,h=n.scaleX,f=n.scaleY,d=n.target,p=n.xOrigin,g=n.yOrigin,v=n.xOffset,m=n.yOffset,y=n.forceCSS,_=parseFloat(o),x=parseFloat(s),S,A,w,M,C;l=parseFloat(l),u=parseFloat(u),c=parseFloat(c),c&&(c=parseFloat(c),u+=c,l+=c),l||u?(l*=Sf,u*=Sf,S=Math.cos(l)*h,A=Math.sin(l)*h,w=Math.sin(l-u)*-f,M=Math.cos(l-u)*f,u&&(c*=Sf,C=Math.tan(u-c),C=Math.sqrt(1+C*C),w*=C,M*=C,c&&(C=Math.tan(c),C=Math.sqrt(1+C*C),S*=C,A*=C)),S=Jn(S),A=Jn(A),w=Jn(w),M=Jn(M)):(S=h,M=f,A=w=0),(_&&!~(o+"").indexOf("px")||x&&!~(s+"").indexOf("px"))&&(_=Xl(d,"x",o,"px"),x=Xl(d,"y",s,"px")),(p||g||v||m)&&(_=Jn(_+p-(p*S+g*w)+v),x=Jn(x+g-(p*A+g*M)+m)),(i||a)&&(C=d.getBBox(),_=Jn(_+i/100*C.width),x=Jn(x+a/100*C.height)),C="matrix("+S+","+A+","+w+","+M+","+_+","+x+")",d.setAttribute("transform",C),y&&(d.style[zn]=C)},F9=function(e,t,n,i,a){var o=360,s=Er(a),l=parseFloat(a)*(s&&~a.indexOf("rad")?Gu:1),u=l-i,c=i+u+"deg",h,f;return s&&(h=a.split("_")[1],h==="short"&&(u%=o,u!==u%(o/2)&&(u+=u<0?o:-o)),h==="cw"&&u<0?u=(u+o*wL)%o-~~(u/o)*o:h==="ccw"&&u>0&&(u=(u-o*wL)%o-~~(u/o)*o)),e._pt=f=new Pi(e._pt,t,n,i,u,_9),f.e=c,f.u="deg",e._props.push(n),f},PL=function(e,t){for(var n in t)e[n]=t[n];return e},B9=function(e,t,n){var i=PL({},n._gsap),a="perspective,force3D,transformOrigin,svgOrigin",o=n.style,s,l,u,c,h,f,d,p;i.svg?(u=n.getAttribute("transform"),n.setAttribute("transform",""),o[zn]=t,s=Av(n,1),$l(n,zn),n.setAttribute("transform",u)):(u=getComputedStyle(n)[zn],o[zn]=t,s=Av(n,1),o[zn]=u);for(l in Cs)u=i[l],c=s[l],u!==c&&a.indexOf(l)<0&&(d=ei(u),p=ei(c),h=d!==p?Xl(n,l,u,p):parseFloat(u),f=parseFloat(c),e._pt=new Pi(e._pt,s,l,h,f-h,cb),e._pt.u=p||0,e._props.push(l));PL(s,i)};Li("padding,margin,Width,Radius",function(r,e){var t="Top",n="Right",i="Bottom",a="Left",o=(e<3?[t,n,i,a]:[t+a,t+n,i+n,i+a]).map(function(s){return e<2?r+s:"border"+s+r});M0[e>1?"border"+r:r]=function(s,l,u,c,h){var f,d;if(arguments.length<4)return f=o.map(function(p){return vs(s,p,u)}),d=f.join(" "),d.split(f[0]).length===5?f[0]:d;f=(c+"").split(" "),d={},o.forEach(function(p,g){return d[p]=f[g]=f[g]||f[(g-1)/2|0]}),s.init(l,d,h)}});var Q5={name:"css",register:fb,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,n,i,a){var o=this._props,s=e.style,l=n.vars.startAt,u,c,h,f,d,p,g,v,m,y,_,x,S,A,w,M,C;ZM||fb(),this.styles=this.styles||$5(e),M=this.styles.props,this.tween=n;for(g in t)if(g!=="autoRound"&&(c=t[g],!(Xi[g]&&N5(g,t,n,i,e,a)))){if(d=typeof c,p=M0[g],d==="function"&&(c=c.call(n,i,e,a),d=typeof c),d==="string"&&~c.indexOf("random(")&&(c=yv(c)),p)p(this,e,g,c,n)&&(w=1);else if(g.substr(0,2)==="--")u=(getComputedStyle(e).getPropertyValue(g)+"").trim(),c+="",Nl.lastIndex=0,Nl.test(u)||(v=ei(u),m=ei(c),m?v!==m&&(u=Xl(e,g,u,m)+m):v&&(c+=v)),this.add(s,"setProperty",u,c,i,a,0,0,g),o.push(g),M.push(g,0,s[g]);else if(d!=="undefined"){if(l&&g in l?(u=typeof l[g]=="function"?l[g].call(n,i,e,a):l[g],Er(u)&&~u.indexOf("random(")&&(u=yv(u)),ei(u+"")||u==="auto"||(u+=ea.units[g]||ei(vs(e,g))||""),(u+"").charAt(1)==="="&&(u=vs(e,g))):u=vs(e,g),f=parseFloat(u),y=d==="string"&&c.charAt(1)==="="&&c.substr(0,2),y&&(c=c.substr(2)),h=parseFloat(c),g in ko&&(g==="autoAlpha"&&(f===1&&vs(e,"visibility")==="hidden"&&h&&(f=0),M.push("visibility",0,s.visibility),_l(this,s,"visibility",f?"inherit":"hidden",h?"inherit":"hidden",!h)),g!=="scale"&&g!=="transform"&&(g=ko[g],~g.indexOf(",")&&(g=g.split(",")[0]))),_=g in Cs,_){if(this.styles.save(g),C=c,d==="string"&&c.substring(0,6)==="var(--"){if(c=Zi(e,c.substring(4,c.indexOf(")"))),c.substring(0,5)==="calc("){var b=e.style.perspective;e.style.perspective=c,c=Zi(e,"perspective"),b?e.style.perspective=b:$l(e,"perspective")}h=parseFloat(c)}if(x||(S=e._gsap,S.renderTransform&&!t.parseTransform||Av(e,t.parseTransform),A=t.smoothOrigin!==!1&&S.smooth,x=this._pt=new Pi(this._pt,s,zn,0,1,S.renderTransform,S,0,-1),x.dep=1),g==="scale")this._pt=new Pi(this._pt,S,"scaleY",S.scaleY,(y?_f(S.scaleY,y+h):h)-S.scaleY||0,cb),this._pt.u=0,o.push("scaleY",g),g+="X";else if(g==="transformOrigin"){M.push(Ri,0,s[Ri]),c=I9(c),S.svg?db(e,c,0,A,0,this):(m=parseFloat(c.split(" ")[2])||0,m!==S.zOrigin&&_l(this,S,"zOrigin",S.zOrigin,m),_l(this,s,g,C0(u),C0(c)));continue}else if(g==="svgOrigin"){db(e,c,1,A,0,this);continue}else if(g in j5){F9(this,S,g,f,y?_f(f,y+c):c);continue}else if(g==="smoothOrigin"){_l(this,S,"smooth",S.smooth,c);continue}else if(g==="force3D"){S[g]=c;continue}else if(g==="transform"){B9(this,c,e);continue}}else g in s||(g=Bf(g)||g);if(_||(h||h===0)&&(f||f===0)&&!y9.test(c)&&g in s)v=(u+"").substr((f+"").length),h||(h=0),m=ei(c)||(g in ea.units?ea.units[g]:v),v!==m&&(f=Xl(e,g,u,m)),this._pt=new Pi(this._pt,_?S:s,g,f,(y?_f(f,y+h):h)-f,!_&&(m==="px"||g==="zIndex")&&t.autoRound!==!1?A9:cb),this._pt.u=m||0,_&&C!==c?(this._pt.b=u,this._pt.e=C,this._pt.r=S9):v!==m&&m!=="%"&&(this._pt.b=u,this._pt.r=x9);else if(g in s)D9.call(this,e,g,u,y?y+c:c);else if(g in e)this.add(e,g,u||e[g],y?y+c:c,i,a);else if(g!=="parseTransform"){VM(g,c);continue}_||(g in s?M.push(g,0,s[g]):typeof e[g]=="function"?M.push(g,2,e[g]()):M.push(g,1,u||e[g])),o.push(g)}}w&&U5(this)},render:function(e,t){if(t.tween._time||!QM())for(var n=t._pt;n;)n.r(e,n.d),n=n._next;else t.styles.revert()},get:vs,aliases:ko,getSetter:function(e,t,n){var i=ko[t];return i&&i.indexOf(",")<0&&(t=i),t in Cs&&t!==Ri&&(e._gsap.x||vs(e,"x"))?n&&AL===n?t==="scale"?M9:T9:(AL=n||{})&&(t==="scale"?C9:E9):e.style&&!BM(e.style[t])?w9:~t.indexOf("-")?b9:jM(e,t)},core:{_removeProperty:$l,_getMatrix:eC}};ki.utils.checkPrefix=Bf;ki.core.getStyleSaver=$5;(function(r,e,t,n){var i=Li(r+","+e+","+t,function(a){Cs[a]=1});Li(e,function(a){ea.units[a]="deg",j5[a]=1}),ko[i[13]]=r+","+e,Li(n,function(a){var o=a.split(":");ko[o[1]]=i[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");Li("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){ea.units[r]="px"});ki.registerPlugin(Q5);var $n=ki.registerPlugin(Q5)||ki;$n.core.Tween;const z9={name:"SvglineAnimation",props:{width:{type:Number,default:135},height:{type:Number,default:150},path:{type:String,default:"M0 72.5H682L732 0.5H3082"},color:{type:String,default:"#0091FF"},duration:{type:Number,default:3},length:{type:Number,default:100},begin:{type:Number,default:0},dir:{type:Array,default:()=>[0,1]},strokeWidth:{type:Number,default:4}},data(){let r=1;return{maskId:"svgline-"+r,radialGradientId:"radialGradient-"+r}},mounted(){let r=this._.uid;this.maskId="svgline-"+r,this.radialGradientId="radialGradient-"+r}},U9={class:"svg-line-animation"},V9=["viewBox"],G9=["id"],H9=["stop-opacity"],W9=["stop-opacity"],$9=["id"],X9=["r","fill"],Y9=["begin","dur","path","keyPoints"],q9=["d","stroke","stroke-width","mask"];function j9(r,e,t,n,i,a){return ie(),oe("div",U9,[(ie(),oe("svg",{width:"100%",height:"100%",viewBox:`0 0 ${t.width} ${t.height}`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},[G("defs",null,[G("radialGradient",{id:i.radialGradientId,cx:"50%",cy:"50%",fx:"100%",fy:"50%",r:"50%"},[G("stop",{offset:"0%","stop-color":"#fff","stop-opacity":t.dir[1]},null,8,H9),G("stop",{offset:"100%","stop-color":"#fff","stop-opacity":t.dir[0]},null,8,W9)],8,G9),G("mask",{id:i.maskId},[G("circle",{r:t.length,cx:"0",cy:"0",fill:`url(#${i.radialGradientId})`},[G("animateMotion",{begin:`${t.begin}s`,dur:`${t.duration}s`,path:t.path,rotate:"auto",keyPoints:`${t.dir[0]};${t.dir[1]}`,keyTimes:"0;1",repeatCount:"indefinite"},null,8,Y9)],8,X9)],8,$9)]),G("path",{class:"path-line",d:t.path,stroke:t.color,"stroke-width":t.strokeWidth,mask:`url(#${i.maskId})`},null,8,q9)],8,V9))])}const E0=OM(z9,[["render",j9]]);const K9={class:"m-header"},Z9={class:"m-header-wrap"},Q9={class:"m-header-title"},J9={class:"m-header-subtext"},e$={class:"m-header-left",style:{color:"#fff"}},t$={class:"m-header-right"},n$={class:"m-header-line"},r$={__name:"index",props:{title:{type:String,default:"数据可视化大屏"},subText:{type:String,default:"Visualization Platform"}},setup(r){return(e,t)=>(ie(),oe("div",K9,[G("div",Z9,[G("div",Q9,Te(r.title),1),G("div",J9,Te(r.subText),1)]),G("div",e$,[Df(e.$slots,"left")]),G("div",t$,[Df(e.$slots,"right")]),G("div",n$,[$e(E0,{class:"m-header-line-left",width:961,height:79,color:"#30DCFF",strokeWidth:2,dir:[0,1],length:100,path:"M1 1.52783L535 25.6808C552.73 26.5835 571.454 31.3851 588.834 39.2194C593.758 41.4385 598.692 43.7289 603.643 46.0273C633.567 59.9182 664.121 74.1016 696.754 74.6262C696.765 74.6264 696.775 74.6265 696.786 74.6267C821.602 76.5993 879.336 78 961 78"}),$e(E0,{class:"m-header-line-right",width:961,height:79,color:"#30DCFF",strokeWidth:2,dir:[0,1],length:100,path:"M1 1.52783L535 25.6808C552.73 26.5835 571.454 31.3851 588.834 39.2194C593.758 41.4385 598.692 43.7289 603.643 46.0273C633.567 59.9182 664.121 74.1016 696.754 74.6262C696.765 74.6264 696.775 74.6265 696.786 74.6267C821.602 76.5993 879.336 78 961 78"})])]))}};const i$={class:"m-menu"},a$={__name:"index",props:{defaultActive:{type:[String,Number],default:""}},emits:["select"],setup(r,{emit:e}){const t=e,n=r,i=tt(n.defaultActive);return uL("updateActive",o=>{i.value=o,t("select",o)}),uL("activeIndex",i),ni(()=>n.defaultActive,o=>{o!==i.value&&(i.value=o)}),(o,s)=>(ie(),oe("div",i$,[Df(o.$slots,"default")]))}},o$={__name:"index",props:{index:{type:[String,Number],required:!0}},setup(r){const e=r,t=sf("updateActive"),n=sf("activeIndex"),i=()=>{t(e.index)};return(a,o)=>(ie(),oe("div",{class:Vt(["m-menu-item",{"is-active":r.index===_n(n)}]),onClick:i},[Df(a.$slots,"default")],2))}};let RL=0;const DL="webkit moz ms o".split(" ");let Mo,Co;const s$=typeof window=="undefined";if(s$)Mo=function(){},Co=function(){};else{Mo=window.requestAnimationFrame,Co=window.cancelAnimationFrame;let r;for(let e=0;e{e(t+n)},n);return RL=t+n,i},Co=function(e){window.clearTimeout(e)})}const l$={props:{startVal:{type:Number,required:!1,default:0},endVal:{type:Number,required:!1,default:2017},duration:{type:Number,required:!1,default:3e3},autoplay:{type:Boolean,required:!1,default:!0},decimals:{type:Number,required:!1,default:0,validator(r){return r>=0}},decimal:{type:String,required:!1,default:"."},separator:{type:String,required:!1,default:","},prefix:{type:String,required:!1,default:""},suffix:{type:String,required:!1,default:""},useEasing:{type:Boolean,required:!1,default:!0},easingFn:{type:Function,default(r,e,t,n){return t*(-Math.pow(2,-10*r/n)+1)*1024/1023+e}}},data(){return{localStartVal:this.startVal,displayValue:this.formatNumber(this.startVal),printVal:null,paused:!1,localDuration:this.duration,startTime:null,timestamp:null,remaining:null,rAF:null}},computed:{countDown(){return this.startVal>this.endVal}},watch:{startVal(){this.autoplay&&this.start()},endVal(){this.autoplay&&this.start()}},mounted(){this.autoplay&&this.start(),this.$emit("mountedCallback")},methods:{start(){this.localStartVal=this.startVal,this.startTime=null,this.localDuration=this.duration,this.paused=!1,this.rAF=Mo(this.count)},pauseResume(){this.paused?(this.resume(),this.paused=!1):(this.pause(),this.paused=!0)},pause(){Co(this.rAF)},resume(){this.startTime=null,this.localDuration=+this.remaining,this.localStartVal=+this.printVal,Mo(this.count)},reset(){this.startTime=null,Co(this.rAF),this.displayValue=this.formatNumber(this.startVal)},count(r){this.startTime||(this.startTime=r),this.timestamp=r;const e=r-this.startTime;this.remaining=this.localDuration-e,this.useEasing?this.countDown?this.printVal=this.localStartVal-this.easingFn(e,0,this.localStartVal-this.endVal,this.localDuration):this.printVal=this.easingFn(e,this.localStartVal,this.endVal-this.localStartVal,this.localDuration):this.countDown?this.printVal=this.localStartVal-(this.localStartVal-this.endVal)*(e/this.localDuration):this.printVal=this.localStartVal+(this.endVal-this.localStartVal)*(e/this.localDuration),this.countDown?this.printVal=this.printValthis.endVal?this.endVal:this.printVal,this.displayValue=this.formatNumber(this.printVal),e1?this.decimal+e[1]:"",i=/(\d+)(\d{3})/;if(this.separator&&!this.isNumber(this.separator))for(;i.test(t);)t=t.replace(i,"$1"+this.separator+"$2");return this.prefix+t+n+this.suffix}},destroyed(){Co(this.rAF)}};function u$(r,e,t,n,i,a){return ie(),oe("span",null,Te(i.displayValue),1)}const J5=OM(l$,[["render",u$]]);typeof window!="undefined"&&window.Vue&&window.Vue.component("count-to",J5);const c$={class:"count-card-left"},h$={class:"count-card-title"},f$={class:"title-zh"},d$={key:0,class:"title-en"},p$={class:"count-card-right"},v$={class:"unit"},g$={__name:"index",props:{info:{type:Object,default:()=>({icon:"xiaoshoujine",zh:"2023年销售金额",en:"Sales amount in 2023",value:9500,unit:"万元",decimals:0})}},setup(r){const e=r,t=tt(!0),n=tt(!1),i=tt(0);let a=null;const o=Se(()=>e.info.duration||1800);ni(()=>[e.info.value,e.info.zh],()=>{a&&window.clearTimeout(a),t.value=!0,n.value=!1,i.value+=1},{immediate:!0});function s(c){return c.toUpperCase()}function l(){t.value=!0,n.value=!1}function u(){t.value=!1,n.value=!0,a&&window.clearTimeout(a),a=window.setTimeout(()=>{n.value=!1},900)}return uo(()=>{a&&window.clearTimeout(a)}),(c,h)=>(ie(),oe("div",{class:Vt(["count-card",{"is-counting":t.value,"is-settled":n.value}])},[G("div",c$,[G("div",{class:Vt(["count-card-icon","icon-"+r.info.icon])},null,2),G("div",h$,[G("div",f$,Te(r.info.zh),1),r.info.en?(ie(),oe("div",d$,Te(s(r.info.en)),1)):Tt("",!0)])]),G("div",p$,[(ie(),oe("div",{class:"value",key:i.value},[$e(_n(J5),{startVal:0,endVal:r.info.value,decimals:r.info.decimals,duration:o.value,separator:"",autoplay:!0,onMountedCallback:l,onCallback:u},null,8,["endVal","decimals","duration"])])),G("div",v$,Te(r.info.unit),1)])],2))}},m$=""+new URL("title-zs1-c15a5ee8-balabala-1782613078975.svg",import.meta.url).href,y$=""+new URL("saoguang-ccf84a88-balabala-1782613078975.svg",import.meta.url).href,_$=""+new URL("content-bottom-left-arrow-3a8a61f3-balabala-1782613078975.svg",import.meta.url).href,x$=""+new URL("content-bottom-right-arrow-a3c5270d-balabala-1782613078975.svg",import.meta.url).href,IL=""+new URL("content-middle-line-162bc0d5-balabala-1782613078975.svg",import.meta.url).href;const S$={class:"m-card-hd"},A$={class:"m-card-hd-bg"},w$=["width","viewBox"],b$=["clip-path"],T$=["width"],M$=["id"],C$=["d"],E$=["d","fill"],L$=["d","fill","mask"],P$=["clip-path"],R$=["x1"],D$=["id","x1"],I$=["id"],N$=["id"],k$=["width"],O$=["id"],F$={class:"m-card-hd-title"},B$=["width","height","viewBox"],z$={opacity:"0.6"},U$=["d"],V$=["d"],G$={class:"m-card-bd-content"},tn={__name:"index",props:{width:{type:Number,default:398},height:{type:Number,default:200},title:{type:String,default:"标题"}},setup(r){const e=r,t=tt(1),n=Se(()=>{let o=e.width;return`M165 0.5 L165.707 -0.207107 L165.414 -0.5 H165 V0.5Z M10 0.5 V-0.5 H9.58579 L9.29289 -0.207107 L10 0.5Z M175 10.5 L174.293 11.2071 L174.586 11.5 H175 V10.5Z M${o} 10.5 H${o+1} V9.5 H${o} V10.5Z M${o} 34.5 V35.5 H${o+1} V34.5 H${o}Z M0 34.5 H-1 V35.5 H0 V34.5Z M0 10.5 L-0.707107 9.79289 L-1 10.0858 V10.5 H0Z M165 -0.5 H10 V1.5 H165 V-0.5Z M175.707 9.79289 L165.707 -0.207107 L164.293 1.20711 L174.293 11.2071 L175.707 9.79289Z M${o} 9.5 H175 V11.5 H${o} V9.5Z M${o+1} 34.5 V10.5 H397 V34.5 H${o+1}Z M0 35.5 H${o} V33.5 H0 V35.5Z M-1 10.5 V34.5 H1 V10.5 H-1Z M9.29289 -0.207107 L-0.707107 9.79289 L0.707107 11.2071 L10.7071 1.20711 L9.29289 -0.207107Z`}),i=Se(()=>{let s=e.height-156,l=e.width;return`M3.485 ${46.0565+s/2} V${45.8735+s/2} L3.36682 ${45.7337+s/2} L0.5 ${42.343+s/2} V1 H${l-.5} V${42.3431+s/2} L${l-3.367} ${45.7337+s/2} L${l-3.485} ${45.8735+s/2} V${46.0565+s/2} L${l-3.367} ${88.745+s/2} L${l-.5} ${92.135+s/2} V${155+s} H0.5 V${92.135+s/2} L3.36682 ${88.745+s/2} L3.485 ${88.605+s/2} V${88.422+s/2} V${46.0565+s/2}Z`}),a=Se(()=>`width:${e.width}px;height:${e.height}px;`);return Ko(()=>{t.value="__"+QB().uid}),(o,s)=>(ie(),oe("div",{class:"m-card",style:un(a.value)},[G("div",S$,[G("div",A$,[(ie(),oe("svg",{width:r.width,height:"36",viewBox:`0 0 ${r.width} 36`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},[G("g",{"clip-path":`url(#clip0_70_69244${t.value})`},[G("rect",{y:"34.5",width:r.width,height:"1",fill:"url(#paint0_linear_70_69244)"},null,8,T$),G("mask",{id:`path-2-inside-1_70_69244${t.value}`,fill:"white"},[G("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:`M10 0.5H165L175 10.5H${r.width}V34.5H0V10.5L10 0.5Z`},null,8,C$)],8,M$),G("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:`M10 0.5H165L175 10.5H${r.width}V34.5H0V10.5L10 0.5Z`,fill:`url(#paint1_linear_70_69244${t.value})`},null,8,E$),G("path",{d:n.value,fill:`url(#paint2_linear_70_69244${t.value})`,mask:`url(#path-2-inside-1_70_69244${t.value})`},null,8,L$),s[1]||(s[1]=fc('',4)),G("g",{style:{"mix-blend-mode":"plus-lighter"},"clip-path":`url(#clip1_70_69244${t.value})`},[...s[0]||(s[0]=[fc('',4)])],8,P$)],8,b$),G("defs",null,[G("linearGradient",{id:"paint0_linear_70_69244",x1:r.width,y1:"35.5021",x2:"0",y2:"35.5021",gradientUnits:"userSpaceOnUse"},[...s[2]||(s[2]=[G("stop",{"stop-color":"#35A8EB","stop-opacity":"0.1"},null,-1),G("stop",{offset:"1","stop-color":"#30DCFF"},null,-1)])],8,R$),G("linearGradient",{id:`paint1_linear_70_69244${t.value}`,x1:r.width,y1:"17.5",x2:"7.94819",y2:"17.5",gradientUnits:"userSpaceOnUse"},[...s[3]||(s[3]=[G("stop",{offset:"0.0364889","stop-color":"#35A8EB","stop-opacity":"0.11"},null,-1),G("stop",{offset:"1","stop-color":"#30C1FF","stop-opacity":"0.27"},null,-1)])],8,D$),G("linearGradient",{id:`paint2_linear_70_69244${t.value}`,x1:"40.8948",y1:"13.5",x2:"40.895",y2:"-6.50005",gradientUnits:"userSpaceOnUse"},[...s[4]||(s[4]=[G("stop",{"stop-color":"#35A8EB","stop-opacity":"0"},null,-1),G("stop",{offset:"1","stop-color":"#30DCFF"},null,-1)])],8,I$),s[6]||(s[6]=fc('',8)),G("clipPath",{id:`clip0_70_69244${t.value}`},[G("rect",{width:r.width,height:"35",fill:"white",transform:"translate(0 0.5)"},null,8,k$)],8,N$),G("clipPath",{id:`clip1_70_69244${t.value}`},[...s[5]||(s[5]=[G("rect",{width:"130",height:"4",fill:"white",transform:"matrix(1 1.64302e-07 -0.0495776 -0.99877 28 4.5)"},null,-1)])],8,O$)])],8,w$))]),s[7]||(s[7]=G("img",{class:"m-card-hd-zs1",src:m$,alt:""},null,-1)),s[8]||(s[8]=G("div",{class:"saoguang"},[G("img",{src:y$,alt:""})],-1)),G("div",F$,Te(r.title),1)]),G("div",{class:"m-card-bd",style:un(a.value)},[G("div",{class:"m-card-bd-bg",style:un(a.value)},[(ie(),oe("svg",{width:r.width,height:r.height,viewBox:`0 0 ${r.width} ${r.height}`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},[G("g",z$,[G("path",{d:i.value,fill:"rgba(26, 57, 77,1)"},null,8,U$),G("path",{d:i.value,stroke:"url(#paint1_linear_70_69585)"},null,8,V$)]),s[9]||(s[9]=G("defs",null,[G("linearGradient",{id:"paint1_linear_70_69585",x1:"199",y1:"203.499",x2:"199",y2:"0.499359",gradientUnits:"userSpaceOnUse"},[G("stop",{"stop-color":"#4FC5DD"}),G("stop",{offset:"1","stop-color":"#05839D","stop-opacity":"0"})])],-1))],8,B$)),s[10]||(s[10]=G("img",{class:"m-card-bd-bottom-left-arrow",src:_$,alt:""},null,-1)),s[11]||(s[11]=G("img",{class:"m-card-bd-bottom-right-arrow",src:x$,alt:""},null,-1)),s[12]||(s[12]=G("img",{class:"m-card-bd-middle-left-line",src:IL,alt:""},null,-1)),s[13]||(s[13]=G("img",{class:"m-card-bd-middle-right-line",src:IL,alt:""},null,-1))],4),G("div",G$,[Df(o.$slots,"default")])],4)],4))}};/** * @license * Copyright 2010-2023 Three.js Authors * SPDX-License-Identifier: MIT */const tC="161",oh={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},sh={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},H$=0,NL=1,W$=2,ez=1,$$=2,hs=3,Es=0,Di=1,ur=2,kl=0,mc=1,Eo=2,kL=3,OL=4,tz=5,vl=100,X$=101,Y$=102,FL=103,BL=104,q$=200,nz=201,j$=202,K$=203,pb=204,vb=205,Z$=206,Q$=207,rz=208,J$=209,eX=210,tX=211,nX=212,rX=213,iX=214,aX=0,oX=1,sX=2,L0=3,lX=4,uX=5,cX=6,hX=7,nC=0,fX=1,dX=2,Ol=0,pX=1,vX=2,gX=3,mX=4,yX=5,_X=6,zL="attached",xX="detached",iz=300,zf=301,Uf=302,gb=303,mb=304,Z_=306,jr=1e3,ti=1001,P0=1002,vr=1003,yb=1004,Qh=1005,lr=1006,$y=1007,gs=1008,Fl=1009,SX=1010,AX=1011,rC=1012,az=1013,xl=1014,Ro=1015,wv=1016,oz=1017,sz=1018,yc=1020,wX=1021,ba=1023,bX=1024,TX=1025,_c=1026,Vf=1027,MX=1028,lz=1029,CX=1030,uz=1031,cz=1033,Ax=33776,bx=33777,Tx=33778,Mx=33779,UL=35840,VL=35841,GL=35842,HL=35843,hz=36196,WL=37492,$L=37496,XL=37808,YL=37809,qL=37810,jL=37811,KL=37812,ZL=37813,QL=37814,JL=37815,eP=37816,tP=37817,nP=37818,rP=37819,iP=37820,aP=37821,Cx=36492,oP=36494,sP=36495,EX=36283,lP=36284,uP=36285,cP=36286,bv=2300,Gf=2301,Ex=2302,hP=2400,fP=2401,dP=2402,LX=2500,PX=0,fz=1,_b=2,dz=3e3,xc=3001,RX=3200,DX=3201,iC=0,IX=1,Ta="",dn="srgb",yr="srgb-linear",aC="display-p3",Q_="display-p3-linear",R0="linear",Ln="srgb",D0="rec709",I0="p3",lh=7680,pP=519,NX=512,kX=513,OX=514,pz=515,FX=516,BX=517,zX=518,UX=519,xb=35044,vP="300 es",Sb=1035,ms=2e3,N0=2001;class Yc{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const a=i.indexOf(t);a!==-1&&i.splice(a,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let a=0,o=i.length;a>8&255]+Gr[r>>16&255]+Gr[r>>24&255]+"-"+Gr[e&255]+Gr[e>>8&255]+"-"+Gr[e>>16&15|64]+Gr[e>>24&255]+"-"+Gr[t&63|128]+Gr[t>>8&255]+"-"+Gr[t>>16&255]+Gr[t>>24&255]+Gr[n&255]+Gr[n>>8&255]+Gr[n>>16&255]+Gr[n>>24&255]).toLowerCase()}function hr(r,e,t){return Math.max(e,Math.min(t,r))}function oC(r,e){return(r%e+e)%e}function VX(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function GX(r,e,t){return r!==e?(t-r)/(e-r):0}function Yp(r,e,t){return(1-t)*r+t*e}function HX(r,e,t,n){return Yp(r,e,1-Math.exp(-t*n))}function WX(r,e=1){return e-Math.abs(oC(r,e*2)-e)}function $X(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function XX(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function YX(r,e){return r+Math.floor(Math.random()*(e-r+1))}function qX(r,e){return r+Math.random()*(e-r)}function jX(r){return r*(.5-Math.random())}function KX(r){r!==void 0&&(gP=r);let e=gP+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function ZX(r){return r*Xp}function QX(r){return r*Hf}function Ab(r){return(r&r-1)===0&&r!==0}function JX(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function k0(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function eY(r,e,t,n,i){const a=Math.cos,o=Math.sin,s=a(t/2),l=o(t/2),u=a((e+n)/2),c=o((e+n)/2),h=a((e-n)/2),f=o((e-n)/2),d=a((n-e)/2),p=o((n-e)/2);switch(i){case"XYX":r.set(s*c,l*h,l*f,s*u);break;case"YZY":r.set(l*f,s*c,l*h,s*u);break;case"ZXZ":r.set(l*h,l*f,s*c,s*u);break;case"XZX":r.set(s*c,l*p,l*d,s*u);break;case"YXY":r.set(l*d,s*c,l*p,s*u);break;case"ZYZ":r.set(l*p,l*d,s*c,s*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Ka(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function cn(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}const sC={DEG2RAD:Xp,RAD2DEG:Hf,generateUUID:Ra,clamp:hr,euclideanModulo:oC,mapLinear:VX,inverseLerp:GX,lerp:Yp,damp:HX,pingpong:WX,smoothstep:$X,smootherstep:XX,randInt:YX,randFloat:qX,randFloatSpread:jX,seededRandom:KX,degToRad:ZX,radToDeg:QX,isPowerOfTwo:Ab,ceilPowerOfTwo:JX,floorPowerOfTwo:k0,setQuaternionFromProperEuler:eY,normalize:cn,denormalize:Ka};class Me{constructor(e=0,t=0){Me.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(hr(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),a=this.x-e.x,o=this.y-e.y;return this.x=a*n-o*i+e.x,this.y=a*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ht{constructor(e,t,n,i,a,o,s,l,u){Ht.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,a,o,s,l,u)}set(e,t,n,i,a,o,s,l,u){const c=this.elements;return c[0]=e,c[1]=i,c[2]=s,c[3]=t,c[4]=a,c[5]=l,c[6]=n,c[7]=o,c[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,a=this.elements,o=n[0],s=n[3],l=n[6],u=n[1],c=n[4],h=n[7],f=n[2],d=n[5],p=n[8],g=i[0],v=i[3],m=i[6],y=i[1],_=i[4],x=i[7],S=i[2],A=i[5],w=i[8];return a[0]=o*g+s*y+l*S,a[3]=o*v+s*_+l*A,a[6]=o*m+s*x+l*w,a[1]=u*g+c*y+h*S,a[4]=u*v+c*_+h*A,a[7]=u*m+c*x+h*w,a[2]=f*g+d*y+p*S,a[5]=f*v+d*_+p*A,a[8]=f*m+d*x+p*w,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8];return t*o*c-t*s*u-n*a*c+n*s*l+i*a*u-i*o*l}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=c*o-s*u,f=s*l-c*a,d=u*a-o*l,p=t*h+n*f+i*d;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/p;return e[0]=h*g,e[1]=(i*u-c*n)*g,e[2]=(s*n-i*o)*g,e[3]=f*g,e[4]=(c*t-i*l)*g,e[5]=(i*a-s*t)*g,e[6]=d*g,e[7]=(n*l-u*t)*g,e[8]=(o*t-n*a)*g,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,a,o,s){const l=Math.cos(a),u=Math.sin(a);return this.set(n*l,n*u,-n*(l*o+u*s)+o+e,-i*u,i*l,-i*(-u*o+l*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(Lx.makeScale(e,t)),this}rotate(e){return this.premultiply(Lx.makeRotation(-e)),this}translate(e,t){return this.premultiply(Lx.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Lx=new Ht;function vz(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function Tv(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function tY(){const r=Tv("canvas");return r.style.display="block",r}const mP={};function Sc(r){r in mP||(mP[r]=!0,console.warn(r))}const yP=new Ht().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),_P=new Ht().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),$g={[yr]:{transfer:R0,primaries:D0,toReference:r=>r,fromReference:r=>r},[dn]:{transfer:Ln,primaries:D0,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[Q_]:{transfer:R0,primaries:I0,toReference:r=>r.applyMatrix3(_P),fromReference:r=>r.applyMatrix3(yP)},[aC]:{transfer:Ln,primaries:I0,toReference:r=>r.convertSRGBToLinear().applyMatrix3(_P),fromReference:r=>r.applyMatrix3(yP).convertLinearToSRGB()}},nY=new Set([yr,Q_]),ln={enabled:!0,_workingColorSpace:yr,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!nY.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,e,t){if(this.enabled===!1||e===t||!e||!t)return r;const n=$g[e].toReference,i=$g[t].fromReference;return i(n(r))},fromWorkingColorSpace:function(r,e){return this.convert(r,this._workingColorSpace,e)},toWorkingColorSpace:function(r,e){return this.convert(r,e,this._workingColorSpace)},getPrimaries:function(r){return $g[r].primaries},getTransfer:function(r){return r===Ta?R0:$g[r].transfer}};function Af(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function Px(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let uh;class gz{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{uh===void 0&&(uh=Tv("canvas")),uh.width=e.width,uh.height=e.height;const n=uh.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=uh}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap){const t=Tv("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),a=i.data;for(let o=0;o0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==iz)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case jr:e.x=e.x-Math.floor(e.x);break;case ti:e.x=e.x<0?0:1;break;case P0:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case jr:e.y=e.y-Math.floor(e.y);break;case ti:e.y=e.y<0?0:1;break;case P0:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return Sc("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===dn?xc:dz}set encoding(e){Sc("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===xc?dn:Ta}}mr.DEFAULT_IMAGE=null;mr.DEFAULT_MAPPING=iz;mr.DEFAULT_ANISOTROPY=1;class an{constructor(e=0,t=0,n=0,i=1){an.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,a=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*a,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*a,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*a,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*a,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,a;const l=e.elements,u=l[0],c=l[4],h=l[8],f=l[1],d=l[5],p=l[9],g=l[2],v=l[6],m=l[10];if(Math.abs(c-f)<.01&&Math.abs(h-g)<.01&&Math.abs(p-v)<.01){if(Math.abs(c+f)<.1&&Math.abs(h+g)<.1&&Math.abs(p+v)<.1&&Math.abs(u+d+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const _=(u+1)/2,x=(d+1)/2,S=(m+1)/2,A=(c+f)/4,w=(h+g)/4,M=(p+v)/4;return _>x&&_>S?_<.01?(n=0,i=.707106781,a=.707106781):(n=Math.sqrt(_),i=A/n,a=w/n):x>S?x<.01?(n=.707106781,i=0,a=.707106781):(i=Math.sqrt(x),n=A/i,a=M/i):S<.01?(n=.707106781,i=.707106781,a=0):(a=Math.sqrt(S),n=w/a,i=M/a),this.set(n,i,a,t),this}let y=Math.sqrt((v-p)*(v-p)+(h-g)*(h-g)+(f-c)*(f-c));return Math.abs(y)<.001&&(y=1),this.x=(v-p)/y,this.y=(h-g)/y,this.z=(f-c)/y,this.w=Math.acos((u+d+m-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class aY extends Yc{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new an(0,0,e,t),this.scissorTest=!1,this.viewport=new an(0,0,e,t);const i={width:e,height:t,depth:1};n.encoding!==void 0&&(Sc("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===xc?dn:Ta),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:lr,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},n),this.texture=new mr(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=n.generateMipmaps,this.texture.internalFormat=n.internalFormat,this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}setSize(e,t,n=1){(this.width!==e||this.height!==t||this.depth!==n)&&(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new mz(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class kc extends aY{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class yz extends mr{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=vr,this.minFilter=vr,this.wrapR=ti,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class oY extends mr{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=vr,this.minFilter=vr,this.wrapR=ti,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ao{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,a,o,s){let l=n[i+0],u=n[i+1],c=n[i+2],h=n[i+3];const f=a[o+0],d=a[o+1],p=a[o+2],g=a[o+3];if(s===0){e[t+0]=l,e[t+1]=u,e[t+2]=c,e[t+3]=h;return}if(s===1){e[t+0]=f,e[t+1]=d,e[t+2]=p,e[t+3]=g;return}if(h!==g||l!==f||u!==d||c!==p){let v=1-s;const m=l*f+u*d+c*p+h*g,y=m>=0?1:-1,_=1-m*m;if(_>Number.EPSILON){const S=Math.sqrt(_),A=Math.atan2(S,m*y);v=Math.sin(v*A)/S,s=Math.sin(s*A)/S}const x=s*y;if(l=l*v+f*x,u=u*v+d*x,c=c*v+p*x,h=h*v+g*x,v===1-s){const S=1/Math.sqrt(l*l+u*u+c*c+h*h);l*=S,u*=S,c*=S,h*=S}}e[t]=l,e[t+1]=u,e[t+2]=c,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,a,o){const s=n[i],l=n[i+1],u=n[i+2],c=n[i+3],h=a[o],f=a[o+1],d=a[o+2],p=a[o+3];return e[t]=s*p+c*h+l*d-u*f,e[t+1]=l*p+c*f+u*h-s*d,e[t+2]=u*p+c*d+s*f-l*h,e[t+3]=c*p-s*h-l*f-u*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,i=e._y,a=e._z,o=e._order,s=Math.cos,l=Math.sin,u=s(n/2),c=s(i/2),h=s(a/2),f=l(n/2),d=l(i/2),p=l(a/2);switch(o){case"XYZ":this._x=f*c*h+u*d*p,this._y=u*d*h-f*c*p,this._z=u*c*p+f*d*h,this._w=u*c*h-f*d*p;break;case"YXZ":this._x=f*c*h+u*d*p,this._y=u*d*h-f*c*p,this._z=u*c*p-f*d*h,this._w=u*c*h+f*d*p;break;case"ZXY":this._x=f*c*h-u*d*p,this._y=u*d*h+f*c*p,this._z=u*c*p+f*d*h,this._w=u*c*h-f*d*p;break;case"ZYX":this._x=f*c*h-u*d*p,this._y=u*d*h+f*c*p,this._z=u*c*p-f*d*h,this._w=u*c*h+f*d*p;break;case"YZX":this._x=f*c*h+u*d*p,this._y=u*d*h+f*c*p,this._z=u*c*p-f*d*h,this._w=u*c*h-f*d*p;break;case"XZY":this._x=f*c*h-u*d*p,this._y=u*d*h-f*c*p,this._z=u*c*p+f*d*h,this._w=u*c*h+f*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],a=t[8],o=t[1],s=t[5],l=t[9],u=t[2],c=t[6],h=t[10],f=n+s+h;if(f>0){const d=.5/Math.sqrt(f+1);this._w=.25/d,this._x=(c-l)*d,this._y=(a-u)*d,this._z=(o-i)*d}else if(n>s&&n>h){const d=2*Math.sqrt(1+n-s-h);this._w=(c-l)/d,this._x=.25*d,this._y=(i+o)/d,this._z=(a+u)/d}else if(s>h){const d=2*Math.sqrt(1+s-n-h);this._w=(a-u)/d,this._x=(i+o)/d,this._y=.25*d,this._z=(l+c)/d}else{const d=2*Math.sqrt(1+h-n-s);this._w=(o-i)/d,this._x=(a+u)/d,this._y=(l+c)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(hr(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,a=e._z,o=e._w,s=t._x,l=t._y,u=t._z,c=t._w;return this._x=n*c+o*s+i*u-a*l,this._y=i*c+o*l+a*s-n*u,this._z=a*c+o*u+n*l-i*s,this._w=o*c-n*s-i*l-a*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,a=this._z,o=this._w;let s=o*e._w+n*e._x+i*e._y+a*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=o,this._x=n,this._y=i,this._z=a,this;const l=1-s*s;if(l<=Number.EPSILON){const d=1-t;return this._w=d*o+t*this._w,this._x=d*n+t*this._x,this._y=d*i+t*this._y,this._z=d*a+t*this._z,this.normalize(),this}const u=Math.sqrt(l),c=Math.atan2(u,s),h=Math.sin((1-t)*c)/u,f=Math.sin(t*c)/u;return this._w=o*h+this._w*f,this._x=n*h+this._x*f,this._y=i*h+this._y*f,this._z=a*h+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),i=2*Math.PI*Math.random(),a=2*Math.PI*Math.random();return this.set(t*Math.cos(i),n*Math.sin(a),n*Math.cos(a),t*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class X{constructor(e=0,t=0,n=0){X.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(xP.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(xP.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,a=e.elements;return this.x=a[0]*t+a[3]*n+a[6]*i,this.y=a[1]*t+a[4]*n+a[7]*i,this.z=a[2]*t+a[5]*n+a[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,a=e.elements,o=1/(a[3]*t+a[7]*n+a[11]*i+a[15]);return this.x=(a[0]*t+a[4]*n+a[8]*i+a[12])*o,this.y=(a[1]*t+a[5]*n+a[9]*i+a[13])*o,this.z=(a[2]*t+a[6]*n+a[10]*i+a[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,a=e.x,o=e.y,s=e.z,l=e.w,u=2*(o*i-s*n),c=2*(s*t-a*i),h=2*(a*n-o*t);return this.x=t+l*u+o*h-s*c,this.y=n+l*c+s*u-a*h,this.z=i+l*h+a*c-o*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i,this.y=a[1]*t+a[5]*n+a[9]*i,this.z=a[2]*t+a[6]*n+a[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,a=e.z,o=t.x,s=t.y,l=t.z;return this.x=i*l-a*s,this.y=a*o-n*l,this.z=n*s-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Dx.copy(this).projectOnVector(e),this.sub(Dx)}reflect(e){return this.sub(Dx.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(hr(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,n=Math.sqrt(1-cu(e,2));return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Dx=new X,xP=new ao;class Oa{constructor(e=new X(1/0,1/0,1/0),t=new X(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Va),Va.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Id),Yg.subVectors(this.max,Id),ch.subVectors(e.a,Id),hh.subVectors(e.b,Id),fh.subVectors(e.c,Id),Gs.subVectors(hh,ch),Hs.subVectors(fh,hh),du.subVectors(ch,fh);let t=[0,-Gs.z,Gs.y,0,-Hs.z,Hs.y,0,-du.z,du.y,Gs.z,0,-Gs.x,Hs.z,0,-Hs.x,du.z,0,-du.x,-Gs.y,Gs.x,0,-Hs.y,Hs.x,0,-du.y,du.x,0];return!Ix(t,ch,hh,fh,Yg)||(t=[1,0,0,0,1,0,0,0,1],!Ix(t,ch,hh,fh,Yg))?!1:(qg.crossVectors(Gs,Hs),t=[qg.x,qg.y,qg.z],Ix(t,ch,hh,fh,Yg))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Va).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Va).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(ns[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ns[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ns[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ns[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ns[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ns[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ns[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ns[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ns),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const ns=[new X,new X,new X,new X,new X,new X,new X,new X],Va=new X,Xg=new Oa,ch=new X,hh=new X,fh=new X,Gs=new X,Hs=new X,du=new X,Id=new X,Yg=new X,qg=new X,pu=new X;function Ix(r,e,t,n,i){for(let a=0,o=r.length-3;a<=o;a+=3){pu.fromArray(r,a);const s=i.x*Math.abs(pu.x)+i.y*Math.abs(pu.y)+i.z*Math.abs(pu.z),l=e.dot(pu),u=t.dot(pu),c=n.dot(pu);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>s)return!1}return!0}const sY=new Oa,Nd=new X,Nx=new X;class Fa{constructor(e=new X,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):sY.setFromPoints(e).getCenter(n);let i=0;for(let a=0,o=e.length;athis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Nd.subVectors(e,this.center);const t=Nd.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(Nd,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Nx.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Nd.copy(e.center).add(Nx)),this.expandByPoint(Nd.copy(e.center).sub(Nx))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const rs=new X,kx=new X,jg=new X,Ws=new X,Ox=new X,Kg=new X,Fx=new X;class sd{constructor(e=new X,t=new X(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,rs)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=rs.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(rs.copy(this.origin).addScaledVector(this.direction,t),rs.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){kx.copy(e).add(t).multiplyScalar(.5),jg.copy(t).sub(e).normalize(),Ws.copy(this.origin).sub(kx);const a=e.distanceTo(t)*.5,o=-this.direction.dot(jg),s=Ws.dot(this.direction),l=-Ws.dot(jg),u=Ws.lengthSq(),c=Math.abs(1-o*o);let h,f,d,p;if(c>0)if(h=o*l-s,f=o*s-l,p=a*c,h>=0)if(f>=-p)if(f<=p){const g=1/c;h*=g,f*=g,d=h*(h+o*f+2*s)+f*(o*h+f+2*l)+u}else f=a,h=Math.max(0,-(o*f+s)),d=-h*h+f*(f+2*l)+u;else f=-a,h=Math.max(0,-(o*f+s)),d=-h*h+f*(f+2*l)+u;else f<=-p?(h=Math.max(0,-(-o*a+s)),f=h>0?-a:Math.min(Math.max(-a,-l),a),d=-h*h+f*(f+2*l)+u):f<=p?(h=0,f=Math.min(Math.max(-a,-l),a),d=f*(f+2*l)+u):(h=Math.max(0,-(o*a+s)),f=h>0?a:Math.min(Math.max(-a,-l),a),d=-h*h+f*(f+2*l)+u);else f=o>0?-a:a,h=Math.max(0,-(o*f+s)),d=-h*h+f*(f+2*l)+u;return n&&n.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(kx).addScaledVector(jg,f),d}intersectSphere(e,t){rs.subVectors(e.center,this.origin);const n=rs.dot(this.direction),i=rs.dot(rs)-n*n,a=e.radius*e.radius;if(i>a)return null;const o=Math.sqrt(a-i),s=n-o,l=n+o;return l<0?null:s<0?this.at(l,t):this.at(s,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,a,o,s,l;const u=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,f=this.origin;return u>=0?(n=(e.min.x-f.x)*u,i=(e.max.x-f.x)*u):(n=(e.max.x-f.x)*u,i=(e.min.x-f.x)*u),c>=0?(a=(e.min.y-f.y)*c,o=(e.max.y-f.y)*c):(a=(e.max.y-f.y)*c,o=(e.min.y-f.y)*c),n>o||a>i||((a>n||isNaN(n))&&(n=a),(o=0?(s=(e.min.z-f.z)*h,l=(e.max.z-f.z)*h):(s=(e.max.z-f.z)*h,l=(e.min.z-f.z)*h),n>l||s>i)||((s>n||n!==n)&&(n=s),(l=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,rs)!==null}intersectTriangle(e,t,n,i,a){Ox.subVectors(t,e),Kg.subVectors(n,e),Fx.crossVectors(Ox,Kg);let o=this.direction.dot(Fx),s;if(o>0){if(i)return null;s=1}else if(o<0)s=-1,o=-o;else return null;Ws.subVectors(this.origin,e);const l=s*this.direction.dot(Kg.crossVectors(Ws,Kg));if(l<0)return null;const u=s*this.direction.dot(Ox.cross(Ws));if(u<0||l+u>o)return null;const c=-s*Ws.dot(Fx);return c<0?null:this.at(c/o,a)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Mt{constructor(e,t,n,i,a,o,s,l,u,c,h,f,d,p,g,v){Mt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,a,o,s,l,u,c,h,f,d,p,g,v)}set(e,t,n,i,a,o,s,l,u,c,h,f,d,p,g,v){const m=this.elements;return m[0]=e,m[4]=t,m[8]=n,m[12]=i,m[1]=a,m[5]=o,m[9]=s,m[13]=l,m[2]=u,m[6]=c,m[10]=h,m[14]=f,m[3]=d,m[7]=p,m[11]=g,m[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Mt().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/dh.setFromMatrixColumn(e,0).length(),a=1/dh.setFromMatrixColumn(e,1).length(),o=1/dh.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*a,t[5]=n[5]*a,t[6]=n[6]*a,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,a=e.z,o=Math.cos(n),s=Math.sin(n),l=Math.cos(i),u=Math.sin(i),c=Math.cos(a),h=Math.sin(a);if(e.order==="XYZ"){const f=o*c,d=o*h,p=s*c,g=s*h;t[0]=l*c,t[4]=-l*h,t[8]=u,t[1]=d+p*u,t[5]=f-g*u,t[9]=-s*l,t[2]=g-f*u,t[6]=p+d*u,t[10]=o*l}else if(e.order==="YXZ"){const f=l*c,d=l*h,p=u*c,g=u*h;t[0]=f+g*s,t[4]=p*s-d,t[8]=o*u,t[1]=o*h,t[5]=o*c,t[9]=-s,t[2]=d*s-p,t[6]=g+f*s,t[10]=o*l}else if(e.order==="ZXY"){const f=l*c,d=l*h,p=u*c,g=u*h;t[0]=f-g*s,t[4]=-o*h,t[8]=p+d*s,t[1]=d+p*s,t[5]=o*c,t[9]=g-f*s,t[2]=-o*u,t[6]=s,t[10]=o*l}else if(e.order==="ZYX"){const f=o*c,d=o*h,p=s*c,g=s*h;t[0]=l*c,t[4]=p*u-d,t[8]=f*u+g,t[1]=l*h,t[5]=g*u+f,t[9]=d*u-p,t[2]=-u,t[6]=s*l,t[10]=o*l}else if(e.order==="YZX"){const f=o*l,d=o*u,p=s*l,g=s*u;t[0]=l*c,t[4]=g-f*h,t[8]=p*h+d,t[1]=h,t[5]=o*c,t[9]=-s*c,t[2]=-u*c,t[6]=d*h+p,t[10]=f-g*h}else if(e.order==="XZY"){const f=o*l,d=o*u,p=s*l,g=s*u;t[0]=l*c,t[4]=-h,t[8]=u*c,t[1]=f*h+g,t[5]=o*c,t[9]=d*h-p,t[2]=p*h-d,t[6]=s*c,t[10]=g*h+f}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(lY,e,uY)}lookAt(e,t,n){const i=this.elements;return Gi.subVectors(e,t),Gi.lengthSq()===0&&(Gi.z=1),Gi.normalize(),$s.crossVectors(n,Gi),$s.lengthSq()===0&&(Math.abs(n.z)===1?Gi.x+=1e-4:Gi.z+=1e-4,Gi.normalize(),$s.crossVectors(n,Gi)),$s.normalize(),Zg.crossVectors(Gi,$s),i[0]=$s.x,i[4]=Zg.x,i[8]=Gi.x,i[1]=$s.y,i[5]=Zg.y,i[9]=Gi.y,i[2]=$s.z,i[6]=Zg.z,i[10]=Gi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,a=this.elements,o=n[0],s=n[4],l=n[8],u=n[12],c=n[1],h=n[5],f=n[9],d=n[13],p=n[2],g=n[6],v=n[10],m=n[14],y=n[3],_=n[7],x=n[11],S=n[15],A=i[0],w=i[4],M=i[8],C=i[12],b=i[1],T=i[5],P=i[9],D=i[13],L=i[2],E=i[6],I=i[10],N=i[14],R=i[3],F=i[7],O=i[11],V=i[15];return a[0]=o*A+s*b+l*L+u*R,a[4]=o*w+s*T+l*E+u*F,a[8]=o*M+s*P+l*I+u*O,a[12]=o*C+s*D+l*N+u*V,a[1]=c*A+h*b+f*L+d*R,a[5]=c*w+h*T+f*E+d*F,a[9]=c*M+h*P+f*I+d*O,a[13]=c*C+h*D+f*N+d*V,a[2]=p*A+g*b+v*L+m*R,a[6]=p*w+g*T+v*E+m*F,a[10]=p*M+g*P+v*I+m*O,a[14]=p*C+g*D+v*N+m*V,a[3]=y*A+_*b+x*L+S*R,a[7]=y*w+_*T+x*E+S*F,a[11]=y*M+_*P+x*I+S*O,a[15]=y*C+_*D+x*N+S*V,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],a=e[12],o=e[1],s=e[5],l=e[9],u=e[13],c=e[2],h=e[6],f=e[10],d=e[14],p=e[3],g=e[7],v=e[11],m=e[15];return p*(+a*l*h-i*u*h-a*s*f+n*u*f+i*s*d-n*l*d)+g*(+t*l*d-t*u*f+a*o*f-i*o*d+i*u*c-a*l*c)+v*(+t*u*h-t*s*d-a*o*h+n*o*d+a*s*c-n*u*c)+m*(-i*s*c-t*l*h+t*s*f+i*o*h-n*o*f+n*l*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=h*v*u-g*f*u+g*l*d-s*v*d-h*l*m+s*f*m,_=p*f*u-c*v*u-p*l*d+o*v*d+c*l*m-o*f*m,x=c*g*u-p*h*u+p*s*d-o*g*d-c*s*m+o*h*m,S=p*h*l-c*g*l-p*s*f+o*g*f+c*s*v-o*h*v,A=t*y+n*_+i*x+a*S;if(A===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/A;return e[0]=y*w,e[1]=(g*f*a-h*v*a-g*i*d+n*v*d+h*i*m-n*f*m)*w,e[2]=(s*v*a-g*l*a+g*i*u-n*v*u-s*i*m+n*l*m)*w,e[3]=(h*l*a-s*f*a-h*i*u+n*f*u+s*i*d-n*l*d)*w,e[4]=_*w,e[5]=(c*v*a-p*f*a+p*i*d-t*v*d-c*i*m+t*f*m)*w,e[6]=(p*l*a-o*v*a-p*i*u+t*v*u+o*i*m-t*l*m)*w,e[7]=(o*f*a-c*l*a+c*i*u-t*f*u-o*i*d+t*l*d)*w,e[8]=x*w,e[9]=(p*h*a-c*g*a-p*n*d+t*g*d+c*n*m-t*h*m)*w,e[10]=(o*g*a-p*s*a+p*n*u-t*g*u-o*n*m+t*s*m)*w,e[11]=(c*s*a-o*h*a-c*n*u+t*h*u+o*n*d-t*s*d)*w,e[12]=S*w,e[13]=(c*g*i-p*h*i+p*n*f-t*g*f-c*n*v+t*h*v)*w,e[14]=(p*s*i-o*g*i-p*n*l+t*g*l+o*n*v-t*s*v)*w,e[15]=(o*h*i-c*s*i+c*n*l-t*h*l-o*n*f+t*s*f)*w,this}scale(e){const t=this.elements,n=e.x,i=e.y,a=e.z;return t[0]*=n,t[4]*=i,t[8]*=a,t[1]*=n,t[5]*=i,t[9]*=a,t[2]*=n,t[6]*=i,t[10]*=a,t[3]*=n,t[7]*=i,t[11]*=a,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),a=1-n,o=e.x,s=e.y,l=e.z,u=a*o,c=a*s;return this.set(u*o+n,u*s-i*l,u*l+i*s,0,u*s+i*l,c*s+n,c*l-i*o,0,u*l-i*s,c*l+i*o,a*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,a,o){return this.set(1,n,a,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,a=t._x,o=t._y,s=t._z,l=t._w,u=a+a,c=o+o,h=s+s,f=a*u,d=a*c,p=a*h,g=o*c,v=o*h,m=s*h,y=l*u,_=l*c,x=l*h,S=n.x,A=n.y,w=n.z;return i[0]=(1-(g+m))*S,i[1]=(d+x)*S,i[2]=(p-_)*S,i[3]=0,i[4]=(d-x)*A,i[5]=(1-(f+m))*A,i[6]=(v+y)*A,i[7]=0,i[8]=(p+_)*w,i[9]=(v-y)*w,i[10]=(1-(f+g))*w,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let a=dh.set(i[0],i[1],i[2]).length();const o=dh.set(i[4],i[5],i[6]).length(),s=dh.set(i[8],i[9],i[10]).length();this.determinant()<0&&(a=-a),e.x=i[12],e.y=i[13],e.z=i[14],Ga.copy(this);const u=1/a,c=1/o,h=1/s;return Ga.elements[0]*=u,Ga.elements[1]*=u,Ga.elements[2]*=u,Ga.elements[4]*=c,Ga.elements[5]*=c,Ga.elements[6]*=c,Ga.elements[8]*=h,Ga.elements[9]*=h,Ga.elements[10]*=h,t.setFromRotationMatrix(Ga),n.x=a,n.y=o,n.z=s,this}makePerspective(e,t,n,i,a,o,s=ms){const l=this.elements,u=2*a/(t-e),c=2*a/(n-i),h=(t+e)/(t-e),f=(n+i)/(n-i);let d,p;if(s===ms)d=-(o+a)/(o-a),p=-2*o*a/(o-a);else if(s===N0)d=-o/(o-a),p=-o*a/(o-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return l[0]=u,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=c,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=d,l[14]=p,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,n,i,a,o,s=ms){const l=this.elements,u=1/(t-e),c=1/(n-i),h=1/(o-a),f=(t+e)*u,d=(n+i)*c;let p,g;if(s===ms)p=(o+a)*h,g=-2*h;else if(s===N0)p=a*h,g=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*c,l[9]=0,l[13]=-d,l[2]=0,l[6]=0,l[10]=g,l[14]=-p,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const dh=new X,Ga=new Mt,lY=new X(0,0,0),uY=new X(1,1,1),$s=new X,Zg=new X,Gi=new X,SP=new Mt,AP=new ao;class J_{constructor(e=0,t=0,n=0,i=J_.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const i=e.elements,a=i[0],o=i[4],s=i[8],l=i[1],u=i[5],c=i[9],h=i[2],f=i[6],d=i[10];switch(t){case"XYZ":this._y=Math.asin(hr(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(f,u),this._z=0);break;case"YXZ":this._x=Math.asin(-hr(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-h,a),this._z=0);break;case"ZXY":this._x=Math.asin(hr(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(l,a));break;case"ZYX":this._y=Math.asin(-hr(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,d),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(hr(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-hr(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,u),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return SP.makeRotationFromQuaternion(e),this.setFromRotationMatrix(SP,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return AP.setFromEuler(this),this.setFromQuaternion(AP,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}J_.DEFAULT_ORDER="XYZ";class lC{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let n=0;n0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(s=>({boxInitialized:s.boxInitialized,boxMin:s.box.min.toArray(),boxMax:s.box.max.toArray(),sphereInitialized:s.sphereInitialized,sphereRadius:s.sphere.radius,sphereCenter:s.sphere.center.toArray()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function a(s,l){return s[l.uuid]===void 0&&(s[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=a(e.geometries,this.geometry);const s=this.geometry.parameters;if(s!==void 0&&s.shapes!==void 0){const l=s.shapes;if(Array.isArray(l))for(let u=0,c=l.length;u0){i.children=[];for(let s=0;s0){i.animations=[];for(let s=0;s0&&(n.geometries=s),l.length>0&&(n.materials=l),u.length>0&&(n.textures=u),c.length>0&&(n.images=c),h.length>0&&(n.shapes=h),f.length>0&&(n.skeletons=f),d.length>0&&(n.animations=d),p.length>0&&(n.nodes=p)}return n.object=i,n;function o(s){const l=[];for(const u in s){const c=s[u];delete c.metadata,l.push(c)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(a)):i.set(0,0,0)}static getBarycoord(e,t,n,i,a){Ha.subVectors(i,t),as.subVectors(n,t),Bx.subVectors(e,t);const o=Ha.dot(Ha),s=Ha.dot(as),l=Ha.dot(Bx),u=as.dot(as),c=as.dot(Bx),h=o*u-s*s;if(h===0)return a.set(0,0,0),null;const f=1/h,d=(u*l-s*c)*f,p=(o*c-s*l)*f;return a.set(1-d-p,p,d)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,os)===null?!1:os.x>=0&&os.y>=0&&os.x+os.y<=1}static getInterpolation(e,t,n,i,a,o,s,l){return this.getBarycoord(e,t,n,i,os)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(a,os.x),l.addScaledVector(o,os.y),l.addScaledVector(s,os.z),l)}static isFrontFacing(e,t,n,i){return Ha.subVectors(n,t),as.subVectors(e,t),Ha.cross(as).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ha.subVectors(this.c,this.b),as.subVectors(this.a,this.b),Ha.cross(as).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Jh.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Jh.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,a){return Jh.getInterpolation(e,this.a,this.b,this.c,t,n,i,a)}containsPoint(e){return Jh.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Jh.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,a=this.c;let o,s;vh.subVectors(i,n),gh.subVectors(a,n),zx.subVectors(e,n);const l=vh.dot(zx),u=gh.dot(zx);if(l<=0&&u<=0)return t.copy(n);Ux.subVectors(e,i);const c=vh.dot(Ux),h=gh.dot(Ux);if(c>=0&&h<=c)return t.copy(i);const f=l*h-c*u;if(f<=0&&l>=0&&c<=0)return o=l/(l-c),t.copy(n).addScaledVector(vh,o);Vx.subVectors(e,a);const d=vh.dot(Vx),p=gh.dot(Vx);if(p>=0&&d<=p)return t.copy(a);const g=d*u-l*p;if(g<=0&&u>=0&&p<=0)return s=u/(u-p),t.copy(n).addScaledVector(gh,s);const v=c*p-d*h;if(v<=0&&h-c>=0&&d-p>=0)return CP.subVectors(a,i),s=(h-c)/(h-c+(d-p)),t.copy(i).addScaledVector(CP,s);const m=1/(v+g+f);return o=g*m,s=f*m,t.copy(n).addScaledVector(vh,o).addScaledVector(gh,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}};const _z={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Xs={h:0,s:0,l:0},Jg={h:0,s:0,l:0};function Gx(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}class nt{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=dn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,ln.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=ln.workingColorSpace){return this.r=e,this.g=t,this.b=n,ln.toWorkingColorSpace(this,i),this}setHSL(e,t,n,i=ln.workingColorSpace){if(e=oC(e,1),t=hr(t,0,1),n=hr(n,0,1),t===0)this.r=this.g=this.b=n;else{const a=n<=.5?n*(1+t):n+t-n*t,o=2*n-a;this.r=Gx(o,a,e+1/3),this.g=Gx(o,a,e),this.b=Gx(o,a,e-1/3)}return ln.toWorkingColorSpace(this,i),this}setStyle(e,t=dn){function n(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let a;const o=i[1],s=i[2];switch(o){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,t);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,t);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const a=i[1],o=a.length;if(o===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(a,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=dn){const n=_z[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Af(e.r),this.g=Af(e.g),this.b=Af(e.b),this}copyLinearToSRGB(e){return this.r=Px(e.r),this.g=Px(e.g),this.b=Px(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=dn){return ln.fromWorkingColorSpace(Hr.copy(this),e),Math.round(hr(Hr.r*255,0,255))*65536+Math.round(hr(Hr.g*255,0,255))*256+Math.round(hr(Hr.b*255,0,255))}getHexString(e=dn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=ln.workingColorSpace){ln.fromWorkingColorSpace(Hr.copy(this),t);const n=Hr.r,i=Hr.g,a=Hr.b,o=Math.max(n,i,a),s=Math.min(n,i,a);let l,u;const c=(s+o)/2;if(s===o)l=0,u=0;else{const h=o-s;switch(u=c<=.5?h/(o+s):h/(2-o-s),o){case n:l=(i-a)/h+(i0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==mc&&(n.blending=this.blending),this.side!==Es&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==pb&&(n.blendSrc=this.blendSrc),this.blendDst!==vb&&(n.blendDst=this.blendDst),this.blendEquation!==vl&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==L0&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==pP&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==lh&&(n.stencilFail=this.stencilFail),this.stencilZFail!==lh&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==lh&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(a){const o=[];for(const s in a){const l=a[s];delete l.metadata,o.push(l)}return o}if(t){const a=i(e.textures),o=i(e.images);a.length>0&&(n.textures=a),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let a=0;a!==i;++a)n[a]=t[a].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Pn extends Da{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new nt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=nC,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const ar=new X,em=new Me;class Gn{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=xb,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Ro,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return Sc("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,a=this.itemSize;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const u=n[l];e.data.attributes[l]=u.toJSON(e.data)}const i={};let a=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],c=[];for(let h=0,f=u.length;h0&&(i[l]=c,a=!0)}a&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const s=this.boundingSphere;return s!==null&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone(t));const i=e.attributes;for(const u in i){const c=i[u];this.setAttribute(u,c.clone(t))}const a=e.morphAttributes;for(const u in a){const c=[],h=a[u];for(let f=0,d=h.length;f0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,o=i.length;acu(e.far-e.near,2)))&&(EP.copy(a).invert(),vu.copy(e.ray).applyMatrix4(EP),!(n.boundingBox!==null&&vu.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,vu)))}_computeIntersections(e,t,n){let i;const a=this.geometry,o=this.material,s=a.index,l=a.attributes.position,u=a.attributes.uv,c=a.attributes.uv1,h=a.attributes.normal,f=a.groups,d=a.drawRange;if(s!==null)if(Array.isArray(o))for(let p=0,g=f.length;pt.far?null:{distance:u,point:sm.clone(),object:r}}function lm(r,e,t,n,i,a,o,s,l,u){r.getVertexPosition(s,yh),r.getVertexPosition(l,_h),r.getVertexPosition(u,xh);const c=mY(r,e,t,n,yh,_h,xh,om);if(c){i&&(rm.fromBufferAttribute(i,s),im.fromBufferAttribute(i,l),am.fromBufferAttribute(i,u),c.uv=Tp.getInterpolation(om,yh,_h,xh,rm,im,am,new Me)),a&&(rm.fromBufferAttribute(a,s),im.fromBufferAttribute(a,l),am.fromBufferAttribute(a,u),c.uv1=Tp.getInterpolation(om,yh,_h,xh,rm,im,am,new Me),c.uv2=c.uv1),o&&(PP.fromBufferAttribute(o,s),RP.fromBufferAttribute(o,l),DP.fromBufferAttribute(o,u),c.normal=Tp.getInterpolation(om,yh,_h,xh,PP,RP,DP,new X),c.normal.dot(n.direction)>0&&c.normal.multiplyScalar(-1));const h={a:s,b:l,c:u,normal:new X,materialIndex:0};Tp.getNormal(yh,_h,xh,h.normal),c.face=h}return c}class ld extends wn{constructor(e=1,t=1,n=1,i=1,a=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:a,depthSegments:o};const s=this;i=Math.floor(i),a=Math.floor(a),o=Math.floor(o);const l=[],u=[],c=[],h=[];let f=0,d=0;p("z","y","x",-1,-1,n,t,e,o,a,0),p("z","y","x",1,-1,n,t,-e,o,a,1),p("x","z","y",1,1,e,n,t,i,o,2),p("x","z","y",1,-1,e,n,-t,i,o,3),p("x","y","z",1,-1,e,t,n,i,a,4),p("x","y","z",-1,-1,e,t,-n,i,a,5),this.setIndex(l),this.setAttribute("position",new Nn(u,3)),this.setAttribute("normal",new Nn(c,3)),this.setAttribute("uv",new Nn(h,2));function p(g,v,m,y,_,x,S,A,w,M,C){const b=x/w,T=S/M,P=x/2,D=S/2,L=A/2,E=w+1,I=M+1;let N=0,R=0;const F=new X;for(let O=0;O0?1:-1,c.push(F.x,F.y,F.z),h.push(H/w),h.push(1-O/M),N+=1}}for(let O=0;O0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}let wz=class extends bn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Mt,this.projectionMatrix=new Mt,this.projectionMatrixInverse=new Mt,this.coordinateSystem=ms}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};const Ys=new X,IP=new Me,NP=new Me;class Qr extends wz{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Hf*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Xp*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Hf*2*Math.atan(Math.tan(Xp*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){Ys.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Ys.x,Ys.y).multiplyScalar(-e/Ys.z),Ys.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Ys.x,Ys.y).multiplyScalar(-e/Ys.z)}getViewSize(e,t){return this.getViewBounds(e,IP,NP),t.subVectors(NP,IP)}setViewOffset(e,t,n,i,a,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=a,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Xp*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,a=-.5*i;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,u=o.fullHeight;a+=o.offsetX*i/l,t-=o.offsetY*n/u,i*=o.width/l,n*=o.height/u}const s=this.filmOffset;s!==0&&(a+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+i,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Sh=-90,Ah=1;class SY extends bn{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Qr(Sh,Ah,e,t);i.layers=this.layers,this.add(i);const a=new Qr(Sh,Ah,e,t);a.layers=this.layers,this.add(a);const o=new Qr(Sh,Ah,e,t);o.layers=this.layers,this.add(o);const s=new Qr(Sh,Ah,e,t);s.layers=this.layers,this.add(s);const l=new Qr(Sh,Ah,e,t);l.layers=this.layers,this.add(l);const u=new Qr(Sh,Ah,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,i,a,o,s,l]=t;for(const u of t)this.remove(u);if(e===ms)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===N0)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const u of t)this.add(u),u.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[a,o,s,l,u,c]=this.children,h=e.getRenderTarget(),f=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const g=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,i),e.render(t,a),e.setRenderTarget(n,1,i),e.render(t,o),e.setRenderTarget(n,2,i),e.render(t,s),e.setRenderTarget(n,3,i),e.render(t,l),e.setRenderTarget(n,4,i),e.render(t,u),n.texture.generateMipmaps=g,e.setRenderTarget(n,5,i),e.render(t,c),e.setRenderTarget(h,f,d),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}}class bz extends mr{constructor(e,t,n,i,a,o,s,l,u,c){e=e!==void 0?e:[],t=t!==void 0?t:zf,super(e,t,n,i,a,o,s,l,u,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class AY extends kc{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},i=[n,n,n,n,n,n];t.encoding!==void 0&&(Sc("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===xc?dn:Ta),this.texture=new bz(i,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:lr}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; vec3 transformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include } `,fragmentShader:` uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); gl_FragColor = texture2D( tEquirect, sampleUV ); } `},i=new ld(5,5,5),a=new Ls({name:"CubemapFromEquirect",uniforms:Wf(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Di,blending:kl});a.uniforms.tEquirect.value=t;const o=new rn(i,a),s=t.minFilter;return t.minFilter===gs&&(t.minFilter=lr),new SY(1,10,this).update(e,o),t.minFilter=s,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){const a=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(a)}}const $x=new X,wY=new X,bY=new Ht;let cl=class{constructor(e=new X(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=$x.subVectors(n,t).cross(wY.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta($x),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/i;return a<0||a>1?null:t.copy(e.start).addScaledVector(n,a)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||bY.getNormalMatrix(e),i=this.coplanarPoint($x).applyMatrix4(e),a=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(a),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};const gu=new Fa,um=new X;class cC{constructor(e=new cl,t=new cl,n=new cl,i=new cl,a=new cl,o=new cl){this.planes=[e,t,n,i,a,o]}set(e,t,n,i,a,o){const s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(n),s[3].copy(i),s[4].copy(a),s[5].copy(o),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=ms){const n=this.planes,i=e.elements,a=i[0],o=i[1],s=i[2],l=i[3],u=i[4],c=i[5],h=i[6],f=i[7],d=i[8],p=i[9],g=i[10],v=i[11],m=i[12],y=i[13],_=i[14],x=i[15];if(n[0].setComponents(l-a,f-u,v-d,x-m).normalize(),n[1].setComponents(l+a,f+u,v+d,x+m).normalize(),n[2].setComponents(l+o,f+c,v+p,x+y).normalize(),n[3].setComponents(l-o,f-c,v-p,x-y).normalize(),n[4].setComponents(l-s,f-h,v-g,x-_).normalize(),t===ms)n[5].setComponents(l+s,f+h,v+g,x+_).normalize();else if(t===N0)n[5].setComponents(s,h,g,_).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),gu.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),gu.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(gu)}intersectsSprite(e){return gu.center.set(0,0,0),gu.radius=.7071067811865476,gu.applyMatrix4(e.matrixWorld),this.intersectsSphere(gu)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let a=0;a<6;a++)if(t[a].distanceToPoint(n)0?e.max.x:e.min.x,um.y=i.normal.y>0?e.max.y:e.min.y,um.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(um)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function Tz(){let r=null,e=!1,t=null,n=null;function i(a,o){t(a,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(a){t=a},setContext:function(a){r=a}}}function TY(r,e){const t=e.isWebGL2,n=new WeakMap;function i(u,c){const h=u.array,f=u.usage,d=h.byteLength,p=r.createBuffer();r.bindBuffer(c,p),r.bufferData(c,h,f),u.onUploadCallback();let g;if(h instanceof Float32Array)g=r.FLOAT;else if(h instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(t)g=r.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else g=r.UNSIGNED_SHORT;else if(h instanceof Int16Array)g=r.SHORT;else if(h instanceof Uint32Array)g=r.UNSIGNED_INT;else if(h instanceof Int32Array)g=r.INT;else if(h instanceof Int8Array)g=r.BYTE;else if(h instanceof Uint8Array)g=r.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)g=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:p,type:g,bytesPerElement:h.BYTES_PER_ELEMENT,version:u.version,size:d}}function a(u,c,h){const f=c.array,d=c._updateRange,p=c.updateRanges;if(r.bindBuffer(h,u),d.count===-1&&p.length===0&&r.bufferSubData(h,0,f),p.length!==0){for(let g=0,v=p.length;g 0 vec4 plane; #ifdef ALPHA_TO_COVERAGE float distanceToPlane, distanceGradient; float clipOpacity = 1.0; #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; distanceGradient = fwidth( distanceToPlane ) / 2.0; clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); if ( clipOpacity == 0.0 ) discard; } #pragma unroll_loop_end #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES float unionClipOpacity = 1.0; #pragma unroll_loop_start for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; distanceGradient = fwidth( distanceToPlane ) / 2.0; unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); } #pragma unroll_loop_end clipOpacity *= 1.0 - unionClipOpacity; #endif diffuseColor.a *= clipOpacity; if ( diffuseColor.a == 0.0 ) discard; #else #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; } #pragma unroll_loop_end #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES bool clipped = true; #pragma unroll_loop_start for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; } #pragma unroll_loop_end if ( clipped ) discard; #endif #endif #endif`,GY=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`,HY=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; #endif`,WY=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; #endif`,$Y=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; #endif`,XY=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; #endif`,YY=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; #endif`,qY=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) vColor = vec3( 1.0 ); #endif #ifdef USE_COLOR vColor *= color; #endif #ifdef USE_INSTANCING_COLOR vColor.xyz *= instanceColor.xyz; #endif`,jY=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 #define RECIPROCAL_PI2 0.15915494309189535 #define EPSILON 1e-6 #ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif #define whiteComplement( a ) ( 1.0 - saturate( a ) ) float pow2( const in float x ) { return x*x; } vec3 pow2( const in vec3 x ) { return x*x; } float pow3( const in float x ) { return x*x*x; } float pow4( const in float x ) { float x2 = x*x; return x2*x2; } float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } highp float rand( const in vec2 uv ) { const highp float a = 12.9898, b = 78.233, c = 43758.5453; highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); return fract( sin( sn ) * c ); } #ifdef HIGH_PRECISION float precisionSafeLength( vec3 v ) { return length( v ); } #else float precisionSafeLength( vec3 v ) { float maxComponent = max3( abs( v ) ); return length( v / maxComponent ) * maxComponent; } #endif struct IncidentLight { vec3 color; vec3 direction; bool visible; }; struct ReflectedLight { vec3 directDiffuse; vec3 directSpecular; vec3 indirectDiffuse; vec3 indirectSpecular; }; #ifdef USE_ALPHAHASH varying vec3 vPosition; #endif vec3 transformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); } mat3 transposeMat3( const in mat3 m ) { mat3 tmp; tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); return tmp; } float luminance( const in vec3 rgb ) { const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); return dot( weights, rgb ); } bool isPerspectiveMatrix( mat4 m ) { return m[ 2 ][ 3 ] == - 1.0; } vec2 equirectUv( in vec3 dir ) { float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; return vec2( u, v ); } vec3 BRDF_Lambert( const in vec3 diffuseColor ) { return RECIPROCAL_PI * diffuseColor; } vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); } float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); } // validated`,KY=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { vec3 absDirection = abs( direction ); float face = - 1.0; if ( absDirection.x > absDirection.z ) { if ( absDirection.x > absDirection.y ) face = direction.x > 0.0 ? 0.0 : 3.0; else face = direction.y > 0.0 ? 1.0 : 4.0; } else { if ( absDirection.z > absDirection.y ) face = direction.z > 0.0 ? 2.0 : 5.0; else face = direction.y > 0.0 ? 1.0 : 4.0; } return face; } vec2 getUV( vec3 direction, float face ) { vec2 uv; if ( face == 0.0 ) { uv = vec2( direction.z, direction.y ) / abs( direction.x ); } else if ( face == 1.0 ) { uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); } else if ( face == 2.0 ) { uv = vec2( - direction.x, direction.y ) / abs( direction.z ); } else if ( face == 3.0 ) { uv = vec2( - direction.z, direction.y ) / abs( direction.x ); } else if ( face == 4.0 ) { uv = vec2( - direction.x, direction.z ) / abs( direction.y ); } else { uv = vec2( direction.x, direction.y ) / abs( direction.z ); } return 0.5 * ( uv + 1.0 ); } vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { float face = getFace( direction ); float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); mipInt = max( mipInt, cubeUV_minMipLevel ); float faceSize = exp2( mipInt ); highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; if ( face > 2.0 ) { uv.y += faceSize; face -= 3.0; } uv.x += face * faceSize; uv.x += filterInt * 3.0 * cubeUV_minTileSize; uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); uv.x *= CUBEUV_TEXEL_WIDTH; uv.y *= CUBEUV_TEXEL_HEIGHT; #ifdef texture2DGradEXT return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; #else return texture2D( envMap, uv ).rgb; #endif } #define cubeUV_r0 1.0 #define cubeUV_m0 - 2.0 #define cubeUV_r1 0.8 #define cubeUV_m1 - 1.0 #define cubeUV_r4 0.4 #define cubeUV_m4 2.0 #define cubeUV_r5 0.305 #define cubeUV_m5 3.0 #define cubeUV_r6 0.21 #define cubeUV_m6 4.0 float roughnessToMip( float roughness ) { float mip = 0.0; if ( roughness >= cubeUV_r1 ) { mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; } else if ( roughness >= cubeUV_r4 ) { mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; } else if ( roughness >= cubeUV_r5 ) { mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; } else if ( roughness >= cubeUV_r6 ) { mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; } else { mip = - 2.0 * log2( 1.16 * roughness ); } return mip; } vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); float mipF = fract( mip ); float mipInt = floor( mip ); vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); if ( mipF == 0.0 ) { return vec4( color0, 1.0 ); } else { vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); return vec4( mix( color0, color1, mipF ), 1.0 ); } } #endif`,ZY=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif #ifdef USE_BATCHING mat3 bm = mat3( batchingMatrix ); transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); transformedNormal = bm * transformedNormal; #ifdef USE_TANGENT transformedTangent = bm * transformedTangent; #endif #endif #ifdef USE_INSTANCING mat3 im = mat3( instanceMatrix ); transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); transformedNormal = im * transformedNormal; #ifdef USE_TANGENT transformedTangent = im * transformedTangent; #endif #endif transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedNormal = - transformedNormal; #endif #ifdef USE_TANGENT transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif #endif`,QY=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; #endif`,JY=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); #endif`,eq=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); totalEmissiveRadiance *= emissiveColor.rgb; #endif`,tq=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; #endif`,nq="gl_FragColor = linearToOutputTexel( gl_FragColor );",rq=` const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( vec3( 0.8224621, 0.177538, 0.0 ), vec3( 0.0331941, 0.9668058, 0.0 ), vec3( 0.0170827, 0.0723974, 0.9105199 ) ); const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( vec3( 1.2249401, - 0.2249404, 0.0 ), vec3( - 0.0420569, 1.0420571, 0.0 ), vec3( - 0.0196376, - 0.0786361, 1.0982735 ) ); vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); } vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); } vec4 LinearTransferOETF( in vec4 value ) { return value; } vec4 sRGBTransferOETF( in vec4 value ) { return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); } vec4 LinearToLinear( in vec4 value ) { return value; } vec4 LinearTosRGB( in vec4 value ) { return sRGBTransferOETF( value ); }`,iq=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); } else { cameraToFrag = normalize( vWorldPosition - cameraPosition ); } vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vec3 reflectVec = reflect( cameraToFrag, worldNormal ); #else vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); #endif #else vec3 reflectVec = vReflect; #endif #ifdef ENVMAP_TYPE_CUBE vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); #else vec4 envColor = vec4( 0.0 ); #endif #ifdef ENVMAP_BLENDING_MULTIPLY outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); #elif defined( ENVMAP_BLENDING_MIX ) outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif #endif`,aq=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; #ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #else uniform sampler2D envMap; #endif #endif`,oq=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif #ifdef ENV_WORLDPOS varying vec3 vWorldPosition; uniform float refractionRatio; #else varying vec3 vReflect; #endif #endif`,sq=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif #ifdef ENV_WORLDPOS varying vec3 vWorldPosition; #else varying vec3 vReflect; uniform float refractionRatio; #endif #endif`,lq=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else vec3 cameraToVertex; if ( isOrthographic ) { cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); } else { cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); } vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vReflect = reflect( cameraToVertex, worldNormal ); #else vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif #endif`,uq=`#ifdef USE_FOG vFogDepth = - mvPosition.z; #endif`,cq=`#ifdef USE_FOG varying float vFogDepth; #endif`,hq=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); #endif`,fq=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 uniform float fogDensity; #else uniform float fogNear; uniform float fogFar; #endif #endif`,dq=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { float dotNL = dot( normal, lightDirection ); vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); #ifdef USE_GRADIENTMAP return vec3( texture2D( gradientMap, coord ).r ); #else vec2 fw = fwidth( coord ) * 0.5; return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); #endif }`,pq=`#ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; reflectedLight.indirectDiffuse += lightMapIrradiance; #endif`,vq=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; #endif`,gq=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularStrength = specularStrength;`,mq=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; }; void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Lambert #define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,yq=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; #endif vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { float x = normal.x, y = normal.y, z = normal.z; vec3 result = shCoefficients[ 0 ] * 0.886227; result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); return result; } vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); return irradiance; } vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { vec3 irradiance = ambientLightColor; return irradiance; } float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { #if defined ( LEGACY_LIGHTS ) if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); } return 1.0; #else float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); if ( cutoffDistance > 0.0 ) { distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); } return distanceFalloff; #endif } float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { return smoothstep( coneCosine, penumbraCosine, angleCosine ); } #if NUM_DIR_LIGHTS > 0 struct DirectionalLight { vec3 direction; vec3 color; }; uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { light.color = directionalLight.color; light.direction = directionalLight.direction; light.visible = true; } #endif #if NUM_POINT_LIGHTS > 0 struct PointLight { vec3 position; vec3 color; float distance; float decay; }; uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { vec3 lVector = pointLight.position - geometryPosition; light.direction = normalize( lVector ); float lightDistance = length( lVector ); light.color = pointLight.color; light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); light.visible = ( light.color != vec3( 0.0 ) ); } #endif #if NUM_SPOT_LIGHTS > 0 struct SpotLight { vec3 position; vec3 direction; vec3 color; float distance; float decay; float coneCos; float penumbraCos; }; uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { vec3 lVector = spotLight.position - geometryPosition; light.direction = normalize( lVector ); float angleCos = dot( light.direction, spotLight.direction ); float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); if ( spotAttenuation > 0.0 ) { float lightDistance = length( lVector ); light.color = spotLight.color * spotAttenuation; light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); light.visible = ( light.color != vec3( 0.0 ) ); } else { light.color = vec3( 0.0 ); light.visible = false; } } #endif #if NUM_RECT_AREA_LIGHTS > 0 struct RectAreaLight { vec3 color; vec3 position; vec3 halfWidth; vec3 halfHeight; }; uniform sampler2D ltc_1; uniform sampler2D ltc_2; uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; #endif #if NUM_HEMI_LIGHTS > 0 struct HemisphereLight { vec3 direction; vec3 skyColor; vec3 groundColor; }; uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { float dotNL = dot( normal, hemiLight.direction ); float hemiDiffuseWeight = 0.5 * dotNL + 0.5; vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } #endif`,_q=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); return PI * envMapColor.rgb * envMapIntensity; #else return vec3( 0.0 ); #endif } vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 reflectVec = reflect( - viewDir, normal ); reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); return envMapColor.rgb * envMapIntensity; #else return vec3( 0.0 ); #endif } #ifdef USE_ANISOTROPY vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 bentNormal = cross( bitangent, viewDir ); bentNormal = normalize( cross( bentNormal, bitangent ) ); bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); return getIBLRadiance( viewDir, bentNormal, roughness ); #else return vec3( 0.0 ); #endif } #endif #endif`,xq=`ToonMaterial material; material.diffuseColor = diffuseColor.rgb;`,Sq=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Aq=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; material.specularStrength = specularStrength;`,wq=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; float specularShininess; float specularStrength; }; void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; } void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,bq=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; material.roughness = min( material.roughness, 1.0 ); #ifdef IOR material.ior = ior; #ifdef USE_SPECULAR float specularIntensityFactor = specularIntensity; vec3 specularColorFactor = specularColor; #ifdef USE_SPECULAR_COLORMAP specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; #endif #ifdef USE_SPECULAR_INTENSITYMAP specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; #endif material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); #else float specularIntensityFactor = 1.0; vec3 specularColorFactor = vec3( 1.0 ); material.specularF90 = 1.0; #endif material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); #else material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); material.specularF90 = 1.0; #endif #ifdef USE_CLEARCOAT material.clearcoat = clearcoat; material.clearcoatRoughness = clearcoatRoughness; material.clearcoatF0 = vec3( 0.04 ); material.clearcoatF90 = 1.0; #ifdef USE_CLEARCOATMAP material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; #endif material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); material.clearcoatRoughness += geometryRoughness; material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); #endif #ifdef USE_IRIDESCENCE material.iridescence = iridescence; material.iridescenceIOR = iridescenceIOR; #ifdef USE_IRIDESCENCEMAP material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; #else material.iridescenceThickness = iridescenceThicknessMaximum; #endif #endif #ifdef USE_SHEEN material.sheenColor = sheenColor; #ifdef USE_SHEEN_COLORMAP material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; #endif material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); #ifdef USE_SHEEN_ROUGHNESSMAP material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; #endif #endif #ifdef USE_ANISOTROPY #ifdef USE_ANISOTROPYMAP mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; #else vec2 anisotropyV = anisotropyVector; #endif material.anisotropy = length( anisotropyV ); if( material.anisotropy == 0.0 ) { anisotropyV = vec2( 1.0, 0.0 ); } else { anisotropyV /= material.anisotropy; material.anisotropy = saturate( material.anisotropy ); } material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; #endif`,Tq=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; float specularF90; #ifdef USE_CLEARCOAT float clearcoat; float clearcoatRoughness; vec3 clearcoatF0; float clearcoatF90; #endif #ifdef USE_IRIDESCENCE float iridescence; float iridescenceIOR; float iridescenceThickness; vec3 iridescenceFresnel; vec3 iridescenceF0; #endif #ifdef USE_SHEEN vec3 sheenColor; float sheenRoughness; #endif #ifdef IOR float ior; #endif #ifdef USE_TRANSMISSION float transmission; float transmissionAlpha; float thickness; float attenuationDistance; vec3 attenuationColor; #endif #ifdef USE_ANISOTROPY float anisotropy; float alphaT; vec3 anisotropyT; vec3 anisotropyB; #endif }; vec3 clearcoatSpecularDirect = vec3( 0.0 ); vec3 clearcoatSpecularIndirect = vec3( 0.0 ); vec3 sheenSpecularDirect = vec3( 0.0 ); vec3 sheenSpecularIndirect = vec3(0.0 ); vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); float x2 = x * x; float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); } float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { float a2 = pow2( alpha ); float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); return 0.5 / max( gv + gl, EPSILON ); } float D_GGX( const in float alpha, const in float dotNH ) { float a2 = pow2( alpha ); float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; return RECIPROCAL_PI * a2 / pow2( denom ); } #ifdef USE_ANISOTROPY float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); float v = 0.5 / ( gv + gl ); return saturate(v); } float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { float a2 = alphaT * alphaB; highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); highp float v2 = dot( v, v ); float w2 = a2 / v2; return RECIPROCAL_PI * a2 * pow2 ( w2 ); } #endif #ifdef USE_CLEARCOAT vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { vec3 f0 = material.clearcoatF0; float f90 = material.clearcoatF90; float roughness = material.clearcoatRoughness; float alpha = pow2( roughness ); vec3 halfDir = normalize( lightDir + viewDir ); float dotNL = saturate( dot( normal, lightDir ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float dotVH = saturate( dot( viewDir, halfDir ) ); vec3 F = F_Schlick( f0, f90, dotVH ); float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); float D = D_GGX( alpha, dotNH ); return F * ( V * D ); } #endif vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { vec3 f0 = material.specularColor; float f90 = material.specularF90; float roughness = material.roughness; float alpha = pow2( roughness ); vec3 halfDir = normalize( lightDir + viewDir ); float dotNL = saturate( dot( normal, lightDir ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float dotVH = saturate( dot( viewDir, halfDir ) ); vec3 F = F_Schlick( f0, f90, dotVH ); #ifdef USE_IRIDESCENCE F = mix( F, material.iridescenceFresnel, material.iridescence ); #endif #ifdef USE_ANISOTROPY float dotTL = dot( material.anisotropyT, lightDir ); float dotTV = dot( material.anisotropyT, viewDir ); float dotTH = dot( material.anisotropyT, halfDir ); float dotBL = dot( material.anisotropyB, lightDir ); float dotBV = dot( material.anisotropyB, viewDir ); float dotBH = dot( material.anisotropyB, halfDir ); float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); #else float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); float D = D_GGX( alpha, dotNH ); #endif return F * ( V * D ); } vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { const float LUT_SIZE = 64.0; const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; const float LUT_BIAS = 0.5 / LUT_SIZE; float dotNV = saturate( dot( N, V ) ); vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); uv = uv * LUT_SCALE + LUT_BIAS; return uv; } float LTC_ClippedSphereFormFactor( const in vec3 f ) { float l = length( f ); return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); } vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { float x = dot( v1, v2 ); float y = abs( x ); float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; float b = 3.4175940 + ( 4.1616724 + y ) * y; float v = a / b; float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; return cross( v1, v2 ) * theta_sintheta; } vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; vec3 lightNormal = cross( v1, v2 ); if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); vec3 T1, T2; T1 = normalize( V - N * dot( V, N ) ); T2 = - cross( N, T1 ); mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); vec3 coords[ 4 ]; coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); coords[ 0 ] = normalize( coords[ 0 ] ); coords[ 1 ] = normalize( coords[ 1 ] ); coords[ 2 ] = normalize( coords[ 2 ] ); coords[ 3 ] = normalize( coords[ 3 ] ); vec3 vectorFormFactor = vec3( 0.0 ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); return vec3( result ); } #if defined( USE_SHEEN ) float D_Charlie( float roughness, float dotNH ) { float alpha = pow2( roughness ); float invAlpha = 1.0 / alpha; float cos2h = dotNH * dotNH; float sin2h = max( 1.0 - cos2h, 0.0078125 ); return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); } float V_Neubelt( float dotNV, float dotNL ) { return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); } vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { vec3 halfDir = normalize( lightDir + viewDir ); float dotNL = saturate( dot( normal, lightDir ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float D = D_Charlie( sheenRoughness, dotNH ); float V = V_Neubelt( dotNV, dotNL ); return sheenColor * ( D * V ); } #endif float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { float dotNV = saturate( dot( normal, viewDir ) ); float r2 = roughness * roughness; float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); return saturate( DG * RECIPROCAL_PI ); } vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { float dotNV = saturate( dot( normal, viewDir ) ); const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); vec4 r = roughness * c0 + c1; float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; return fab; } vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { vec2 fab = DFGApprox( normal, viewDir, roughness ); return specularColor * fab.x + specularF90 * fab.y; } #ifdef USE_IRIDESCENCE void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { #else void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { #endif vec2 fab = DFGApprox( normal, viewDir, roughness ); #ifdef USE_IRIDESCENCE vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); #else vec3 Fr = specularColor; #endif vec3 FssEss = Fr * fab.x + specularF90 * fab.y; float Ess = fab.x + fab.y; float Ems = 1.0 - Ess; vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); singleScatter += FssEss; multiScatter += Fms * Ems; } #if NUM_RECT_AREA_LIGHTS > 0 void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { vec3 normal = geometryNormal; vec3 viewDir = geometryViewDir; vec3 position = geometryPosition; vec3 lightPos = rectAreaLight.position; vec3 halfWidth = rectAreaLight.halfWidth; vec3 halfHeight = rectAreaLight.halfHeight; vec3 lightColor = rectAreaLight.color; float roughness = material.roughness; vec3 rectCoords[ 4 ]; rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; vec2 uv = LTC_Uv( normal, viewDir, roughness ); vec4 t1 = texture2D( ltc_1, uv ); vec4 t2 = texture2D( ltc_2, uv ); mat3 mInv = mat3( vec3( t1.x, 0, t1.y ), vec3( 0, 1, 0 ), vec3( t1.z, 0, t1.w ) ); vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); } #endif void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; #ifdef USE_CLEARCOAT float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); vec3 ccIrradiance = dotNLcc * directLight.color; clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); #endif #ifdef USE_SHEEN sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); #endif reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { #ifdef USE_CLEARCOAT clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); #endif #ifdef USE_SHEEN sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); #endif vec3 singleScattering = vec3( 0.0 ); vec3 multiScattering = vec3( 0.0 ); vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; #ifdef USE_IRIDESCENCE computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); #else computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); #endif vec3 totalScattering = singleScattering + multiScattering; vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); reflectedLight.indirectSpecular += radiance * singleScattering; reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; } #define RE_Direct RE_Direct_Physical #define RE_Direct_RectArea RE_Direct_RectArea_Physical #define RE_IndirectDiffuse RE_IndirectDiffuse_Physical #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); }`,Mq=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); vec3 geometryClearcoatNormal = vec3( 0.0 ); #ifdef USE_CLEARCOAT geometryClearcoatNormal = clearcoatNormal; #endif #ifdef USE_IRIDESCENCE float dotNVi = saturate( dot( normal, geometryViewDir ) ); if ( material.iridescenceThickness == 0.0 ) { material.iridescence = 0.0; } else { material.iridescence = saturate( material.iridescence ); } if ( material.iridescence > 0.0 ) { material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); } #endif IncidentLight directLight; #if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) PointLight pointLight; #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 PointLightShadow pointLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { pointLight = pointLights[ i ]; getPointLightInfo( pointLight, geometryPosition, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) pointLightShadow = pointLightShadows[ i ]; directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; #endif RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) SpotLight spotLight; vec4 spotColor; vec3 spotLightCoord; bool inSpotLightMap; #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 SpotLightShadow spotLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { spotLight = spotLights[ i ]; getSpotLightInfo( spotLight, geometryPosition, directLight ); #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS #else #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) #endif #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; #endif #undef SPOT_LIGHT_MAP_INDEX #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) spotLightShadow = spotLightShadows[ i ]; directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; #endif RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) DirectionalLight directionalLight; #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 DirectionalLightShadow directionalLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { directionalLight = directionalLights[ i ]; getDirectionalLightInfo( directionalLight, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) directionalLightShadow = directionalLightShadows[ i ]; directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; #endif RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) RectAreaLight rectAreaLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { rectAreaLight = rectAreaLights[ i ]; RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); } #pragma unroll_loop_end #endif #if defined( RE_IndirectDiffuse ) vec3 iblIrradiance = vec3( 0.0 ); vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); #if defined( USE_LIGHT_PROBES ) irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); #endif #if ( NUM_HEMI_LIGHTS > 0 ) #pragma unroll_loop_start for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); } #pragma unroll_loop_end #endif #endif #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); #endif`,Cq=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; irradiance += lightMapIrradiance; #endif #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) iblIrradiance += getIBLIrradiance( geometryNormal ); #endif #endif #if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) #ifdef USE_ANISOTROPY radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); #else radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); #endif #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif #endif`,Eq=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif`,Lq=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif`,Pq=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; #endif`,Rq=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif #endif`,Dq=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); #else if ( isPerspectiveMatrix( projectionMatrix ) ) { gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; gl_Position.z *= gl_Position.w; } #endif #endif`,Iq=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vMapUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); #endif diffuseColor *= sampledDiffuseColor; #endif`,Nq=`#ifdef USE_MAP uniform sampler2D map; #endif`,kq=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; #endif #endif #ifdef USE_MAP diffuseColor *= texture2D( map, uv ); #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; #endif`,Oq=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) uniform mat3 uvTransform; #endif #endif #ifdef USE_MAP uniform sampler2D map; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; #endif`,Fq=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; #endif`,Bq=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; #endif`,zq=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; #elif defined( USE_COLOR ) if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } #endif`,Uq=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; } #else objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif #endif`,Vq=`#ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; uniform sampler2DArray morphTargetsTexture; uniform ivec2 morphTargetsTextureSize; vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; int y = texelIndex / morphTargetsTextureSize.x; int x = texelIndex - y * morphTargetsTextureSize.x; ivec3 morphUV = ivec3( x, y, morphTargetIndex ); return texelFetch( morphTargetsTexture, morphUV, 0 ); } #else #ifndef USE_MORPHNORMALS uniform float morphTargetInfluences[ 8 ]; #else uniform float morphTargetInfluences[ 4 ]; #endif #endif #endif`,Gq=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; } #else transformed += morphTarget0 * morphTargetInfluences[ 0 ]; transformed += morphTarget1 * morphTargetInfluences[ 1 ]; transformed += morphTarget2 * morphTargetInfluences[ 2 ]; transformed += morphTarget3 * morphTargetInfluences[ 3 ]; #ifndef USE_MORPHNORMALS transformed += morphTarget4 * morphTargetInfluences[ 4 ]; transformed += morphTarget5 * morphTargetInfluences[ 5 ]; transformed += morphTarget6 * morphTargetInfluences[ 6 ]; transformed += morphTarget7 * morphTargetInfluences[ 7 ]; #endif #endif #endif`,Hq=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); vec3 normal = normalize( cross( fdx, fdy ) ); #else vec3 normal = normalize( vNormal ); #ifdef DOUBLE_SIDED normal *= faceDirection; #endif #endif #if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) #ifdef USE_TANGENT mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); #else mat3 tbn = getTangentFrame( - vViewPosition, normal, #if defined( USE_NORMALMAP ) vNormalMapUv #elif defined( USE_CLEARCOAT_NORMALMAP ) vClearcoatNormalMapUv #else vUv #endif ); #endif #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) tbn[0] *= faceDirection; tbn[1] *= faceDirection; #endif #endif #ifdef USE_CLEARCOAT_NORMALMAP #ifdef USE_TANGENT mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); #else mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); #endif #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) tbn2[0] *= faceDirection; tbn2[1] *= faceDirection; #endif #endif vec3 nonPerturbedNormal = normal;`,Wq=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; #endif #ifdef DOUBLE_SIDED normal = normal * faceDirection; #endif normal = normalize( normalMatrix * normal ); #elif defined( USE_NORMALMAP_TANGENTSPACE ) vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; mapN.xy *= normalScale; normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); #endif`,$q=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif`,Xq=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif`,Yq=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif #endif`,qq=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif #ifdef USE_NORMALMAP_OBJECTSPACE uniform mat3 normalMatrix; #endif #if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { vec3 q0 = dFdx( eye_pos.xyz ); vec3 q1 = dFdy( eye_pos.xyz ); vec2 st0 = dFdx( uv.st ); vec2 st1 = dFdy( uv.st ); vec3 N = surf_norm; vec3 q1perp = cross( q1, N ); vec3 q0perp = cross( N, q0 ); vec3 T = q1perp * st0.x + q0perp * st1.x; vec3 B = q1perp * st0.y + q0perp * st1.y; float det = max( dot( T, T ), dot( B, B ) ); float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } #endif`,jq=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; #endif`,Kq=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); #endif`,Zq=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP uniform sampler2D clearcoatNormalMap; uniform vec2 clearcoatNormalScale; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; #endif`,Qq=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; #endif`,Jq=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,ej=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { return 2.0 * rgb.xyz - 1.0; } const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); const float ShiftRight8 = 1. / 256.; vec4 packDepthToRGBA( const in float v ) { vec4 r = vec4( fract( v * PackFactors ), v ); r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; } float unpackRGBAToDepth( const in vec4 v ) { return dot( v, UnpackFactors ); } vec2 packDepthToRG( in highp float v ) { return packDepthToRGBA( v ).yx; } float unpackRGToDepth( const in highp vec2 v ) { return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); } vec4 pack2HalfToRGBA( vec2 v ) { vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); } vec2 unpackRGBATo2Half( vec4 v ) { return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); } float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { return ( viewZ + near ) / ( near - far ); } float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { return depth * ( near - far ) - near; } float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); } float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * depth - far ); }`,tj=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; #endif`,nj=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif #ifdef USE_INSTANCING mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; gl_Position = projectionMatrix * mvPosition;`,rj=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); #endif`,ij=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } #endif`,aj=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; #endif`,oj=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; #endif`,sj=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; #endif #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; struct DirectionalLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; struct SpotLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; #endif #if NUM_POINT_LIGHT_SHADOWS > 0 uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; struct PointLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; float shadowCameraNear; float shadowCameraFar; }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); } vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { return unpackRGBATo2Half( texture2D( shadow, uv ) ); } float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ float occlusion = 1.0; vec2 distribution = texture2DDistribution( shadow, uv ); float hard_shadow = step( compare , distribution.x ); if (hard_shadow != 1.0 ) { float distance = compare - distribution.x ; float variance = max( 0.00000, distribution.y * distribution.y ); float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); } return occlusion; } float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { float shadow = 1.0; shadowCoord.xyz /= shadowCoord.w; shadowCoord.z += shadowBias; bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; bool frustumTest = inFrustum && shadowCoord.z <= 1.0; if ( frustumTest ) { #if defined( SHADOWMAP_TYPE_PCF ) vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float dx0 = - texelSize.x * shadowRadius; float dy0 = - texelSize.y * shadowRadius; float dx1 = + texelSize.x * shadowRadius; float dy1 = + texelSize.y * shadowRadius; float dx2 = dx0 / 2.0; float dy2 = dy0 / 2.0; float dx3 = dx1 / 2.0; float dy3 = dy1 / 2.0; shadow = ( texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) ) * ( 1.0 / 17.0 ); #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float dx = texelSize.x; float dy = texelSize.y; vec2 uv = shadowCoord.xy; vec2 f = fract( uv * shadowMapSize + 0.5 ); uv -= f * texelSize; shadow = ( texture2DCompare( shadowMap, uv, shadowCoord.z ) + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), f.x ) + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), f.x ) + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), f.y ) + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), f.y ) + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), f.x ), mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), f.x ), f.y ) ) * ( 1.0 / 9.0 ); #elif defined( SHADOWMAP_TYPE_VSM ) shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); #else shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); #endif } return shadow; } vec2 cubeToUV( vec3 v, float texelSizeY ) { vec3 absV = abs( v ); float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); absV *= scaleToCube; v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); vec2 planar = v.xy; float almostATexel = 1.5 * texelSizeY; float almostOne = 1.0 - almostATexel; if ( absV.z >= almostOne ) { if ( v.z > 0.0 ) planar.x = 4.0 - v.x; } else if ( absV.x >= almostOne ) { float signX = sign( v.x ); planar.x = v.z * signX + 2.0 * signX; } else if ( absV.y >= almostOne ) { float signY = sign( v.y ); planar.x = v.x + 2.0 * signY + 2.0; planar.y = v.z * signY - 2.0; } return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); } float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); vec3 lightToPosition = shadowCoord.xyz; float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; vec3 bd3D = normalize( lightToPosition ); #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; return ( texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) ) * ( 1.0 / 9.0 ); #else return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } #endif`,lj=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; struct DirectionalLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 struct SpotLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; #endif #if NUM_POINT_LIGHT_SHADOWS > 0 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; struct PointLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; float shadowCameraNear; float shadowCameraFar; }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif #endif`,uj=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif #if defined( USE_SHADOWMAP ) #if NUM_DIR_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #if NUM_POINT_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #endif #if NUM_SPOT_LIGHT_COORDS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { shadowWorldPosition = worldPosition; #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; #endif vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif`,cj=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 DirectionalLightShadow directionalLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { directionalLight = directionalLightShadows[ i ]; shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; } #pragma unroll_loop_end #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 SpotLightShadow spotLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { spotLight = spotLightShadows[ i ]; shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; } #pragma unroll_loop_end #endif #if NUM_POINT_LIGHT_SHADOWS > 0 PointLightShadow pointLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { pointLight = pointLightShadows[ i ]; shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; } #pragma unroll_loop_end #endif #endif return shadow; }`,hj=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); #endif`,fj=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; mat4 getBoneMatrix( const in float i ) { int size = textureSize( boneTexture, 0 ).x; int j = int( i ) * 4; int x = j % size; int y = j / size; vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } #endif`,dj=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; skinned += boneMatY * skinVertex * skinWeight.y; skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; #endif`,pj=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; skinMatrix += skinWeight.z * boneMatZ; skinMatrix += skinWeight.w * boneMatW; skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif #endif`,vj=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; #endif`,gj=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; #endif`,mj=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); #endif`,yj=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; vec3 LinearToneMapping( vec3 color ) { return saturate( toneMappingExposure * color ); } vec3 ReinhardToneMapping( vec3 color ) { color *= toneMappingExposure; return saturate( color / ( vec3( 1.0 ) + color ) ); } vec3 OptimizedCineonToneMapping( vec3 color ) { color *= toneMappingExposure; color = max( vec3( 0.0 ), color - 0.004 ); return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); } vec3 RRTAndODTFit( vec3 v ) { vec3 a = v * ( v + 0.0245786 ) - 0.000090537; vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; return a / b; } vec3 ACESFilmicToneMapping( vec3 color ) { const mat3 ACESInputMat = mat3( vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), vec3( 0.04823, 0.01566, 0.83777 ) ); const mat3 ACESOutputMat = mat3( vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), vec3( -0.07367, -0.00605, 1.07602 ) ); color *= toneMappingExposure / 0.6; color = ACESInputMat * color; color = RRTAndODTFit( color ); color = ACESOutputMat * color; return saturate( color ); } const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( vec3( 1.6605, - 0.1246, - 0.0182 ), vec3( - 0.5876, 1.1329, - 0.1006 ), vec3( - 0.0728, - 0.0083, 1.1187 ) ); const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( vec3( 0.6274, 0.0691, 0.0164 ), vec3( 0.3293, 0.9195, 0.0880 ), vec3( 0.0433, 0.0113, 0.8956 ) ); vec3 agxDefaultContrastApprox( vec3 x ) { vec3 x2 = x * x; vec3 x4 = x2 * x2; return + 15.5 * x4 * x2 - 40.14 * x4 * x + 31.96 * x4 - 6.868 * x2 * x + 0.4298 * x2 + 0.1191 * x - 0.00232; } vec3 AgXToneMapping( vec3 color ) { const mat3 AgXInsetMatrix = mat3( vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) ); const mat3 AgXOutsetMatrix = mat3( vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) ); const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; color *= toneMappingExposure; color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; color = AgXInsetMatrix * color; color = max( color, 1e-10 ); color = log2( color ); color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); color = clamp( color, 0.0, 1.0 ); color = agxDefaultContrastApprox( color ); color = AgXOutsetMatrix * color; color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); color = LINEAR_REC2020_TO_LINEAR_SRGB * color; color = clamp( color, 0.0, 1.0 ); return color; } vec3 CustomToneMapping( vec3 color ) { return color; }`,_j=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; material.attenuationDistance = attenuationDistance; material.attenuationColor = attenuationColor; #ifdef USE_TRANSMISSIONMAP material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; #endif #ifdef USE_THICKNESSMAP material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; #endif vec3 pos = vWorldPosition; vec3 v = normalize( cameraPosition - pos ); vec3 n = inverseTransformDirection( normal, viewMatrix ); vec4 transmitted = getIBLVolumeRefraction( n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness, material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); #endif`,xj=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; uniform vec3 attenuationColor; #ifdef USE_TRANSMISSIONMAP uniform sampler2D transmissionMap; #endif #ifdef USE_THICKNESSMAP uniform sampler2D thicknessMap; #endif uniform vec2 transmissionSamplerSize; uniform sampler2D transmissionSamplerMap; uniform mat4 modelMatrix; uniform mat4 projectionMatrix; varying vec3 vWorldPosition; float w0( float a ) { return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); } float w1( float a ) { return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); } float w2( float a ){ return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); } float w3( float a ) { return ( 1.0 / 6.0 ) * ( a * a * a ); } float g0( float a ) { return w0( a ) + w1( a ); } float g1( float a ) { return w2( a ) + w3( a ); } float h0( float a ) { return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); } float h1( float a ) { return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); } vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { uv = uv * texelSize.zw + 0.5; vec2 iuv = floor( uv ); vec2 fuv = fract( uv ); float g0x = g0( fuv.x ); float g1x = g1( fuv.x ); float h0x = h0( fuv.x ); float h1x = h1( fuv.x ); float h0y = h0( fuv.y ); float h1y = h1( fuv.y ); vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); } vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); vec2 fLodSizeInv = 1.0 / fLodSize; vec2 cLodSizeInv = 1.0 / cLodSize; vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); return mix( fSample, cSample, fract( lod ) ); } vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); vec3 modelScale; modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); return normalize( refractionVector ) * thickness * modelScale; } float applyIorToRoughness( const in float roughness, const in float ior ) { return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); } vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); } vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { if ( isinf( attenuationDistance ) ) { return vec3( 1.0 ); } else { vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; } } vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness, const in vec3 attenuationColor, const in float attenuationDistance ) { vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); vec3 refractedRayExit = position + transmissionRay; vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); vec2 refractionCoords = ndcPos.xy / ndcPos.w; refractionCoords += 1.0; refractionCoords /= 2.0; vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); vec3 attenuatedColor = transmittance * transmittedLight.rgb; vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); } #endif`,Sj=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP varying vec2 vMapUv; #endif #ifdef USE_ALPHAMAP varying vec2 vAlphaMapUv; #endif #ifdef USE_LIGHTMAP varying vec2 vLightMapUv; #endif #ifdef USE_AOMAP varying vec2 vAoMapUv; #endif #ifdef USE_BUMPMAP varying vec2 vBumpMapUv; #endif #ifdef USE_NORMALMAP varying vec2 vNormalMapUv; #endif #ifdef USE_EMISSIVEMAP varying vec2 vEmissiveMapUv; #endif #ifdef USE_METALNESSMAP varying vec2 vMetalnessMapUv; #endif #ifdef USE_ROUGHNESSMAP varying vec2 vRoughnessMapUv; #endif #ifdef USE_ANISOTROPYMAP varying vec2 vAnisotropyMapUv; #endif #ifdef USE_CLEARCOATMAP varying vec2 vClearcoatMapUv; #endif #ifdef USE_CLEARCOAT_NORMALMAP varying vec2 vClearcoatNormalMapUv; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP varying vec2 vClearcoatRoughnessMapUv; #endif #ifdef USE_IRIDESCENCEMAP varying vec2 vIridescenceMapUv; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP varying vec2 vIridescenceThicknessMapUv; #endif #ifdef USE_SHEEN_COLORMAP varying vec2 vSheenColorMapUv; #endif #ifdef USE_SHEEN_ROUGHNESSMAP varying vec2 vSheenRoughnessMapUv; #endif #ifdef USE_SPECULARMAP varying vec2 vSpecularMapUv; #endif #ifdef USE_SPECULAR_COLORMAP varying vec2 vSpecularColorMapUv; #endif #ifdef USE_SPECULAR_INTENSITYMAP varying vec2 vSpecularIntensityMapUv; #endif #ifdef USE_TRANSMISSIONMAP uniform mat3 transmissionMapTransform; varying vec2 vTransmissionMapUv; #endif #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; #endif`,Aj=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP uniform mat3 mapTransform; varying vec2 vMapUv; #endif #ifdef USE_ALPHAMAP uniform mat3 alphaMapTransform; varying vec2 vAlphaMapUv; #endif #ifdef USE_LIGHTMAP uniform mat3 lightMapTransform; varying vec2 vLightMapUv; #endif #ifdef USE_AOMAP uniform mat3 aoMapTransform; varying vec2 vAoMapUv; #endif #ifdef USE_BUMPMAP uniform mat3 bumpMapTransform; varying vec2 vBumpMapUv; #endif #ifdef USE_NORMALMAP uniform mat3 normalMapTransform; varying vec2 vNormalMapUv; #endif #ifdef USE_DISPLACEMENTMAP uniform mat3 displacementMapTransform; varying vec2 vDisplacementMapUv; #endif #ifdef USE_EMISSIVEMAP uniform mat3 emissiveMapTransform; varying vec2 vEmissiveMapUv; #endif #ifdef USE_METALNESSMAP uniform mat3 metalnessMapTransform; varying vec2 vMetalnessMapUv; #endif #ifdef USE_ROUGHNESSMAP uniform mat3 roughnessMapTransform; varying vec2 vRoughnessMapUv; #endif #ifdef USE_ANISOTROPYMAP uniform mat3 anisotropyMapTransform; varying vec2 vAnisotropyMapUv; #endif #ifdef USE_CLEARCOATMAP uniform mat3 clearcoatMapTransform; varying vec2 vClearcoatMapUv; #endif #ifdef USE_CLEARCOAT_NORMALMAP uniform mat3 clearcoatNormalMapTransform; varying vec2 vClearcoatNormalMapUv; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform mat3 clearcoatRoughnessMapTransform; varying vec2 vClearcoatRoughnessMapUv; #endif #ifdef USE_SHEEN_COLORMAP uniform mat3 sheenColorMapTransform; varying vec2 vSheenColorMapUv; #endif #ifdef USE_SHEEN_ROUGHNESSMAP uniform mat3 sheenRoughnessMapTransform; varying vec2 vSheenRoughnessMapUv; #endif #ifdef USE_IRIDESCENCEMAP uniform mat3 iridescenceMapTransform; varying vec2 vIridescenceMapUv; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform mat3 iridescenceThicknessMapTransform; varying vec2 vIridescenceThicknessMapUv; #endif #ifdef USE_SPECULARMAP uniform mat3 specularMapTransform; varying vec2 vSpecularMapUv; #endif #ifdef USE_SPECULAR_COLORMAP uniform mat3 specularColorMapTransform; varying vec2 vSpecularColorMapUv; #endif #ifdef USE_SPECULAR_INTENSITYMAP uniform mat3 specularIntensityMapTransform; varying vec2 vSpecularIntensityMapUv; #endif #ifdef USE_TRANSMISSIONMAP uniform mat3 transmissionMapTransform; varying vec2 vTransmissionMapUv; #endif #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; #endif`,wj=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; #endif #ifdef USE_ALPHAMAP vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; #endif #ifdef USE_LIGHTMAP vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; #endif #ifdef USE_AOMAP vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; #endif #ifdef USE_BUMPMAP vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; #endif #ifdef USE_NORMALMAP vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; #endif #ifdef USE_DISPLACEMENTMAP vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; #endif #ifdef USE_EMISSIVEMAP vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; #endif #ifdef USE_METALNESSMAP vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_ROUGHNESSMAP vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_ANISOTROPYMAP vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; #endif #ifdef USE_CLEARCOATMAP vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; #endif #ifdef USE_CLEARCOAT_NORMALMAP vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_IRIDESCENCEMAP vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_SHEEN_COLORMAP vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; #endif #ifdef USE_SHEEN_ROUGHNESSMAP vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_SPECULARMAP vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; #endif #ifdef USE_SPECULAR_COLORMAP vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; #endif #ifdef USE_SPECULAR_INTENSITYMAP vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; #endif #ifdef USE_TRANSMISSIONMAP vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; #endif`,bj=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING worldPosition = batchingMatrix * worldPosition; #endif #ifdef USE_INSTANCING worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; #endif`;const Tj=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); }`,Mj=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { vec4 texColor = texture2D( t2D, vUv ); #ifdef DECODE_VIDEO_TEXTURE texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); #endif texColor.rgb *= backgroundIntensity; gl_FragColor = texColor; #include #include }`,Cj=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; }`,Ej=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; #endif uniform float flipEnvMap; uniform float backgroundBlurriness; uniform float backgroundIntensity; varying vec3 vWorldDirection; #include void main() { #ifdef ENVMAP_TYPE_CUBE vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); #elif defined( ENVMAP_TYPE_CUBE_UV ) vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness ); #else vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); #endif texColor.rgb *= backgroundIntensity; gl_FragColor = texColor; #include #include }`,Lj=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; }`,Pj=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; void main() { vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); gl_FragColor = texColor; gl_FragColor.a *= opacity; #include #include }`,Rj=`#include #include #include #include #include #include #include #include varying vec2 vHighPrecisionZW; void main() { #include #include #include #ifdef USE_DISPLACEMENTMAP #include #include #include #endif #include #include #include #include #include #include #include vHighPrecisionZW = gl_Position.zw; }`,Dj=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include #include #include #include #include #include #include #include #include varying vec2 vHighPrecisionZW; void main() { vec4 diffuseColor = vec4( 1.0 ); #include #if DEPTH_PACKING == 3200 diffuseColor.a = opacity; #endif #include #include #include #include #include float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; #if DEPTH_PACKING == 3200 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #endif }`,Ij=`#define DISTANCE varying vec3 vWorldPosition; #include #include #include #include #include #include #include void main() { #include #include #include #ifdef USE_DISPLACEMENTMAP #include #include #include #endif #include #include #include #include #include #include #include vWorldPosition = worldPosition.xyz; }`,Nj=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; varying vec3 vWorldPosition; #include #include #include #include #include #include #include #include void main () { vec4 diffuseColor = vec4( 1.0 ); #include #include #include #include #include float dist = length( vWorldPosition - referencePosition ); dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); }`,kj=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include }`,Oj=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include }`,Fj=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include #include #include #include #include #include #include void main() { vLineDistance = scale * lineDistance; #include #include #include #include #include #include #include #include #include }`,Bj=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; varying float vLineDistance; #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include if ( mod( vLineDistance, totalSize ) > dashSize ) { discard; } vec3 outgoingLight = vec3( 0.0 ); #include #include #include outgoingLight = diffuseColor.rgb; #include #include #include #include #include }`,zj=`#include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) #include #include #include #include #include #endif #include #include #include #include #include #include #include #include #include }`,Uj=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include #include #include #include #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; #else reflectedLight.indirectDiffuse += vec3( 1.0 ); #endif #include reflectedLight.indirectDiffuse *= diffuseColor.rgb; vec3 outgoingLight = reflectedLight.indirectDiffuse; #include #include #include #include #include #include #include }`,Vj=`#define LAMBERT varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #include }`,Gj=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; #include #include #include #include #include #include #include }`,Hj=`#define MATCAP varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; }`,Wj=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include #include #include #include #include #include vec3 viewDir = normalize( vViewPosition ); vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); vec3 y = cross( viewDir, x ); vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; #ifdef USE_MATCAP vec4 matcapColor = texture2D( matcap, uv ); #else vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); #endif vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; #include #include #include #include #include #include }`,$j=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif }`,Xj=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); #include #include #include #include gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); #ifdef OPAQUE gl_FragColor.a = 1.0; #endif }`,Yj=`#define PHONG varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #include }`,qj=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; uniform float shininess; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; #include #include #include #include #include #include #include }`,jj=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; #endif #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif }`,Kj=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR #endif uniform vec3 diffuse; uniform vec3 emissive; uniform float roughness; uniform float metalness; uniform float opacity; #ifdef IOR uniform float ior; #endif #ifdef USE_SPECULAR uniform float specularIntensity; uniform vec3 specularColor; #ifdef USE_SPECULAR_COLORMAP uniform sampler2D specularColorMap; #endif #ifdef USE_SPECULAR_INTENSITYMAP uniform sampler2D specularIntensityMap; #endif #endif #ifdef USE_CLEARCOAT uniform float clearcoat; uniform float clearcoatRoughness; #endif #ifdef USE_IRIDESCENCE uniform float iridescence; uniform float iridescenceIOR; uniform float iridescenceThicknessMinimum; uniform float iridescenceThicknessMaximum; #endif #ifdef USE_SHEEN uniform vec3 sheenColor; uniform float sheenRoughness; #ifdef USE_SHEEN_COLORMAP uniform sampler2D sheenColorMap; #endif #ifdef USE_SHEEN_ROUGHNESSMAP uniform sampler2D sheenRoughnessMap; #endif #endif #ifdef USE_ANISOTROPY uniform vec2 anisotropyVector; #ifdef USE_ANISOTROPYMAP uniform sampler2D anisotropyMap; #endif #endif varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; #include vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; #ifdef USE_SHEEN float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; #endif #ifdef USE_CLEARCOAT float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; #endif #include #include #include #include #include #include }`,Zj=`#define TOON varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include }`,Qj=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; #include #include #include #include #include #include }`,Jj=`uniform float size; uniform float scale; #include #include #include #include #include #include #ifdef USE_POINTS_UV varying vec2 vUv; uniform mat3 uvTransform; #endif void main() { #ifdef USE_POINTS_UV vUv = ( uvTransform * vec3( uv, 1 ) ).xy; #endif #include #include #include #include #include gl_PointSize = size; #ifdef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); #endif #include #include #include #include }`,eK=`uniform vec3 diffuse; uniform float opacity; #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include vec3 outgoingLight = vec3( 0.0 ); #include #include #include #include #include outgoingLight = diffuseColor.rgb; #include #include #include #include #include }`,tK=`#include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include }`,nK=`uniform vec3 color; uniform float opacity; #include #include #include #include #include #include #include #include void main() { #include gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); #include #include #include }`,rK=`uniform float rotation; uniform vec2 center; #include #include #include #include #include void main() { #include vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); vec2 scale; scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); #ifndef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) scale *= - mvPosition.z; #endif vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; vec2 rotatedPosition; rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; mvPosition.xy += rotatedPosition; gl_Position = projectionMatrix * mvPosition; #include #include #include }`,iK=`uniform vec3 diffuse; uniform float opacity; #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include vec3 outgoingLight = vec3( 0.0 ); #include #include #include #include #include outgoingLight = diffuseColor.rgb; #include #include #include #include }`,It={alphahash_fragment:MY,alphahash_pars_fragment:CY,alphamap_fragment:EY,alphamap_pars_fragment:LY,alphatest_fragment:PY,alphatest_pars_fragment:RY,aomap_fragment:DY,aomap_pars_fragment:IY,batching_pars_vertex:NY,batching_vertex:kY,begin_vertex:OY,beginnormal_vertex:FY,bsdfs:BY,iridescence_fragment:zY,bumpmap_pars_fragment:UY,clipping_planes_fragment:VY,clipping_planes_pars_fragment:GY,clipping_planes_pars_vertex:HY,clipping_planes_vertex:WY,color_fragment:$Y,color_pars_fragment:XY,color_pars_vertex:YY,color_vertex:qY,common:jY,cube_uv_reflection_fragment:KY,defaultnormal_vertex:ZY,displacementmap_pars_vertex:QY,displacementmap_vertex:JY,emissivemap_fragment:eq,emissivemap_pars_fragment:tq,colorspace_fragment:nq,colorspace_pars_fragment:rq,envmap_fragment:iq,envmap_common_pars_fragment:aq,envmap_pars_fragment:oq,envmap_pars_vertex:sq,envmap_physical_pars_fragment:_q,envmap_vertex:lq,fog_vertex:uq,fog_pars_vertex:cq,fog_fragment:hq,fog_pars_fragment:fq,gradientmap_pars_fragment:dq,lightmap_fragment:pq,lightmap_pars_fragment:vq,lights_lambert_fragment:gq,lights_lambert_pars_fragment:mq,lights_pars_begin:yq,lights_toon_fragment:xq,lights_toon_pars_fragment:Sq,lights_phong_fragment:Aq,lights_phong_pars_fragment:wq,lights_physical_fragment:bq,lights_physical_pars_fragment:Tq,lights_fragment_begin:Mq,lights_fragment_maps:Cq,lights_fragment_end:Eq,logdepthbuf_fragment:Lq,logdepthbuf_pars_fragment:Pq,logdepthbuf_pars_vertex:Rq,logdepthbuf_vertex:Dq,map_fragment:Iq,map_pars_fragment:Nq,map_particle_fragment:kq,map_particle_pars_fragment:Oq,metalnessmap_fragment:Fq,metalnessmap_pars_fragment:Bq,morphcolor_vertex:zq,morphnormal_vertex:Uq,morphtarget_pars_vertex:Vq,morphtarget_vertex:Gq,normal_fragment_begin:Hq,normal_fragment_maps:Wq,normal_pars_fragment:$q,normal_pars_vertex:Xq,normal_vertex:Yq,normalmap_pars_fragment:qq,clearcoat_normal_fragment_begin:jq,clearcoat_normal_fragment_maps:Kq,clearcoat_pars_fragment:Zq,iridescence_pars_fragment:Qq,opaque_fragment:Jq,packing:ej,premultiplied_alpha_fragment:tj,project_vertex:nj,dithering_fragment:rj,dithering_pars_fragment:ij,roughnessmap_fragment:aj,roughnessmap_pars_fragment:oj,shadowmap_pars_fragment:sj,shadowmap_pars_vertex:lj,shadowmap_vertex:uj,shadowmask_pars_fragment:cj,skinbase_vertex:hj,skinning_pars_vertex:fj,skinning_vertex:dj,skinnormal_vertex:pj,specularmap_fragment:vj,specularmap_pars_fragment:gj,tonemapping_fragment:mj,tonemapping_pars_fragment:yj,transmission_fragment:_j,transmission_pars_fragment:xj,uv_pars_fragment:Sj,uv_pars_vertex:Aj,uv_vertex:wj,worldpos_vertex:bj,background_vert:Tj,background_frag:Mj,backgroundCube_vert:Cj,backgroundCube_frag:Ej,cube_vert:Lj,cube_frag:Pj,depth_vert:Rj,depth_frag:Dj,distanceRGBA_vert:Ij,distanceRGBA_frag:Nj,equirect_vert:kj,equirect_frag:Oj,linedashed_vert:Fj,linedashed_frag:Bj,meshbasic_vert:zj,meshbasic_frag:Uj,meshlambert_vert:Vj,meshlambert_frag:Gj,meshmatcap_vert:Hj,meshmatcap_frag:Wj,meshnormal_vert:$j,meshnormal_frag:Xj,meshphong_vert:Yj,meshphong_frag:qj,meshphysical_vert:jj,meshphysical_frag:Kj,meshtoon_vert:Zj,meshtoon_frag:Qj,points_vert:Jj,points_frag:eK,shadow_vert:tK,shadow_frag:nK,sprite_vert:rK,sprite_frag:iK},Ve={common:{diffuse:{value:new nt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ht},alphaMap:{value:null},alphaMapTransform:{value:new Ht},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ht}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ht}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ht}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ht},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ht},normalScale:{value:new Me(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ht},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ht}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ht}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ht}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new nt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new nt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ht},alphaTest:{value:0},uvTransform:{value:new Ht}},sprite:{diffuse:{value:new nt(16777215)},opacity:{value:1},center:{value:new Me(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ht},alphaMap:{value:null},alphaMapTransform:{value:new Ht},alphaTest:{value:0}}},Ai={basic:{uniforms:ui([Ve.common,Ve.specularmap,Ve.envmap,Ve.aomap,Ve.lightmap,Ve.fog]),vertexShader:It.meshbasic_vert,fragmentShader:It.meshbasic_frag},lambert:{uniforms:ui([Ve.common,Ve.specularmap,Ve.envmap,Ve.aomap,Ve.lightmap,Ve.emissivemap,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,Ve.fog,Ve.lights,{emissive:{value:new nt(0)}}]),vertexShader:It.meshlambert_vert,fragmentShader:It.meshlambert_frag},phong:{uniforms:ui([Ve.common,Ve.specularmap,Ve.envmap,Ve.aomap,Ve.lightmap,Ve.emissivemap,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,Ve.fog,Ve.lights,{emissive:{value:new nt(0)},specular:{value:new nt(1118481)},shininess:{value:30}}]),vertexShader:It.meshphong_vert,fragmentShader:It.meshphong_frag},standard:{uniforms:ui([Ve.common,Ve.envmap,Ve.aomap,Ve.lightmap,Ve.emissivemap,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,Ve.roughnessmap,Ve.metalnessmap,Ve.fog,Ve.lights,{emissive:{value:new nt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:It.meshphysical_vert,fragmentShader:It.meshphysical_frag},toon:{uniforms:ui([Ve.common,Ve.aomap,Ve.lightmap,Ve.emissivemap,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,Ve.gradientmap,Ve.fog,Ve.lights,{emissive:{value:new nt(0)}}]),vertexShader:It.meshtoon_vert,fragmentShader:It.meshtoon_frag},matcap:{uniforms:ui([Ve.common,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,Ve.fog,{matcap:{value:null}}]),vertexShader:It.meshmatcap_vert,fragmentShader:It.meshmatcap_frag},points:{uniforms:ui([Ve.points,Ve.fog]),vertexShader:It.points_vert,fragmentShader:It.points_frag},dashed:{uniforms:ui([Ve.common,Ve.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:It.linedashed_vert,fragmentShader:It.linedashed_frag},depth:{uniforms:ui([Ve.common,Ve.displacementmap]),vertexShader:It.depth_vert,fragmentShader:It.depth_frag},normal:{uniforms:ui([Ve.common,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,{opacity:{value:1}}]),vertexShader:It.meshnormal_vert,fragmentShader:It.meshnormal_frag},sprite:{uniforms:ui([Ve.sprite,Ve.fog]),vertexShader:It.sprite_vert,fragmentShader:It.sprite_frag},background:{uniforms:{uvTransform:{value:new Ht},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:It.background_vert,fragmentShader:It.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:It.backgroundCube_vert,fragmentShader:It.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:It.cube_vert,fragmentShader:It.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:It.equirect_vert,fragmentShader:It.equirect_frag},distanceRGBA:{uniforms:ui([Ve.common,Ve.displacementmap,{referencePosition:{value:new X},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:It.distanceRGBA_vert,fragmentShader:It.distanceRGBA_frag},shadow:{uniforms:ui([Ve.lights,Ve.fog,{color:{value:new nt(0)},opacity:{value:1}}]),vertexShader:It.shadow_vert,fragmentShader:It.shadow_frag}};Ai.physical={uniforms:ui([Ai.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ht},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ht},clearcoatNormalScale:{value:new Me(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ht},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ht},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ht},sheen:{value:0},sheenColor:{value:new nt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ht},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ht},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ht},transmissionSamplerSize:{value:new Me},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ht},attenuationDistance:{value:0},attenuationColor:{value:new nt(0)},specularColor:{value:new nt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ht},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ht},anisotropyVector:{value:new Me},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ht}}]),vertexShader:It.meshphysical_vert,fragmentShader:It.meshphysical_frag};const cm={r:0,b:0,g:0};function aK(r,e,t,n,i,a,o){const s=new nt(0);let l=a===!0?0:1,u,c,h=null,f=0,d=null;function p(v,m){let y=!1,_=m.isScene===!0?m.background:null;_&&_.isTexture&&(_=(m.backgroundBlurriness>0?t:e).get(_)),_===null?g(s,l):_&&_.isColor&&(g(_,1),y=!0);const x=r.xr.getEnvironmentBlendMode();x==="additive"?n.buffers.color.setClear(0,0,0,1,o):x==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(r.autoClear||y)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),_&&(_.isCubeTexture||_.mapping===Z_)?(c===void 0&&(c=new rn(new ld(1,1,1),new Ls({name:"BackgroundCubeMaterial",uniforms:Wf(Ai.backgroundCube.uniforms),vertexShader:Ai.backgroundCube.vertexShader,fragmentShader:Ai.backgroundCube.fragmentShader,side:Di,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(S,A,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(c)),c.material.uniforms.envMap.value=_,c.material.uniforms.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,c.material.uniforms.backgroundBlurriness.value=m.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=m.backgroundIntensity,c.material.toneMapped=ln.getTransfer(_.colorSpace)!==Ln,(h!==_||f!==_.version||d!==r.toneMapping)&&(c.material.needsUpdate=!0,h=_,f=_.version,d=r.toneMapping),c.layers.enableAll(),v.unshift(c,c.geometry,c.material,0,0,null)):_&&_.isTexture&&(u===void 0&&(u=new rn(new Za(2,2),new Ls({name:"BackgroundMaterial",uniforms:Wf(Ai.background.uniforms),vertexShader:Ai.background.vertexShader,fragmentShader:Ai.background.fragmentShader,side:Es,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=_,u.material.uniforms.backgroundIntensity.value=m.backgroundIntensity,u.material.toneMapped=ln.getTransfer(_.colorSpace)!==Ln,_.matrixAutoUpdate===!0&&_.updateMatrix(),u.material.uniforms.uvTransform.value.copy(_.matrix),(h!==_||f!==_.version||d!==r.toneMapping)&&(u.material.needsUpdate=!0,h=_,f=_.version,d=r.toneMapping),u.layers.enableAll(),v.unshift(u,u.geometry,u.material,0,0,null))}function g(v,m){v.getRGB(cm,Az(r)),n.buffers.color.setClear(cm.r,cm.g,cm.b,m,o)}return{getClearColor:function(){return s},setClearColor:function(v,m=1){s.set(v),l=m,g(s,l)},getClearAlpha:function(){return l},setClearAlpha:function(v){l=v,g(s,l)},render:p}}function oK(r,e,t,n){const i=r.getParameter(r.MAX_VERTEX_ATTRIBS),a=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||a!==null,s={},l=v(null);let u=l,c=!1;function h(L,E,I,N,R){let F=!1;if(o){const O=g(N,I,E);u!==O&&(u=O,d(u.object)),F=m(L,N,I,R),F&&y(L,N,I,R)}else{const O=E.wireframe===!0;(u.geometry!==N.id||u.program!==I.id||u.wireframe!==O)&&(u.geometry=N.id,u.program=I.id,u.wireframe=O,F=!0)}R!==null&&t.update(R,r.ELEMENT_ARRAY_BUFFER),(F||c)&&(c=!1,M(L,E,I,N),R!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(R).buffer))}function f(){return n.isWebGL2?r.createVertexArray():a.createVertexArrayOES()}function d(L){return n.isWebGL2?r.bindVertexArray(L):a.bindVertexArrayOES(L)}function p(L){return n.isWebGL2?r.deleteVertexArray(L):a.deleteVertexArrayOES(L)}function g(L,E,I){const N=I.wireframe===!0;let R=s[L.id];R===void 0&&(R={},s[L.id]=R);let F=R[E.id];F===void 0&&(F={},R[E.id]=F);let O=F[N];return O===void 0&&(O=v(f()),F[N]=O),O}function v(L){const E=[],I=[],N=[];for(let R=0;R=0){const W=R[H];let Z=F[H];if(Z===void 0&&(H==="instanceMatrix"&&L.instanceMatrix&&(Z=L.instanceMatrix),H==="instanceColor"&&L.instanceColor&&(Z=L.instanceColor)),W===void 0||W.attribute!==Z||Z&&W.data!==Z.data)return!0;O++}return u.attributesNum!==O||u.index!==N}function y(L,E,I,N){const R={},F=E.attributes;let O=0;const V=I.getAttributes();for(const H in V)if(V[H].location>=0){let W=F[H];W===void 0&&(H==="instanceMatrix"&&L.instanceMatrix&&(W=L.instanceMatrix),H==="instanceColor"&&L.instanceColor&&(W=L.instanceColor));const Z={};Z.attribute=W,W&&W.data&&(Z.data=W.data),R[H]=Z,O++}u.attributes=R,u.attributesNum=O,u.index=N}function _(){const L=u.newAttributes;for(let E=0,I=L.length;E=0){let Q=R[V];if(Q===void 0&&(V==="instanceMatrix"&&L.instanceMatrix&&(Q=L.instanceMatrix),V==="instanceColor"&&L.instanceColor&&(Q=L.instanceColor)),Q!==void 0){const W=Q.normalized,Z=Q.itemSize,ee=t.get(Q);if(ee===void 0)continue;const he=ee.buffer,le=ee.type,re=ee.bytesPerElement,be=n.isWebGL2===!0&&(le===r.INT||le===r.UNSIGNED_INT||Q.gpuType===az);if(Q.isInterleavedBufferAttribute){const de=Q.data,U=de.stride,K=Q.offset;if(de.isInstancedInterleavedBuffer){for(let te=0;te0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";w="mediump"}return w==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext!="undefined"&&r.constructor.name==="WebGL2RenderingContext";let s=t.precision!==void 0?t.precision:"highp";const l=a(s);l!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",l,"instead."),s=l);const u=o||e.has("WEBGL_draw_buffers"),c=t.logarithmicDepthBuffer===!0,h=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),f=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=r.getParameter(r.MAX_TEXTURE_SIZE),p=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),g=r.getParameter(r.MAX_VERTEX_ATTRIBS),v=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),m=r.getParameter(r.MAX_VARYING_VECTORS),y=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),_=f>0,x=o||e.has("OES_texture_float"),S=_&&x,A=o?r.getParameter(r.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:i,getMaxPrecision:a,precision:s,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:f,maxTextureSize:d,maxCubemapSize:p,maxAttributes:g,maxVertexUniforms:v,maxVaryings:m,maxFragmentUniforms:y,vertexTextures:_,floatFragmentTextures:x,floatVertexTextures:S,maxSamples:A}}function uK(r){const e=this;let t=null,n=0,i=!1,a=!1;const o=new cl,s=new Ht,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,f){const d=h.length!==0||f||n!==0||i;return i=f,n=h.length,d},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(h,f){t=c(h,f,0)},this.setState=function(h,f,d){const p=h.clippingPlanes,g=h.clipIntersection,v=h.clipShadows,m=r.get(h);if(!i||p===null||p.length===0||a&&!v)a?c(null):u();else{const y=a?0:n,_=y*4;let x=m.clippingState||null;l.value=x,x=c(p,f,_,d);for(let S=0;S!==_;++S)x[S]=t[S];m.clippingState=x,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=y}};function u(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function c(h,f,d,p){const g=h!==null?h.length:0;let v=null;if(g!==0){if(v=l.value,p!==!0||v===null){const m=d+g*4,y=f.matrixWorldInverse;s.getNormalMatrix(y),(v===null||v.length0){const u=new AY(l.height);return u.fromEquirectangularTexture(r,o),e.set(o,u),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){const s=o.target;s.removeEventListener("dispose",i);const l=e.get(s);l!==void 0&&(e.delete(s),l.dispose())}function a(){e=new WeakMap}return{get:n,dispose:a}}class e1 extends wz{constructor(e=-1,t=1,n=1,i=-1,a=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=a,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,a,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=a,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let a=n-e,o=n+e,s=i+t,l=i-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=u*this.view.offsetX,o=a+u*this.view.width,s-=c*this.view.offsetY,l=s-c*this.view.height}this.projectionMatrix.makeOrthographic(a,o,s,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const cf=4,kP=[.125,.215,.35,.446,.526,.582],Ku=20,Xx=new e1,OP=new nt;let Yx=null,qx=0,jx=0;const Hu=(1+Math.sqrt(5))/2,wh=1/Hu,FP=[new X(1,1,1),new X(-1,1,1),new X(1,1,-1),new X(-1,1,-1),new X(0,Hu,wh),new X(0,Hu,-wh),new X(wh,0,Hu),new X(-wh,0,Hu),new X(Hu,wh,0),new X(-Hu,wh,0)];class BP{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Yx=this._renderer.getRenderTarget(),qx=this._renderer.getActiveCubeFace(),jx=this._renderer.getActiveMipmapLevel(),this._setSize(256);const a=this._allocateTargets();return a.depthBuffer=!0,this._sceneToCubeUV(e,n,i,a),t>0&&this._blur(a,0,0,t),this._applyPMREM(a),this._cleanup(a),a}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=VP(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=UP(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?_:0,_,_),c.setRenderTarget(i),g&&c.render(p,s),c.render(e,s)}p.geometry.dispose(),p.material.dispose(),c.toneMapping=f,c.autoClear=h,e.background=v}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===zf||e.mapping===Uf;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=VP()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=UP());const a=i?this._cubemapMaterial:this._equirectMaterial,o=new rn(this._lodPlanes[0],a),s=a.uniforms;s.envMap.value=e;const l=this._cubeSize;hm(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(o,Xx)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;iKu&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${Ku}`);const m=[];let y=0;for(let w=0;w_-cf?i-_+cf:0),A=4*(this._cubeSize-x);hm(t,S,A,3*x,2*x),l.setRenderTarget(t),l.render(h,Xx)}}function hK(r){const e=[],t=[],n=[];let i=r;const a=r-cf+1+kP.length;for(let o=0;or-cf?l=kP[o-r+cf-1]:o===0&&(l=0),n.push(l);const u=1/(s-2),c=-u,h=1+u,f=[c,c,h,c,h,h,c,c,h,h,c,h],d=6,p=6,g=3,v=2,m=1,y=new Float32Array(g*p*d),_=new Float32Array(v*p*d),x=new Float32Array(m*p*d);for(let A=0;A2?0:-1,C=[w,M,0,w+2/3,M,0,w+2/3,M+1,0,w,M,0,w+2/3,M+1,0,w,M+1,0];y.set(C,g*p*A),_.set(f,v*p*A);const b=[A,A,A,A,A,A];x.set(b,m*p*A)}const S=new wn;S.setAttribute("position",new Gn(y,g)),S.setAttribute("uv",new Gn(_,v)),S.setAttribute("faceIndex",new Gn(x,m)),e.push(S),i>cf&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function zP(r,e,t){const n=new kc(r,e,t);return n.texture.mapping=Z_,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function hm(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function fK(r,e,t){const n=new Float32Array(Ku),i=new X(0,1,0);return new Ls({name:"SphericalGaussianBlur",defines:{n:Ku,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:hC(),fragmentShader:` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; uniform int samples; uniform float weights[ n ]; uniform bool latitudinal; uniform float dTheta; uniform float mipInt; uniform vec3 poleAxis; #define ENVMAP_TYPE_CUBE_UV #include vec3 getSample( float theta, vec3 axis ) { float cosTheta = cos( theta ); // Rodrigues' axis-angle rotation vec3 sampleDirection = vOutputDirection * cosTheta + cross( axis, vOutputDirection ) * sin( theta ) + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); return bilinearCubeUV( envMap, sampleDirection, mipInt ); } void main() { vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); if ( all( equal( axis, vec3( 0.0 ) ) ) ) { axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); } axis = normalize( axis ); gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); for ( int i = 1; i < n; i++ ) { if ( i >= samples ) { break; } float theta = dTheta * float( i ); gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); } } `,blending:kl,depthTest:!1,depthWrite:!1})}function UP(){return new Ls({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:hC(),fragmentShader:` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; #include void main() { vec3 outputDirection = normalize( vOutputDirection ); vec2 uv = equirectUv( outputDirection ); gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } `,blending:kl,depthTest:!1,depthWrite:!1})}function VP(){return new Ls({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:hC(),fragmentShader:` precision mediump float; precision mediump int; uniform float flipEnvMap; varying vec3 vOutputDirection; uniform samplerCube envMap; void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } `,blending:kl,depthTest:!1,depthWrite:!1})}function hC(){return` precision mediump float; precision mediump int; attribute float faceIndex; varying vec3 vOutputDirection; // RH coordinate system; PMREM face-indexing convention vec3 getDirection( vec2 uv, float face ) { uv = 2.0 * uv - 1.0; vec3 direction = vec3( uv, 1.0 ); if ( face == 0.0 ) { direction = direction.zyx; // ( 1, v, u ) pos x } else if ( face == 1.0 ) { direction = direction.xzy; direction.xz *= -1.0; // ( -u, 1, -v ) pos y } else if ( face == 2.0 ) { direction.x *= -1.0; // ( -u, v, 1 ) pos z } else if ( face == 3.0 ) { direction = direction.zyx; direction.xz *= -1.0; // ( -1, v, -u ) neg x } else if ( face == 4.0 ) { direction = direction.xzy; direction.xy *= -1.0; // ( -u, -1, v ) neg y } else if ( face == 5.0 ) { direction.z *= -1.0; // ( u, v, -1 ) neg z } return direction; } void main() { vOutputDirection = getDirection( uv, faceIndex ); gl_Position = vec4( position, 1.0 ); } `}function dK(r){let e=new WeakMap,t=null;function n(s){if(s&&s.isTexture){const l=s.mapping,u=l===gb||l===mb,c=l===zf||l===Uf;if(u||c)if(s.isRenderTargetTexture&&s.needsPMREMUpdate===!0){s.needsPMREMUpdate=!1;let h=e.get(s);return t===null&&(t=new BP(r)),h=u?t.fromEquirectangular(s,h):t.fromCubemap(s,h),e.set(s,h),h.texture}else{if(e.has(s))return e.get(s).texture;{const h=s.image;if(u&&h&&h.height>0||c&&h&&i(h)){t===null&&(t=new BP(r));const f=u?t.fromEquirectangular(s):t.fromCubemap(s);return e.set(s,f),s.addEventListener("dispose",a),f.texture}else return null}}}return s}function i(s){let l=0;const u=6;for(let c=0;ce.maxTextureSize&&(b=Math.ceil(C/e.maxTextureSize),C=e.maxTextureSize);const T=new Float32Array(C*b*4*p),P=new yz(T,C,b,p);P.type=Ro,P.needsUpdate=!0;const D=M*4;for(let E=0;E0)return r;const i=e*t;let a=GP[i];if(a===void 0&&(a=new Float32Array(i),GP[i]=a),e!==0){n.toArray(a,0);for(let o=1,s=0;o!==e;++o)s+=t,r[o].toArray(a,s)}return a}function _r(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t":" "} ${s}: ${t[o]}`)}return n.join(` `)}function vZ(r){const e=ln.getPrimaries(ln.workingColorSpace),t=ln.getPrimaries(r);let n;switch(e===t?n="":e===I0&&t===D0?n="LinearDisplayP3ToLinearSRGB":e===D0&&t===I0&&(n="LinearSRGBToLinearDisplayP3"),r){case yr:case Q_:return[n,"LinearTransferOETF"];case dn:case aC:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",r),[n,"LinearTransferOETF"]}}function jP(r,e,t){const n=r.getShaderParameter(e,r.COMPILE_STATUS),i=r.getShaderInfoLog(e).trim();if(n&&i==="")return"";const a=/ERROR: 0:(\d+)/.exec(i);if(a){const o=parseInt(a[1]);return t.toUpperCase()+` `+i+` `+pZ(r.getShaderSource(e),o)}else return i}function gZ(r,e){const t=vZ(e);return`vec4 ${r}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function mZ(r,e){let t;switch(e){case pX:t="Linear";break;case vX:t="Reinhard";break;case gX:t="OptimizedCineon";break;case mX:t="ACESFilmic";break;case _X:t="AgX";break;case yX:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function yZ(r){return[r.extensionDerivatives||r.envMapCubeUVHeight||r.bumpMap||r.normalMapTangentSpace||r.clearcoatNormalMap||r.flatShading||r.alphaToCoverage||r.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(r.extensionFragDepth||r.logarithmicDepthBuffer)&&r.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",r.extensionDrawBuffers&&r.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(r.extensionShaderTextureLOD||r.envMap||r.transmission)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(hf).join(` `)}function _Z(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(hf).join(` `)}function xZ(r){const e=[];for(const t in r){const n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` `)}function SZ(r,e){const t={},n=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function wb(r){return r.replace(AZ,bZ)}const wZ=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function bZ(r,e){let t=It[e];if(t===void 0){const n=wZ.get(e);if(n!==void 0)t=It[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return wb(t)}const TZ=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function QP(r){return r.replace(TZ,MZ)}function MZ(r,e,t,n){let i="";for(let a=parseInt(e);a0&&(m+=` `),y=[d,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g].filter(hf).join(` `),y.length>0&&(y+=` `)):(m=[JP(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` `].filter(hf).join(` `),y=[d,JP(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.envMap?"#define "+c:"",t.envMap?"#define "+h:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Ol?"#define TONE_MAPPING":"",t.toneMapping!==Ol?It.tonemapping_pars_fragment:"",t.toneMapping!==Ol?mZ("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",It.colorspace_pars_fragment,gZ("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` `].filter(hf).join(` `)),o=wb(o),o=KP(o,t),o=ZP(o,t),s=wb(s),s=KP(s,t),s=ZP(s,t),o=QP(o),s=QP(s),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(_=`#version 300 es `,m=[p,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` `+m,y=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===vP?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===vP?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` `)+` `+y);const x=_+m+o,S=_+y+s,A=qP(i,i.VERTEX_SHADER,x),w=qP(i,i.FRAGMENT_SHADER,S);i.attachShader(v,A),i.attachShader(v,w),t.index0AttributeName!==void 0?i.bindAttribLocation(v,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(v,0,"position"),i.linkProgram(v);function M(P){if(r.debug.checkShaderErrors){const D=i.getProgramInfoLog(v).trim(),L=i.getShaderInfoLog(A).trim(),E=i.getShaderInfoLog(w).trim();let I=!0,N=!0;if(i.getProgramParameter(v,i.LINK_STATUS)===!1)if(I=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(i,v,A,w);else{const R=jP(i,A,"vertex"),F=jP(i,w,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(v,i.VALIDATE_STATUS)+` Material Name: `+P.name+` Material Type: `+P.type+` Program Info Log: `+D+` `+R+` `+F)}else D!==""?console.warn("THREE.WebGLProgram: Program Info Log:",D):(L===""||E==="")&&(N=!1);N&&(P.diagnostics={runnable:I,programLog:D,vertexShader:{log:L,prefix:m},fragmentShader:{log:E,prefix:y}})}i.deleteShader(A),i.deleteShader(w),C=new Xy(i,v),b=SZ(i,v)}let C;this.getUniforms=function(){return C===void 0&&M(this),C};let b;this.getAttributes=function(){return b===void 0&&M(this),b};let T=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return T===!1&&(T=i.getProgramParameter(v,fZ)),T},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(v),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=dZ++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=A,this.fragmentShader=w,this}let IZ=0;class NZ{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),a=this._getShaderStage(n),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(a)===!1&&(o.add(a),a.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new kZ(e),t.set(e,n)),n}}class kZ{constructor(e){this.id=IZ++,this.code=e,this.usedTimes=0}}function OZ(r,e,t,n,i,a,o){const s=new lC,l=new NZ,u=new Set,c=[],h=i.isWebGL2,f=i.logarithmicDepthBuffer,d=i.vertexTextures;let p=i.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(b){return u.add(b),b===0?"uv":`uv${b}`}function m(b,T,P,D,L){const E=D.fog,I=L.geometry,N=b.isMeshStandardMaterial?D.environment:null,R=(b.isMeshStandardMaterial?t:e).get(b.envMap||N),F=R&&R.mapping===Z_?R.image.height:null,O=g[b.type];b.precision!==null&&(p=i.getMaxPrecision(b.precision),p!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",p,"instead."));const V=I.morphAttributes.position||I.morphAttributes.normal||I.morphAttributes.color,H=V!==void 0?V.length:0;let Q=0;I.morphAttributes.position!==void 0&&(Q=1),I.morphAttributes.normal!==void 0&&(Q=2),I.morphAttributes.color!==void 0&&(Q=3);let W,Z,ee,he;if(O){const $t=Ai[O];W=$t.vertexShader,Z=$t.fragmentShader}else W=b.vertexShader,Z=b.fragmentShader,l.update(b),ee=l.getVertexShaderID(b),he=l.getFragmentShaderID(b);const le=r.getRenderTarget(),re=L.isInstancedMesh===!0,be=L.isBatchedMesh===!0,de=!!b.map,U=!!b.matcap,K=!!R,te=!!b.aoMap,ce=!!b.lightMap,se=!!b.bumpMap,Ne=!!b.normalMap,Oe=!!b.displacementMap,B=!!b.emissiveMap,z=!!b.metalnessMap,ne=!!b.roughnessMap,ve=b.anisotropy>0,Ae=b.clearcoat>0,we=b.iridescence>0,We=b.sheen>0,Be=b.transmission>0,je=ve&&!!b.anisotropyMap,Ye=Ae&&!!b.clearcoatMap,xt=Ae&&!!b.clearcoatNormalMap,Le=Ae&&!!b.clearcoatRoughnessMap,Wt=we&&!!b.iridescenceMap,Ct=we&&!!b.iridescenceThicknessMap,_t=We&&!!b.sheenColorMap,J=We&&!!b.sheenRoughnessMap,ue=!!b.specularMap,Ie=!!b.specularColorMap,j=!!b.specularIntensityMap,Ee=Be&&!!b.transmissionMap,Ue=Be&&!!b.thicknessMap,et=!!b.gradientMap,Y=!!b.alphaMap,De=b.alphaTest>0,q=!!b.alphaHash,Ce=!!b.extensions;let st=Ol;b.toneMapped&&(le===null||le.isXRRenderTarget===!0)&&(st=r.toneMapping);const Jt={isWebGL2:h,shaderID:O,shaderType:b.type,shaderName:b.name,vertexShader:W,fragmentShader:Z,defines:b.defines,customVertexShaderID:ee,customFragmentShaderID:he,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:p,batching:be,instancing:re,instancingColor:re&&L.instanceColor!==null,supportsVertexTextures:d,outputColorSpace:le===null?r.outputColorSpace:le.isXRRenderTarget===!0?le.texture.colorSpace:yr,alphaToCoverage:!!b.alphaToCoverage,map:de,matcap:U,envMap:K,envMapMode:K&&R.mapping,envMapCubeUVHeight:F,aoMap:te,lightMap:ce,bumpMap:se,normalMap:Ne,displacementMap:d&&Oe,emissiveMap:B,normalMapObjectSpace:Ne&&b.normalMapType===IX,normalMapTangentSpace:Ne&&b.normalMapType===iC,metalnessMap:z,roughnessMap:ne,anisotropy:ve,anisotropyMap:je,clearcoat:Ae,clearcoatMap:Ye,clearcoatNormalMap:xt,clearcoatRoughnessMap:Le,iridescence:we,iridescenceMap:Wt,iridescenceThicknessMap:Ct,sheen:We,sheenColorMap:_t,sheenRoughnessMap:J,specularMap:ue,specularColorMap:Ie,specularIntensityMap:j,transmission:Be,transmissionMap:Ee,thicknessMap:Ue,gradientMap:et,opaque:b.transparent===!1&&b.blending===mc&&b.alphaToCoverage===!1,alphaMap:Y,alphaTest:De,alphaHash:q,combine:b.combine,mapUv:de&&v(b.map.channel),aoMapUv:te&&v(b.aoMap.channel),lightMapUv:ce&&v(b.lightMap.channel),bumpMapUv:se&&v(b.bumpMap.channel),normalMapUv:Ne&&v(b.normalMap.channel),displacementMapUv:Oe&&v(b.displacementMap.channel),emissiveMapUv:B&&v(b.emissiveMap.channel),metalnessMapUv:z&&v(b.metalnessMap.channel),roughnessMapUv:ne&&v(b.roughnessMap.channel),anisotropyMapUv:je&&v(b.anisotropyMap.channel),clearcoatMapUv:Ye&&v(b.clearcoatMap.channel),clearcoatNormalMapUv:xt&&v(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Le&&v(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Wt&&v(b.iridescenceMap.channel),iridescenceThicknessMapUv:Ct&&v(b.iridescenceThicknessMap.channel),sheenColorMapUv:_t&&v(b.sheenColorMap.channel),sheenRoughnessMapUv:J&&v(b.sheenRoughnessMap.channel),specularMapUv:ue&&v(b.specularMap.channel),specularColorMapUv:Ie&&v(b.specularColorMap.channel),specularIntensityMapUv:j&&v(b.specularIntensityMap.channel),transmissionMapUv:Ee&&v(b.transmissionMap.channel),thicknessMapUv:Ue&&v(b.thicknessMap.channel),alphaMapUv:Y&&v(b.alphaMap.channel),vertexTangents:!!I.attributes.tangent&&(Ne||ve),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!I.attributes.color&&I.attributes.color.itemSize===4,pointsUvs:L.isPoints===!0&&!!I.attributes.uv&&(de||Y),fog:!!E,useFog:b.fog===!0,fogExp2:!!E&&E.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:f,skinning:L.isSkinnedMesh===!0,morphTargets:I.morphAttributes.position!==void 0,morphNormals:I.morphAttributes.normal!==void 0,morphColors:I.morphAttributes.color!==void 0,morphTargetsCount:H,morphTextureStride:Q,numDirLights:T.directional.length,numPointLights:T.point.length,numSpotLights:T.spot.length,numSpotLightMaps:T.spotLightMap.length,numRectAreaLights:T.rectArea.length,numHemiLights:T.hemi.length,numDirLightShadows:T.directionalShadowMap.length,numPointLightShadows:T.pointShadowMap.length,numSpotLightShadows:T.spotShadowMap.length,numSpotLightShadowsWithMaps:T.numSpotLightShadowsWithMaps,numLightProbes:T.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:r.shadowMap.enabled&&P.length>0,shadowMapType:r.shadowMap.type,toneMapping:st,useLegacyLights:r._useLegacyLights,decodeVideoTexture:de&&b.map.isVideoTexture===!0&&ln.getTransfer(b.map.colorSpace)===Ln,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===ur,flipSided:b.side===Di,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionDerivatives:Ce&&b.extensions.derivatives===!0,extensionFragDepth:Ce&&b.extensions.fragDepth===!0,extensionDrawBuffers:Ce&&b.extensions.drawBuffers===!0,extensionShaderTextureLOD:Ce&&b.extensions.shaderTextureLOD===!0,extensionClipCullDistance:Ce&&b.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:Ce&&b.extensions.multiDraw===!0&&n.has("WEBGL_multi_draw"),rendererExtensionFragDepth:h||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||n.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return Jt.vertexUv1s=u.has(1),Jt.vertexUv2s=u.has(2),Jt.vertexUv3s=u.has(3),u.clear(),Jt}function y(b){const T=[];if(b.shaderID?T.push(b.shaderID):(T.push(b.customVertexShaderID),T.push(b.customFragmentShaderID)),b.defines!==void 0)for(const P in b.defines)T.push(P),T.push(b.defines[P]);return b.isRawShaderMaterial===!1&&(_(T,b),x(T,b),T.push(r.outputColorSpace)),T.push(b.customProgramCacheKey),T.join()}function _(b,T){b.push(T.precision),b.push(T.outputColorSpace),b.push(T.envMapMode),b.push(T.envMapCubeUVHeight),b.push(T.mapUv),b.push(T.alphaMapUv),b.push(T.lightMapUv),b.push(T.aoMapUv),b.push(T.bumpMapUv),b.push(T.normalMapUv),b.push(T.displacementMapUv),b.push(T.emissiveMapUv),b.push(T.metalnessMapUv),b.push(T.roughnessMapUv),b.push(T.anisotropyMapUv),b.push(T.clearcoatMapUv),b.push(T.clearcoatNormalMapUv),b.push(T.clearcoatRoughnessMapUv),b.push(T.iridescenceMapUv),b.push(T.iridescenceThicknessMapUv),b.push(T.sheenColorMapUv),b.push(T.sheenRoughnessMapUv),b.push(T.specularMapUv),b.push(T.specularColorMapUv),b.push(T.specularIntensityMapUv),b.push(T.transmissionMapUv),b.push(T.thicknessMapUv),b.push(T.combine),b.push(T.fogExp2),b.push(T.sizeAttenuation),b.push(T.morphTargetsCount),b.push(T.morphAttributeCount),b.push(T.numDirLights),b.push(T.numPointLights),b.push(T.numSpotLights),b.push(T.numSpotLightMaps),b.push(T.numHemiLights),b.push(T.numRectAreaLights),b.push(T.numDirLightShadows),b.push(T.numPointLightShadows),b.push(T.numSpotLightShadows),b.push(T.numSpotLightShadowsWithMaps),b.push(T.numLightProbes),b.push(T.shadowMapType),b.push(T.toneMapping),b.push(T.numClippingPlanes),b.push(T.numClipIntersection),b.push(T.depthPacking)}function x(b,T){s.disableAll(),T.isWebGL2&&s.enable(0),T.supportsVertexTextures&&s.enable(1),T.instancing&&s.enable(2),T.instancingColor&&s.enable(3),T.matcap&&s.enable(4),T.envMap&&s.enable(5),T.normalMapObjectSpace&&s.enable(6),T.normalMapTangentSpace&&s.enable(7),T.clearcoat&&s.enable(8),T.iridescence&&s.enable(9),T.alphaTest&&s.enable(10),T.vertexColors&&s.enable(11),T.vertexAlphas&&s.enable(12),T.vertexUv1s&&s.enable(13),T.vertexUv2s&&s.enable(14),T.vertexUv3s&&s.enable(15),T.vertexTangents&&s.enable(16),T.anisotropy&&s.enable(17),T.alphaHash&&s.enable(18),T.batching&&s.enable(19),b.push(s.mask),s.disableAll(),T.fog&&s.enable(0),T.useFog&&s.enable(1),T.flatShading&&s.enable(2),T.logarithmicDepthBuffer&&s.enable(3),T.skinning&&s.enable(4),T.morphTargets&&s.enable(5),T.morphNormals&&s.enable(6),T.morphColors&&s.enable(7),T.premultipliedAlpha&&s.enable(8),T.shadowMapEnabled&&s.enable(9),T.useLegacyLights&&s.enable(10),T.doubleSided&&s.enable(11),T.flipSided&&s.enable(12),T.useDepthPacking&&s.enable(13),T.dithering&&s.enable(14),T.transmission&&s.enable(15),T.sheen&&s.enable(16),T.opaque&&s.enable(17),T.pointsUvs&&s.enable(18),T.decodeVideoTexture&&s.enable(19),T.alphaToCoverage&&s.enable(20),b.push(s.mask)}function S(b){const T=g[b.type];let P;if(T){const D=Ai[T];P=uC.clone(D.uniforms)}else P=b.uniforms;return P}function A(b,T){let P;for(let D=0,L=c.length;D0?n.push(m):d.transparent===!0?i.push(m):t.push(m)}function l(h,f,d,p,g,v){const m=o(h,f,d,p,g,v);d.transmission>0?n.unshift(m):d.transparent===!0?i.unshift(m):t.unshift(m)}function u(h,f){t.length>1&&t.sort(h||BZ),n.length>1&&n.sort(f||eR),i.length>1&&i.sort(f||eR)}function c(){for(let h=e,f=r.length;h=a.length?(o=new tR,a.push(o)):o=a[i],o}function t(){r=new WeakMap}return{get:e,dispose:t}}function UZ(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new X,color:new nt};break;case"SpotLight":t={position:new X,direction:new X,color:new nt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new X,color:new nt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new X,skyColor:new nt,groundColor:new nt};break;case"RectAreaLight":t={color:new nt,position:new X,halfWidth:new X,halfHeight:new X};break}return r[e.id]=t,t}}}function VZ(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Me};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Me};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Me,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}let GZ=0;function HZ(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function WZ(r,e){const t=new UZ,n=VZ(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new X);const a=new X,o=new Mt,s=new Mt;function l(c,h){let f=0,d=0,p=0;for(let P=0;P<9;P++)i.probe[P].set(0,0,0);let g=0,v=0,m=0,y=0,_=0,x=0,S=0,A=0,w=0,M=0,C=0;c.sort(HZ);const b=h===!0?Math.PI:1;for(let P=0,D=c.length;P0&&(e.isWebGL2?r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Ve.LTC_FLOAT_1,i.rectAreaLTC2=Ve.LTC_FLOAT_2):(i.rectAreaLTC1=Ve.LTC_HALF_1,i.rectAreaLTC2=Ve.LTC_HALF_2):r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Ve.LTC_FLOAT_1,i.rectAreaLTC2=Ve.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=Ve.LTC_HALF_1,i.rectAreaLTC2=Ve.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=f,i.ambient[1]=d,i.ambient[2]=p;const T=i.hash;(T.directionalLength!==g||T.pointLength!==v||T.spotLength!==m||T.rectAreaLength!==y||T.hemiLength!==_||T.numDirectionalShadows!==x||T.numPointShadows!==S||T.numSpotShadows!==A||T.numSpotMaps!==w||T.numLightProbes!==C)&&(i.directional.length=g,i.spot.length=m,i.rectArea.length=y,i.point.length=v,i.hemi.length=_,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=S,i.pointShadowMap.length=S,i.spotShadow.length=A,i.spotShadowMap.length=A,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=S,i.spotLightMatrix.length=A+w-M,i.spotLightMap.length=w,i.numSpotLightShadowsWithMaps=M,i.numLightProbes=C,T.directionalLength=g,T.pointLength=v,T.spotLength=m,T.rectAreaLength=y,T.hemiLength=_,T.numDirectionalShadows=x,T.numPointShadows=S,T.numSpotShadows=A,T.numSpotMaps=w,T.numLightProbes=C,i.version=GZ++)}function u(c,h){let f=0,d=0,p=0,g=0,v=0;const m=h.matrixWorldInverse;for(let y=0,_=c.length;y<_;y++){const x=c[y];if(x.isDirectionalLight){const S=i.directional[f];S.direction.setFromMatrixPosition(x.matrixWorld),a.setFromMatrixPosition(x.target.matrixWorld),S.direction.sub(a),S.direction.transformDirection(m),f++}else if(x.isSpotLight){const S=i.spot[p];S.position.setFromMatrixPosition(x.matrixWorld),S.position.applyMatrix4(m),S.direction.setFromMatrixPosition(x.matrixWorld),a.setFromMatrixPosition(x.target.matrixWorld),S.direction.sub(a),S.direction.transformDirection(m),p++}else if(x.isRectAreaLight){const S=i.rectArea[g];S.position.setFromMatrixPosition(x.matrixWorld),S.position.applyMatrix4(m),s.identity(),o.copy(x.matrixWorld),o.premultiply(m),s.extractRotation(o),S.halfWidth.set(x.width*.5,0,0),S.halfHeight.set(0,x.height*.5,0),S.halfWidth.applyMatrix4(s),S.halfHeight.applyMatrix4(s),g++}else if(x.isPointLight){const S=i.point[d];S.position.setFromMatrixPosition(x.matrixWorld),S.position.applyMatrix4(m),d++}else if(x.isHemisphereLight){const S=i.hemi[v];S.direction.setFromMatrixPosition(x.matrixWorld),S.direction.transformDirection(m),v++}}}return{setup:l,setupView:u,state:i}}function nR(r,e){const t=new WZ(r,e),n=[],i=[];function a(){n.length=0,i.length=0}function o(h){n.push(h)}function s(h){i.push(h)}function l(h){t.setup(n,h)}function u(h){t.setupView(n,h)}return{init:a,state:{lightsArray:n,shadowsArray:i,lights:t},setupLights:l,setupLightsView:u,pushLight:o,pushShadow:s}}function $Z(r,e){let t=new WeakMap;function n(a,o=0){const s=t.get(a);let l;return s===void 0?(l=new nR(r,e),t.set(a,[l])):o>=s.length?(l=new nR(r,e),s.push(l)):l=s[o],l}function i(){t=new WeakMap}return{get:n,dispose:i}}class XZ extends Da{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=RX,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class YZ extends Da{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const qZ=`void main() { gl_Position = vec4( position, 1.0 ); }`,jZ=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include void main() { const float samples = float( VSM_SAMPLES ); float mean = 0.0; float squared_mean = 0.0; float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); float uvStart = samples <= 1.0 ? 0.0 : - 1.0; for ( float i = 0.0; i < samples; i ++ ) { float uvOffset = uvStart + i * uvStride; #ifdef HORIZONTAL_PASS vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); mean += distribution.x; squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; #else float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); mean += depth; squared_mean += depth * depth; #endif } mean = mean / samples; squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); }`;function KZ(r,e,t){let n=new cC;const i=new Me,a=new Me,o=new an,s=new XZ({depthPacking:DX}),l=new YZ,u={},c=t.maxTextureSize,h={[Es]:Di,[Di]:Es,[ur]:ur},f=new Ls({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Me},radius:{value:4}},vertexShader:qZ,fragmentShader:jZ}),d=f.clone();d.defines.HORIZONTAL_PASS=1;const p=new wn;p.setAttribute("position",new Gn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const g=new rn(p,f),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=ez;let m=this.type;this.render=function(A,w,M){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||A.length===0)return;const C=r.getRenderTarget(),b=r.getActiveCubeFace(),T=r.getActiveMipmapLevel(),P=r.state;P.setBlending(kl),P.buffers.color.setClear(1,1,1,1),P.buffers.depth.setTest(!0),P.setScissorTest(!1);const D=m!==hs&&this.type===hs,L=m===hs&&this.type!==hs;for(let E=0,I=A.length;Ec||i.y>c)&&(i.x>c&&(a.x=Math.floor(c/F.x),i.x=a.x*F.x,R.mapSize.x=a.x),i.y>c&&(a.y=Math.floor(c/F.y),i.y=a.y*F.y,R.mapSize.y=a.y)),R.map===null||D===!0||L===!0){const V=this.type!==hs?{minFilter:vr,magFilter:vr}:{};R.map!==null&&R.map.dispose(),R.map=new kc(i.x,i.y,V),R.map.texture.name=N.name+".shadowMap",R.camera.updateProjectionMatrix()}r.setRenderTarget(R.map),r.clear();const O=R.getViewportCount();for(let V=0;V0||w.map&&w.alphaTest>0){const P=b.uuid,D=w.uuid;let L=u[P];L===void 0&&(L={},u[P]=L);let E=L[D];E===void 0&&(E=b.clone(),L[D]=E,w.addEventListener("dispose",S)),b=E}if(b.visible=w.visible,b.wireframe=w.wireframe,C===hs?b.side=w.shadowSide!==null?w.shadowSide:w.side:b.side=w.shadowSide!==null?w.shadowSide:h[w.side],b.alphaMap=w.alphaMap,b.alphaTest=w.alphaTest,b.map=w.map,b.clipShadows=w.clipShadows,b.clippingPlanes=w.clippingPlanes,b.clipIntersection=w.clipIntersection,b.displacementMap=w.displacementMap,b.displacementScale=w.displacementScale,b.displacementBias=w.displacementBias,b.wireframeLinewidth=w.wireframeLinewidth,b.linewidth=w.linewidth,M.isPointLight===!0&&b.isMeshDistanceMaterial===!0){const P=r.properties.get(b);P.light=M}return b}function x(A,w,M,C,b){if(A.visible===!1)return;if(A.layers.test(w.layers)&&(A.isMesh||A.isLine||A.isPoints)&&(A.castShadow||A.receiveShadow&&b===hs)&&(!A.frustumCulled||n.intersectsObject(A))){A.modelViewMatrix.multiplyMatrices(M.matrixWorldInverse,A.matrixWorld);const D=e.update(A),L=A.material;if(Array.isArray(L)){const E=D.groups;for(let I=0,N=E.length;I=1):O.indexOf("OpenGL ES")!==-1&&(F=parseFloat(/^OpenGL ES (\d)/.exec(O)[1]),R=F>=2);let V=null,H={};const Q=r.getParameter(r.SCISSOR_BOX),W=r.getParameter(r.VIEWPORT),Z=new an().fromArray(Q),ee=new an().fromArray(W);function he(Y,De,q,Ce){const st=new Uint8Array(4),Jt=r.createTexture();r.bindTexture(Y,Jt),r.texParameteri(Y,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(Y,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let $t=0;$tve||B.height>ve)&&(Ae=ve/Math.max(B.width,B.height)),Ae<1||z===!0)if(typeof HTMLImageElement!="undefined"&&B instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&B instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&B instanceof ImageBitmap){const we=z?k0:Math.floor,We=we(Ae*B.width),Be=we(Ae*B.height);h===void 0&&(h=p(We,Be));const je=ne?p(We,Be):h;return je.width=We,je.height=Be,je.getContext("2d").drawImage(B,0,0,We,Be),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+B.width+"x"+B.height+") to ("+We+"x"+Be+")."),je}else return"data"in B&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+B.width+"x"+B.height+")."),B;return B}function v(B){return Ab(B.width)&&Ab(B.height)}function m(B){return s?!1:B.wrapS!==ti||B.wrapT!==ti||B.minFilter!==vr&&B.minFilter!==lr}function y(B,z){return B.generateMipmaps&&z&&B.minFilter!==vr&&B.minFilter!==lr}function _(B){r.generateMipmap(B)}function x(B,z,ne,ve,Ae=!1){if(s===!1)return z;if(B!==null){if(r[B]!==void 0)return r[B];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+B+"'")}let we=z;if(z===r.RED&&(ne===r.FLOAT&&(we=r.R32F),ne===r.HALF_FLOAT&&(we=r.R16F),ne===r.UNSIGNED_BYTE&&(we=r.R8)),z===r.RED_INTEGER&&(ne===r.UNSIGNED_BYTE&&(we=r.R8UI),ne===r.UNSIGNED_SHORT&&(we=r.R16UI),ne===r.UNSIGNED_INT&&(we=r.R32UI),ne===r.BYTE&&(we=r.R8I),ne===r.SHORT&&(we=r.R16I),ne===r.INT&&(we=r.R32I)),z===r.RG&&(ne===r.FLOAT&&(we=r.RG32F),ne===r.HALF_FLOAT&&(we=r.RG16F),ne===r.UNSIGNED_BYTE&&(we=r.RG8)),z===r.RGBA){const We=Ae?R0:ln.getTransfer(ve);ne===r.FLOAT&&(we=r.RGBA32F),ne===r.HALF_FLOAT&&(we=r.RGBA16F),ne===r.UNSIGNED_BYTE&&(we=We===Ln?r.SRGB8_ALPHA8:r.RGBA8),ne===r.UNSIGNED_SHORT_4_4_4_4&&(we=r.RGBA4),ne===r.UNSIGNED_SHORT_5_5_5_1&&(we=r.RGB5_A1)}return(we===r.R16F||we===r.R32F||we===r.RG16F||we===r.RG32F||we===r.RGBA16F||we===r.RGBA32F)&&e.get("EXT_color_buffer_float"),we}function S(B,z,ne){return y(B,ne)===!0||B.isFramebufferTexture&&B.minFilter!==vr&&B.minFilter!==lr?Math.log2(Math.max(z.width,z.height))+1:B.mipmaps!==void 0&&B.mipmaps.length>0?B.mipmaps.length:B.isCompressedTexture&&Array.isArray(B.image)?z.mipmaps.length:1}function A(B){return B===vr||B===yb||B===Qh?r.NEAREST:r.LINEAR}function w(B){const z=B.target;z.removeEventListener("dispose",w),C(z),z.isVideoTexture&&c.delete(z)}function M(B){const z=B.target;z.removeEventListener("dispose",M),T(z)}function C(B){const z=n.get(B);if(z.__webglInit===void 0)return;const ne=B.source,ve=f.get(ne);if(ve){const Ae=ve[z.__cacheKey];Ae.usedTimes--,Ae.usedTimes===0&&b(B),Object.keys(ve).length===0&&f.delete(ne)}n.remove(B)}function b(B){const z=n.get(B);r.deleteTexture(z.__webglTexture);const ne=B.source,ve=f.get(ne);delete ve[z.__cacheKey],o.memory.textures--}function T(B){const z=B.texture,ne=n.get(B),ve=n.get(z);if(ve.__webglTexture!==void 0&&(r.deleteTexture(ve.__webglTexture),o.memory.textures--),B.depthTexture&&B.depthTexture.dispose(),B.isWebGLCubeRenderTarget)for(let Ae=0;Ae<6;Ae++){if(Array.isArray(ne.__webglFramebuffer[Ae]))for(let we=0;we=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+B+" texture units while this GPU supports only "+i.maxTextures),P+=1,B}function E(B){const z=[];return z.push(B.wrapS),z.push(B.wrapT),z.push(B.wrapR||0),z.push(B.magFilter),z.push(B.minFilter),z.push(B.anisotropy),z.push(B.internalFormat),z.push(B.format),z.push(B.type),z.push(B.generateMipmaps),z.push(B.premultiplyAlpha),z.push(B.flipY),z.push(B.unpackAlignment),z.push(B.colorSpace),z.join()}function I(B,z){const ne=n.get(B);if(B.isVideoTexture&&Ne(B),B.isRenderTargetTexture===!1&&B.version>0&&ne.__version!==B.version){const ve=B.image;if(ve===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ve.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Z(ne,B,z);return}}t.bindTexture(r.TEXTURE_2D,ne.__webglTexture,r.TEXTURE0+z)}function N(B,z){const ne=n.get(B);if(B.version>0&&ne.__version!==B.version){Z(ne,B,z);return}t.bindTexture(r.TEXTURE_2D_ARRAY,ne.__webglTexture,r.TEXTURE0+z)}function R(B,z){const ne=n.get(B);if(B.version>0&&ne.__version!==B.version){Z(ne,B,z);return}t.bindTexture(r.TEXTURE_3D,ne.__webglTexture,r.TEXTURE0+z)}function F(B,z){const ne=n.get(B);if(B.version>0&&ne.__version!==B.version){ee(ne,B,z);return}t.bindTexture(r.TEXTURE_CUBE_MAP,ne.__webglTexture,r.TEXTURE0+z)}const O={[jr]:r.REPEAT,[ti]:r.CLAMP_TO_EDGE,[P0]:r.MIRRORED_REPEAT},V={[vr]:r.NEAREST,[yb]:r.NEAREST_MIPMAP_NEAREST,[Qh]:r.NEAREST_MIPMAP_LINEAR,[lr]:r.LINEAR,[$y]:r.LINEAR_MIPMAP_NEAREST,[gs]:r.LINEAR_MIPMAP_LINEAR},H={[NX]:r.NEVER,[UX]:r.ALWAYS,[kX]:r.LESS,[pz]:r.LEQUAL,[OX]:r.EQUAL,[zX]:r.GEQUAL,[FX]:r.GREATER,[BX]:r.NOTEQUAL};function Q(B,z,ne){if(z.type===Ro&&e.has("OES_texture_float_linear")===!1&&(z.magFilter===lr||z.magFilter===$y||z.magFilter===Qh||z.magFilter===gs||z.minFilter===lr||z.minFilter===$y||z.minFilter===Qh||z.minFilter===gs)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),ne?(r.texParameteri(B,r.TEXTURE_WRAP_S,O[z.wrapS]),r.texParameteri(B,r.TEXTURE_WRAP_T,O[z.wrapT]),(B===r.TEXTURE_3D||B===r.TEXTURE_2D_ARRAY)&&r.texParameteri(B,r.TEXTURE_WRAP_R,O[z.wrapR]),r.texParameteri(B,r.TEXTURE_MAG_FILTER,V[z.magFilter]),r.texParameteri(B,r.TEXTURE_MIN_FILTER,V[z.minFilter])):(r.texParameteri(B,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(B,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(B===r.TEXTURE_3D||B===r.TEXTURE_2D_ARRAY)&&r.texParameteri(B,r.TEXTURE_WRAP_R,r.CLAMP_TO_EDGE),(z.wrapS!==ti||z.wrapT!==ti)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(B,r.TEXTURE_MAG_FILTER,A(z.magFilter)),r.texParameteri(B,r.TEXTURE_MIN_FILTER,A(z.minFilter)),z.minFilter!==vr&&z.minFilter!==lr&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),z.compareFunction&&(r.texParameteri(B,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(B,r.TEXTURE_COMPARE_FUNC,H[z.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const ve=e.get("EXT_texture_filter_anisotropic");if(z.magFilter===vr||z.minFilter!==Qh&&z.minFilter!==gs||z.type===Ro&&e.has("OES_texture_float_linear")===!1||s===!1&&z.type===wv&&e.has("OES_texture_half_float_linear")===!1)return;(z.anisotropy>1||n.get(z).__currentAnisotropy)&&(r.texParameterf(B,ve.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(z.anisotropy,i.getMaxAnisotropy())),n.get(z).__currentAnisotropy=z.anisotropy)}}function W(B,z){let ne=!1;B.__webglInit===void 0&&(B.__webglInit=!0,z.addEventListener("dispose",w));const ve=z.source;let Ae=f.get(ve);Ae===void 0&&(Ae={},f.set(ve,Ae));const we=E(z);if(we!==B.__cacheKey){Ae[we]===void 0&&(Ae[we]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,ne=!0),Ae[we].usedTimes++;const We=Ae[B.__cacheKey];We!==void 0&&(Ae[B.__cacheKey].usedTimes--,We.usedTimes===0&&b(z)),B.__cacheKey=we,B.__webglTexture=Ae[we].texture}return ne}function Z(B,z,ne){let ve=r.TEXTURE_2D;(z.isDataArrayTexture||z.isCompressedArrayTexture)&&(ve=r.TEXTURE_2D_ARRAY),z.isData3DTexture&&(ve=r.TEXTURE_3D);const Ae=W(B,z),we=z.source;t.bindTexture(ve,B.__webglTexture,r.TEXTURE0+ne);const We=n.get(we);if(we.version!==We.__version||Ae===!0){t.activeTexture(r.TEXTURE0+ne);const Be=ln.getPrimaries(ln.workingColorSpace),je=z.colorSpace===Ta?null:ln.getPrimaries(z.colorSpace),Ye=z.colorSpace===Ta||Be===je?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,z.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,z.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,z.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ye);const xt=m(z)&&v(z.image)===!1;let Le=g(z.image,xt,!1,i.maxTextureSize);Le=Oe(z,Le);const Wt=v(Le)||s,Ct=a.convert(z.format,z.colorSpace);let _t=a.convert(z.type),J=x(z.internalFormat,Ct,_t,z.colorSpace,z.isVideoTexture);Q(ve,z,Wt);let ue;const Ie=z.mipmaps,j=s&&z.isVideoTexture!==!0&&J!==hz,Ee=We.__version===void 0||Ae===!0,Ue=we.dataReady,et=S(z,Le,Wt);if(z.isDepthTexture)J=r.DEPTH_COMPONENT,s?z.type===Ro?J=r.DEPTH_COMPONENT32F:z.type===xl?J=r.DEPTH_COMPONENT24:z.type===yc?J=r.DEPTH24_STENCIL8:J=r.DEPTH_COMPONENT16:z.type===Ro&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),z.format===_c&&J===r.DEPTH_COMPONENT&&z.type!==rC&&z.type!==xl&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),z.type=xl,_t=a.convert(z.type)),z.format===Vf&&J===r.DEPTH_COMPONENT&&(J=r.DEPTH_STENCIL,z.type!==yc&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),z.type=yc,_t=a.convert(z.type))),Ee&&(j?t.texStorage2D(r.TEXTURE_2D,1,J,Le.width,Le.height):t.texImage2D(r.TEXTURE_2D,0,J,Le.width,Le.height,0,Ct,_t,null));else if(z.isDataTexture)if(Ie.length>0&&Wt){j&&Ee&&t.texStorage2D(r.TEXTURE_2D,et,J,Ie[0].width,Ie[0].height);for(let Y=0,De=Ie.length;Y>=1,De>>=1}}else if(Ie.length>0&&Wt){j&&Ee&&t.texStorage2D(r.TEXTURE_2D,et,J,Ie[0].width,Ie[0].height);for(let Y=0,De=Ie.length;Y0&&Ue++,t.texStorage2D(r.TEXTURE_CUBE_MAP,Ue,ue,Le[0].width,Le[0].height));for(let Y=0;Y<6;Y++)if(xt){Ie?Ee&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+Y,0,0,0,Le[Y].width,Le[Y].height,_t,J,Le[Y].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+Y,0,ue,Le[Y].width,Le[Y].height,0,_t,J,Le[Y].data);for(let De=0;De>we),Le=Math.max(1,z.height>>we);Ae===r.TEXTURE_3D||Ae===r.TEXTURE_2D_ARRAY?t.texImage3D(Ae,we,je,xt,Le,z.depth,0,We,Be,null):t.texImage2D(Ae,we,je,xt,Le,0,We,Be,null)}t.bindFramebuffer(r.FRAMEBUFFER,B),se(z)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,ve,Ae,n.get(ne).__webglTexture,0,ce(z)):(Ae===r.TEXTURE_2D||Ae>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&Ae<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,ve,Ae,n.get(ne).__webglTexture,we),t.bindFramebuffer(r.FRAMEBUFFER,null)}function le(B,z,ne){if(r.bindRenderbuffer(r.RENDERBUFFER,B),z.depthBuffer&&!z.stencilBuffer){let ve=s===!0?r.DEPTH_COMPONENT24:r.DEPTH_COMPONENT16;if(ne||se(z)){const Ae=z.depthTexture;Ae&&Ae.isDepthTexture&&(Ae.type===Ro?ve=r.DEPTH_COMPONENT32F:Ae.type===xl&&(ve=r.DEPTH_COMPONENT24));const we=ce(z);se(z)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,we,ve,z.width,z.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,we,ve,z.width,z.height)}else r.renderbufferStorage(r.RENDERBUFFER,ve,z.width,z.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,B)}else if(z.depthBuffer&&z.stencilBuffer){const ve=ce(z);ne&&se(z)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,ve,r.DEPTH24_STENCIL8,z.width,z.height):se(z)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,ve,r.DEPTH24_STENCIL8,z.width,z.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,z.width,z.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,B)}else{const ve=z.isWebGLMultipleRenderTargets===!0?z.texture:[z.texture];for(let Ae=0;Ae0){ne.__webglFramebuffer[Be]=[];for(let je=0;je0){ne.__webglFramebuffer=[];for(let Be=0;Be0&&se(B)===!1){const Be=we?z:[z];ne.__webglMultisampledFramebuffer=r.createFramebuffer(),ne.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,ne.__webglMultisampledFramebuffer);for(let je=0;je0)for(let je=0;je0)for(let je=0;je0&&se(B)===!1){const z=B.isWebGLMultipleRenderTargets?B.texture:[B.texture],ne=B.width,ve=B.height;let Ae=r.COLOR_BUFFER_BIT;const we=[],We=B.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Be=n.get(B),je=B.isWebGLMultipleRenderTargets===!0;if(je)for(let Ye=0;Ye0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&z.__useRenderToTexture!==!1}function Ne(B){const z=o.render.frame;c.get(B)!==z&&(c.set(B,z),B.update())}function Oe(B,z){const ne=B.colorSpace,ve=B.format,Ae=B.type;return B.isCompressedTexture===!0||B.isVideoTexture===!0||B.format===Sb||ne!==yr&&ne!==Ta&&(ln.getTransfer(ne)===Ln?s===!1?e.has("EXT_sRGB")===!0&&ve===ba?(B.format=Sb,B.minFilter=lr,B.generateMipmaps=!1):z=gz.sRGBToLinear(z):(ve!==ba||Ae!==Fl)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ne)),z}this.allocateTextureUnit=L,this.resetTextureUnits=D,this.setTexture2D=I,this.setTexture2DArray=N,this.setTexture3D=R,this.setTextureCube=F,this.rebindTextures=de,this.setupRenderTarget=U,this.updateRenderTargetMipmap=K,this.updateMultisampleRenderTarget=te,this.setupDepthRenderbuffer=be,this.setupFrameBufferTexture=he,this.useMultisampledRTT=se}function JZ(r,e,t){const n=t.isWebGL2;function i(a,o=Ta){let s;const l=ln.getTransfer(o);if(a===Fl)return r.UNSIGNED_BYTE;if(a===oz)return r.UNSIGNED_SHORT_4_4_4_4;if(a===sz)return r.UNSIGNED_SHORT_5_5_5_1;if(a===SX)return r.BYTE;if(a===AX)return r.SHORT;if(a===rC)return r.UNSIGNED_SHORT;if(a===az)return r.INT;if(a===xl)return r.UNSIGNED_INT;if(a===Ro)return r.FLOAT;if(a===wv)return n?r.HALF_FLOAT:(s=e.get("OES_texture_half_float"),s!==null?s.HALF_FLOAT_OES:null);if(a===wX)return r.ALPHA;if(a===ba)return r.RGBA;if(a===bX)return r.LUMINANCE;if(a===TX)return r.LUMINANCE_ALPHA;if(a===_c)return r.DEPTH_COMPONENT;if(a===Vf)return r.DEPTH_STENCIL;if(a===Sb)return s=e.get("EXT_sRGB"),s!==null?s.SRGB_ALPHA_EXT:null;if(a===MX)return r.RED;if(a===lz)return r.RED_INTEGER;if(a===CX)return r.RG;if(a===uz)return r.RG_INTEGER;if(a===cz)return r.RGBA_INTEGER;if(a===Ax||a===bx||a===Tx||a===Mx)if(l===Ln)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(a===Ax)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(a===bx)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(a===Tx)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(a===Mx)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(a===Ax)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===bx)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===Tx)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===Mx)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(a===UL||a===VL||a===GL||a===HL)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(a===UL)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===VL)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===GL)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===HL)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(a===hz)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(a===WL||a===$L)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(a===WL)return l===Ln?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(a===$L)return l===Ln?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(a===XL||a===YL||a===qL||a===jL||a===KL||a===ZL||a===QL||a===JL||a===eP||a===tP||a===nP||a===rP||a===iP||a===aP)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(a===XL)return l===Ln?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(a===YL)return l===Ln?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(a===qL)return l===Ln?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(a===jL)return l===Ln?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(a===KL)return l===Ln?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(a===ZL)return l===Ln?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(a===QL)return l===Ln?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(a===JL)return l===Ln?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(a===eP)return l===Ln?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(a===tP)return l===Ln?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(a===nP)return l===Ln?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(a===rP)return l===Ln?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(a===iP)return l===Ln?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(a===aP)return l===Ln?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(a===Cx||a===oP||a===sP)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(a===Cx)return l===Ln?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(a===oP)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(a===sP)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(a===EX||a===lP||a===uP||a===cP)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(a===Cx)return s.COMPRESSED_RED_RGTC1_EXT;if(a===lP)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(a===uP)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(a===cP)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return a===yc?n?r.UNSIGNED_INT_24_8:(s=e.get("WEBGL_depth_texture"),s!==null?s.UNSIGNED_INT_24_8_WEBGL:null):r[a]!==void 0?r[a]:null}return{convert:i}}class eQ extends Qr{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}let Dn=class extends bn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const tQ={type:"move"};class Zx{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Dn,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Dn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new X,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new X),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Dn,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new X,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new X),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,a=null,o=null;const s=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(const g of e.hand.values()){const v=t.getJointPose(g,n),m=this._getHandJoint(u,g);v!==null&&(m.matrix.fromArray(v.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=v.radius),m.visible=v!==null}const c=u.joints["index-finger-tip"],h=u.joints["thumb-tip"],f=c.position.distanceTo(h.position),d=.02,p=.005;u.inputState.pinching&&f>d+p?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&f<=d-p&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(a=t.getPose(e.gripSpace,n),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));s!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&a!==null&&(i=a),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(tQ)))}return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=a!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new Dn;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}const nQ=` void main() { gl_Position = vec4( position, 1.0 ); }`,rQ=` uniform sampler2DArray depthColor; uniform float depthWidth; uniform float depthHeight; void main() { vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); if ( coord.x >= 1.0 ) { gl_FragDepthEXT = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; } else { gl_FragDepthEXT = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; } }`;class iQ{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new mr,a=e.properties.get(i);a.__webglTexture=t.texture,(t.depthNear!=n.depthNear||t.depthFar!=n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}render(e,t){if(this.texture!==null){if(this.mesh===null){const n=t.cameras[0].viewport,i=new Ls({extensions:{fragDepth:!0},vertexShader:nQ,fragmentShader:rQ,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new rn(new Za(20,20),i)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}}class aQ extends Yc{constructor(e,t){super();const n=this;let i=null,a=1,o=null,s="local-floor",l=1,u=null,c=null,h=null,f=null,d=null,p=null;const g=new iQ,v=t.getContextAttributes();let m=null,y=null;const _=[],x=[],S=new Me;let A=null;const w=new Qr;w.layers.enable(1),w.viewport=new an;const M=new Qr;M.layers.enable(2),M.viewport=new an;const C=[w,M],b=new eQ;b.layers.enable(1),b.layers.enable(2);let T=null,P=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(W){let Z=_[W];return Z===void 0&&(Z=new Zx,_[W]=Z),Z.getTargetRaySpace()},this.getControllerGrip=function(W){let Z=_[W];return Z===void 0&&(Z=new Zx,_[W]=Z),Z.getGripSpace()},this.getHand=function(W){let Z=_[W];return Z===void 0&&(Z=new Zx,_[W]=Z),Z.getHandSpace()};function D(W){const Z=x.indexOf(W.inputSource);if(Z===-1)return;const ee=_[Z];ee!==void 0&&(ee.update(W.inputSource,W.frame,u||o),ee.dispatchEvent({type:W.type,data:W.inputSource}))}function L(){i.removeEventListener("select",D),i.removeEventListener("selectstart",D),i.removeEventListener("selectend",D),i.removeEventListener("squeeze",D),i.removeEventListener("squeezestart",D),i.removeEventListener("squeezeend",D),i.removeEventListener("end",L),i.removeEventListener("inputsourceschange",E);for(let W=0;W<_.length;W++){const Z=x[W];Z!==null&&(x[W]=null,_[W].disconnect(Z))}T=null,P=null,g.reset(),e.setRenderTarget(m),d=null,f=null,h=null,i=null,y=null,Q.stop(),n.isPresenting=!1,e.setPixelRatio(A),e.setSize(S.width,S.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(W){a=W,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(W){s=W,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||o},this.setReferenceSpace=function(W){u=W},this.getBaseLayer=function(){return f!==null?f:d},this.getBinding=function(){return h},this.getFrame=function(){return p},this.getSession=function(){return i},this.setSession=function(W){return Ge(this,null,function*(){if(i=W,i!==null){if(m=e.getRenderTarget(),i.addEventListener("select",D),i.addEventListener("selectstart",D),i.addEventListener("selectend",D),i.addEventListener("squeeze",D),i.addEventListener("squeezestart",D),i.addEventListener("squeezeend",D),i.addEventListener("end",L),i.addEventListener("inputsourceschange",E),v.xrCompatible!==!0&&(yield t.makeXRCompatible()),A=e.getPixelRatio(),e.getSize(S),i.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const Z={antialias:i.renderState.layers===void 0?v.antialias:!0,alpha:!0,depth:v.depth,stencil:v.stencil,framebufferScaleFactor:a};d=new XRWebGLLayer(i,t,Z),i.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),y=new kc(d.framebufferWidth,d.framebufferHeight,{format:ba,type:Fl,colorSpace:e.outputColorSpace,stencilBuffer:v.stencil})}else{let Z=null,ee=null,he=null;v.depth&&(he=v.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,Z=v.stencil?Vf:_c,ee=v.stencil?yc:xl);const le={colorFormat:t.RGBA8,depthFormat:he,scaleFactor:a};h=new XRWebGLBinding(i,t),f=h.createProjectionLayer(le),i.updateRenderState({layers:[f]}),e.setPixelRatio(1),e.setSize(f.textureWidth,f.textureHeight,!1),y=new kc(f.textureWidth,f.textureHeight,{format:ba,type:Fl,depthTexture:new Mz(f.textureWidth,f.textureHeight,ee,void 0,void 0,void 0,void 0,void 0,void 0,Z),stencilBuffer:v.stencil,colorSpace:e.outputColorSpace,samples:v.antialias?4:0});const re=e.properties.get(y);re.__ignoreDepthValues=f.ignoreDepthValues}y.isXRRenderTarget=!0,this.setFoveation(l),u=null,o=yield i.requestReferenceSpace(s),Q.setContext(i),Q.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}})},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function E(W){for(let Z=0;Z=0&&(x[he]=null,_[he].disconnect(ee))}for(let Z=0;Z=x.length){x.push(ee),he=re;break}else if(x[re]===null){x[re]=ee,he=re;break}if(he===-1)break}const le=_[he];le&&le.connect(ee)}}const I=new X,N=new X;function R(W,Z,ee){I.setFromMatrixPosition(Z.matrixWorld),N.setFromMatrixPosition(ee.matrixWorld);const he=I.distanceTo(N),le=Z.projectionMatrix.elements,re=ee.projectionMatrix.elements,be=le[14]/(le[10]-1),de=le[14]/(le[10]+1),U=(le[9]+1)/le[5],K=(le[9]-1)/le[5],te=(le[8]-1)/le[0],ce=(re[8]+1)/re[0],se=be*te,Ne=be*ce,Oe=he/(-te+ce),B=Oe*-te;Z.matrixWorld.decompose(W.position,W.quaternion,W.scale),W.translateX(B),W.translateZ(Oe),W.matrixWorld.compose(W.position,W.quaternion,W.scale),W.matrixWorldInverse.copy(W.matrixWorld).invert();const z=be+Oe,ne=de+Oe,ve=se-B,Ae=Ne+(he-B),we=U*de/ne*z,We=K*de/ne*z;W.projectionMatrix.makePerspective(ve,Ae,we,We,z,ne),W.projectionMatrixInverse.copy(W.projectionMatrix).invert()}function F(W,Z){Z===null?W.matrixWorld.copy(W.matrix):W.matrixWorld.multiplyMatrices(Z.matrixWorld,W.matrix),W.matrixWorldInverse.copy(W.matrixWorld).invert()}this.updateCamera=function(W){if(i===null)return;g.texture!==null&&(W.near=g.depthNear,W.far=g.depthFar),b.near=M.near=w.near=W.near,b.far=M.far=w.far=W.far,(T!==b.near||P!==b.far)&&(i.updateRenderState({depthNear:b.near,depthFar:b.far}),T=b.near,P=b.far,w.near=T,w.far=P,M.near=T,M.far=P,w.updateProjectionMatrix(),M.updateProjectionMatrix(),W.updateProjectionMatrix());const Z=W.parent,ee=b.cameras;F(b,Z);for(let he=0;he0&&(v.alphaTest.value=m.alphaTest);const y=e.get(m).envMap;if(y&&(v.envMap.value=y,v.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,v.reflectivity.value=m.reflectivity,v.ior.value=m.ior,v.refractionRatio.value=m.refractionRatio),m.lightMap){v.lightMap.value=m.lightMap;const _=r._useLegacyLights===!0?Math.PI:1;v.lightMapIntensity.value=m.lightMapIntensity*_,t(m.lightMap,v.lightMapTransform)}m.aoMap&&(v.aoMap.value=m.aoMap,v.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,v.aoMapTransform))}function o(v,m){v.diffuse.value.copy(m.color),v.opacity.value=m.opacity,m.map&&(v.map.value=m.map,t(m.map,v.mapTransform))}function s(v,m){v.dashSize.value=m.dashSize,v.totalSize.value=m.dashSize+m.gapSize,v.scale.value=m.scale}function l(v,m,y,_){v.diffuse.value.copy(m.color),v.opacity.value=m.opacity,v.size.value=m.size*y,v.scale.value=_*.5,m.map&&(v.map.value=m.map,t(m.map,v.uvTransform)),m.alphaMap&&(v.alphaMap.value=m.alphaMap,t(m.alphaMap,v.alphaMapTransform)),m.alphaTest>0&&(v.alphaTest.value=m.alphaTest)}function u(v,m){v.diffuse.value.copy(m.color),v.opacity.value=m.opacity,v.rotation.value=m.rotation,m.map&&(v.map.value=m.map,t(m.map,v.mapTransform)),m.alphaMap&&(v.alphaMap.value=m.alphaMap,t(m.alphaMap,v.alphaMapTransform)),m.alphaTest>0&&(v.alphaTest.value=m.alphaTest)}function c(v,m){v.specular.value.copy(m.specular),v.shininess.value=Math.max(m.shininess,1e-4)}function h(v,m){m.gradientMap&&(v.gradientMap.value=m.gradientMap)}function f(v,m){v.metalness.value=m.metalness,m.metalnessMap&&(v.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,v.metalnessMapTransform)),v.roughness.value=m.roughness,m.roughnessMap&&(v.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,v.roughnessMapTransform)),e.get(m).envMap&&(v.envMapIntensity.value=m.envMapIntensity)}function d(v,m,y){v.ior.value=m.ior,m.sheen>0&&(v.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),v.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(v.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,v.sheenColorMapTransform)),m.sheenRoughnessMap&&(v.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,v.sheenRoughnessMapTransform))),m.clearcoat>0&&(v.clearcoat.value=m.clearcoat,v.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(v.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,v.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(v.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,v.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(v.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,v.clearcoatNormalMapTransform),v.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===Di&&v.clearcoatNormalScale.value.negate())),m.iridescence>0&&(v.iridescence.value=m.iridescence,v.iridescenceIOR.value=m.iridescenceIOR,v.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],v.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(v.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,v.iridescenceMapTransform)),m.iridescenceThicknessMap&&(v.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,v.iridescenceThicknessMapTransform))),m.transmission>0&&(v.transmission.value=m.transmission,v.transmissionSamplerMap.value=y.texture,v.transmissionSamplerSize.value.set(y.width,y.height),m.transmissionMap&&(v.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,v.transmissionMapTransform)),v.thickness.value=m.thickness,m.thicknessMap&&(v.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,v.thicknessMapTransform)),v.attenuationDistance.value=m.attenuationDistance,v.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(v.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(v.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,v.anisotropyMapTransform))),v.specularIntensity.value=m.specularIntensity,v.specularColor.value.copy(m.specularColor),m.specularColorMap&&(v.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,v.specularColorMapTransform)),m.specularIntensityMap&&(v.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,v.specularIntensityMapTransform))}function p(v,m){m.matcap&&(v.matcap.value=m.matcap)}function g(v,m){const y=e.get(m).light;v.referencePosition.value.setFromMatrixPosition(y.matrixWorld),v.nearDistance.value=y.shadow.camera.near,v.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function sQ(r,e,t,n){let i={},a={},o=[];const s=t.isWebGL2?r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(y,_){const x=_.program;n.uniformBlockBinding(y,x)}function u(y,_){let x=i[y.id];x===void 0&&(p(y),x=c(y),i[y.id]=x,y.addEventListener("dispose",v));const S=_.program;n.updateUBOMapping(y,S);const A=e.render.frame;a[y.id]!==A&&(f(y),a[y.id]=A)}function c(y){const _=h();y.__bindingPointIndex=_;const x=r.createBuffer(),S=y.__size,A=y.usage;return r.bindBuffer(r.UNIFORM_BUFFER,x),r.bufferData(r.UNIFORM_BUFFER,S,A),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,_,x),x}function h(){for(let y=0;y0&&(x+=S-A),y.__size=x,y.__cache={},this}function g(y){const _={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(_.boundary=4,_.storage=4):y.isVector2?(_.boundary=8,_.storage=8):y.isVector3||y.isColor?(_.boundary=16,_.storage=12):y.isVector4?(_.boundary=16,_.storage=16):y.isMatrix3?(_.boundary=48,_.storage=48):y.isMatrix4?(_.boundary=64,_.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),_}function v(y){const _=y.target;_.removeEventListener("dispose",v);const x=o.indexOf(_.__bindingPointIndex);o.splice(x,1),r.deleteBuffer(i[_.id]),delete i[_.id],delete a[_.id]}function m(){for(const y in i)r.deleteBuffer(i[y]);o=[],i={},a={}}return{bind:l,update:u,dispose:m}}class fC{constructor(e={}){const{canvas:t=tY(),context:n=null,depth:i=!0,stencil:a=!0,alpha:o=!1,antialias:s=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let f;n!==null?f=n.getContextAttributes().alpha:f=o;const d=new Uint32Array(4),p=new Int32Array(4);let g=null,v=null;const m=[],y=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=dn,this._useLegacyLights=!1,this.toneMapping=Ol,this.toneMappingExposure=1;const _=this;let x=!1,S=0,A=0,w=null,M=-1,C=null;const b=new an,T=new an;let P=null;const D=new nt(0);let L=0,E=t.width,I=t.height,N=1,R=null,F=null;const O=new an(0,0,E,I),V=new an(0,0,E,I);let H=!1;const Q=new cC;let W=!1,Z=!1,ee=null;const he=new Mt,le=new Me,re=new X,be={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function de(){return w===null?N:1}let U=n;function K($,fe){for(let me=0;me<$.length;me++){const ye=$[me],ge=t.getContext(ye,fe);if(ge!==null)return ge}return null}try{const $={alpha:!0,depth:i,stencil:a,antialias:s,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:c,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${tC}`),t.addEventListener("webglcontextlost",et,!1),t.addEventListener("webglcontextrestored",Y,!1),t.addEventListener("webglcontextcreationerror",De,!1),U===null){const fe=["webgl2","webgl","experimental-webgl"];if(_.isWebGL1Renderer===!0&&fe.shift(),U=K(fe,$),U===null)throw K(fe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext!="undefined"&&U instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),U.getShaderPrecisionFormat===void 0&&(U.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch($){throw console.error("THREE.WebGLRenderer: "+$.message),$}let te,ce,se,Ne,Oe,B,z,ne,ve,Ae,we,We,Be,je,Ye,xt,Le,Wt,Ct,_t,J,ue,Ie,j;function Ee(){te=new pK(U),ce=new lK(U,te,e),te.init(ce),ue=new JZ(U,te,ce),se=new ZZ(U,te,ce),Ne=new mK(U),Oe=new FZ,B=new QZ(U,te,se,Oe,ce,ue,Ne),z=new cK(_),ne=new dK(_),ve=new TY(U,ce),Ie=new oK(U,te,ve,ce),Ae=new vK(U,ve,Ne,Ie),we=new SK(U,Ae,ve,Ne),Ct=new xK(U,ce,B),xt=new uK(Oe),We=new OZ(_,z,ne,te,ce,Ie,xt),Be=new oQ(_,Oe),je=new zZ,Ye=new $Z(te,ce),Wt=new aK(_,z,ne,se,we,f,l),Le=new KZ(_,we,ce),j=new sQ(U,Ne,ce,se),_t=new sK(U,te,Ne,ce),J=new gK(U,te,Ne,ce),Ne.programs=We.programs,_.capabilities=ce,_.extensions=te,_.properties=Oe,_.renderLists=je,_.shadowMap=Le,_.state=se,_.info=Ne}Ee();const Ue=new aQ(_,U);this.xr=Ue,this.getContext=function(){return U},this.getContextAttributes=function(){return U.getContextAttributes()},this.forceContextLoss=function(){const $=te.get("WEBGL_lose_context");$&&$.loseContext()},this.forceContextRestore=function(){const $=te.get("WEBGL_lose_context");$&&$.restoreContext()},this.getPixelRatio=function(){return N},this.setPixelRatio=function($){$!==void 0&&(N=$,this.setSize(E,I,!1))},this.getSize=function($){return $.set(E,I)},this.setSize=function($,fe,me=!0){if(Ue.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}E=$,I=fe,t.width=Math.floor($*N),t.height=Math.floor(fe*N),me===!0&&(t.style.width=$+"px",t.style.height=fe+"px"),this.setViewport(0,0,$,fe)},this.getDrawingBufferSize=function($){return $.set(E*N,I*N).floor()},this.setDrawingBufferSize=function($,fe,me){E=$,I=fe,N=me,t.width=Math.floor($*me),t.height=Math.floor(fe*me),this.setViewport(0,0,$,fe)},this.getCurrentViewport=function($){return $.copy(b)},this.getViewport=function($){return $.copy(O)},this.setViewport=function($,fe,me,ye){$.isVector4?O.set($.x,$.y,$.z,$.w):O.set($,fe,me,ye),se.viewport(b.copy(O).multiplyScalar(N).floor())},this.getScissor=function($){return $.copy(V)},this.setScissor=function($,fe,me,ye){$.isVector4?V.set($.x,$.y,$.z,$.w):V.set($,fe,me,ye),se.scissor(T.copy(V).multiplyScalar(N).floor())},this.getScissorTest=function(){return H},this.setScissorTest=function($){se.setScissorTest(H=$)},this.setOpaqueSort=function($){R=$},this.setTransparentSort=function($){F=$},this.getClearColor=function($){return $.copy(Wt.getClearColor())},this.setClearColor=function(){Wt.setClearColor.apply(Wt,arguments)},this.getClearAlpha=function(){return Wt.getClearAlpha()},this.setClearAlpha=function(){Wt.setClearAlpha.apply(Wt,arguments)},this.clear=function($=!0,fe=!0,me=!0){let ye=0;if($){let ge=!1;if(w!==null){const Ze=w.texture.format;ge=Ze===cz||Ze===uz||Ze===lz}if(ge){const Ze=w.texture.type,ct=Ze===Fl||Ze===xl||Ze===rC||Ze===yc||Ze===oz||Ze===sz,mt=Wt.getClearColor(),At=Wt.getClearAlpha(),Bt=mt.r,Et=mt.g,Rt=mt.b;ct?(d[0]=Bt,d[1]=Et,d[2]=Rt,d[3]=At,U.clearBufferuiv(U.COLOR,0,d)):(p[0]=Bt,p[1]=Et,p[2]=Rt,p[3]=At,U.clearBufferiv(U.COLOR,0,p))}else ye|=U.COLOR_BUFFER_BIT}fe&&(ye|=U.DEPTH_BUFFER_BIT),me&&(ye|=U.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),U.clear(ye)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",et,!1),t.removeEventListener("webglcontextrestored",Y,!1),t.removeEventListener("webglcontextcreationerror",De,!1),je.dispose(),Ye.dispose(),Oe.dispose(),z.dispose(),ne.dispose(),we.dispose(),Ie.dispose(),j.dispose(),We.dispose(),Ue.dispose(),Ue.removeEventListener("sessionstart",Lr),Ue.removeEventListener("sessionend",en),ee&&(ee.dispose(),ee=null),jn.stop()};function et($){$.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function Y(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1;const $=Ne.autoReset,fe=Le.enabled,me=Le.autoUpdate,ye=Le.needsUpdate,ge=Le.type;Ee(),Ne.autoReset=$,Le.enabled=fe,Le.autoUpdate=me,Le.needsUpdate=ye,Le.type=ge}function De($){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",$.statusMessage)}function q($){const fe=$.target;fe.removeEventListener("dispose",q),Ce(fe)}function Ce($){st($),Oe.remove($)}function st($){const fe=Oe.get($).programs;fe!==void 0&&(fe.forEach(function(me){We.releaseProgram(me)}),$.isShaderMaterial&&We.releaseShaderCache($))}this.renderBufferDirect=function($,fe,me,ye,ge,Ze){fe===null&&(fe=be);const ct=ge.isMesh&&ge.matrixWorld.determinant()<0,mt=l7($,fe,me,ye,ge);se.setMaterial(ye,ct);let At=me.index,Bt=1;if(ye.wireframe===!0){if(At=Ae.getWireframeAttribute(me),At===void 0)return;Bt=2}const Et=me.drawRange,Rt=me.attributes.position;let Kn=Et.start*Bt,Vi=(Et.start+Et.count)*Bt;Ze!==null&&(Kn=Math.max(Kn,Ze.start*Bt),Vi=Math.min(Vi,(Ze.start+Ze.count)*Bt)),At!==null?(Kn=Math.max(Kn,0),Vi=Math.min(Vi,At.count)):Rt!=null&&(Kn=Math.max(Kn,0),Vi=Math.min(Vi,Rt.count));const wr=Vi-Kn;if(wr<0||wr===1/0)return;Ie.setup(ge,ye,mt,me,At);let ts,On=_t;if(At!==null&&(ts=ve.get(At),On=J,On.setIndex(ts)),ge.isMesh)ye.wireframe===!0?(se.setLineWidth(ye.wireframeLinewidth*de()),On.setMode(U.LINES)):On.setMode(U.TRIANGLES);else if(ge.isLine){let Ut=ye.linewidth;Ut===void 0&&(Ut=1),se.setLineWidth(Ut*de()),ge.isLineSegments?On.setMode(U.LINES):ge.isLineLoop?On.setMode(U.LINE_LOOP):On.setMode(U.LINE_STRIP)}else ge.isPoints?On.setMode(U.POINTS):ge.isSprite&&On.setMode(U.TRIANGLES);if(ge.isBatchedMesh)On.renderMultiDraw(ge._multiDrawStarts,ge._multiDrawCounts,ge._multiDrawCount);else if(ge.isInstancedMesh)On.renderInstances(Kn,wr,ge.count);else if(me.isInstancedBufferGeometry){const Ut=me._maxInstanceCount!==void 0?me._maxInstanceCount:1/0,ax=Math.min(me.instanceCount,Ut);On.renderInstances(Kn,wr,ax)}else On.render(Kn,wr)};function Jt($,fe,me){$.transparent===!0&&$.side===ur&&$.forceSinglePass===!1?($.side=Di,$.needsUpdate=!0,Gg($,fe,me),$.side=Es,$.needsUpdate=!0,Gg($,fe,me),$.side=ur):Gg($,fe,me)}this.compile=function($,fe,me=null){me===null&&(me=$),v=Ye.get(me),v.init(),y.push(v),me.traverseVisible(function(ge){ge.isLight&&ge.layers.test(fe.layers)&&(v.pushLight(ge),ge.castShadow&&v.pushShadow(ge))}),$!==me&&$.traverseVisible(function(ge){ge.isLight&&ge.layers.test(fe.layers)&&(v.pushLight(ge),ge.castShadow&&v.pushShadow(ge))}),v.setupLights(_._useLegacyLights);const ye=new Set;return $.traverse(function(ge){const Ze=ge.material;if(Ze)if(Array.isArray(Ze))for(let ct=0;ct{function Ze(){if(ye.forEach(function(ct){Oe.get(ct).currentProgram.isReady()&&ye.delete(ct)}),ye.size===0){ge($);return}setTimeout(Ze,10)}te.get("KHR_parallel_shader_compile")!==null?Ze():setTimeout(Ze,10)})};let $t=null;function mn($){$t&&$t($)}function Lr(){jn.stop()}function en(){jn.start()}const jn=new Tz;jn.setAnimationLoop(mn),typeof self!="undefined"&&jn.setContext(self),this.setAnimationLoop=function($){$t=$,Ue.setAnimationLoop($),$===null?jn.stop():jn.start()},Ue.addEventListener("sessionstart",Lr),Ue.addEventListener("sessionend",en),this.render=function($,fe){if(fe!==void 0&&fe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(x===!0)return;$.matrixWorldAutoUpdate===!0&&$.updateMatrixWorld(),fe.parent===null&&fe.matrixWorldAutoUpdate===!0&&fe.updateMatrixWorld(),Ue.enabled===!0&&Ue.isPresenting===!0&&(Ue.cameraAutoUpdate===!0&&Ue.updateCamera(fe),fe=Ue.getCamera()),$.isScene===!0&&$.onBeforeRender(_,$,fe,w),v=Ye.get($,y.length),v.init(),y.push(v),he.multiplyMatrices(fe.projectionMatrix,fe.matrixWorldInverse),Q.setFromProjectionMatrix(he),Z=this.localClippingEnabled,W=xt.init(this.clippingPlanes,Z),g=je.get($,m.length),g.init(),m.push(g),oi($,fe,0,_.sortObjects),g.finish(),_.sortObjects===!0&&g.sort(R,F),this.info.render.frame++,W===!0&&xt.beginShadows();const me=v.state.shadowsArray;if(Le.render(me,$,fe),W===!0&&xt.endShadows(),this.info.autoReset===!0&&this.info.reset(),(Ue.enabled===!1||Ue.isPresenting===!1||Ue.hasDepthSensing()===!1)&&Wt.render(g,$),v.setupLights(_._useLegacyLights),fe.isArrayCamera){const ye=fe.cameras;for(let ge=0,Ze=ye.length;ge0?v=y[y.length-1]:v=null,m.pop(),m.length>0?g=m[m.length-1]:g=null};function oi($,fe,me,ye){if($.visible===!1)return;if($.layers.test(fe.layers)){if($.isGroup)me=$.renderOrder;else if($.isLOD)$.autoUpdate===!0&&$.update(fe);else if($.isLight)v.pushLight($),$.castShadow&&v.pushShadow($);else if($.isSprite){if(!$.frustumCulled||Q.intersectsSprite($)){ye&&re.setFromMatrixPosition($.matrixWorld).applyMatrix4(he);const ct=we.update($),mt=$.material;mt.visible&&g.push($,ct,mt,me,re.z,null)}}else if(($.isMesh||$.isLine||$.isPoints)&&(!$.frustumCulled||Q.intersectsObject($))){const ct=we.update($),mt=$.material;if(ye&&($.boundingSphere!==void 0?($.boundingSphere===null&&$.computeBoundingSphere(),re.copy($.boundingSphere.center)):(ct.boundingSphere===null&&ct.computeBoundingSphere(),re.copy(ct.boundingSphere.center)),re.applyMatrix4($.matrixWorld).applyMatrix4(he)),Array.isArray(mt)){const At=ct.groups;for(let Bt=0,Et=At.length;Bt0&&s7(ge,Ze,fe,me),ye&&se.viewport(b.copy(ye)),ge.length>0&&Vg(ge,fe,me),Ze.length>0&&Vg(Ze,fe,me),ct.length>0&&Vg(ct,fe,me),se.buffers.depth.setTest(!0),se.buffers.depth.setMask(!0),se.buffers.color.setMask(!0),se.setPolygonOffset(!1)}function s7($,fe,me,ye){if((me.isScene===!0?me.overrideMaterial:null)!==null)return;const Ze=ce.isWebGL2;ee===null&&(ee=new kc(1,1,{generateMipmaps:!0,type:te.has("EXT_color_buffer_half_float")?wv:Fl,minFilter:gs,samples:Ze?4:0})),_.getDrawingBufferSize(le),Ze?ee.setSize(le.x,le.y):ee.setSize(k0(le.x),k0(le.y));const ct=_.getRenderTarget();_.setRenderTarget(ee),_.getClearColor(D),L=_.getClearAlpha(),L<1&&_.setClearColor(16777215,.5),_.clear();const mt=_.toneMapping;_.toneMapping=Ol,Vg($,me,ye),B.updateMultisampleRenderTarget(ee),B.updateRenderTargetMipmap(ee);let At=!1;for(let Bt=0,Et=fe.length;Bt0),Rt=!!me.morphAttributes.position,Kn=!!me.morphAttributes.normal,Vi=!!me.morphAttributes.color;let wr=Ol;ye.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&(wr=_.toneMapping);const ts=me.morphAttributes.position||me.morphAttributes.normal||me.morphAttributes.color,On=ts!==void 0?ts.length:0,Ut=Oe.get(ye),ax=v.state.lights;if(W===!0&&(Z===!0||$!==C)){const oa=$===C&&ye.id===M;xt.setState(ye,$,oa)}let Hn=!1;ye.version===Ut.__version?(Ut.needsLights&&Ut.lightsStateVersion!==ax.state.version||Ut.outputColorSpace!==mt||ge.isBatchedMesh&&Ut.batching===!1||!ge.isBatchedMesh&&Ut.batching===!0||ge.isInstancedMesh&&Ut.instancing===!1||!ge.isInstancedMesh&&Ut.instancing===!0||ge.isSkinnedMesh&&Ut.skinning===!1||!ge.isSkinnedMesh&&Ut.skinning===!0||ge.isInstancedMesh&&Ut.instancingColor===!0&&ge.instanceColor===null||ge.isInstancedMesh&&Ut.instancingColor===!1&&ge.instanceColor!==null||Ut.envMap!==At||ye.fog===!0&&Ut.fog!==Ze||Ut.numClippingPlanes!==void 0&&(Ut.numClippingPlanes!==xt.numPlanes||Ut.numIntersection!==xt.numIntersection)||Ut.vertexAlphas!==Bt||Ut.vertexTangents!==Et||Ut.morphTargets!==Rt||Ut.morphNormals!==Kn||Ut.morphColors!==Vi||Ut.toneMapping!==wr||ce.isWebGL2===!0&&Ut.morphTargetsCount!==On)&&(Hn=!0):(Hn=!0,Ut.__version=ye.version);let lu=Ut.currentProgram;Hn===!0&&(lu=Gg(ye,fe,ge));let rL=!1,Rd=!1,ox=!1;const Vr=lu.getUniforms(),uu=Ut.uniforms;if(se.useProgram(lu.program)&&(rL=!0,Rd=!0,ox=!0),ye.id!==M&&(M=ye.id,Rd=!0),rL||C!==$){Vr.setValue(U,"projectionMatrix",$.projectionMatrix),Vr.setValue(U,"viewMatrix",$.matrixWorldInverse);const oa=Vr.map.cameraPosition;oa!==void 0&&oa.setValue(U,re.setFromMatrixPosition($.matrixWorld)),ce.logarithmicDepthBuffer&&Vr.setValue(U,"logDepthBufFC",2/(Math.log($.far+1)/Math.LN2)),(ye.isMeshPhongMaterial||ye.isMeshToonMaterial||ye.isMeshLambertMaterial||ye.isMeshBasicMaterial||ye.isMeshStandardMaterial||ye.isShaderMaterial)&&Vr.setValue(U,"isOrthographic",$.isOrthographicCamera===!0),C!==$&&(C=$,Rd=!0,ox=!0)}if(ge.isSkinnedMesh){Vr.setOptional(U,ge,"bindMatrix"),Vr.setOptional(U,ge,"bindMatrixInverse");const oa=ge.skeleton;oa&&(ce.floatVertexTextures?(oa.boneTexture===null&&oa.computeBoneTexture(),Vr.setValue(U,"boneTexture",oa.boneTexture,B)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}ge.isBatchedMesh&&(Vr.setOptional(U,ge,"batchingTexture"),Vr.setValue(U,"batchingTexture",ge._matricesTexture,B));const sx=me.morphAttributes;if((sx.position!==void 0||sx.normal!==void 0||sx.color!==void 0&&ce.isWebGL2===!0)&&Ct.update(ge,me,lu),(Rd||Ut.receiveShadow!==ge.receiveShadow)&&(Ut.receiveShadow=ge.receiveShadow,Vr.setValue(U,"receiveShadow",ge.receiveShadow)),ye.isMeshGouraudMaterial&&ye.envMap!==null&&(uu.envMap.value=At,uu.flipEnvMap.value=At.isCubeTexture&&At.isRenderTargetTexture===!1?-1:1),Rd&&(Vr.setValue(U,"toneMappingExposure",_.toneMappingExposure),Ut.needsLights&&u7(uu,ox),Ze&&ye.fog===!0&&Be.refreshFogUniforms(uu,Ze),Be.refreshMaterialUniforms(uu,ye,N,I,ee),Xy.upload(U,tL(Ut),uu,B)),ye.isShaderMaterial&&ye.uniformsNeedUpdate===!0&&(Xy.upload(U,tL(Ut),uu,B),ye.uniformsNeedUpdate=!1),ye.isSpriteMaterial&&Vr.setValue(U,"center",ge.center),Vr.setValue(U,"modelViewMatrix",ge.modelViewMatrix),Vr.setValue(U,"normalMatrix",ge.normalMatrix),Vr.setValue(U,"modelMatrix",ge.matrixWorld),ye.isShaderMaterial||ye.isRawShaderMaterial){const oa=ye.uniformsGroups;for(let lx=0,h7=oa.length;lx0&&B.useMultisampledRTT($)===!1?ge=Oe.get($).__webglMultisampledFramebuffer:Array.isArray(Et)?ge=Et[me]:ge=Et,b.copy($.viewport),T.copy($.scissor),P=$.scissorTest}else b.copy(O).multiplyScalar(N).floor(),T.copy(V).multiplyScalar(N).floor(),P=H;if(se.bindFramebuffer(U.FRAMEBUFFER,ge)&&ce.drawBuffers&&ye&&se.drawBuffers($,ge),se.viewport(b),se.scissor(T),se.setScissorTest(P),Ze){const At=Oe.get($.texture);U.framebufferTexture2D(U.FRAMEBUFFER,U.COLOR_ATTACHMENT0,U.TEXTURE_CUBE_MAP_POSITIVE_X+fe,At.__webglTexture,me)}else if(ct){const At=Oe.get($.texture),Bt=fe||0;U.framebufferTextureLayer(U.FRAMEBUFFER,U.COLOR_ATTACHMENT0,At.__webglTexture,me||0,Bt)}M=-1},this.readRenderTargetPixels=function($,fe,me,ye,ge,Ze,ct){if(!($&&$.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let mt=Oe.get($).__webglFramebuffer;if($.isWebGLCubeRenderTarget&&ct!==void 0&&(mt=mt[ct]),mt){se.bindFramebuffer(U.FRAMEBUFFER,mt);try{const At=$.texture,Bt=At.format,Et=At.type;if(Bt!==ba&&ue.convert(Bt)!==U.getParameter(U.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Rt=Et===wv&&(te.has("EXT_color_buffer_half_float")||ce.isWebGL2&&te.has("EXT_color_buffer_float"));if(Et!==Fl&&ue.convert(Et)!==U.getParameter(U.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Et===Ro&&(ce.isWebGL2||te.has("OES_texture_float")||te.has("WEBGL_color_buffer_float")))&&!Rt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}fe>=0&&fe<=$.width-ye&&me>=0&&me<=$.height-ge&&U.readPixels(fe,me,ye,ge,ue.convert(Bt),ue.convert(Et),Ze)}finally{const At=w!==null?Oe.get(w).__webglFramebuffer:null;se.bindFramebuffer(U.FRAMEBUFFER,At)}}},this.copyFramebufferToTexture=function($,fe,me=0){const ye=Math.pow(2,-me),ge=Math.floor(fe.image.width*ye),Ze=Math.floor(fe.image.height*ye);B.setTexture2D(fe,0),U.copyTexSubImage2D(U.TEXTURE_2D,me,0,0,$.x,$.y,ge,Ze),se.unbindTexture()},this.copyTextureToTexture=function($,fe,me,ye=0){const ge=fe.image.width,Ze=fe.image.height,ct=ue.convert(me.format),mt=ue.convert(me.type);B.setTexture2D(me,0),U.pixelStorei(U.UNPACK_FLIP_Y_WEBGL,me.flipY),U.pixelStorei(U.UNPACK_PREMULTIPLY_ALPHA_WEBGL,me.premultiplyAlpha),U.pixelStorei(U.UNPACK_ALIGNMENT,me.unpackAlignment),fe.isDataTexture?U.texSubImage2D(U.TEXTURE_2D,ye,$.x,$.y,ge,Ze,ct,mt,fe.image.data):fe.isCompressedTexture?U.compressedTexSubImage2D(U.TEXTURE_2D,ye,$.x,$.y,fe.mipmaps[0].width,fe.mipmaps[0].height,ct,fe.mipmaps[0].data):U.texSubImage2D(U.TEXTURE_2D,ye,$.x,$.y,ct,mt,fe.image),ye===0&&me.generateMipmaps&&U.generateMipmap(U.TEXTURE_2D),se.unbindTexture()},this.copyTextureToTexture3D=function($,fe,me,ye,ge=0){if(_.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Ze=$.max.x-$.min.x+1,ct=$.max.y-$.min.y+1,mt=$.max.z-$.min.z+1,At=ue.convert(ye.format),Bt=ue.convert(ye.type);let Et;if(ye.isData3DTexture)B.setTexture3D(ye,0),Et=U.TEXTURE_3D;else if(ye.isDataArrayTexture||ye.isCompressedArrayTexture)B.setTexture2DArray(ye,0),Et=U.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}U.pixelStorei(U.UNPACK_FLIP_Y_WEBGL,ye.flipY),U.pixelStorei(U.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ye.premultiplyAlpha),U.pixelStorei(U.UNPACK_ALIGNMENT,ye.unpackAlignment);const Rt=U.getParameter(U.UNPACK_ROW_LENGTH),Kn=U.getParameter(U.UNPACK_IMAGE_HEIGHT),Vi=U.getParameter(U.UNPACK_SKIP_PIXELS),wr=U.getParameter(U.UNPACK_SKIP_ROWS),ts=U.getParameter(U.UNPACK_SKIP_IMAGES),On=me.isCompressedTexture?me.mipmaps[ge]:me.image;U.pixelStorei(U.UNPACK_ROW_LENGTH,On.width),U.pixelStorei(U.UNPACK_IMAGE_HEIGHT,On.height),U.pixelStorei(U.UNPACK_SKIP_PIXELS,$.min.x),U.pixelStorei(U.UNPACK_SKIP_ROWS,$.min.y),U.pixelStorei(U.UNPACK_SKIP_IMAGES,$.min.z),me.isDataTexture||me.isData3DTexture?U.texSubImage3D(Et,ge,fe.x,fe.y,fe.z,Ze,ct,mt,At,Bt,On.data):me.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),U.compressedTexSubImage3D(Et,ge,fe.x,fe.y,fe.z,Ze,ct,mt,At,On.data)):U.texSubImage3D(Et,ge,fe.x,fe.y,fe.z,Ze,ct,mt,At,Bt,On),U.pixelStorei(U.UNPACK_ROW_LENGTH,Rt),U.pixelStorei(U.UNPACK_IMAGE_HEIGHT,Kn),U.pixelStorei(U.UNPACK_SKIP_PIXELS,Vi),U.pixelStorei(U.UNPACK_SKIP_ROWS,wr),U.pixelStorei(U.UNPACK_SKIP_IMAGES,ts),ge===0&&ye.generateMipmaps&&U.generateMipmap(Et),se.unbindTexture()},this.initTexture=function($){$.isCubeTexture?B.setTextureCube($,0):$.isData3DTexture?B.setTexture3D($,0):$.isDataArrayTexture||$.isCompressedArrayTexture?B.setTexture2DArray($,0):B.setTexture2D($,0),se.unbindTexture()},this.resetState=function(){S=0,A=0,w=null,se.reset(),Ie.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return ms}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===aC?"display-p3":"srgb",t.unpackColorSpace=ln.workingColorSpace===Q_?"display-p3":"srgb"}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===dn?xc:dz}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===xc?dn:yr}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class lQ extends fC{}lQ.prototype.isWebGL1Renderer=!0;class dC{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new nt(e),this.near=t,this.far=n}clone(){return new dC(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Dz extends bn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class pC{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=xb,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Ra()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return Sc("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,a=this.stride;ie.far||t.push({distance:l,point:Fd.clone(),uv:Tp.getInterpolation(Fd,fm,zd,dm,rR,Qx,iR,new Me),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function pm(r,e,t,n,i,a){Ch.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Bd.x=a*Ch.x-i*Ch.y,Bd.y=i*Ch.x+a*Ch.y):Bd.copy(Ch),r.copy(e),r.x+=Bd.x,r.y+=Bd.y,r.applyMatrix4(Iz)}const oR=new X,sR=new an,lR=new an,uQ=new X,uR=new Mt,vm=new X,Jx=new Fa,cR=new Mt,eS=new sd;class cQ extends rn{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=zL,this.bindMatrix=new Mt,this.bindMatrixInverse=new Mt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Oa),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;nl)continue;f.applyMatrix4(this.matrixWorld);const M=e.ray.origin.distanceTo(f);Me.far||t.push({distance:M,point:h.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}}else{const m=Math.max(0,o.start),y=Math.min(v.count,o.start+o.count);for(let _=m,x=y-1;_l)continue;f.applyMatrix4(this.matrixWorld);const A=e.ray.origin.distanceTo(f);Ae.far||t.push({distance:A,point:h.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,o=i.length;a0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,o=i.length;ai.far)return;a.push({distance:u,distanceToRay:Math.sqrt(s),point:l,index:e,face:null,object:o})}}class yC extends mr{constructor(e,t,n,i,a,o,s,l,u){super(e,t,n,i,a,o,s,l,u),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Zo{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,i=this.getPoint(0),a=0;t.push(0);for(let o=1;o<=e;o++)n=this.getPoint(o/e),a+=n.distanceTo(i),t.push(a),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let i=0;const a=n.length;let o;t?o=t:o=e*n[a-1];let s=0,l=a-1,u;for(;s<=l;)if(i=Math.floor(s+(l-s)/2),u=n[i]-o,u<0)s=i+1;else if(u>0)l=i-1;else{l=i;break}if(i=l,n[i]===o)return i/(a-1);const c=n[i],f=n[i+1]-c,d=(o-c)/f;return(i+d)/(a-1)}getTangent(e,t){let i=e-1e-4,a=e+1e-4;i<0&&(i=0),a>1&&(a=1);const o=this.getPoint(i),s=this.getPoint(a),l=t||(o.isVector2?new Me:new X);return l.copy(s).sub(o).normalize(),l}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new X,i=[],a=[],o=[],s=new X,l=new Mt;for(let d=0;d<=e;d++){const p=d/e;i[d]=this.getTangentAt(p,new X)}a[0]=new X,o[0]=new X;let u=Number.MAX_VALUE;const c=Math.abs(i[0].x),h=Math.abs(i[0].y),f=Math.abs(i[0].z);c<=u&&(u=c,n.set(1,0,0)),h<=u&&(u=h,n.set(0,1,0)),f<=u&&n.set(0,0,1),s.crossVectors(i[0],n).normalize(),a[0].crossVectors(i[0],s),o[0].crossVectors(i[0],a[0]);for(let d=1;d<=e;d++){if(a[d]=a[d-1].clone(),o[d]=o[d-1].clone(),s.crossVectors(i[d-1],i[d]),s.length()>Number.EPSILON){s.normalize();const p=Math.acos(hr(i[d-1].dot(i[d]),-1,1));a[d].applyMatrix4(l.makeRotationAxis(s,p))}o[d].crossVectors(i[d],a[d])}if(t===!0){let d=Math.acos(hr(a[0].dot(a[e]),-1,1));d/=e,i[0].dot(s.crossVectors(a[0],a[e]))>0&&(d=-d);for(let p=1;p<=e;p++)a[p].applyMatrix4(l.makeRotationAxis(i[p],d*p)),o[p].crossVectors(i[p],a[p])}return{tangents:i,normals:a,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class _C extends Zo{constructor(e=0,t=0,n=1,i=1,a=0,o=Math.PI*2,s=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=a,this.aEndAngle=o,this.aClockwise=s,this.aRotation=l}getPoint(e,t){const n=t||new Me,i=Math.PI*2;let a=this.aEndAngle-this.aStartAngle;const o=Math.abs(a)i;)a-=i;a0?0:(Math.floor(Math.abs(s)/a)+1)*a:l===0&&s===a-1&&(s=a-2,l=1);let u,c;this.closed||s>0?u=i[(s-1)%a]:(xm.subVectors(i[0],i[1]).add(i[0]),u=xm);const h=i[s%a],f=i[(s+1)%a];if(this.closed||s+2i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(SR(s,l.x,u.x,c.x,h.x),SR(s,l.y,u.y,c.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t=n){const o=i[a]-n,s=this.curves[a],l=s.getLength(),u=l===0?0:1-o/l;return s.getPointAt(u,t)}a++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){const h=u.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(u);const c=u.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}};class Uo extends AR{constructor(e){super(e),this.uuid=Ra(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,i=this.holes.length;n80*t){s=u=r[0],l=c=r[1];for(let p=t;pu&&(u=h),f>c&&(c=f);d=Math.max(u-s,c-l),d=d!==0?32767/d:0}return Cv(a,o,t,s,l,d,0),o}};function Vz(r,e,t,n,i){let a,o;if(i===GQ(r,e,t,n)>0)for(a=e;a=e;a-=n)o=wR(a,r[a],r[a+1],o);return o&&n1(o,o.next)&&(Lv(o),o=o.next),o}function Oc(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(n1(t,t.next)||Un(t.prev,t,t.next)===0)){if(Lv(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function Cv(r,e,t,n,i,a,o){if(!r)return;!o&&a&&OQ(r,n,i,a);let s=r,l,u;for(;r.prev!==r.next;){if(l=r.prev,u=r.next,a?EQ(r,n,i,a):CQ(r)){e.push(l.i/t|0),e.push(r.i/t|0),e.push(u.i/t|0),Lv(r),r=u.next,s=u.next;continue}if(r=u,r===s){o?o===1?(r=LQ(Oc(r),e,t),Cv(r,e,t,n,i,a,2)):o===2&&PQ(r,e,t,n,i,a):Cv(Oc(r),e,t,n,i,a,1);break}}}function CQ(r){const e=r.prev,t=r,n=r.next;if(Un(e,t,n)>=0)return!1;const i=e.x,a=t.x,o=n.x,s=e.y,l=t.y,u=n.y,c=ia?i>o?i:o:a>o?a:o,d=s>l?s>u?s:u:l>u?l:u;let p=n.next;for(;p!==e;){if(p.x>=c&&p.x<=f&&p.y>=h&&p.y<=d&&ff(i,s,a,l,o,u,p.x,p.y)&&Un(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function EQ(r,e,t,n){const i=r.prev,a=r,o=r.next;if(Un(i,a,o)>=0)return!1;const s=i.x,l=a.x,u=o.x,c=i.y,h=a.y,f=o.y,d=sl?s>u?s:u:l>u?l:u,v=c>h?c>f?c:f:h>f?h:f,m=Cb(d,p,e,t,n),y=Cb(g,v,e,t,n);let _=r.prevZ,x=r.nextZ;for(;_&&_.z>=m&&x&&x.z<=y;){if(_.x>=d&&_.x<=g&&_.y>=p&&_.y<=v&&_!==i&&_!==o&&ff(s,c,l,h,u,f,_.x,_.y)&&Un(_.prev,_,_.next)>=0||(_=_.prevZ,x.x>=d&&x.x<=g&&x.y>=p&&x.y<=v&&x!==i&&x!==o&&ff(s,c,l,h,u,f,x.x,x.y)&&Un(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;_&&_.z>=m;){if(_.x>=d&&_.x<=g&&_.y>=p&&_.y<=v&&_!==i&&_!==o&&ff(s,c,l,h,u,f,_.x,_.y)&&Un(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;x&&x.z<=y;){if(x.x>=d&&x.x<=g&&x.y>=p&&x.y<=v&&x!==i&&x!==o&&ff(s,c,l,h,u,f,x.x,x.y)&&Un(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function LQ(r,e,t){let n=r;do{const i=n.prev,a=n.next.next;!n1(i,a)&&Gz(i,n,n.next,a)&&Ev(i,a)&&Ev(a,i)&&(e.push(i.i/t|0),e.push(n.i/t|0),e.push(a.i/t|0),Lv(n),Lv(n.next),n=r=a),n=n.next}while(n!==r);return Oc(n)}function PQ(r,e,t,n,i,a){let o=r;do{let s=o.next.next;for(;s!==o.prev;){if(o.i!==s.i&&zQ(o,s)){let l=Hz(o,s);o=Oc(o,o.next),l=Oc(l,l.next),Cv(o,e,t,n,i,a,0),Cv(l,e,t,n,i,a,0);return}s=s.next}o=o.next}while(o!==r)}function RQ(r,e,t,n){const i=[];let a,o,s,l,u;for(a=0,o=e.length;a=t.next.y&&t.next.y!==t.y){const f=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(f<=a&&f>n&&(n=f,i=t.x=t.x&&t.x>=l&&a!==t.x&&ff(oi.x||t.x===i.x&&kQ(i,t)))&&(i=t,c=h)),t=t.next;while(t!==s);return i}function kQ(r,e){return Un(r.prev,r,e.prev)<0&&Un(e.next,r,r.next)<0}function OQ(r,e,t,n){let i=r;do i.z===0&&(i.z=Cb(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,FQ(i)}function FQ(r){let e,t,n,i,a,o,s,l,u=1;do{for(t=r,r=null,a=null,o=0;t;){for(o++,n=t,s=0,e=0;e0||l>0&&n;)s!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:r=i,i.prevZ=a,a=i;t=n}a.nextZ=null,u*=2}while(o>1);return r}function Cb(r,e,t,n,i){return r=(r-t)*i|0,e=(e-n)*i|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function BQ(r){let e=r,t=r;do(e.x=(r-o)*(a-s)&&(r-o)*(n-s)>=(t-o)*(e-s)&&(t-o)*(a-s)>=(i-o)*(n-s)}function zQ(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!UQ(r,e)&&(Ev(r,e)&&Ev(e,r)&&VQ(r,e)&&(Un(r.prev,r,e.prev)||Un(r,e.prev,e))||n1(r,e)&&Un(r.prev,r,r.next)>0&&Un(e.prev,e,e.next)>0)}function Un(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function n1(r,e){return r.x===e.x&&r.y===e.y}function Gz(r,e,t,n){const i=Am(Un(r,e,t)),a=Am(Un(r,e,n)),o=Am(Un(t,n,r)),s=Am(Un(t,n,e));return!!(i!==a&&o!==s||i===0&&Sm(r,t,e)||a===0&&Sm(r,n,e)||o===0&&Sm(t,r,n)||s===0&&Sm(t,e,n))}function Sm(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function Am(r){return r>0?1:r<0?-1:0}function UQ(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&Gz(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function Ev(r,e){return Un(r.prev,r,r.next)<0?Un(r,e,r.next)>=0&&Un(r,r.prev,e)>=0:Un(r,e,r.prev)<0||Un(r,r.next,e)<0}function VQ(r,e){let t=r,n=!1;const i=(r.x+e.x)/2,a=(r.y+e.y)/2;do t.y>a!=t.next.y>a&&t.next.y!==t.y&&i<(t.next.x-t.x)*(a-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function Hz(r,e){const t=new Eb(r.i,r.x,r.y),n=new Eb(e.i,e.x,e.y),i=r.next,a=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,a.next=n,n.prev=a,n}function wR(r,e,t,n){const i=new Eb(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Lv(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Eb(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function GQ(r,e,t,n){let i=0;for(let a=e,o=t-n;a2&&r[e-1].equals(r[0])&&r.pop()}function TR(r,e){for(let t=0;tNumber.EPSILON){const we=Math.sqrt(ve),We=Math.sqrt(z*z+ne*ne),Be=K.x-B/we,je=K.y+Oe/we,Ye=te.x-ne/We,xt=te.y+z/We,Le=((Ye-Be)*ne-(xt-je)*z)/(Oe*ne-B*z);ce=Be+Oe*Le-U.x,se=je+B*Le-U.y;const Wt=ce*ce+se*se;if(Wt<=2)return new Me(ce,se);Ne=Math.sqrt(Wt/2)}else{let we=!1;Oe>Number.EPSILON?z>Number.EPSILON&&(we=!0):Oe<-Number.EPSILON?z<-Number.EPSILON&&(we=!0):Math.sign(B)===Math.sign(ne)&&(we=!0),we?(ce=-B,se=Oe,Ne=Math.sqrt(ve)):(ce=Oe,se=B,Ne=Math.sqrt(ve/2))}return new Me(ce/Ne,se/Ne)}const F=[];for(let U=0,K=L.length,te=K-1,ce=U+1;U=0;U--){const K=U/v,te=d*Math.cos(K*Math.PI/2),ce=p*Math.sin(K*Math.PI/2)+g;for(let se=0,Ne=L.length;se=0;){const ce=te;let se=te-1;se<0&&(se=U.length-1);for(let Ne=0,Oe=c+v*2;Ne0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class Lb extends Da{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new nt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new nt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=iC,this.normalScale=new Me(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=nC,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}function wm(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)}function YQ(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function qQ(r){function e(i,a){return r[i]-r[a]}const t=r.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function CR(r,e,t){const n=r.length,i=new r.constructor(n);for(let a=0,o=0;o!==n;++a){const s=t[a]*e;for(let l=0;l!==e;++l)i[o++]=r[s+l]}return i}function Wz(r,e,t,n){let i=1,a=r[0];for(;a!==void 0&&a[n]===void 0;)a=r[i++];if(a===void 0)return;let o=a[n];if(o!==void 0)if(Array.isArray(o))do o=a[n],o!==void 0&&(e.push(a.time),t.push.apply(t,o)),a=r[i++];while(a!==void 0);else if(o.toArray!==void 0)do o=a[n],o!==void 0&&(e.push(a.time),o.toArray(t,t.length)),a=r[i++];while(a!==void 0);else do o=a[n],o!==void 0&&(e.push(a.time),t.push(o)),a=r[i++];while(a!==void 0)}class gg{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],a=t[n-1];e:{t:{let o;n:{r:if(!(e=a)){const s=t[1];e=a)break t}o=n,n=0;break n}break e}for(;n>>1;et;)--o;if(++o,a!==0||o!==i){a>=o&&(o=Math.max(o,1),a=o-1);const s=this.getValueSize();this.times=n.slice(a,o),this.values=this.values.slice(a*s,o*s)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,a=n.length;a===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let s=0;s!==a;s++){const l=n[s];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,l,o),e=!1;break}o=l}if(i!==void 0&&YQ(i))for(let s=0,l=i.length;s!==l;++s){const u=i[s];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===Ex,a=e.length-1;let o=1;for(let s=1;s0){e[o]=e[a];for(let s=a*n,l=o*n,u=0;u!==n;++u)t[l+u]=t[s+u];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}Qo.prototype.TimeBufferType=Float32Array;Qo.prototype.ValueBufferType=Float32Array;Qo.prototype.DefaultInterpolation=Gf;class cd extends Qo{}cd.prototype.ValueTypeName="bool";cd.prototype.ValueBufferType=Array;cd.prototype.DefaultInterpolation=bv;cd.prototype.InterpolantFactoryMethodLinear=void 0;cd.prototype.InterpolantFactoryMethodSmooth=void 0;class $z extends Qo{}$z.prototype.ValueTypeName="color";class $f extends Qo{}$f.prototype.ValueTypeName="number";class QQ extends gg{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const a=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=(n-t)/(i-t);let u=e*s;for(let c=u+s;u!==c;u+=4)ao.slerpFlat(a,0,o,u-s,o,u,l);return a}}class Fc extends Qo{InterpolantFactoryMethodLinear(e){return new QQ(this.times,this.values,this.getValueSize(),e)}}Fc.prototype.ValueTypeName="quaternion";Fc.prototype.DefaultInterpolation=Gf;Fc.prototype.InterpolantFactoryMethodSmooth=void 0;class hd extends Qo{}hd.prototype.ValueTypeName="string";hd.prototype.ValueBufferType=Array;hd.prototype.DefaultInterpolation=bv;hd.prototype.InterpolantFactoryMethodLinear=void 0;hd.prototype.InterpolantFactoryMethodSmooth=void 0;class Xf extends Qo{}Xf.prototype.ValueTypeName="vector";class JQ{constructor(e,t=-1,n,i=LX){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Ra(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,s=n.length;o!==s;++o)t.push(tJ(n[o]).scale(i));const a=new this(e.name,e.duration,t,e.blendMode);return a.uuid=e.uuid,a}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let a=0,o=n.length;a!==o;++a)t.push(Qo.toJSON(n[a]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const a=t.length,o=[];for(let s=0;s1){const h=c[1];let f=i[h];f||(i[h]=f=[]),f.push(u)}}const o=[];for(const s in i)o.push(this.CreateFromMorphTargetSequence(s,i[s],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(h,f,d,p,g){if(d.length!==0){const v=[],m=[];Wz(d,v,m,p),v.length!==0&&g.push(new h(f,v,m))}},i=[],a=e.name||"default",o=e.fps||30,s=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let h=0;h{t&&t(a),this.manager.itemEnd(e)},0),a;if(ss[e]!==void 0){ss[e].push({onLoad:t,onProgress:n,onError:i});return}ss[e]=[],ss[e].push({onLoad:t,onProgress:n,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,l=this.responseType;fetch(o).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream=="undefined"||u.body===void 0||u.body.getReader===void 0)return u;const c=ss[e],h=u.body.getReader(),f=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),d=f?parseInt(f):0,p=d!==0;let g=0;const v=new ReadableStream({start(m){y();function y(){h.read().then(({done:_,value:x})=>{if(_)m.close();else{g+=x.byteLength;const S=new ProgressEvent("progress",{lengthComputable:p,loaded:g,total:d});for(let A=0,w=c.length;A{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(c=>new DOMParser().parseFromString(c,s));case"json":return u.json();default:if(s===void 0)return u.text();{const h=/charset="?([^;"\s]*)"?/i.exec(s),f=h&&h[1]?h[1].toLowerCase():void 0,d=new TextDecoder(f);return u.arrayBuffer().then(p=>d.decode(p))}}}).then(u=>{Sl.add(e,u);const c=ss[e];delete ss[e];for(let h=0,f=c.length;h{const c=ss[e];if(c===void 0)throw this.manager.itemError(e),u;delete ss[e];for(let h=0,f=c.length;h{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class iJ extends iu{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,o=Sl.get(e);if(o!==void 0)return a.manager.itemStart(e),setTimeout(function(){t&&t(o),a.manager.itemEnd(e)},0),o;const s=Tv("img");function l(){c(),Sl.add(e,this),t&&t(this),a.manager.itemEnd(e)}function u(h){c(),i&&i(h),a.manager.itemError(e),a.manager.itemEnd(e)}function c(){s.removeEventListener("load",l,!1),s.removeEventListener("error",u,!1)}return s.addEventListener("load",l,!1),s.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(s.crossOrigin=this.crossOrigin),a.manager.itemStart(e),s.src=e,s}}class AC extends iu{constructor(e){super(e)}load(e,t,n,i){const a=new mr,o=new iJ(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(s){a.image=s,a.needsUpdate=!0,t!==void 0&&t(a)},n,i),a}}class i1 extends bn{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new nt(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}const aS=new Mt,ER=new X,LR=new X;class wC{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Me(512,512),this.map=null,this.mapPass=null,this.matrix=new Mt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new cC,this._frameExtents=new Me(1,1),this._viewportCount=1,this._viewports=[new an(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;ER.setFromMatrixPosition(e.matrixWorld),t.position.copy(ER),LR.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(LR),t.updateMatrixWorld(),aS.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(aS),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(aS)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class aJ extends wC{constructor(){super(new Qr(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=Hf*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,a=e.distance||t.far;(n!==t.fov||i!==t.aspect||a!==t.far)&&(t.fov=n,t.aspect=i,t.far=a,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class oJ extends i1{constructor(e,t,n=0,i=Math.PI/3,a=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(bn.DEFAULT_UP),this.updateMatrix(),this.target=new bn,this.distance=n,this.angle=i,this.penumbra=a,this.decay=o,this.map=null,this.shadow=new aJ}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const PR=new Mt,Gd=new X,oS=new X;class sJ extends wC{constructor(){super(new Qr(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Me(4,2),this._viewportCount=6,this._viewports=[new an(2,1,1,1),new an(0,1,1,1),new an(3,1,1,1),new an(1,1,1,1),new an(3,0,1,1),new an(1,0,1,1)],this._cubeDirections=[new X(1,0,0),new X(-1,0,0),new X(0,0,1),new X(0,0,-1),new X(0,1,0),new X(0,-1,0)],this._cubeUps=[new X(0,1,0),new X(0,1,0),new X(0,1,0),new X(0,1,0),new X(0,0,1),new X(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,a=e.distance||n.far;a!==n.far&&(n.far=a,n.updateProjectionMatrix()),Gd.setFromMatrixPosition(e.matrixWorld),n.position.copy(Gd),oS.copy(n.position),oS.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(oS),n.updateMatrixWorld(),i.makeTranslation(-Gd.x,-Gd.y,-Gd.z),PR.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(PR)}}class Yz extends i1{constructor(e,t,n=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new sJ}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class lJ extends wC{constructor(){super(new e1(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class B0 extends i1{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(bn.DEFAULT_UP),this.updateMatrix(),this.target=new bn,this.shadow=new lJ}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class qz extends i1{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class Kp{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n{t&&t(u),a.manager.itemEnd(e)}).catch(u=>{i&&i(u)});return}return setTimeout(function(){t&&t(o),a.manager.itemEnd(e)},0),o}const s={};s.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",s.headers=this.requestHeader;const l=fetch(e,s).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(a.options,{colorSpaceConversion:"none"}))}).then(function(u){return Sl.add(e,u),t&&t(u),a.manager.itemEnd(e),u}).catch(function(u){i&&i(u),Sl.remove(e),a.manager.itemError(e),a.manager.itemEnd(e)});Sl.add(e,l),a.manager.itemStart(e)}}class hJ{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=RR(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=RR();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function RR(){return(typeof performance=="undefined"?Date:performance).now()}const bC="\\[\\]\\.:\\/",fJ=new RegExp("["+bC+"]","g"),TC="[^"+bC+"]",dJ="[^"+bC.replace("\\.","")+"]",pJ=/((?:WC+[\/:])*)/.source.replace("WC",TC),vJ=/(WCOD+)?/.source.replace("WCOD",dJ),gJ=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",TC),mJ=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",TC),yJ=new RegExp("^"+pJ+vJ+gJ+mJ+"$"),_J=["material","materials","bones","map"];class xJ{constructor(e,t,n){const i=n||hn.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,a=n.length;i!==a;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class hn{constructor(e,t,n){this.path=t,this.parsedPath=n||hn.parseTrackName(t),this.node=hn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new hn.Composite(e,t,n):new hn(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(fJ,"")}static parseTrackName(e){const t=yJ.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const a=n.nodeName.substring(i+1);_J.indexOf(a)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=a)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(a){for(let o=0;ot}}class a1{constructor(){this.events=new Map}on(e,t){let n=this.events.get(e);n||(n=new Set,this.events.set(e,n)),n.add(t)}off(e,t){const n=this.events.get(e);n&&(t?n.delete(t):this.events.delete(e))}emit(e,...t){const n=this.events.get(e);n&&n.forEach(i=>{i(...t)})}once(e,t){const n=(...i)=>{t(...i),this.off(e,n)};this.on(e,n)}}class TJ extends a1{constructor({canvas:e}){super(),this.canvas=e,this.pixelRatio=2,this.init(),window.addEventListener("resize",()=>{this.init(),this.emit("resize")})}init(){var t;const e=((t=this.canvas)==null?void 0:t.parentNode)||this.canvas||document.documentElement;this.width=e.offsetWidth||window.innerWidth||1,this.height=e.offsetHeight||window.innerHeight||1,this.pixelRatio=this.pixelRatio||Math.min(window.devicePixelRatio,2)}destroy(){this.off("resize")}}class MJ extends a1{constructor(){super(),this.start=Date.now(),this.current=this.start,this.elapsed=0,this.delta=16,this.clock=new hJ,this.raf=bJ(()=>this.tick()),this.raf.start()}tick(){const e=Date.now();this.delta=e-this.current,this.current=e,this.elapsed=this.current-this.start;const t=this.clock.getDelta(),n=this.clock.getElapsedTime();this.emit("tick",t,n)}destroy(){this.pause(),this.off("tick")}pause(){this.raf.pause()}resume(){this.raf.resume()}isActive(){this.raf.isActive()}}function Kz(r,e=!1){const t=r[0].index!==null,n=new Set(Object.keys(r[0].attributes)),i=new Set(Object.keys(r[0].morphAttributes)),a={},o={},s=r[0].morphTargetsRelative,l=new wn;let u=0;for(let c=0;c=2.0 are supported."));return}const u=new aee(a,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c=0&&s[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}u.setExtensions(o),u.setPlugins(s),u.parse(n,i)}parseAsync(e,t){const n=this;return new Promise(function(i,a){n.parse(e,t,i,a)})}}function EJ(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}const Yt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class LJ{constructor(e){this.parser=e,this.name=Yt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,a.source,o)}}class GJ{constructor(e){this.parser=e,this.name=Yt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,a=i.textures[e];if(!a.extensions||!a.extensions[t])return null;const o=a.extensions[t],s=i.images[o.source];let l=n.textureLoader;if(s.uri){const u=n.options.manager.getHandler(s.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return n.loadTextureImage(e,o.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class HJ{constructor(e){this.parser=e,this.name=Yt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,a=i.textures[e];if(!a.extensions||!a.extensions[t])return null;const o=a.extensions[t],s=i.images[o.source];let l=n.textureLoader;if(s.uri){const u=n.options.manager.getHandler(s.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return n.loadTextureImage(e,o.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class WJ{constructor(e){this.name=Yt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const i=n.extensions[this.name],a=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return a.then(function(s){const l=i.byteOffset||0,u=i.byteLength||0,c=i.count,h=i.byteStride,f=new Uint8Array(s,l,u);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(c,h,f,i.mode,i.filter).then(function(d){return d.buffer}):o.ready.then(function(){const d=new ArrayBuffer(c*h);return o.decodeGltfBuffer(new Uint8Array(d),c,h,f,i.mode,i.filter),d})})}else return null}}class $J{constructor(e){this.name=Yt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const i=t.meshes[n.mesh];for(const u of i.primitives)if(u.mode!==ga.TRIANGLES&&u.mode!==ga.TRIANGLE_STRIP&&u.mode!==ga.TRIANGLE_FAN&&u.mode!==void 0)return null;const o=n.extensions[this.name].attributes,s=[],l={};for(const u in o)s.push(this.parser.getDependency("accessor",o[u]).then(c=>(l[u]=c,l[u])));return s.length<1?null:(s.push(this.parser.createNodeMesh(e)),Promise.all(s).then(u=>{const c=u.pop(),h=c.isGroup?c.children:[c],f=u[0].count,d=[];for(const p of h){const g=new Mt,v=new X,m=new ao,y=new X(1,1,1),_=new pQ(p.geometry,p.material,f);for(let x=0;x0||r.search(/^data\:image\/jpeg/)===0?"image/jpeg":r.search(/\.webp($|\?)/i)>0||r.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const iee=new Mt;class aee{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new EJ,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,i=!1,a=-1;typeof navigator!="undefined"&&(n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,i=navigator.userAgent.indexOf("Firefox")>-1,a=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap=="undefined"||n||i&&a<98?this.textureLoader=new AC(this.options.manager):this.textureLoader=new cJ(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Rv(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,i=this.json,a=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(o){const s={scene:o[0][i.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:i.asset,parser:n,userData:{}};return mu(a,s,i),hl(s,i),Promise.all(n._invokeAll(function(l){return l.afterRoot&&l.afterRoot(s)})).then(function(){e(s)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let i=0,a=t.length;i{const l=this.associations.get(o);l!=null&&this.associations.set(s,l);for(const[u,c]of o.children.entries())a(c,s.children[u])};return a(n,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n=2&&v.setY(C,A[w*l+1]),l>=3&&v.setZ(C,A[w*l+2]),l>=4&&v.setW(C,A[w*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){const t=this.json,n=this.options,a=t.textures[e].source,o=t.images[a];let s=this.textureLoader;if(o.uri){const l=n.manager.getHandler(o.uri);l!==null&&(s=l)}return this.loadTextureImage(e,a,s)}loadTextureImage(e,t,n){const i=this,a=this.json,o=a.textures[e],s=a.images[t],l=(s.uri||s.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(t,n).then(function(c){c.flipY=!1,c.name=o.name||s.name||"",c.name===""&&typeof s.uri=="string"&&s.uri.startsWith("data:image/")===!1&&(c.name=s.uri);const f=(a.samplers||{})[o.sampler]||{};return c.magFilter=BR[f.magFilter]||lr,c.minFilter=BR[f.minFilter]||gs,c.wrapS=zR[f.wrapS]||jr,c.wrapT=zR[f.wrapT]||jr,i.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,t){const n=this,i=this.json,a=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());const o=i.images[e],s=self.URL||self.webkitURL;let l=o.uri||"",u=!1;if(o.bufferView!==void 0)l=n.getDependency("bufferView",o.bufferView).then(function(h){u=!0;const f=new Blob([h],{type:o.mimeType});return l=s.createObjectURL(f),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(l).then(function(h){return new Promise(function(f,d){let p=f;t.isImageBitmapLoader===!0&&(p=function(g){const v=new mr(g);v.needsUpdate=!0,f(v)}),t.load(Kp.resolveURL(h,a.path),p,void 0,d)})}).then(function(h){return u===!0&&s.revokeObjectURL(l),h.userData.mimeType=o.mimeType||ree(o.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),h});return this.sourceCache[e]=c,c}assignTexture(e,t,n,i){const a=this;return this.getDependency("texture",n.index).then(function(o){if(!o)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(o=o.clone(),o.channel=n.texCoord),a.extensions[Yt.KHR_TEXTURE_TRANSFORM]){const s=n.extensions!==void 0?n.extensions[Yt.KHR_TEXTURE_TRANSFORM]:void 0;if(s){const l=a.associations.get(o);o=a.extensions[Yt.KHR_TEXTURE_TRANSFORM].extendTexture(o,s),a.associations.set(o,l)}}return i!==void 0&&(o.colorSpace=i),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=t.attributes.tangent===void 0,a=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const s="PointsMaterial:"+n.uuid;let l=this.cache.get(s);l||(l=new pg,Da.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,l.sizeAttenuation=!1,this.cache.add(s,l)),n=l}else if(e.isLine){const s="LineBasicMaterial:"+n.uuid;let l=this.cache.get(s);l||(l=new ys,Da.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,this.cache.add(s,l)),n=l}if(i||a||o){let s="ClonedMaterial:"+n.uuid+":";i&&(s+="derivative-tangents:"),a&&(s+="vertex-colors:"),o&&(s+="flat-shading:");let l=this.cache.get(s);l||(l=n.clone(),a&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(s,l),this.associations.set(l,this.associations.get(n))),n=l}e.material=n}getMaterialType(){return Pv}loadMaterial(e){const t=this,n=this.json,i=this.extensions,a=n.materials[e];let o;const s={},l=a.extensions||{},u=[];if(l[Yt.KHR_MATERIALS_UNLIT]){const h=i[Yt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),u.push(h.extendParams(s,a,t))}else{const h=a.pbrMetallicRoughness||{};if(s.color=new nt(1,1,1),s.opacity=1,Array.isArray(h.baseColorFactor)){const f=h.baseColorFactor;s.color.setRGB(f[0],f[1],f[2],yr),s.opacity=f[3]}h.baseColorTexture!==void 0&&u.push(t.assignTexture(s,"map",h.baseColorTexture,dn)),s.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,s.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(s,"metalnessMap",h.metallicRoughnessTexture)),u.push(t.assignTexture(s,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(e,s)})))}a.doubleSided===!0&&(s.side=ur);const c=a.alphaMode||lS.OPAQUE;if(c===lS.BLEND?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,c===lS.MASK&&(s.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&o!==Pn&&(u.push(t.assignTexture(s,"normalMap",a.normalTexture)),s.normalScale=new Me(1,1),a.normalTexture.scale!==void 0)){const h=a.normalTexture.scale;s.normalScale.set(h,h)}if(a.occlusionTexture!==void 0&&o!==Pn&&(u.push(t.assignTexture(s,"aoMap",a.occlusionTexture)),a.occlusionTexture.strength!==void 0&&(s.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&o!==Pn){const h=a.emissiveFactor;s.emissive=new nt().setRGB(h[0],h[1],h[2],yr)}return a.emissiveTexture!==void 0&&o!==Pn&&u.push(t.assignTexture(s,"emissiveMap",a.emissiveTexture,dn)),Promise.all(u).then(function(){const h=new o(s);return a.name&&(h.name=a.name),hl(h,a),t.associations.set(h,{materials:e}),a.extensions&&mu(i,h,a),h})}createUniqueName(e){const t=hn.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function a(s){return n[Yt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(s,t).then(function(l){return UR(l,s,t)})}const o=[];for(let s=0,l=e.length;s0&&tee(m,a),m.name=t.createUniqueName(a.name||"mesh_"+e),hl(m,a),v.extensions&&mu(i,m,v),t.assignFinalMaterial(m),h.push(m)}for(let d=0,p=h.length;d1?c=new Dn:u.length===1?c=u[0]:c=new bn,c!==u[0])for(let h=0,f=u.length;h{const h=new Map;for(const[f,d]of i.associations)(f instanceof Da||f instanceof mr)&&h.set(f,d);return c.traverse(f=>{const d=i.associations.get(f);d!=null&&h.set(f,d)}),h};return i.associations=u(a),a})}_createAnimationTracks(e,t,n,i,a){const o=[],s=e.name?e.name:e.uuid,l=[];qs[a.path]===qs.weights?e.traverse(function(f){f.morphTargetInfluences&&l.push(f.name?f.name:f.uuid)}):l.push(s);let u;switch(qs[a.path]){case qs.weights:u=$f;break;case qs.rotation:u=Fc;break;case qs.position:case qs.scale:u=Xf;break;default:switch(n.itemSize){case 1:u=$f;break;case 2:case 3:default:u=Xf;break}break}const c=i.interpolation!==void 0?QJ[i.interpolation]:Gf,h=this._getArrayFromAccessor(n);for(let f=0,d=l.length;f{this.parse(o,t,i)},n,i)}parse(e,t,n=()=>{}){this.decodeDracoFile(e,t,null,null,dn).catch(n)}decodeDracoFile(e,t,n,i,a=yr,o=()=>{}){const s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:a};return this.decodeGeometry(e,s).then(t).catch(o)}decodeGeometry(e,t){const n=JSON.stringify(t);if(cS.has(e)){const l=cS.get(e);if(l.key===n)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i;const a=this.workerNextTaskID++,o=e.byteLength,s=this._getWorker(a,o).then(l=>(i=l,new Promise((u,c)=>{i._callbacks[a]={resolve:u,reject:c},i.postMessage({type:"decode",id:a,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return s.catch(()=>!0).then(()=>{i&&a&&this._releaseTask(i,a)}),cS.set(e,{key:n,promise:s}),s}_createGeometry(e){const t=new wn;e.index&&t.setIndex(new Gn(e.index.array,1));for(let n=0;n{n.load(e,i,void 0,a)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{const i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);const a=lee.toString(),o=["/* draco decoder */",i,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join(` `);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengtha._taskLoad?-1:1});const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{const h=c.draco,f=new h.Decoder;try{const d=t(h,f,new Int8Array(l),u),p=d.attributes.map(g=>g.array.buffer);d.index&&p.push(d.index.array.buffer),self.postMessage({type:"decode",id:s.id,geometry:d},p)}catch(d){console.error(d),self.postMessage({type:"error",id:s.id,error:d.message})}finally{h.destroy(f)}});break}};function t(o,s,l,u){const c=u.attributeIDs,h=u.attributeTypes;let f,d;const p=s.GetEncodedGeometryType(l);if(p===o.TRIANGULAR_MESH)f=new o.Mesh,d=s.DecodeArrayToMesh(l,l.byteLength,f);else if(p===o.POINT_CLOUD)f=new o.PointCloud,d=s.DecodeArrayToPointCloud(l,l.byteLength,f);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!d.ok()||f.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+d.error_msg());const g={index:null,attributes:[]};for(const v in c){const m=self[h[v]];let y,_;if(u.useUniqueIDs)_=c[v],y=s.GetAttributeByUniqueId(f,_);else{if(_=s.GetAttributeId(f,o[c[v]]),_===-1)continue;y=s.GetAttribute(f,_)}const x=i(o,s,f,v,m,y);v==="color"&&(x.vertexColorSpace=u.vertexColorSpace),g.attributes.push(x)}return p===o.TRIANGULAR_MESH&&(g.index=n(o,s,f)),o.destroy(f),g}function n(o,s,l){const c=l.num_faces()*3,h=c*4,f=o._malloc(h);s.GetTrianglesUInt32Array(l,h,f);const d=new Uint32Array(o.HEAPF32.buffer,f,c).slice();return o._free(f),{array:d,itemSize:1}}function i(o,s,l,u,c,h){const f=h.num_components(),p=l.num_points()*f,g=p*c.BYTES_PER_ELEMENT,v=a(o,c),m=o._malloc(g);s.GetAttributeDataArrayForAllPoints(l,h,v,g,m);const y=new c(o.HEAPF32.buffer,m,p).slice();return o._free(m),{name:u,array:y,itemSize:f}}function a(o,s){switch(s){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}let Nb={GLTFLoader:"GLTF",TextureLoader:"Texture",FontLoader:"Font",MMDLoader:"MMD",MTLLoader:"MTL",OBJLoader:"OBJ",PCDLoader:"PCD",FileLoader:"File",ImageLoader:"Image",ObjectLoader:"Object",MaterialLoader:"Material",CubeTextureLoader:"CubeTexture",RGBELoader:"RGBELoader",FBXLoader:"FBX"};const uee=Object.values(Nb);class cee extends a1{constructor({dracoPath:e}={}){super(),this.dracoPath=e||"./draco/gltf/",this.itemsLoaded=0,this.itemsTotal=0,this.assets=[],this.loaders={},this.initDefaultLoader()}initManager(){const e=new Xz;return e.onProgress=(t,n,i)=>{this.itemsLoaded=n,this.itemsTotal=i,this.emit("onProgress",t,n,i)},e.onError=t=>{this.emit("onError",t)},e}initDefaultLoader(){[{loader:CJ,name:"GLTFLoader"},{loader:AC,name:"TextureLoader"}].map(e=>this.addLoader(e.loader,e.name))}initDraco(e){const t=new see;t.setDecoderPath(this.dracoPath),t.preload(),e.setDRACOLoader(t)}addLoader(e,t=""){if(e.name&&Nb[t]){if(!this.loaders[t]){let i=new e(this.manager),a=t;i instanceof iu&&(a==="GLTFLoader"&&this.initDraco(i),this.loaders[Nb[a]]=i)}}else throw new Error("请配置正确的加载器")}loadItem(e){return new Promise((t,n)=>{if(!this.loaders[e.type])throw new Error(`资源${e.path}没有配置加载器`);this.loaders[e.type].load(e.path,i=>{this.itemsLoaded++,this.emit("onProgress",e.path,this.itemsLoaded,this.itemsTotal),t(Xe(Re({},e),{data:i}))},null,i=>{this.emit("onError",i),n(i)})})}loadAll(e){return this.itemsLoaded=0,this.itemsTotal=0,new Promise((t,n)=>{let i=this.matchType(e),a=[];this.itemsTotal=i.length,i.map(o=>{let s=this.loadItem(o);a.push(s)}),Promise.all(a).then(o=>{this.assets=o,this.emit("onLoad"),t(o)}).catch(o=>{this.emit("onError",o),n(o)})})}matchType(e){return this.assets=e.map(t=>({type:uee.includes(t.type)?t.type:"",path:t.path,name:t.name,data:null})).filter(t=>{if(!t.type)throw new Error(`资源${t.path},type不正确`);return t.type}),this.assets}getResource(e){let t=this.assets.find(n=>n.name===e);if(!t)throw new Error(`资源${e}不存在`);return t.data}destroy(){this.off("onProgress"),this.off("onLoad"),this.off("onError"),this.assets=[]}}const Jz=r=>{r instanceof Array?r.forEach(Jz):(r.map&&r.map.dispose(),r.dispose())},eU=r=>{r.geometry&&r.geometry.dispose(),r.material&&Jz(r.material),r.texture&&r.texture.dispose(),r.children&&r.children.forEach(eU)},hee=r=>{if(r&&r.children)for(;r.children.length;){const e=r.children[0];r.remove(e),eU(e)}};var MC={exports:{}},fee=function(e,t,n,i){var a=e[0],o=e[1],s=!1;n===void 0&&(n=0),i===void 0&&(i=t.length);for(var l=(i-n)/2,u=0,c=l-1;uo!=p>o&&a<(d-h)*(o-f)/(p-f)+h;g&&(s=!s)}return s},dee=function(e,t,n,i){var a=e[0],o=e[1],s=!1;n===void 0&&(n=0),i===void 0&&(i=t.length);for(var l=i-n,u=0,c=l-1;uo!=p>o&&a<(d-h)*(o-f)/(p-f)+h;g&&(s=!s)}return s},tU=fee,nU=dee;MC.exports=function(e,t,n,i){return t.length>0&&Array.isArray(t[0])?nU(e,t,n,i):tU(e,t,n,i)};MC.exports.nested=nU;MC.exports.flat=tU;function pee(r=10,e=62){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[],i;if(e=e||t.length,r)for(i=0;i{console.log(r);let e=JSON.parse(r),t=e.features;for(let n=0;nMath.PI&&($t-=q),mn<-Math.PI?mn+=q:mn>Math.PI&&(mn-=q),$t<=mn?s.theta=Math.max($t,Math.min(mn,s.theta)):s.theta=s.theta>($t+mn)/2?Math.max($t,s.theta):Math.min(mn,s.theta)),s.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,s.phi)),s.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(c,n.dampingFactor):n.target.add(c),n.target.sub(n.cursor),n.target.clampLength(n.minTargetRadius,n.maxTargetRadius),n.target.add(n.cursor),n.zoomToCursor&&A||n.object.isOrthographicCamera?s.radius=O(s.radius):s.radius=O(s.radius*u),j.setFromSpherical(s),j.applyQuaternion(Ue),Jt.copy(n.target).add(j),n.object.lookAt(n.target),n.enableDamping===!0?(l.theta*=1-n.dampingFactor,l.phi*=1-n.dampingFactor,c.multiplyScalar(1-n.dampingFactor)):(l.set(0,0,0),c.set(0,0,0));let Lr=!1;if(n.zoomToCursor&&A){let en=null;if(n.object.isPerspectiveCamera){const jn=j.length();en=O(jn*u);const oi=jn-en;n.object.position.addScaledVector(x,oi),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){const jn=new X(S.x,S.y,0);jn.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/u)),n.object.updateProjectionMatrix(),Lr=!0;const oi=new X(S.x,S.y,0);oi.unproject(n.object),n.object.position.sub(oi).add(jn),n.object.updateMatrixWorld(),en=j.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;en!==null&&(this.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(en).add(n.object.position):(Tm.origin.copy(n.object.position),Tm.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(Tm.direction))o||8*(1-Y.dot(n.object.quaternion))>o||De.distanceToSquared(n.target)>0?(n.dispatchEvent(VR),et.copy(n.object.position),Y.copy(n.object.quaternion),De.copy(n.target),!0):!1}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",Wt),n.domElement.removeEventListener("pointerdown",B),n.domElement.removeEventListener("pointercancel",ne),n.domElement.removeEventListener("wheel",we),n.domElement.removeEventListener("pointermove",z),n.domElement.removeEventListener("pointerup",ne),n._domElementKeyEvents!==null&&(n._domElementKeyEvents.removeEventListener("keydown",Ye),n._domElementKeyEvents=null)};const n=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let a=i.NONE;const o=1e-6,s=new IR,l=new IR;let u=1;const c=new X,h=new Me,f=new Me,d=new Me,p=new Me,g=new Me,v=new Me,m=new Me,y=new Me,_=new Me,x=new X,S=new Me;let A=!1;const w=[],M={};let C=!1;function b(j){return j!==null?2*Math.PI/60*n.autoRotateSpeed*j:2*Math.PI/60/60*n.autoRotateSpeed}function T(j){const Ee=Math.abs(j*.01);return Math.pow(.95,n.zoomSpeed*Ee)}function P(j){l.theta-=j}function D(j){l.phi-=j}const L=function(){const j=new X;return function(Ue,et){j.setFromMatrixColumn(et,0),j.multiplyScalar(-Ue),c.add(j)}}(),E=function(){const j=new X;return function(Ue,et){n.screenSpacePanning===!0?j.setFromMatrixColumn(et,1):(j.setFromMatrixColumn(et,0),j.crossVectors(n.object.up,j)),j.multiplyScalar(Ue),c.add(j)}}(),I=function(){const j=new X;return function(Ue,et){const Y=n.domElement;if(n.object.isPerspectiveCamera){const De=n.object.position;j.copy(De).sub(n.target);let q=j.length();q*=Math.tan(n.object.fov/2*Math.PI/180),L(2*Ue*q/Y.clientHeight,n.object.matrix),E(2*et*q/Y.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(L(Ue*(n.object.right-n.object.left)/n.object.zoom/Y.clientWidth,n.object.matrix),E(et*(n.object.top-n.object.bottom)/n.object.zoom/Y.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function N(j){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u/=j:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function R(j){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u*=j:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function F(j,Ee){if(!n.zoomToCursor)return;A=!0;const Ue=n.domElement.getBoundingClientRect(),et=j-Ue.left,Y=Ee-Ue.top,De=Ue.width,q=Ue.height;S.x=et/De*2-1,S.y=-(Y/q)*2+1,x.set(S.x,S.y,1).unproject(n.object).sub(n.object.position).normalize()}function O(j){return Math.max(n.minDistance,Math.min(n.maxDistance,j))}function V(j){h.set(j.clientX,j.clientY)}function H(j){F(j.clientX,j.clientX),m.set(j.clientX,j.clientY)}function Q(j){p.set(j.clientX,j.clientY)}function W(j){f.set(j.clientX,j.clientY),d.subVectors(f,h).multiplyScalar(n.rotateSpeed);const Ee=n.domElement;P(2*Math.PI*d.x/Ee.clientHeight),D(2*Math.PI*d.y/Ee.clientHeight),h.copy(f),n.update()}function Z(j){y.set(j.clientX,j.clientY),_.subVectors(y,m),_.y>0?N(T(_.y)):_.y<0&&R(T(_.y)),m.copy(y),n.update()}function ee(j){g.set(j.clientX,j.clientY),v.subVectors(g,p).multiplyScalar(n.panSpeed),I(v.x,v.y),p.copy(g),n.update()}function he(j){F(j.clientX,j.clientY),j.deltaY<0?R(T(j.deltaY)):j.deltaY>0&&N(T(j.deltaY)),n.update()}function le(j){let Ee=!1;switch(j.code){case n.keys.UP:j.ctrlKey||j.metaKey||j.shiftKey?D(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):I(0,n.keyPanSpeed),Ee=!0;break;case n.keys.BOTTOM:j.ctrlKey||j.metaKey||j.shiftKey?D(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):I(0,-n.keyPanSpeed),Ee=!0;break;case n.keys.LEFT:j.ctrlKey||j.metaKey||j.shiftKey?P(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):I(n.keyPanSpeed,0),Ee=!0;break;case n.keys.RIGHT:j.ctrlKey||j.metaKey||j.shiftKey?P(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):I(-n.keyPanSpeed,0),Ee=!0;break}Ee&&(j.preventDefault(),n.update())}function re(j){if(w.length===1)h.set(j.pageX,j.pageY);else{const Ee=ue(j),Ue=.5*(j.pageX+Ee.x),et=.5*(j.pageY+Ee.y);h.set(Ue,et)}}function be(j){if(w.length===1)p.set(j.pageX,j.pageY);else{const Ee=ue(j),Ue=.5*(j.pageX+Ee.x),et=.5*(j.pageY+Ee.y);p.set(Ue,et)}}function de(j){const Ee=ue(j),Ue=j.pageX-Ee.x,et=j.pageY-Ee.y,Y=Math.sqrt(Ue*Ue+et*et);m.set(0,Y)}function U(j){n.enableZoom&&de(j),n.enablePan&&be(j)}function K(j){n.enableZoom&&de(j),n.enableRotate&&re(j)}function te(j){if(w.length==1)f.set(j.pageX,j.pageY);else{const Ue=ue(j),et=.5*(j.pageX+Ue.x),Y=.5*(j.pageY+Ue.y);f.set(et,Y)}d.subVectors(f,h).multiplyScalar(n.rotateSpeed);const Ee=n.domElement;P(2*Math.PI*d.x/Ee.clientHeight),D(2*Math.PI*d.y/Ee.clientHeight),h.copy(f)}function ce(j){if(w.length===1)g.set(j.pageX,j.pageY);else{const Ee=ue(j),Ue=.5*(j.pageX+Ee.x),et=.5*(j.pageY+Ee.y);g.set(Ue,et)}v.subVectors(g,p).multiplyScalar(n.panSpeed),I(v.x,v.y),p.copy(g)}function se(j){const Ee=ue(j),Ue=j.pageX-Ee.x,et=j.pageY-Ee.y,Y=Math.sqrt(Ue*Ue+et*et);y.set(0,Y),_.set(0,Math.pow(y.y/m.y,n.zoomSpeed)),N(_.y),m.copy(y);const De=(j.pageX+Ee.x)*.5,q=(j.pageY+Ee.y)*.5;F(De,q)}function Ne(j){n.enableZoom&&se(j),n.enablePan&&ce(j)}function Oe(j){n.enableZoom&&se(j),n.enableRotate&&te(j)}function B(j){n.enabled!==!1&&(w.length===0&&(n.domElement.setPointerCapture(j.pointerId),n.domElement.addEventListener("pointermove",z),n.domElement.addEventListener("pointerup",ne)),Ct(j),j.pointerType==="touch"?xt(j):ve(j))}function z(j){n.enabled!==!1&&(j.pointerType==="touch"?Le(j):Ae(j))}function ne(j){switch(_t(j),w.length){case 0:n.domElement.releasePointerCapture(j.pointerId),n.domElement.removeEventListener("pointermove",z),n.domElement.removeEventListener("pointerup",ne),n.dispatchEvent(GR),a=i.NONE;break;case 1:const Ee=w[0],Ue=M[Ee];xt({pointerId:Ee,pageX:Ue.x,pageY:Ue.y});break}}function ve(j){let Ee;switch(j.button){case 0:Ee=n.mouseButtons.LEFT;break;case 1:Ee=n.mouseButtons.MIDDLE;break;case 2:Ee=n.mouseButtons.RIGHT;break;default:Ee=-1}switch(Ee){case oh.DOLLY:if(n.enableZoom===!1)return;H(j),a=i.DOLLY;break;case oh.ROTATE:if(j.ctrlKey||j.metaKey||j.shiftKey){if(n.enablePan===!1)return;Q(j),a=i.PAN}else{if(n.enableRotate===!1)return;V(j),a=i.ROTATE}break;case oh.PAN:if(j.ctrlKey||j.metaKey||j.shiftKey){if(n.enableRotate===!1)return;V(j),a=i.ROTATE}else{if(n.enablePan===!1)return;Q(j),a=i.PAN}break;default:a=i.NONE}a!==i.NONE&&n.dispatchEvent(hS)}function Ae(j){switch(a){case i.ROTATE:if(n.enableRotate===!1)return;W(j);break;case i.DOLLY:if(n.enableZoom===!1)return;Z(j);break;case i.PAN:if(n.enablePan===!1)return;ee(j);break}}function we(j){n.enabled===!1||n.enableZoom===!1||a!==i.NONE||(j.preventDefault(),n.dispatchEvent(hS),he(We(j)),n.dispatchEvent(GR))}function We(j){const Ee=j.deltaMode,Ue={clientX:j.clientX,clientY:j.clientY,deltaY:j.deltaY};switch(Ee){case 1:Ue.deltaY*=16;break;case 2:Ue.deltaY*=100;break}return j.ctrlKey&&!C&&(Ue.deltaY*=10),Ue}function Be(j){j.key==="Control"&&(C=!0,n.domElement.getRootNode().addEventListener("keyup",je,{passive:!0,capture:!0}))}function je(j){j.key==="Control"&&(C=!1,n.domElement.getRootNode().removeEventListener("keyup",je,{passive:!0,capture:!0}))}function Ye(j){n.enabled===!1||n.enablePan===!1||le(j)}function xt(j){switch(J(j),w.length){case 1:switch(n.touches.ONE){case sh.ROTATE:if(n.enableRotate===!1)return;re(j),a=i.TOUCH_ROTATE;break;case sh.PAN:if(n.enablePan===!1)return;be(j),a=i.TOUCH_PAN;break;default:a=i.NONE}break;case 2:switch(n.touches.TWO){case sh.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;U(j),a=i.TOUCH_DOLLY_PAN;break;case sh.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;K(j),a=i.TOUCH_DOLLY_ROTATE;break;default:a=i.NONE}break;default:a=i.NONE}a!==i.NONE&&n.dispatchEvent(hS)}function Le(j){switch(J(j),a){case i.TOUCH_ROTATE:if(n.enableRotate===!1)return;te(j),n.update();break;case i.TOUCH_PAN:if(n.enablePan===!1)return;ce(j),n.update();break;case i.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Ne(j),n.update();break;case i.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;Oe(j),n.update();break;default:a=i.NONE}}function Wt(j){n.enabled!==!1&&j.preventDefault()}function Ct(j){w.push(j.pointerId)}function _t(j){delete M[j.pointerId];for(let Ee=0;Ee0){for(o=e[--t];t>0&&(n=o,i=e[--t],o=n+i,a=i-(o-n),!a););t>0&&(a<0&&e[t-1]<0||a>0&&e[t-1]>0)&&(i=a*2,n=o+i,i==n-o&&(o=n))}return o}}function*_ee(r){for(const e of r)yield*lL(e)}function iU(r){return Array.from(_ee(r))}var Cn=1e-6,xee=1e-12,Qt=Math.PI,Mi=Qt/2,WR=Qt/4,Na=Qt*2,$i=180/Qt,or=Qt/180,Yn=Math.abs,aU=Math.atan,Dv=Math.atan2,er=Math.cos,See=Math.exp,Aee=Math.log,tr=Math.sin,wee=Math.sign||function(r){return r>0?1:r<0?-1:0},o1=Math.sqrt,bee=Math.tan;function Tee(r){return r>1?0:r<-1?Qt:Math.acos(r)}function Iv(r){return r>1?Mi:r<-1?-Mi:Math.asin(r)}function Mp(){}function z0(r,e){r&&XR.hasOwnProperty(r.type)&&XR[r.type](r,e)}var $R={Feature:function(r,e){z0(r.geometry,e)},FeatureCollection:function(r,e){for(var t=r.features,n=-1,i=t.length;++nQt&&(r-=Math.round(r/Na)*Na),[r,e]}zb.invert=zb;function oU(r,e,t){return(r%=Na)?e||t?Bb(jR(r),KR(e,t)):jR(r):e||t?KR(e,t):zb}function qR(r){return function(e,t){return e+=r,Yn(e)>Qt&&(e-=Math.round(e/Na)*Na),[e,t]}}function jR(r){var e=qR(r);return e.invert=qR(-r),e}function KR(r,e){var t=er(r),n=tr(r),i=er(e),a=tr(e);function o(s,l){var u=er(l),c=er(s)*u,h=tr(s)*u,f=tr(l),d=f*t+c*n;return[Dv(h*i-d*a,c*t-f*n),Iv(d*i+h*a)]}return o.invert=function(s,l){var u=er(l),c=er(s)*u,h=tr(s)*u,f=tr(l),d=f*i-h*a;return[Dv(h*i+f*a,c*t+d*n),Iv(d*t-c*n)]},o}function Cee(r){r=oU(r[0]*or,r[1]*or,r.length>2?r[2]*or:0);function e(t){return t=r(t[0]*or,t[1]*or),t[0]*=$i,t[1]*=$i,t}return e.invert=function(t){return t=r.invert(t[0]*or,t[1]*or),t[0]*=$i,t[1]*=$i,t},e}function Eee(r,e,t,n,i,a){if(t){var o=er(e),s=tr(e),l=n*t;i==null?(i=e+n*Na,a=e-l/2):(i=ZR(o,i),a=ZR(o,a),(n>0?ia)&&(i+=n*Na));for(var u,c=i;n>0?c>a:c1&&r.push(r.pop().concat(r.shift()))},result:function(){var t=r;return r=[],e=null,t}}}function Yy(r,e){return Yn(r[0]-e[0])=0;--s)i.point((h=c[s])[0],h[1]);else n(f.x,f.p.x,-1,i);f=f.p}f=f.o,c=f.z,d=!d}while(!f.v);i.lineEnd()}}}function QR(r){if(e=r.length){for(var e,t=0,n=r[0],i;++t=0?1:-1,b=C*M,T=b>Qt,P=v*A;if(l.add(Dv(P*C*tr(b),m*w+P*er(b))),o+=T?M+C*Na:M,T^p>=t^x>=t){var D=U0(Yf(d),Yf(_));Fb(D);var L=U0(a,D);Fb(L);var E=(T^M>=0?-1:1)*Iv(L[2]);(n>E||n===E&&(D[0]||D[1]))&&(s+=T^M>=0?1:-1)}}return(o<-Cn||o0){for(l||(i.polygonStart(),l=!0),i.lineStart(),A=0;A1&&x&2&&S.push(S.pop().concat(S.shift())),c.push(S.filter(Pee))}}return f}}function Pee(r){return r.length>1}function Ree(r,e){return((r=r.x)[0]<0?r[1]-Mi-Cn:Mi-r[1])-((e=e.x)[0]<0?e[1]-Mi-Cn:Mi-e[1])}const JR=uU(function(){return!0},Dee,Nee,[-Qt,-Mi]);function Dee(r){var e=NaN,t=NaN,n=NaN,i;return{lineStart:function(){r.lineStart(),i=1},point:function(a,o){var s=a>0?Qt:-Qt,l=Yn(a-e);Yn(l-Qt)0?Mi:-Mi),r.point(n,t),r.lineEnd(),r.lineStart(),r.point(s,t),r.point(a,t),i=0):n!==s&&l>=Qt&&(Yn(e-n)Cn?aU((tr(e)*(a=er(n))*tr(t)-tr(n)*(i=er(e))*tr(r))/(i*a*o)):(e+n)/2}function Nee(r,e,t,n){var i;if(r==null)i=t*Mi,n.point(-Qt,i),n.point(0,i),n.point(Qt,i),n.point(Qt,0),n.point(Qt,-i),n.point(0,-i),n.point(-Qt,-i),n.point(-Qt,0),n.point(-Qt,i);else if(Yn(r[0]-e[0])>Cn){var a=r[0]0,i=Yn(e)>Cn;function a(c,h,f,d){Eee(d,r,t,f,c,h)}function o(c,h){return er(c)*er(h)>e}function s(c){var h,f,d,p,g;return{lineStart:function(){p=d=!1,g=1},point:function(v,m){var y=[v,m],_,x=o(v,m),S=n?x?0:u(v,m):x?u(v+(v<0?Qt:-Qt),m):0;if(!h&&(p=d=x)&&c.lineStart(),x!==d&&(_=l(h,y),(!_||Yy(h,_)||Yy(y,_))&&(y[2]=1)),x!==d)g=0,x?(c.lineStart(),_=l(y,h),c.point(_[0],_[1])):(_=l(h,y),c.point(_[0],_[1],2),c.lineEnd()),h=_;else if(i&&h&&n^x){var A;!(S&f)&&(A=l(y,h,!0))&&(g=0,n?(c.lineStart(),c.point(A[0][0],A[0][1]),c.point(A[1][0],A[1][1]),c.lineEnd()):(c.point(A[1][0],A[1][1]),c.lineEnd(),c.lineStart(),c.point(A[0][0],A[0][1],3)))}x&&(!h||!Yy(h,y))&&c.point(y[0],y[1]),h=y,d=x,f=S},lineEnd:function(){d&&c.lineEnd(),h=null},clean:function(){return g|(p&&d)<<1}}}function l(c,h,f){var d=Yf(c),p=Yf(h),g=[1,0,0],v=U0(d,p),m=Mm(v,v),y=v[0],_=m-y*y;if(!_)return!f&&c;var x=e*m/_,S=-e*y/_,A=U0(g,v),w=Cm(g,x),M=Cm(v,S);fS(w,M);var C=A,b=Mm(w,C),T=Mm(C,C),P=b*b-T*(Mm(w,w)-1);if(!(P<0)){var D=o1(P),L=Cm(C,(-b-D)/T);if(fS(L,w),L=Ob(L),!f)return L;var E=c[0],I=h[0],N=c[1],R=h[1],F;I0^L[1]<(Yn(L[0]-E)Qt^(E<=L[0]&&L[0]<=I)){var Q=Cm(C,(-b+D)/T);return fS(Q,w),[L,Ob(Q)]}}}function u(c,h){var f=n?r:Qt-r,d=0;return c<-f?d|=1:c>f&&(d|=2),h<-f?d|=4:h>f&&(d|=8),d}return uU(o,s,a,n?[0,-r]:[-Qt,r-Qt])}function Oee(r,e,t,n,i,a){var o=r[0],s=r[1],l=e[0],u=e[1],c=0,h=1,f=l-o,d=u-s,p;if(p=t-o,!(!f&&p>0)){if(p/=f,f<0){if(p0){if(p>h)return;p>c&&(c=p)}if(p=i-o,!(!f&&p<0)){if(p/=f,f<0){if(p>h)return;p>c&&(c=p)}else if(f>0){if(p0)){if(p/=d,d<0){if(p0){if(p>h)return;p>c&&(c=p)}if(p=a-s,!(!d&&p<0)){if(p/=d,d<0){if(p>h)return;p>c&&(c=p)}else if(d>0){if(p0&&(r[0]=o+c*f,r[1]=s+c*d),h<1&&(e[0]=o+h*f,e[1]=s+h*d),!0}}}}}var Cp=1e9,Lm=-Cp;function Fee(r,e,t,n){function i(u,c){return r<=u&&u<=t&&e<=c&&c<=n}function a(u,c,h,f){var d=0,p=0;if(u==null||(d=o(u,h))!==(p=o(c,h))||l(u,c)<0^h>0)do f.point(d===0||d===3?r:t,d>1?n:e);while((d=(d+h+4)%4)!==p);else f.point(c[0],c[1])}function o(u,c){return Yn(u[0]-r)0?0:3:Yn(u[0]-t)0?2:1:Yn(u[1]-e)0?1:0:c>0?3:2}function s(u,c){return l(u.x,c.x)}function l(u,c){var h=o(u,1),f=o(c,1);return h!==f?h-f:h===0?c[1]-u[1]:h===1?u[0]-c[0]:h===2?u[1]-c[1]:c[0]-u[0]}return function(u){var c=u,h=sU(),f,d,p,g,v,m,y,_,x,S,A,w={point:M,lineStart:P,lineEnd:D,polygonStart:b,polygonEnd:T};function M(E,I){i(E,I)&&c.point(E,I)}function C(){for(var E=0,I=0,N=d.length;In&&(W-H)*(n-Q)>(Z-Q)*(r-H)&&++E:Z<=n&&(W-H)*(n-Q)<(Z-Q)*(r-H)&&--E;return E}function b(){c=h,f=[],d=[],A=!0}function T(){var E=C(),I=A&&E,N=(f=iU(f)).length;(I||N)&&(u.polygonStart(),I&&(u.lineStart(),a(null,null,1,u),u.lineEnd()),N&&lU(f,s,E,a,u),u.polygonEnd()),c=u,f=d=p=null}function P(){w.point=L,d&&d.push(p=[]),S=!0,x=!1,y=_=NaN}function D(){f&&(L(g,v),m&&x&&h.rejoin(),f.push(h.result())),w.point=M,x&&c.lineEnd()}function L(E,I){var N=i(E,I);if(d&&p.push([E,I]),S)g=E,v=I,m=N,S=!1,N&&(c.lineStart(),c.point(E,I));else if(N&&x)c.point(E,I);else{var R=[y=Math.max(Lm,Math.min(Cp,y)),_=Math.max(Lm,Math.min(Cp,_))],F=[E=Math.max(Lm,Math.min(Cp,E)),I=Math.max(Lm,Math.min(Cp,I))];Oee(R,F,r,e,t,n)?(x||(c.lineStart(),c.point(R[0],R[1])),c.point(F[0],F[1]),N||c.lineEnd(),A=!1):N&&(c.lineStart(),c.point(E,I),A=!1)}y=E,_=I,x=N}return w}}const eD=r=>r;var qf=1/0,V0=qf,Nv=-qf,G0=Nv,Bee={point:zee,lineStart:Mp,lineEnd:Mp,polygonStart:Mp,polygonEnd:Mp,result:function(){var r=[[qf,V0],[Nv,G0]];return Nv=G0=-(V0=qf=1/0),r}};function zee(r,e){rNv&&(Nv=r),eG0&&(G0=e)}const tD=Bee;function EC(r){return function(e){var t=new Ub;for(var n in r)t[n]=r[n];return t.stream=e,t}}function Ub(){}Ub.prototype={constructor:Ub,point:function(r,e){this.stream.point(r,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function LC(r,e,t){var n=r.clipExtent&&r.clipExtent();return r.scale(150).translate([0,0]),n!=null&&r.clipExtent(null),Mee(t,r.stream(tD)),e(tD.result()),n!=null&&r.clipExtent(n),r}function cU(r,e,t){return LC(r,function(n){var i=e[1][0]-e[0][0],a=e[1][1]-e[0][1],o=Math.min(i/(n[1][0]-n[0][0]),a/(n[1][1]-n[0][1])),s=+e[0][0]+(i-o*(n[1][0]+n[0][0]))/2,l=+e[0][1]+(a-o*(n[1][1]+n[0][1]))/2;r.scale(150*o).translate([s,l])},t)}function Uee(r,e,t){return cU(r,[[0,0],e],t)}function Vee(r,e,t){return LC(r,function(n){var i=+e,a=i/(n[1][0]-n[0][0]),o=(i-a*(n[1][0]+n[0][0]))/2,s=-a*n[0][1];r.scale(150*a).translate([o,s])},t)}function Gee(r,e,t){return LC(r,function(n){var i=+e,a=i/(n[1][1]-n[0][1]),o=-a*n[0][0],s=(i-a*(n[1][1]+n[0][1]))/2;r.scale(150*a).translate([o,s])},t)}var nD=16,Hee=er(30*or);function rD(r,e){return+e?$ee(r,e):Wee(r)}function Wee(r){return EC({point:function(e,t){e=r(e,t),this.stream.point(e[0],e[1])}})}function $ee(r,e){function t(n,i,a,o,s,l,u,c,h,f,d,p,g,v){var m=u-n,y=c-i,_=m*m+y*y;if(_>4*e&&g--){var x=o+f,S=s+d,A=l+p,w=o1(x*x+S*S+A*A),M=Iv(A/=w),C=Yn(Yn(A)-1)e||Yn((m*D+y*L)/_-.5)>.3||o*f+s*d+l*p2?E[2]%360*or:0,D()):[s*$i,l*$i,u*$i]},T.angle=function(E){return arguments.length?(h=E%360*or,D()):h*$i},T.reflectX=function(E){return arguments.length?(f=E?-1:1,D()):f<0},T.reflectY=function(E){return arguments.length?(d=E?-1:1,D()):d<0},T.precision=function(E){return arguments.length?(A=rD(w,S=E*E),L()):o1(S)},T.fitExtent=function(E,I){return cU(T,E,I)},T.fitSize=function(E,I){return Uee(T,E,I)},T.fitWidth=function(E,I){return Vee(T,E,I)},T.fitHeight=function(E,I){return Gee(T,E,I)};function D(){var E=iD(t,0,0,f,d,h).apply(null,e(a,o)),I=iD(t,n-E[0],i-E[1],f,d,h);return c=oU(s,l,u),w=Bb(e,I),M=Bb(c,w),A=rD(w,S),L()}function L(){return C=b=null,T}return function(){return e=r.apply(this,arguments),T.invert=e.invert&&P,D()}}function PC(r,e){return[r,Aee(bee((Mi+e)/2))]}PC.invert=function(r,e){return[r,2*aU(See(e))-Mi]};function Ac(){return Zee(PC).scale(961/Na)}function Zee(r){var e=jee(r),t=e.center,n=e.scale,i=e.translate,a=e.clipExtent,o=null,s,l,u;e.scale=function(h){return arguments.length?(n(h),c()):n()},e.translate=function(h){return arguments.length?(i(h),c()):i()},e.center=function(h){return arguments.length?(t(h),c()):t()},e.clipExtent=function(h){return arguments.length?(h==null?o=s=l=u=null:(o=+h[0][0],s=+h[0][1],l=+h[1][0],u=+h[1][1]),c()):o==null?null:[[o,s],[l,u]]};function c(){var h=Qt*n(),f=e(Cee(e.rotate()).invert([0,0]));return a(o==null?[[f[0]-h,f[1]-h],[f[0]+h,f[1]+h]]:r===PC?[[Math.max(f[0]-h,o),s],[Math.min(f[0]+h,l),u]]:[[o,Math.max(f[1]-h,s)],[l,Math.min(f[1]+h,u)]])}return c()}class Qee extends a1{constructor(e,t={}){super();let n={isOrthographic:!1};this.config=Object.assign({},n,t),this.canvas=e,this.scene=new Dz,this.sizes=new TJ(this),this.time=new MJ(this),this.camera=new mee(this,{isOrthographic:this.config.isOrthographic}),this.renderer=new vee(this),this.sizes.on("resize",()=>{this.resize()}),this.time.on("tick",i=>{this.update(i)})}setAxesHelper(e=250){if(!e)return!1;let t=new jz(e);this.scene.add(t)}resize(){this.camera.resize(),this.renderer.resize()}update(e){this.camera.update(e),this.renderer.update(e)}destroy(){var e,t;this.sizes.destroy(),this.time.destroy(),this.camera.destroy(),this.renderer.destroy(),this.scene.traverse(n=>{if(n instanceof rn){n.geometry.dispose();for(const i in n.material){const a=n.material[i];a&&typeof a.dispose=="function"&&a.dispose()}}}),(t=(e=this.canvas)==null?void 0:e.parentNode)==null||t.removeChild(this.canvas)}}class Jee{constructor({material:e,time:t,size:n,diffuseColor:i,diffuseSpeed:a,diffuseWidth:o,callback:s=()=>{}}){this.time=t,this.pointShader=null,this.callback=s;let l={size:100,diffuseSpeed:15,diffuseColor:9345950,diffuseWidth:10};this.options=Object.assign({},l,{material:e,size:n,diffuseColor:i,diffuseSpeed:a,diffuseWidth:o}),this.init()}init(){let{material:e,size:t,diffuseColor:n,diffuseSpeed:i,diffuseWidth:a}=this.options,o=t/i;e.onBeforeCompile=s=>{this.pointShader=s,this.callback(s,o),s.uniforms=Xe(Re({},s.uniforms),{uTime:{value:0},uSpeed:{value:i},uWidth:{value:a},uColor:{value:new nt(n)}}),s.vertexShader=s.vertexShader.replace("void main() {",` varying vec3 vPosition; void main(){ vPosition = position; `),s.fragmentShader=s.fragmentShader.replace("void main() {",` uniform float uTime; uniform float uSpeed; uniform float uWidth; uniform vec3 uColor; varying vec3 vPosition; void main(){ `),s.fragmentShader=s.fragmentShader.replace("#include ",` #ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif float r = uTime * uSpeed; float w = uWidth; // if(w>uWidth){ // w = uWidth; // }else{ // w = uTime * 1.5; // } vec2 center = vec2(0.0, 0.0); float rDistance = distance(vPosition.xy, center); if(rDistance > r && rDistance < r + 2.0 * w) { float per = 0.0; if(rDistance < r + w) { float p = smoothstep(0.0,1.0,(rDistance - r) / w); p*=p; outgoingLight = mix(outgoingLight, uColor, p); } else { float p = smoothstep(0.0,1.0,(rDistance - r - w) / w); outgoingLight = mix(uColor, outgoingLight, p); } gl_FragColor = vec4(outgoingLight, diffuseColor.a); } else { gl_FragColor = vec4(outgoingLight, 0.0); } `)}}}let ete=class{constructor({scene:e,time:t},n){this.scene=e,this.time=t,this.instance=null;let i={position:new X(0,0,0),gridSize:100,gridDivision:20,gridColor:2635578,shapeSize:1,shapeColor:9345950,pointSize:.2,pointColor:2635578,pointLayout:{row:200,col:200},pointBlending:mc};this.options=Object.assign({},i,n),this.init()}init(){let e=new Dn;e.name="Grid";let t=this.createGridHelp(),n=this.createShapes(),i=this.createPoint();e.add(t,n,i),e.position.copy(this.options.position),this.instance=e,this.scene.add(e)}createShapes(){let{gridSize:e,gridDivision:t,shapeSize:n,shapeColor:i}=this.options,a=e/t,o=e/2,s=new Pn({color:i,side:ur}),l=[];for(let h=0;h{this.update()}),this.sizes.on("resize",()=>{this.resize()})}create(e="",t="",n=!1){let i=document.createElement("div");i.innerHTML=e,i.className=t,i.style.visibility="hidden",i.style.position="absolute",t||(i.style.padding="10px",i.style.color="#fff",i.style.fontSize="12px",i.style.textAlign="center",i.style.background="rgba(0,0,0,0.6)",i.style.borderRadius="4px");let a=null;return n?a=new nte(i):a=new hU(i),a.init=(o,s)=>{a.element.innerHTML=o,a.element.style.visibility="visible",a.position.copy(s)},a.hide=()=>{a.element.style.visibility="hidden"},a.scaleHide=()=>{a.element.classList.add("scale-hidden")},a.show=()=>{a.element.style.visibility="visible",a.element.classList.remove("scale-hidden")},a.setParent=o=>{this.parent=o,o.add(a)},a.remove=()=>{this.parent.remove(a)},a}setLabelStyle(e,t=.1,n="x",i=Math.PI/2,a="none"){e.element.style.pointerEvents=a,e.scale.set(t,t,t),e.rotation[n]=i}setRenderLevel(e){this.css3dRender.domElement.style.zIndex=e}update(){this.css3dRender.render(this.scene,this.camera.instance)}destroy(){if(this.css3dRender){let e=this.css3dRender.domElement;e.parentNode.removeChild(e)}}resize(){let{width:e,height:t}=this.sizes;this.css3dRender.setSize(e,t)}}class sD{constructor({time:e},t){this.time=e,this.options=Object.assign({},{width:10,scale:1,position:new X(0,0,0),needRotate:!1,rotateSpeed:.001,material:new Pn({transparent:!0,opacity:1,depthTest:!0})},t);let n=new Za(this.options.width,this.options.width),i=new rn(n,this.options.material);i.position.copy(this.options.position),i.scale.set(this.options.scale,this.options.scale,this.options.scale),this.instance=i}setParent(e){e.add(this.instance),this.time.on("tick",()=>{this.update()})}update(){this.options.needRotate&&(this.instance.rotation.z+=this.options.rotateSpeed)}}class H0{constructor({time:e},t={}){this.instance=null,this.time=e,this.enable=!0,this.config=Object.assign({num:100,range:500,speed:.01,renderOrder:99,dir:"up",material:new pg({map:H0.createTexture(),size:20,color:16777215,transparent:!0,opacity:1,depthTest:!1,vertexColors:!0,blending:Eo,sizeAttenuation:!0})},t),this.create()}create(){const{range:e,speed:t,dir:n,material:i,num:a,renderOrder:o}=this.config,s=[],l=[],u=[];for(let h=0;hn/2&&o===1&&(f=-n/2),f<-n/2&&o==-1&&(f=n/2),s.setX(c,h),s.setZ(c,f),l.setX(c,d),l.setY(c,p)}s.needsUpdate=!0,l.needsUpdate=!0}setParent(e){e.add(this.instance),this.time.on("tick",(t,n)=>{this.enable&&this.update(t,n)})}}class pS{constructor({},e={}){this.mapGroup=new Dn,this.coordinates=[],this.config=Object.assign({position:new X(0,0,0),geoProjectionCenter:new Me(0,0),geoProjectionScale:120,data:"",renderOrder:1,merge:!1,material:new Pn({color:1582651,transparent:!0,opacity:1})},e),this.mapGroup.position.copy(this.config.position);let t=CC(this.config.data);this.create(t)}geoProjection(e){return Ac().center(this.config.geoProjectionCenter).scale(this.config.geoProjectionScale).translate([0,0])(e)}create(e){let{merge:t}=this.config,n=[];if(e.features.forEach(i=>{const a=new bn;let{name:o,center:s=[],centroid:l=[]}=i.properties;this.coordinates.push({name:o,center:s,centroid:l}),a.userData.name=o,i.geometry.coordinates.forEach(u=>{u.forEach(c=>{const h=new Uo;for(let d=0;d{const n=new bn;let{name:i,center:a=[],centroid:o=[]}=t.properties;this.coordinates.push({name:i,center:a,centroid:o});const s={depth:this.config.depth,bevelEnabled:!0,bevelSegments:1,bevelThickness:.1};let l=[this.config.topFaceMaterial,this.config.sideMaterial];t.geometry.coordinates.forEach(u=>{u.forEach((c,h)=>{const f=new Uo;for(let g=0;g #include #include #include #include uniform float linewidth; uniform vec2 resolution; attribute vec3 instanceStart; attribute vec3 instanceEnd; attribute vec3 instanceColorStart; attribute vec3 instanceColorEnd; #ifdef WORLD_UNITS varying vec4 worldPos; varying vec3 worldStart; varying vec3 worldEnd; #ifdef USE_DASH varying vec2 vUv; #endif #else varying vec2 vUv; #endif #ifdef USE_DASH uniform float dashScale; attribute float instanceDistanceStart; attribute float instanceDistanceEnd; varying float vLineDistance; #endif void trimSegment( const in vec4 start, inout vec4 end ) { // trim end segment so it terminates between the camera plane and the near plane // conservative estimate of the near plane float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column float nearEstimate = - 0.5 * b / a; float alpha = ( nearEstimate - start.z ) / ( end.z - start.z ); end.xyz = mix( start.xyz, end.xyz, alpha ); } void main() { #ifdef USE_COLOR vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd; #endif #ifdef USE_DASH vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd; vUv = uv; #endif float aspect = resolution.x / resolution.y; // camera space vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 ); vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 ); #ifdef WORLD_UNITS worldStart = start.xyz; worldEnd = end.xyz; #else vUv = uv; #endif // special case for perspective projection, and segments that terminate either in, or behind, the camera plane // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space // but we need to perform ndc-space calculations in the shader, so we must address this issue directly // perhaps there is a more elegant solution -- WestLangley bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column if ( perspective ) { if ( start.z < 0.0 && end.z >= 0.0 ) { trimSegment( start, end ); } else if ( end.z < 0.0 && start.z >= 0.0 ) { trimSegment( end, start ); } } // clip space vec4 clipStart = projectionMatrix * start; vec4 clipEnd = projectionMatrix * end; // ndc space vec3 ndcStart = clipStart.xyz / clipStart.w; vec3 ndcEnd = clipEnd.xyz / clipEnd.w; // direction vec2 dir = ndcEnd.xy - ndcStart.xy; // account for clip-space aspect ratio dir.x *= aspect; dir = normalize( dir ); #ifdef WORLD_UNITS vec3 worldDir = normalize( end.xyz - start.xyz ); vec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) ); vec3 worldUp = normalize( cross( worldDir, tmpFwd ) ); vec3 worldFwd = cross( worldDir, worldUp ); worldPos = position.y < 0.5 ? start: end; // height offset float hw = linewidth * 0.5; worldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp; // don't extend the line if we're rendering dashes because we // won't be rendering the endcaps #ifndef USE_DASH // cap extension worldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir; // add width to the box worldPos.xyz += worldFwd * hw; // endcaps if ( position.y > 1.0 || position.y < 0.0 ) { worldPos.xyz -= worldFwd * 2.0 * hw; } #endif // project the worldpos vec4 clip = projectionMatrix * worldPos; // shift the depth of the projected points so the line // segments overlap neatly vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd; clip.z = clipPose.z * clip.w; #else vec2 offset = vec2( dir.y, - dir.x ); // undo aspect ratio adjustment dir.x /= aspect; offset.x /= aspect; // sign flip if ( position.x < 0.0 ) offset *= - 1.0; // endcaps if ( position.y < 0.0 ) { offset += - dir; } else if ( position.y > 1.0 ) { offset += dir; } // adjust for linewidth offset *= linewidth; // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ... offset /= resolution.y; // select end vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd; // back to clip space offset *= clip.w; clip.xy += offset; #endif gl_Position = clip; vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation #include #include #include } `,fragmentShader:` uniform vec3 diffuse; uniform float opacity; uniform float linewidth; #ifdef USE_DASH uniform float dashOffset; uniform float dashSize; uniform float gapSize; #endif varying float vLineDistance; #ifdef WORLD_UNITS varying vec4 worldPos; varying vec3 worldStart; varying vec3 worldEnd; #ifdef USE_DASH varying vec2 vUv; #endif #else varying vec2 vUv; #endif #include #include #include #include #include vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) { float mua; float mub; vec3 p13 = p1 - p3; vec3 p43 = p4 - p3; vec3 p21 = p2 - p1; float d1343 = dot( p13, p43 ); float d4321 = dot( p43, p21 ); float d1321 = dot( p13, p21 ); float d4343 = dot( p43, p43 ); float d2121 = dot( p21, p21 ); float denom = d2121 * d4343 - d4321 * d4321; float numer = d1343 * d4321 - d1321 * d4343; mua = numer / denom; mua = clamp( mua, 0.0, 1.0 ); mub = ( d1343 + d4321 * ( mua ) ) / d4343; mub = clamp( mub, 0.0, 1.0 ); return vec2( mua, mub ); } void main() { #include #ifdef USE_DASH if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX #endif float alpha = opacity; #ifdef WORLD_UNITS // Find the closest points on the view ray and the line segment vec3 rayEnd = normalize( worldPos.xyz ) * 1e5; vec3 lineDir = worldEnd - worldStart; vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd ); vec3 p1 = worldStart + lineDir * params.x; vec3 p2 = rayEnd * params.y; vec3 delta = p1 - p2; float len = length( delta ); float norm = len / linewidth; #ifndef USE_DASH #ifdef USE_ALPHA_TO_COVERAGE float dnorm = fwidth( norm ); alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm ); #else if ( norm > 0.5 ) { discard; } #endif #endif #else #ifdef USE_ALPHA_TO_COVERAGE // artifacts appear on some hardware if a derivative is taken within a conditional float a = vUv.x; float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; float len2 = a * a + b * b; float dlen = fwidth( len2 ); if ( abs( vUv.y ) > 1.0 ) { alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 ); } #else if ( abs( vUv.y ) > 1.0 ) { float a = vUv.x; float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; float len2 = a * a + b * b; if ( len2 > 1.0 ) discard; } #endif #endif vec4 diffuseColor = vec4( diffuse, alpha ); #include #include gl_FragColor = vec4( diffuseColor.rgb, alpha ); #include #include #include #include } `};class dU extends Ls{constructor(e){super({type:"LineMaterial",uniforms:uC.clone(Ai.line.uniforms),vertexShader:Ai.line.vertexShader,fragmentShader:Ai.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1))}}const uD=new X,cD=new X,Pr=new an,Rr=new an,po=new an,vS=new X,gS=new Mt,Ir=new AJ,hD=new X,Rm=new Oa,Dm=new Fa,vo=new an;let Do,wc;function fD(r,e,t){return vo.set(0,0,-e,1).applyMatrix4(r.projectionMatrix),vo.multiplyScalar(1/vo.w),vo.x=wc/t.width,vo.y=wc/t.height,vo.applyMatrix4(r.projectionMatrixInverse),vo.multiplyScalar(1/vo.w),Math.abs(Math.max(vo.x,vo.y))}function ste(r,e){const t=r.matrixWorld,n=r.geometry,i=n.attributes.instanceStart,a=n.attributes.instanceEnd,o=Math.min(n.instanceCount,i.count);for(let s=0,l=o;sh&&Rr.z>h)continue;if(Pr.z>h){const _=Pr.z-Rr.z,x=(Pr.z-h)/_;Pr.lerp(Rr,x)}else if(Rr.z>h){const _=Rr.z-Pr.z,x=(Rr.z-h)/_;Rr.lerp(Pr,x)}Pr.applyMatrix4(n),Rr.applyMatrix4(n),Pr.multiplyScalar(1/Pr.w),Rr.multiplyScalar(1/Rr.w),Pr.x*=a.x/2,Pr.y*=a.y/2,Rr.x*=a.x/2,Rr.y*=a.y/2,Ir.start.copy(Pr),Ir.start.z=0,Ir.end.copy(Rr),Ir.end.z=0;const g=Ir.closestPointToPointParameter(vS,!0);Ir.at(g,hD);const v=sC.lerp(Pr.z,Rr.z,g),m=v>=-1&&v<=1,y=vS.distanceTo(hD){const c=[];let h=null;t==="Line2"?(u[0].forEach(f=>{const[d,p]=this.geoProjection(f);c.push(d,-p,0)}),h=this.createLine2(c)):t==="Line3"?(u[0].forEach(f=>{const[d,p]=this.geoProjection(f);c.push(new X(d,-p,0))}),h=this.createLine3(c)):u[0].forEach(f=>{const[d,p]=this.geoProjection(f);c.push(new X(d,-p,0)),h=this.createLine(c)}),l.add(h)}),a.add(l))}return a}createLine3(e){const t=this.config.tubeRadius,n=256*10,i=4,a=!1,{material:o,renderOrder:s}=this.config,l=new kz(e),u=new SC(l,n,t,i,a),c=new rn(u,o);return c.name="mapLine3",c.renderOrder=s,c}createLine2(e){const{material:t,renderOrder:n}=this.config,i=new pU;i.setPositions(e);let a=new cte(i,t);return a.name="mapLine2",a.renderOrder=n,a.computeLineDistances(),a}createLine(e){const{material:t,renderOrder:n,type:i}=this.config,a=new wn;a.setFromPoints(e);let o=new O0(a,t);return o.renderOrder=n,o.name="mapLine",o}setParent(e){e.add(this.lineGroup)}};class dD{constructor(e,t){this.shader=null,this.config=Object.assign({uColor1:2781042,uColor2:860197,size:15,dir:"x"},t),this.init(e)}init(e){let{uColor1:t,uColor2:n,dir:i,size:a}=this.config,o={x:1,y:2,z:3};e.onBeforeCompile=s=>{this.shader=s,s.uniforms=Xe(Re({},s.uniforms),{uColor1:{value:new nt(t)},uColor2:{value:new nt(n)},uDir:{value:o[i]},uSize:{value:a}}),s.vertexShader=s.vertexShader.replace("void main() {",` attribute float alpha; varying vec3 vPosition; varying float vAlpha; void main() { vAlpha = alpha; vPosition = position; `),s.fragmentShader=s.fragmentShader.replace("void main() {",` varying vec3 vPosition; varying float vAlpha; uniform vec3 uColor1; uniform vec3 uColor2; uniform float uDir; uniform float uSize; void main() { `),s.fragmentShader=s.fragmentShader.replace("#include ",` #ifdef OPAQUE diffuseColor.a = 1.0; #endif // https://github.com/mrdoob/three.js/pull/22425 #ifdef USE_TRANSMISSION diffuseColor.a *= transmissionAlpha + 0.1; #endif // vec3 gradient = mix(uColor1, uColor2, vPosition.x / 15.0); vec3 gradient = vec3(0.0,0.0,0.0); if(uDir==1.0){ gradient = mix(uColor1, uColor2, vPosition.x/ uSize); }else if(uDir==2.0){ gradient = mix(uColor1, uColor2, vPosition.z/ uSize); }else if(uDir==3.0){ gradient = mix(uColor1, uColor2, vPosition.y/ uSize); } outgoingLight = outgoingLight * gradient; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); `)}}}const hte="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAK+SURBVHgB7dzNbdswGIdxSugCRtGBuklWSO17nXs/J0hHywA11AEMu3wDsLFT5WCJ5PtI/D8nQ5cA/FmxJJLqtofhHBSmPihUAoElEFgCgfVu7ODX95suqOKNXVDpDIElEFgCgSUQWAKBJRBYAoE1G2Q3DJ/j9fRjUGE7DI+f4niEGc0CMYzzKezjx7vWUQwjnMJdF8djDsq8M+QYLu/om0VJGP8OXI/LTc0C+fJhs4/fiIeLQ82hvMaI/zEevsVxCROb/RvSMkpuDCvLVVaLKCUwrGyXvS2hlMKwst6HtIBSEsPKfmO4ZpTSGFaRO/U1otTAsIo9OlkTSi0Mq+izrDWg1MSwij9cXDJKbQyrytPeJaJ4YFjVHr8vCcULw6o6H7IEFE8Mq/oEFRnFG8NymTEkohAwLLcpXBIKBcNynVMnoJAwLPdFDp4oNAwLserEA4WIYXVjK7C9Vr+fY8Gh7e8/Lhha/f5GhDMjJRBYAoElEFgCgSUQWAKBJRBYAoElEFgCgSUQWAKBJRBYAoElEFgCgSUQWAKBJRBYAoElEFgCgSUQWAKBJZDwvIIQs2kIA/K81tYvzKYhBMh/75vyCYHiDgLBSLmjuIK8xrBV6J1HoO11biCk/Rmk7XUuIMTNMhSU6iDUnUsWAaUqCBkj5Y1SDWQJGClPlCogS8JIeaEUB1kiRsoDpSjIkjFStVGKgawBI1UTpQjImjBStVCyg6wRI1UDJSvImjFSpVGygbSAkSqJkgWkJYxUKZTZIC1ipEqgzAJpGSOVG2UyiDBeyokyCWR3OOyFcd0Yyu4wfA83Ngnk2Pe/ziE82WdhvHSJYuNz7MPPcGOTQH5sNk+nPnyMf/xeGNcZSvyS3tv42DiFG0O94q+19Iq/BSQQWAKBJRBYAoElEFgCgSUQWKM3hsovnSGwBAJLILAEAusvLK6Na4P/Au0AAAAASUVORK5CYII=",fte=[{name:"邛溪镇",center:[102.60242339873115,32.83022561372293],centroid:[102.60242339873115,32.83022561372293]},{name:"刷经寺镇",center:[102.55651980382184,32.204097908180216],centroid:[102.55651980382184,32.204097908180216]},{name:"安曲镇",center:[102.38447320923945,32.696113484169786],centroid:[102.38447320923945,32.696113484169786]},{name:"龙日镇",center:[102.48704663740175,32.471364980560764],centroid:[102.48704663740175,32.471364980560764]},{name:"江茸乡",center:[102.29046083534963,32.355689518554044],centroid:[102.29046083534963,32.355689518554044]},{name:"查尔玛乡",center:[102.03268479676977,32.440590072394265],centroid:[102.03268479676977,32.440590072394265]},{name:"瓦切镇",center:[102.71535664604494,33.12869670968013],centroid:[102.71535664604494,33.12869670968013]},{name:"阿木乡",center:[102.77925597565002,32.73632379185147],centroid:[102.77925597565002,32.73632379185147]},{name:"麦洼乡",center:[102.95718106156616,33.15445682575394],centroid:[102.95718106156616,33.15445682575394]},{name:"色地镇",center:[103.12540730227074,33.010462261362875],centroid:[103.12540730227074,33.010462261362875]}],pD=[{name:"色地镇",enName:"sedi",center:[103.12540730227074,33.010462261362875],centroid:[103.12540730227074,33.010462261362875],value:1199},{name:"瓦切镇",enName:"waqie",center:[102.71535664604494,33.12869670968013],centroid:[102.71535664604494,33.12869670968013],value:991},{name:"刷经寺镇",enName:"shuajingsi",center:[102.55651980382184,32.204097908180216],centroid:[102.55651980382184,32.204097908180216],value:986},{name:"邛溪镇",enName:"qiongxi",center:[102.60242339873115,32.83022561372293],centroid:[102.60242339873115,32.83022561372293],value:896},{name:"阿木乡",enName:"amu",center:[102.77925597565002,32.73632379185147],centroid:[102.77925597565002,32.73632379185147],value:892},{name:"安曲镇",enName:"anqu",center:[102.38447320923945,32.696113484169786],centroid:[102.38447320923945,32.696113484169786],value:885},{name:"查尔玛乡",enName:"chaerma",center:[102.03268479676977,32.440590072394265],centroid:[102.03268479676977,32.440590072394265],value:729},{name:"龙日镇",enName:"longri",center:[102.48704663740175,32.471364980560764],centroid:[102.48704663740175,32.471364980560764],value:645},{name:"麦洼乡",enName:"maiwa",center:[102.95718106156616,33.15445682575394],centroid:[102.95718106156616,33.15445682575394],value:559},{name:"江茸乡",enName:"jiangrong",center:[102.29046083534963,32.355689518554044],centroid:[102.29046083534963,32.355689518554044],value:514}],dte=[{value:180,lng:102.60242339873115,lat:32.83022561372293},{value:160,lng:102.55651980382184,lat:32.204097908180216},{value:150,lng:102.38447320923945,lat:32.696113484169786},{value:177,lng:102.48704663740175,lat:32.471364980560764},{value:130,lng:102.29046083534963,lat:32.355689518554044},{value:165,lng:102.03268479676977,lat:32.440590072394265},{value:165,lng:102.71535664604494,lat:33.12869670968013},{value:132,lng:102.77925597565002,lat:32.73632379185147},{value:158,lng:102.95718106156616,lat:33.15445682575394},{value:187,lng:103.12540730227074,lat:33.010462261362875}],pte=[{name:"邛溪镇",level:"县城驻地",value:895.94,lng:102.60242339873115,lat:32.83022561372293},{name:"瓦切镇",level:"北部牧区",value:991,lng:102.71535664604494,lat:33.12869670968013},{name:"刷经寺镇",level:"南部通道",value:986.44,lng:102.55651980382184,lat:32.204097908180216},{name:"色地镇",level:"东部片区",value:1199.06,lng:103.12540730227074,lat:33.010462261362875}];var vD=class{constructor(r,e){bt(this,"target");bt(this,"name");bt(this,"intersected");bt(this,"wasIntersected",!1);bt(this,"wasIntersectedOnMouseDown",!1);bt(this,"distance");this.target=r,this.name=e,this.intersected=!1,this.distance=0}},yi=class{constructor(e,t=null){bt(this,"type");bt(this,"cancelBubble");bt(this,"originalEvent");bt(this,"coords",new Me(0,0));bt(this,"distance",0);bt(this,"intersected",!1);bt(this,"wasIntersected",!1);bt(this,"wasIntersectedOnMouseDown",!1);this.cancelBubble=!1,this.type=e,this.originalEvent=t}stopPropagation(){this.cancelBubble=!0}},vte=class{constructor(r,e,t,n){bt(this,"renderer");bt(this,"camera");bt(this,"domElement");bt(this,"bindEventsOnBodyElement");bt(this,"autoAdd");bt(this,"scene");bt(this,"mouse");bt(this,"supportsPointerEvents");bt(this,"interactiveObjects");bt(this,"closestObject");bt(this,"raycaster");bt(this,"treatTouchEventsAsMouseEvents");bt(this,"dispose",()=>{this.domElement.removeEventListener("click",this.onMouseClick),this.supportsPointerEvents&&(this.bindEventsOnBodyElement?this.domElement.ownerDocument.removeEventListener("pointermove",this.onDocumentPointerMove):this.domElement.removeEventListener("pointermove",this.onDocumentPointerMove),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("pointerup",this.onPointerUp)),this.bindEventsOnBodyElement?this.domElement.ownerDocument.removeEventListener("mousemove",this.onDocumentMouseMove):this.domElement.removeEventListener("mousemove",this.onDocumentMouseMove),this.domElement.removeEventListener("mousedown",this.onMouseDown),this.domElement.removeEventListener("mouseup",this.onMouseUp),this.domElement.removeEventListener("touchstart",this.onTouchStart),this.domElement.removeEventListener("touchmove",this.onTouchMove),this.domElement.removeEventListener("touchend",this.onTouchEnd)});bt(this,"add",(r,e=[])=>{if(r&&!this.interactiveObjects.find(t=>t.target===r))if(e.length>0)e.forEach(t=>{let n=r.getObjectByName(t);if(n){let i=new vD(n,t);this.interactiveObjects.push(i)}});else{let t=new vD(r,r.name);this.interactiveObjects.push(t)}});bt(this,"remove",(r,e=[])=>{!r||(e.length>0?e.forEach(t=>{let n=r.getObjectByName(t);n&&(this.interactiveObjects=this.interactiveObjects.filter(i=>i.target!==n))}):this.interactiveObjects=this.interactiveObjects.filter(t=>t.target!==r))});bt(this,"update",()=>{var n;this.raycaster.setFromCamera(this.mouse,this.camera),this.interactiveObjects.forEach(i=>{i.target&&this.checkIntersection(i)}),this.interactiveObjects.sort(function(i,a){return i.distance-a.distance});let r=(n=this.interactiveObjects.find(i=>i.intersected))!=null?n:null;if(r!=this.closestObject){if(this.closestObject){let i=new yi("mouseout");this.dispatch(this.closestObject,i)}if(r){let i=new yi("mouseover");this.dispatch(r,i)}this.closestObject=r}let e;this.interactiveObjects.forEach(i=>{!i.intersected&&i.wasIntersected&&(e||(e=new yi("mouseleave")),this.dispatch(i,e))});let t;this.interactiveObjects.forEach(i=>{i.intersected&&!i.wasIntersected&&(t||(t=new yi("mouseenter")),this.dispatch(i,t))})});bt(this,"checkIntersection",r=>{let e=this.raycaster.intersectObjects([r.target],!0);if(r.wasIntersected=r.intersected,e.length>0){let t=e[0].distance;e.forEach(n=>{n.distance{this.mapPositionToPoint(this.mouse,r.clientX,r.clientY);let e=new yi("mousemove",r);this.interactiveObjects.forEach(t=>{this.dispatch(t,e)})});bt(this,"onDocumentPointerMove",r=>{this.mapPositionToPoint(this.mouse,r.clientX,r.clientY);let e=new yi("pointermove",r);this.interactiveObjects.forEach(t=>{this.dispatch(t,e)})});bt(this,"onTouchMove",r=>{r.touches.length>0&&this.mapPositionToPoint(this.mouse,r.touches[0].clientX,r.touches[0].clientY);let e=new yi(this.treatTouchEventsAsMouseEvents?"mousemove":"touchmove",r);this.interactiveObjects.forEach(t=>{this.dispatch(t,e)})});bt(this,"onMouseClick",r=>{this.update();let e=new yi("click",r);this.interactiveObjects.forEach(t=>{t.intersected&&this.dispatch(t,e)})});bt(this,"onMouseDown",r=>{this.mapPositionToPoint(this.mouse,r.clientX,r.clientY),this.update();let e=new yi("mousedown",r);this.interactiveObjects.forEach(t=>{t.intersected?(t.wasIntersectedOnMouseDown=!0,this.dispatch(t,e)):t.wasIntersectedOnMouseDown=!1})});bt(this,"onPointerDown",r=>{this.mapPositionToPoint(this.mouse,r.clientX,r.clientY),this.update();let e=new yi("pointerdown",r);this.interactiveObjects.forEach(t=>{t.intersected&&this.dispatch(t,e)})});bt(this,"onTouchStart",r=>{r.touches.length>0&&this.mapPositionToPoint(this.mouse,r.touches[0].clientX,r.touches[0].clientY),this.update();let e=new yi(this.treatTouchEventsAsMouseEvents?"mousedown":"touchstart",r);this.interactiveObjects.forEach(t=>{t.intersected&&this.dispatch(t,e)})});bt(this,"onMouseUp",r=>{let e=new yi("mouseup",r);this.interactiveObjects.forEach(t=>{this.dispatch(t,e)})});bt(this,"onPointerUp",r=>{let e=new yi("pointerup",r);this.interactiveObjects.forEach(t=>{this.dispatch(t,e)})});bt(this,"onTouchEnd",r=>{r.touches.length>0&&this.mapPositionToPoint(this.mouse,r.touches[0].clientX,r.touches[0].clientY),this.update();let e=new yi(this.treatTouchEventsAsMouseEvents?"mouseup":"touchend",r);this.interactiveObjects.forEach(t=>{this.dispatch(t,e)})});bt(this,"dispatch",(r,e)=>{r.target&&!e.cancelBubble&&(e.coords=this.mouse,e.distance=r.distance,e.intersected=r.intersected,e.wasIntersected=r.wasIntersected,e.wasIntersectedOnMouseDown=r.wasIntersectedOnMouseDown,r.target.dispatchEvent(e))});bt(this,"mapPositionToPoint",(r,e,t)=>{let n=this.renderer.domElement.getBoundingClientRect();r.x=(e-n.left)/n.width*2-1,r.y=-((t-n.top)/n.height)*2+1});this.renderer=r,this.camera=e,this.domElement=t,this.bindEventsOnBodyElement=n&&typeof n.bindEventsOnBodyElement<"u"?n.bindEventsOnBodyElement:!0,this.scene=n&&typeof n.scene<"u"?n.scene:null,this.scene&&(this.scene.onBeforeRender=()=>{this.autoAdd&&this.scene!==null&&this.scene.traverse(i=>{this.add(i),i.addEventListener("removed",a=>{this.remove(a.target)})}),this.update()}),this.autoAdd=n&&typeof n.autoAdd<"u"?n.autoAdd:!1,this.autoAdd&&this.scene===null&&console.error("Attention: Options.scene needs to be set when using options.autoAdd"),this.mouse=new Me(-1,1),this.supportsPointerEvents=!!window.PointerEvent,this.interactiveObjects=[],this.closestObject=null,this.raycaster=new SJ,t.addEventListener("click",this.onMouseClick),this.supportsPointerEvents&&(this.bindEventsOnBodyElement?t.ownerDocument.addEventListener("pointermove",this.onDocumentPointerMove):t.addEventListener("pointermove",this.onDocumentPointerMove),t.addEventListener("pointerdown",this.onPointerDown),t.addEventListener("pointerup",this.onPointerUp)),this.bindEventsOnBodyElement?t.ownerDocument.addEventListener("mousemove",this.onDocumentMouseMove):t.addEventListener("mousemove",this.onDocumentMouseMove),t.addEventListener("mousedown",this.onMouseDown),t.addEventListener("mouseup",this.onMouseUp),t.addEventListener("touchstart",this.onTouchStart,{passive:!0}),t.addEventListener("touchmove",this.onTouchMove,{passive:!0}),t.addEventListener("touchend",this.onTouchEnd,{passive:!0}),this.treatTouchEventsAsMouseEvents=!0}};const df=256,gte="https://map.shuxitech.com/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}",Ep={west:101.852492,south:31.851389,east:103.347518,north:33.319796};function gD(r,e,t){const n=cu(2,t),i=Math.sin(e*Math.PI/180);return{x:(r+180)/360*n,y:(.5-Math.log((1+i)/(1-i))/(4*Math.PI))*n}}function mD(r,e,t){const n=cu(2,t),i=r/n*360-180,a=Math.PI-2*Math.PI*e/n,o=180/Math.PI*Math.atan(.5*(Math.exp(a)-Math.exp(-a)));return[i,o]}function mte(r,e){const t=gD(r.west,r.north,e),n=gD(r.east,r.south,e),i=Math.floor(t.x),a=Math.floor(n.x),o=Math.floor(t.y),s=Math.floor(n.y);return{zoom:e,minX:i,maxX:a,minY:o,maxY:s,cols:a-i+1,rows:s-o+1}}function yte(r,e){const[t,n]=mD(r.minX,r.minY,r.zoom),[i,a]=mD(r.maxX+1,r.maxY+1,r.zoom),[o]=e([t,Ep.south]),[s]=e([i,Ep.south]),[,l]=e([Ep.west,n]),[,u]=e([Ep.west,a]);return{left:o,right:s,bottom:-u,top:-l}}function _te(r,e){const{width:t,height:n}=e;r.save(),r.globalCompositeOperation="multiply",r.fillStyle="rgba(5, 24, 34, 0.22)",r.fillRect(0,0,t,n),r.globalCompositeOperation="screen";const i=r.createRadialGradient(t*.5,n*.48,t*.1,t*.5,n*.5,t*.72);i.addColorStop(0,"rgba(80, 230, 255, 0.16)"),i.addColorStop(1,"rgba(0, 18, 36, 0.03)"),r.fillStyle=i,r.fillRect(0,0,t,n),r.restore()}function xte(r,e){const t=r.createLinearGradient(0,0,e.width,e.height);t.addColorStop(0,"#061927"),t.addColorStop(.5,"#0b2c3c"),t.addColorStop(1,"#07131f"),r.fillStyle=t,r.fillRect(0,0,e.width,e.height)}function Ste(r){return new Promise(e=>{const t=new Image;t.crossOrigin="anonymous",t.onload=()=>e(t),t.onerror=()=>e(null),t.src=r})}function Ate(r,e,t){return gte.replace("{x}",r).replace("{y}",e).replace("{z}",t)}function wte(r,e,t,n){return Ge(this,null,function*(){const i=[];r.save(),r.filter="brightness(0.92) contrast(1.22) saturate(1.06)";for(let a=n.minX;a<=n.maxX;a+=1)for(let o=n.minY;o<=n.maxY;o+=1)i.push(Ste(Ate(a,o,n.zoom)).then(s=>{s&&(r.drawImage(s,(a-n.minX)*df,(o-n.minY)*df,df,df),t.needsUpdate=!0)}));yield Promise.allSettled(i),r.restore(),_te(r,e),t.needsUpdate=!0})}function bte({geoProjectionCenter:r,geoProjectionScale:e,zoom:t=11}={}){const n=mte(Ep,t),i=document.createElement("canvas");i.width=n.cols*df,i.height=n.rows*df;const a=i.getContext("2d");xte(a,i);const o=new yC(i);o.colorSpace=dn,o.wrapS=ti,o.wrapT=ti,o.minFilter=lr,o.magFilter=lr,o.needsUpdate=!0;const s=Ac().center(r).scale(e).translate([0,0]),l=yte(n,s);return wte(a,i,o,n).catch(u=>{console.warn("load satellite tiles failed:",u)}),{texture:o,uvBounds:l}}function yD(r,e){const t=e.right-e.left,n=e.top-e.bottom;r.mapGroup.traverse(i=>{var s,l;const a=(l=(s=i.geometry)==null?void 0:s.attributes)==null?void 0:l.position;if(!i.isMesh||!a)return;const o=new Float32Array(a.count*2);for(let u=0;uXe(Re({},r),{key:`grassland-type-${e+1}`,cqlFilter:ci("grass_min_type",r.name),rankingPropertyName:["area_code","acreage"],rankingTownCodeKeys:["area_code"],rankingAreaKeys:["acreage"]})),xD=[{name:">4000(kg/hm2)",fillColor:"#39A700",strokeColor:"#39A700"},{name:"3000-4000(kg/hm2)",fillColor:"#8CCF00",strokeColor:"#8CCF00"},{name:"2000-3000(kg/hm2)",fillColor:"#FEFE02",strokeColor:"#FEFE02"},{name:"1500-2000(kg/hm2)",fillColor:"#FE7E01",strokeColor:"#FE7E01"},{name:"<1500(kg/hm2)",fillColor:"#FB0100",strokeColor:"#FB0100"}].map(r=>Xe(Re({},r),{selectable:!1})),Zp={1:"一级",2:"二级",3:"三级",4:"四级",5:"五级",6:"六级",7:"七级",8:"八级"},vU=[{level:"1",name:"1级草原",fillColor:"#81D10B",strokeColor:"#81D10B"},{level:"2",name:"2级草原",fillColor:"#8AE611",strokeColor:"#8AE611"},{level:"3",name:"3级草原",fillColor:"#79C801",strokeColor:"#79C801"},{level:"4",name:"4级草原",fillColor:"#D0EC03",strokeColor:"#D0EC03"},{level:"5",name:"5级草原",fillColor:"#FFCC00",strokeColor:"#FFCC00"},{level:"6",name:"6级草原",fillColor:"#FF6501",strokeColor:"#FF6501"},{level:"7",name:"7级草原",fillColor:"#FB0002",strokeColor:"#FB0002"},{level:"8",name:"8级草原",fillColor:"#D71345",strokeColor:"#D71345"}].map(r=>Xe(Re({},r),{key:`grassland-level-${r.level}`,cqlFilter:`grassland_level IN ('${r.level}','${r.name}','${Zp[r.level]}草原','${Zp[r.level]}草地')`,rankingPropertyName:["area_code","acreage"],rankingTownCodeKeys:["area_code"],rankingAreaKeys:["acreage"],level:void 0})),Cte=vU.map(r=>{const e=r.key.replace("grassland-level-",""),t=r.name.replace("草原","湿地");return Xe(Re({},r),{key:`wetland-level-${e}`,name:t,cqlFilter:`grassland_level IN ('${e}','${t}','${r.name}','${Zp[e]}湿地','${Zp[e]}草原','${Zp[e]}草地')`})}),Ete=[{key:"basic-grassland-basic",name:"基本草原",fillColor:"#2EEA78",strokeColor:"#18F8FF",cqlFilter:"(grassland_category_code = 'BASIC' OR grassland_category_name = '基本草原')",rankingValueKey:"basicAreaWanMu"},{key:"basic-grassland-general",name:"一般草原",fillColor:"#FFD15A",strokeColor:"#18F8FF",cqlFilter:"(grassland_category_code = 'GENERAL' OR grassland_category_name = '一般草原')",rankingValueKey:"generalAreaWanMu"}],jf=[{key:"grassland",name:"草地资源",color:"#8AE611",defaultLayerKey:"grassland-distribution",coreGroups:["grassLand","grassland"]},{key:"wetland",name:"湿地资源",color:"#33A3DC",defaultLayerKey:"wetland-distribution",coreGroups:["wetland"]},{key:"woodland",name:"林地资源",color:"#2BD17E",defaultLayerKey:"woodland-distribution",coreGroups:["woodland"]}],qy=[{key:"national-park",name:"若尔盖国家公园",color:"#8AE611",defaultLayerKey:"national-park-zoning"},{key:"restoration",name:"生态修复工程",color:"#33A3DC",defaultLayerKey:"restoration-projects"}],jy={woodland:[{key:"woodland-distribution",name:"林地范围",layerName:"ne:t_woodland_2023",styles:"woodland_distribution",opacity:.82,legends:[{key:"woodland-distribution-all",name:"林地范围",fillColor:"#2BD17E",strokeColor:"#2BD17E",selectable:!1}]},{key:"woodland-protection",name:"公益林",layerName:"ne:t_woodland_2023",styles:"woodland_protection",opacity:.86,legends:[{key:"woodland-protection-level-1",name:"国家一级公益林",fillColor:"#08C4C5",strokeColor:"#08C4C5",cqlFilter:ci("gjgyl_bhdj","1")},{key:"woodland-protection-level-2",name:"国家二级公益林",fillColor:"#2BD17E",strokeColor:"#2BD17E",cqlFilter:ci("gjgyl_bhdj","2")},{key:"woodland-protection-unset",name:"未划定",fillColor:"#6B8191",strokeColor:"#6B8191",cqlFilter:"(gjgyl_bhdj IS NULL OR gjgyl_bhdj = '' OR gjgyl_bhdj NOT IN ('1','2'))"}]},{key:"woodland-type",name:"林地类型",layerName:"ne:t_woodland_2023",styles:"woodland_type",opacity:.84,legends:[{key:"woodland-type-shrub",name:"灌木林地",fillColor:"#2BD17E",strokeColor:"#2BD17E",cqlFilter:ci("dlmc","灌木林地")},{key:"woodland-type-arbor",name:"乔木林地",fillColor:"#0DA368",strokeColor:"#0DA368",cqlFilter:ci("dlmc","乔木林地")},{key:"woodland-type-swamp",name:"灌丛沼泽",fillColor:"#23C7B7",strokeColor:"#23C7B7",cqlFilter:ci("dlmc","灌丛沼泽")},{key:"woodland-type-other",name:"其他林地",fillColor:"#B7D96B",strokeColor:"#B7D96B",cqlFilter:"(dlmc IS NULL OR dlmc = '' OR dlmc NOT IN ('灌木林地','乔木林地','灌丛沼泽'))"}]},{key:"woodland-quality",name:"林地质量",layerName:"ne:t_woodland_2023",styles:"woodland_quality",opacity:.84,legends:[{key:"woodland-quality-2",name:"二级质量",fillColor:"#08C4C5",strokeColor:"#08C4C5",cqlFilter:ci("zl_dj","2")},{key:"woodland-quality-3",name:"三级质量",fillColor:"#2BD17E",strokeColor:"#2BD17E",cqlFilter:ci("zl_dj","3")},{key:"woodland-quality-4",name:"四级质量",fillColor:"#23C7B7",strokeColor:"#23C7B7",cqlFilter:ci("zl_dj","4")},{key:"woodland-quality-5",name:"五级质量",fillColor:"#B7D96B",strokeColor:"#B7D96B",cqlFilter:ci("zl_dj","5")},{key:"woodland-quality-unset",name:"未划分",fillColor:"#6B8191",strokeColor:"#6B8191",cqlFilter:"(zl_dj IS NULL OR zl_dj = '' OR zl_dj NOT IN ('2','3','4','5'))"}]},{key:"woodland-ownership",name:"林地权属",layerName:"ne:t_woodland_2023",styles:"woodland_ownership",opacity:.84,legends:[{key:"woodland-ownership-collective",name:"集体林地",fillColor:"#2BD17E",strokeColor:"#2BD17E",cqlFilter:ci("ld_qs","10")},{key:"woodland-ownership-other",name:"国有或其他",fillColor:"#08C4C5",strokeColor:"#08C4C5",cqlFilter:"(ld_qs IS NULL OR ld_qs = '' OR ld_qs <> '10')"}]}],grassland:[{key:"grassland-distribution",name:"草地分布",layerName:"ne:t_grassland_result_caodi",opacity:.82,legends:[{name:"草地",fillColor:"#1D953F",strokeColor:"#1D953F"}]},{key:"basic-grassland",name:"基本/一般草原",layerName:"ne:t_basic_grassland_2023",styles:"basic_grassland_type",opacity:.84,legends:Ete},{key:"grassland-level",name:"草原级",layerName:"ne:t_grassland_result_level_caodi",opacity:.82,legends:vU},{key:"grassland-type",name:"草原类型",layerName:"ne:t_grassland_result_grass_min_type_caodi",opacity:.82,legends:_D},{key:"grassland-yield",name:"草地产草量/生产力",layerName:"ne:t_grassland_result_yield_caodi",opacity:.82,legends:xD},{key:"grassland-health",name:"草地健康/退化",layerName:"ne:2023_08_ndvi",opacity:.72,legends:[{name:"非常差",fillColor:"#FF000533",strokeColor:"#FF0005",selectable:!1},{name:"差",fillColor:"#D8EE8C33",strokeColor:"#D8EE8C",selectable:!1},{name:"正常",fillColor:"#78C96233",strokeColor:"#78C962",selectable:!1},{name:"较好",fillColor:"#25814933",strokeColor:"#258149",selectable:!1}]}],wetland:[{key:"wetland-distribution",name:"湿地分布",layerName:"ne:t_grassland_result_shidi",opacity:.84,legends:[{name:"湿地",fillColor:"#33A3DC",strokeColor:"#33A3DC"}]},{key:"wetland-level",name:"湿地级",layerName:"ne:t_grassland_result_level_shidi",opacity:.82,legends:Cte},{key:"wetland-type",name:"湿地类型",layerName:"ne:t_grassland_result_grass_min_type_shidi",opacity:.82,legends:_D},{key:"wetland-yield",name:"湿地产草量/生产力",layerName:"ne:t_grassland_result_yield_shidi",opacity:.82,legends:xD}]},gU={"national-park":[{key:"national-park-zoning",name:"国家公园分区",sourceType:"wkt-api",apiUrl:"/openApi/gjgy/gjgy_area",fallbackPath:"datas/ecological-protection/national_park_wkt.json",opacity:.9,clipBounds:{west:101.852492,south:32.757724488,east:103.227028864,north:33.319796},mapView:{targetLngLat:[102.74,33.12],distanceScale:.68,targetLocalZ:.78,duration:.95},legends:[{key:"national-park-core",name:"核心保护区",fillColor:"#2EEA78",strokeColor:"#18F8FF",match:{field:"type",value:"核心保护区"},selectable:!1},{key:"national-park-general",name:"一般控制区",fillColor:"#FFD15A",strokeColor:"#FFF2A0",match:{field:"type",value:"一般控制区"},selectable:!1}]}],restoration:[{key:"restoration-projects",name:"生态修复工程",sourceType:"geojson",dataPath:"datas/ecological-protection/ecological_restoration_projects.geojson",opacity:.9,legends:[{key:"restoration-grassland",name:"草地修复",fillColor:"#70D44B",strokeColor:"#B7FF6D",cqlFilter:ci("project_category","草地修复"),match:{field:"project_category",value:"草地修复"}},{key:"restoration-wetland",name:"湿地修复",fillColor:"#42C6DF",strokeColor:"#9CF7FF",cqlFilter:ci("project_category","湿地修复"),match:{field:"project_category",value:"湿地修复"}},{key:"restoration-woodland",name:"林地修复",fillColor:"#1FB579",strokeColor:"#57F2A6",cqlFilter:ci("project_category","林地修复"),match:{field:"project_category",value:"林地修复"}},{key:"restoration-linear",name:"线性设施",fillColor:"#F5C84B",strokeColor:"#FFE289",cqlFilter:ci("feature_role","线性设施"),match:{field:"feature_role",value:"线性设施"}}]}]},Lte=Re(Re({},jy),gU),Pte=[...jf,...qy];function yS(r){return Pte.find(e=>e.key===r)||jf[0]}function s1(r){return Lte[r]||[]}function mg(r,e){const t=s1(r);return t.find(n=>n.key===e)||t[0]}const Rte=12e3;function Dte(r,e={}){const t=new URLSearchParams;Object.entries(e).forEach(([i,a])=>{a!=null&&a!==""&&t.append(i,a)});const n=t.toString();return n?`${r}${r.includes("?")?"&":"?"}${n}`:r}function Bs(t){return Ge(this,arguments,function*(r,e={}){const u=e,{params:n,timeout:i=Rte}=u,a=sL(u,["params","timeout"]),o=new AbortController;let s=!1;const l=window.setTimeout(()=>{s=!0,o.abort()},i);try{const c=yield fetch(Dte(r,n),Xe(Re({credentials:"include"},a),{signal:o.signal,headers:Re({Accept:"application/json"},a.headers||{})}));if(!c.ok){const h=new Error(c.status===401?"用户未登录或授权已过期。":`HTTP ${c.status}`);throw h.code=`HTTP_${c.status}`,h.status=c.status,h}return yield c.json()}catch(c){if(o.signal.aborted||(c==null?void 0:c.name)==="AbortError"||/aborted/i.test((c==null?void 0:c.message)||"")){const f=new Error(s?"服务响应超时,请稍后再试。":"请求已取消,请重新发送。");throw f.code=s?"REQUEST_TIMEOUT":"REQUEST_ABORTED",f}throw c}finally{window.clearTimeout(l)}})}function Lt(r){return(r==null?void 0:r.data)!==void 0?r.data:(r==null?void 0:r.result)!==void 0?r.result:r}const RC="/geoserver/ne/wms",Ite={}.VITE_GEOSERVER_WFS_URL||RC.replace(/\/wms$/i,"/wfs");function DC(r,e){const t=new URLSearchParams;return Object.entries(e).forEach(([n,i])=>{i!=null&&i!==""&&t.append(n,i)}),`${r}${r.includes("?")?"&":"?"}${t.toString()}`}function SD(r,e={}){const t=e.bounds||Mn,n=e.size||fl;return DC(e.url||RC,{service:"WMS",version:"1.1.1",request:"GetMap",layers:r.layerName,styles:r.styles||"",format:"image/png",transparent:!0,tiled:!0,srs:"EPSG:4326",bbox:[t.west,t.south,t.east,t.north].join(","),width:n.width,height:n.height,CQL_FILTER:e.cqlFilter||r.cqlFilter,_:Date.now()})}function Nte(r,e,t={}){var a,o;const n=t.bounds||Mn,i=t.size||fl;return DC(t.url||RC,{service:"WMS",version:"1.1.1",request:"GetFeatureInfo",layers:r.layerName,query_layers:r.layerName,styles:r.styles||"",info_format:"application/json",feature_count:5,srs:"EPSG:4326",bbox:[n.west,n.south,n.east,n.north].join(","),width:i.width,height:i.height,x:Math.round(e.x),y:Math.round(e.y),buffer:(o=(a=t.buffer)!=null?a:r.queryBuffer)!=null?o:8,CQL_FILTER:t.cqlFilter||r.cqlFilter})}function AD(n,i){return Ge(this,arguments,function*(r,e,t={}){const a=Nte(r,e,t);return Bs(a,{credentials:"include"})})}function kte(r,e={}){return DC(e.url||Ite,{service:"WFS",version:e.version||"1.0.0",request:"GetFeature",typeName:r,outputFormat:"json",propertyName:Array.isArray(e.propertyName)?e.propertyName.join(","):e.propertyName,CQL_FILTER:e.cqlFilter,maxFeatures:e.maxFeatures||2e5})}function l1(t){return Ge(this,arguments,function*(r,e={}){const n=kte(r,e);return Bs(n,{credentials:"include",timeout:e.timeout||2e4})})}function wD(r){var n;const e=(n=r==null?void 0:r.features)==null?void 0:n[0];if(!e)return null;const t=e.properties||{};return{id:e.id||t.gid||t.objectid||t.OBJECTID,properties:t,feature:e}}function bD(r){return r.sort((e,t)=>t.value-e.value),r}function Lh(r){return String(r||"").replace(/\s+/g,"").trim()}function Wd(r,e=0){const t=Number(r);return Number.isFinite(t)?t:e}function TD(r){return r?/^https?:\/\//.test(r)||r.startsWith("/")?r:`./${r}`:""}class Ote extends Qee{constructor(e,t,n={}){super(e),this.geoProjectionCenter=[102.6305459723107,32.72169252326339],this.geoProjectionScale=650,this.depth=.5,this.mapFocusLabelInfo={name:"红原县",enName:"HONGYUAN COUNTY",center:[102.6305459723107,32.08]},this.clicked=!1,this.scene.fog=new dC(1058614,1,50),this.scene.background=new nt(1058614),this.camera.instance.position.set(-13.767695123014105,12.990152163077308,39.28228164159694),this.camera.instance.near=1,this.camera.instance.far=1e4,this.camera.instance.updateProjectionMatrix(),this.defaultMapCameraPosition=new X(-.17427287762525134,13.678992786206543,20.688611202093714),this.defaultMapTarget=new X(0,0,0),this.activeMapViewTweens=[],this.interactionManager=new vte(this.renderer.instance,this.camera.instance,this.canvas),this.assets=t,this.callbacks=n,this.topicLayerLoadId=0,this.visibleTopicLayers=[],this.mapAnimationComplete=!1,this.showTownRankingBars=!1,this.showTownRankingPointMarkers=!1,this.currentTownRanking=null,this.selectedFeatureGroup=null,this.selectedVectorFeatures=[],this.currentVectorFeatures=[],this.townMetaByName=new Map(pD.map(i=>[Lh(i.name),i])),this.initEnvironment(),this.init()}init(){this.labelGroup=new Dn,this.label3d=new ate(this),this.labelGroup.rotation.x=-Math.PI/2,this.scene.add(this.labelGroup),this.flyLineFocusGroup=new Dn,this.flyLineFocusGroup.visible=!1,this.flyLineFocusGroup.rotation.x=-Math.PI/2,this.scene.add(this.flyLineFocusGroup),this.eventElement=[],this.defaultMaterial=null,this.defaultLightMaterial=null,this.createBottomBg(),this.createChinaBlurLine(),this.createGrid(),this.createRotateBorder(),this.createLabel(),this.createMap(),this.createEvent(),this.createFlyLine(),this.createFocus(),this.createParticles(),this.createScatter(),this.createInfoPoint(),this.createStorke();let e=$n.timeline({onComplete:()=>{this.mapAnimationComplete=!0,this.applyLayerMapView(this.currentTopicLayer,{force:!0})}});e.pause(),this.animateTl=e,e.addLabel("focusMap",1.5),e.addLabel("focusMapOpacity",2),e.addLabel("bar",3),e.to(this.camera.instance.position,{duration:2,x:this.defaultMapCameraPosition.x,y:this.defaultMapCameraPosition.y,z:this.defaultMapCameraPosition.z,ease:"circ.out",onStart:()=>{this.flyLineFocusGroup.visible=!1}}),e.to(this.focusMapGroup.position,{duration:1,x:0,y:0,z:0},"focusMap"),e.to(this.focusMapGroup.scale,{duration:1,x:1,y:1,z:1,ease:"circ.out",onComplete:()=>{this.flyLineGroup.visible=!0,this.scatterGroup.visible=!0,this.InfoPointGroup.visible=this.showTownRankingPointMarkers&&this.hasTownRankingRows()}},"focusMap"),e.to(this.focusMapTopMaterial,{duration:1,opacity:1,ease:"circ.out"},"focusMapOpacity"),e.to(this.focusMapSideMaterial,{duration:1,opacity:1,ease:"circ.out",onComplete:()=>{this.focusMapSideMaterial.transparent=!1}},"focusMapOpacity"),this.otherLabel.map((n,i)=>{let a=n.element.querySelector(".other-label");e.to(a,{duration:1,delay:.1*i,translateY:0,opacity:1,ease:"circ.out"},"focusMapOpacity")}),e.to(this.mapLineMaterial,{duration:.5,delay:.3,opacity:1},"focusMapOpacity"),e.to(this.rotateBorder1.scale,{delay:.3,duration:1,x:1,y:1,z:1,ease:"circ.out"},"focusMapOpacity"),e.to(this.rotateBorder2.scale,{duration:1,delay:.5,x:1,y:1,z:1,ease:"circ.out",onComplete:()=>{var n,i;this.flyLineFocusGroup.visible=!0,(i=(n=this.callbacks).onPlayComplete)==null||i.call(n)}},"focusMapOpacity"),this.showTownRankingBars&&(this.allBar.map((n,i)=>{e.to(n.scale,{duration:1,delay:.1*i,x:1,y:1,z:1,ease:"circ.out"},"bar")}),this.allBarMaterial.map((n,i)=>{e.to(n,{duration:1,delay:.1*i,opacity:1,ease:"circ.out"},"bar")}));const t=this;this.allProvinceLabel.map((n,i)=>{let a=n.element.querySelector(".provinces-label-wrap"),o=n.element.querySelector(".number .value"),s={progress:0};e.to(a,{duration:1,delay:.2*i,translateY:0,opacity:1,ease:"circ.out"},"bar"),e.to(s,{duration:1,delay:.2*i,progress:1,onStart:()=>{s.progress=0},onUpdate:l},"bar");function l(){var c,h;const u=Wd((h=(c=n.userData)==null?void 0:c.targetValue)!=null?h:o.dataset.targetValue);o.innerText=t.formatMapRankingValue(u*s.progress)}}),this.showTownRankingBars&&this.allGuangquan.map((n,i)=>{e.to(n.children[0].scale,{duration:1,delay:.1*i,x:1,y:1,z:1,ease:"circ.out"},"bar"),e.to(n.children[1].scale,{duration:1,delay:.1*i,x:1,y:1,z:1,ease:"circ.out"},"bar")})}initEnvironment(){let e=new qz(16777215,5);this.scene.add(e);let t=new B0(16777215,5);t.position.set(-30,6,-8),t.castShadow=!0,t.shadow.radius=20,t.shadow.mapSize.width=1024,t.shadow.mapSize.height=1024,this.scene.add(t),this.createPointLight({color:"#1d5e5e",intensity:800,distance:1e4,x:-9,y:3,z:-3}),this.createPointLight({color:"#1d5e5e",intensity:200,distance:1e4,x:0,y:2,z:5})}createPointLight(e){const t=new Yz(1924702,e.intensity,e.distance);t.position.set(e.x,e.y,e.z),this.scene.add(t)}createMap(){let e=new Dn,t=new Dn;this.focusMapGroup=t;let{china:n,chinaTopLine:i}=this.createChina(),{map:a,mapTop:o,mapLine:s}=this.createProvince();n.setParent(e),i.setParent(e),this.createDiffuse(),a.setParent(t),o.setParent(t),s.setParent(t),t.position.set(0,0,-.01),t.scale.set(1,1,0),e.add(t),this.createTopicLayer(),e.rotation.x=-Math.PI/2,e.position.set(0,.2,0),this.scene.add(e),this.createBar()}createChina(){let e={chinaBgMaterialColor:"#152c47",lineColor:"#3f82cd"},t=this.assets.instance.getResource("china"),n=new Lb({color:new nt(e.chinaBgMaterialColor),transparent:!0,opacity:1}),i=new pS(this,{data:t,geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,merge:!0,material:n,renderOrder:2}),a=new ys({color:e.lineColor}),o=new mS(this,{data:t,geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,material:a,renderOrder:3});return o.lineGroup.position.z+=.01,{china:i,chinaTopLine:o}}createProvince(){let e=this.assets.instance.getResource("mapJson");this.mapJsonData=e;const t=bte({geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,zoom:Tte});this.enhanceTexture(t.texture);let[n,i]=this.createProvinceMaterial();this.focusMapTopMaterial=n,this.focusMapSideMaterial=i;let a=new ote(this,{geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,position:new X(0,0,.11),data:e,depth:this.depth,topFaceMaterial:n,sideMaterial:i,renderOrder:9}),o=new Pv({color:16777215,map:t.texture,transparent:!0,opacity:.9,roughness:.9});new dD(o,{uColor1:1227744,uColor2:38069}),this.defaultMaterial=o,this.defaultLightMaterial=this.defaultMaterial.clone(),this.defaultLightMaterial.color=new nt("rgba(115,208,255,1)"),this.defaultLightMaterial.opacity=.8;let s=new pS(this,{geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,position:new X(0,0,this.depth+.22),data:e,material:o,renderOrder:8});yD(s,t.uvBounds),s.mapGroup.children.map(u=>{u.children.map(c=>{c.type==="Mesh"&&this.eventElement.push(c)})}),this.mapLineMaterial=new ys({color:16777215,opacity:0,transparent:!0,fog:!1});let l=new mS(this,{geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,data:e,material:this.mapLineMaterial,renderOrder:3});return l.lineGroup.position.z+=this.depth+.23,{map:a,mapTop:s,mapLine:l}}createTopicLayer(){if(!this.mapJsonData)return;const e=document.createElement("canvas");e.width=fl.width,e.height=fl.height;const t=e.getContext("2d");t.clearRect(0,0,e.width,e.height);const n=new yC(e);n.colorSpace=dn,n.wrapS=ti,n.wrapT=ti,n.minFilter=lr,n.magFilter=lr,this.enhanceTexture(n),n.needsUpdate=!0;const i=new Pn({map:n,transparent:!0,opacity:0,depthWrite:!1,side:ur,fog:!1}),a=new pS(this,{geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,position:new X(0,0,this.depth+.255),data:this.mapJsonData,material:i,renderOrder:18});yD(a,this.createLayerUvBounds()),a.setParent(this.focusMapGroup),this.topicLayerCanvas=e,this.topicLayerContext=t,this.topicLayerTexture=n,this.topicLayerMaterial=i,this.topicLayerMap=a}createSelectedFeatureGroup(){var e;this.selectedFeatureGroup||(this.selectedFeatureGroup=new Dn,this.selectedFeatureGroup.name="selected-feature-highlight",this.selectedFeatureGroup.position.z=this.depth+.31,(e=this.focusMapGroup)==null||e.add(this.selectedFeatureGroup))}createLayerUvBounds(){const e=Ac().center(this.geoProjectionCenter).scale(this.geoProjectionScale).translate([0,0]),[t]=e([Mn.west,Mn.south]),[n]=e([Mn.east,Mn.south]),[,i]=e([Mn.west,Mn.north]),[,a]=e([Mn.west,Mn.south]);return{left:t,right:n,bottom:-a,top:-i}}setTopicLayer(e){var i,a;if(!e||!this.topicLayerContext||!this.topicLayerTexture)return;this.currentTopicLayer=e,this.visibleTopicLayers=[e],this.clearSelectedFeature(),this.applyLayerMapView(e);const t=++this.topicLayerLoadId;if((a=(i=this.callbacks).onLayerStatus)==null||a.call(i,{type:"loading",text:`正在加载 ${e.name}`}),e.sourceType==="wkt-api"||e.sourceType==="geojson"){this.loadVectorTopicLayer(e,t);return}const n=new Image;n.crossOrigin="anonymous",n.onload=()=>{var o,s,l;t===this.topicLayerLoadId&&(this.topicLayerContext.clearRect(0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),this.topicLayerContext.drawImage(n,0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),this.topicLayerTexture.needsUpdate=!0,this.topicLayerMaterial.opacity=(o=e.opacity)!=null?o:.84,(l=(s=this.callbacks).onLayerStatus)==null||l.call(s,{type:"success",text:"GeoServer 图层已加载"}))},n.onerror=()=>{var o,s;t===this.topicLayerLoadId&&(this.topicLayerContext.clearRect(0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),this.topicLayerTexture.needsUpdate=!0,this.topicLayerMaterial.opacity=0,(s=(o=this.callbacks).onLayerStatus)==null||s.call(o,{type:"error",text:"GeoServer 图层加载失败"}))},n.src=SD(e)}setTopicLayers(e=[],t=e[0]){var o,s,l,u;if(!this.topicLayerContext||!this.topicLayerTexture)return;const n=e.filter(Boolean);if(!n.length){this.visibleTopicLayers=[],this.currentTopicLayer=null,this.clearSelectedFeature(),this.applyLayerMapView(null),this.topicLayerContext.clearRect(0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),this.topicLayerTexture.needsUpdate=!0,this.topicLayerMaterial.opacity=0,(s=(o=this.callbacks).onLayerStatus)==null||s.call(o,{type:"success",text:"图层已关闭"});return}if(n.length===1){this.setTopicLayer(Re(Re({},n[0]),(t==null?void 0:t.key)===n[0].key?t:{}));return}this.currentTopicLayer=t||n[n.length-1],this.visibleTopicLayers=n,this.clearSelectedFeature(),this.applyLayerMapView(this.currentTopicLayer);const i=++this.topicLayerLoadId;(u=(l=this.callbacks).onLayerStatus)==null||u.call(l,{type:"loading",text:`正在加载 ${n.length} 个林地图层`});const a=n.filter(c=>c.sourceType!=="wkt-api"&&c.sourceType!=="geojson");Promise.all(a.map(c=>this.loadTopicLayerImage(c))).then(c=>{var f,d;if(i!==this.topicLayerLoadId)return;const h=c.filter(Boolean);this.topicLayerContext.clearRect(0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),h.forEach(({image:p,layer:g},v)=>{var y,_;this.topicLayerContext.save();const m=v===h.length-1?Math.max(.78,(y=g.opacity)!=null?y:.9):Math.min(.52,(_=g.opacity)!=null?_:.52);this.topicLayerContext.globalAlpha=Math.min(1,Math.max(.28,m)),this.topicLayerContext.drawImage(p,0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),this.topicLayerContext.restore()}),this.topicLayerTexture.needsUpdate=!0,this.topicLayerMaterial.opacity=h.length?1:0,(d=(f=this.callbacks).onLayerStatus)==null||d.call(f,{type:h.length?"success":"error",text:h.length?`已加载 ${h.length} 个林地图层`:"林地图层加载失败"})})}loadTopicLayerImage(e){return new Promise(t=>{const n=new Image;n.crossOrigin="anonymous",n.onload=()=>t({image:n,layer:e}),n.onerror=()=>t(null),n.src=SD(e)})}applyLayerMapView(e,t={}){var s,l;if(!((s=this.camera)!=null&&s.instance)||!((l=this.camera)!=null&&l.controls)||!this.mapAnimationComplete&&!t.force)return;const n=(e==null?void 0:e.mapView)||(e!=null&&e.cameraPosition?{cameraPosition:e.cameraPosition}:null),i=n?this.getLayerMapViewTarget(n):this.defaultMapTarget.clone(),a=n?this.getLayerMapViewCameraPosition(n,i):this.defaultMapCameraPosition.clone(),o=n&&Number.isFinite(n.duration)?n.duration:.75;this.animateMapCamera(a,i,o)}getLayerMapViewTarget(e){var t;return e!=null&&e.targetLngLat?this.lngLatToWorldPoint(e.targetLngLat,(t=e.targetLocalZ)!=null?t:.72):e!=null&&e.target?this.toVector3(e.target,this.defaultMapTarget):this.defaultMapTarget.clone()}getLayerMapViewCameraPosition(e,t){if(e!=null&&e.cameraPosition)return this.toVector3(e.cameraPosition,this.defaultMapCameraPosition);const n=Number.isFinite(e==null?void 0:e.distanceScale)?e.distanceScale:1,i=this.defaultMapCameraPosition.clone().sub(this.defaultMapTarget).multiplyScalar(n),a=t.clone().add(i);return e!=null&&e.cameraOffset&&a.add(this.toVector3(e.cameraOffset,new X(0,0,0))),a}lngLatToWorldPoint(e,t=0){const n=Array.isArray(e)?e:[e==null?void 0:e.lng,e==null?void 0:e.lat],i=Number(n==null?void 0:n[0]),a=Number(n==null?void 0:n[1]);if(!Number.isFinite(i)||!Number.isFinite(a))return this.defaultMapTarget.clone();const[o,s]=this.geoProjection([i,a]),l=new X(o,-s,Number(t)||0);return this.focusMapGroup?this.focusMapGroup.localToWorld(l):l}toVector3(e,t){if(Array.isArray(e)){const[o,s,l]=e.map(Number);return[o,s,l].every(Number.isFinite)?new X(o,s,l):t.clone()}const n=Number(e==null?void 0:e.x),i=Number(e==null?void 0:e.y),a=Number(e==null?void 0:e.z);return[n,i,a].every(Number.isFinite)?new X(n,i,a):t.clone()}animateMapCamera(e,t,n=.75){this.activeMapViewTweens.forEach(o=>{var s;return(s=o==null?void 0:o.kill)==null?void 0:s.call(o)}),this.activeMapViewTweens=[];const i=this.camera.controls,a=()=>i.update();this.activeMapViewTweens.push($n.to(this.camera.instance.position,{duration:n,x:e.x,y:e.y,z:e.z,ease:"power2.out",onUpdate:a}),$n.to(i.target,{duration:n,x:t.x,y:t.y,z:t.z,ease:"power2.out",onUpdate:a}))}loadVectorTopicLayer(e,t){return Ge(this,null,function*(){var n,i,a,o,s;try{const l=yield this.fetchVectorLayerGeojson(e);if(t!==this.topicLayerLoadId)return;this.currentVectorFeatures=l.features||[],this.drawVectorTopicLayer(e,this.currentVectorFeatures),this.topicLayerTexture.needsUpdate=!0,this.topicLayerMaterial.opacity=(n=e.opacity)!=null?n:.9,(a=(i=this.callbacks).onLayerStatus)==null||a.call(i,{type:"success",text:"真实矢量图层已加载"})}catch(l){if(t!==this.topicLayerLoadId)return;this.currentVectorFeatures=[],this.topicLayerContext.clearRect(0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),this.topicLayerTexture.needsUpdate=!0,this.topicLayerMaterial.opacity=0,(s=(o=this.callbacks).onLayerStatus)==null||s.call(o,{type:"error",text:"真实矢量图层加载失败"})}})}fetchVectorLayerGeojson(e){return Ge(this,null,function*(){if(e.sourceType==="geojson"){const n=yield fetch(TD(e.dataPath),{credentials:"include"});if(!n.ok)throw new Error(`HTTP ${n.status}`);return yield n.json()}let t=[];try{const n=yield fetch(e.apiUrl,{credentials:"include"});if(!n.ok)throw new Error(`HTTP ${n.status}`);const i=yield n.json();t=Array.isArray(i==null?void 0:i.data)?i.data:[]}catch(n){const i=yield fetch(TD(e.fallbackPath),{credentials:"include"});if(!i.ok)throw n;const a=yield i.json();t=Array.isArray(a==null?void 0:a.rows)?a.rows:[]}return{type:"FeatureCollection",features:t.map(n=>({type:"Feature",properties:{id:n.id,type:n.type,totalAcreage:n.totalAcreage,cdAcreage:n.cdAcreage,sdAcreage:n.sdAcreage,cdScl:n.cdScl,sdScl:n.sdScl},geometry:this.parseWktGeometry(n.wkt)})).filter(n=>n.geometry)}})}drawVectorTopicLayer(e,t){const n=this.topicLayerContext;n.clearRect(0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),n.save(),n.lineJoin="round",n.lineCap="round",this.clipVectorLayerContext(n,e),this.getVisibleVectorFeatures(e,t).sort((o,s)=>{var c,h;const l=this.getGeometryDrawRank((c=o.geometry)==null?void 0:c.type),u=this.getGeometryDrawRank((h=s.geometry)==null?void 0:h.type);return l-u}).forEach(o=>{const s=this.getVectorFeatureStyle(e,o);this.drawVectorFeature(n,o.geometry,s)}),this.drawSelectedVectorOverlay(n),n.restore()}drawSelectedVectorOverlay(e){const t=this.selectedVectorFeatures||[];if(!t.length)return;const n={fill:"#FFE15A",stroke:"#24F6C4",polygonAlpha:.24,lineAlpha:.98,lineWidth:12,pointRadius:9,glow:!0},i={fill:"#FFF06A",stroke:"#FFFDF2",polygonAlpha:.46,lineAlpha:1,lineWidth:5,pointRadius:6,glow:!1};e.save(),t.forEach(a=>{var s;const o=(a==null?void 0:a.geometry)||((s=a==null?void 0:a.feature)==null?void 0:s.geometry);this.drawVectorFeature(e,o,n),this.drawVectorFeature(e,o,i)}),e.restore()}redrawVectorTopicLayer(){!this.topicLayerContext||!this.topicLayerTexture||!this.currentTopicLayer||!["wkt-api","geojson"].includes(this.currentTopicLayer.sourceType)||(this.drawVectorTopicLayer(this.currentTopicLayer,this.currentVectorFeatures||[]),this.topicLayerTexture.needsUpdate=!0)}getVisibleVectorFeatures(e,t){const n=e==null?void 0:e.activeLegend,i=n==null?void 0:n.match;if(i!=null&&i.field)return(t||[]).filter(s=>{var l,u;return String((u=(l=s==null?void 0:s.properties)==null?void 0:l[i.field])!=null?u:"")===String(i.value)});const o=String((e==null?void 0:e.cqlFilter)||"").trim().match(/^([a-zA-Z0-9_]+)\s*=\s*'((?:''|[^'])*)'$/);if(o){const[,s,l]=o,u=l.replace(/''/g,"'");return(t||[]).filter(c=>{var h,f;return String((f=(h=c==null?void 0:c.properties)==null?void 0:h[s])!=null?f:"")===u})}return[...t||[]]}clipVectorLayerContext(e,t){const n=this.getLayerClipBounds(t);if(!n)return;const i=this.lngLatToLayerCanvasPoint([n.west,n.north]),a=this.lngLatToLayerCanvasPoint([n.east,n.south]),o=Math.min(i.x,a.x),s=Math.min(i.y,a.y),l=Math.abs(a.x-i.x),u=Math.abs(a.y-i.y);!l||!u||(e.beginPath(),e.rect(o,s,l,u),e.clip())}getLayerClipBounds(e){const t=e==null?void 0:e.clipBounds;if(!t)return null;const n=Math.max(Number(t.west),Mn.west),i=Math.max(Number(t.south),Mn.south),a=Math.min(Number(t.east),Mn.east),o=Math.min(Number(t.north),Mn.north);return![n,i,a,o].every(Number.isFinite)||n>=a||i>=o?null:{west:n,south:i,east:a,north:o}}getGeometryDrawRank(e){return String(e).includes("Polygon")?1:String(e).includes("LineString")?2:3}getVectorFeatureStyle(e,t){var l,u,c;const n=t.properties||{},a=(e.legends||[]).find(h=>{var d;const f=h.match;return f?String((d=n[f.field])!=null?d:"")===String(f.value):!1})||((l=e.legends)==null?void 0:l[0])||{},o=String(((u=t.geometry)==null?void 0:u.type)||"").includes("LineString"),s=((c=t.geometry)==null?void 0:c.type)==="Point";return{fill:o||s?a.strokeColor||a.fillColor||"#30DCFF":a.fillColor||"#30DCFF",stroke:a.strokeColor||a.fillColor||"#30DCFF",polygonAlpha:.36,lineAlpha:o?.92:.9,lineWidth:o?5:2.4,pointRadius:4.5,glow:!0}}drawVectorFeature(e,t,n){if(t!=null&&t.coordinates){if(t.type==="Polygon"){this.drawPolygonPath(e,t.coordinates,n);return}if(t.type==="MultiPolygon"){t.coordinates.forEach(i=>this.drawPolygonPath(e,i,n));return}if(t.type==="LineString"){this.drawLinePath(e,t.coordinates,n);return}if(t.type==="MultiLineString"){t.coordinates.forEach(i=>this.drawLinePath(e,i,n));return}t.type==="Point"&&this.drawPointPath(e,t.coordinates,n)}}drawPolygonPath(e,t,n){Array.isArray(t==null?void 0:t[0])&&(e.save(),e.beginPath(),t.forEach(i=>{i.forEach((a,o)=>{const s=this.lngLatToLayerCanvasPoint(a);o===0?e.moveTo(s.x,s.y):e.lineTo(s.x,s.y)}),e.closePath()}),e.fillStyle=this.hexToRgba(n.fill,n.polygonAlpha),e.strokeStyle=this.hexToRgba(n.stroke,n.lineAlpha),e.lineWidth=n.lineWidth,n.glow&&(e.shadowColor=n.stroke,e.shadowBlur=14),e.fill("evenodd"),e.stroke(),e.restore())}drawLinePath(e,t,n){!Array.isArray(t)||t.length<2||(e.save(),e.beginPath(),t.forEach((i,a)=>{const o=this.lngLatToLayerCanvasPoint(i);a===0?e.moveTo(o.x,o.y):e.lineTo(o.x,o.y)}),e.strokeStyle=this.hexToRgba(n.stroke,n.lineAlpha),e.lineWidth=n.lineWidth,e.shadowColor=n.stroke,e.shadowBlur=12,e.stroke(),e.restore())}drawPointPath(e,t,n){const i=this.lngLatToLayerCanvasPoint(t);e.save(),e.beginPath(),e.arc(i.x,i.y,n.pointRadius,0,Math.PI*2),e.fillStyle=this.hexToRgba(n.fill,.88),e.shadowColor=n.stroke,e.shadowBlur=12,e.fill(),e.restore()}lngLatToLayerCanvasPoint(e){const t=Number(e==null?void 0:e[0]),n=Number(e==null?void 0:e[1]);return{x:(t-Mn.west)/(Mn.east-Mn.west)*this.topicLayerCanvas.width,y:(Mn.north-n)/(Mn.north-Mn.south)*this.topicLayerCanvas.height}}hexToRgba(e,t=1){const n=String(e||"#30DCFF").replace("#",""),i=n.length===3?n.split("").map(u=>u+u).join(""):n,a=Number.parseInt(i,16);if(!Number.isFinite(a))return`rgba(48, 220, 255, ${t})`;const o=a>>16&255,s=a>>8&255,l=a&255;return`rgba(${o}, ${s}, ${l}, ${t})`}parseWktGeometry(e){var o;const t=String(e||"").trim();if(!t)return null;const n=t.match(/^([A-Z]+)(?:\s+[A-Z]+)?\s*\(/i),i=(o=n==null?void 0:n[1])==null?void 0:o.toUpperCase();if(!i)return null;const a=t.slice(t.indexOf("("));return i==="POLYGON"?{type:"Polygon",coordinates:this.parseWktPolygonBody(a)}:i==="MULTIPOLYGON"?{type:"MultiPolygon",coordinates:this.parseWktMultiPolygonBody(a)}:null}parseWktMultiPolygonBody(e){return this.getWktChildGroups(e).map(t=>this.parseWktPolygonBody(t)).filter(t=>t.length)}parseWktPolygonBody(e){return this.getWktChildGroups(e).map(t=>this.parseWktRing(t)).filter(t=>t.length>=3)}getWktChildGroups(e){const t=String(e||"").trim(),n=t.startsWith("(")&&t.endsWith(")")?t.slice(1,-1):t,i=[];let a=0,o=-1;for(let s=0;s=0&&(i.push(n.slice(o,s+1)),o=-1))}return i.length?i:[n]}parseWktRing(e){return String(e||"").replace(/^\(+|\)+$/g,"").split(",").map(n=>n.trim().split(/\s+/).slice(0,2).map(Number)).filter(([n,i])=>Number.isFinite(n)&&Number.isFinite(i))}createProvinceMaterial(){let e=new Lb({color:16777215,transparent:!0,opacity:0,fog:!1,side:ur});e.onBeforeCompile=i=>{i.uniforms=Xe(Re({},i.uniforms),{uColor1:{value:new nt(2780818)},uColor2:{value:new nt(1058614)}}),i.vertexShader=i.vertexShader.replace("void main() {",` attribute float alpha; varying vec3 vPosition; varying float vAlpha; void main() { vAlpha = alpha; vPosition = position; `),i.fragmentShader=i.fragmentShader.replace("void main() {",` varying vec3 vPosition; varying float vAlpha; uniform vec3 uColor1; uniform vec3 uColor2; void main() { `),i.fragmentShader=i.fragmentShader.replace("#include ",` #ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= transmissionAlpha + 0.1; #endif vec3 gradient = mix(uColor1, uColor2, vPosition.x/15.78); outgoingLight = mix(outgoingLight, outgoingLight * gradient, 0.22); float topAlpha = 0.88; if(vPosition.z>0.3){ diffuseColor.a *= topAlpha; } gl_FragColor = vec4( outgoingLight, diffuseColor.a ); `)};let t=this.assets.instance.getResource("side");t.wrapS=jr,t.wrapT=jr,t.repeat.set(1,1.5),t.offset.y+=.065;let n=new Pv({color:16777215,map:t,fog:!1,opacity:0,side:ur});return this.time.on("tick",()=>{t.offset.y+=.005}),n.onBeforeCompile=i=>{i.uniforms=Xe(Re({},i.uniforms),{uColor1:{value:new nt(2780818)},uColor2:{value:new nt(2780818)}}),i.vertexShader=i.vertexShader.replace("void main() {",` attribute float alpha; varying vec3 vPosition; varying float vAlpha; void main() { vAlpha = alpha; vPosition = position; `),i.fragmentShader=i.fragmentShader.replace("void main() {",` varying vec3 vPosition; varying float vAlpha; uniform vec3 uColor1; uniform vec3 uColor2; void main() { `),i.fragmentShader=i.fragmentShader.replace("#include ",` #ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= transmissionAlpha + 0.1; #endif vec3 gradient = mix(uColor1, uColor2, vPosition.z/1.2); outgoingLight = outgoingLight*gradient; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); `)},[e,n]}getDefaultTownRanking(){return{title:"乡镇统计加载中",unit:"",rows:pD.map(e=>({name:e.name,value:0,unit:""}))}}getTownRankingMeta(e=this.currentTownRanking){const t=this.getDefaultTownRanking();return{title:(e==null?void 0:e.title)||t.title,unit:(e==null?void 0:e.unit)||t.unit,metricLabel:(e==null?void 0:e.metricLabel)||(e==null?void 0:e.legendName)||"",note:(e==null?void 0:e.note)||""}}getTownRankingRows(e=this.currentTownRanking,t=7,n=!0){var l;const i=this.getDefaultTownRanking(),a=(l=e==null?void 0:e.rows)!=null&&l.length?e.rows:n?i.rows:[],o=this.getTownRankingMeta(e),s=a.map(u=>{const c=this.townMetaByName.get(Lh(u.name));return c?Xe(Re(Re({},c),u),{name:c.name,enName:c.enName,center:c.center,centroid:c.centroid,value:Wd(u.value),unit:u.unit||o.unit,metricTitle:o.title}):null}).filter(Boolean).sort((u,c)=>c.value-u.value).map((u,c)=>Xe(Re({},u),{rank:c+1}));return Number.isFinite(t)?s.slice(0,t):s}hasTownRankingRows(e=this.currentTownRanking){return this.getTownRankingRows(e,Number.POSITIVE_INFINITY,!1).length>0}formatMapRankingValue(e){const t=Wd(e);return Math.abs(t)>=100?String(Math.round(t)):Math.abs(t)>=10?String(Number(t.toFixed(1))):String(Number(t.toFixed(2)))}getBarHeight(e,t){return t?Math.max(2.8*.12,2.8*(Wd(e)/t)):2.8*.25}createBarGeometry(e){const n=new ld(.06999999999999999,.06999999999999999,e);return n.translate(0,0,e/2),n}getProvinceLabelHtml(e,t,n){return`
${n.title}
${this.formatMapRankingValue(e.value)}${e.unit||n.unit}
${e.name}
${t+1}
`}updateBarItem(e,t,n,i,a=!0){var u,c;const o=this.getBarHeight(t.value,i),[s,l]=this.geoProjection(t.centroid);return e.visible=!0,(c=(u=e.geometry)==null?void 0:u.dispose)==null||c.call(u),e.geometry=this.createBarGeometry(o),e.position.set(s,-l,this.depth+.45),e.userData=Xe(Re({},t),{targetValue:t.value,geoHeight:o}),e.children.forEach(h=>{var f,d,p,g;(d=(f=h.geometry)==null?void 0:f.dispose)==null||d.call(f),Array.isArray(h.material)?h.material.forEach(v=>{var m;return(m=v==null?void 0:v.dispose)==null?void 0:m.call(v)}):(g=(p=h.material)==null?void 0:p.dispose)==null||g.call(p)}),e.clear(),e.add(...this.createHUIGUANG(o,n>3?16776948:7863285)),a?$n.to(e.scale,{duration:.45,x:1,y:1,z:1,ease:"power2.out"}):this.mapAnimationComplete&&e.scale.set(1,1,1),{x:s,y:l,geoHeight:o}}updateProvinceLabel(e,t,n,i,a,o=!0){var p;const s=Wd((p=e.userData)==null?void 0:p.targetValue,t.value);e.visible=!0,e.userData=Xe(Re({},t),{targetValue:t.value}),e.position.copy(i);const l=e.element.querySelector(".label-title"),u=e.element.querySelector(".number .value"),c=e.element.querySelector(".number .unit"),h=e.element.querySelector(".name"),f=e.element.querySelector(".no");!l||!u||!c||!h||!f?e.element.innerHTML=this.getProvinceLabelHtml(t,n,a):(l.innerText=a.title,u.dataset.targetValue=String(t.value),u.innerText=this.formatMapRankingValue(t.value),c.innerText=t.unit||a.unit,h.innerText=t.name,f.innerText=n+1);const d=e.element.querySelector(".provinces-label-wrap");if(this.mapAnimationComplete&&(d.style.opacity="1",d.style.transform="translate(50%, 0)"),o&&this.mapAnimationComplete){const g=e.element.querySelector(".number .value"),m={value:s};$n.to(m,{value:t.value,duration:.45,ease:"power2.out",onUpdate:()=>{g.innerText=this.formatMapRankingValue(m.value)},onComplete:()=>{g.dataset.previousValue=String(t.value),g.innerText=this.formatMapRankingValue(t.value)}})}}clearTownNameLabelStat(e){const t=e.element.querySelector(".town-stat-label"),n=e.element.querySelector(".town-stat-value"),i=e.element.querySelector(".town-stat-unit"),a=e.element.querySelector(".town-rank"),o=e.element.querySelector(".town-stat-metric");t==null||t.classList.remove("has-stat"),n&&(n.innerText=""),i&&(i.innerText=""),a&&(a.innerText=""),o&&(o.innerText="")}updateTownNameLabelStats(e=this.currentTownRanking){var a;if(!((a=this.townNameLabels)!=null&&a.length))return;const t=this.getTownRankingRows(e,Number.POSITIVE_INFINITY,!1),n=this.getTownRankingMeta(e),i=new Map(t.map(o=>[Lh(o.name),o]));this.townNameLabels.forEach(o=>{var g,v;const s=((g=o.userData)==null?void 0:g.townName)||((v=o.userData)==null?void 0:v.name),l=i.get(Lh(s));if(!l){this.clearTownNameLabelStat(o);return}const u=o.element.querySelector(".town-stat-label"),c=o.element.querySelector(".town-name"),h=o.element.querySelector(".town-stat-value"),f=o.element.querySelector(".town-stat-unit"),d=o.element.querySelector(".town-rank"),p=o.element.querySelector(".town-stat-metric");u==null||u.classList.add("has-stat"),c&&(c.innerText=s),p&&(p.innerText=l.metricLabel||n.metricLabel||""),h&&(h.innerText=this.formatMapRankingValue(l.value)),f&&(f.innerText=l.unit||n.unit||""),d&&(d.innerText=l.rank?`第${l.rank}名`:""),o.userData=Xe(Re(Re({},o.userData),l),{townName:s,targetValue:l.value})})}getInfoPointHtml(e,t=this.getTownRankingMeta()){const n=String(t.title||"统计指标").replace(/排行$/,"");return`
乡镇${e.name}
指标${n}
数值${this.formatMapRankingValue(e.value)}${e.unit||t.unit}
排名第${e.rank||"-"}名
`}updateInfoPointStats(){var i,a;if(!((i=this.infoPointSprites)!=null&&i.length)||!((a=this.infoLabelElement)!=null&&a.length))return;if(!this.showTownRankingPointMarkers){this.clearInfoPointStats();return}const e=this.getTownRankingRows(this.currentTownRanking,Number.POSITIVE_INFINITY,!1);if(!e.length){this.clearInfoPointStats();return}const t=new Map(e.map(o=>[Lh(o.name),o])),n=this.getTownRankingMeta();this.infoPointSprites.forEach((o,s)=>{const l=t.get(Lh(o.userData.name));if(!l)return;o.userData=Xe(Re({},o.userData),{value:l.value,unit:l.unit||n.unit,rank:l.rank,metricTitle:n.title});const u=Math.max(...e.map(f=>f.value),1),c=.7+l.value/u*.4;o.scale.set(c,c,c);const h=this.infoLabelElement[s];h&&(h.userData=Re({},l),h.element.innerHTML=this.getInfoPointHtml(l,n))})}clearInfoPointStats(){var e,t;clearInterval(this.infoPointLabelTime),this.infoPointLabelTime=null,this.infoPointIndex=0,this.InfoPointGroup&&(this.InfoPointGroup.visible=!1),(e=this.infoLabelElement)==null||e.forEach(n=>{n.visible=!1}),(t=this.infoPointSprites)==null||t.forEach(n=>{n.visible=!1,n.scale.set(0,0,0)})}createBar(){const e=this.getTownRankingRows();this.getTownRankingMeta();const t=new Dn;this.barGroup=t;const n=Math.max(...e.map(i=>i.value),1);this.allBar=[],this.allBarMaterial=[],this.allGuangquan=[],this.allProvinceLabel=[],e.map((i,a)=>{const o=this.getBarHeight(i.value,n),s=new Pn({color:16777215,transparent:!0,opacity:0,depthTest:!1,fog:!1});new dD(s,{uColor1:a>3?16506760:5291006,uColor2:a>3?16776948:7863285,size:o,dir:"y"});const l=new rn(this.createBarGeometry(o),s);l.renderOrder=5;const[u,c]=this.geoProjection(i.centroid);l.position.set(u,-c,this.depth+.45),l.scale.set(1,1,0),l.userData=Xe(Re({},i),{targetValue:i.value,geoHeight:o});const h=this.createQuan(new X(u,this.depth+.44,c),a);l.add(...this.createHUIGUANG(o,a>3?16776948:7863285)),t.add(l),t.rotation.x=-Math.PI/2,this.allBar.push(l),this.allBarMaterial.push(s),this.allGuangquan.push(h)}),this.scene.add(t),this.updateTownNameLabelStats(this.currentTownRanking)}setTownRanking(e){var i,a,o,s,l,u,c,h;if(this.currentTownRanking=e,this.updateTownNameLabelStats(e),!((i=this.allBar)!=null&&i.length))return;if(!this.showTownRankingBars){this.allBar.forEach(f=>{f.visible=!1,f.scale.set(1,1,0)}),(a=this.allBarMaterial)==null||a.forEach(f=>{f.opacity=0}),(o=this.allProvinceLabel)==null||o.forEach(f=>{f.visible=!1}),(s=this.allGuangquan)==null||s.forEach(f=>{f.visible=!1}),this.clearInfoPointStats();return}const t=this.getTownRankingRows(e,7,!1);if(!t.length){this.allBar.forEach(f=>{f.visible=!1,f.scale.set(1,1,0)}),(l=this.allProvinceLabel)==null||l.forEach(f=>{f.visible=!1}),(u=this.allGuangquan)==null||u.forEach(f=>{f.visible=!1}),this.clearInfoPointStats();return}this.InfoPointGroup&&(this.InfoPointGroup.visible=this.showTownRankingPointMarkers&&this.mapAnimationComplete),(c=this.infoPointSprites)==null||c.forEach(f=>{f.visible=this.showTownRankingPointMarkers});const n=Math.max(...t.map(f=>f.value),1);this.allBar.forEach((f,d)=>{const p=d{f.visible=!1}),this.allGuangquan.forEach((f,d)=>{f.visible=d{const p=this.allBar[d],g=this.allGuangquan[d];if(!p)return;const{x:v,y:m}=this.updateBarItem(p,f,d,n,this.mapAnimationComplete);g&&(g.visible=!0,g.position.set(0,0,0),g.children.forEach(y=>{y.position.set(v,this.depth+.44,m),this.mapAnimationComplete&&y.scale.set(1,1,1)}))}),this.updateInfoPointStats()}createEvent(){let e=[];const t=i=>{i.traverse(a=>{a.isMesh&&(a.material=this.defaultMaterial)})},n=i=>{i.traverse(a=>{a.isMesh&&(a.material=this.defaultLightMaterial)})};this.eventElement.map(i=>{this.interactionManager.add(i),i.addEventListener("mousedown",a=>{this.handleMapClick(a)}),i.addEventListener("mouseover",a=>{e.includes(a.target.parent)||e.push(a.target.parent),document.body.style.cursor="pointer",n(a.target.parent)}),i.addEventListener("mouseout",a=>{e=e.filter(o=>o.userData.name!==a.target.parent.userData.name),e.length>0&&e[e.length-1],t(a.target.parent),document.body.style.cursor="default"})})}createHUIGUANG(e,t){let n=new Za(.35,e);n.translate(0,e/2,0);const i=this.assets.instance.getResource("huiguang");i.colorSpace=dn,i.wrapS=jr,i.wrapT=jr;let a=new Pn({color:t,map:i,transparent:!0,opacity:.4,depthWrite:!1,side:ur,blending:Eo}),o=new rn(n,a);o.renderOrder=10,o.rotateX(Math.PI/2);let s=o.clone(),l=o.clone();return s.rotateY(Math.PI/180*60),l.rotateY(Math.PI/180*120),[o,s,l]}createQuan(e,t){const n=this.assets.instance.getResource("guangquan1"),i=this.assets.instance.getResource("guangquan2");let a=new Za(.5,.5),o=new Pn({color:16777215,map:n,alphaMap:n,opacity:1,transparent:!0,depthTest:!1,fog:!1,blending:Eo}),s=new Pn({color:16777215,map:i,alphaMap:i,opacity:1,transparent:!0,depthTest:!1,fog:!1,blending:Eo}),l=new rn(a,o),u=new rn(a,s);return l.renderOrder=6,u.renderOrder=6,l.rotateX(-Math.PI/2),u.rotateX(-Math.PI/2),l.position.copy(e),u.position.copy(e),u.position.y-=.001,l.scale.set(0,0,0),u.scale.set(0,0,0),this.quanGroup=new Dn,this.quanGroup.add(l,u),this.scene.add(this.quanGroup),this.time.on("tick",()=>{l.rotation.z+=.05}),this.quanGroup}createDiffuse(){let e=new Za(200,200),t=new Pn({color:0,depthWrite:!1,transparent:!0,blending:tz});t.blendEquation=vl,t.blendSrc=rz,t.blendDst=nz,new Jee({material:t,time:this.time,size:60,diffuseSpeed:8,diffuseColor:7442830,diffuseWidth:2,callback:i=>{setTimeout(()=>{$n.to(i.uniforms.uTime,{value:4,repeat:-1,duration:6,ease:"power1.easeIn"})},3)}});let n=new rn(e,t);n.renderOrder=3,n.rotation.x=-Math.PI/2,n.position.set(0,.21,0),this.scene.add(n)}createGrid(){new ete(this,{gridSize:50,gridDivision:20,gridColor:1788784,shapeSize:.5,shapeColor:2776970,pointSize:.1,pointColor:1396093})}createBottomBg(){let e=new Za(20,20);const t=this.assets.instance.getResource("ocean");t.colorSpace=dn,t.wrapS=jr,t.wrapT=jr,t.repeat.set(1,1);let n=new Pn({map:t,opacity:1,fog:!1}),i=new rn(e,n);i.rotation.x=-Math.PI/2,i.position.set(0,-.7,0),this.scene.add(i)}createChinaBlurLine(){let e=new Za(147,147);const t=this.assets.instance.getResource("chinaBlurLine");t.colorSpace=dn,t.wrapS=jr,t.wrapT=jr,t.generateMipmaps=!1,t.minFilter=vr,t.repeat.set(1,1);let n=new Pn({color:4162253,alphaMap:t,transparent:!0,opacity:.5}),i=new rn(e,n);i.rotateX(-Math.PI/2),i.position.set(-19.3,-.5,-19.7),this.scene.add(i)}createLabel(){let e=this,t=this.labelGroup,n=this.label3d,i=[],a=[];fte.map(u=>{if(u.hide==!0)return!1;let c=s(u,n,t);i.push(c),a.push(c)});let o=l(Re({},this.mapFocusLabelInfo),n,t);i.push(o),this.otherLabel=i,this.townNameLabels=a;function s(u,c,h){let f=c.create("",`china-label ${u.blur?" blur":""}`,!1);const[d,p]=e.geoProjection(u.center);return f.init(`
${u.name}
`,new X(d,-p,e.depth+.85)),c.setLabelStyle(f,.018,"x"),f.setParent(h),f.userData=Xe(Re({},u),{townName:u.name}),f}function l(u,c,h){let f=c.create("","map-label",!1);const[d,p]=e.geoProjection(u.center);return f.init(`
${u.name}${u.enName}
`,new X(d,-p,.4)),c.setLabelStyle(f,.015,"x"),f.setParent(h),f}}createRotateBorder(){let e=12,t=this.assets.instance.getResource("rotationBorder1"),n=this.assets.instance.getResource("rotationBorder2"),i=new sD(this,{width:e*1.178,needRotate:!0,rotateSpeed:.001,material:new Pn({map:t,color:4763647,transparent:!0,opacity:.2,side:ur,depthWrite:!1,blending:Eo}),position:new X(0,.28,0)});i.instance.rotation.x=-Math.PI/2,i.instance.renderOrder=6,i.instance.scale.set(0,0,0),i.setParent(this.scene);let a=new sD(this,{width:e*1.116,needRotate:!0,rotateSpeed:-.004,material:new Pn({map:n,color:4763647,transparent:!0,opacity:.4,side:ur,depthWrite:!1,blending:Eo}),position:new X(0,.3,0)});a.instance.rotation.x=-Math.PI/2,a.instance.renderOrder=6,a.instance.scale.set(0,0,0),a.setParent(this.scene),this.rotateBorder1=i.instance,this.rotateBorder2=a.instance}createFlyLine(){this.flyLineGroup=new Dn,this.flyLineGroup.visible=!1,this.scene.add(this.flyLineGroup)}createFocus(){this.flyLineFocusGroup.clear()}createParticles(){this.particles=new H0(this,{num:10,range:30,dir:"up",speed:.05,material:new pg({map:H0.createTexture(),size:1,color:61166,transparent:!0,opacity:1,depthTest:!1,depthWrite:!1,vertexColors:!0,blending:Eo,sizeAttenuation:!0})}),this.particleGroup=new Dn,this.scene.add(this.particleGroup),this.particleGroup.rotation.x=-Math.PI/2,this.particles.setParent(this.particleGroup),this.particles.enable=!0,this.particleGroup.visible=!0}createScatter(){this.scatterGroup=new Dn,this.scatterGroup.visible=!1,this.scatterGroup.rotation.x=-Math.PI/2,this.scene.add(this.scatterGroup);const e=this.assets.instance.getResource("arrow"),t=new bb({map:e,color:16776948,fog:!1,transparent:!0,depthTest:!1});let n=bD(dte),i=n[0].value;n.map(a=>{const o=new aR(t);o.renderOrder=23;let s=.1+a.value/i*.2;o.scale.set(s,s,s);let[l,u]=this.geoProjection([a.lng,a.lat]);o.position.set(l,-u,this.depth+.45),o.userData.position=[l,-u,this.depth+.45],this.scatterGroup.add(o)})}createInfoPoint(){let e=this;this.InfoPointGroup=new Dn,this.scene.add(this.InfoPointGroup),this.InfoPointGroup.visible=!1,this.InfoPointGroup.rotation.x=-Math.PI/2,this.infoPointIndex=0,this.infoPointLabelTime=null,this.infoLabelElement=[],this.infoPointSprites=[];let t=this.label3d;const n=this.assets.instance.getResource("point");let i=[16776948,7863285],a=bD(pte),o=a[0].value;a.map((l,u)=>{const c=new bb({map:n,color:i[u%i.length],fog:!1,transparent:!0,depthTest:!1}),h=new aR(c);h.renderOrder=23;let f=.7+l.value/o*.4;h.scale.set(f,f,f);let[d,p]=this.geoProjection([l.lng,l.lat]),g=[d,-p,this.depth+.7];h.position.set(...g),h.userData.position=[...g],h.userData={position:[d,-p,this.depth+.7],name:l.name,value:l.value,level:l.level,index:u},this.InfoPointGroup.add(h);let v=s(l,t,this.InfoPointGroup,u);this.infoLabelElement.push(v),this.infoPointSprites.push(h),this.interactionManager.add(h),h.addEventListener("mousedown",m=>{if(this.clicked||!this.InfoPointGroup.visible)return!1;this.clicked=!0,this.infoPointIndex=m.target.userData.index,this.infoLabelElement.map(y=>{y.visible=!1}),v.visible=!0,this.createInfoPointLabelLoop()}),h.addEventListener("mouseup",m=>{this.clicked=!1}),h.addEventListener("mouseover",m=>{document.body.style.cursor="pointer"}),h.addEventListener("mouseout",m=>{document.body.style.cursor="default"})});function s(l,u,c,h){let f=u.create("","info-point",!0);const[d,p]=e.geoProjection([l.lng,l.lat]);return f.init(e.getInfoPointHtml(Xe(Re({},l),{value:0,rank:h+1,unit:""}),e.getTownRankingMeta()),new X(d,-p,e.depth+1.9)),u.setLabelStyle(f,.015,"x"),f.setParent(c),f.visible=!1,f}}createInfoPointLabelLoop(){clearInterval(this.infoPointLabelTime),this.infoPointLabelTime=setInterval(()=>{this.infoPointIndex++,this.infoPointIndex>=this.infoLabelElement.length&&(this.infoPointIndex=0),this.infoLabelElement.map((e,t)=>{this.infoPointIndex===t?e.visible=!0:e.visible=!1})},3e3)}createStorke(){const e=this.assets.instance.getResource("mapStroke"),t=this.assets.instance.getResource("pathLine3");t.wrapS=t.wrapT=jr,t.repeat.set(2,1);let n=new mS(this,{geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,position:new X(0,0,this.depth+.24),data:e,material:new Pn({color:2868444,map:t,alphaMap:t,fog:!1,transparent:!0,opacity:1,blending:Eo}),type:"Line3",renderOrder:22,tubeRadius:.03});this.focusMapGroup.add(n.lineGroup),this.time.on("tick",()=>{t.offset.x+=.005})}handleMapClick(e){return Ge(this,null,function*(){var a,o,s,l,u,c,h,f,d,p,g,v,m,y,_,x,S,A,w,M,C,b,T,P,D,L,E,I,N;if(!this.currentTopicLayer)return;const t=this.getScreenPointFromEvent(e),n=this.getLngLatFromEvent(e);if(!n){this.clearSelectedFeature(),(o=(a=this.callbacks).onFeatureInfo)==null||o.call(a,{feature:null});return}if(this.currentTopicLayer.sourceType==="wkt-api"||this.currentTopicLayer.sourceType==="geojson"){const R=this.pickVectorFeatureAtPoint(n);R?(this.showSelectedFeature(R),(h=(c=this.callbacks).onFeatureInfo)==null||h.call(c,{feature:{id:((s=R.properties)==null?void 0:s.id)||((l=R.properties)==null?void 0:l.feature_id)||((u=R.properties)==null?void 0:u.project_name),properties:R.properties||{},feature:R,layer:this.currentTopicLayer,lngLat:n},screen:t}),(d=(f=this.callbacks).onLayerStatus)==null||d.call(f,{type:"success",text:"真实矢量要素已选中"})):(this.clearSelectedFeature(),(g=(p=this.callbacks).onFeatureInfo)==null||g.call(p,{feature:null}),(m=(v=this.callbacks).onLayerStatus)==null||m.call(v,{type:"success",text:"当前点击位置无生态保护要素"}));return}const i=this.lngLatToWmsPixel(n);(_=(y=this.callbacks).onFeatureInfo)==null||_.call(y,{feature:null}),(S=(x=this.callbacks).onFeatureLoading)==null||S.call(x,!0);try{const R=yield AD(this.currentTopicLayer,i,{size:fl,buffer:10}),F=wD(R),O=F?null:yield this.queryFallbackFeatureInfo(n),V=F||(O==null?void 0:O.feature);if(V){const H=yield this.enrichFeatureInfo(V,i,n);this.showSelectedFeature(H.feature||H),(w=(A=this.callbacks).onFeatureInfo)==null||w.call(A,{feature:Xe(Re({},H),{layer:(O==null?void 0:O.layer)||this.currentTopicLayer,lngLat:n}),screen:t})}else this.clearSelectedFeature(),(C=(M=this.callbacks).onFeatureInfo)==null||C.call(M,{feature:null});V||(T=(b=this.callbacks).onLayerStatus)==null||T.call(b,{type:"success",text:"当前点击位置无图斑"})}catch(R){this.clearSelectedFeature(),(D=(P=this.callbacks).onFeatureInfo)==null||D.call(P,{feature:null}),(E=(L=this.callbacks).onLayerStatus)==null||E.call(L,{type:"error",text:"图斑信息查询失败"})}finally{(N=(I=this.callbacks).onFeatureLoading)==null||N.call(I,!1)}})}enrichFeatureInfo(e,t,n){return Ge(this,null,function*(){const i=this.getLayerTopicKey(this.currentTopicLayer);if(!["grassland","woodland"].includes(i))return e;const o=(jy[i]||[]).find(h=>h.key===`${i}-distribution`),s=(this.visibleTopicLayers||[]).filter(h=>this.getLayerTopicKey(h)===i).slice(0,5),l=[o,this.currentTopicLayer,...s].filter(h=>h==null?void 0:h.layerName).filter((h,f,d)=>d.findIndex(p=>this.getLayerQueryKey(p)===this.getLayerQueryKey(h))===f);if(!l.length)return e;const u=yield Promise.allSettled([...l.filter(h=>this.getLayerQueryKey(h)!==this.getLayerQueryKey(this.currentTopicLayer)).map(h=>Ge(this,null,function*(){const f=yield AD(h,t,{size:fl,buffer:10}),d=wD(f);return d?{layer:h,feature:d,source:"wms"}:null})),...l.map(h=>Ge(this,null,function*(){const f=yield this.queryLayerFeatureByPoint(h,n);return f?{layer:h,feature:f,source:"wfs"}:null}))]),c=Re({},e.properties||{});return u.forEach(h=>{var f,d;h.status!=="fulfilled"||!((d=(f=h.value)==null?void 0:f.feature)!=null&&d.properties)||this.mergeBusinessProperties(c,h.value.feature.properties,h.value.layer)}),Xe(Re({},e),{properties:c,relatedFeatures:u.filter(h=>{var f;return h.status==="fulfilled"&&((f=h.value)==null?void 0:f.feature)}).map(h=>h.value),feature:Xe(Re({},e.feature||{}),{properties:c})})})}queryFallbackFeatureInfo(e){return Ge(this,null,function*(){const t=this.getLayerTopicKey(this.currentTopicLayer);if(!["grassland","woodland"].includes(t))return null;const i=[(jy[t]||[]).find(a=>a.key===`${t}-distribution`),this.currentTopicLayer,...(this.visibleTopicLayers||[]).filter(a=>this.getLayerTopicKey(a)===t)].filter((a,o,s)=>(a==null?void 0:a.layerName)&&s.findIndex(l=>this.getLayerQueryKey(l)===this.getLayerQueryKey(a))===o);for(const a of i){const o=yield this.queryLayerFeatureByPoint(a,e,{requireContainment:!0});if(o)return{layer:a,feature:o}}return null})}queryLayerFeatureByPoint(i,a){return Ge(this,arguments,function*(e,t,n={}){var p,g,v;if(!(e!=null&&e.layerName)||!Number.isFinite(t==null?void 0:t.lng)||!Number.isFinite(t==null?void 0:t.lat))return null;const o=e.pointQueryTolerance||.0015,s=e.geometryField||"geom",l=t.lng-o,u=t.lat-o,c=t.lng+o,h=t.lat+o,f=yield l1(e.layerName,{cqlFilter:`BBOX(${s},${l},${u},${c},${h})`,maxFeatures:8,timeout:12e3}),d=this.pickFeatureAtPoint((f==null?void 0:f.features)||[],t,n);return d?{id:d.id||((p=d.properties)==null?void 0:p.gid)||((g=d.properties)==null?void 0:g.objectid)||((v=d.properties)==null?void 0:v.OBJECTID),properties:d.properties||{},feature:d}:null})}pickFeatureAtPoint(e,t,n={}){var a;if(!Array.isArray(e)||!e.length)return null;const i=e.filter(o=>this.isLngLatInGeometry(t,o.geometry)).sort((o,s)=>this.getGeometryAreaScore(o.geometry)-this.getGeometryAreaScore(s.geometry));return i.length?i[0]:n.requireContainment?null:((a=e.map(o=>({feature:o,distance:this.getGeometryDistanceScore(o.geometry,t)})).sort((o,s)=>o.distance-s.distance)[0])==null?void 0:a.feature)||null}isLngLatInGeometry(e,t){return!e||!(t!=null&&t.coordinates)?!1:t.type==="Polygon"?this.isLngLatInPolygon(e,t.coordinates):t.type==="MultiPolygon"?t.coordinates.some(n=>this.isLngLatInPolygon(e,n)):!1}isLngLatInPolygon(e,t=[]){return!t.length||!this.isLngLatInRing(e,t[0])?!1:!t.slice(1).some(i=>this.isLngLatInRing(e,i))}isLngLatInRing(e,t=[]){if(t.length<3)return!1;let n=!1;const i=e.lng,a=e.lat;for(let o=0,s=t.length-1;oa!=d>a&&i<(f-c)*(a-h)/(d-h)+c&&(n=!n)}return n}isPointOnSegment(e,t,n,i,a,o){const s=(e-n)*(o-i)-(t-i)*(a-n);return Math.abs(s)>1e-10?!1:(e-n)*(e-a)+(t-i)*(t-o)<=1e-10}getGeometryAreaScore(e){return e!=null&&e.coordinates?e.type==="Polygon"?this.getLngLatPolygonAreaScore(e.coordinates):e.type==="MultiPolygon"?e.coordinates.reduce((t,n)=>t+this.getLngLatPolygonAreaScore(n),0):Number.POSITIVE_INFINITY:Number.POSITIVE_INFINITY}getLngLatPolygonAreaScore(e=[]){const t=e[0]||[];if(t.length<3)return Number.POSITIVE_INFINITY;let n=0;for(let i=0;i({minLng:Math.min(n.minLng,Number((i==null?void 0:i[0])||0)),minLat:Math.min(n.minLat,Number((i==null?void 0:i[1])||0)),maxLng:Math.max(n.maxLng,Number((i==null?void 0:i[0])||0)),maxLat:Math.max(n.maxLat,Number((i==null?void 0:i[1])||0))}),{minLng:Number.POSITIVE_INFINITY,minLat:Number.POSITIVE_INFINITY,maxLng:Number.NEGATIVE_INFINITY,maxLat:Number.NEGATIVE_INFINITY}):null}getGeometryCoordinateList(e){const t=[],n=i=>{if(Array.isArray(i)){if(typeof i[0]=="number"&&typeof i[1]=="number"){t.push(i);return}i.forEach(n)}};return n(e==null?void 0:e.coordinates),t}pickVectorFeatureAtPoint(e){const t=this.currentVectorFeatures||[],n=t.filter(a=>this.isLngLatInGeometry(e,a.geometry)).sort((a,o)=>this.getGeometryAreaScore(a.geometry)-this.getGeometryAreaScore(o.geometry));if(n.length)return n[0];const i=t.find(a=>this.isPointOrLineNearLngLat(a.geometry,e));return i||null}focusProject(e){var f,d,p,g;const t=String(e||"").trim();if(!t)return!1;const n=(this.currentVectorFeatures||[]).filter(v=>{var m;return String(((m=v==null?void 0:v.properties)==null?void 0:m.project_name)||"").trim()===t});if(!n.length)return(d=(f=this.callbacks).onLayerStatus)==null||d.call(f,{type:"success",text:"当前项目图斑尚未加载"}),!1;const i=this.getFeatureListLngLatBounds(n);if(!i)return!1;const a=this.getProjectHighlightFeatures(n);a.length?(this.showSelectedFeatures(a),this.setSelectedVectorFeatures(a)):this.clearSelectedFeature();const o=[(i.minLng+i.maxLng)/2,(i.minLat+i.maxLat)/2],s=Math.max(i.maxLng-i.minLng,i.maxLat-i.minLat),l=Math.max(.22,Math.min(.55,s*1.25)),u=this.lngLatToWorldPoint(o,.72),c=this.defaultMapCameraPosition.clone().sub(this.defaultMapTarget).multiplyScalar(l),h=u.clone().add(c);return this.animateMapCamera(h,u,.75),(g=(p=this.callbacks).onLayerStatus)==null||g.call(p,{type:"success",text:"已定位项目"}),!0}getProjectHighlightFeatures(e){const t=e.filter(i=>{var o;const a=String(((o=i==null?void 0:i.geometry)==null?void 0:o.type)||"");return a.includes("Polygon")||a.includes("LineString")}),n=t.filter(i=>{var a;return((a=i==null?void 0:i.properties)==null?void 0:a.feature_role)==="工程范围"});return n.length?n:t}getFeatureListLngLatBounds(e){return e.reduce((t,n)=>{const i=this.getGeometryLngLatBounds(n.geometry);return i?t?{minLng:Math.min(t.minLng,i.minLng),minLat:Math.min(t.minLat,i.minLat),maxLng:Math.max(t.maxLng,i.maxLng),maxLat:Math.max(t.maxLat,i.maxLat)}:Re({},i):t},null)}isPointOrLineNearLngLat(e,t){return e!=null&&e.coordinates?e.type==="Point"?this.getCoordinateDistance(e.coordinates,[t.lng,t.lat])<=.006:e.type==="LineString"?this.isCoordinateNearLine(e.coordinates,t,.004):e.type==="MultiLineString"?e.coordinates.some(n=>this.isCoordinateNearLine(n,t,.004)):!1:!1}isCoordinateNearLine(e,t,n){if(!Array.isArray(e)||e.length<2)return!1;const i=[t.lng,t.lat];for(let a=1;aa.some(o=>o.key===n||o.layerName===t));return(i==null?void 0:i[0])||""}getLayerQueryKey(e){return[(e==null?void 0:e.layerName)||"",(e==null?void 0:e.styles)||"",(e==null?void 0:e.cqlFilter)||"",(e==null?void 0:e.key)||""].join("|")}mergeBusinessProperties(e,t,n){const i=(n==null?void 0:n.key)||"";if(Object.entries(t||{}).forEach(([a,o])=>{o==null||o===""||(e[a]===void 0||e[a]===null||e[a]==="")&&(e[a]=o)}),i==="basic-grassland"){const a=(t==null?void 0:t.basic_type_name)||(t==null?void 0:t.grassland_category_name)||(t==null?void 0:t.land_class_name)||(t==null?void 0:t.land_use_name)||(t==null?void 0:t.base_grass);a!=null&&a!==""&&(e.basic_type_name=a)}if(i==="grassland-level"){const a=(t==null?void 0:t.grassland_level)||(t==null?void 0:t.level)||(t==null?void 0:t.grassland_level_name)||(t==null?void 0:t.level_name);a!=null&&a!==""&&(e.grassland_level=a)}if(i==="grassland-type"||i==="wetland-type"){const a=(t==null?void 0:t.grass_min_type)||(t==null?void 0:t.grass_type)||(t==null?void 0:t.grassland_type)||(t==null?void 0:t.type_name)||(t==null?void 0:t.type);a!=null&&a!==""&&(e.grass_min_type=a)}if(i==="grassland-yield"||i==="wetland-yield"){const a=(t==null?void 0:t.yield)||(t==null?void 0:t.xc_yield)||(t==null?void 0:t.xb_xc_yield)||(t==null?void 0:t.fresh_grass_yield)||(t==null?void 0:t.value),o=(t==null?void 0:t.mu_yield)||(t==null?void 0:t.xc_mu_yield)||(t==null?void 0:t.xb_xc_mu_yield)||(t==null?void 0:t.yield_per_mu);a!=null&&a!==""&&(e.fresh_grass_yield=a),o!=null&&o!==""&&(e.mu_yield=o)}if(i==="grassland-health"){const a=(t==null?void 0:t.health_level)||(t==null?void 0:t.health_level_name)||(t==null?void 0:t.ndvi_level)||(t==null?void 0:t.level)||(t==null?void 0:t.level_name),o=(t==null?void 0:t.ndvi)||(t==null?void 0:t.NDVI)||(t==null?void 0:t.value);a!=null&&a!==""&&(e.health_level=a),o!=null&&o!==""&&(e.ndvi=o);const s=(t==null?void 0:t.degradation_level)||(t==null?void 0:t.degradation_level_name)||(t==null?void 0:t.level)||(t==null?void 0:t.level_name);s!=null&&s!==""&&(e.degradation_level=s)}}getScreenPointFromEvent(e){var n;const t=((n=e==null?void 0:e.data)==null?void 0:n.originalEvent)||(e==null?void 0:e.originalEvent)||e;return(t==null?void 0:t.clientX)!==void 0&&(t==null?void 0:t.clientY)!==void 0?{x:t.clientX,y:t.clientY}:null}getLngLatFromEvent(e){var s,l,u;const n=(u=(((l=(s=this.interactionManager)==null?void 0:s.raycaster)==null?void 0:l.intersectObject(e.target,!1))||[])[0])==null?void 0:u.point;if(!n)return null;const i=this.focusMapGroup.worldToLocal(n.clone()),o=Ac().center(this.geoProjectionCenter).scale(this.geoProjectionScale).translate([0,0]).invert([i.x,-i.y]);return o?{lng:o[0],lat:o[1]}:null}lngLatToWmsPixel({lng:e,lat:t}){const n=(e-Mn.west)/(Mn.east-Mn.west)*fl.width,i=(Mn.north-t)/(Mn.north-Mn.south)*fl.height;return{x:n,y:i}}showSelectedFeature(e){var n;const t=(e==null?void 0:e.geometry)||((n=e==null?void 0:e.feature)==null?void 0:n.geometry);this.clearSelectedFeature(),this.createSelectedFeatureGroup(),this.addSelectedGeometry(t),this.selectedFeatureGroup.children.length||this.clearSelectedFeature()}showSelectedFeatures(e=[]){this.clearSelectedFeature(),this.createSelectedFeatureGroup(),e.forEach(t=>{var i;const n=(t==null?void 0:t.geometry)||((i=t==null?void 0:t.feature)==null?void 0:i.geometry);this.addSelectedGeometry(n)}),this.selectedFeatureGroup.children.length||this.clearSelectedFeature()}setSelectedVectorFeatures(e=[]){this.selectedVectorFeatures=[...e],this.redrawVectorTopicLayer()}addSelectedGeometry(e){if(!(e!=null&&e.coordinates)||!this.selectedFeatureGroup)return;const t=this.getDisplayFeaturePolygons(e),n=new Pn({color:16769370,transparent:!0,opacity:.5,side:ur,depthWrite:!1,fog:!1}),i=new ys({color:16777215,transparent:!0,opacity:.96,linewidth:2,depthTest:!1,fog:!1}),a=new ys({color:2422468,transparent:!0,opacity:.96,linewidth:3,depthTest:!1,fog:!1});t.length&&t.forEach(s=>{const l=this.createProjectedShape(s);if(!l)return;const u=new vg(l),c=new rn(u,n);c.renderOrder=35,this.selectedFeatureGroup.add(c),s.forEach(h=>{const f=this.createProjectedRingPoints(h);if(f.length<3)return;const d=new wn().setFromPoints(f),p=new O0(d,i);p.renderOrder=37,this.selectedFeatureGroup.add(p);const g=new wn().setFromPoints(f),v=new O0(g,a);v.renderOrder=36,v.scale.set(1.004,1.004,1),this.selectedFeatureGroup.add(v)})});const o=this.normalizeFeatureLineStrings(e);o.length&&o.forEach(s=>{const l=this.createProjectedRingPoints(s);if(l.length<2)return;const u=new wn().setFromPoints(l),c=new Mv(u,a);c.renderOrder=36,c.scale.set(1.004,1.004,1),this.selectedFeatureGroup.add(c);const h=new wn().setFromPoints(l),f=new Mv(h,i);f.renderOrder=37,this.selectedFeatureGroup.add(f)})}clearSelectedFeature(){var n,i,a;const e=!!((n=this.selectedVectorFeatures)!=null&&n.length);if(this.selectedVectorFeatures=[],e&&this.redrawVectorTopicLayer(),!this.selectedFeatureGroup)return;const t=new Set;for(;this.selectedFeatureGroup.children.length;){const o=this.selectedFeatureGroup.children.pop();(a=(i=o.geometry)==null?void 0:i.dispose)==null||a.call(i),Array.isArray(o.material)?o.material.forEach(s=>t.add(s)):t.add(o.material)}t.forEach(o=>{var s;return(s=o==null?void 0:o.dispose)==null?void 0:s.call(o)})}normalizeFeaturePolygons(e){return e!=null&&e.coordinates?e.type==="Polygon"?[e.coordinates]:e.type==="MultiPolygon"?e.coordinates:[]:[]}normalizeFeatureLineStrings(e){return e!=null&&e.coordinates?e.type==="LineString"?[e.coordinates]:e.type==="MultiLineString"?e.coordinates:[]:[]}getDisplayFeaturePolygons(e){const t=this.normalizeFeaturePolygons(e),n=this.getLayerClipBounds(this.currentTopicLayer);return n?t.map(i=>{const a=this.clipRingToBounds(i==null?void 0:i[0],n);if(a.length<3)return null;const o=i.slice(1).map(s=>this.clipRingToBounds(s,n)).filter(s=>s.length>=3);return[a,...o]}).filter(Boolean):t}clipRingToBounds(e=[],t){let n=e.map(a=>[Number(a==null?void 0:a[0]),Number(a==null?void 0:a[1])]).filter(([a,o])=>Number.isFinite(a)&&Number.isFinite(o));return[{inside:([a])=>a>=t.west,intersect:(a,o)=>this.getLngLatLineIntersection(a,o,"lng",t.west)},{inside:([a])=>a<=t.east,intersect:(a,o)=>this.getLngLatLineIntersection(a,o,"lng",t.east)},{inside:([,a])=>a>=t.south,intersect:(a,o)=>this.getLngLatLineIntersection(a,o,"lat",t.south)},{inside:([,a])=>a<=t.north,intersect:(a,o)=>this.getLngLatLineIntersection(a,o,"lat",t.north)}].forEach(a=>{const o=n;n=[],o.length&&o.forEach((s,l)=>{const u=o[(l+o.length-1)%o.length],c=a.inside(s),h=a.inside(u);c?(h||n.push(a.intersect(u,s)),n.push(s)):h&&n.push(a.intersect(u,s))})}),n}getLngLatLineIntersection(e,t,n,i){const a=n==="lng"?0:1,o=n==="lng"?1:0,s=t[a]-e[a];if(!s)return[...e];const l=(i-e[a])/s,u=[...e];return u[a]=i,u[o]=e[o]+(t[o]-e[o])*l,u}createProjectedShape(e){const t=e==null?void 0:e[0];if(!Array.isArray(t)||t.length<3)return null;const n=new Uo;return this.createProjectedRingPoints(t).forEach((a,o)=>{o===0?n.moveTo(a.x,a.y):n.lineTo(a.x,a.y)}),e.slice(1).forEach(a=>{const o=this.createProjectedRingPoints(a);if(o.length<3)return;const s=new Uo;o.forEach((l,u)=>{u===0?s.moveTo(l.x,l.y):s.lineTo(l.x,l.y)}),n.holes.push(s)}),n}createProjectedRingPoints(e){if(!Array.isArray(e))return[];const t=[];return e.forEach(n=>{if(!Array.isArray(n)||n.length<2)return;const i=Number(n[0]),a=Number(n[1]);if(!Number.isFinite(i)||!Number.isFinite(a))return;const[o,s]=this.geoProjection([i,a]);t.push(new X(o,-s,0))}),t}enhanceTexture(e){var n,i,a;const t=(i=(n=this.renderer)==null?void 0:n.instance)==null?void 0:i.capabilities;e.anisotropy=((a=t==null?void 0:t.getMaxAnisotropy)==null?void 0:a.call(t))||1,e.needsUpdate=!0}geoProjection(e){return Ac().center(this.geoProjectionCenter).scale(this.geoProjectionScale).translate([0,0])(e)}update(){super.update(),this.interactionManager&&this.interactionManager.update()}destroy(){this.callbacks={},this.clearSelectedFeature(),super.destroy(),this.label3d&&this.label3d.destroy()}}const Fte={class:"map"},yg={__name:"map",props:{activeLayer:{type:Object,default:null},mapRanking:{type:Object,default:null}},emits:["feature-loading","feature-info","layer-status"],setup(r,{expose:e,emit:t}){const n=r,i=t,a=tt(null),o=Ap(null);uo(()=>{h()});function s(f){o.value||!a.value||(o.value=new Ote(a.value,f,{onFeatureLoading:d=>i("feature-loading",d),onFeatureInfo:d=>i("feature-info",d),onLayerStatus:d=>i("layer-status",d)}),o.value.time.pause(),n.activeLayer&&o.value.setTopicLayer(n.activeLayer),o.value.setTownRanking(n.mapRanking))}function l(){return Ge(this,null,function*(){o.value&&(o.value.time.resume(),o.value.animateTl.timeScale(1),o.value.animateTl.play())})}function u(){var f,d;(d=(f=o.value)==null?void 0:f.clearSelectedFeature)==null||d.call(f)}function c(f){var d,p;(p=(d=o.value)==null?void 0:d.focusProject)==null||p.call(d,f)}function h(){var f,d;(d=(f=o.value)==null?void 0:f.destroy)==null||d.call(f),o.value=null}return ni(()=>n.activeLayer,f=>{o.value&&f&&o.value.setTopicLayer(f)},{deep:!0}),ni(()=>n.mapRanking,f=>{o.value&&o.value.setTownRanking(f)},{deep:!0}),e({loadMap:s,play:l,clearSelectedFeature:u,focusProject:c,destroyMap:h,canvasMap:o}),(f,d)=>(ie(),oe("div",Fte,[G("canvas",{ref_key:"canvasRef",ref:a},null,512)]))}};const Bte={key:0,class:"business-stat-empty"},zte={class:"business-stat-rank"},Ute={class:"business-stat-main"},Vte={class:"business-stat-name"},Gte={class:"business-stat-bar"},Hte={class:"business-stat-value"},Wte={key:0},MD={__name:"BusinessStatList",props:{rows:{type:Array,default:()=>[]},compact:{type:Boolean,default:!1}},setup(r){const e=r,t=Se(()=>{const i=e.rows.map(a=>Number(a.value)).filter(a=>!Number.isNaN(a));return Math.max(...i,1)});function n(i){const a=Number(i.value);return Number.isNaN(a)?36:Math.max(8,Math.round(a/t.value*100))}return(i,a)=>(ie(),oe("div",{class:Vt(["business-stat-list",{"is-compact":r.compact,"is-dense":r.rows.length>10}])},[r.rows.length?Tt("",!0):(ie(),oe("div",Bte,"暂无业务统计数据")),(ie(!0),oe(it,null,vt(r.rows,(o,s)=>(ie(),oe("div",{key:o.key||o.name,class:"business-stat-row"},[G("div",zte,Te(s+1),1),G("div",Ute,[G("div",Vte,Te(o.name),1),G("div",Gte,[G("span",{style:un({width:`${n(o)}%`})},null,4)])]),G("div",Hte,[G("strong",null,Te(o.value),1),G("em",null,Te(o.unit),1),o.extra?(ie(),oe("span",Wte,Te(o.extra),1)):Tt("",!0)])]))),128))],2))}},$te=""+new URL("ring2-a1b91808-balabala-1782613078975.png",import.meta.url).href,Xte=""+new URL("ring3-fe0f60d7-balabala-1782613078975.png",import.meta.url).href,Yte=""+new URL("ring4-f2e324d6-balabala-1782613078975.png",import.meta.url).href;const qte={name:"ThreePie",props:{data:{type:Array,default:()=>[]},colors:{type:Array,default:()=>[2161326,15380744,3122407,65535,16536624]},opacity:{type:Number,default:.5},delay:{type:Number,default:5e3},loopComplete:{type:Function,default:()=>{}}},computed:{currentData(){return Xe(Re({},this.data[this.activeIndex]),{count:this.count})}},data(){return this.scene=null,this.camera=null,this.renderer=null,this.controls=null,this.axes=null,this.pieGroup=new Dn,{width:300,height:200,activeIndex:0,count:0,timer:null}},mounted(){this.width=this.$refs.pieDom.offsetWidth,this.height=this.$refs.pieDom.offsetHeight,this.count=this.data.map(r=>r.value).reduce((r,e)=>r+e,0),this.init()},beforeUnmount(){clearInterval(this.timer),this.destroy()},methods:{init(){this.scene=new Dz,this.initCamera(),this.initRenderer(),this.initLight(),this.initAxes(),this.initControls(),this.createPlane({url:$te,width:5,position:new X(0,0,-.01),color:"#00ffff"}),this.createPlane({url:Xte,width:6.5,position:new X(0,0,-.02),color:"#00ffff"}),this.createPlane({url:Yte,width:5.5,position:new X(0,0,-.03),animate:!0,color:"#00ffff"}),this.createPie(),this.loop()},createPlane(r){let e={url:"texture/ring1.png",width:5.5,z:0,position:new X(0,0,0),animate:!1,color:null},t=Object.assign(e,r);const n=new Za(t.width,t.width),i=new Pn({map:this.getTexture(t.url),transparent:!0,side:ur,depthTest:!1});t.color&&(i.color=new nt(t.color));const a=new rn(n,i);a.position.copy(t.position),a.rotation.x=-1*Math.PI/2,t.animate&&$n.to(a.rotation,{z:2*Math.PI,repeat:-1,ease:"none",duration:3}),this.scene.add(a)},getTexture(r){const e=new AC().load(r);return e.wrapS=e.wrapT=jr,e},createPie(){let r=0,e=0;for(var t=0;t{this.loopChange()},this.delay)},loopChange(){let r=this.activeIndex+1;r>=this.data.length&&(r=0,this.loopComplete&&this.loopComplete()),this.chooseRing(r)},chooseRing(r=0,e=!1){let t=r-1<0?this.data.length-1:r-1,n=this.pieGroup.children[t];this.prevMesh=n,this.activeIndex=r;let i=this.pieGroup.children[r];e||($n.to(n.scale,{z:1}),$n.to(n.material,{opacity:this.opacity})),$n.to(i.scale,{z:2}),$n.to(i.material,{opacity:.8})},addRing(r={}){let e={innerRadius:1.5,outerRadius:2,thickness:.5,startAngle:0,endAngle:Math.PI/2,color:65535,segments:120},t=Object.assign(e,r),n=new Uo;n.arc(0,0,t.outerRadius,t.startAngle,t.endAngle);let i=n.getPoints(t.segments),a=new Uo;a.arc(0,0,t.innerRadius,t.endAngle,t.startAngle,!0);let o=a.getPoints(t.segments),s=new Uo(i.concat(o));const l={steps:1,depth:t.thickness,bevelEnabled:!0,bevelThickness:0,bevelSize:0,bevelOffset:0,bevelSegments:0},u=new r1(s,l);let c=new Lb({color:t.color,transparent:!0,opacity:this.opacity,side:ur});const h=new rn(u,c.clone());return h.renderOrder=10,h.rotation.x=-1*Math.PI/2,h},initCamera(){var r=this.width/this.height;this.camera=new Qr(30,r,.1,1500),this.camera.position.set(6.023813305272227,4.838542633695233,6.111272698256137),this.camera.lookAt(0,0,0)},initRenderer(){this.renderer=new fC({antialias:!0,alpha:!0}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(this.width,this.height),this.$refs.pieDom.appendChild(this.renderer.domElement)},initLight(){let r=new B0(16777215,2);r.position.set(200,300,200);let e=new B0(16777215,2);e.position.set(-200,-300,-200);let t=new qz(16777215,2);this.scene.add(r),this.scene.add(e),this.scene.add(t)},initAxes(){this.axes=new jz(0),this.scene.add(this.axes)},initControls(){this.controls=new rU(this.camera,this.renderer.domElement),this.controls.maxPolarAngle=Math.PI,this.controls.autoRotate=!1,this.controls.enableDamping=!0,this.controls.enabled=!1},loop(){this.renderer.setAnimationLoop(()=>{this.renderer.render(this.scene,this.camera),this.controls&&this.controls.update()})},start(){this.loop(),this.controls.enabled=!0,this.timer=setInterval(()=>{this.loopChange()},this.delay)},stop(){clearInterval(this.timer),this.controls&&(this.controls.enabled=!1),this.renderer&&this.renderer.setAnimationLoop(null)},getScene(){return this.scene},getRender(){return this.renderer},resize(){this.width=this.$refs.pieDom.offsetWidth,this.height=this.$refs.pieDom.offsetHeight;let r=this.width/this.height;this.camera.aspect=r,this.camera.updateProjectionMatrix(),this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio)},destroy(){this.prevMesh&&($n.set(this.prevMesh.scale,{z:1}),$n.set(this.prevMesh.material,{opacity:this.opacity})),this.stop(),window.removeEventListener("resize",()=>{this.resize()}),this.renderer&&(hee(this.pieGroup),this.renderer.dispose(),this.renderer.forceContextLoss(),this.controls.dispose(),this.$refs.pieDom.innerHTML="",this.scene=null,this.camera=null,this.renderer=null,this.controls=null,this.axes=null)}}},jte={class:"three-pie-wrap"},Kte={class:"three-pie",ref:"pieDom"},Zte={class:"three-pie-slot"};function Qte(r,e,t,n,i,a){return ie(),oe("div",jte,[G("div",Kte,null,512),G("div",Zte,[Df(r.$slots,"default",{data:a.currentData})])])}const Jte=OM(qte,[["render",Qte]]);const ene={key:0,class:"business-panel-empty"},tne={key:2,class:"business-metrics"},nne={key:3,class:"business-icon-metrics"},rne={class:"business-icon-metric-copy"},ine={key:0},ane={key:4,class:"business-spotlight"},one={class:"business-spotlight-main"},sne={class:"business-spotlight-side"},lne={key:0},une={key:1,class:"business-panel-empty"},cne={key:0,class:"business-ring-visual"},hne={class:"business-ring-inner"},fne={key:1,class:"business-donut-visual"},dne={class:"business-three-pie-center"},pne={class:"business-donut-legend"},vne={key:1,class:"business-panel-empty"},gne={key:6,class:"business-structure"},mne={class:"business-structure-overview"},yne={class:"business-structure-band"},_ne=["title"],xne={class:"business-structure-list"},Sne={key:1,class:"business-panel-empty"},Ane={key:7,class:"business-capacity"},wne={class:"business-capacity-head"},bne={class:"business-capacity-band"},Tne=["title"],Mne={class:"business-capacity-list"},Cne={key:0,class:"business-capacity-town"},Ene={key:1,class:"business-panel-empty"},Lne={class:"business-bar-name"},Pne={class:"business-bar-track"},Rne={key:0},Dne={key:1},Ine={class:"business-column-track"},Nne={key:10,class:"business-project-table"},kne={class:"business-project-search"},One={class:"business-project-frame"},Fne=["onClick","onKeydown"],Bne=["title"],zne={key:0},Une={key:0,class:"business-project-empty"},Vne={class:"business-table-head"},Gne={class:"business-table-body"},Hne={class:"business-table-name"},Wne={class:"business-table-value"},$ne={key:0},Xne={class:"business-stack-legend"},Yne={class:"business-stack-chart"},qne={class:"business-stack-track"},jne={key:14,class:"business-line"},Kne={viewBox:"0 0 320 86",preserveAspectRatio:"none","aria-hidden":"true"},Zne=["points"],Qne=["points"],Jne=["cx","cy"],ere=["cx","cy","onMouseenter"],tre=["onMouseenter"],nre={key:0},rre={key:15,class:"business-heat"},ire={key:0},are={class:"business-split-band"},ore={class:"business-split-list"},CD=3e3,Si={__name:"BusinessPanelRenderer",props:{panel:{type:Object,default:()=>({rows:[]})},compact:{type:Boolean,default:!1}},emits:["row-select"],setup(r,{emit:e}){const t=r,n=e,i=["#24f6c4","#32dcff","#ffe06b","#7ee269","#ff9a62","#9ea7ff"],a=Se(()=>{var J;return((J=t.panel)==null?void 0:J.type)||"rank"}),o=Se(()=>{var J;return(((J=t.panel)==null?void 0:J.rows)||[]).filter(ue=>ue==null?void 0:ue.name)}),s=Se(()=>o.value.map(J=>Xe(Re({},J),{value:re(J)})).filter(J=>J.value>0)),l=Se(()=>o.value.map(J=>re(J)).filter(J=>J>0)),u=Se(()=>Math.max(...l.value,1)),c=Se(()=>l.value.reduce((J,ue)=>J+ue,0)),h=Se(()=>o.value.filter(J=>re(J)>0)),f=Se(()=>o.value.filter(J=>re(J)>0)),d=Se(()=>f.value),p=Se(()=>o.value.filter(J=>re(J)>0)),g=Se(()=>f.value.slice(0,6)),v=Se(()=>{var J;return((J=t.panel)==null?void 0:J.segments)||[]}),m=Se(()=>o.value.filter(J=>be(J)>0)),y=tt(""),_=tt(null),x=Se(()=>{const J=te(y.value);return J?o.value.filter(ue=>te(ue.searchText||[ue.name,ue.projectName,ue.category,ue.year,ue.measure,ue.townships,ue.metric].filter(Boolean).join(" ")).includes(J)):o.value}),S=Se(()=>o.value.find(J=>["forage-total","wetland-yield-total"].includes(J.key))||o.value[0]),A=Se(()=>o.value.filter(J=>["forage-edible","forage-unavailable","wetland-yield-edible","wetland-yield-unavailable"].includes(J.key))),w=Se(()=>o.value.find(J=>["forage-top-town","wetland-yield-top-town"].includes(J.key))),M=tt(0),C=tt(null);let b=null;const T=Se(()=>{var J,ue;return`${((J=t.panel)==null?void 0:J.key)||((ue=t.panel)==null?void 0:ue.title)||"pie"}-${s.value.map(Ie=>`${Ie.name}:${Ie.value}`).join("|")}`}),P=Se(()=>{const J=D.value;return J?M.value%J:0}),D=Se(()=>{var J;return a.value==="structure"?p.value.length:a.value==="donut"?s.value.length:a.value==="bar"&&((J=t.panel)==null?void 0:J.variant)==="capacity"?A.value.length:a.value==="bar"||a.value==="column"?f.value.length:a.value==="table"?d.value.length:a.value==="line"?f.value.length:a.value==="split"?h.value.length:0}),L=Se(()=>s.value[P.value]||s.value[0]);Se(()=>p.value[P.value]||p.value[0]);const E=Se(()=>o.value[0]),I=Se(()=>o.value.slice(0,4).map((J,ue)=>Xe(Re({},J),{icon:xt(J,ue)}))),N=Se(()=>p.value.map((J,ue)=>Xe(Re({},J),{displayIndex:ue}))),R=Se(()=>{var J;return a.value!=="donut"?"standard":((J=t.panel)==null?void 0:J.variant)==="ring"?"ring":"three"}),F=Se(()=>{if(!s.value.length)return{};const J=c.value||1;let ue=-90;return{"--ring-gradient":`conic-gradient(${s.value.map((j,Ee)=>{const Ue=re(j)/J*360,et=ue,Y=ue+Ue;return ue=Y,`${Ye(Ee)} ${et}deg ${Y}deg`}).join(", ")})`,"--ring-active-color":Ye(P.value)}});Ko(()=>{Le()}),uo(()=>{Wt()}),ni(()=>{var J;return[(J=t.panel)==null?void 0:J.key,o.value.length]},()=>{M.value=0,C.value=null,y.value="",_.value=null,Le()});const O=Se(()=>{const J=f.value,ue=320,Ie=66,j=10,Ee=J.length>1?ue/(J.length-1):ue,Ue=J.map(q=>re(q)).filter(q=>q>0),et=Ue.length?Math.min(...Ue):0,Y=Ue.length?Math.max(...Ue):1,De=Math.max(Y-et,Y*.08,1);return J.map((q,Ce)=>{const st=re(q);return{x:Math.round(Ce*Ee),y:Math.round(j+Ie-(st-et)/De*Ie),item:q}})}),V=Se(()=>O.value.map(J=>`${J.x},${J.y}`).join(" ")),H=Se(()=>O.value.length?`0,86 ${V.value} 320,86`:""),Q=Se(()=>f.value),W=Se(()=>({gridTemplateColumns:`repeat(${Math.max(Q.value.length,1)}, minmax(0, 1fr))`})),Z=Se(()=>Number.isInteger(C.value)?O.value[C.value]:null),ee=Se(()=>O.value.length?Number.isInteger(C.value)?C.value:P.value:0),he=Se(()=>Z.value?Z.value:O.value[ee.value]||O.value[0]),le=Se(()=>{const J=he.value;if(!J)return{};const ue=J.x/320*100,Ie=J.y/86*100,j=J.y<42;return{left:`${Math.min(84,Math.max(16,ue))}%`,top:`${Ie}%`,transform:j?"translate(-50%, 10px)":"translate(-50%, calc(-100% - 8px))"}});function re(J){const ue=Number(J==null?void 0:J.value);if(!Number.isNaN(ue)&&ue>0)return ue;const Ie=Number(J==null?void 0:J.percent);return Number.isNaN(Ie)?0:Ie}function be(J){const ue=(J==null?void 0:J.segments)||(J==null?void 0:J.values)||{};return v.value.reduce((Ie,j)=>Ie+(Number(ue[j.key])||0),0)}function de(J){const ue=be(J),Ie=(J==null?void 0:J.segments)||(J==null?void 0:J.values)||{};return ue?v.value.map(j=>{const Ee=Number(Ie[j.key])||0;return Xe(Re({},j),{value:Ee,percent:Math.max(Ee>0?3:0,Ee/ue*100)})}):[]}function U(J){const ue=Number(J);return Number.isNaN(ue)?"--":Number.isInteger(ue)?`${ue}`:`${Number(ue.toFixed(2))}`}function K(J){return(J==null?void 0:J.displayValue)!==void 0&&(J==null?void 0:J.displayValue)!==null&&(J==null?void 0:J.displayValue)!==""?J.displayValue:(J==null?void 0:J.value)===void 0||(J==null?void 0:J.value)===null||(J==null?void 0:J.value)===""?"--":U(J.value)}function te(J){return String(J||"").trim().toLowerCase()}function ce(J){_.value=(J==null?void 0:J.key)||(J==null?void 0:J.name)||null,n("row-select",J)}function se(J){const ue=Number(J==null?void 0:J.scaleValue);if(!Number.isNaN(ue)&&ue>0)return Math.max(8,Math.min(100,Math.round(ue)));const Ie=re(J);return Ie?Math.max(8,Math.round(Ie/u.value*100)):8}function Ne(J,ue){const Ie=se(J),j=Math.max(.14,Math.min(.46,Ie/180));return{"--heat-color":Ye(ue),"--heat-bg":Oe(Ye(ue),j)}}function Oe(J,ue=.2){const Ie=String(J||"").replace("#","");if(Ie.length!==6)return`rgba(48, 220, 255, ${ue})`;const j=parseInt(Ie,16),Ee=j>>16&255,Ue=j>>8&255,et=j&255;return`rgba(${Ee}, ${Ue}, ${et}, ${ue})`}function B(J){const ue=O.value.length;if(!ue)return;const Ie=J.currentTarget.getBoundingClientRect(),j=Ie.width?(J.clientX-Ie.left)/Ie.width:0,Ee=Math.min(ue-1,Math.max(0,Math.round(j*(ue-1))));C.value=Ee}function z(J){const ue=re(J);return!c.value||!ue?0:Math.max(6,ue/c.value*100)}function ne(J){const ue=re(J);return!c.value||!ue?0:Math.max(2,ue/c.value*100)}function ve(J){if(!J)return"--";if(J.extra)return J.extra;const ue=re(J);return!c.value||!ue?"--":`${U(ue/c.value*100)}%`}function Ae(){const J=re(S.value);return J>0?J:A.value.reduce((ue,Ie)=>ue+re(Ie),0)}function we(J){const ue=Ae(),Ie=re(J);return!ue||!Ie?0:Math.max(6,Ie/ue*100)}function We(J){const ue=Ae(),Ie=re(J);return!ue||!Ie?"--":`${U(Ie/ue*100)}%`}function Be(J,ue){return["forage-edible","wetland-yield-edible"].includes(J==null?void 0:J.key)?"#24f6c4":["forage-unavailable","wetland-yield-unavailable"].includes(J==null?void 0:J.key)?"#ffe06b":Ye(ue)}function je(J){const ue=re(J),Ie=Number(J==null?void 0:J.count)||c.value;return!ue||!Ie?"0%":`${U(ue/Ie*100)}%`}function Ye(J){return i[J%i.length]}function xt(J,ue){if(J!=null&&J.icon)return String(J.icon).replace(/[^a-z0-9-]/gi,"");const Ie=String((J==null?void 0:J.name)||"");return Ie.includes("退化率")||Ie.includes("利用率")||Ie.includes("占比")?"rate":Ie.includes("重度")||Ie.includes("退化")?"risk":Ie.includes("可食")||Ie.includes("供给")?"leaf":Ie.includes("不可")?"stack":Ie.includes("产量")||Ie.includes("鲜草")?"yield":Ie.includes("乡镇")?"town":Ie.includes("面积")?"area":["yield","leaf","rate","risk"][ue%4]}function Le(){Wt();const J=D.value;J<2||(b=window.setInterval(()=>{M.value=(M.value+1)%J},CD))}function Wt(){b&&(window.clearInterval(b),b=null)}function Ct(J){return`linear-gradient(90deg, rgba(36, 246, 196, 0.18), ${Ye(J)})`}function _t(J){return`linear-gradient(180deg, ${Ye(J)}, rgba(50, 220, 255, 0.12))`}return(J,ue)=>{var Ie,j,Ee,Ue,et,Y,De;return ie(),oe("div",{class:Vt(["business-panel",[`is-${a.value}`,`is-${R.value}`,{"is-compact":r.compact}]])},[o.value.length?a.value==="rank"?(ie(),Ji(MD,{key:1,rows:o.value,compact:""},null,8,["rows"])):a.value==="metric"?(ie(),oe("div",tne,[(ie(!0),oe(it,null,vt(o.value.slice(0,4),q=>(ie(),oe("div",{key:q.key||q.name,class:"business-metric-item"},[G("span",null,Te(q.name),1),G("strong",null,Te(K(q)),1),G("em",null,Te(q.unit),1)]))),128))])):a.value==="iconMetric"?(ie(),oe("div",nne,[(ie(!0),oe(it,null,vt(I.value,(q,Ce)=>(ie(),oe("div",{key:q.key||q.name,class:Vt(["business-icon-metric-item",`is-tone-${Ce%i.length}`])},[G("i",{class:Vt(["business-icon-metric-mark",`is-${q.icon}`])},[...ue[2]||(ue[2]=[G("span",null,null,-1)])],2),G("div",rne,[G("span",null,Te(q.name),1),G("strong",null,[Zn(Te(K(q)),1),q.unit?(ie(),oe("em",ine,Te(q.unit),1)):Tt("",!0)])])],2))),128))])):a.value==="spotlight"?(ie(),oe("div",ane,[E.value?(ie(),oe(it,{key:0},[G("div",one,[G("span",null,Te(E.value.name),1),G("strong",null,[Zn(Te(K(E.value)),1),G("em",null,Te(E.value.unit),1)]),G("small",null,Te(E.value.extra||((Ie=r.panel)==null?void 0:Ie.note)||"核心业务指标"),1)]),G("div",sne,[(ie(!0),oe(it,null,vt(o.value.slice(1,4),(q,Ce)=>(ie(),oe("div",{key:q.key||q.name,class:"business-spotlight-chip"},[G("i",{style:un({borderColor:Ye(Ce+1)})},null,4),G("span",null,Te(q.name),1),G("strong",null,[Zn(Te(K(q)),1),G("em",null,Te(q.unit),1)]),q.extra?(ie(),oe("small",lne,Te(q.extra),1)):Tt("",!0)]))),128))])],64)):(ie(),oe("div",une,"暂无业务统计数据"))])):a.value==="donut"?(ie(),oe("div",{key:5,class:Vt(["business-donut",[`is-variant-${R.value}`,{"is-dense":s.value.length>5}]])},[s.value.length?(ie(),oe(it,{key:0},[R.value==="ring"?(ie(),oe("div",cne,[G("div",{class:"business-ring-core",style:un(F.value)},[ue[3]||(ue[3]=G("div",{class:"business-ring-orbit"},null,-1)),G("div",hne,[G("strong",null,Te(je(L.value)),1),G("span",null,Te(((j=L.value)==null?void 0:j.name)||"结构占比"),1)])],4)])):(ie(),oe("div",fne,[(ie(),Ji(Jte,{key:T.value,data:s.value,delay:CD,colors:i,opacity:.62,class:"business-three-pie"},{default:Xt(({data:q})=>[G("div",dne,[G("strong",null,Te(je(q)),1),G("span",null,Te((q==null?void 0:q.name)||"结构占比"),1)])]),_:1},8,["data"]))])),G("div",pne,[(ie(!0),oe(it,null,vt(s.value,(q,Ce)=>(ie(),oe("div",{key:q.key||q.name,class:Vt(["business-donut-row",{"is-active":Ce===P.value}])},[G("i",{style:un({borderColor:Ye(Ce)})},null,4),G("span",null,Te(q.name),1),G("strong",null,Te(K(q)),1),G("em",null,Te(q.unit),1)],2))),128))])],64)):(ie(),oe("div",vne,"暂无业务统计数据"))],2)):a.value==="structure"?(ie(),oe("div",gne,[p.value.length?(ie(),oe(it,{key:0},[G("div",mne,[G("div",yne,[(ie(!0),oe(it,null,vt(p.value,(q,Ce)=>(ie(),oe("i",{key:q.key||q.name,class:Vt({"is-active":Ce===P.value}),style:un({width:`${ne(q)}%`,background:Ye(Ce),color:Ye(Ce)}),title:`${q.name}:${K(q)}${q.unit||""} ${ve(q)}`},null,14,_ne))),128))])]),G("div",xne,[(ie(!0),oe(it,null,vt(N.value,q=>(ie(),oe("div",{key:q.key||q.name,class:Vt(["business-structure-row",{"is-active":q.displayIndex===P.value}])},[G("i",{style:un({background:Ye(q.displayIndex),color:Ye(q.displayIndex)})},null,4),G("span",null,Te(q.name),1),G("strong",null,[Zn(Te(K(q)),1),G("em",null,Te(q.unit),1)]),G("small",null,Te(ve(q)),1)],2))),128))])],64)):(ie(),oe("div",Sne,"暂无业务统计数据"))])):a.value==="bar"&&((Ee=r.panel)==null?void 0:Ee.variant)==="capacity"?(ie(),oe("div",Ane,[S.value?(ie(),oe(it,{key:0},[G("div",wne,[G("span",null,Te(S.value.name),1),G("strong",null,[Zn(Te(K(S.value)),1),G("em",null,Te(S.value.unit),1)])]),G("div",bne,[(ie(!0),oe(it,null,vt(A.value,(q,Ce)=>(ie(),oe("i",{key:q.key||q.name,class:Vt({"is-active":Ce===P.value}),style:un({width:`${we(q)}%`,background:Be(q,Ce),color:Be(q,Ce)}),title:`${q.name}:${K(q)}${q.unit||""} ${We(q)}`},null,14,Tne))),128))]),G("div",Mne,[(ie(!0),oe(it,null,vt(A.value,(q,Ce)=>(ie(),oe("div",{key:q.key||q.name,class:Vt(["business-capacity-row",{"is-active":Ce===P.value}])},[G("i",{style:un({background:Be(q,Ce),color:Be(q,Ce)})},null,4),G("span",null,Te(q.name),1),G("strong",null,[Zn(Te(K(q)),1),G("em",null,Te(q.unit),1)]),G("small",null,Te(We(q)),1)],2))),128))]),w.value?(ie(),oe("div",Cne,[G("span",null,Te(w.value.name),1),G("strong",null,[Zn(Te(K(w.value)),1),G("em",null,Te(w.value.unit),1)])])):Tt("",!0)],64)):(ie(),oe("div",Ene,"暂无业务统计数据"))])):a.value==="bar"?(ie(),oe("div",{key:8,class:Vt(["business-bars",{"is-dense":f.value.length>=5,"is-long":f.value.length>10,"is-single":((Ue=r.panel)==null?void 0:Ue.span)===1,"is-distribution":((et=r.panel)==null?void 0:et.variant)==="distribution","is-capacity":((Y=r.panel)==null?void 0:Y.variant)==="capacity"}])},[(ie(!0),oe(it,null,vt(f.value,(q,Ce)=>(ie(),oe("div",{key:q.key||q.name,class:Vt(["business-bar-row",{"is-active":Ce===P.value}])},[G("span",Lne,Te(q.name),1),G("div",Pne,[G("i",{style:un({width:`${se(q)}%`,background:Ct(Ce)})},null,4)]),G("strong",null,[Zn(Te(K(q))+" ",1),q.unit?(ie(),oe("em",Rne,Te(q.unit),1)):Tt("",!0),q.extra?(ie(),oe("small",Dne,Te(q.extra),1)):Tt("",!0)])],2))),128))],2)):a.value==="column"?(ie(),oe("div",{key:9,class:Vt(["business-columns",[`is-variant-${((De=r.panel)==null?void 0:De.variant)||"solid"}`,{"is-dense":f.value.length>6}]])},[(ie(!0),oe(it,null,vt(f.value,(q,Ce)=>(ie(),oe("div",{key:q.key||q.name,class:Vt(["business-column-item",{"is-active":Ce===P.value}])},[G("strong",null,Te(K(q)),1),G("div",Ine,[G("i",{style:un({height:`${se(q)}%`,background:_t(Ce),"--column-load-delay":`${Ce*.075}s`})},null,4)]),G("span",null,Te(q.name),1)],2))),128))],2)):a.value==="projectTable"?(ie(),oe("div",Nne,[G("div",kne,[ul(G("input",{"onUpdate:modelValue":ue[0]||(ue[0]=q=>y.value=q),type:"search",placeholder:"搜索项目"},null,512),[[JB,y.value]])]),G("div",One,[G("table",null,[ue[4]||(ue[4]=G("colgroup",null,[G("col",{class:"business-project-col-name"}),G("col",{class:"business-project-col-year"}),G("col",{class:"business-project-col-category"}),G("col",{class:"business-project-col-scale"})],-1)),ue[5]||(ue[5]=G("thead",null,[G("tr",null,[G("th",null,"项目名称"),G("th",null,"年份"),G("th",null,"类型"),G("th",null,"规模")])],-1)),G("tbody",null,[(ie(!0),oe(it,null,vt(x.value,q=>(ie(),oe("tr",{key:q.key||q.name,class:Vt({"is-active":_.value===(q.key||q.name)}),tabindex:"0",onClick:Ce=>ce(q),onKeydown:[Kw(Nc(Ce=>ce(q),["prevent"]),["enter"]),Kw(Nc(Ce=>ce(q),["prevent"]),["space"])]},[G("td",{class:"business-project-name",title:q.name},Te(q.name),9,Bne),G("td",null,Te(q.year||"未知"),1),G("td",null,Te(q.category||"--"),1),G("td",null,[G("strong",null,[Zn(Te(K(q)),1),q.unit?(ie(),oe("em",zne,Te(q.unit),1)):Tt("",!0)])])],42,Fne))),128))])]),x.value.length?Tt("",!0):(ie(),oe("div",Une,"无匹配项目"))])])):a.value==="table"?(ie(),oe("div",{key:11,class:Vt(["business-table",{"is-dense":d.value.length>8}])},[G("div",Vne,[(ie(),oe(it,null,vt(2,q=>G("div",{key:q,class:"business-table-head-group"},[...ue[6]||(ue[6]=[G("span",null,"乡镇",-1),G("span",null,"亩产",-1)])])),64))]),G("div",Gne,[(ie(!0),oe(it,null,vt(d.value,(q,Ce)=>(ie(),oe("div",{key:q.key||q.name,class:Vt(["business-table-row",{"is-active":Ce===P.value}])},[G("span",Hne,Te(q.name),1),G("div",Wne,[G("strong",null,[Zn(Te(K(q)),1),q.unit?(ie(),oe("em",$ne,Te(q.unit),1)):Tt("",!0)]),G("i",null,[G("b",{style:un({width:`${se(q)}%`,background:Ct(Ce)})},null,4)])])],2))),128))])],2)):a.value==="stackColumn"?(ie(),oe("div",{key:12,class:Vt(["business-stack-columns",{"is-dense":m.value.length>6}])},[G("div",Xne,[(ie(!0),oe(it,null,vt(v.value,(q,Ce)=>(ie(),oe("span",{key:q.key||q.name},[G("i",{style:un({background:Ye(Ce)})},null,4),Zn(Te(q.name),1)]))),128))]),G("div",Yne,[(ie(!0),oe(it,null,vt(m.value,q=>(ie(),oe("div",{key:q.key||q.name,class:"business-stack-item"},[G("div",qne,[(ie(!0),oe(it,null,vt(de(q),(Ce,st)=>(ie(),oe("i",{key:Ce.key||Ce.name,style:un({height:`${Ce.percent}%`,background:Ye(st)})},null,4))),128))]),G("span",null,Te(q.name),1)]))),128))])],2)):a.value==="peak"?(ie(),oe("div",{key:13,class:Vt(["business-peaks",{"is-dense":f.value.length>5}])},[(ie(!0),oe(it,null,vt(f.value,(q,Ce)=>(ie(),oe("div",{key:q.key||q.name,class:"business-peak-item",style:un({"--peak-height":`${se(q)}%`,"--peak-color":Ye(Ce)})},[G("strong",null,Te(K(q)),1),ue[7]||(ue[7]=G("div",{class:"business-peak-stage"},[G("i")],-1)),G("span",null,Te(q.name),1)],4))),128))],2)):a.value==="line"?(ie(),oe("div",jne,[G("div",{class:"business-line-chart",onMousemove:B,onMouseleave:ue[1]||(ue[1]=q=>C.value=null)},[(ie(),oe("svg",Kne,[ue[8]||(ue[8]=G("path",{class:"business-line-grid",d:"M0 18H320M0 44H320M0 70H320"},null,-1)),G("polyline",{class:"business-line-area",points:H.value},null,8,Zne),G("polyline",{class:"business-line-stroke",points:V.value},null,8,Qne),(ie(!0),oe(it,null,vt(O.value,(q,Ce)=>(ie(),oe("circle",{key:Ce,cx:q.x,cy:q.y,r:"3",class:Vt(["business-line-dot",{"is-active":Ce===ee.value}])},null,10,Jne))),128)),(ie(!0),oe(it,null,vt(O.value,(q,Ce)=>(ie(),oe("circle",{key:`hit-${Ce}`,cx:q.x,cy:q.y,r:"13",class:"business-line-hit",onMouseenter:st=>C.value=Ce},null,40,ere))),128))])),G("div",{class:"business-line-hover-zones",style:un(W.value)},[(ie(!0),oe(it,null,vt(O.value,(q,Ce)=>(ie(),oe("i",{key:`zone-${Ce}`,onMouseenter:st=>C.value=Ce},null,40,tre))),128))],4),he.value?(ie(),oe("div",{key:0,class:"business-line-tooltip",style:un(le.value)},[G("span",null,Te(he.value.item.name),1),G("strong",null,[Zn(Te(K(he.value.item)),1),he.value.item.unit?(ie(),oe("em",nre,Te(he.value.item.unit),1)):Tt("",!0)])],4)):Tt("",!0)],32),G("div",{class:"business-line-labels",style:un(W.value)},[(ie(!0),oe(it,null,vt(Q.value,q=>(ie(),oe("span",{key:q.key||q.name},Te(q.name),1))),128))],4)])):a.value==="heat"?(ie(),oe("div",rre,[(ie(!0),oe(it,null,vt(g.value,(q,Ce)=>(ie(),oe("div",{key:q.key||q.name,class:"business-heat-cell",style:un(Ne(q,Ce))},[ue[9]||(ue[9]=G("i",null,null,-1)),G("span",null,Te(q.name),1),G("strong",null,[Zn(Te(K(q)),1),q.unit?(ie(),oe("em",ire,Te(q.unit),1)):Tt("",!0)])],4))),128))])):a.value==="split"?(ie(),oe("div",{key:16,class:Vt(["business-split",{"is-dense":h.value.length>10}])},[G("div",are,[(ie(!0),oe(it,null,vt(h.value,(q,Ce)=>(ie(),oe("i",{key:q.key||q.name,style:un({width:`${z(q)}%`,background:Ye(Ce)})},null,4))),128))]),G("div",ore,[(ie(!0),oe(it,null,vt(h.value,(q,Ce)=>(ie(),oe("div",{key:q.key||q.name,class:"business-split-row"},[G("span",null,[G("i",{style:un({background:Ye(Ce)})},null,4),Zn(Te(q.name),1)]),G("strong",null,Te(K(q))+Te(q.unit),1)]))),128))])],2)):(ie(),Ji(MD,{key:17,rows:o.value,compact:""},null,8,["rows"])):(ie(),oe("div",ene,"暂无业务统计数据"))],2)}}},ED="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAD0SURBVHgB7dEBDcAgEACxZ/5NTgkg40JaC137mgesf57wDSlCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTEHKbcBaYZyb5dAAAAAElFTkSuQmCC",sre=""+new URL("pathLine2-d4134d4b-balabala-1782613078975.png",import.meta.url).href,lre="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADzSURBVHgB7dEBDcAwDMCw9vw5f4MRTTYF73/NC3bnBd+QIiRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSMwBQCIExogIrTYAAAAASUVORK5CYII=",ure="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMxSURBVHgB7dZBDcJQFADBB/kCuHAgAQckHAA3Tf27aIXsjIjNXv7bfgyQdB0gSwAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgbN2erwGaHACECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCErfv7M0CTA4AwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYCw9fj+BmhyABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABB2Amb1BS2MWc5zAAAAAElFTkSuQmCC",cre=""+new URL("ocean-bg-8c848b8f-balabala-1782613078975.png",import.meta.url).href,hre=""+new URL("rotationBorder1-2ce8e0ef-balabala-1782613078975.png",import.meta.url).href,fre=""+new URL("rotationBorder2-7496b968-balabala-1782613078975.png",import.meta.url).href,dre=""+new URL("chinaBlurLine-1a2cbc0f-balabala-1782613078975.png",import.meta.url).href,pre="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA0ESURBVHgB7Z3/VRu7E8XFO+9/kgpIKoAOEioAKoBUAFSAqSCkAkwFQAVABUAFhAoIFfjt3bzl+TlGtndG0oz2fs6ZY/L94R2v9u6MpJG0FkKYBELIXP4KhJB3oUAIiUCBEBKBAiEkAgVCSAQKhJAIFAghESgQQiJQIIREoEAIiUCBEBKBAiEkAgVCSAQKhJAIFAghESgQQiJQIIREoEAIiUCBEBKBAiEkAgVCSAQKhJAIfweSlA8fPoRPnz6Fra2t9u+NjY23/wyfsBg/f/58+/z161d4fn5++/vh4aH9JOlYC9wXSw089F+/fg2bm5tvosBnSjqhwO7u7lrx4G+iAwUiAA//7u5uKwh8LooGuehEcn19HW5vb9+iEFkdCmRFECF2dnZaQaSODlpAIBDKxcVF+0lWY0Jb3s7OziaeeXp6mpyfn08aobu67wXNlbPFDQ9WLUAsBwcHkyYSumqDzObKWRP28vIyqQ1EFQrlT+M8SA+Qy9dGE0lCE1HCzc1N288i/+FK0RaspjTrPRqhsJ/y21w5a8ZqTLPmMfTUa3ApFuYqMEQrpcY0ax5d6tUIxc2wtjauFC2xw8PDtze/NH0YQpo1SzfqVbINC5grZ3sZUgTk1NPg39LvHUqaNcv9/f2Q0i5Xzq5s01FjlibVEn33eDyeDJmTkxMz7ZzQXDm7tM2LGrMgZWj6JL2vMcQ0axbc45qjSZW1WBjHv7y8XKp48PT0NIxGo9AHfD86sKsUKaL6FrVRXcn66+vruyXr+N719fW3znFXMm8N/Jbj4+NwdXUVasSNmpcxhP1VQPoleQO+l2bhe/F2Re0WOrbNwy2KVp3hOxC5kB7iu3ENK32hSlMuV85GH5wmakz6gLH+vtfFgwo6QRwdHbViyP37cU1ce1FamRq0gcaLwJC5cnauIQKgPyGh77Bv90a39lBAuIhuJaIL2qKifokrZ/8wvDml4gAaw75WDSle7shSkUhcOfs/gzg035C1T4LhgUVU0XihLAPapkS6qWyunH2z/f199fQB31dZ/jzXIBS8DHIIBfcUbeXp/syYK2dbww1PRTPk6+peSA0d+xxCcSwSV84mFQfAG8/T/dAwRJQcS4mdisSPs9p9jllqnxVeZMtUH0hw2ifx4SgaL5U48L1INbzci9SWsn/iUCT2ndSY53iPoUeN2D1PFU2cDQHbdhCjSqnEwaix2DBokQJpoWhGs+1g3/KRRY3D9dbLm9Zk7CxoWwe/365zqxYeLsPAFvuoGe4Z7p02DgocbTrWFQFqglnkIUwEprQUi8SMR3N7TqXolA9tAjClafdLpEsOEps9p7RHTygOfdMWieFiUVsOafc7KI50pi0So6OKdpxBmNWE4khvmiIxmmrZcUZzlITiyGeaIjGYatlwBOUNWmCkxcrvGoppjm4ZS7XKO6E5aoUoZOE3Dc0wfK6VARhbl1PeCWyaoEFla6HdmeaL7vv371Z+V/mbqkUFyzvdm+Zmekbas6wDWtGDnXI7hj6EBkY67OUurvW2qXlHEq+mNdlroAzF901kv8OmaS1wM/DyK3NhregxwPMq3JhWqlU4ipS5sEb0YGpl3ypo5/wX1Rq5Ympl37TaulQUKXJG4cnJSZDy48ePdtt9Yhu0EY6YkKJxrmRf3L1R2DH3ZZgVl3bYS82uZ48gGofUM3r4AgcEoc0k4OCgptMfSpBVkdJSBPz/c/tMk5tGFClUZ5fvYhpDuxzW9WsaZfG5O+tZU6z9/f0gAWnV7e1tID45Ozt79zzGZSnRWc+mRml6JTkqjWbDpFGkwObieS6kkV5x5Mq/oS8iJWealS3FkqZXSK04cuUfpFjSNDl3mpVFidL0ip3zeky6KWDmkcz0F5FODg7xUJuaTWPId2NjI4uvWVIs6eTg1dVVIPWANOv6+jpI2NvbCznIIpCdnZ0gQXoziT3G43GQsLm5GXKwFn6HkqQ0OWNo0qzQl7W1tUDqAqUjeC7w2QdEoY8fP4bUJI8gW1tbInFwYrBO8IA/PDyEvkBYTT8kpCa5QCTiAEyv6kXattvb2yE1yQUi7aAzgtSLtG2RnaQmuUAknSlpGCa2QdtKarOk2ckyZOmD9IXiqB9JG+cYyUoqEHSk+o5SgMfHx0DqRtLGiCCS52sZkgpEmiOy/1E/0iwhdZqVPIJIkK4dIPaRCiR1Rz2pQKTqZh+kfqQV2q5TLIlAED0YQepH2s6DTbG49mM4SNp6fX09pCSpQCSlAIwew0EiENcRRAIjyHB4fX0NfRlsH0Ry04gvJNmCa4FIYIo1HCy3tVmBEGIBCoSQCBQIKc5oNGpXjfaxz58/h5RQIIREoEAIiWBWIKmH7whZhqQCkQzfpS4hIGQZzAokx5YuhCwiqUCen59DX3Js6ULIIsxGkBwL8glZRFKBSAoOpevZCdHAbAQBjCKkNEkFYn29MSGLMJtiAQqElCZ5iiURSa4t7kk5rKfRf4fEIM3qexMYQern/v6+/cRzcnd31+6FJt2SVJukR1idnZ1NJDQiyXLUFi2/oW3foxHO5PLycnJ0dJT1VNtZyxJBJGB3eO6PVSexnf+RPcCmT7TFc4AIg+1K8Xeu5yKpAqUHeN7c3BR7e9DSGtpWQo7sIssRbC8vL6KjtrAohmvU66N5xkNfMPiTerEUyFLuLjlJCMJiZ70+plOnPuTa+T+LQKS54v7+fiB1IT35OOfR4MnzOGk/BIfO4/D5HL7S8hjaVAKeqRx+ZokgyBelhYvSsw6JHQ4ODsT7NufaeTPbklvpiaaHh4eB1IE0Zc59sFKWUIXJHilMs/ybNN0GmScO890cad45Go1y3hhaAjs/P59IeHp6yupv1l1NLi4uggSkWVxE5RfU5En7krnTq6wCkQ7NQRxHR0eB+ATikFbvSl+yfcgaslCEJoFDvn4N6ZGn9AqWfeM46WgWo4hPkB5Lo8fp6WkoQVZF4u0v7awzivgyjFxJowfINTk4bdkjCIoOpXkko4gvNKLHeDwudixfdlVqzImUeqPQVjONeY/CbV3kouK1AIBrRexbBe1c5sJaUQRLMgvePFrEDg4OJhqUXHIbCl5Y5e2CDjtTLXum1TE3kCWUu7hWFGGqZc80Xn6gcPSAFb242o1kqmXHTk5OJhqgbsvA7ynrQGzrl1Ux8LYZvGm2p5HUubgD4r2zOpDzsj9SzrT6HcBI9ICVd0Jjdr0DtV6cZS9j0jq7DmMvOhNOtH0ILQy9fQZj0nUe02B42NBvM+OIWocdoKNo6bfVbFqdcoAoZOz32XEGYVUr1QIUSXrTFAcw2Ic05YxqqgUoknSmLQ6jS6rNOaSaagGKRN+0xWF4steeU9qpFuBEop5pi8P48LxJp9TKUADrtXQMw+eao1Udu7u7ln+3WcfanFQDHsIjN7xgtOY5pnGwlZNp59pThiQYG1N3aYjmWjPk06BtHfx+2w4irPdtHG40J7fDw8NJCtCmTioezDvYq8aH4pDfc+3RxA5nNXMunGz7EcuObKH40cvvsmiIGtqjiB0OB0zcOLqUSJzktSYtZdToxOFwwMSVs9F1zlqVvBjnH9KwMO6Z9tzGPJwOmLhytrV5ItHKa7sHBd9X++RiJ4xU6VQF4oC5cvbNcMO7htUSx7zBAPwb16opouQUBq7hfKjdlbP/M+SzmiMisVliXAf/vWeh5BRGJ44KJmldOZvMVtkBEB1ZL29FiAKlHCk73/PAC6WSCgZXziazPmUUeEMiqlirJYIoMPsN33JFi2kq2xvAlbNJTGsHQLyl0bEv8ebENXFt+FBCFB0YZq9pT4C1f/8YNM0bT7z7+CzYxf7h4aG1u7u7t3/jUwJ2toevjSDC5uZm+wmzcDQdzu8YjUahJgYvkKbTmrVRIRBs4z/9+fr6Ovd/u76+3j74nShgFs9oxG/Y29vLfn5gDgYtEDxwiB6kPxDFt2/fip3dkZrsB+hYAtGD9ANR4/j4OGxvb1crjg7zHaUUprlF5tDAQMCASnFcOatmKRYA1Q5Gxwa4tt+Vsyqmud59KGAJwUC3dHXlrJohRRiPxxMSB+nUwNf0u3JW3RBNcpdheAD3hMdJBAqkMwrlNxTGH+bK2eQ2xNQLnW/0MSiMuebK2WwGoaBGq+bRLhRoYnMLnqcSNVfOFjG8WRFVahALo8VqxmLFFWkerNBElvDlyxf1AsdUYKb7+vo6XF1dVVkvlRIKRAAEAsHs7Oy0FbVWBIMyEIjh8fGx/ay9FCQlFIginUggmq4UPXX1LR5+lNE/Pz+3n4gQFIQeFEhiIJBOKF3JOsrYu2izKOogGnSl8SiL70rkIYbub5IOCoSQCIMudydkERQIIREoEEIiUCCERKBACIlAgRASgQIhJAIFQkgECoSQCBQIIREoEEIiUCCERKBACIlAgRASgQIhJAIFQkgECoSQCBQIIREoEEIiUCCERKBACIlAgRAS4R+Py6dcyrAs4QAAAABJRU5ErkJggg==",vre="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA4qSURBVHgB7Z3xVdvMEsX15bz/k1RAOoBUQDrAHUAHpgOgAkgF2BWAKwBXEKggUEGcCvx09d76M/LMalfalXal+zvnHhPFllbWXu3MrCT/UxTFtiCEiHwqCCEqNAghFmgQQizQIIRYoEEIsfCfgkThy5cvlU5OTopv375Vfx8dHe2WY9n++yQ2m00l8Pb2tnt9f3+vlr+8vFSvWGbeR8LyT8Eyb2dgAuj4+Ljq+MYUfQKTQDDNer3e/U26QYN4YkaFs7OznTG0EWBozCgDrVar3YhD3KFBHPjx40dxenpavUI58/z8XI0weIWIHRpEAUbAKHFxcRF8hDC5xX6OoWFyFFuu0haEYTDJcrmkWRRokD1CmcLE/0imTW5gEmmTbLcFuY1J+s3fyH1M6NelzTTLIZM3CDrWfD4vZrNZqw5mOtbr62v1OmRFyZhkv2jQdp9ubm52+zN1tlNUOVpsHx4etn/+/Nn68OvXr+3d3d22NNS27JDJ7yfaiLaizWi7L/f399V3lfp+RlRWje0sHOynpyfnDgID4f2Xl5dZGKJJZUi2LUPI6uTgA74DfC6nfQ2krBrbWji4v3//duoMxhT4zBhMoQn75msWfIcTM0pWjfWWjzHGNFL4yowsrmHYhIySVWOd5RpKYbRAfD7xOPuDysR+u1gsti7AKMhxcto/T2XV2EbhTOhqjOvr60mOFj7fpesIjGQe789p/xyVVWNVoaNfXV01Hkgc7KmGUV3kahQcg5F9t1k1VhTCo6aDN8HkMopcjDKy7zqrxn4QzlRNFRiGUnHkYpSRhF1ZNXYnl1EDyTeNEU/o/PiORz6aZNXYqsPf3t5aDwqS9JEmjEnKpTCCY5bpySqfxuJA2EYNhFNIwHPapzGpKezC/2V44sqjofP53HrdFHIRhlPDCwawzaFkeBJLv5G2kApf+MgnqrJU02iCcnAm+5Ju4zAi2GJb5hppqyk3wWUtGRy/NBvWlG+gdJtq26mPwrHSyCAvSa9RuBZIyzewnNdN5SdbWR7LccwTbXtaDTo/P1fNkcmQTClqigpw7BNsdzqNQaVKA5URVqnyF46hbXIxwQpXGg2xXWjIfGN8suUliVW4hm+EzRyc+BuvMjHJsA2wmYNX345fOMaJm2S4jWs5BytV0xKOtVaYSSCCGGbDqFho5ki45EdFkq20P3B1a5gvg+agpH4hmWTgftHvBm21cIZVFPqAdvIcaA6sv43ZzMGEnDLSEnf0nQHmwvrbmPbMJc5zUHUhOZfAxY89t6WfDWnlXJqD0qTNk+D2hx7bEX8jWjkXlxz0uKNUhtJuvuqx/Bt3A8g7pMrEQPEklZnQR6TQvMekPe7OSUl5pvcmUwNp4JNsvJVrt8qynEv5Siv/9pCPxFmxVqpjUk61lZa0Rz7hhl+pNt8xQImOGpmke9wjh1rhV4pHTko7wbyD6iotH8FjnyJtM+wKtdCKM+VUKOExTz2GWuFWplWtMKLE+KKo6Up6aHmkUCvcyqTZcoZWVAzBCFKoFaEIFGZFMAFDK6pPaddrBT4hh1mRlJizakXFllTVCtzvuq9ES5oYWlGxpUUuARP27iuREnNeiEj1Jek5WwFHkW4rkMq6TMypPqUl7IHy324rkEYPJuZU35IuQ0HfDLDu9h/WRo8+vhCK2pc2BxfgZN3+wxw9qJQU6YSdVGMoqpOkk3bHila7D0r1Z44e1NCSJg87VrT8PyTdvMLRg0pBWkWr7SjyqWjB+fn5wbKbm5uCkKHZbDbFz58/D5bP5/OiLV6O0mYuOe9BpSJpFMG/21zp6z2ClEPVwbLFYlG8vb0VhKQARpHlcvlhWWmOosxPijZ4OUqqEvCB01RqkvJkPD6oxboG2ShFRZdUafVN1r1CLCk5lxIiQlJgtVodLJvNZoUvzm6Swism51Sq0pJ1z/W4vVEKrx4fHwf/EijKpq5hlnOIJYVXpUEKQlKmXs0CvmGWk5Ok8IoPn6ZSV9cwy2kEwdxHmWt8WIYECPVmQlIGffTl5eXDMsyJSPN5Es4GqcPwiuSCVM1yNQhoHGakRIfVKyoXIcyq43GFr//KOTlI5SbpR3hccujGEOvk5ORg2Xq9LgjJCanPSn27TqNBpJLY8/NzQUhOSH3WpdzbaJDj42OnjRGSMlKflfq2hDUGq9eQmX9Quao+l+cyH2IdQRCjoWa8T72mTEgu1PMQ9O2mPMRqkPrkIHh9fS0IyRHp5N7JINJkCkcQkitSHtLJIFISQ4OQXJFuC5eipH28QiyYg9dfkVxB362bpKmSpRoECUzdIDQHyZ16BIQ+Xi9E7aMahAk6GSPv7+8Hyz5//qy+3zqC1OGjfUjuSH34+/fv6vtVg0jZPQ1Ccsc3UfcaQZiDkNyRDBIsBymn6gtCckY6yR8dHanvVw0ifUhKcAjJCWkE+fr1q/p+56eaMLwiY6Hel1tVsTgHQsZKvS+3StKbVkpIrvj0ZecqFg1CxkK9L7eqYtk+RMiYaGUQQggNQogVGoQQCzQIIRZoEEIsqAZhWZdMBVtfdzYIy75kLPjM8TmHWDQIGQs+fVk1SP2qRxqEjIV6X7bdCMgQi0yOICPI379/D5bZbiwhJAekK3dbjSC+N5YQkgOSQWw3AnqVeZueQkdI6vg+a8FrBKFBSO5Ifdj2OF3VINKHaBCSO1IfDjJRqK2ckJyQnsXbuszr+6BfQlJHmgNpPZPu+6BfQlJG+kWppqeFWg0ilb8YZpFckR6n2/RAdq8RBEi/OkVIDkgGafrFZm+DMA8hueKboBusP4Nb/xlo/JRu02coKkXhJ8yD/gw0YKJOxoCUoLv83majQaQkhnkIyQ2pz7r8YlqjQR4fH502RkjKSH1W6tsS1hisHJq2dRDLNX2OolJSPf8A6NsOn21e+dPTU9uVU9TgKvPmg/6LPu3yWad70tfr9cGyi4uLgpAckMIrqU9LOBlEmkw5OzsrCMkBqa82TRDu4zTU1OdD8G+GWVTqknJon7k858f+LJfLD/9GXXk2mxWEpIzUR31GD+DkpDKOa53oUNRQenh4OOi36Mse63DfGMMsKidJ1SvfS6W8Hl4thVmsZpFUkapXvuEVcHYTwywqJ0mTg57hFTTIRikqqk5OTjqHV5D374OsVquDZaxmkdSYz+cHy25uboo2eDkKSTmTdSplSck5wHLfdXmPIHgCRD3RQbJ+eXlZEJICUnK+WCyc7h6U8HaVlKxzFKFSEXKNgHlyu0ZIV/iWo8ggXwhFGZXTDgf9smOltd0HpVGE96tTQ0saPWCaDutMqjEU1VrS6BHgpB2+QcxFqCEU6YQdvlHX19e9fSkUBUUaPaDwDWNFi+pTmN+IGO53b6BU0bq9ve3tC6KmLfS1SKMH1H0lUkULtJm5pCgfabPms9ks1DbCNFQaRXilLxVbUr+7v78PuY0wK9KczMlDKpak/DdC5BKuwahe1WHCTsWQlphHqKCGWxmMIDUa9wXH+qKoaQphVJ1Ic3BhG64l7AGTJmri0kKrSFdxhN8B6UkSCLVY1aK6SgutAifm+wq/Ui3UYlWL6iqpaoW+FvHkG2dHtFDr6uoq1o5QIxf6To+hlVG8Hbq7uxN3iA95oHylnXDRxyJvO97KtVCL+QjlIy3v6OnK8fg7V3/IA8Djgzg/QjUpgZNs/J3EbLpExMoDNRJJFyKCHq/Q6GUjaj7CpJ3SpCXlPd9v1NuGxBJdz2cDKhNp5hjg9zH725gWT4Lz8/O+d5xKVOgLEpHnOzT1ujE1aQcs/1JaOXcgc0C9b7B6sLBkEizD/w3RJmp4af0CDNgvBtmoesEZTTJN2cwx8KOkBtuwWv7FF8VwazrCsdbMkUABZ9CNizdZGZi4j19aQg4SeXzU4A2wmoTzJOPVfD5P3RxQEo2gSSYmbZ4jMXNAyTREzUkALjngtVv5C8dQul3WkOCkcVKNUatbYMBaOBVAOHbSb1wCJOmJPvg8uQZVJT9txh3LWeHKT7ZKVeKl/SQbpd4DYGBeko9s+UYGUUGyDbMOyQAXPzLkSvv4aReomuOXQV6ZdOMq2SpcOAPxR3vSEx7zpIVUoIdbZUMpi0ZW1Q3bF47KCEeT4YURQXrskwHHMLPbG7JpaGNewtFkWGHiz3YSy7QKmVVjqzOUdneigblJv2rKNQCOWabzWFk1dieMFLbRBGBykUaJJ3R47Z7x/VEj87J8Vo39IHT+xWLReIAYdoUVjIHSrS2cAshFRnD1Q1aNFeUymtAo/X7XI5rMzaqxqnCmspWDaZRu3y0qT03GADgGI7tmLqvGNsol7No3CnMUXa6hFBhxYSSrxjoLE1UuZzyAORTe5vuvEB4h+XY1xsivjcuqsd5yiZkNuKxlqqOKCaOayrWGCYWqWTW2tXyMAlCBwWfGfA8K9g37CFO4jBYTM4ZRVo3tLNMhfDBmGcPIsj9SuJoCTCCU0pRVY4MJB9slma+DMAzxOXKcHEYXtBFtRZttV0ZLwEA4OUz5/pt//v/HZClHhaLsAEVZran+9uXl5aXS6+vr7u/NZlMMQWmG3f4cHx9Xr233abVaFXd3d4PtSypM3iD7oEOVoVRxenraqmMZjEnw+v7+Xry9vVX/xivUBbTLGAE6OjqqXssqXKc2o33L5bJ4fHwsnp+fC/I/aBCFUGaRQGfclw2YYV+h20FT2KFBHIBZIJgFrzkDI6zX6+qVpmiGBvEEZ3GEM2XiW8X5+Dv0mT0UJsxDfoRRYsj8KFdokACY+N8kxyY/6BPkNibnMcUCiHSDBomESaTNiINXk1AD82rLLfZzFJPoQzCBSfrNqMCRIQ40CCEWPhWEEBUahBALNAghFmgQQizQIIRY+C9cNXNlJEjHoQAAAABJRU5ErkJggg==",gre=""+new URL("huiguang-3c5dfda5-balabala-1782613078975.png",import.meta.url).href,mre="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFPSURBVHgB7ddhbcMwEAXglyEoBEPoGARCIYTBymBhMAgrhDFoIZTBIATC21lxtGhdYieOW7u6T7L6x5HvfPXJBpRSSj0jko2MGqWTJL7tQMkkgSN/tSiRBG5cNQadjB1KI0GfeOsDJXHVmFKjFBLseSaRM0rg2q3PAbn7c8Cn2Dn5HnwJ7p3hWuSI/QHvFiRi5xrkhv+3W59P5ITz7danRi4YdsCn5NGOGdZufRo8kgSwi6zGIPoe9oI4bzIM4tkkjngExh3wqaoYrBRTkRbbslW5bzuWnTswnRorVFiB/dPVII1rVVWvWGjxX4t9qzRIZy9rpD34vH2+zrnIaN03dtj3+zXw27TPYvrvUxcXsMH8ZjRu7pw0z2JOt9sh+MU7GJCUwdZG1ejcwg03LP8oqa9RItvew9i325P7Tf6yY3/1GdbcQymllFJKKaUy9gO4eI9ILG1riwAAAABJRU5ErkJggg==",yre="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAABGCAYAAABxLuKEAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA5BSURBVHgB7VxbjxxHFT516Znd9a537axDAhGJkQKCkEDCA5ECT0TwgBTxjgQviN/DD+BP8IgEAolAECQkcYAkCiEX2TGxY+9lrt1dF75T1T1T055ZO9u9thPtkdo909Ndl6/P+c6lak10KqdyKqdyKqdyKqdyKp8rEXQXxXvfqj8hhKe7JHcFmASQ+iwb31c+isM1vt8VgE4EmCVAiCWHpNv3b6kCgyJAPvl+oiB1DkwDlBSEWktU9VkN4mextBkchsgADb8bAaqBqcFKQeocoE6BqUBJgakBYQA0fwYYGhe04LnMQaLqM890NnEgYfi7jWe/Q1RQBKgGaaZF9y0wCSj1MdMMPoZEvQoQhaMnIlAMjhwRZXU7ZzBZzLBkBHoApQ9QxkQ5rjkAVJ6NwJU0B8hWjwYu6gqgToBpgCKTQ0ND+ls4TwAILqzhmjIF9YFIJjLqGWNkRlrjHMbiNRmttfUlFT4jC8QKHw82q5K1aBNAfQIgducalGpPJ+C0BibhlBQQtY8XDlXRUIv+Oj7n0Apwxrotyz70fksL8QVM4DFJ/itSyl3n3QU8l0shPoYNXYN6vEfSf2i8+hgojTeybAoNKgFwbqMGWbRZVPyDpucmdj8BU2uKqo4+E6uK5rPGgODcd8acxaC/pIT4IQD4Dp7+GkWTWjawgSX/qrP+RU/6j47MUGo9xs1jzH5SaQ+Dk+9G06oJuhOTagVMw4QCueLIBlFbAig4ztiSNpww2xjp93pK/gQ3f4Mqsr0D2Xfk/2Qd/UYo9TZMbKwyGlSmlQP0KWvOhag1M3DuF2CCpsDuM5BlvwbFFrTppNmEhpzD8QK05Od4qr/YhB9D98GvlFfX+FnQCG0s9EXifev9rwrn3si03gcCQXtwnmxGrjG0CE4rk9LUTlKy1ZhxjzlFxMmdAWwbNoLyPED5Ge7pJ+8iN879s/T+iifogfdlbFFkuKOfKXUBbT2FK+tVR4+Bl35BUv46n5pLPaUJrO3AOQ4eL9jSuUUibiXHBqYZyO1BY+BBJIPCnKJKOlMKs9MT8hlo0C8pgBK9hvH+KgD5O0Y/AmAMpAAgvbptXB8XxrxrhPior9QzAPnL1U9PAJyfukxcF4pK9GPZvVdo8KkmYVV9PrZ0pTF4f5SpGJ+wtvQttEU5t6u0ZvOpzcJbTx/kzv0DQJSsVYrduFwYhwefWCvl2Dk3nRrz0prWEog/wv3BOJ4GOM/mxtyASZXQFIOHjYxzYXBrrRGURMafVtoAMyNeuOYM2qKg8/1RCcIFKF7YLQz8OUH+sfoBjPjj3NrXMbtSk+gDkAwj34L27cAw1gIqgqZw0wMZIl85dYLGubOv9qRUMMmH0aOGlr0grHitAGyZWisRDzEwFqRvt+KLstSSP7vQGKFiNMu5j4Y9aWeCNzqnpHhSxIGGN2e9ewvvfD8Tcg3g9IHUdiYl4hixW0XCfCPCf3+zZFgk3cQ9hXHihpXiTeX9rogctNtT4slCZmxSQ3zna5xqqJs4zlcEzOZ+XAKWdAxJg7pPYpgvNypwQrgvEMl78RB+v1iDxwSLGX7E90rpGYQ1EOzjigO95AXFCYoLGcnH8XkTGtfXirR17ipAnVbtQSvFU6EvY/ommnDoXyX5VxvpooGQ70zjW8uECWeYidwGoz5Q3wcsP8S1AmaGuWICQu7I4EiWqryQwZvJXWgda4JgQkbKfbP6XUENdgDWjmWyL0vOteoX00ma0xqY81WWzG8azKcsmV5pEeWSY8JN3fM07Vd6fvTIIE9BzXYpguAUa533B/EnRpfWBKkNyxorBCeiQXPP3nkR7EhpA0zoeD8CE8wFLkIZC3+kmoMS9T9sg+xe/R0Mu26XOYJBhfcWtjFfD1Q0W19/nsXLvZitpyWQTy2tNaYWuE0JWxdaqdgmkhuMKp+RkaB1fC5BqFPcYOC2wdVHulMuMxzSvKxAbF58jm2Kwjrr7OrJt5pbZ8Cw6GSiFkEpVD9wQnx14lHmIAAGb0FD3Pg/XN5b1RbI+gD3XMa9AzxXyDjW3QoFCzd+TWpZqgS4LqUzYKrIk8uR0TUTDXFcTX5XCNMetSQ4JwJobs+QfwfXD/wtbXl+9m00ycAi6hc5nr0oYj2HJffWvmeRX5tQwlnUPN8oex5H2sQxoWOUGz1GziGnR+7igYwNma+Xk9L5d7US36ToTuGuxFfBoFcAznV2TajByJAWkHhICnk+NuoPEO98BE25ga97IKMxnnkQsc63aV7puzqy/oNeBi8HhA1CH8R9s3rM+XlqcM+SSPafnC6DcUNdlo/SB27xo9z6NxGxfhcuq851HkH8/5x37veOxCFMDRZBe6i7oBi1YBFTHwhXMOYbPaW+j/OD/AP3gQz7JTj0EfKLXPV0juKX4zEwqW92kECyHMuUmtFkVcBGlWEBnALF22Hh3e/weTh7FkEfPMnzoOgv4hsAEOAbcb1xHPJvuPc8gP0RHnu07gptvTE07m0EfTmi3rxETVRlWT6NfZqDOTD3zJRYHNS2hHvJKkCs8pqTw7GT9hCE2x8bxyXKP6xr9QOKNRYO0y/qSMavw6DewrXcxcoBhWRQyj6g/xY07euUvDzUYz4cGfdnBDgDmNcQGjfJ0B+vIvSq1YTtpIrXRtpyTHgrLsYmPDgD4y7G5STTvV6OyQ2FpLNQnUvgghy5wo9FVV+BSGjN0zgxB3GhalI1ywS7wcVyP3fFzFtXpsb9tvT2ak+oMZc+RQSU67+8ksDhb1r/vaeFqlAU2o5aozCaQmc0QcgineccBt7Ei5uoM7pxWb5ls0yuh1ovPSxiiYCFCXW7OqjGoq4bwBxHAPblnNwlFL2uKKn2MP1DAD21pZ6srYfab86xURlBae2RWFqTL1Wqi3S/HMZClQY4OYqxeYbyQXxtXpZey2lp37VK7K8L+WwmBRfC60W2W6K0anb78Gx/HVt7Cea1D4I5yBwNwS8ARk+he9OKz8LSyk6jtEkt5NjA8HxZqgFYZNmqH1WeuSZHgWpisVbkwY2Ih9e1sKjsi3FpXOYkvbIhpIX7fkJEMJfJ4cTavxSOPoA5jrW3I8G5qgJ/eT9CrxMfTWnKmrpVOQBasnx7HOnElHCIagmD3Q+TJXMOyrKaHPQHwdihBwNnLhSnHGotcuLcK8i2N+GhLi5pdzq19kVU+i4rL/axsjBADoF4hph0cdYTB5PF4KdAorCx75Lma9utpQtTSt8QxxIc01gedGDBEiUI4SWnhEqixBkIUYODrMTkXzuj9RYXnpLGfOncf6EGl4VQN+CZJkB6Aq1hUAZcfkDFbpJFTWETMnauLTUorRfdWgFTmVOdAQcXiVim5FnCS3AqTOCbTJbaO22gOWKAKhzqB24DvFMUXlxDqfOdNaU4OYx84/313Ps3OD9CYmWElANcO0RBeYLqdwEtHKlqyRbtT7fisktqQvcuwEulejOztWOA4vYqzeElVdYcqH2OItwY5TXwArhC0iEmfAMZxKTEehEmPgsA8eD7OFD+9Pu4Z8imI8ErYK4JYiQ2HwaFib5wi6uPna5dd5pdU7X74FxceOfAa7Ygz2+5NH6qlCp5kQ0aMQbrInbxe7CHf1XPj7HA9F5PAAwpJxyryJAwBmAZ4GlNuCD6opjveqj7bg1ILV0Bk3qB2fYMX3kp8EGOIhbMIIA0RqcFNGGEcvdIWD8syf2HeAHO+3/DxK7hHngg5EreF9AWeCLPMQrvfGDXXG5EbrG7i9rSqbQm3xUbDoNpbcUBl1NeoQxLHDp4D6fsFBWmPiLfEuYyRu32GkB52Tp/GcWoIY4c5oZcSTF/QFsAhI4RLQONYNJvL2pI89xauvBKTUk5JxxrMcEMOxJM1KACJoW37gb86pFxC8QmfxNxiWCMp+DRwTTIvr3iNlSuI6e49blLTvfndS4nAcwy4TfN0WBYNsU/TgcHhqURKQrOnxD4DOKdvJ6EQJkk4kAVch9XmWV/kVNmbdMJyEkAc2QRWoc4R1XaJHh1YUNy8CsJlsdkzCuSIWYc189wMlWsjmYlNcBps9CWjPP40uCXIwHpc+C2GIShnBK4X2MGD1QrAlj94CRUhoU137Gn+TRykqa0LC8M3krF4Iz3tPBCGu924J0QO/UzfE3OkuuVuxbEku91sNlaunLXTW2pd0GkYip3ywXzmSZUN4WVxOrrmbQt3Bt2NPSW50Bdx2Ez6UpjavsXjWu1pLEGEyi74b6PxaY9Jl8fNYiFl0puyLAHL65eZvMdU7Si/c7lpEypNhtVfTZVX+xduNLG4Ix43ZlNRQRemVX2uCJ3gN9GHAyuzZd2Q0xEtwLe7LcT6SqJZFmmNSw1QIFferHSFvbbYfL7GW9JAwgUTYifZyCQlNOA86wyApkn7ddVuqb4dFzUUk4qwGMQ6n0xdUDGEwrmkkUPFVbPTASCi+S8HJvxhkMTF/F5IW1SzE2vCUiagnQuJ+mVal6p44zaVdfgTItoRky8rBWijJoispgghj11vcVai0naWhXXdCJdApOaUpoW1N4k/RsAFtebAxW8SxLI8W+1ptXE29wBnhJ65yC1BuY2PJMCRLQIGk803U0epHerRjQBadZ106Mz6dqUmuWH5m9NYDQlkXDjXtO41y05p/fHRjr665OTIl+WELkm1+u9t7WH4nOR3Nt8nuhWs2mCMqscUsdy7B1HTVmRN6XbviQt7iRPry1LH9K/Q6onv4xXZuB3+cdcJxngsaRuO6TMtGhuR4X0Ta1Yde1EpDONYVlSzWtqTn2N6PZ/LLqKWJeaz339N5EsK8BhaYJzJ30vK10u9UD3PTC1rKgFC1oEhSezzJyaGuKXXI8Nflb+vHiZHKFFy3KrWx5vXvjM/kH6Kjn9LwzuUG4H1N0Eoin/B14zT4gj8tU+AAAAAElFTkSuQmCC",_re="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAnCSURBVHgB7d3tURtXGwbgR563AN4OtgToADrAFYRUYKjASgV2KrBTAUkF0AHuQOrATgUn53iXQBxE9LHfuq6ZM/J4BKPhz3Pv2fusIgAAAAAAAAAAAAAAgGlYBDALKaVP+eU8pu2PxWJxHUDnBACYiRwATvLLQ15VTNM6r7McAL4F0Lk3AcxCMzgvoh6kU7PO68Lwh/7YAYCZyTsBp1HvBExJufL/EkBv7ADAzDSD9Cam48bwB4CW5J2AZRq/ZQAA7coD9nMar9sABqMDADOW6pMBd3mdxrisQ+MfBqUDADPWDNi3Ma6TAevQ+IfB2QGAI5DqkwFlJ+AkhvX9qKLSHwD0JIeAqzQ8T/kDgL6lYU8GLAMAGEYa5mTAxwAAhpOH8UleD6k/q1SfRgAAhpQHctUM5j6GfxUAwDjkwXya19fUna+GPwCMUOr2ZMBlAADjlLo5GbAMAGDcUrsnAzT+AWAqUjsnAx4CAJiOdPjJgFVS+gOA6WlCwD4nAzT+AWDK8iC/TLvT+AeAqUu7nQxYBgAwD3mwf9xi+Gv8A8Dc5AF/98rw1/gHgDlK9RcHrV4Y/uX/qgAA5in9+2SA4Q8AxyAP/PNnAeA8AIDjkAf/tcY/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwGFSSpdlBQAwOXmGn+T1KXaVf+gq1d4HADAZeXZXea3Kil09CwDFhwAARi/P7NNm+Kc2AkDxUBJFAACjlOf0ux9mdysB4PsvEgIAYHzKLfuX5nbsakMAKL4qBwLAODyW/TbM7FYDwCPlQAAYUKrLfg+vzOpOAkChHAgAA0j/LPvtHADexGGuk3IgAPQqz92f8stdXlXs6dAAUJyWDyEEAED3mlvwn/M6iQO0EQCKKuoQcB4AQOvS05P9ltGCtgJAUUUdApQDAaBFzS572fK/ipa0GQAeLYUAAGhHKftFPfxPo0VdBICihIDbsl0RAMBe2ij7bdJVACjKw4KcEACAPbRV9tukywBQVFH3AlrdtgCAOWuz7LdJ1wGgqKLeCbgOAGCjxyf7RYtlv036CACPPigHAsDLnjX9e9k17zMAFMqBAPCDVH/JXrnyr6InfQeAQjkQABrN7vhtdFT222SIAFBUoRwIwJFrvlRvGQMYKgAUVSgHAnCEmsf6lvv9g83AIQPAI+VAAI5Gcwu83O8/jwGNIQAUyoEAzF7zpXm9lv02GUsAKJQDAZitPN/eRX3MbxQXu2MKAMW3AIB5+n+MyJgCwG95XSwWi3UAwMzk+bbMLxcxkovdsQSAX/If5iovOwAAzFaec/f55SyvdQxs6ABQBv7PTSoCgNlrdrrLTsCXGNCQAWAd9Zb/5wCAI1JCQF5lJ+DXGMhQAWAd9fAfNP0AwJDyHCwPAvolBjBEAPg9rzNlPwD4uxz4NnouB/YdAErZ762yHwA8yXPx+8Vx9FgO7DMA3Cj7AcDL+i4H9hEAytV+ud//MQCAjfosB3YdANZR3++/DwBgK32UA7sMAPeh7AcAe+m6HNhVAPg1f/ALZT8A2F+X5cAuAsBNs3UBABzoWTlwHS1qMwAo+wFAB5oQ0Go5sK0AsA5lPwDoTLmt3mY5sI0AcB/KfgDQi6YceBMHOjQAKPsBQM+a2+3dPDkwpXSVXqfoBwADyrO4ymv1yqxebfrZfXYAlP0AYASelQN/j7Zs2AFYlbQRAMCo5Pm83GUH4LVf9GMAeDD8AWC8yu35tgOA7X4AmIA8s0/TUy/goACwDABgMp6VA/cKAJclBAQAMDl5hp/k9SEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6XUqrKCgDgOOTBf5LXKq+H8u8AAOYvD/1P6cmnAADmLQ/89+nf3gcAME950L9Lm/0UAMC85AF/ml73tbwnAIB5aBr/q/TfynuqAACmLT01/rdV3utkAABMWR7mt2l3twEATFN6ufG/LScDAGBq0uuN/21dBwAwDem/G/+7cDIAAMYubd/431Y5HlgFADBOaffG/7ZWyckAABintF/jf1t3AQCMSzqs8b+tDwEAjENPw/+RkwEAMLQ8kM9T/84DGJVFAEcj1e38cm++in59y+tssVisAxgFAQCOxIDD/9E66hDwLYDBvQngWJTn9VcxnKr5DMAICABwBFLdxh/DE/rOk5MBANC91G/jf1tOBsDAdABgxvKgvYzxbrtfLBaL+wAGIQDATKW69PeQ11gfyetkAAxIBwBmKD01/sf8PP7y2e6SLw6CQdgBgBnKQ7Vc+U/la3m/5F2AswB6ZQcAZiaNp/G/rdPkZAAA7C+Ns/G/rfcB9MYtAJiJNO7G/7au8u2A3wLo3P8CmJOfY9r+DAAAAAAAAAAAAAAAAOCZvwCgkvxAcNS/iwAAAABJRU5ErkJggg==",xre="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAD/CAMAAABb2Q/2AAAAsVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+3mHKcAAAAO3RSTlMABQoPExgdISgxJTYsQDtTRUr+9vpOWXJdaWVhgIx2om2n6oiWmYTKr5G68J22eqvBfeHZ5c++1LPdxUM4ZWUAAAZvSURBVGjerdrZdpswFAXQmnk0EMB4Ajwbz2Mc1///Yb0SuLg1km66mtfsdRBXRyIP+fH205IURZZa7794h7KqKZKEkrqFCgVpOSpOKoaJljZWOm1VwUnTRUv7/0sbvc62r2FlgJOy0o6x0kVL30NJiUh0ZkfHZuLXGWj/PTNArzPu68hMr4/MVEGqMlJaWNkDKWGukM4IK70uTipq3NVBthASMoWb1CJS644cIoG2OJDIQUYlm4KDH7mWxDJoKfX+3iSyooxEMqRSyhVlJFJp9YY2SGZoiyGZkMh+YtPRN4eWDqQCckSl1CoxIxKkQTMVSWp+pyeUQY4WbSqftuG9S+kkqWupitwkgdZSe5VSo5SeMgOpiaWqmfuVb1BZUUbkU6pyHdokJSJPs0AoZcjU7WRBMhWgQjnkSqmW2dB3ailx5HAW1FJqzJRLOd3Gjo6R7cVTym+y9aecbr1KCjLdae7hMt0090yupBAq/yLld1lHapa7WMVEElqNnimnr1JiS3+Rxqal8aVCZZp3+FJ+ylnRBalSyperA1IGM7ScFwNbIJXvSSOY3/u2QaTSIKVXudp2uVIupW7Eq3kHLetMmSu3RQ8p8/XoVQJtGieVu55A0lfXHY9m6iqhQpkg5fhNtljySKSGkPNxry2SKpGdec6VciUtIvtIOV5nbQekypLKUx4ep1rKHNk9PPZIWdRSEcmTi5KDYjl0HatZSn/IO1Kag/E9E0m1kkVSSlUg++Mic02UvD8WCKkbZn/3ORVLrZSLb0kdIdf06brGkspT9tZf6T9KiSmL25Aj5Ve5Bml8VyqNUn2u8zP1cfJ2mQmlRuToeJnRp2v/TdpE+jaVKk86IH8iZfJAy/UjRcrdkUhLIC0iH1j5uMwDnFyec7TcBrYjkDrIrJI6RuYYaYK8YqRh2vvP61gkNSpPy69t0EbI9pDK+iDx5GUbU6kJ5OIyKQKc/LnZ4TKnZ5R0zHZ63qxxmatreItdkbQM011NwqPHk1WVcJIWxJ2dJzuQDl5aukjOr5O159oYOYmWT6ny5Sb6xMktSkI9fSp9jMw30VcHpCGW4QeRpki2vyM34bITtHmSFqSSPkaO8TKMvujT4WZiSZ3IYBx+XLoI6WKljZVOJQccqbxJhyeNSv4cBLRMfBnDPD8HMVIuqTQwmRjpx7BHF5GkVYoP8EZ9DyG9UkJBOdJ6le3/JB2okleA7OFlWVBmQ0C6IDfhF5UOS2oaLUjnXkqXJ+kWUTnCyTA6j7qwSSxJBw+yew8/zgmVhqaxpe91d7XUEXIQ+zRTZUnYokEpq41XBPKaVZKb2aeSbDxb0hukAzK8iCSMs5J72CS+hMzeGuSJSJsnYfAgP64nsp0Mqfwhh1Q6fDkqZTcWy1v4McHIAZWLpC5Tk4QqeThJNzP5jgzPC6iISPaTI8gpXxovstx4kYR1iiUUJDtGONnLHiDTPU/qpdx/W9KCsiQUuTuicnXqieWJyqFIxiCXYXRd0YIypUPlcBmGRMJHli+TWvIzB8liCeucLWiV2dKv5Ga2SKjUm6RGpFfJOZRJIPsZXk5LmdF7kSVJ6fbTz0p6bGnWcgu140lakPQzjCbbVCxPIEOBtF5kXhaUKeH2HA1XX7DOfLXvYeWJL6EgtewEzVKt5GJG5LiqcrM0XuWsklqjpKWjMgQ5EshsSjMPAul7IOdfUbQ5zKHKIC2uvEThBGTCl1C6LchNQWTMlynIj7DYTkG6PLmv5YAre/vVU2YCeVrlP4nMsfKep3A8GFIH2flL2oxMUuThbFzJfZ8ldQfkiMpos8tXWDkm0ufJxfwpT0J5OMM61wcoPUiDKRMiP4ic8WU3mW6pvEFBhbI4RyALjLxSOYfSs2VM5P0KTz9CQblykKQ5kdHxLpIZkVEUVrLNkC6VOyIf9y3IgCHNV7mD0nPlfjXekXUudzkcJLb0+iDXE5ycVXItkqdapgypUNk7zQ63/y2Hv+U4zVjSKmVxm8A8P29COS+Ov+WgUcog/VouK+nwJawTl0nlmitdpNRrWc8TLW2OpJOvukROh6pITZ33+q8STodpNUgFZFz2k3SenCPPfZctkOT+pKeDyCO5Q0CW/3vyJu3qZgC5Jrdi7Dram6xGT+9kuEOie135Ur4dOfLlOoOsLjCr/rzXki6U/nVBvkf0c1Qu809Z9w4+8GeYUnrqkWm+LvMXnJRTlwruvBIAAAAASUVORK5CYII=",Sre=""+new URL("focus_bg-b6803e2d-balabala-1782613078975.png",import.meta.url).href,Are="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAOVBMVEUAAAD///////////////////////////////////////////////////////////////////////8KOjVvAAAAEnRSTlMA3yDvvxBAn3CAYFCQzzCgj6+a/gWFAAAIxklEQVR42uzBgQAAAACAoP2pF6kCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGB27gRJcRiGAqi8O2sH3f+wM1XM1lOAHZwQKfnvBF3tjyxbBgAAAAAAAAAAAAAAAAAAAAAAAAAAAACAvfBPxkz+lro8xEBwMfyd87dumAkugx9xfhkswRXwUyb1CMH58UvTEgm0CjOVcYlLA4FCMTkOVQFABs4nLo5/ylTEdUxCP6BGyJ7vPBVxNd8TKBA6x3+EugCgDJxGTPyvnkp4HURAtOj5O18RAETgLKLn/7lQDgAicA7W8wN9OQCIwBmEhR/y5QAgAieQHT/mwj4BYJMJpIgTPxVLAXibwdRYhrDwC6kmANgHFBsc/7V+D+AWBpeDRws3LojFAKAI6BUdl4zFAKAIaBUWLnOFADRb8JL0INZwjUiv+MkYw00MtoFDZMdVRqpgY8zdbXL8Doc7gQMsXMnRCvPQ3RyvthB8lp24WqSV5v7L8DoTtoGPmg3XG+kNc+/RCIg1OK7nB3pP6G9cz+Hh6MdkruZzoAZ2TR3oCD6i40pujNTMfhkkQJSlemAbaBOhN0iAHImr+Egbqo1AIthZalj+tgggARIkrjBF2kFvkIDDpUMvZnuDBBwrcVkXaDe2QwKO1HGRt7QrO2EwcJhOxFiuNzgNHqM7/ON/Zz2XYDy8g0HCx7/2Khpzgc1ZJ2gcZ00pjPjOwKf/5WOgDwqjoDhewiRt18382kSwoUXet7Rmg8Pgx2SJ9dYaYUXpvAoNoA90iOD5FYc2YCPB8CtfdJgvfsXgGyPbWOReu3VoA/bXy13/UgLwQ8MbsEbw+hcS4LAJtEui17+QgBtBo174+hN1GArsyBqZ/f+/vrAJNGjYADwJ4XES2Mus4pgdDE4COzHS7n8fswZToV1kfk7UxH3GTGAP1qj5t2b0gTtI/NRIwozoAzdnNTSANY2goG5FlaTqX2qd/POqLlZNA3CXcRTcVtL2ifLa/mDZrIobgH9ZhxLwkQIg9td5M0rAdqzGqzWPErCZpOkE8JvFd8a3YmW/AVj/NkDcxYVwSVsHeBecytwKZNR1gHcZE4F9H4IZEm5SdXkllldaAIgiToIbsGoLAJHHSbBdUlsAiKKaCbZgRm8BeF4CHEGlQXEBIIrYA1olzQWAyOA2sJHTXACIMq4C2gxq3oE9FpyGh8yCJe0ldOQHfFaS3+M5fWPAQhvofI/Vrxb1X6V5rH6DUXcL+L0NdCli9VeatO8AROHX6o9Y/fXsGX5swzO7ERc/b+n17wBEA1b/bQlvqq7NqD8DQAt7hh0A3jfgGvXaRtWDQGjmlc8BoJFDC3BpM1qAaxvwnu7auhPcA8MP9u40yU0ghgIw6s2AWcy7/2EzNUmq8iMzeNwNSNb7jgCNpFYvVNh4ss63xEu3fYusAV3LrAF9K+ZuhaGm7pwE+NZzEuDbwMsVfFt5rNK3jQPAt2R+RzgdcSagIyeEA8A34X4w37gh0DkOAOe4FOAcTwXR+0ic0vjGpoZzbGo4xwHgHLtazrGp4RybGr4FNjV8K9zg6lvhTQe+cYezc9zh7NzGc66+zdzh7FvkjaeuLTzo7NudfSDfeNuRc7ztyLnIWaBrvPHSuZGTAN9unAT4JvivqSMXFrAGdG20//NDqpG4I9S1bP0H6OqUh6ns+RZ/v9SjPKKxCdTGEqCVXB7R3EJ6AM8ENJHLLVrcTDeCXYB6eUzRaBMtgdvBGrx9s48vgAsBVXKfTAfQGyeBh7RRo5EyMAv7wFVyhOkzFSMzQKUVphupwgxQqcByFT2CGaBWhOHtFGI7fqkwGQ4BI5gBqhXYDQECrgPUS2ZDwGh47CrSw+pyioArwQ3kCJu9gBEsAZsYYLIdGIQlYBsZgMHDdQNYAjayWnyUAQwArRQYLKdni6NWqwRzdeDIAHBKCIhKP6cgDAAtJWtJIDEANFVgKwn0YABoK5lKAgEMAOc9UlHXDsrCANDchC89OmUeDADt5WimDOjxJWEAqHusFm5bWmBmqNoy2/iwggBcBjxCgYVCMIuVSGXPBOjvByWwAjxKjvof7g02EpVNdwC69wYM+MCNYIfZlI+AAfpjlGk5qh4BA5gADlageAQMYAI43KR3BAz4xBthDpUFSvPsDTDRqLAuRHwn5e4SOeGDqTVrq3pAX60VBADXAM4x4VuydKdbBCwAzjND2efW4zezhxiNCYLvPXJ3ovyAxqz0zpao6JEHAVgAnuwOaEkDfcQfvA7oRD32pNCdICR80Nucel8D9sjYHa6PfP9XmbBrDt2hQgLf/3VW7BtCd5g8YN/a0WFW4MI80Ee+/6utuGwIlBl8/9dbcc0QKAl8/yqsuGAIlAS+fy0GPEfG3DWRe8FfXABSYMCT5Bba/LPuE+d/agx4WhpDq5/X6GlF0z3iedvLqeCe8LzI/v+JguAn0rjUdx717UnxLMz4GbmN4eUN6de3oGn/89wXt+G+dD8QwfJfrz7iFXHehr6U0HCQRZZ/lwiCKiIyp2dygKK9SPSvPKFafQ6YeP7jOqOgUm0OiOp/YvPewoo6lfOAjZ//j+kKAntn09n8Ua8uCHTfW5n9DVgEL3u9FzQz++vRy0EDIEfO/U14OQ90OxKjvxEvDoGXfgOT2Pr5xc6d4zAIAwEUDdjsm+D+h02X1pZFgcN7V5ivGRr8REUJFLxRFR3/pypI4JMSjb8m7VESQP4NGIz/6dqjuTWA7voJk0+/KsyxIIDkDYij8Vcjfw1k/pYeVru/MssR7gmgu4LLX6ecBj5pu9Vfr37dEgHw79r5aATwcu2yxiCAl9uX6YxBAC/X9cs4DWfcmkYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMC3PTgkAAAAABD0/7UrbAAAAAAAAAAAAAAAAAAAAAAAAHAKGbwwCsmp53wAAAAASUVORK5CYII=",wre=""+new URL("focus_move_bg-cf41417a-balabala-1782613078975.png",import.meta.url).href;class _g{constructor(){this.ready=null,this.init()}init(){this.instance=new cee,this.instance.addLoader(Rv,"FileLoader");let e="./",t=[{type:"Texture",name:"flyline",path:ED},{type:"Texture",name:"pathLine",path:ED},{type:"Texture",name:"pathLine2",path:lre},{type:"Texture",name:"pathLine3",path:sre},{type:"File",name:"china",path:e+"assets/json/红原县-轮廓.json"},{type:"File",name:"mapJson",path:e+"assets/json/红原县.json"},{type:"File",name:"mapStroke",path:e+"assets/json/红原县-轮廓.json"},{type:"Texture",name:"huiguang",path:gre},{type:"Texture",name:"rotationBorder1",path:hre},{type:"Texture",name:"rotationBorder2",path:fre},{type:"Texture",name:"guangquan1",path:pre},{type:"Texture",name:"guangquan2",path:vre},{type:"Texture",name:"chinaBlurLine",path:dre},{type:"Texture",name:"ocean",path:cre},{type:"Texture",name:"side",path:ure},{type:"Texture",name:"arrow",path:mre},{type:"Texture",name:"point",path:yre},{type:"Texture",name:"focusArrows",path:_re},{type:"Texture",name:"focusBar",path:xre},{type:"Texture",name:"focusBg",path:Sre},{type:"Texture",name:"focusMidQuan",path:Are},{type:"Texture",name:"focusMoveBg",path:wre}];this.ready=this.instance.loadAll(t)}}const oo={herdsmanCount:129,grasslandArea:7568515,wetArea:2429693,yakCount:10965,projectCount:17,baseCount:12},xg=[{zoneName:"色地乡",grasslandArea:1463044,yakCount:11704},{zoneName:"麦洼乡",grasslandArea:660352,yakCount:5283},{zoneName:"壤口乡",grasslandArea:763672,yakCount:6109},{zoneName:"阿木乡",grasslandArea:1115947,yakCount:8928},{zoneName:"瓦切镇",grasslandArea:1111492,yakCount:8892},{zoneName:"查尔玛乡",grasslandArea:858500,yakCount:6868},{zoneName:"江茸乡",grasslandArea:644761,yakCount:5158},{zoneName:"龙日镇",grasslandArea:874234,yakCount:6994},{zoneName:"安曲镇",grasslandArea:1165634,yakCount:9325},{zoneName:"刷经寺镇",grasslandArea:62465,yakCount:500},{zoneName:"邛溪镇",grasslandArea:1166721,yakCount:9334}],mU=[{zoneName:"色地乡",grasslandArea:350788,wetArea:166983},{zoneName:"麦洼乡",grasslandArea:162198,wetArea:71501},{zoneName:"壤口乡",grasslandArea:241024,wetArea:29239},{zoneName:"阿木乡",grasslandArea:305522,wetArea:89411},{zoneName:"瓦切镇",grasslandArea:264640,wetArea:128717},{zoneName:"查尔玛乡",grasslandArea:286159,wetArea:17664},{zoneName:"江茸乡",grasslandArea:175840,wetArea:52341},{zoneName:"龙日镇",grasslandArea:222346,wetArea:87046},{zoneName:"安曲镇",grasslandArea:304970,wetArea:107548},{zoneName:"刷经寺镇",grasslandArea:22107,wetArea:7002},{zoneName:"邛溪镇",grasslandArea:318316,wetArea:94587}],bre=[{month:"1月",count:485,speed:380},{month:"2月",count:502,speed:313},{month:"3月",count:471,speed:142},{month:"4月",count:893,speed:574},{month:"5月",count:874,speed:231},{month:"6月",count:879,speed:555},{month:"7月",count:145,speed:654},{month:"8月",count:521,speed:123},{month:"9月",count:741,speed:456},{month:"10月",count:744,speed:458},{month:"11月",count:777,speed:444},{month:"12月",count:563,speed:254}],yU=[{name:"色地乡",count:131983,devices:25},{name:"瓦切乡",count:126611,devices:24},{name:"安曲乡",count:99331,devices:20},{name:"邛溪镇",count:81727,devices:18},{name:"麦洼乡",count:78489,devices:16},{name:"龙日乡",count:66846,devices:15},{name:"阿木乡",count:64176,devices:14},{name:"查尔玛乡",count:47958,devices:11},{name:"江茸乡",count:34576,devices:9},{name:"刷经寺镇",count:30407,devices:8},{name:"壤口乡",count:19744,devices:6}],W0=yU.reduce((r,e)=>r+e.count,0),_U=1824,xU=-3672,Al=W0+_U+xU;function Tre(r,e){const t=r.map(i=>Xe(Re({},i),{count:Math.round(e*i.ratio/100)})),n=e-t.reduce((i,a)=>i+a.count,0);return n&&t[1]&&(t[1].count+=n),t}Tre([{name:"成年母牛",ratio:47},{name:"其他成年牛",ratio:22},{name:"幼畜",ratio:16},{name:"育成牛",ratio:11},{name:"公牛",ratio:4}],Al);const IC=[{label:"屠宰出栏",value:1706,yoy:6},{label:"活畜交易",value:1043,yoy:-3},{label:"外运销售",value:624,yoy:12},{label:"其他出栏",value:299,yoy:-9}],SU=[{name:"饲草储备库",value:7,capacity:10500,unit:"座"},{name:"加工企业",value:7,capacity:13e3,unit:"家"},{name:"工程数量",value:oo.projectCount,capacity:17,unit:"个"},{name:"基地数量",value:oo.baseCount,capacity:12,unit:"个"}],Mre=[{name:"越界预警",value:4},{name:"草畜平衡",value:3},{name:"防疫提醒",value:2},{name:"设备离线",value:1}],Ii=(r,e=2)=>{const t=cu(10,e);return Math.round((Number(r)||0)*t)/t},AU=(r,e)=>r.reduce((t,n)=>t+(Number(n[e])||0),0),LD=r=>Ii((Number(r)||0)/1e4,2),wU=AU(IC,"value"),u1=AU(xg,"yakCount"),Sg=Ii(oo.grasslandArea/1e4,2),NC=Ii(oo.wetArea/1e4,2),kC=177.92,bU=Ii(Sg+NC+kC,2),Cre=Ii(u1/Math.max(Sg,1),1),PD=Ii(NC/Math.max(bU,1)*100,1),RD=637.13,Ky=108.84,Ere=297.29,Vb=159.33,Lre=[{key:"forest-grass-wet-area",zh:"林草湿总量",name:"林草湿总量",value:bU,unit:"万亩",decimals:2},{key:"yak-count",zh:"牦牛存栏",name:"牦牛存栏",value:u1,unit:"头",decimals:0},{key:"trade-flow",zh:"交易流通",name:"交易流通",value:wU,unit:"头",decimals:0},{key:"support-capacity",zh:"产业载体",name:"产业载体",value:oo.baseCount+oo.projectCount,unit:"个",decimals:0}],_S=[{key:"grassland",name:"草地",value:Sg,unit:"万亩",color:"#7ee269"},{key:"wetland",name:"湿地",value:NC,unit:"万亩",color:"#32dcff"},{key:"woodland",name:"林地",value:kC,unit:"万亩",color:"#24f6c4"}],xS=[{key:"basic-grassland",name:"基本草原",value:RD,unit:"万亩",percent:Ii(RD/Math.max(Sg,1)*100,1),note:"草地保护底盘"},{key:"wetland-yield",name:"湿地生产力",value:Ky,unit:"万吨",percent:Ii(Ky/Math.max(Ere+Ky,1)*100,1),note:"鲜草产能"},{key:"public-woodland",name:"公益林面积",value:Vb,unit:"万亩",percent:Ii(Vb/Math.max(kC,1)*100,1),note:"林地保护占比"},{key:"wetland-rate",name:"湿地占比",value:PD,unit:"%",percent:PD,note:"林草湿结构"}],DD=mU.map(r=>{const e=xg.find(i=>i.zoneName===r.zoneName)||{},t=LD(r.grasslandArea),n=LD(r.wetArea);return{key:r.zoneName,name:r.zoneName,grasslandArea:t,wetlandArea:n,yakCount:e.yakCount||0,resourceTotal:Ii(t+n,2),density:Ii((e.yakCount||0)/Math.max(t+n,1),1)}}).sort((r,e)=>e.yakCount-r.yakCount),Pre=xg.map(r=>({key:r.zoneName,name:r.zoneName,value:r.yakCount,unit:"头",percent:Ii(r.yakCount/Math.max(u1,1)*100,1)})).sort((r,e)=>e.value-r.value),Gb=IC.map(r=>({key:r.label,name:r.label,value:r.value,unit:"头",yoy:r.yoy,percent:Ii(r.value/Math.max(wU,1)*100,1)})),Rre=Math.max(...SU.map(r=>Number(r.value)||0),1),Dre=SU.map(r=>{const e=r.name.includes("储备")||r.name.includes("加工")?`${Number(r.capacity||0).toLocaleString("zh-CN")}吨`:"已接入";return{key:r.name,name:r.name,value:r.value,unit:r.unit,capacity:r.capacity,capacityNote:e,percent:Ii((Number(r.value)||0)/Rre*100,1)}});var KB,ZB;const Ire=[{key:"flow-grassland",module:"林草湿",name:"草地面积分布完成乡镇归集",value:Sg,unit:"万亩",trend:"+0.8%"},{key:"flow-wetland",module:"林草湿",name:"湿地生产力指标进入总览",value:Ky,unit:"万吨",trend:"+1.2%"},{key:"flow-woodland",module:"林草湿",name:"公益林保护面积同步",value:Vb,unit:"万亩",trend:"89.6%"},{key:"flow-yak-town",module:"牦牛",name:"乡镇牦牛存栏排行刷新",value:u1,unit:"头",trend:"+2.4%"},{key:"flow-yak-density",module:"草畜",name:"草畜密度联动核算",value:Cre,unit:"头/万亩",trend:"联动"},{key:"flow-trade-1",module:"交易",name:"屠宰出栏流通记录入库",value:((KB=Gb[0])==null?void 0:KB.value)||0,unit:"头",trend:"+6%"},{key:"flow-trade-2",module:"交易",name:"活畜交易影响扣减存栏",value:((ZB=Gb[1])==null?void 0:ZB.value)||0,unit:"头",trend:"-3%"},{key:"flow-industry",module:"产业",name:"饲草储备与加工主体纳入画像",value:oo.baseCount+oo.projectCount,unit:"个",trend:"在线"}];const Nre={class:"home-dashboard"},kre={class:"home-left home-side-stack"},Ore={class:"home-right home-side-stack"},Fre={__name:"index",emits:["module-stats","loading-progress","map-ready"],setup(r,{emit:e}){const t=e,n=tt(null),i=mg("grassland","grassland-distribution");let a=null,o=!1;const s=_S.find(b=>b.key==="grassland")||{},l=xS.find(b=>b.key==="basic-grassland")||{},u=xS.find(b=>b.key==="wetland-yield")||{},c=xS.find(b=>b.key==="public-woodland")||{},h=Se(()=>_S.reduce((b,T)=>b+Number(T.value||0),0)),f=Se(()=>_S.map(b=>Xe(Re({},b),{percent:w(b)}))),d=Se(()=>Pre.slice(0,6).map(b=>Xe(Re({},b),{extra:`${b.percent}%`}))),p=Se(()=>DD.slice(0,6).map(b=>({key:b.key,name:b.name,value:b.density,unit:"头/万亩",extra:`${C(b.yakCount)}头`}))),g=Se(()=>[{key:"grassland-total",name:"草地资源",value:s.value,unit:s.unit,extra:`${w(s)}%`},{key:"basic-grassland",name:"基本草原",value:l.value,unit:l.unit,extra:`${l.percent||"--"}%`},{key:"public-woodland",name:"公益林面积",value:c.value,unit:c.unit,extra:`${c.percent||"--"}%`},{key:"wetland-yield",name:"湿地生产力",value:u.value,unit:u.unit,extra:`${u.percent||"--"}%`}]),v=Se(()=>Gb.map(b=>Xe(Re({},b),{extra:`${b.yoy>0?"+":""}${b.yoy}%`}))),m=Se(()=>Dre.map(b=>Xe(Re({},b),{extra:b.capacityNote,scaleValue:b.percent}))),y=Se(()=>DD.slice(0,5).map(b=>({key:b.key,name:b.name,value:b.resourceTotal,unit:"万亩",extra:`${b.density}头/万亩`}))),_=Se(()=>Ire.slice(0,6).map(b=>({key:b.key,name:M(b),value:b.value,unit:b.unit,extra:b.trend}))),x=Se(()=>[{key:"resource-structure",title:"林草湿资源结构",type:"donut",variant:"ring",rows:f.value},{key:"yak-town-rank",title:"乡镇牦牛存栏",type:"bar",variant:"distribution",rows:d.value},{key:"capacity-density",title:"草畜承载密度",type:"line",rows:p.value},{key:"resource-business",title:"资源业务画像",type:"structure",rows:g.value}]),S=Se(()=>[{key:"trade-structure",title:"牦牛交易结构",type:"donut",rows:v.value},{key:"support-industry",title:"产业支撑能力",type:"column",variant:"slim",rows:m.value},{key:"town-resource",title:"乡镇资源协同",type:"bar",variant:"distribution",rows:y.value},{key:"data-flow",title:"业务数据动态",type:"heat",rows:_.value}]);Ko(()=>{t("module-stats",{moduleKey:"home",items:Lre}),A()}),uo(()=>{var b,T;o=!0,(T=(b=n.value)==null?void 0:b.destroyMap)==null||T.call(b)});function A(){var T,P,D;a=new _g,t("loading-progress",{progress:0}),(P=(T=a.instance)==null?void 0:T.on)==null||P.call(T,"onProgress",(L,E,I)=>{t("loading-progress",{progress:Math.floor(E/(I||1)*100),path:L,itemsLoaded:E,itemsTotal:I})});const b=(L=0)=>Ge(this,null,function*(){var I,N;if(o)return;yield no();const E=n.value;if((I=E==null?void 0:E.loadMap)==null||I.call(E,a),E!=null&&E.canvasMap){t("loading-progress",{progress:100}),t("map-ready"),(N=E.play)==null||N.call(E);return}if(L<24){window.setTimeout(()=>b(L+1),120);return}t("map-ready")});(D=a.ready)==null||D.then(b).catch(()=>{t("map-ready")})}function w(b={}){const T=h.value||1;return Number((Number(b.value||0)/T*100).toFixed(1))}function M(b={}){const T=String(b.name||"");return T.includes("草地面积")?"草地归集":T.includes("湿地生产力")?"湿地生产力":T.includes("公益林")?"公益林同步":T.includes("牦牛存栏")?"牦牛存栏":T.includes("草畜密度")?"草畜核算":T.includes("屠宰")?"屠宰入库":T.includes("活畜")?"活畜交易":T.includes("饲草")?"产业画像":b.module||"业务动态"}function C(b){const T=Number(b);return Number.isFinite(T)?T.toLocaleString("zh-CN",{maximumFractionDigits:Number.isInteger(T)?0:2}):"--"}return(b,T)=>(ie(),oe("div",Nre,[$e(yg,{ref_key:"mapSceneRef",ref:n,class:"home-map-scene","active-layer":_n(i)},null,8,["active-layer"]),T[0]||(T[0]=G("div",{class:"home-map-scrim"},null,-1)),G("div",kre,[(ie(!0),oe(it,null,vt(x.value,P=>(ie(),Ji(tn,{key:P.key,class:"home-card left-card",title:P.title,width:398,height:186},{default:Xt(()=>[$e(Si,{panel:P,compact:""},null,8,["panel"])]),_:2},1032,["title"]))),128))]),G("div",Ore,[(ie(!0),oe(it,null,vt(S.value,P=>(ie(),Ji(tn,{key:P.key,class:"home-card right-card",title:P.title,width:398,height:186},{default:Xt(()=>[$e(Si,{panel:P,compact:""},null,8,["panel"])]),_:2},1032,["title"]))),128))])]))}},Bre="/openApi",c1={513233100:"邛溪镇",513233101:"刷经寺镇",513233103:"安曲镇",513233105:"龙日镇",513233202:"江茸乡",513233203:"查尔玛乡",513233204:"瓦切镇",513233205:"阿木乡",513233207:"麦洼乡",513233208:"色地镇"},zre=Object.values(c1).map(Kf);function TU(r){return/^https?:\/\//.test(r)?r:`${Bre}${r.startsWith("/")?r:`/${r}`}`}function gl(r,e){return Bs(TU(r),{method:"POST",body:e?JSON.stringify(e):void 0,headers:{"Content-Type":"application/json"}})}function sn(r,e){return Bs(TU(r),{params:e})}function lt(r,e){for(const t of e)if((r==null?void 0:r[t])!==void 0&&(r==null?void 0:r[t])!==null&&(r==null?void 0:r[t])!=="")return r[t]}function Oi(r){if(r==null||r==="")return;const e=Number(r);return Number.isNaN(e)?void 0:e}function St(r){const e=Oi(r);if(e!==void 0)return Number.isInteger(e)?e:Number(e.toFixed(2))}function Ni(r,e){const t=Oi(r),n=Oi(e);if(!(t===void 0||n===void 0||n===0))return t/n*100}function Im(r,e,t="占比"){var i;const n=St((i=lt(r,["areaPercent","area_percent","percent"]))!=null?i:Ni(lt(r,["areaWanMu","value"]),e));return n===void 0?"":`${t} ${n}%`}function go(r,e=""){const t=St(lt(r,["areaPercent","area_percent","percent"]));return t===void 0?"":`${e}${t}%`}function Ure(r,e=0){const t=lt(r,["name","title","label","zh","itemName","item_name"])||`指标${e+1}`,n=St(lt(r,["value","num","count","area","acreage","total"])),i=lt(r,["unit","unitName","unit_name"])||"";return{key:lt(r,["id","key","code"])||`${t}-${e}`,name:t,value:n,unit:i,source:r}}function Vre(r){return(Array.isArray(r)?r:(r==null?void 0:r.rows)||(r==null?void 0:r.list)||[]).map(Ure).filter(t=>t.name)}function Gre(r){const e=(r==null?void 0:r.core)||(r==null?void 0:r.summary)||r||{},t=((r==null?void 0:r.typeDistribution)||(r==null?void 0:r.typeStats)||[])[0]||{},n=((r==null?void 0:r.ecologicalPosition)||[])[0]||{};return[{key:"woodland-area",name:"林地总面积",value:St(lt(e,["totalAreaWanMu","total_area_wan_mu","areaWanMu","area_wan_mu"])),unit:"万亩"},{key:"woodland-main-type-rate",name:`${lt(t,["name"])||"主导类型"}占比`,value:St(lt(t,["areaPercent","area_percent","percent"])),unit:"%"},{key:"woodland-ecology-area",name:"生态重点区面积",value:St(lt(n,["areaWanMu","value"])),unit:"万亩"}]}function Hre(r){const e=(r==null?void 0:r.overview)||(r==null?void 0:r.summary)||r||{};return[{key:"grassland-total-area",name:"草地总面积",value:St(lt(e,["totalAreaWanMu","total_area_wan_mu","totalArea","total_area","areaWanMu"])),unit:lt(e,["areaUnit","area_unit"])||"万亩"},{key:"basic-grassland-area",name:"基本草原",value:St(lt(e,["basicAreaWanMu","basic_area_wan_mu","basicArea","basic_area"])),unit:lt(e,["areaUnit","area_unit"])||"万亩"},{key:"general-grassland-area",name:"一般草原",value:St(lt(e,["generalAreaWanMu","general_area_wan_mu","generalArea","general_area"])),unit:lt(e,["areaUnit","area_unit"])||"万亩"}]}function rc(r,e){const i=({woodland:[{key:"woodland-area",name:"林地总面积",unit:"万亩"},{key:"woodland-public-area",name:"公益林面积",unit:"万亩"},{key:"woodland-public-rate",name:"公益林占比",unit:"%"}],grassland:[{key:"grassland-area",name:"草地总面积",unit:"万亩"},{key:"basic-grassland",name:"基本草原",unit:"万亩"},{key:"general-grassland",name:"一般草原",unit:"万亩"}],wetland:[{key:"wetland-area",name:"湿地面积",unit:"万亩"},{key:"wetland-yield",name:"湿地生产力",unit:"万吨"},{key:"wetland-level-1-area",name:"1级湿地面积",unit:"万亩"}]}[e]||[]).map((a,o)=>{var s,l;return Xe(Re(Re({},a),r[o]||{}),{name:((s=r[o])==null?void 0:s.name)||a.name,unit:((l=r[o])==null?void 0:l.unit)||a.unit})});return i.length?i:r}function Wre(r){return Ge(this,null,function*(){let e;for(const t of r)try{return yield t()}catch(n){e=n}throw e||new Error("No request configured")})}function Sn(r=[],e={}){const{nameKeys:t=["name","townName","typeName"],valueKeys:n=["areaWanMu","value","totalAreaWanMu","basicAreaWanMu"],unit:i="万亩",max:a=Number.POSITIVE_INFINITY,extra:o}=e,s=r.map((l,u)=>{const c=St(lt(l,n)),h={key:lt(l,["key","code","townCode"])||`${lt(l,t)||u}-${u}`,name:lt(l,t)||`第${u+1}项`,value:c,unit:i,percent:St(lt(l,["percent","areaPercent","basicRatio","generalRatio"])),source:l};return o?Xe(Re({},h),{extra:o(l)}):h}).sort((l,u)=>(Number(u.value)||0)-(Number(l.value)||0));return Number.isFinite(a)?s.slice(0,a):s}function Nm(r=[],e={}){const{nameKeys:t=["name"],valueKeys:n=["value"],unit:i,max:a=Number.POSITIVE_INFINITY,extra:o}=e;return Sn(r,{nameKeys:t,valueKeys:n,unit:i,max:a,extra:o})}function $re(r=[],e={}){const{nameKeys:t=["grassMinType","name"],valueKeys:n=["acreage"],unit:i="万亩",max:a=Number.POSITIVE_INFINITY}=e,o=r.map((s,l)=>{const u=lt(s,n),c=St(i==="万亩"?Oi(u)/1e4:u),h=lt(s,t)||`第${l+1}项`;return{key:lt(s,["key","code"])||`${h}-${l}`,name:h,value:c,unit:i,source:s}}).filter(s=>Number(s.value)>0).sort((s,l)=>(Number(l.value)||0)-(Number(s.value)||0));return Number.isFinite(a)?o.slice(0,a):o}function Gt(r,e,t,n="rank",i={}){return Re({key:r,title:e,type:n,rows:t||[]},i)}function $0(r=[],e=[],t={}){const{unit:n="万吨",max:i=Number.POSITIVE_INFINITY,showMuYieldExtra:a=!0}=t,o=new Map(e.map(s=>[s.areaName,s]));return Sn(r,{nameKeys:["areaName","name"],valueKeys:["yield","value"],unit:n,max:i,extra:s=>{const l=o.get(s.areaName),u=St(lt(l,["yield","value"])),c=lt(l,["unit"])||"斤";return a&&u!==void 0?`亩产 ${u} ${c}`:""}})}function Kf(r){return String(r||"").replace(/\s+/g,"").trim()}function kv(r=[]){const e=new Map(zre.map((t,n)=>[t,n]));return[...r].sort((t,n)=>{const i=e.get(Kf(t==null?void 0:t.name)),a=e.get(Kf(n==null?void 0:n.name));return i!==void 0&&a!==void 0?i-a:i!==void 0?-1:a!==void 0?1:0})}function MU(r){const e=String(r||"");return{用于畜牧业生产的人工草地:"人工草地","对调节气候、涵养水源、保持水土、防风固沙具有特殊作用的草原":"生态调节草原",国家重点保护野生动植物生存环境的草原:"野生动植物栖息草原","草原科研、教学实验基地":"科研教学草原"}[e]||e}function X0(r){return MU(r).replace(/\s+/g,"").replace(/类$/,"")}function Y0(r){const e=String(r||""),t=e.match(/level-([1-8])/);if(t)return t[1];const n=e.match(/([1-8])\s*级/);if(n)return n[1];if(/^[1-8]$/.test(e.trim()))return e.trim();const a=Object.entries({一:"1",二:"2",三:"3",四:"4",五:"5",六:"6",七:"7",八:"8"}).find(([o])=>e.includes(`${o}级`));return(a==null?void 0:a[1])||""}function CU(r){return Y0(r==null?void 0:r.key)||Y0(r==null?void 0:r.name)}function h1(r=[],e={}){const{nameKeys:t=["name","townName","areaName"],valueKeys:n=["areaWanMu","value","totalAreaWanMu","yield"],unit:i="万亩"}=e;return r.map((a,o)=>{const s=Kf(lt(a,t)),l=St(lt(a,n));return!s||l===void 0?null:{key:lt(a,["key","code","townCode"])||`${s}-${o}`,name:s,value:l,unit:lt(a,["unit"])||i,source:a}}).filter(Boolean).sort((a,o)=>(Number(o.value)||0)-(Number(a.value)||0))}function Hb(r=[],e={}){const{nameKeys:t=["townName","name","areaName"],valueKeys:n=["areaWanMu","value","totalAreaWanMu","yield"],unit:i="万亩"}=e,a=new Map;return r.forEach(o=>{const s=Kf(lt(o,t)),l=Oi(lt(o,n));if(!s||l===void 0)return;const u=a.get(s)||{key:lt(o,["townCode","code"])||s,name:s,value:0,unit:lt(o,["unit"])||i,source:[]};u.value+=l,u.source.push(o),a.set(s,u)}),Array.from(a.values()).map(o=>Xe(Re({},o),{value:St(o.value)})).sort((o,s)=>(Number(s.value)||0)-(Number(o.value)||0))}function Vo({topicKey:r,layerKey:e,title:t,unit:n="万亩",rows:i=[],note:a="",metricLabel:o=""}){const s=i.filter(l=>(l==null?void 0:l.name)&&l.value!==void 0).sort((l,u)=>(Number(u.value)||0)-(Number(l.value)||0)).map((l,u)=>Xe(Re({},l),{unit:l.unit||n,rank:u+1}));return{status:s.length?"success":"empty",topicKey:r,layerKey:e,title:t,unit:n,metricLabel:o,note:a,rows:s}}function km(o){return Ge(this,arguments,function*({topicKey:r,layerKey:e,layerName:t,title:n,cqlFilter:i="",unit:a="万亩"}){const s=yield l1(t,{propertyName:["xiang","acreage"],cqlFilter:i,maxFeatures:2e5}),l=new Map;return((s==null?void 0:s.features)||[]).forEach(u=>{const c=u.properties||{},h=String(c.xiang||""),f=c1[h],d=Oi(c.acreage);if(!f||d===void 0)return;const p=l.get(f)||{key:h,name:f,value:0,unit:a};p.value+=d/1e4,l.set(f,p)}),Vo({topicKey:r,layerKey:e,title:n,unit:a,rows:Array.from(l.values()).map(u=>Xe(Re({},u),{value:St(u.value)})),note:"按 GeoServer 图斑属性汇总到乡镇"})})}function Xre(r,e,t="林地面积排行"){return Ge(this,null,function*(){const n=Lt(yield gl("/woodland/distribution"));return Vo({topicKey:r,layerKey:e,title:t,unit:"万亩",rows:h1((n==null?void 0:n.areaDistribution)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],unit:"万亩"})})})}function ID(r,e,t,n){return Ge(this,null,function*(){const i=Lt(yield sn("/basic_grassland/overview"));return Vo({topicKey:r,layerKey:e,title:n,unit:"万亩",rows:h1((i==null?void 0:i.townStats)||[],{nameKeys:["name"],valueKeys:[t],unit:"万亩"})})})}function Yre(r={},e=[],t=[]){const n=lt(r,t);if(n)return Kf(n);const i=e.map(o=>lt(r,[o])).find(o=>o!==void 0),a=String(i||"").slice(0,9);return c1[a]||""}function qre(r,e,t,n){return Ge(this,null,function*(){const i=(n==null?void 0:n.rankingTownCodeKeys)||(t==null?void 0:t.rankingTownCodeKeys)||["area_code","xiang","town_code"],a=(n==null?void 0:n.rankingTownNameKeys)||(t==null?void 0:t.rankingTownNameKeys)||["town_name","area_name","xiang_name"],o=(n==null?void 0:n.rankingAreaKeys)||(t==null?void 0:t.rankingAreaKeys)||["acreage","area_mu","area"],s=(n==null?void 0:n.rankingPropertyName)||[...i,...a,...o],l=yield l1(t.layerName,{propertyName:s,cqlFilter:n.cqlFilter,maxFeatures:2e5,timeout:25e3}),u=new Map;return((l==null?void 0:l.features)||[]).forEach(c=>{const h=c.properties||{},f=Yre(h,i,a),d=Oi(lt(h,o));if(!f||d===void 0)return;const p=u.get(f)||{key:f,name:f,value:0,unit:"万亩"};p.value+=d/1e4,u.set(f,p)}),Vo({topicKey:r,layerKey:e,title:`${n.name}面积排行`,unit:"万亩",metricLabel:n.name,rows:Array.from(u.values()).map(c=>Xe(Re({},c),{value:St(c.value),metricLabel:n.name})),note:"按选中图例过滤 GeoServer 图斑并汇总到乡镇"})})}function jre(r,e,t){return Ge(this,null,function*(){const n=Lt(yield sn("/basic_grassland/overview"));return Vo({topicKey:r,layerKey:e,title:`${t.name}面积排行`,unit:"万亩",metricLabel:t.name,rows:h1((n==null?void 0:n.townStats)||[],{nameKeys:["name"],valueKeys:[t.rankingValueKey],unit:"万亩"}).map(i=>Xe(Re({},i),{metricLabel:t.name}))})})}function f1(r,e,t,n,i={}){const a=ef(n||[],i).map(o=>Xe(Re({},o),{metricLabel:t.name}));return Vo({topicKey:r,layerKey:e,title:`${t.name}面积排行`,unit:"万亩",metricLabel:t.name,rows:a})}function Kre(r,e,t){return Ge(this,null,function*(){const n=CU(t);if(!n)return null;const i=Lt(yield sn("/grassland_grassland_level/distribution"));return f1(r,e,t,i,{nameKeys:["areaName","area_name","name"],valueKeys:["acreage","areaWanMu","value"],filter:a=>Y0(lt(a,["level","name"]))===n})})}function Zre(r,e,t){return Ge(this,null,function*(){const n=X0(t.name);if(!n)return null;const[i,a]=yield Promise.all([yn(()=>Ge(this,null,function*(){return Lt(yield sn("/grassland_grass_type/distribution"))})),yn(()=>Ge(this,null,function*(){return Lt(yield sn("/grassland_grass_type/minTypeAreaDistribution"))}))]);return f1(r,e,t,[...i||[],...a||[]],{nameKeys:["areaName","area_name","name"],valueKeys:["acreage","areaWanMu","value"],filter:o=>{const s=lt(o,["grassMinType","grass_min_type","grassType","grass_type","name"]);return X0(s)===n}})})}function Qre(r,e,t){return Ge(this,null,function*(){const n=CU(t);if(!n)return null;const i=Lt(yield sn("/wetland_grassland_level/distribution"));return f1(r,e,t,i,{nameKeys:["areaName","area_name","name"],valueKeys:["acreage","areaWanMu","value"],filter:a=>Y0(lt(a,["level","name"]))===n})})}function Jre(r,e,t){return Ge(this,null,function*(){const n=X0(t.name);if(!n)return null;const[i,a]=yield Promise.all([yn(()=>Ge(this,null,function*(){return Lt(yield sn("/wetland_grass_type_copy/distribution"))})),yn(()=>Ge(this,null,function*(){return Lt(yield sn("/wetland_grass_type_copy/minTypeAreaDistribution"))}))]);return f1(r,e,t,[...i||[],...a||[]],{nameKeys:["areaName","area_name","name"],valueKeys:["acreage","areaWanMu","value"],filter:o=>{const s=lt(o,["grassMinType","grass_min_type","grassType","grass_type","name"]);return X0(s)===n}})})}function eie(r,e,t){return Ge(this,null,function*(){if(!(t!=null&&t.key))return null;const n=mg(r,e);return n?r==="grassland"&&e==="basic-grassland"&&t.rankingValueKey?jre(r,e,t):r==="grassland"&&e==="grassland-level"?Kre(r,e,t):r==="grassland"&&e==="grassland-type"?Zre(r,e,t):r==="wetland"&&e==="wetland-level"?Qre(r,e,t):r==="wetland"&&e==="wetland-type"?Jre(r,e,t):t.cqlFilter&&n.layerName?qre(r,e,n,t):null:null})}function Om(r,e,t,n,i="万吨"){return Ge(this,null,function*(){const a=Lt(yield sn(t)),o=lt(a==null?void 0:a[0],["unit"])||i;return Vo({topicKey:r,layerKey:e,title:n,unit:o,rows:h1(a||[],{nameKeys:["areaName","name"],valueKeys:["yield","value"],unit:o})})})}function Kr(r=[],e=5){return r.slice(0,e)}function Qp(r=[],e={}){var c,h;const{limit:t=5,minPercent:n=1,otherName:i="其他类型"}=e,a=r.filter(f=>(f==null?void 0:f.name)&&Number(f.value)>0).sort((f,d)=>(Number(d.value)||0)-(Number(f.value)||0)),o=a.reduce((f,d)=>f+(Number(d.value)||0),0);if(!o||a.length<=t)return a;const s=[],l=[];if(a.forEach((f,d)=>{const p=Ni(f.value,o);d=n)?s.push(f):l.push(f)}),!l.length)return s;const u=l.reduce((f,d)=>f+(Number(d.value)||0),0);return[...s,{key:`${i}-${l.length}`,name:i,value:St(u),unit:((c=l[0])==null?void 0:c.unit)||((h=a[0])==null?void 0:h.unit)||"万亩",extra:`${St(Ni(u,o))}%`}]}function Bc(r=[]){return r.reduce((e,t)=>e+(Number(t.value)||0),0)}function Sa(r=[],e=Bc(r),t=""){return r.map(n=>{const i=St(Ni(n.value,e));return Xe(Re({},n),{extra:i===void 0?n.extra:`${t}${i}%`})})}function ND(r){return Array.isArray(r==null?void 0:r.rows)&&r.rows.length>0}function va(r=[],e=[],t=4){const n=[],i=new Set,a=s=>{!s||i.has(s.key)||(i.add(s.key),n.push(s))},o=[...r,...e];return o.filter(ND).forEach(a),o.filter(s=>s&&!ND(s)).forEach(a),n.slice(0,t)}function kD(r=[],e={}){const{headCount:t=4,headName:n="重点区域",tailName:i="其他区域"}=e,a=r.filter(u=>(u==null?void 0:u.name)&&Number(u.value)>0);if(!a.length)return[];const o=a.slice(0,t),s=a.slice(t),l=(u,c)=>{var h,f;return{key:u,name:u,value:St(c.reduce((d,p)=>d+(Number(p.value)||0),0)),unit:((h=c[0])==null?void 0:h.unit)||((f=a[0])==null?void 0:f.unit)||"万亩",extra:`${c.length}项`}};return[l(n,o),s.length?l(i,s):null].filter(u=>u&&Number(u.value)>0)}function bf(r,e,t){var s,l,u,c;if(!t)return r;const n={grassland:"grassland-distribution",wetland:"wetland-distribution",woodland:"woodland-distribution"}[e],i=((s=r==null?void 0:r.layerPanels)==null?void 0:s[t])||((l=r==null?void 0:r.layerPanels)==null?void 0:l[n]);if(!i)return r;const a=(u=i.leftPanels)!=null&&u.length?i.leftPanels:r.leftPanels,o=(c=i.rightPanels)!=null&&c.length?i.rightPanels:r.rightPanels;return Xe(Re({},r),{activeLayerKey:t||n,leftPanels:a,rightPanels:o,left:(a==null?void 0:a[0])||r.left,right:(o==null?void 0:o[0])||r.right})}function EU(r,e=["areaWanMu","value","acreage","areaMu"]){for(const t of e){const n=lt(r,[t]),i=Oi(n);if(i===void 0)continue;const a=String(t).toLowerCase(),o=String(lt(r,["unit","areaUnit","area_unit"])||"");return a.includes("wanmu")||o==="万亩"?i:a.includes("mu")||o==="亩"?i/1e4:i}}function ef(r=[],e={}){const{nameKeys:t=["name","areaName","townName"],valueKeys:n=["areaWanMu","value","acreage","areaMu"],nameTransform:i=l=>l,filter:a,extra:o}=e,s=new Map;return r.forEach(l=>{if(a&&!a(l))return;const u=lt(l,t),c=i(u,l),h=EU(l,n);if(!c||h===void 0)return;const f=s.get(c)||{key:lt(l,["key","code","townCode"])||c,name:c,value:0,unit:"万亩",source:[]};f.value+=h,f.source.push(l),s.set(c,f)}),Array.from(s.values()).map(l=>{const u=Xe(Re({},l),{value:St(l.value)});return o?Xe(Re({},u),{extra:o(u)}):u}).filter(l=>Number(l.value)>0).sort((l,u)=>(Number(u.value)||0)-(Number(l.value)||0))}function OD(r){return String(r||"").replace(/草原/g,"湿地")}function tie(r={},e=[]){var s;const t=(r==null?void 0:r.unit)||lt(e==null?void 0:e[0],["unit"])||"万吨",n=(s=Oi(r==null?void 0:r.xc))!=null?s:Bc(e),i=Oi(r==null?void 0:r.edibleXc),a=n!==void 0&&i!==void 0?Math.max(n-i,0):void 0,o=e[0];return[{key:"wetland-yield-total",name:"鲜草总产",value:St(n),unit:t,scaleValue:100},{key:"wetland-yield-edible",name:"可食鲜草",value:St(i),unit:t,scaleValue:St(Ni(i,n))},{key:"wetland-yield-unavailable",name:"不可食鲜草",value:St(a),unit:t,scaleValue:St(Ni(a,n))},{key:"wetland-yield-top-town",name:o!=null&&o.name?`${o.name}产量`:"最高乡镇产量",value:o==null?void 0:o.value,unit:(o==null?void 0:o.unit)||t,scaleValue:St(Ni(o==null?void 0:o.value,n))}].filter(l=>l.value!==void 0)}function LU({yieldSummary:r,townAreaRows:e,typeRows:t,levelRows:n,yieldRows:i,minTypeRows:a,muYieldRows:o,edibleYieldRows:s,edibleMuRows:l,typeTownRows:u,levelTownRows:c,minTownRows:h}){const f=Gt("wetland-town-area","湿地面积分布",kv(e),"line",{span:1,variant:"distribution"}),d=Gt("wetland-type","湿地类型结构",t,"donut",{span:1}),p=Gt("wetland-level-proportion","湿地级占比",Sa(n),"donut",{span:1}),g=Gt("wetland-min-type","湿地优势小类",Kr(a,6),"bar",{span:1}),v=Gt("wetland-yield-capacity","湿地产能结构",tie(r,i),"bar",{span:1,variant:"capacity"}),m=Gt("wetland-yield","湿地生产力分布",kv(i),"line",{span:1}),y=Gt("wetland-edible-yield","可食鲜草产量",Kr(s,6),"column",{span:1,variant:"slim"}),_=Gt("wetland-mu-yield","湿地亩产效率",Kr(o,6),"bar",{span:1}),x=Gt("wetland-level","湿地级别面积",n,"column",{span:1}),S=Gt("wetland-level-town","1级湿地分布",Kr(c,6),"bar",{span:1,variant:"distribution"}),A=Gt("wetland-type-town","湿地类型乡镇分布",Kr(u,6),"bar",{span:1,variant:"distribution"}),w=Gt("wetland-edible-mu","可食鲜草亩产",Kr(l,6),"bar",{span:1}),M=Gt("wetland-min-town","优势小类乡镇分布",Kr(h,6),"bar",{span:1,variant:"distribution"}),C=[f,d,p,g],b=[y,m,_,v];return{leftPanels:C,rightPanels:b,left:C[0],right:b[0],layerPanels:nie({townAreaPanel:f,typePanel:d,yieldCapacityPanel:v,yieldPanel:m,levelPanel:x,levelTownPanel:S,muYieldPanel:_,levelStructurePanel:p,typeTownPanel:A,minTypePanel:g,edibleYieldPanel:y,edibleMuPanel:w,minTownPanel:M})}}function nie(r={}){const{townAreaPanel:e,typePanel:t,yieldCapacityPanel:n,yieldPanel:i,levelPanel:a,levelTownPanel:o,muYieldPanel:s,levelStructurePanel:l,typeTownPanel:u,minTypePanel:c,edibleYieldPanel:h,edibleMuPanel:f,minTownPanel:d}=r;return{"wetland-distribution":{leftPanels:[e,t,l,c].filter(Boolean),rightPanels:[h,i,s,n].filter(Boolean)},"wetland-level":{leftPanels:[l,a,o,t].filter(Boolean),rightPanels:[h,i,s,n].filter(Boolean)},"wetland-type":{leftPanels:[t,u,c,d].filter(Boolean),rightPanels:[h,i,f,n].filter(Boolean)},"wetland-yield":{leftPanels:[e,t,l,c].filter(Boolean),rightPanels:[h,i,s,n].filter(Boolean)}}}function rie(r={}){const{leftPanels:e=[],rightPanels:t=[]}=r,n={leftPanels:e.filter(Boolean),rightPanels:t.filter(Boolean)};return{"grassland-distribution":n,"basic-grassland":n,"grassland-level":n,"grassland-type":n,"grassland-yield":n,"grassland-health":n}}function PU({townRows:r=[],typeRows:e=[],scaleRows:t=[],protectionRows:n=[],ownershipRows:i=[],qualityRows:a=[],originRows:o=[],ageRows:s=[],canopyRows:l=[],forestTypeRows:u=[],manageLevelRows:c=[],regionRows:h=[],ownerRows:f=[],typeTownRows:d=[],qualityLevelRows:p=[],townConcentrationRows:g=kD(r,{headCount:4,headName:"前四乡镇",tailName:"其他乡镇"}),typeConcentrationRows:v=kD(e,{headCount:2,headName:"主要类型",tailName:"其他类型"})}){const m=Gt("woodland-town","林地面积分布",kv(r),"line",{span:1,variant:"distribution"}),y=Gt("woodland-type","林地类型结构",e,"donut",{span:1}),_=Gt("woodland-protection","公益林保护等级",Sa(n),"structure",{span:1}),x=Gt("woodland-ownership","林地权属结构",Sa(i),"structure",{span:1}),S=Gt("woodland-quality","优势树种面积",Kr(a,6),"bar",{span:1}),A=Gt("woodland-origin","林地起源结构",Sa(o),"structure",{span:1}),w=Gt("woodland-age","林龄组结构",Kr(s,6),"column",{span:1}),M=Gt("woodland-canopy","郁闭度结构",Kr(l,6),"column",{span:1}),C=Gt("woodland-area-scale","林地图斑规模",t,"column",{span:1}),b=Gt("woodland-forest-type","森林类别结构",Kr(u,6),"bar",{span:1}),T=Gt("woodland-manage-level","管护等级分布",Kr(c,6),"bar",{span:1}),P=Gt("woodland-public-rank","公益林面积排行",Kr(h,6),"bar",{span:1,variant:"distribution"}),D=Gt("woodland-owner-rank","权属单位排行",Kr(f,6),"bar",{span:1}),L=Gt("woodland-type-town","乡镇类型构成",Kr(d,6),"bar",{span:1,variant:"distribution"}),E=Gt("woodland-quality-level","林地质量等级",Sa(p),"donut",{span:1}),I=Gt("woodland-town-concentration","林地集中度",Sa(g),"structure",{span:1}),N=Gt("woodland-type-concentration","类型集中度",Sa(v),"structure",{span:1}),R=va([m,y,_,x],[C,D,b,S]),F=va([S,A,w,M],[C,D,b,P,I,N]);return{leftPanels:R,rightPanels:F,left:R[0],right:F[0],layerPanels:iie({townPanel:m,typePanel:y,scalePanel:C,protectionPanel:_,ownershipPanel:x,qualityPanel:S,originPanel:A,agePanel:w,canopyPanel:M,forestTypePanel:b,manageLevelPanel:T,regionPanel:P,ownerPanel:D,typeTownPanel:L,qualityLevelPanel:E,townConcentrationPanel:I,typeConcentrationPanel:N})}}function iie(r={}){const{townPanel:e,typePanel:t,scalePanel:n,protectionPanel:i,ownershipPanel:a,qualityPanel:o,originPanel:s,agePanel:l,canopyPanel:u,forestTypePanel:c,manageLevelPanel:h,regionPanel:f,ownerPanel:d,typeTownPanel:p,qualityLevelPanel:g,townConcentrationPanel:v,typeConcentrationPanel:m}=r;return{"woodland-distribution":{leftPanels:va([e,t,i,a],[n,c,d]),rightPanels:va([o,s,l,u],[n,d,f,v,m,g])},"woodland-protection":{leftPanels:va([i,c,h,e],[t,a,n]),rightPanels:va([f,o,s,a],[d,t,n])},"woodland-type":{leftPanels:va([t,e,p,n],[i,a,c]),rightPanels:va([o,s,i,a],[l,u,d,m])},"woodland-quality":{leftPanels:va([o,s,l,u],[g,n,t]),rightPanels:va([e,t,i,a],[c,d,n])},"woodland-ownership":{leftPanels:va([a,d,e,t],[n,i,o]),rightPanels:va([i,o,s,n],[c,l,u])}}}function aie(r){const e=String(r||"").trim();return e.includes("未")&&e.includes("退")?"未退化":e.includes("轻")?"轻度退化":e.includes("中")?"中度退化":e.includes("重")?"重度退化":e||"未分级"}function oie(){return Ge(this,null,function*(){const r=yield l1("ne:t_grassland_result_caodi",{propertyName:["area_code","degradation_level","acreage"],maxFeatures:2e5,timeout:25e3}),e=new Map,t=new Map;((r==null?void 0:r.features)||[]).forEach(o=>{const s=o.properties||{},l=aie(s.degradation_level),u=Oi(s.acreage);if(!l||u===void 0)return;const c=u/1e4;if(e.set(l,(e.get(l)||0)+c),l==="未退化")return;const h=String(s.area_code||"").slice(0,9),f=c1[h];f&&t.set(f,(t.get(f)||0)+c)});const n=["未退化","轻度退化","中度退化","重度退化","未分级"],i=Array.from(e.entries()).map(([o,s])=>({key:o,name:o,value:St(s),unit:"万亩"})).filter(o=>Number(o.value)>0).sort((o,s)=>{const l=n.indexOf(o.name),u=n.indexOf(s.name);return l!==-1||u!==-1?(l===-1?99:l)-(u===-1?99:u):(Number(s.value)||0)-(Number(o.value)||0)}),a=Array.from(t.entries()).map(([o,s])=>({key:o,name:o,value:St(s),unit:"万亩"})).filter(o=>Number(o.value)>0).sort((o,s)=>(Number(s.value)||0)-(Number(o.value)||0));return{levelRows:Sa(i),townRows:a}})}function RU(r=[],e={},t=[],n=[]){var o;const i=lie(t).find(s=>s.key==="degraded-rate"),a=(o=Oi(e==null?void 0:e.xc))!=null?o:Bc(n);return[r[0],r[1],{key:"grassland-yield-total",name:"鲜草产量",value:St(a),unit:(e==null?void 0:e.unit)||"万吨"},i].filter(s=>(s==null?void 0:s.value)!==void 0)}function sie(r=[]){const e=Bc(r);return r.filter(t=>t.name&&t.name!=="未退化"&&Number(t.value)>0).map(t=>Xe(Re({},t),{extra:St(Ni(t.value,e))?`${St(Ni(t.value,e))}%`:""}))}function DU(r={},e=[]){var s;const t=(r==null?void 0:r.unit)||lt(e==null?void 0:e[0],["unit"])||"万吨",n=(s=Oi(r==null?void 0:r.xc))!=null?s:Bc(e),i=Oi(r==null?void 0:r.edibleXc),a=n!==void 0&&i!==void 0?Math.max(n-i,0):void 0,o=e.find(l=>Number(l.value)>0);return[{key:"forage-total",name:"鲜草总产",value:St(n),unit:t,scaleValue:100},{key:"forage-edible",name:"可食鲜草",value:St(i),unit:t,scaleValue:St(Ni(i,n))},{key:"forage-unavailable",name:"不可食鲜草",value:St(a),unit:t,scaleValue:St(Ni(a,n))},{key:"forage-top-town",name:o!=null&&o.name?`最高乡镇:${o.name}`:"最高乡镇产量",value:o==null?void 0:o.value,unit:(o==null?void 0:o.unit)||t,scaleValue:St(Ni(o==null?void 0:o.value,n))}].filter(l=>l.value!==void 0)}function IU(){return{levelRows:Sa([{key:"none",name:"未退化",value:642.42,unit:"万亩"},{key:"light",name:"轻度退化",value:83.95,unit:"万亩"},{key:"middle",name:"中度退化",value:17.49,unit:"万亩"},{key:"heavy",name:"重度退化",value:13.09,unit:"万亩"}]),townRows:[{key:"qiongxi",name:"邛溪镇",value:14.72,unit:"万亩"},{key:"sedi",name:"色地镇",value:13.86,unit:"万亩"},{key:"anqu",name:"安曲镇",value:12.38,unit:"万亩"},{key:"wache",name:"瓦切镇",value:10.64,unit:"万亩"},{key:"chaerma",name:"查尔玛乡",value:9.53,unit:"万亩"},{key:"amu",name:"阿木乡",value:8.71,unit:"万亩"}]}}function lie(r=[]){const e=Bc(r),t=r.filter(o=>o.name&&o.name!=="未退化"),n=Bc(t),i=t.filter(o=>o.name.includes("中")||o.name.includes("重")).reduce((o,s)=>o+(Number(s.value)||0),0),a=t.find(o=>o.name.includes("重"));return[{key:"degraded-total",name:"退化面积",value:St(n),unit:"万亩",icon:"area"},{key:"degraded-rate",name:"退化率",value:St(Ni(n,e)),unit:"%",icon:"rate"},{key:"medium-heavy-area",name:"中重度",value:St(i),unit:"万亩",icon:"risk"},{key:"heavy-area",name:"重度",value:a==null?void 0:a.value,unit:(a==null?void 0:a.unit)||"万亩",icon:"risk"}].filter(o=>o.value!==void 0)}function FD(r,e){if(r==="grassland"){const t=rc([{key:"grassland-area",name:"草地总面积",value:756.43,unit:"万亩"},{key:"basic-grassland",name:"基本草原",value:637.13,unit:"万亩"},{key:"general-grassland",name:"一般草原",value:119.31,unit:"万亩"}],r),n=Sn([{name:"色地镇",value:99.09,basicAreaWanMu:66.58},{name:"邛溪镇",value:93.01,basicAreaWanMu:70.6},{name:"安曲镇",value:90.08,basicAreaWanMu:73.49},{name:"阿木乡",value:86.3,basicAreaWanMu:77.31},{name:"查尔玛乡",value:80.8,basicAreaWanMu:79.04},{name:"瓦切镇",value:74.74,basicAreaWanMu:70.73},{name:"刷经寺镇",value:74.3,basicAreaWanMu:56.66},{name:"龙日镇",value:62.64,basicAreaWanMu:49.66},{name:"江茸乡",value:49.67,basicAreaWanMu:48.78},{name:"麦洼乡",value:45.82,basicAreaWanMu:44.28}],{nameKeys:["name"],valueKeys:["value"]}),i=Sn([{areaName:"邛溪镇",yield:38.88},{areaName:"色地镇",yield:37.78},{areaName:"安曲镇",yield:36.77},{areaName:"查尔玛乡",yield:33.21},{areaName:"瓦切镇",yield:32.62},{areaName:"阿木乡",yield:32.17},{areaName:"龙日镇",yield:24.43},{areaName:"刷经寺镇",yield:22.51},{areaName:"麦洼乡",yield:19.5},{areaName:"江茸乡",yield:19.43}],{nameKeys:["areaName"],valueKeys:["yield"],unit:"万吨"}),a=Qp([{key:"grazing",name:"重要放牧场",value:516.41,unit:"万亩"},{key:"general",name:"一般草原",value:119.31,unit:"万亩"},{key:"ecology",name:"生态调节草原",value:97.23,unit:"万亩"},{key:"mowing",name:"割草地",value:15.95,unit:"万亩"},{key:"improved",name:"改良草地",value:4.33,unit:"万亩"}],{limit:4,minPercent:3,otherName:"其他草原类型"}),o=Sn([{areaName:"瓦切镇",yield:798.39},{areaName:"查尔玛乡",yield:794.32},{areaName:"麦洼乡",yield:784.16},{areaName:"邛溪镇",yield:772.43},{areaName:"安曲镇",yield:770.9}],{nameKeys:["areaName"],valueKeys:["yield"],unit:"斤"}),l=IU().levelRows,u=Sa([{key:"level-3",name:"3级草原",value:200.9,unit:"万亩"},{key:"level-4",name:"4级草原",value:205.47,unit:"万亩"},{key:"level-5",name:"5级草原",value:385.42,unit:"万亩"},{key:"level-6",name:"6级草原",value:139.06,unit:"万亩"},{key:"level-7",name:"7级草原",value:3.68,unit:"万亩"},{key:"level-8",name:"8级草原",value:3.61,unit:"万亩"}]),c=Sa([{key:"good",name:"较健康",value:231.32,unit:"万亩"},{key:"healthy",name:"健康",value:481.87,unit:"万亩"},{key:"subhealthy",name:"亚健康",value:23.69,unit:"万亩"},{key:"unhealthy",name:"不健康",value:20.27,unit:"万亩"}]),h=DU({xc:297.29,edibleXc:192.26,unit:"万吨"},i),f=Sn([{areaName:"邛溪镇",yield:24.71},{areaName:"色地镇",yield:24.18},{areaName:"安曲镇",yield:23.48},{areaName:"查尔玛乡",yield:21.26},{areaName:"瓦切镇",yield:20.88},{areaName:"阿木乡",yield:20.59},{areaName:"龙日镇",yield:15.63},{areaName:"刷经寺镇",yield:14.41},{areaName:"麦洼乡",yield:12.48},{areaName:"江茸乡",yield:12.44}],{nameKeys:["areaName"],valueKeys:["yield"],unit:"万吨"}),d=kU({core:t,townRows:n,grassTypeRows:a,grassLevelRows:u,healthRows:c,productivityRows:o,edibleYieldRows:f,forageRows:h,degradationRows:l}),p=Xe(Re({status:"fallback"},d),{top:RU(t,{xc:297.29,unit:"万吨"},l,i)});return bf(p,r,e)}if(r==="wetland"){const t=rc([{key:"wetland-area",name:"湿地面积",value:291.82,unit:"万亩"},{key:"wetland-yield",name:"湿地生产力(鲜草)",value:108.84,unit:"万吨"},{key:"wetland-level-1-area",name:"1级湿地面积",value:213.22,unit:"万亩"}],r),n=Qp([{name:"高寒草甸类",value:190.32,unit:"万亩"},{name:"山地草甸类",value:49.48,unit:"万亩"},{name:"低地草甸类",value:3.21,unit:"万亩"}],{limit:4,minPercent:1,otherName:"其他湿地类型"}),i=[{name:"1级湿地",value:213.22,unit:"万亩"},{name:"2级湿地",value:22.99,unit:"万亩"},{name:"3级湿地",value:6.42,unit:"万亩"},{name:"4级湿地",value:.36,unit:"万亩"},{name:"5级湿地",value:.02,unit:"万亩"}],a=Sn([{areaName:"色地镇",yield:21.32},{areaName:"瓦切镇",yield:17.49},{areaName:"安曲镇",yield:15.19},{areaName:"邛溪镇",yield:13.41},{areaName:"阿木乡",yield:10.37},{areaName:"龙日镇",yield:10.11},{areaName:"麦洼乡",yield:9.67},{areaName:"江茸乡",yield:5.78},{areaName:"刷经寺镇",yield:3.43},{areaName:"查尔玛乡",yield:2.08}],{nameKeys:["areaName"],valueKeys:["yield"],unit:"万吨"}),o=[{name:"瓦切镇",value:944.22,unit:"斤"},{name:"安曲镇",value:913.28,unit:"斤"},{name:"麦洼乡",value:911.14,unit:"斤"},{name:"查尔玛乡",value:873.31,unit:"斤"},{name:"阿木乡",value:872,unit:"斤"}],s=[{name:"瓦切镇",value:36.38,unit:"万亩"},{name:"邛溪镇",value:29.29,unit:"万亩"},{name:"阿木乡",value:25.26,unit:"万亩"},{name:"龙日镇",value:24.59,unit:"万亩"},{name:"色地镇",value:24.62,unit:"万亩"}].sort((d,p)=>p.value-d.value),l=[{name:"矮生嵩草、杂类草型",value:108.35,unit:"万亩"},{name:"高山嵩草、矮生嵩草型",value:34.36,unit:"万亩"},{name:"西藏嵩草、杂类草型",value:32.37,unit:"万亩"},{name:"早熟禾、杂类草型",value:20.99,unit:"万亩"},{name:"苔草、杂类草型",value:14.63,unit:"万亩"}],u=Sn([{areaName:"色地镇",yield:2.82},{areaName:"邛溪镇",yield:2.71},{areaName:"瓦切镇",yield:2.64},{areaName:"麦洼乡",yield:1.76},{areaName:"安曲镇",yield:1.66}],{nameKeys:["areaName"],valueKeys:["yield"],unit:"万吨"}),c=Sn([{areaName:"阿木乡",yield:509.83},{areaName:"瓦切镇",yield:509.52},{areaName:"邛溪镇",yield:356.74},{areaName:"色地镇",yield:287.23},{areaName:"麦洼乡",yield:281.27}],{nameKeys:["areaName"],valueKeys:["yield"],unit:"斤"}),h=LU({core:t,yieldSummary:{xc:108.84,edibleXc:1.65,unit:"万吨"},townAreaRows:s,typeRows:n,levelRows:i,yieldRows:a,minTypeRows:l,muYieldRows:o,edibleYieldRows:u,edibleMuRows:c,typeTownRows:s,levelTownRows:s,minTownRows:s}),f=Re({status:"fallback",core:t,top:[t[0],t[1],t[2]]},h);return bf(f,r,e)}if(r==="woodland"){const t=rc([{key:"woodland-area",name:"林地总面积",value:177.92,unit:"万亩"},{key:"woodland-public-area",name:"公益林面积",value:159.33,unit:"万亩"},{key:"woodland-public-rate",name:"公益林占比",value:89.55,unit:"%"}],r),n=Sn([{name:"刷经寺镇",value:59.4,percent:33.39},{name:"色地镇",value:27.97,percent:15.72},{name:"查尔玛乡",value:22.6,percent:12.7},{name:"阿木乡",value:19.37,percent:10.89},{name:"江茸乡",value:11.61,percent:6.53},{name:"邛溪镇",value:8.29,percent:4.66},{name:"瓦切镇",value:7.98,percent:4.49},{name:"安曲镇",value:7.47,percent:4.2},{name:"龙日镇",value:7.08,percent:3.98},{name:"麦洼乡",value:6.14,percent:3.45}],{nameKeys:["name"],valueKeys:["value"],extra:h=>`占比 ${St(h.percent)}%`}),i=Qp([{name:"灌木林地",value:114.78,unit:"万亩"},{name:"乔木林地",value:49.56,unit:"万亩"},{name:"灌丛沼泽",value:8.79,unit:"万亩"},{name:"其他林地",value:4.79,unit:"万亩"}],{limit:4,minPercent:1,otherName:"其他林地"}),u=PU({townRows:n,typeRows:i,scaleRows:[{name:"15-150亩",value:96.91,unit:"万亩"},{name:"<15亩",value:39.99,unit:"万亩"},{name:"150-1500亩",value:30.81,unit:"万亩"},{name:"≥1500亩",value:10.21,unit:"万亩"}],protectionRows:[{name:"国家二级公益林",value:158.33,unit:"万亩",extra:"88.99%"},{name:"未划定",value:18.72,unit:"万亩",extra:"10.52%"},{name:"国家一级公益林",value:.88,unit:"万亩",extra:"0.49%"}],ownershipRows:[{name:"集体林地",value:172.19,unit:"万亩",extra:"96.78%"},{name:"国有或其他",value:5.73,unit:"万亩",extra:"3.22%"}],ownerRows:[{name:"壤口村",value:42.74,unit:"万亩",extra:"占比 24.02%"},{name:"查龙村",value:16.34,unit:"万亩",extra:"占比 9.18%"},{name:"茸塔玛村",value:14.96,unit:"万亩",extra:"占比 8.41%"},{name:"峨扎村",value:9.96,unit:"万亩",extra:"占比 5.6%"},{name:"三家寨村",value:9.57,unit:"万亩",extra:"占比 5.38%"}]}),c=Re({status:"fallback",core:t,top:[t[0],t[1],t[2]]},u);return bf(c,r,e)}return{status:"empty",core:rc([],r),leftPanels:[],rightPanels:[],left:{title:"业务统计",rows:[]},right:{title:"业务统计",rows:[]}}}function NU(r=[],e=["name"]){const t=new Map;return r.forEach(n=>{const i=lt(n,e);!i||t.has(i)||t.set(i,n)}),Array.from(t.values())}function yn(r,e=[]){return r().catch(()=>e)}function SS(r=[],e={}){const{nameKeys:t=["name","health","level"],valueKeys:n=["value","acreage","areaWanMu"],unit:i="万亩",nameTransform:a=l=>l,max:o=Number.POSITIVE_INFINITY}=e,s=Sn(r||[],{nameKeys:t,valueKeys:n,unit:i}).map(l=>Xe(Re({},l),{name:a(l.name)}));return Sa(s).filter(l=>Number(l.value)>0).slice(0,o)}function uie(r){const e=String(r||"");return/^\d+$/.test(e)?`${e}级草原`:e.includes("级")?e.replace(/草地/g,"草原"):e}function cie(r){const e=String(r||"");return{healthy:"健康",subhealthy:"亚健康",unhealthy:"不健康"}[e]||e}function kU({core:r,townRows:e,grassTypeRows:t,grassLevelRows:n,healthRows:i,productivityRows:a,edibleYieldRows:o,forageRows:s,degradationRows:l}){const u=Gt("grassland-town","草地面积分布",kv(e),"line",{span:1}),c=Gt("grassland-productivity-town","草地生产力分布",kv(a),"line",{span:1}),h=Gt("grassland-type-proportion","草原类占比",t,"donut",{span:1}),f=Gt("grassland-edible-yield","可食鲜草产量分布",Kr(o,10),"column",{span:1,variant:"slim"}),d=Gt("grassland-degradation","草地退化统计",sie(l),"structure",{span:1}),p=Gt("grassland-health-proportion","草地健康占比",i,"donut",{span:1}),g=Gt("grassland-level-proportion","草原级占比",n,"donut",{span:1}),v=Gt("grassland-forage-capacity","饲草供给",s,"bar",{span:1,variant:"capacity"}),m=[u,h,d,g],y=[f,c,p,v];return{core:r,leftPanels:m,rightPanels:y,left:m[0],right:y[0],layerPanels:rie({leftPanels:m,rightPanels:y})}}function hie(r,e={}){const t=Vre(r),n=NU(e.typeRows||[],["name"]),i=e.yieldRows||[],a=e.levelRows||[],o=e.minTypeRows||[],s=e.edibleRows||[],l=e.edibleMuRows||[],u=e.typeDistributionRows||[],c=e.levelDistributionRows||[],h=e.minTypeDistributionRows||[],f=e.yieldSummary||{},d=Qp(Nm(n,{nameKeys:["name"],valueKeys:["value"],unit:"万亩"}),{limit:4,minPercent:1,otherName:"其他湿地类型"}),p=$0(i,e.muYieldRows||[],{showMuYieldExtra:!1}),g=Nm(e.muYieldRows||[],{nameKeys:["areaName","name"],valueKeys:["yield","value"],unit:"斤",max:5}),v=Nm(a,{nameKeys:["name"],valueKeys:["value"],unit:"万亩"}).map(P=>Xe(Re({},P),{name:OD(P.name)})),m=$re(o),y=$0(s,l,{showMuYieldExtra:!1}),_=Nm(l,{nameKeys:["areaName","name"],valueKeys:["yield","value"],unit:lt(l==null?void 0:l[0],["unit"])||"斤",max:5}),x=ef(u,{nameKeys:["areaName","name"],valueKeys:["acreage","areaWanMu","value"]}),S=ef(u,{nameKeys:["areaName","name"],valueKeys:["acreage","areaWanMu","value"],extra:P=>{var D;return`${((D=P.source)==null?void 0:D.length)||0}类`}}),A=ef(c,{nameKeys:["areaName","name"],valueKeys:["acreage","areaWanMu","value"]}),w=ef(c,{nameKeys:["areaName","name"],valueKeys:["acreage","areaWanMu","value"],filter:P=>OD(lt(P,["level","name"])).startsWith("1级")}),M=ef(h,{nameKeys:["areaName","name"],valueKeys:["acreage","areaWanMu","value"],extra:P=>{var D;return`${((D=P.source)==null?void 0:D.filter(L=>EU(L,["acreage","areaWanMu","value"])>0).length)||0}型`}}),C=rc(t,"wetland"),b=v.find(P=>/^1级/.test(P.name))||v[0],T=LU({yieldSummary:f,townAreaRows:x,typeRows:d,levelRows:v,yieldRows:p,minTypeRows:m,muYieldRows:g,edibleYieldRows:y,edibleMuRows:_,typeTownRows:S,levelTownRows:w.length?w:A,minTownRows:M});return Re({core:C,top:[C[0],C[1],{key:"wetland-level-1-area",name:"1级湿地面积",value:b==null?void 0:b.value,unit:(b==null?void 0:b.unit)||"万亩"}].filter(Boolean)},T)}function fie(r,e){return Ge(this,null,function*(){var t;try{if(r==="woodland"){const[n,i,a,o,s]=yield Promise.all([gl("/woodland/distribution").then(Lt),yn(()=>Ge(this,null,function*(){return Lt(yield gl("/woodland/types"))}),{}),yn(()=>Ge(this,null,function*(){return Lt(yield gl("/woodland/protection"))}),{}),yn(()=>Ge(this,null,function*(){return Lt(yield gl("/woodland/quality"))}),{}),yn(()=>Ge(this,null,function*(){return Lt(yield gl("/woodland/ownership"))}),{})]),l=rc(Gre(n),r),u=lt((n==null?void 0:n.core)||(n==null?void 0:n.summary)||{},["totalAreaWanMu","total_area_wan_mu","areaWanMu","area_wan_mu"]),c=lt((a==null?void 0:a.summary)||{},["publicAreaWanMu","public_area_wan_mu"]),h=[l[0],{key:"woodland-public-area",name:"公益林面积",value:St(c),unit:"万亩"},{key:"woodland-public-rate",name:"公益林占比",value:St((t=lt((a==null?void 0:a.summary)||{},["publicAreaPercent","public_area_percent"]))!=null?t:Ni(c,u)),unit:"%"}].filter(Boolean),f=Sn((n==null?void 0:n.areaDistribution)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:D=>Im(D,u)}),d=Qp(Sn((i==null?void 0:i.typeStats)||(n==null?void 0:n.typeDistribution)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:go}),{limit:4,minPercent:1,otherName:"其他林地"}),p=Sn((n==null?void 0:n.patchScale)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:D=>Im(D,u)}),g=Sn((a==null?void 0:a.protectionLevels)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:go}),v=Sn((o==null?void 0:o.speciesRanks)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],max:6,extra:go}),m=Sn((s==null?void 0:s.ownerRanks)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],max:6,extra:D=>Im(D,u)}),y=Sn((s==null?void 0:s.landOwnerships)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:go}),_=Sn((a==null?void 0:a.forestTypes)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],max:6,extra:go}),x=Sn((a==null?void 0:a.manageLevels)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],max:6,extra:go}),S=Sn((a==null?void 0:a.regionRanks)||[],{nameKeys:["regionName","name","townName"],valueKeys:["areaWanMu","value"],max:6,extra:D=>Im(D,c)}),A=Sn((o==null?void 0:o.origins)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:go}),w=Sn((o==null?void 0:o.ageGroups)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:go}),M=Sn((o==null?void 0:o.canopyLevels)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:D=>{const L=St(lt(D,["avgCanopy","avg_canopy"]));return L!==void 0?`均值 ${L}`:go(D)}}),C=Sn((o==null?void 0:o.qualityLevels)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:go}),b=Hb((i==null?void 0:i.townComposition)||[],{nameKeys:["townName","name"],valueKeys:["areaWanMu","value"]}).slice(0,6),T=PU({townRows:f,typeRows:d,scaleRows:p,protectionRows:g,ownershipRows:y,qualityRows:v,originRows:A,ageRows:w,canopyRows:M,forestTypeRows:_,manageLevelRows:x,regionRows:S,ownerRows:m,typeTownRows:b,qualityLevelRows:C}),P=Re({status:"success",core:l,top:h},T);return bf(P,r,e)}if(r==="grassland"){const[n,i,a,o,s,l,u,c,h]=yield Promise.all([sn("/basic_grassland/overview").then(Lt),yn(()=>Ge(this,null,function*(){return Lt(yield sn("/grassland_yield/yieldProportion"))}),{}),yn(()=>Ge(this,null,function*(){return Lt(yield sn("/grassland_yield/distribution"))})),yn(()=>Ge(this,null,function*(){return Lt(yield sn("/grassland_yield/muYieldDistribution"))})),yn(()=>Ge(this,null,function*(){return oie()}),IU()),yn(()=>Ge(this,null,function*(){return Lt(yield sn("/grassland_grass_type/areaProportion"))})),yn(()=>Ge(this,null,function*(){return Lt(yield sn("/grassland_grassland_level/areaProportion"))})),yn(()=>Ge(this,null,function*(){return Lt(yield sn("/grassland_health/proportion"))})),yn(()=>Ge(this,null,function*(){return Lt(yield sn("/grassland_yield/edibleXcDistribution"))}))]),f=s.levelRows||[],d=rc(Hre(n),r),p=$0(a||[],o||[],{showMuYieldExtra:!1}),g=Sn(o||[],{nameKeys:["areaName","name"],valueKeys:["yield","value"],unit:lt(o==null?void 0:o[0],["unit"])||"斤"}),v=Sn((n==null?void 0:n.townStats)||[],{nameKeys:["name"],valueKeys:["totalAreaWanMu"]}),m=SS(NU(l||[],["name"]),{nameKeys:["name"],valueKeys:["value","areaWanMu","acreage"],unit:"万亩",nameTransform:MU}),y=SS(u||[],{nameKeys:["name","level"],valueKeys:["value","areaWanMu","acreage"],unit:"万亩",nameTransform:uie}),_=SS(c||[],{nameKeys:["health","name"],valueKeys:["acreage","value","areaWanMu"],unit:"万亩",nameTransform:cie}),x=$0(h||[],[],{showMuYieldExtra:!1}),S=kU({core:d,townRows:v,grassTypeRows:m,grassLevelRows:y,healthRows:_,productivityRows:g,edibleYieldRows:x,forageRows:DU(i,p),degradationRows:f}),A=Xe(Re({status:"success"},S),{top:RU(d,i,f,p)});return bf(A,r,e)}if(r==="wetland"){const[n,i,a,o,s,l,u,c,h,f,d,p]=yield Promise.all([Wre([()=>Ge(this,null,function*(){return Lt(yield sn("/index/dataItem",{group:"wetland"}))}),()=>Ge(this,null,function*(){return Lt(yield sn("/index/dataItem",{group:"wetland_grassland_level"}))})]),yn(()=>Ge(this,null,function*(){return Lt(yield sn("/wetland_grass_type_copy/areaProportion"))})),yn(()=>Ge(this,null,function*(){return Lt(yield sn("/wetland_yield/distribution"))})),yn(()=>Ge(this,null,function*(){return Lt(yield sn("/wetland_yield/muYieldDistribution"))})),yn(()=>Ge(this,null,function*(){return Lt(yield sn("/wetland_grassland_level/areaProportion"))})),yn(()=>Ge(this,null,function*(){return Lt(yield sn("/wetland_grass_type_copy/minTypeAreaProportion"))})),yn(()=>Ge(this,null,function*(){return Lt(yield sn("/wetland_yield/edibleXcDistribution"))})),yn(()=>Ge(this,null,function*(){return Lt(yield sn("/wetland_yield/edibleXcMuDistribution"))})),yn(()=>Ge(this,null,function*(){return Lt(yield sn("/wetland_grass_type_copy/distribution"))})),yn(()=>Ge(this,null,function*(){return Lt(yield sn("/wetland_grassland_level/distribution"))})),yn(()=>Ge(this,null,function*(){return Lt(yield sn("/wetland_grass_type_copy/minTypeAreaDistribution"))})),yn(()=>Ge(this,null,function*(){return Lt(yield sn("/wetland_yield/yieldProportion"))}),{})]),g=hie(n,{typeRows:i,yieldRows:a,muYieldRows:o,levelRows:s,minTypeRows:l,edibleRows:u,edibleMuRows:c,typeDistributionRows:h,levelDistributionRows:f,minTypeDistributionRows:d,yieldSummary:p}),v=Xe(Re({status:"success"},g),{left:g.leftPanels[0],right:g.rightPanels[0]});return bf(v,r,e)}return FD(r,e)}catch(n){return Xe(Re({},FD(r,e)),{status:"error",error:n})}})}function die(r,e,t=null){return Ge(this,null,function*(){try{const n=yield eie(r,e,t);return n||(r==="woodland"?e==="woodland-protection"?yield km({topicKey:r,layerKey:e,layerName:"ne:t_woodland_2023",title:"公益林面积排行",cqlFilter:"gjgyl_bhdj IN ('1','2')"}).catch(()=>Ge(this,null,function*(){const i=Lt(yield gl("/woodland/protection")),a=Hb((i==null?void 0:i.regionRanks)||[],{nameKeys:["townName"],valueKeys:["areaWanMu"],unit:"万亩"});return Vo({topicKey:r,layerKey:e,title:"公益林面积排行",unit:"万亩",rows:a,note:"按公益林村级榜单汇总到乡镇"})})):e==="woodland-type"?yield km({topicKey:r,layerKey:e,layerName:"ne:t_woodland_2023",title:"林地类型面积排行"}).catch(()=>Ge(this,null,function*(){const i=Lt(yield gl("/woodland/types")),a=Hb((i==null?void 0:i.townComposition)||[],{nameKeys:["townName"],valueKeys:["areaWanMu"],unit:"万亩"});return Vo({topicKey:r,layerKey:e,title:"林地类型面积排行",unit:"万亩",rows:a,note:"按林地类型组成汇总到乡镇"})})):e==="woodland-quality"?yield km({topicKey:r,layerKey:e,layerName:"ne:t_woodland_2023",title:"林地质量面积排行",cqlFilter:"zl_dj IS NOT NULL"}):e==="woodland-ownership"?yield km({topicKey:r,layerKey:e,layerName:"ne:t_woodland_2023",title:"林地权属面积排行",cqlFilter:"ld_qs IS NOT NULL"}):yield Xre(r,e,"林地面积排行"):r==="grassland"?e==="basic-grassland"?yield ID(r,e,"basicAreaWanMu","基本草原面积排行"):e==="grassland-level"?yield Om(r,e,"/grassland_yield/muYieldDistribution","草地亩产排行","斤"):yield ID(r,e,"totalAreaWanMu","草地面积排行"):r==="wetland"?e==="wetland-level"?yield Om(r,e,"/wetland_yield/muYieldDistribution","湿地亩产排行","斤"):e==="wetland-type"?yield Om(r,e,"/wetland_yield/edibleXcDistribution","可食鲜草产量排行","万吨"):yield Om(r,e,"/wetland_yield/distribution","湿地生产力排行","万吨"):Vo({topicKey:r,layerKey:e,title:"乡镇统计排行",rows:[]}))}catch(n){return{status:"error",topicKey:r,layerKey:e,title:"乡镇统计排行",unit:"",rows:[],error:n}}})}const pie={class:"topic-switcher"},vie={class:"topic-switcher-menu"},gie=["onClick"],mie={class:"topic-name"},OC={__name:"TopicSwitcher",props:{modelValue:{type:String,required:!0},topics:{type:Array,default:()=>jf}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=Se(()=>{var o;return(o=t.topics)!=null&&o.length?t.topics:jf});function a(o,s){var l,u;(u=(l=o.currentTarget)==null?void 0:l.blur)==null||u.call(l),n("update:modelValue",s)}return(o,s)=>(ie(),oe("div",pie,[s[1]||(s[1]=G("div",{class:"topic-switcher-arrow"},[G("img",{src:_0,alt:""}),G("img",{src:x0,alt:""})],-1)),G("div",vie,[(ie(!0),oe(it,null,vt(i.value,l=>(ie(),oe("button",{key:l.key,class:Vt(["topic-switcher-item",{"is-active":l.key===r.modelValue}]),style:un({"--topic-color":l.color}),type:"button",onMousedown:s[0]||(s[0]=Nc(()=>{},["prevent"])),onClick:u=>a(u,l.key)},[G("span",mie,Te(l.name),1)],46,gie))),128))]),s[2]||(s[2]=G("div",{class:"topic-switcher-arrow is-reverse"},[G("img",{src:_0,alt:""}),G("img",{src:x0,alt:""})],-1))]))}};const yie={class:"layer-panel"},_ie={class:"layer-panel-list"},xie=["onClick"],Sie={key:0,class:"layer-panel-empty"},Aie={class:"layer-panel-legend"},wie=["disabled","title","onClick"],bie={class:"legend-name"},Tie={key:0,class:"legend-check"},Mie={key:1,class:"layer-panel-empty is-legend"},OU={__name:"LayerPanel",props:{topicKey:{type:String,required:!0},modelValue:{type:String,default:""},legends:{type:Array,default:()=>[]},selectedLegendKey:{type:String,default:""},height:{type:Number,default:0},width:{type:Number,default:232}},emits:["update:modelValue","update:selectedLegendKey"],setup(r,{emit:e}){const t=r,n=e,i=Se(()=>s1(t.topicKey)),a=Se(()=>t.legends.filter(c).length>1),o=Se(()=>t.legends.length===1),s=Se(()=>t.height?t.height:430);function l(f,d){var p,g;(g=(p=f.currentTarget)==null?void 0:p.blur)==null||g.call(p),n("update:modelValue",d)}function u(f,d){var p,g;(g=(p=f.currentTarget)==null?void 0:p.blur)==null||g.call(p),h(d)&&n("update:selectedLegendKey",t.selectedLegendKey===d.key?"":d.key)}function c(f){return(f==null?void 0:f.selectable)===!1?!1:!!(f!=null&&f.key&&(f.cqlFilter||f.rankingValueKey))}function h(f){return a.value&&c(f)}return(f,d)=>(ie(),Ji(tn,{title:"图层控制",width:r.width,height:s.value},{default:Xt(()=>[G("div",yie,[G("div",_ie,[(ie(!0),oe(it,null,vt(i.value,p=>(ie(),oe("button",{key:p.key,class:Vt(["layer-panel-item",{"is-active":p.key===r.modelValue,"is-checked":p.key===r.modelValue}]),type:"button",onMousedown:d[0]||(d[0]=Nc(()=>{},["prevent"])),onClick:g=>l(g,p.key)},[G("span",null,Te(p.name),1),d[2]||(d[2]=G("i",null,null,-1))],42,xie))),128)),i.value.length?Tt("",!0):(ie(),oe("div",Sie,"暂无图层配置"))]),G("div",Aie,[d[3]||(d[3]=G("div",{class:"layer-panel-section-title"},"图例",-1)),r.legends.length?(ie(),oe("div",{key:0,class:Vt(["layer-panel-legend-grid",{"is-single":o.value}])},[(ie(!0),oe(it,null,vt(r.legends,p=>(ie(),oe("button",{key:p.key||p.name,class:Vt(["layer-panel-legend-row",{"is-selected":h(p)&&p.key===r.selectedLegendKey,"is-checkable":h(p),"is-disabled":!h(p)}]),type:"button",disabled:!h(p),title:p.name,onMousedown:d[1]||(d[1]=Nc(()=>{},["prevent"])),onClick:g=>u(g,p)},[G("span",{class:"legend-swatch",style:un({backgroundColor:p.fillColor,borderColor:p.strokeColor||p.fillColor})},null,4),G("span",bie,Te(p.name),1),h(p)?(ie(),oe("i",Tie)):Tt("",!0)],42,wie))),128))],2)):(ie(),oe("div",Mie,"暂无图例"))])])]),_:1},8,["width","height"]))}};const Cie={class:"feature-info"},Eie={key:0,class:"feature-info-state"},Lie={key:1,class:"feature-info-state"},Pie={key:2,class:"feature-info-state"},Rie={key:0,class:"feature-table"},Die=["title"],Iie={key:1,class:"feature-info-state is-inline"},FU={__name:"FeatureInfoPanel",props:{feature:{type:Object,default:null},empty:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},height:{type:Number,default:380},width:{type:Number,default:430}},setup(r){const e=r,t=[[["town_name","xiangName","xiang_name","xiang","xzqmc","xzqdm","town_code","area_code"],"所在乡镇"],[["village_name","cunName","cun_name","cun","c_name","cmc"],"所在村"],[["full_name"],"所在区域"],[["land_number","patch_no"],"图斑编号"],[["areaWanMu","area_wan_mu","area_mu","acreage","mj","xbmj","tbdlmj","tbmj","geomj","shape_area"],"图斑面积"]],n=[[["investigator"],"调查人"],[["survey_time","dc_rq","sjnf","delimitation_year"],"调查时间"],[["adjust_opinion_name"],"调整意见"],[["adjust_reason"],"调整原因"]],i={woodland:[[["dlmc","layer_class_name"],"地类名称"],...t,[["qsdwmc"],"权属单位"],[["zldwmc"],"坐落单位"],[["lin_ban"],"林班"],[["xiao_ban"],"小班"],[["ld_qs","tdsyqs","qsxz","ownership_name","ownership"],"土地权属"],[["gjgyl_bhdj","bh_dj","protection_level_name","protection_level"],"保护等级"],[["sen_lin_lb","forest_type"],"森林类别"],[["lin_zhong","forest_category"],"林种"],[["zl_dj","quality_level_name","quality_level"],"质量等级"],[["you_shi_sz","tree_species","dominant_tree_species"],"优势树种"],[["qi_yuan","origin"],"起源"],[["ling_zu"],"龄组"],[["yu_bi_du"],"郁闭度"],[["pingjun_sg"],"平均树高"],[["mei_gq_zs"],"每公顷株数"],[["mei_gq_xj"],"每公顷蓄积"],[["huo_lm_xj"],"活立木蓄积"],[["sheng_wu_l"],"生物量"],[["tan_chu_l"],"碳储量"],[["stqwmc"],"生态区位"],[["po_du","slope"],"坡度"],[["po_wei"],"坡位"],[["tu_ceng_hd","soil_depth"],"土层厚度"],...n],grassland:[...t,[["land_class_name","land_use_name","land_use"],"地类名称"],[["land_type"],"资源大类"],[["resource_type"],"资源类别"],[["grassland_category_name","grassland category","base_grass"],"草原类别"],[["basic_type_name"],"基本草原类型"],[["grass_type_name","grassland_type_name","grass_type"],"草原类"],[["grass_min_type"],"草原型"],[["grassland_level_name","grassland_level","level_name","level"],"草原级别"],[["degradation_level_name","degradation_level"],"退化等级"],[["vegetation_structure_name","vegetation_structure"],"植被结构"],[["vegetation_cover"],"植被盖度"],[["lbmjbl"],"裸斑面积比例"],[["dominance_level"],"优势度"],[["dominant_grass_species"],"优势草种"],[["functional_category"],"功能类别"],[["xc_yield"],"鲜草产量"],[["xc_mu_yield","xb_xc_mu_yield","mu_yield"],"鲜草亩产"],[["xb_xc_yield"],"小班鲜草产量"],[["xb_xc_mu_yield"],"小班鲜草亩产"],[["gc_yield"],"干草产量"],[["gc_mu_yield","xb_gc_mu_yield"],"干草亩产"],[["xb_gc_yield"],"小班干草产量"],[["xb_gc_mu_yield"],"小班干草亩产"],[["elevation"],"海拔"],[["landform_name","landform"],"地貌"],[["slope"],"坡度"],[["aspect"],"坡向"],[["soil_depth","tu_ceng_hd"],"土层厚度"],[["soil texture"],"土壤质地"],[["sddl"],"三调地类"],[["hqlm"],"划区轮牧"],[["cdsyq"],"草地所有权"],[["cdsyq2"],"草地使用权"],[["cdjjq"],"草地经营权"],...n],wetland:[[["grass_min_type","grassland_category_name","grassland_type_name","land_class_name","land_use_name"],"湿地类型"],...t,[["grass_type_name","grass_type"],"湿地草地型"],[["grassland_level_name","grassland_level","level_name","level"],"湿地级别"],[["vegetation_structure_name","vegetation_structure"],"植被结构"],[["vegetation_cover"],"植被盖度"],[["dominant_grass_species"],"优势草种"],[["functional_category"],"功能类别"],[["xc_yield","xb_xc_yield"],"鲜草产量"],[["xc_mu_yield","xb_xc_mu_yield","mu_yield"],"鲜草亩产"],[["edible_xc_yield"],"可食鲜草产量"],[["edible_xc_mu_yield"],"可食鲜草亩产"],[["gc_yield","xb_gc_yield"],"干草产量"],[["elevation"],"海拔"],[["landform_name","landform"],"地貌"],[["soil_depth","tu_ceng_hd"],"土层厚度"],...n],ecological:[[["type"],"管控分区"],[["project_name"],"项目名称"],[["project_category"],"项目类型"],[["measure_type"],"措施类型"],[["feature_role"],"要素类型"],[["township"],"涉及乡镇"],[["year"],"建设年份"],[["totalAcreage"],"总面积"],[["cdAcreage"],"草地面积"],[["sdAcreage"],"湿地面积"],[["area_mu"],"治理面积"],[["length_meter"],"工程长度"],[["cdScl"],"草地生产力"],[["sdScl"],"湿地生产力"],[["geometry_type"],"几何类型"]]},a={513233100:"邛溪镇",513233101:"刷经寺镇",513233103:"安曲镇",513233105:"龙日镇",513233202:"江茸乡",513233203:"查尔玛乡",513233204:"瓦切镇",513233205:"阿木乡",513233207:"麦洼乡",513233208:"色地镇","513233101000":"刷经寺镇","513233103000":"安曲镇","513233105000":"龙日镇"},o={land_type:{1:"草地",2:"湿地",caodi:"草地",shidi:"湿地",woodland:"林地",grassland:"草地",wetland:"湿地"},vegetation_structure:{1:"草本型"},landform:{2:"平原",5:"中山",6:"高山"},land_use:{"0401":"天然牧草地","0403":"人工牧草地","0404":"其他草地"},sddl:{"0401":"天然牧草地","0403":"人工牧草地","0404":"其他草地"},ld_qs:{10:"集体林地",20:"国有或其他"},qsxz:{10:"集体林地",20:"国有或其他"},tdsyqs:{10:"集体林地",20:"国有或其他"},gjgyl_bhdj:{0:"未划定",1:"国家一级公益林",2:"国家二级公益林"},bh_dj:{0:"未划定",1:"国家一级公益林",2:"国家二级公益林"},zl_dj:{2:"二级质量",3:"三级质量",4:"四级质量",5:"五级质量"},po_wei:{1:"脊部",2:"上坡",3:"中坡",4:"下坡",5:"谷地",6:"平地"}},s=new Set(["lin_zhong","sen_lin_lb","you_shi_sz","qi_yuan","ling_zu","po_xiang","tu_rang_lx","ownership","ownership_name","protection_level","forest_category","forest_type","quality_level","origin","tree_species","dominant_tree_species","base_grass","degradation_level","land_class","grass_type"]),l={xiang:"所在乡镇",xzqdm:"所在乡镇",xzqmc:"所在乡镇",town_code:"所在乡镇",area_code:"所在乡镇",cun:"所在村",cmc:"所在村",c_name:"所在村",acreage:"图斑面积",mj:"图斑面积",xbmj:"小班面积",tbdlmj:"图斑地类面积",geomj:"图斑面积",tbmj:"图斑面积",shape_area:"图斑面积",area_mu:"图斑面积",grass_min_type:"草原型",grass_type:"草原类",grass_type_name:"草原类",grassland_type_name:"草原类",patch_no:"图斑编号",land_number:"图斑编号",grassland_level:"草原级别",grassland_level_name:"草原级别",level:"等级",level_name:"等级",land_class_name:"地类名称",land_use_name:"地类名称",basic_type_name:"草原类型",grassland_category_name:"草原类别",degradation_level:"退化等级",degradation_level_name:"退化等级",vegetation_structure:"植被结构",vegetation_structure_name:"植被结构",xc_yield:"鲜草产量",gc_yield:"干草产量",xc_mu_yield:"鲜草亩产",gc_mu_yield:"干草亩产",mu_yield:"亩产",edible_xc_yield:"可食鲜草产量",edible_xc_mu_yield:"可食鲜草亩产",dlmc:"地类名称",qsdwmc:"权属单位",zldwmc:"坐落单位",lin_ban:"林班",xiao_ban:"小班",ld_qs:"土地权属",tdsyqs:"土地权属",qsxz:"土地权属",gjgyl_bhdj:"保护等级",bh_dj:"保护等级",sen_lin_lb:"森林类别",lin_zhong:"林种",zl_dj:"质量等级",you_shi_sz:"优势树种",qi_yuan:"起源",cdsyq:"草地所有权",cdsyq2:"草地使用权",cdjjq:"草地经营权",resource_type:"资源类型","grassland category":"草原类别",dominant_grass_species:"优势草种",functional_category:"功能类别",vegetation_cover:"植被盖度",xb_xc_yield:"小班鲜草产量",xb_gc_yield:"小班干草产量",base_grass:"基本草原",hqlm:"划区轮牧",elevation:"海拔",soil_depth:"土层厚度","soil texture":"土壤质地",aspect:"坡向",slope:"坡度",landform:"地貌",landform_name:"地貌",sddl:"三调地类",dominance_level:"优势度",investigator:"调查人",survey_time:"调查时间",land_type:"土地类型",status:"状态",type:"类型",xb_gc_mu_yield:"干草亩产",xb_xc_mu_yield:"鲜草亩产",grass_yield:"草地产量",full_name:"所在区域",gyl_bhlx:"公益林保护类型",ling_zu:"龄组",yu_bi_du:"郁闭度",pingjun_xj:"平均胸径",mei_gq_zs:"每公顷株数",mei_gq_xj:"每公顷蓄积",stqwmc:"生态区位",lyfq:"林业分区",qykz:"区域控制",po_wei:"坡位",tu_rang_zd:"土壤质地",zzsxmc:"主导属性",lin_chang:"林场",di_mao:"地貌",jt_qw:"交通区位",zbfglx:"植被覆盖类型",disaster_c:"灾害类型",dispe:"病虫害",pingjun_sg:"平均树高",huo_lm_xj:"活立木蓄积",sheng_wu_l:"生物量",tan_chu_l:"碳储量",g_cheng_lb:"工程类别",shi_quan_d:"事权等级",sf_tbq:"是否特别区",td_th_lx:"土地退化类型",project_name:"项目名称",project_category:"项目类型",measure_type:"措施类型",feature_role:"要素类型",township:"涉及乡镇",year:"建设年份",length_meter:"工程长度",geometry_type:"几何类型",totalAcreage:"总面积",cdAcreage:"草地面积",sdAcreage:"湿地面积",cdScl:"草地生产力",sdScl:"湿地生产力"},u=new Set(Object.keys(l)),c=new Set(["pingjun_sg","pingjun_xj","mei_gq_zs","mei_gq_xj","huo_lm_xj","sheng_wu_l","tan_chu_l","yu_bi_du","grass_yield","xb_xc_yield","xb_xc_mu_yield","xc_mu_yield","xb_gc_yield","xb_gc_mu_yield","gc_mu_yield"]),h=new Set(["xb_xc_yield","xb_gc_yield","grass_yield","gc_yield","xc_yield","yield","output","remark1","remark2","remark3","remark4","remark5","remarks"]),f=Se(()=>{var O;return((O=e.feature)==null?void 0:O.properties)||{}}),d=Se(()=>{var O,V,H;return((V=(O=e.feature)==null?void 0:O.feature)==null?void 0:V.geometry)||((H=e.feature)==null?void 0:H.geometry)||null}),p=Se(()=>{var Z,ee,he,le,re;const O=String(((Z=e.feature)==null?void 0:Z.id)||"").toLowerCase(),V=String(((he=(ee=e.feature)==null?void 0:ee.layer)==null?void 0:he.key)||"").toLowerCase(),H=String(((re=(le=e.feature)==null?void 0:le.layer)==null?void 0:re.layerName)||"").toLowerCase(),Q=`${V} ${H}`,W=f.value;return Q.includes("national-park")||Q.includes("restoration")||W.project_name||W.project_category||W.totalAcreage?"ecological":W.dlmc||O.includes("woodland")||O.includes("t_woodland")||Q.includes("woodland")?"woodland":Q.includes("wetland")||Q.includes("shidi")||O.includes("shidi")||W.land_type==="shidi"||W.land_type==="湿地"||W.land_type===2?"wetland":Q.includes("grassland")||Q.includes("caodi")||W.grassland_category_name||W.basic_type_name||O.includes("caodi")||W.land_type==="caodi"||W.land_type===1?"grassland":"woodland"}),g=Se(()=>{const O=[],V=new Set;return(i[p.value]||i.woodland).forEach(([Q,W])=>{const Z=_(f.value,Q,W,V);Z&&!O.some(ee=>ee.label===Z.label)&&(O.push(Z),V.add(Z.sourceKey))}),O.some(Q=>Q.label==="图斑面积")||y(O,V,"图斑面积",E(d.value),"geometry-area"),Object.entries(f.value).forEach(([Q,W])=>{if(V.has(Q)||D(Q,W))return;const Z=S(Q,W);x(Z)&&(O.some(ee=>ee.value===Z||ee.label===(l[Q]||F(Q)))||(O.push({key:`fallback-${Q}`,sourceKey:Q,label:l[Q]||F(Q),value:Z}),V.add(Q)))}),O}),v=Se(()=>g.value.map((O,V)=>Xe(Re({},O),{displayOrder:m(O,V)})).sort((O,V)=>O.displayOrder-V.displayOrder));function m(O,V){const H=(O==null?void 0:O.label)||"",Q=String((O==null?void 0:O.sourceKey)||"").toLowerCase();return["所在乡镇","所在村","所在区域","图斑编号","图斑面积","小班面积","图斑地类面积","地类名称","湿地类型"].includes(H)?V:["基本草原类型","草原类型","草原类","草原型","湿地草地型","草原级别","湿地级别","退化等级","功能类别","保护等级","森林类别","林种","质量等级","优势树种","起源","龄组"].includes(H)?100+V:H.includes("产量")||H.includes("亩产")||H.includes("植被")||H.includes("优势草种")||H.includes("优势度")||H.includes("海拔")||H.includes("地貌")||H.includes("坡")||H.includes("土壤")||H.includes("郁闭度")||H.includes("树高")||H.includes("蓄积")||H.includes("生物量")||H.includes("碳储量")?200+V:H.includes("权属")||H.includes("所有权")||H.includes("使用权")||H.includes("经营权")||H.includes("调查")||H.includes("调整")||H.includes("划区")||H.includes("单位")||Q.includes("owner")||Q.includes("qsdw")||Q.includes("zldw")?300+V:150+V}function y(O,V,H,Q,W){!x(Q)||O.some(Z=>Z.label===H||Z.value===Q)||(O.push({key:`static-${W}`,sourceKey:W,label:H,value:Q}),V.add(W))}function _(O,V,H,Q=new Set){for(const W of V)if(!(Q.has(W)||P(W))&&x(O==null?void 0:O[W])){const Z=S(W,O[W]);if(!x(Z))continue;return{key:`${H}-${W}`,sourceKey:W,label:H,value:Z}}return null}function x(O){return O!=null&&O!==""&&O!==" "&&O!=="null"&&O!=="undefined"}function S(O,V){var W;if(!x(V))return"";if((W=o[O])!=null&&W[String(V)])return o[O][String(V)];if(["xiang","xzqdm","town_code","area_code"].includes(O))return A(V);if(["cun","village_code"].includes(O)&&w(V))return"";if(["grassland_level","level"].includes(O)&&M(V))return p.value==="wetland"?`${Number(V)}级湿地`:`${Number(V)}级草原`;if(s.has(O)&&w(V)||L(O,V))return"";if(b(O))return T(V);if(typeof V=="number"||/^-?\d+(\.\d+)?$/.test(String(V))){const Z=Number(V);if(Z===0&&c.has(O))return"";const ee=Number.isInteger(Z)?`${Z}`:`${Number(Z.toFixed(2))}`;return["xbmj","tbdlmj","geomj","area_square_meter"].includes(O)?`${C(Z/666.6667)} 亩`:["acreage","mj","area_mu"].includes(O)?`${ee} 亩`:["length_meter"].includes(O)?`${ee} 米`:["totalAcreage","cdAcreage","sdAcreage"].includes(O)?`${ee} 万亩`:["cdScl","sdScl"].includes(O)?`${ee} 万吨`:["areaWanMu","area_wan_mu"].includes(O)?`${ee} 万亩`:["xc_yield","xb_xc_yield","gc_yield","xb_gc_yield","edible_xc_yield","grass_yield"].includes(O)?`${ee} 斤`:["mu_yield","xc_mu_yield","gc_mu_yield","xb_xc_mu_yield","xb_gc_mu_yield","edible_xc_mu_yield"].includes(O)?`${ee} 斤`:["vegetation_cover","lbmjbl","yu_bi_du"].includes(O)?`${ee}%`:["elevation","tu_ceng_hd","pingjun_sg"].includes(O)?`${ee} 米`:["po_du","slope"].includes(O)?`${ee}°`:ee}const Q=String(V);return p.value==="wetland"&&["grassland_level","level"].includes(O)?Q.replace(/草原/g,"湿地"):Q}function A(O){const V=String(O||"").trim();if(!V)return"";if(a[V])return a[V];const H=V.replace(/\D/g,"");if(a[H])return a[H];for(let Q=Math.min(12,H.length);Q>=6;Q--){const W=H.slice(0,Q);if(a[W])return a[W]}return w(V)?"":V}function w(O){return/^[0-9A-Za-z_-]{1,12}$/.test(String(O).trim())}function M(O){return/^-?\d+(\.\d+)?$/.test(String(O).trim())}function C(O){return Number.isInteger(O)?`${O}`:`${Number(O.toFixed(2))}`}function b(O){return["survey_time","dc_rq","create_time","update_time"].includes(String(O))}function T(O){const V=String(O);return/^\d{4}-\d{2}-\d{2}/.test(V)?V.slice(0,10):V}function P(O){const V=String(O).toLowerCase();return["geom","wkt","geometry","the_geom","raw_properties"].includes(V)||["bsm","ysdm","gid","id","objectid","object_id","fid","key_uid"].includes(V)||["shape_leng","shape_length","length","perimeter"].includes(V)?!0:["xzqdm","area_code","town_code","patch_no","land_number"].includes(V)?!1:["di_lei","qykz","stqw","lyfq","tbybh","patch_code"].includes(V)||V.endsWith("_code")||V.endsWith("dm")||V.endsWith("_id")||["create_by","create_time","update_by","update_time"].includes(V)?!0:V.includes("geom")||V.includes("boundary")||V.includes("wkb")}function D(O,V){var Q;if(P(O)||!x(V))return!0;const H=String(O).toLowerCase();return!!(h.has(H)||H.includes("number")||H.includes("patch_no")||!u.has(O)||w(V)&&!((Q=o[O])!=null&&Q[String(V)])&&!["xiang","xzqdm","town_code","area_code","cun","land_type","grassland_level","level","gjgyl_bhdj","bh_dj","ld_qs","qsxz","tdsyqs","zl_dj"].includes(O))}function L(O,V){var H;return!w(V)||(H=o[O])!=null&&H[String(V)]?!1:["resource_type","grassland category","functional_category","aspect","soil_depth","soil texture","cdsyq","cdsyq2","cdjjq"].includes(O)}function E(O){const V=I(O);if(!V)return"";const H=V/666.6667;return H>=1e4?`${C(H/1e4)} 万亩`:`${C(H)} 亩`}function I(O){return O!=null&&O.coordinates?O.type==="Polygon"?N(O.coordinates):O.type==="MultiPolygon"?O.coordinates.reduce((V,H)=>V+N(H),0):0:0}function N(O=[]){if(!O.length)return 0;const[V,...H]=O,Q=Math.abs(R(V)),W=H.reduce((Z,ee)=>Z+Math.abs(R(ee)),0);return Math.max(0,Q-W)}function R(O=[]){if(O.length<3)return 0;const V=O.reduce((Z,ee)=>Z+Number((ee==null?void 0:ee[1])||0),0)/O.length,H=111320,Q=H*Math.cos(V*Math.PI/180);let W=0;for(let Z=0;ZV.toUpperCase())}return(O,V)=>(ie(),Ji(tn,{title:"图斑详情",width:r.width,height:r.height},{default:Xt(()=>[G("div",Cie,[r.loading?(ie(),oe("div",Eie,"正在查询图斑信息")):r.empty?(ie(),oe("div",Lie,"当前点击位置未查询到图斑")):r.feature?(ie(),oe(it,{key:3},[v.value.length?(ie(),oe("div",Rie,[(ie(!0),oe(it,null,vt(v.value,H=>(ie(),oe("div",{key:H.key,class:"feature-row"},[G("span",null,Te(H.label),1),G("strong",{title:H.value},Te(H.value),9,Die)]))),128))])):(ie(),oe("div",Iie,"当前图斑暂无可展示的业务字段"))],64)):(ie(),oe("div",Pie,"点击地图图层查看图斑/要素信息"))])]),_:1},8,["width","height"]))}};const Nie={class:"forest-grass-wet"},kie={class:"forest-grass-wet-ui",id:"forest-grass-wet-ui"},Oie={class:"fgw-left"},Fie={class:"fgw-side-stack is-left"},Bie={class:"fgw-right"},zie={class:"fgw-side-stack is-right"},Uie={class:"fgw-map-layer-tools"},Vie={class:"fgw-bottom-topic"},Gie={key:0,class:"loading"},Hie={class:"loading-progress"},Wie={class:"value"},$ie={__name:"index",props:{showLoading:{type:Boolean,default:!0}},emits:["topic-stats"],setup(r,{emit:e}){const t=r,n=e,i=tt(null),a=tt(jf[0].key),o=tt(jf[0].defaultLayerKey),s=tt([]),l=tt("idle"),u=tt(!1),c=tt({title:"业务统计",rows:[]}),h=tt({title:"业务统计",rows:[]}),f=tt([]),d=tt([]),p=tt({}),g=tt(null),v=tt(""),m=tt(null),y=tt(!1),_=tt(!1),x=tt(null),S=tt(0),A=tt(t.showLoading),w=tt({type:"idle",text:"等待 GeoServer 图层加载"});let M=null,C=!1,b=0,T=0;const P=new Set(["grassland-distribution","wetland-distribution","woodland-distribution","woodland-protection","woodland-type","woodland-quality","woodland-ownership"]);Se(()=>yS(a.value));const D=Se(()=>mg(a.value,o.value)),L=Se(()=>{var B;return(((B=D.value)==null?void 0:B.legends)||[]).find(z=>z.key===v.value)||null}),E=Se(()=>{var z;const B=D.value;return!B||!((z=L.value)!=null&&z.cqlFilter)?B:Xe(Re({},B),{cqlFilter:L.value.cqlFilter,activeLegend:L.value,name:L.value.name||B.name})}),I=Se(()=>190),N=Se(()=>12),R=Se(()=>I.value*2+N.value),F=Se(()=>!!x.value),O=Se(()=>{if(_.value||y.value||!m.value)return 186;const B=be(m.value);return Math.min(480,Math.max(300,86+Math.min(B,12)*34))}),V=Se(()=>{if(!x.value)return{};const B=460,z=O.value,ne=24,ve=H(x.value),Ae=ve.x>1420?-B-28:28,we=Math.min(Math.max(ve.x+Ae,ne),1920-B-ne),We=Math.min(Math.max(ve.y-z-72,188),1080-z-132);return{left:`${we}px`,top:`${We}px`,right:"auto",bottom:"auto"}});function H(B){const z=document.querySelector(".forest-grass-wet"),ne=z==null?void 0:z.getBoundingClientRect();return!(ne!=null&&ne.width)||!(ne!=null&&ne.height)?B:{x:(B.x-ne.left)/ne.width*1920,y:(B.y-ne.top)/ne.height*1080}}Ko(()=>{document.addEventListener("pointerdown",Ne,!0),Q(),W(a.value,o.value),de(a.value,o.value)}),uo(()=>{C=!0,document.removeEventListener("pointerdown",Ne,!0)}),ni(a,B=>{var Ae;const z=yS(B),ne=s1(B),ve=z.defaultLayerKey||((Ae=ne[0])==null?void 0:Ae.key)||"";v.value="",o.value=ve,se(),W(B,ve),de(B,ve,null)}),ni(o,()=>{v.value="",se(),w.value={type:"loading",text:"正在加载 GeoServer 图层"},W(a.value,o.value),de(a.value,o.value,null)}),ni(v,()=>{se(),de(a.value,o.value,L.value)});function Q(){var ve;M=new _g;let B=!1;const z={progress:0};M.instance.on("onProgress",(Ae,we,We)=>{const Be=Math.floor(we/We*100);$n.to(z,{progress:Be,onUpdate:()=>{S.value=Math.floor(z.progress)}})});const ne=()=>Ge(this,null,function*(){var Ae,we;C||B||(B=!0,(Ae=i.value)==null||Ae.loadMap(M),yield Oe(),yield no(),(we=i.value)==null||we.play())});M.instance.on("onLoad",ne),(ve=M.ready)==null||ve.then(ne).catch(()=>{C||(w.value={type:"error",text:"地图资源加载失败"})})}function W(ne){return Ge(this,arguments,function*(B,z=o.value){const ve=`${B}:${z||""}`,Ae=p.value[ve];if(Ae){Z(Ae,B);return}const we=++T;u.value=!0,l.value="loading";const We=yield fie(B,z);C||we!==T||B===a.value&&(z||"")===(o.value||"")&&(p.value=Xe(Re({},p.value),{[ve]:We}),Z(We,B))})}function Z(B,z){var ve,Ae,we;const ne=ee(B);s.value=ne.core||[],c.value=ne.left||{title:"业务统计",rows:[]},h.value=ne.right||{title:"业务统计",rows:[]},f.value=(ve=ne.leftPanels)!=null&&ve.length?ne.leftPanels:[c.value],d.value=(Ae=ne.rightPanels)!=null&&Ae.length?ne.rightPanels:[h.value],l.value=ne.status,u.value=!1,n("topic-stats",{topicKey:z,topicName:yS(z).name,items:((we=ne.top)!=null&&we.length?ne.top:ne.core||[]).slice(0,4)})}function ee(B){return B||{}}function he(B,z){return`${a.value}-${z}-${(B==null?void 0:B.key)||(B==null?void 0:B.title)||"panel"}`}function le(B){var ne;const z=((ne=B==null?void 0:B.rows)==null?void 0:ne.length)||0;return(B==null?void 0:B.span)===1?!1:(B==null?void 0:B.span)===2?!0:(B==null?void 0:B.type)==="spotlight"||(B==null?void 0:B.type)==="metric"||(B==null?void 0:B.type)==="column"&&z<=5?!1:(B==null?void 0:B.type)==="rank"&&z>4||(B==null?void 0:B.type)==="split"&&z>4||(B==null?void 0:B.type)==="donut"&&z>5||(B==null?void 0:B.type)==="structure"&&z>4||(B==null?void 0:B.type)==="bar"&&z>4||(B==null?void 0:B.type)==="line"&&z>6}function re(B){return le(B)?R.value:I.value}function be(B){var Ae;const z=(B==null?void 0:B.properties)||{},ne=Object.keys(z).filter(we=>{const We=z[we];if(We==null||We==="")return!1;const Be=we.toLowerCase();return!(["geom","wkt","geometry","the_geom","shape_leng","shape_length","length","perimeter"].includes(Be)||["gid","id","objectid","object_id","fid","key_uid","bsm","ysdm"].includes(Be))}),ve=!!((Ae=B==null?void 0:B.feature)!=null&&Ae.geometry||B!=null&&B.geometry);return ne.length+(ve?1:0)}function de(ve,Ae){return Ge(this,arguments,function*(B,z,ne=L.value){const we=++b;if(!z||!U(z,ne)){g.value=K(B,z);return}const We=yield die(B,z,ne);C||we!==b||B!==a.value||z!==o.value||((ne==null?void 0:ne.key)||"")===v.value&&(g.value=We)})}function U(B,z=null){return!!(z!=null&&z.key)||P.has(B)}function K(B,z){return{status:"disabled",topicKey:B,layerKey:z,title:"",unit:"",rows:[]}}function te(B){var ne,ve;const z=(ve=(ne=B==null?void 0:B.feature)!=null?ne:B)!=null?ve:null;if(!z){se();return}m.value=z,y.value=!1,B!=null&&B.screen&&(x.value=B.screen)}function ce(B){w.value=B}function se(){var B,z;m.value=null,y.value=!1,x.value=null,(z=(B=i.value)==null?void 0:B.clearSelectedFeature)==null||z.call(B)}function Ne(B){if(!F.value)return;const z=document.querySelector(".fgw-map-feature-info"),ne=B.target;z&&ne instanceof Node&&z.contains(ne)||se()}function Oe(){return A.value?new Promise(B=>{$n.to(".forest-grass-wet .loading",{opacity:0,duration:.8,delay:.2,onComplete:()=>{A.value=!1,B()}})}):Promise.resolve()}return(B,z)=>{var ne;return ie(),oe("div",Nie,[$e(yg,{ref_key:"mapSceneRef",ref:i,"active-layer":E.value,"map-ranking":g.value,onFeatureLoading:z[0]||(z[0]=ve=>_.value=ve),onFeatureInfo:te,onLayerStatus:ce},null,8,["active-layer","map-ranking"]),G("div",kie,[G("div",Oie,[G("div",Fie,[(ie(!0),oe(it,null,vt(f.value,ve=>(ie(),Ji(tn,{key:he(ve,"left"),class:Vt(["fgw-side-card left-card",{"is-double":le(ve)}]),title:ve.title,width:398,height:re(ve)},{default:Xt(()=>[$e(Si,{panel:ve,compact:""},null,8,["panel"])]),_:2},1032,["class","title","height"]))),128))])]),G("div",Bie,[G("div",zie,[(ie(!0),oe(it,null,vt(d.value,ve=>(ie(),Ji(tn,{key:he(ve,"right"),class:Vt(["fgw-side-card right-card",{"is-double":le(ve)}]),title:ve.title,width:398,height:re(ve)},{default:Xt(()=>[$e(Si,{panel:ve,compact:""},null,8,["panel"])]),_:2},1032,["class","title","height"]))),128))])]),G("div",Uie,[$e(OU,{modelValue:o.value,"onUpdate:modelValue":z[1]||(z[1]=ve=>o.value=ve),"selected-legend-key":v.value,"onUpdate:selectedLegendKey":z[2]||(z[2]=ve=>v.value=ve),"topic-key":a.value,legends:((ne=E.value)==null?void 0:ne.legends)||[],width:248,height:430},null,8,["modelValue","selected-legend-key","topic-key","legends"])]),F.value?(ie(),oe("div",{key:0,class:"fgw-map-feature-info",style:un(V.value)},[$e(FU,{feature:m.value,empty:y.value,loading:_.value,width:460,height:O.value},null,8,["feature","empty","loading","height"])],4)):Tt("",!0),G("div",Vie,[$e(OC,{modelValue:a.value,"onUpdate:modelValue":z[3]||(z[3]=ve=>a.value=ve)},null,8,["modelValue"])])]),A.value?(ie(),oe("div",Gie,[z[5]||(z[5]=fc('
LOADING
',1)),G("div",Hie,[G("span",Wie,Te(S.value),1),z[4]||(z[4]=G("span",{class:"unit"},"%",-1))])])):Tt("",!0)])}}},wl=(r,e)=>r.reduce((t,n)=>t+Number(n[e]||0),0),cr=(r,e=2)=>Number(Number(r||0).toFixed(e)),Qa={kpi:{projectCount:22,featureCount:29280,subjectFeatureCount:1478,controlPointCount:27802,areaWanMu:175.3693,lengthKm:1250.62,townshipCount:10},categories:[{name:"草地修复",subjectFeatureCount:1067,areaWanMu:168.0339,lengthKm:1238.18,projectCount:13},{name:"林地修复",subjectFeatureCount:244,areaWanMu:7.3354,lengthKm:0,projectCount:6},{name:"湿地修复",subjectFeatureCount:167,areaWanMu:0,lengthKm:12.44,projectCount:3}],measures:[{name:"草原改良",subjectFeatureCount:285,areaWanMu:84.2792,lengthKm:467.5,projectCount:8},{name:"人工种草",subjectFeatureCount:532,areaWanMu:29.1561,lengthKm:0,projectCount:13},{name:"封育治理",subjectFeatureCount:45,areaWanMu:21.2487,lengthKm:0,projectCount:1},{name:"围栏建设",subjectFeatureCount:223,areaWanMu:19.4235,lengthKm:660.88,projectCount:9},{name:"林草碳汇试点",subjectFeatureCount:11,areaWanMu:12.5759,lengthKm:0,projectCount:1},{name:"水源涵养",subjectFeatureCount:82,areaWanMu:5.6993,lengthKm:0,projectCount:1},{name:"人工种草/补播",subjectFeatureCount:46,areaWanMu:2.8162,lengthKm:0,projectCount:4},{name:"防风固沙林",subjectFeatureCount:6,areaWanMu:.1303,lengthKm:0,projectCount:1},{name:"草种繁育",subjectFeatureCount:4,areaWanMu:.04,lengthKm:0,projectCount:1},{name:"种草围栏",subjectFeatureCount:77,areaWanMu:0,lengthKm:109.81,projectCount:1},{name:"小型坝",subjectFeatureCount:8,areaWanMu:0,lengthKm:8.83,projectCount:1},{name:"微型坝",subjectFeatureCount:159,areaWanMu:0,lengthKm:3.61,projectCount:2}],years:[{name:2017,areaWanMu:.1412,lengthKm:0,projectCount:1},{name:2018,areaWanMu:.5608,lengthKm:0,projectCount:1},{name:2019,areaWanMu:12.513,lengthKm:0,projectCount:1},{name:2020,areaWanMu:35.9848,lengthKm:0,projectCount:2},{name:2021,areaWanMu:25.0755,lengthKm:467.5,projectCount:5},{name:2022,areaWanMu:72.024,lengthKm:656.05,projectCount:8},{name:2023,areaWanMu:29.07,lengthKm:114.64,projectCount:3},{name:"未知",areaWanMu:0,lengthKm:12.44,projectCount:2}],townships:[{name:"麦洼乡",areaWanMu:28.5019,lengthKm:84.28,projectCount:3},{name:"龙日镇",areaWanMu:15,lengthKm:26.05,projectCount:1},{name:"安曲镇",areaWanMu:13.1168,lengthKm:0,projectCount:2},{name:"瓦切镇",areaWanMu:6.6824,lengthKm:214.41,projectCount:4},{name:"色地镇",areaWanMu:6.344,lengthKm:101.25,projectCount:3},{name:"刷经寺镇",areaWanMu:5.6528,lengthKm:126.26,projectCount:1},{name:"邛溪镇",areaWanMu:2.3127,lengthKm:101.39,projectCount:4},{name:"阿木乡",areaWanMu:1.34,lengthKm:59.5,projectCount:2},{name:"龙日乡",areaWanMu:.8472,lengthKm:20,projectCount:1},{name:"查尔玛乡",areaWanMu:.7001,lengthKm:37.56,projectCount:1}],projects:[{projectName:"阿坝州红原县2020年退牧还草工程项目",projectCategory:"草地修复",year:2020,areaWanMu:35.6232,lengthKm:0,measureTypes:["人工种草","围栏建设"],townships:[],subjectFeatureCount:73},{projectName:"四川省阿坝州若尔盖草原湿地水源涵养生态保护和修复项目(红原县部分)-2022年",projectCategory:"草地修复",year:2022,areaWanMu:21.5,lengthKm:172.31,measureTypes:["人工种草","围栏建设","种草围栏","草原改良"],townships:["刷经寺镇","龙日乡","龙日镇"],subjectFeatureCount:273},{projectName:"阿坝州红原县 2022 年第二批重点生态保护和修护治理项目-草原封育治理-700",projectCategory:"草地修复",year:2022,areaWanMu:21.2487,lengthKm:272.25,measureTypes:["围栏建设","封育治理"],townships:["瓦切镇","色地镇","邛溪镇"],subjectFeatureCount:90},{projectName:"四川省阿坝州 2023 年中央财政林业草原改革发展资金预算(第三批)——红原县草原生态修复项目",projectCategory:"草地修复",year:2023,areaWanMu:18.79,lengthKm:32.32,measureTypes:["人工种草","围栏建设","草原改良","草种繁育"],townships:["瓦切镇","麦洼乡"],subjectFeatureCount:102},{projectName:"阿坝州红原县2022年第二批重点生态保护和修护治理——红原县林草碳汇创新开发建设试点项目",projectCategory:"草地修复",year:2022,areaWanMu:12.5759,lengthKm:0,measureTypes:["林草碳汇试点"],townships:["安曲镇"],subjectFeatureCount:11},{projectName:"四川省红原县2019年草原生态修复治理项目退化草地治理和天然草原改良",projectCategory:"草地修复",year:2019,areaWanMu:12.513,lengthKm:0,measureTypes:["人工种草/补播","草原改良"],townships:[],subjectFeatureCount:25},{projectName:"阿坝州红原县2021年若尔盖—甘南草原湿地生态保护和修复项目-1880",projectCategory:"草地修复",year:2021,areaWanMu:11.0031,lengthKm:467.5,measureTypes:["人工种草","草原改良"],townships:[],subjectFeatureCount:229},{projectName:"2023 年度四川省阿坝州若尔盖草原湿地水源涵养生态保护和修复项目(红原县部分)-1315",projectCategory:"草地修复",year:2023,areaWanMu:10.28,lengthKm:82.32,measureTypes:["人工种草","围栏建设","草原改良"],townships:["查尔玛乡","麦洼乡"],subjectFeatureCount:50},{projectName:"阿坝州红原县 2022 年中央财政林业草原生态保护恢复(第二批)——草原生态修复治理补助项目-1972",projectCategory:"草地修复",year:2022,areaWanMu:8.2,lengthKm:113.37,measureTypes:["围栏建设","草原改良","人工种草"],townships:["色地镇","邛溪镇","阿木乡"],subjectFeatureCount:127},{projectName:"阿坝州红原县2021年省级草原生态保护恢复项目-1790",projectCategory:"草地修复",year:2021,areaWanMu:7,lengthKm:0,measureTypes:["人工种草","草原改良"],townships:[],subjectFeatureCount:16},{projectName:"阿坝州红原县 2021 年中央财政林业草原生态保护恢复项目-984",projectCategory:"草地修复",year:2021,areaWanMu:6.5,lengthKm:0,measureTypes:["草原改良","人工种草"],townships:[],subjectFeatureCount:14},{projectName:"红原县2022年度黄河上游水源涵养补给区综合治理项目实施方案(代作业设计)变更后最终版",projectCategory:"林地修复",year:2022,areaWanMu:5.6993,lengthKm:0,measureTypes:["水源涵养"],townships:["安曲镇","瓦切镇"],subjectFeatureCount:82},{projectName:"阿坝州红原县 2022 年第二批重点生态保护和修护治理——草原生态修复治理项目-1500",projectCategory:"草地修复",year:2022,areaWanMu:2,lengthKm:81.05,measureTypes:["人工种草","围栏建设"],townships:["瓦切镇","色地镇","麦洼乡"],subjectFeatureCount:53},{projectName:"阿坝州红原县 2022 年省级林业草原生态保护恢复——草原生态修复治理补助项目-888",projectCategory:"草地修复",year:2022,areaWanMu:.8,lengthKm:17.07,measureTypes:["人工种草","围栏建设"],townships:["阿木乡"],subjectFeatureCount:4},{projectName:"红原县2018年川西高原生态脆弱区综合治理项目",projectCategory:"林地修复",year:2018,areaWanMu:.5608,lengthKm:0,measureTypes:["人工种草","人工种草/补播"],townships:[],subjectFeatureCount:107},{projectName:"红原县2021年黄河上游水源涵养补给区生态综合治理项目",projectCategory:"林地修复",year:2021,areaWanMu:.5224,lengthKm:0,measureTypes:["人工种草/补播"],townships:["邛溪镇"],subjectFeatureCount:14},{projectName:"红原县2020年川西高原生态脆弱区综合治理项目",projectCategory:"林地修复",year:2020,areaWanMu:.3617,lengthKm:0,measureTypes:["人工种草","人工种草/补播"],townships:[],subjectFeatureCount:31},{projectName:"2017年川西高原生态脆弱区综合治理项目",projectCategory:"林地修复",year:2017,areaWanMu:.1412,lengthKm:0,measureTypes:["人工种草","防风固沙林"],townships:["邛溪镇"],subjectFeatureCount:8},{projectName:"红原县2021年人工造林封山育林项目",projectCategory:"林地修复",year:2021,areaWanMu:.05,lengthKm:0,measureTypes:["围栏建设"],townships:[],subjectFeatureCount:2},{projectName:"4980小型坝(1)(1)",projectCategory:"湿地修复",year:"未知",areaWanMu:0,lengthKm:8.83,measureTypes:["小型坝"],townships:[],subjectFeatureCount:8},{projectName:"红原县蓄水保湿工程-小型坝和微型坝(1)(1)",projectCategory:"湿地修复",year:2023,areaWanMu:0,lengthKm:3.61,measureTypes:["微型坝"],townships:[],subjectFeatureCount:59},{projectName:"4980微型坝成型(1)(1)",projectCategory:"湿地修复",year:2022,areaWanMu:0,lengthKm:0,measureTypes:["微型坝"],townships:[],subjectFeatureCount:100}]},Xie=[{key:"national-park",label:"若尔盖国家公园",bottomLabel:"若尔盖国家公园"},{key:"restoration",label:"生态修复工程",bottomLabel:"生态修复工程"}],Yi=[{name:"麦洼乡",grasslandAreaWanMu:31.41,wetlandAreaWanMu:11.16,ecologyJobs:179,yakCount:61720,livestockCount:63507,cover:85,villages:"洞拉村、滚塘村、让里村、茸塔玛村"},{name:"瓦切镇",grasslandAreaWanMu:31.42,wetlandAreaWanMu:11.15,ecologyJobs:160,yakCount:33887,livestockCount:34589,cover:85,villages:"唐日村、德香村、日干村"},{name:"色地镇",grasslandAreaWanMu:31.42,wetlandAreaWanMu:11.16,ecologyJobs:39,yakCount:9572,livestockCount:9843,cover:86,villages:"色永村"}],Ci={name:"若尔盖国家公园红原区域",totalAreaWanMu:1250.51,grasslandAreaWanMu:94.25,wetlandAreaWanMu:33.47,woodlandAreaWanMu:null,woodlandDataStatus:"待接入",vegetationCoverage:cr(wl(Yi,"cover")/Yi.length,1),townCount:Yi.length,villageCount:Yi.reduce((r,e)=>r+String(e.villages||"").split("、").filter(Boolean).length,0),householdCount:3023,ecologyJobCount:wl(Yi,"ecologyJobs"),yakCount:wl(Yi,"yakCount"),livestockCount:wl(Yi,"livestockCount")};Ci.otherProtectedAreaWanMu=cr(Ci.totalAreaWanMu-Ci.grasslandAreaWanMu-Ci.wetlandAreaWanMu,2);Yi.map(r=>({key:r.name,name:r.name,value:cr(r.grasslandAreaWanMu+r.wetlandAreaWanMu,2),unit:"万亩",extra:`草地 ${r.grasslandAreaWanMu} / 湿地 ${r.wetlandAreaWanMu}`}));Yi.map(r=>({key:`${r.name}-town`,name:r.name,value:cr(r.grasslandAreaWanMu+r.wetlandAreaWanMu,2),unit:"万亩",extra:r.villages}));const Yie=[{key:"core-protection",name:"核心保护区",value:629.76,unit:"万亩"},{key:"general-control",name:"一般控制区",value:620.75,unit:"万亩"}],qie=43.66,jie=cr(qie*(192.26/297.29),2),Kie={麦洼乡:[{name:"洞拉村",grassland:.29,wetland:.34,household:.3,yak:.32,edible:.31,woodland:.3},{name:"滚塘村",grassland:.26,wetland:.27,household:.25,yak:.25,edible:.26,woodland:.25},{name:"让里村",grassland:.24,wetland:.21,household:.24,yak:.23,edible:.23,woodland:.24},{name:"茸塔玛村",grassland:.21,wetland:.18,household:.21,yak:.2,edible:.2,woodland:.21}],瓦切镇:[{name:"唐日村",grassland:.38,wetland:.42,household:.36,yak:.4,edible:.39,woodland:.38},{name:"德香村",grassland:.32,wetland:.32,household:.33,yak:.32,edible:.32,woodland:.32},{name:"日干村",grassland:.3,wetland:.26,household:.31,yak:.28,edible:.29,woodland:.3}],色地镇:[{name:"色永村",grassland:1,wetland:1,household:1,yak:1,edible:1,woodland:1}]},Zie=wl(Yi,"livestockCount")||wl(Yi,"yakCount")||1,q0=Yi.map(r=>Xe(Re({},r),{householdCount:Math.round(Ci.householdCount*Number(r.livestockCount||r.yakCount||0)/Zie),edibleGrasslandWanTon:cr(Number(r.grasslandAreaWanMu||0)/Math.max(Ci.grasslandAreaWanMu,1)*jie,2)})),BD=Ci.householdCount-wl(q0,"householdCount");BD&&q0[0]&&(q0[0].householdCount+=BD);const FC=(r,e=wl(r,"value"))=>r.map(t=>Xe(Re({},t),{extra:t.extra||`占比 ${cr(Number(t.value||0)/Math.max(e,1)*100,1)}%`})),Qie=FC([{key:"park-scope-grassland",name:"草地",value:Ci.grasslandAreaWanMu,unit:"万亩"},{key:"park-scope-wetland",name:"湿地",value:Ci.wetlandAreaWanMu,unit:"万亩"},{key:"park-scope-other",name:"其他保护范围",value:Ci.otherProtectedAreaWanMu,unit:"万亩"}]),fd=({sourceKey:r,weightKey:e,unit:t="万亩",decimals:n=2})=>{const i=q0.flatMap(a=>(Kie[a.name]||[]).map(s=>({key:`${a.name}-${s.name}-${r}`,name:s.name,town:a.name,value:cr(Number(a[r]||0)*Number(s[e]||0),n),unit:t}))).filter(a=>Number(a.value)>0).sort((a,o)=>Number(o.value||0)-Number(a.value||0));return FC(i)},Jie=fd({sourceKey:"wetlandAreaWanMu",weightKey:"wetland"}),eae=fd({sourceKey:"grasslandAreaWanMu",weightKey:"grassland"}),tae=fd({sourceKey:"householdCount",weightKey:"household",unit:"户",decimals:0}),nae=fd({sourceKey:"yakCount",weightKey:"yak",unit:"头",decimals:0}),rae=fd({sourceKey:"edibleGrasslandWanTon",weightKey:"edible",unit:"万吨"}),iae=fd({sourceKey:"wetlandAreaWanMu",weightKey:"woodland"}),aae=[{zh:"国家公园面积",value:Ci.totalAreaWanMu,unit:"万亩",decimals:2},{zh:"草地面积",value:Ci.grasslandAreaWanMu,unit:"万亩",decimals:2},{zh:"湿地面积",value:Ci.wetlandAreaWanMu,unit:"万亩",decimals:2},{zh:"牦牛数量",value:Ci.yakCount,unit:"头",decimals:0}],oae=[{zh:"修复项目",value:Qa.kpi.projectCount,unit:"个",decimals:0},{zh:"治理面积",value:Qa.kpi.areaWanMu,unit:"万亩",decimals:2},{zh:"工程长度",value:Qa.kpi.lengthKm,unit:"公里",decimals:2},{zh:"涉及乡镇",value:Qa.kpi.townshipCount,unit:"个",decimals:0}];function sae(r){return(r==="restoration"?oae:aae).map((t,n)=>Re({icon:n%2===0?"xiaoshoujine":"zongxiaoliang",en:""},t))}const lae={left:[{key:"park-resource-scope",title:"显示范围资源占比",type:"donut",rows:Qie},{key:"park-wetland-village",title:"湿地分布村级排行",type:"line",rows:Jie.slice(0,8)},{key:"park-woodland-village",title:"林地分布村级排行",type:"heat",rows:iae.slice(0,8)},{key:"park-grassland-village",title:"草地分布村级排行",type:"peak",rows:eae.slice(0,5)}],right:[{key:"park-household-village",title:"牧户分布村级排行",type:"column",variant:"pin",rows:tae.slice(0,8)},{key:"park-yak-village",title:"牦牛分布村级排行",type:"column",variant:"pin",rows:nae.slice(0,8)},{key:"park-edible-grass-village",title:"可食草地资源分布",type:"column",variant:"slim",rows:rae.slice(0,8)},{key:"park-zoning-ledger",title:"核心区和一般区分区面积",type:"structure",rows:FC(Yie)}]},BU=(Qa.townships||[]).filter(r=>/[乡镇]$/.test(String(r.name||""))).slice(0,8),uae=(Qa.projects||[]).map((r,e)=>{const t=Number(r.areaWanMu)>0,n=Number(r.lengthKm)>0,i=t?{value:cr(r.areaWanMu,2),unit:"万亩",metric:"治理面积"}:n?{value:cr(r.lengthKm,2),unit:"公里",metric:"工程长度"}:{value:r.subjectFeatureCount||0,unit:"个",metric:"主体要素"},a=(r.measureTypes||[]).join("、"),o=(r.townships||[]).join("、");return{key:r.id||r.projectName,index:e+1,name:r.projectName,projectName:r.projectName,category:r.projectCategory,year:r.year||"未知",areaWanMu:cr(r.areaWanMu,4),lengthKm:cr(r.lengthKm,2),measure:a,townships:o,subjectFeatureCount:r.subjectFeatureCount||0,value:i.value,unit:i.unit,metric:i.metric,extra:[r.year||"未知",a].filter(Boolean).join(" / "),searchText:[r.projectName,r.projectCategory,r.year,a,o].filter(Boolean).join(" ")}}),cae={left:[{key:"restoration-year-area",title:"治理面积分布",type:"line",rows:(Qa.years||[]).map(r=>({key:r.name,name:`${r.name}`,value:cr(r.areaWanMu,2),unit:"万亩",extra:`${r.projectCount||0}个项目`}))},{key:"restoration-town-area",title:"乡镇治理面积分布",type:"line",rows:BU.map(r=>({key:r.name,name:r.name,value:cr(r.areaWanMu,2),unit:"万亩",extra:`${cr(r.lengthKm,2)}公里`}))},{key:"restoration-category",title:"修复类型占比",type:"donut",rows:(Qa.categories||[]).map(r=>({key:r.name,name:r.name,value:cr(r.areaWanMu||r.lengthKm||r.subjectFeatureCount,2),unit:r.areaWanMu?"万亩":r.lengthKm?"公里":"个",extra:`${r.subjectFeatureCount}个图斑`}))},{key:"restoration-year-length",title:"年度工程长度",type:"column",variant:"slim",rows:(Qa.years||[]).filter(r=>Number(r.lengthKm)>0).map(r=>({key:r.name,name:`${r.name}`,value:cr(r.lengthKm,2),unit:"公里",extra:`${r.projectCount||0}个项目`}))}],right:[{key:"restoration-measure-area",title:"修复措施统计",type:"structure",rows:(Qa.measures||[]).slice(0,8).map(r=>({key:r.name,name:r.name,value:cr(r.areaWanMu||r.lengthKm||r.subjectFeatureCount,2),unit:r.areaWanMu?"万亩":r.lengthKm?"公里":"个",extra:`${r.projectCount}个项目`}))},{key:"restoration-year-project",title:"年度项目数量",type:"column",variant:"slim",rows:(Qa.years||[]).map(r=>({key:r.name,name:`${r.name}`,value:r.projectCount,unit:"个",extra:`${cr(r.areaWanMu,2)}万亩`}))},{key:"restoration-projects",title:"重点项目库",type:"projectTable",span:2,rows:uae}]};function hae(r){return r==="restoration"?{status:"success",title:"乡镇治理排行",metricLabel:"治理面积",unit:"万亩",rows:BU.map(e=>({name:e.name,value:cr(e.areaWanMu,2),unit:"万亩"}))}:{status:"success",title:"国家公园牦牛分布",metricLabel:"牦牛数量",unit:"头",rows:Yi.map(e=>({name:e.name,value:e.yakCount,unit:"头"}))}}const fae={class:"forest-grass-wet ecological-protection"},dae={class:"forest-grass-wet-ui ecological-protection-ui"},pae={class:"fgw-left"},vae={class:"fgw-side-stack is-left"},gae={class:"fgw-right"},mae={class:"fgw-side-stack is-right"},yae={class:"fgw-map-layer-tools"},_ae={class:"fgw-bottom-topic ecological-bottom-topic"},xae={key:0,class:"loading"},Sae={class:"loading-progress"},Aae={class:"value"},zD=190,wae=12,bae={__name:"index",props:{activeView:{type:String,default:"national-park"},showLoading:{type:Boolean,default:!0}},emits:["module-stats","view-change"],setup(r,{emit:e}){const t=r,n=e,i=tt(null),a=tt(""),o=tt(""),s=tt(null),l=tt(!1),u=tt(!1),c=tt(null),h=tt(0),f=tt(t.showLoading),d=tt(null),p=tt({type:"idle",text:"等待生态保护图层加载"});let g=null,v=!1;const m=Se(()=>t.activeView==="restoration"?"restoration":"national-park"),y=Se(()=>mg(m.value,a.value)),_=Se(()=>{var ee;return(((ee=y.value)==null?void 0:ee.legends)||[]).find(he=>he.key===o.value)||null}),x=Se(()=>{const ee=y.value;return!ee||!_.value?ee:Xe(Re({},ee),{cqlFilter:_.value.cqlFilter||ee.cqlFilter,activeLegend:_.value,name:_.value.name||ee.name})}),S=Se(()=>m.value==="restoration"?cae:lae),A=Se(()=>S.value.left||[]),w=Se(()=>S.value.right||[]),M=zD*2+wae,C=Se(()=>!!c.value),b=Se(()=>{if(u.value||l.value||!s.value)return 186;const ee=F(s.value);return Math.min(480,Math.max(300,86+Math.min(ee,12)*34))}),T=Se(()=>{if(!c.value)return{};const ee=460,he=b.value,le=24,re=E(c.value),be=re.x>1420?-ee-28:28,de=Math.min(Math.max(re.x+be,le),1920-ee-le),U=Math.min(Math.max(re.y-he-72,188),1080-he-132);return{left:`${de}px`,top:`${U}px`,right:"auto",bottom:"auto"}});Ko(()=>{document.addEventListener("pointerdown",W,!0),L(),P(m.value)}),uo(()=>{v=!0,document.removeEventListener("pointerdown",W,!0)}),ni(m,ee=>{P(ee)}),ni(a,()=>{o.value="",Q()}),ni(o,()=>{Q()});function P(ee){var re;const he=qy.find(be=>be.key===ee)||qy[0],le=s1(ee);o.value="",a.value=he.defaultLayerKey||((re=le[0])==null?void 0:re.key)||"",d.value=hae(ee),Q(),n("module-stats",{moduleKey:"ecological-protection",viewKey:ee,items:sae(ee)})}function D(ee){n("view-change",ee==="restoration"?"restoration":"national-park")}function L(){var re;g=new _g;let ee=!1;const he={progress:0};g.instance.on("onProgress",(be,de,U)=>{const K=Math.floor(de/U*100);$n.to(he,{progress:K,onUpdate:()=>{h.value=Math.floor(he.progress)}})});const le=()=>Ge(this,null,function*(){var be,de;v||ee||(ee=!0,(be=i.value)==null||be.loadMap(g),yield Z(),yield no(),(de=i.value)==null||de.play())});g.instance.on("onLoad",le),(re=g.ready)==null||re.then(le).catch(()=>{v||(p.value={type:"error",text:"地图资源加载失败"})})}function E(ee){const he=document.querySelector(".ecological-protection"),le=he==null?void 0:he.getBoundingClientRect();return!(le!=null&&le.width)||!(le!=null&&le.height)?ee:{x:(ee.x-le.left)/le.width*1920,y:(ee.y-le.top)/le.height*1080}}function I(ee,he){return`${m.value}-${he}-${(ee==null?void 0:ee.key)||(ee==null?void 0:ee.title)||"panel"}`}function N(ee){return(ee==null?void 0:ee.span)===2}function R(ee){return N(ee)?M:zD}function F(ee){const he=(ee==null?void 0:ee.properties)||{};return Object.keys(he).filter(le=>{const re=he[le];return re==null||re===""?!1:!["geom","wkt","geometry","the_geom","raw_properties"].includes(String(le).toLowerCase())}).length}function O(ee){var le,re;const he=(re=(le=ee==null?void 0:ee.feature)!=null?le:ee)!=null?re:null;if(!he){Q();return}s.value=he,l.value=!1,ee!=null&&ee.screen&&(c.value=ee.screen)}function V(ee){p.value=ee}function H(ee,he){var re,be;if(m.value!=="restoration"||(ee==null?void 0:ee.key)!=="restoration-projects")return;const le=(he==null?void 0:he.projectName)||(he==null?void 0:he.name);le&&(Q(),(be=(re=i.value)==null?void 0:re.focusProject)==null||be.call(re,le))}function Q(){var ee,he;s.value=null,l.value=!1,c.value=null,(he=(ee=i.value)==null?void 0:ee.clearSelectedFeature)==null||he.call(ee)}function W(ee){if(!C.value)return;const he=document.querySelector(".fgw-map-feature-info"),le=ee.target;he&&le instanceof Node&&he.contains(le)||Q()}function Z(){return f.value?new Promise(ee=>{$n.to(".ecological-protection .loading",{opacity:0,duration:.8,delay:.2,onComplete:()=>{f.value=!1,ee()}})}):Promise.resolve()}return(ee,he)=>{var le;return ie(),oe("div",fae,[$e(yg,{ref_key:"mapSceneRef",ref:i,"active-layer":x.value,"map-ranking":d.value,onFeatureLoading:he[0]||(he[0]=re=>u.value=re),onFeatureInfo:O,onLayerStatus:V},null,8,["active-layer","map-ranking"]),G("div",dae,[G("div",pae,[G("div",vae,[(ie(!0),oe(it,null,vt(A.value,re=>(ie(),Ji(tn,{key:I(re,"left"),class:Vt(["fgw-side-card left-card",{"is-double":N(re)}]),title:re.title,width:398,height:R(re)},{default:Xt(()=>[$e(Si,{panel:re,compact:"",onRowSelect:be=>H(re,be)},null,8,["panel","onRowSelect"])]),_:2},1032,["class","title","height"]))),128))])]),G("div",gae,[G("div",mae,[(ie(!0),oe(it,null,vt(w.value,re=>(ie(),Ji(tn,{key:I(re,"right"),class:Vt(["fgw-side-card right-card",{"is-double":N(re)}]),title:re.title,width:398,height:R(re)},{default:Xt(()=>[$e(Si,{panel:re,compact:"",onRowSelect:be=>H(re,be)},null,8,["panel","onRowSelect"])]),_:2},1032,["class","title","height"]))),128))])]),G("div",yae,[$e(OU,{modelValue:a.value,"onUpdate:modelValue":he[1]||(he[1]=re=>a.value=re),"selected-legend-key":o.value,"onUpdate:selectedLegendKey":he[2]||(he[2]=re=>o.value=re),"topic-key":m.value,legends:((le=x.value)==null?void 0:le.legends)||[],width:248,height:430},null,8,["modelValue","selected-legend-key","topic-key","legends"])]),C.value?(ie(),oe("div",{key:0,class:"fgw-map-feature-info",style:un(T.value)},[$e(FU,{feature:s.value,empty:l.value,loading:u.value,width:460,height:b.value},null,8,["feature","empty","loading","height"])],4)):Tt("",!0),G("div",_ae,[$e(OC,{"model-value":m.value,topics:_n(qy),"onUpdate:modelValue":D},null,8,["model-value","topics"])])]),f.value?(ie(),oe("div",xae,[he[4]||(he[4]=fc('
LOADING
',1)),G("div",Sae,[G("span",Aae,Te(h.value),1),he[3]||(he[3]=G("span",{class:"unit"},"%",-1))])])):Tt("",!0)])}}};/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var Wb=function(r,e){return Wb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Wb(r,e)};function ae(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Wb(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Tae=function(){function r(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return r}(),Mae=function(){function r(){this.browser=new Tae,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window!="undefined"}return r}(),ol=new Mae;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(ol.wxa=!0,ol.touchEventsSupported=!0):typeof document=="undefined"&&typeof self!="undefined"?ol.worker=!0:!ol.hasGlobalWindow||"Deno"in window?(ol.node=!0,ol.svgSupported=!0):Cae(navigator.userAgent,ol);function Cae(r,e){var t=e.browser,n=r.match(/Firefox\/([\d.]+)/),i=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/.+?rv:(([\d.]+))/),a=r.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(r);n&&(t.firefox=!0,t.version=n[1]),i&&(t.ie=!0,t.version=i[1]),a&&(t.edge=!0,t.version=a[1],t.newEdge=+a[1].split(".")[0]>18),o&&(t.weChat=!0),e.svgSupported=typeof SVGRect!="undefined",e.touchEventsSupported="ontouchstart"in window&&!t.ie&&!t.edge,e.pointerEventsSupported="onpointerdown"in window&&(t.edge||t.ie&&+t.version>=11),e.domSupported=typeof document!="undefined";var s=document.documentElement.style;e.transform3dSupported=(t.ie&&"transition"in s||t.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||t.ie&&+t.version>=9}const kt=ol;var BC=12,zU="sans-serif",Yl=BC+"px "+zU,Eae=20,Lae=100,Pae="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function Rae(r){var e={};if(typeof JSON=="undefined")return e;for(var t=0;t=0)s=o*t.length;else for(var l=0;l>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[l]+":0",i[u]+":0",n[1-l]+":auto",i[1-u]+":auto",""].join("!important;"),r.appendChild(o),t.push(o)}return t}function eoe(r,e,t){for(var n=t?"invTrans":"trans",i=e[n],a=e.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var c=r[u].getBoundingClientRect(),h=2*u,f=c.left,d=c.top;o.push(f,d),l=l&&a&&f===a[h]&&d===a[h+1],s.push(r[u].offsetLeft,r[u].offsetTop)}return l&&i?i:(e.srcCoords=o,e[n]=t?HD(s,o):HD(o,s))}function XU(r){return r.nodeName.toUpperCase()==="CANVAS"}var toe=/([&<>"'])/g,noe={"&":"&","<":"<",">":">",'"':""","'":"'"};function Jr(r){return r==null?"":(r+"").replace(toe,function(e,t){return noe[t]})}var roe=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,wS=[],ioe=kt.browser.firefox&&+kt.browser.version.split(".")[0]<39;function Zb(r,e,t,n){return t=t||{},n?$D(r,e,t):ioe&&e.layerX!=null&&e.layerX!==e.offsetX?(t.zrX=e.layerX,t.zrY=e.layerY):e.offsetX!=null?(t.zrX=e.offsetX,t.zrY=e.offsetY):$D(r,e,t),t}function $D(r,e,t){if(kt.domSupported&&r.getBoundingClientRect){var n=e.clientX,i=e.clientY;if(XU(r)){var a=r.getBoundingClientRect();t.zrX=n-a.left,t.zrY=i-a.top;return}else if(Kb(wS,r,n,i)){t.zrX=wS[0],t.zrY=wS[1];return}}t.zrX=t.zrY=0}function $C(r){return r||window.event}function ma(r,e,t){if(e=$C(e),e.zrX!=null)return e;var n=e.type,i=n&&n.indexOf("touch")>=0;if(i){var o=n!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&Zb(r,o,e,t)}else{Zb(r,e,e,t);var a=aoe(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&roe.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function aoe(r){var e=r.wheelDelta;if(e)return e;var t=r.deltaX,n=r.deltaY;if(t==null||n==null)return e;var i=Math.abs(n!==0?n:t),a=n>0?-1:n<0?1:t>0?-1:1;return 3*i*a}function Qb(r,e,t,n){r.addEventListener(e,t,n)}function ooe(r,e,t,n){r.removeEventListener(e,t,n)}var Ps=function(r){r.preventDefault(),r.stopPropagation(),r.cancelBubble=!0};function XD(r){return r.which===2||r.which===3}var soe=function(){function r(){this._track=[]}return r.prototype.recognize=function(e,t,n){return this._doTrack(e,t,n),this._recognize(e)},r.prototype.clear=function(){return this._track.length=0,this},r.prototype._doTrack=function(e,t,n){var i=e.touches;if(i){for(var a={points:[],touches:[],target:t,event:e},o=0,s=i.length;o1&&n&&n.length>1){var a=YD(n)/YD(i);!isFinite(a)&&(a=1),e.pinchScale=a;var o=loe(n);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:r[0].target,event:e}}}}};function ta(){return[1,0,0,1,0,0]}function g1(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function XC(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r}function As(r,e,t){var n=e[0]*t[0]+e[2]*t[1],i=e[1]*t[0]+e[3]*t[1],a=e[0]*t[2]+e[2]*t[3],o=e[1]*t[2]+e[3]*t[3],s=e[0]*t[4]+e[2]*t[5]+e[4],l=e[1]*t[4]+e[3]*t[5]+e[5];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=l,r}function Xo(r,e,t){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4]+t[0],r[5]=e[5]+t[1],r}function jc(r,e,t,n){n===void 0&&(n=[0,0]);var i=e[0],a=e[2],o=e[4],s=e[1],l=e[3],u=e[5],c=Math.sin(t),h=Math.cos(t);return r[0]=i*h+s*c,r[1]=-i*c+s*h,r[2]=a*h+l*c,r[3]=-a*c+h*l,r[4]=h*(o-n[0])+c*(u-n[1])+n[0],r[5]=h*(u-n[1])-c*(o-n[0])+n[1],r}function YC(r,e,t){var n=t[0],i=t[1];return r[0]=e[0]*n,r[1]=e[1]*i,r[2]=e[2]*n,r[3]=e[3]*i,r[4]=e[4]*n,r[5]=e[5]*i,r}function vd(r,e){var t=e[0],n=e[2],i=e[4],a=e[1],o=e[3],s=e[5],l=t*o-a*n;return l?(l=1/l,r[0]=o*l,r[1]=-a*l,r[2]=-n*l,r[3]=t*l,r[4]=(n*s-o*i)*l,r[5]=(a*i-t*s)*l,r):null}function uoe(r){var e=ta();return XC(e,r),e}var coe=function(){function r(e,t){this.x=e||0,this.y=t||0}return r.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},r.prototype.clone=function(){return new r(this.x,this.y)},r.prototype.set=function(e,t){return this.x=e,this.y=t,this},r.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},r.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},r.prototype.scale=function(e){this.x*=e,this.y*=e},r.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},r.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},r.prototype.dot=function(e){return this.x*e.x+this.y*e.y},r.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},r.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},r.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},r.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},r.prototype.distanceSquare=function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},r.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},r.prototype.transform=function(e){if(e){var t=this.x,n=this.y;return this.x=e[0]*t+e[2]*n+e[4],this.y=e[1]*t+e[3]*n+e[5],this}},r.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},r.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},r.set=function(e,t,n){e.x=t,e.y=n},r.copy=function(e,t){e.x=t.x,e.y=t.y},r.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},r.lenSquare=function(e){return e.x*e.x+e.y*e.y},r.dot=function(e,t){return e.x*t.x+e.y*t.y},r.add=function(e,t,n){e.x=t.x+n.x,e.y=t.y+n.y},r.sub=function(e,t,n){e.x=t.x-n.x,e.y=t.y-n.y},r.scale=function(e,t,n){e.x=t.x*n,e.y=t.y*n},r.scaleAndAdd=function(e,t,n,i){e.x=t.x+n.x*i,e.y=t.y+n.y*i},r.lerp=function(e,t,n,i){var a=1-i;e.x=a*t.x+i*n.x,e.y=a*t.y+i*n.y},r}();const ft=coe;var Bm=Math.min,zm=Math.max,yu=new ft,_u=new ft,xu=new ft,Su=new ft,$d=new ft,Xd=new ft,hoe=function(){function r(e,t,n,i){n<0&&(e=e+n,n=-n),i<0&&(t=t+i,i=-i),this.x=e,this.y=t,this.width=n,this.height=i}return r.prototype.union=function(e){var t=Bm(e.x,this.x),n=Bm(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=zm(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=zm(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=t,this.y=n},r.prototype.applyTransform=function(e){r.applyTransform(this,this,e)},r.prototype.calculateTransform=function(e){var t=this,n=e.width/t.width,i=e.height/t.height,a=ta();return Xo(a,a,[-t.x,-t.y]),YC(a,a,[n,i]),Xo(a,a,[e.x,e.y]),a},r.prototype.intersect=function(e,t){if(!e)return!1;e instanceof r||(e=r.create(e));var n=this,i=n.x,a=n.x+n.width,o=n.y,s=n.y+n.height,l=e.x,u=e.x+e.width,c=e.y,h=e.y+e.height,f=!(ap&&(p=_,gp&&(p=x,m=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height},r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.copy=function(e){r.copy(this,e)},r.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},r.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},r.prototype.isZero=function(){return this.width===0||this.height===0},r.create=function(e){return new r(e.x,e.y,e.width,e.height)},r.copy=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},r.applyTransform=function(e,t,n){if(!n){e!==t&&r.copy(e,t);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var i=n[0],a=n[3],o=n[4],s=n[5];e.x=t.x*i+o,e.y=t.y*a+s,e.width=t.width*i,e.height=t.height*a,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}yu.x=xu.x=t.x,yu.y=Su.y=t.y,_u.x=Su.x=t.x+t.width,_u.y=xu.y=t.y+t.height,yu.transform(n),Su.transform(n),_u.transform(n),xu.transform(n),e.x=Bm(yu.x,_u.x,xu.x,Su.x),e.y=Bm(yu.y,_u.y,xu.y,Su.y);var l=zm(yu.x,_u.x,xu.x,Su.x),u=zm(yu.y,_u.y,xu.y,Su.y);e.width=l-e.x,e.height=u-e.y},r}();const dt=hoe;var YU="silent";function foe(r,e,t){return{type:r,event:t,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:t.zrX,offsetY:t.zrY,gestureEvent:t.gestureEvent,pinchX:t.pinchX,pinchY:t.pinchY,pinchScale:t.pinchScale,wheelDelta:t.zrDelta,zrByTouch:t.zrByTouch,which:t.which,stop:doe}}function doe(){Ps(this.event)}var poe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.handler=null,t}return e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(Ba),Yd=function(){function r(e,t){this.x=e,this.y=t}return r}(),voe=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],TS=new dt(0,0,0,0),qU=function(r){ae(e,r);function e(t,n,i,a,o){var s=r.call(this)||this;return s._hovered=new Yd(0,0),s.storage=t,s.painter=n,s.painterRoot=a,s._pointerSize=o,i=i||new poe,s.proxy=null,s.setHandlerProxy(i),s._draggingMgr=new jae(s),s}return e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(k(voe,function(n){t.on&&t.on(n,this[n],this)},this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var n=t.zrX,i=t.zrY,a=jU(this,n,i),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var l=this._hovered=a?new Yd(n,i):this.findHover(n,i),u=l.target,c=this.proxy;c.setCursor&&c.setCursor(u?u.cursor:"default"),s&&u!==s&&this.dispatchToElement(o,"mouseout",t),this.dispatchToElement(l,"mousemove",t),u&&u!==s&&this.dispatchToElement(l,"mouseover",t)},e.prototype.mouseout=function(t){var n=t.zrEventControl;n!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",t),n!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new Yd(0,0)},e.prototype.dispatch=function(t,n){var i=this[t];i&&i.call(this,n)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var n=this.proxy;n.setCursor&&n.setCursor(t)},e.prototype.dispatchToElement=function(t,n,i){t=t||{};var a=t.target;if(!(a&&a.silent)){for(var o="on"+n,s=foe(n,t,i);a&&(a[o]&&(s.cancelBubble=!!a[o].call(a,s)),a.trigger(n,s),a=a.__hostTarget?a.__hostTarget:a.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(n,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[o]=="function"&&l[o].call(l,s),l.trigger&&l.trigger(n,s)}))}},e.prototype.findHover=function(t,n,i){var a=this.storage.getDisplayList(),o=new Yd(t,n);if(qD(a,o,t,n,i),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,u=l/2,c=new dt(t-u,n-u,l,l),h=a.length-1;h>=0;h--){var f=a[h];f!==i&&!f.ignore&&!f.ignoreCoarsePointer&&(!f.parent||!f.parent.ignoreCoarsePointer)&&(TS.copy(f.getBoundingRect()),f.transform&&TS.applyTransform(f.transform),TS.intersect(c)&&s.push(f))}if(s.length)for(var d=4,p=Math.PI/12,g=Math.PI*2,v=0;v4)return;this._downPoint=null}this.dispatchToElement(a,r,e)}});function goe(r,e,t){if(r[r.rectHover?"rectContain":"contain"](e,t)){for(var n=r,i=void 0,a=!1;n;){if(n.ignoreClip&&(a=!0),!a){var o=n.getClipPath();if(o&&!o.contain(e,t))return!1}n.silent&&(i=!0);var s=n.__hostTarget;n=s||n.parent}return i?YU:!0}return!1}function qD(r,e,t,n,i){for(var a=r.length-1;a>=0;a--){var o=r[a],s=void 0;if(o!==i&&!o.ignore&&(s=goe(o,t,n))&&(!e.topTarget&&(e.topTarget=o),s!==YU)){e.target=o;break}}}function jU(r,e,t){var n=r.painter;return e<0||e>n.getWidth()||t<0||t>n.getHeight()}const moe=qU;var KU=32,qd=7;function yoe(r){for(var e=0;r>=KU;)e|=r&1,r>>=1;return r+e}function jD(r,e,t,n){var i=e+1;if(i===t)return 1;if(n(r[i++],r[e])<0){for(;i=0;)i++;return i-e}function _oe(r,e,t){for(t--;e>>1,i(a,r[l])<0?s=l:o=l+1;var u=n-o;switch(u){case 3:r[o+3]=r[o+2];case 2:r[o+2]=r[o+1];case 1:r[o+1]=r[o];break;default:for(;u>0;)r[o+u]=r[o+u-1],u--}r[o]=a}}function MS(r,e,t,n,i,a){var o=0,s=0,l=1;if(a(r,e[t+i])>0){for(s=n-i;l0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}else{for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}for(o++;o>>1);a(r,e[t+c])>0?o=c+1:l=c}return l}function CS(r,e,t,n,i,a){var o=0,s=0,l=1;if(a(r,e[t+i])<0){for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}else{for(s=n-i;l=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}for(o++;o>>1);a(r,e[t+c])<0?l=c:o=c+1}return l}function xoe(r,e){var t=qd,n,i,a=0,o=[];n=[],i=[];function s(d,p){n[a]=d,i[a]=p,a+=1}function l(){for(;a>1;){var d=a-2;if(d>=1&&i[d-1]<=i[d]+i[d+1]||d>=2&&i[d-2]<=i[d]+i[d-1])i[d-1]i[d+1])break;c(d)}}function u(){for(;a>1;){var d=a-2;d>0&&i[d-1]=qd||w>=qd);if(M)break;S<0&&(S=0),S+=2}if(t=S,t<1&&(t=1),p===1){for(m=0;m=0;m--)r[A+m]=r[S+m];r[x]=o[_];return}for(var w=t;;){var M=0,C=0,b=!1;do if(e(o[_],r[y])<0){if(r[x--]=r[y--],M++,C=0,--p===0){b=!0;break}}else if(r[x--]=o[_--],C++,M=0,--v===1){b=!0;break}while((M|C)=0;m--)r[A+m]=r[S+m];if(p===0){b=!0;break}}if(r[x--]=o[_--],--v===1){b=!0;break}if(C=v-MS(r[y],o,0,v,v-1,e),C!==0){for(x-=C,_-=C,v-=C,A=x+1,S=_+1,m=0;m=qd||C>=qd);if(b)break;w<0&&(w=0),w+=2}if(t=w,t<1&&(t=1),v===1){for(x-=p,y-=p,A=x+1,S=y+1,m=p-1;m>=0;m--)r[A+m]=r[S+m];r[x]=o[_]}else{if(v===0)throw new Error;for(S=x-(v-1),m=0;ms&&(l=s),KD(r,t,t+l,t+a,e),a=l}o.pushRun(t,a),o.mergeRuns(),i-=a,t+=a}while(i!==0);o.forceMergeRuns()}}var ji=1,Lp=2,tf=4,ZD=!1;function ES(){ZD||(ZD=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function QD(r,e){return r.zlevel===e.zlevel?r.z===e.z?r.z2-e.z2:r.z-e.z:r.zlevel-e.zlevel}var Soe=function(){function r(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=QD}return r.prototype.traverse=function(e,t){for(var n=0;n0&&(c.__clipPaths=[]),isNaN(c.z)&&(ES(),c.z=0),isNaN(c.z2)&&(ES(),c.z2=0),isNaN(c.zlevel)&&(ES(),c.zlevel=0),this._displayList[this._displayListLen++]=c}var h=e.getDecalElement&&e.getDecalElement();h&&this._updateAndAddDisplayable(h,t,n);var f=e.getTextGuideLine();f&&this._updateAndAddDisplayable(f,t,n);var d=e.getTextContent();d&&this._updateAndAddDisplayable(d,t,n)}},r.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},r.prototype.delRoot=function(e){if(e instanceof Array){for(var t=0,n=e.length;t=0&&this._roots.splice(i,1)},r.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},r.prototype.getRoots=function(){return this._roots},r.prototype.dispose=function(){this._displayList=null,this._roots=null},r}();const Aoe=Soe;var ZU;ZU=kt.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(r){return setTimeout(r,16)};const Jb=ZU;var t0={linear:function(r){return r},quadraticIn:function(r){return r*r},quadraticOut:function(r){return r*(2-r)},quadraticInOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)},cubicIn:function(r){return r*r*r},cubicOut:function(r){return--r*r*r+1},cubicInOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)},quarticIn:function(r){return r*r*r*r},quarticOut:function(r){return 1- --r*r*r*r},quarticInOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)},quinticIn:function(r){return r*r*r*r*r},quinticOut:function(r){return--r*r*r*r*r+1},quinticInOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)},sinusoidalIn:function(r){return 1-Math.cos(r*Math.PI/2)},sinusoidalOut:function(r){return Math.sin(r*Math.PI/2)},sinusoidalInOut:function(r){return .5*(1-Math.cos(Math.PI*r))},exponentialIn:function(r){return r===0?0:Math.pow(1024,r-1)},exponentialOut:function(r){return r===1?1:1-Math.pow(2,-10*r)},exponentialInOut:function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)},circularIn:function(r){return 1-Math.sqrt(1-r*r)},circularOut:function(r){return Math.sqrt(1- --r*r)},circularInOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)},elasticIn:function(r){var e,t=.1,n=.4;return r===0?0:r===1?1:(!t||t<1?(t=1,e=n/4):e=n*Math.asin(1/t)/(2*Math.PI),-(t*Math.pow(2,10*(r-=1))*Math.sin((r-e)*(2*Math.PI)/n)))},elasticOut:function(r){var e,t=.1,n=.4;return r===0?0:r===1?1:(!t||t<1?(t=1,e=n/4):e=n*Math.asin(1/t)/(2*Math.PI),t*Math.pow(2,-10*r)*Math.sin((r-e)*(2*Math.PI)/n)+1)},elasticInOut:function(r){var e,t=.1,n=.4;return r===0?0:r===1?1:(!t||t<1?(t=1,e=n/4):e=n*Math.asin(1/t)/(2*Math.PI),(r*=2)<1?-.5*(t*Math.pow(2,10*(r-=1))*Math.sin((r-e)*(2*Math.PI)/n)):t*Math.pow(2,-10*(r-=1))*Math.sin((r-e)*(2*Math.PI)/n)*.5+1)},backIn:function(r){var e=1.70158;return r*r*((e+1)*r-e)},backOut:function(r){var e=1.70158;return--r*r*((e+1)*r+e)+1},backInOut:function(r){var e=2.5949095;return(r*=2)<1?.5*(r*r*((e+1)*r-e)):.5*((r-=2)*r*((e+1)*r+e)+2)},bounceIn:function(r){return 1-t0.bounceOut(1-r)},bounceOut:function(r){return r<1/2.75?7.5625*r*r:r<2/2.75?7.5625*(r-=1.5/2.75)*r+.75:r<2.5/2.75?7.5625*(r-=2.25/2.75)*r+.9375:7.5625*(r-=2.625/2.75)*r+.984375},bounceInOut:function(r){return r<.5?t0.bounceIn(r*2)*.5:t0.bounceOut(r*2-1)*.5+.5}};const QU=t0;var Um=Math.pow,zl=Math.sqrt,K0=1e-8,JU=1e-4,JD=zl(3),Vm=1/3,Io=qc(),Aa=qc(),Tf=qc();function Cl(r){return r>-K0&&rK0||r<-K0}function pr(r,e,t,n,i){var a=1-i;return a*a*(a*r+3*i*e)+i*i*(i*n+3*a*t)}function eI(r,e,t,n,i){var a=1-i;return 3*(((e-r)*a+2*(t-e)*i)*a+(n-t)*i*i)}function Z0(r,e,t,n,i,a){var o=n+3*(e-t)-r,s=3*(t-e*2+r),l=3*(e-r),u=r-i,c=s*s-3*o*l,h=s*l-9*o*u,f=l*l-3*s*u,d=0;if(Cl(c)&&Cl(h))if(Cl(s))a[0]=0;else{var p=-l/s;p>=0&&p<=1&&(a[d++]=p)}else{var g=h*h-4*c*f;if(Cl(g)){var v=h/c,p=-s/o+v,m=-v/2;p>=0&&p<=1&&(a[d++]=p),m>=0&&m<=1&&(a[d++]=m)}else if(g>0){var y=zl(g),_=c*s+1.5*o*(-h+y),x=c*s+1.5*o*(-h-y);_<0?_=-Um(-_,Vm):_=Um(_,Vm),x<0?x=-Um(-x,Vm):x=Um(x,Vm);var p=(-s-(_+x))/(3*o);p>=0&&p<=1&&(a[d++]=p)}else{var S=(2*c*s-3*o*h)/(2*zl(c*c*c)),A=Math.acos(S)/3,w=zl(c),M=Math.cos(A),p=(-s-2*w*M)/(3*o),m=(-s+w*(M+JD*Math.sin(A)))/(3*o),C=(-s+w*(M-JD*Math.sin(A)))/(3*o);p>=0&&p<=1&&(a[d++]=p),m>=0&&m<=1&&(a[d++]=m),C>=0&&C<=1&&(a[d++]=C)}}return d}function t4(r,e,t,n,i){var a=6*t-12*e+6*r,o=9*e+3*n-3*r-9*t,s=3*e-3*r,l=0;if(Cl(o)){if(e4(a)){var u=-s/a;u>=0&&u<=1&&(i[l++]=u)}}else{var c=a*a-4*o*s;if(Cl(c))i[0]=-a/(2*o);else if(c>0){var h=zl(c),u=(-a+h)/(2*o),f=(-a-h)/(2*o);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function jl(r,e,t,n,i,a){var o=(e-r)*i+r,s=(t-e)*i+e,l=(n-t)*i+t,u=(s-o)*i+o,c=(l-s)*i+s,h=(c-u)*i+u;a[0]=r,a[1]=o,a[2]=u,a[3]=h,a[4]=h,a[5]=c,a[6]=l,a[7]=n}function n4(r,e,t,n,i,a,o,s,l,u,c){var h,f=.005,d=1/0,p,g,v,m;Io[0]=l,Io[1]=u;for(var y=0;y<1;y+=.05)Aa[0]=pr(r,t,i,o,y),Aa[1]=pr(e,n,a,s,y),v=bc(Io,Aa),v=0&&v=0&&u<=1&&(i[l++]=u)}}else{var c=o*o-4*a*s;if(Cl(c)){var u=-o/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(c>0){var h=zl(c),u=(-o+h)/(2*a),f=(-o-h)/(2*a);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function r4(r,e,t){var n=r+t-2*e;return n===0?.5:(r-e)/n}function Bv(r,e,t,n,i){var a=(e-r)*n+r,o=(t-e)*n+e,s=(o-a)*n+a;i[0]=r,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=t}function i4(r,e,t,n,i,a,o,s,l){var u,c=.005,h=1/0;Io[0]=o,Io[1]=s;for(var f=0;f<1;f+=.05){Aa[0]=Tr(r,t,i,f),Aa[1]=Tr(e,n,a,f);var d=bc(Io,Aa);d=0&&d=1?1:Z0(0,n,a,1,l,s)&&pr(0,i,o,1,s[0])}}}var Coe=function(){function r(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||qn,this.ondestroy=e.ondestroy||qn,this.onrestart=e.onrestart||qn,e.easing&&this.setEasing(e.easing)}return r.prototype.step=function(e,t){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=t;return}var n=this._life,i=e-this._startTime-this._pausedTime,a=i/n;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=i%n;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){this._paused=!1},r.prototype.setEasing=function(e){this.easing=e,this.easingFunc=qe(e)?e:QU[e]||qC(e)},r}();const Eoe=Coe;var a4=function(){function r(e){this.value=e}return r}(),Loe=function(){function r(){this._len=0}return r.prototype.insert=function(e){var t=new a4(e);return this.insertEntry(t),t},r.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},r.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},r.prototype.len=function(){return this._len},r.prototype.clear=function(){this.head=this.tail=null,this._len=0},r}(),Poe=function(){function r(e){this._list=new Loe,this._maxSize=10,this._map={},this._maxSize=e}return r.prototype.put=function(e,t){var n=this._list,i=this._map,a=null;if(i[e]==null){var o=n.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=n.head;n.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=t:s=new a4(t),s.key=e,n.insertEntry(s),i[e]=s}return a},r.prototype.get=function(e){var t=this._map[e],n=this._list;if(t!=null)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},r.prototype.clear=function(){this._list.clear(),this._map={}},r.prototype.len=function(){return this._list.len()},r}();const Ag=Poe;var tI={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function ro(r){return r=Math.round(r),r<0?0:r>255?255:r}function Roe(r){return r=Math.round(r),r<0?0:r>360?360:r}function zv(r){return r<0?0:r>1?1:r}function LS(r){var e=r;return e.length&&e.charAt(e.length-1)==="%"?ro(parseFloat(e)/100*255):ro(parseInt(e,10))}function Tc(r){var e=r;return e.length&&e.charAt(e.length-1)==="%"?zv(parseFloat(e)/100):zv(parseFloat(e))}function PS(r,e,t){return t<0?t+=1:t>1&&(t-=1),t*6<1?r+(e-r)*t*6:t*2<1?e:t*3<2?r+(e-r)*(2/3-t)*6:r}function El(r,e,t){return r+(e-r)*t}function da(r,e,t,n,i){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r}function tT(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}var o4=new Ag(20),Gm=null;function Rh(r,e){Gm&&tT(Gm,e),Gm=o4.put(r,Gm||e.slice())}function na(r,e){if(r){e=e||[];var t=o4.get(r);if(t)return tT(e,t);r=r+"";var n=r.replace(/ /g,"").toLowerCase();if(n in tI)return tT(e,tI[n]),Rh(r,e),e;var i=n.length;if(n.charAt(0)==="#"){if(i===4||i===5){var a=parseInt(n.slice(1,4),16);if(!(a>=0&&a<=4095)){da(e,0,0,0,1);return}return da(e,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(n.slice(4),16)/15:1),Rh(r,e),e}else if(i===7||i===9){var a=parseInt(n.slice(1,7),16);if(!(a>=0&&a<=16777215)){da(e,0,0,0,1);return}return da(e,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(n.slice(7),16)/255:1),Rh(r,e),e}return}var o=n.indexOf("("),s=n.indexOf(")");if(o!==-1&&s+1===i){var l=n.substr(0,o),u=n.substr(o+1,s-(o+1)).split(","),c=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?da(e,+u[0],+u[1],+u[2],1):da(e,0,0,0,1);c=Tc(u.pop());case"rgb":if(u.length>=3)return da(e,LS(u[0]),LS(u[1]),LS(u[2]),u.length===3?c:Tc(u[3])),Rh(r,e),e;da(e,0,0,0,1);return;case"hsla":if(u.length!==4){da(e,0,0,0,1);return}return u[3]=Tc(u[3]),nT(u,e),Rh(r,e),e;case"hsl":if(u.length!==3){da(e,0,0,0,1);return}return nT(u,e),Rh(r,e),e;default:return}}da(e,0,0,0,1)}}function nT(r,e){var t=(parseFloat(r[0])%360+360)%360/360,n=Tc(r[1]),i=Tc(r[2]),a=i<=.5?i*(n+1):i+n-i*n,o=i*2-a;return e=e||[],da(e,ro(PS(o,a,t+1/3)*255),ro(PS(o,a,t)*255),ro(PS(o,a,t-1/3)*255),1),r.length===4&&(e[3]=r[3]),e}function Doe(r){if(r){var e=r[0]/255,t=r[1]/255,n=r[2]/255,i=Math.min(e,t,n),a=Math.max(e,t,n),o=a-i,s=(a+i)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+i):u=o/(2-a-i);var c=((a-e)/6+o/2)/o,h=((a-t)/6+o/2)/o,f=((a-n)/6+o/2)/o;e===a?l=f-h:t===a?l=1/3+c-f:n===a&&(l=2/3+h-c),l<0&&(l+=1),l>1&&(l-=1)}var d=[l*360,u,s];return r[3]!=null&&d.push(r[3]),d}}function rT(r,e){var t=na(r);if(t){for(var n=0;n<3;n++)e<0?t[n]=t[n]*(1-e)|0:t[n]=(255-t[n])*e+t[n]|0,t[n]>255?t[n]=255:t[n]<0&&(t[n]=0);return ws(t,t.length===4?"rgba":"rgb")}}function RS(r,e,t){if(!(!(e&&e.length)||!(r>=0&&r<=1))){t=t||[];var n=r*(e.length-1),i=Math.floor(n),a=Math.ceil(n),o=e[i],s=e[a],l=n-i;return t[0]=ro(El(o[0],s[0],l)),t[1]=ro(El(o[1],s[1],l)),t[2]=ro(El(o[2],s[2],l)),t[3]=zv(El(o[3],s[3],l)),t}}function Ioe(r,e,t){if(!(!(e&&e.length)||!(r>=0&&r<=1))){var n=r*(e.length-1),i=Math.floor(n),a=Math.ceil(n),o=na(e[i]),s=na(e[a]),l=n-i,u=ws([ro(El(o[0],s[0],l)),ro(El(o[1],s[1],l)),ro(El(o[2],s[2],l)),zv(El(o[3],s[3],l))],"rgba");return t?{color:u,leftIndex:i,rightIndex:a,value:n}:u}}function ev(r,e,t,n){var i=na(r);if(r)return i=Doe(i),e!=null&&(i[0]=Roe(e)),t!=null&&(i[1]=Tc(t)),n!=null&&(i[2]=Tc(n)),ws(nT(i),"rgba")}function Q0(r,e){var t=na(r);if(t&&e!=null)return t[3]=zv(e),ws(t,"rgba")}function ws(r,e){if(!(!r||!r.length)){var t=r[0]+","+r[1]+","+r[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(t+=","+r[3]),e+"("+t+")"}}function J0(r,e){var t=na(r);return t?(.299*t[0]+.587*t[1]+.114*t[2])*t[3]/255+(1-t[3])*e:0}var nI=new Ag(100);function iT(r){if(ke(r)){var e=nI.get(r);return e||(e=rT(r,-.1),nI.put(r,e)),e}else if(p1(r)){var t=pe({},r);return t.colorStops=xe(r.colorStops,function(n){return{offset:n.offset,color:rT(n.color,-.1)}}),t}return r}var e_=Math.round;function Uv(r){var e;if(!r||r==="transparent")r="none";else if(typeof r=="string"&&r.indexOf("rgba")>-1){var t=na(r);t&&(r="rgb("+t[0]+","+t[1]+","+t[2]+")",e=t[3])}return{color:r,opacity:e==null?1:e}}var rI=1e-4;function Ll(r){return r-rI}function Hm(r){return e_(r*1e3)/1e3}function aT(r){return e_(r*1e4)/1e4}function Noe(r){return"matrix("+Hm(r[0])+","+Hm(r[1])+","+Hm(r[2])+","+Hm(r[3])+","+aT(r[4])+","+aT(r[5])+")"}var koe={left:"start",right:"end",center:"middle",middle:"middle"};function Ooe(r,e,t){return t==="top"?r+=e/2:t==="bottom"&&(r-=e/2),r}function Foe(r){return r&&(r.shadowBlur||r.shadowOffsetX||r.shadowOffsetY)}function Boe(r){var e=r.style,t=r.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),t[0],t[1]].join(",")}function s4(r){return r&&!!r.image}function zoe(r){return r&&!!r.svgElement}function jC(r){return s4(r)||zoe(r)}function l4(r){return r.type==="linear"}function u4(r){return r.type==="radial"}function c4(r){return r&&(r.type==="linear"||r.type==="radial")}function m1(r){return"url(#"+r+")"}function h4(r){var e=r.getGlobalScale(),t=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(t)/Math.log(10)),1)}function f4(r){var e=r.x||0,t=r.y||0,n=(r.rotation||0)*Zy,i=ot(r.scaleX,1),a=ot(r.scaleY,1),o=r.skewX||0,s=r.skewY||0,l=[];return(e||t)&&l.push("translate("+e+"px,"+t+"px)"),n&&l.push("rotate("+n+")"),(i!==1||a!==1)&&l.push("scale("+i+","+a+")"),(o||s)&&l.push("skew("+e_(o*Zy)+"deg, "+e_(s*Zy)+"deg)"),l.join(" ")}var Uoe=function(){return kt.hasGlobalWindow&&qe(window.btoa)?function(r){return window.btoa(unescape(encodeURIComponent(r)))}:typeof Buffer!="undefined"?function(r){return Buffer.from(r).toString("base64")}:function(r){return null}}(),oT=Array.prototype.slice;function ds(r,e,t){return(e-r)*t+r}function DS(r,e,t,n){for(var i=e.length,a=0;an?e:r,a=Math.min(t,n),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;so;if(s)n.length=o;else for(var l=a;l=1},r.prototype.getAdditiveTrack=function(){return this._additiveTrack},r.prototype.addKeyframe=function(e,t,n){this._needsSort=!0;var i=this.keyframes,a=i.length,o=!1,s=aI,l=t;if(ii(t)){var u=Woe(t);s=u,(u===1&&!Ft(t[0])||u===2&&!Ft(t[0][0]))&&(o=!0)}else if(Ft(t)&&!Ov(t))s=$m;else if(ke(t))if(!isNaN(+t))s=$m;else{var c=na(t);c&&(l=c,s=Pp)}else if(p1(t)){var h=pe({},l);h.colorStops=xe(t.colorStops,function(d){return{offset:d.offset,color:na(d.color)}}),l4(t)?s=sT:u4(t)&&(s=lT),l=h}a===0?this.valType=s:(s!==this.valType||s===aI)&&(o=!0),this.discrete=this.discrete||o;var f={time:e,value:l,rawValue:t,percent:0};return n&&(f.easing=n,f.easingFunc=qe(n)?n:QU[n]||qC(n)),i.push(f),f},r.prototype.prepare=function(e,t){var n=this.keyframes;this._needsSort&&n.sort(function(g,v){return g.time-v.time});for(var i=this.valType,a=n.length,o=n[a-1],s=this.discrete,l=Xm(i),u=oI(i),c=0;c=0&&!(o[c].percent<=t);c--);c=f(c,s-2)}else{for(c=h;ct);c++);c=f(c-1,s-2)}p=o[c+1],d=o[c]}if(d&&p){this._lastFr=c,this._lastFrP=t;var v=p.percent-d.percent,m=v===0?1:f((t-d.percent)/v,1);p.easingFunc&&(m=p.easingFunc(m));var y=n?this._additiveValue:u?jd:e[l];if((Xm(a)||u)&&!y&&(y=this._additiveValue=[]),this.discrete)e[l]=m<1?d.rawValue:p.rawValue;else if(Xm(a))a===r0?DS(y,d[i],p[i],m):Voe(y,d[i],p[i],m);else if(oI(a)){var _=d[i],x=p[i],S=a===sT;e[l]={type:S?"linear":"radial",x:ds(_.x,x.x,m),y:ds(_.y,x.y,m),colorStops:xe(_.colorStops,function(w,M){var C=x.colorStops[M];return{offset:ds(w.offset,C.offset,m),color:n0(DS([],w.color,C.color,m))}}),global:x.global},S?(e[l].x2=ds(_.x2,x.x2,m),e[l].y2=ds(_.y2,x.y2,m)):e[l].r=ds(_.r,x.r,m)}else if(u)DS(y,d[i],p[i],m),n||(e[l]=n0(y));else{var A=ds(d[i],p[i],m);n?this._additiveValue=A:e[l]=A}n&&this._addToTarget(e)}}},r.prototype._addToTarget=function(e){var t=this.valType,n=this.propName,i=this._additiveValue;t===$m?e[n]=e[n]+i:t===Pp?(na(e[n],jd),Wm(jd,jd,i,1),e[n]=n0(jd)):t===r0?Wm(e[n],e[n],i,1):t===d4&&iI(e[n],e[n],i,1)},r}(),KC=function(){function r(e,t,n,i){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&i){VC("Can' use additive animation on looped animation.");return}this._additiveAnimators=i,this._allowDiscrete=n}return r.prototype.getMaxTime=function(){return this._maxTime},r.prototype.getDelay=function(){return this._delay},r.prototype.getLoop=function(){return this._loop},r.prototype.getTarget=function(){return this._target},r.prototype.changeTarget=function(e){this._target=e},r.prototype.when=function(e,t,n){return this.whenWithKeys(e,t,wt(t),n)},r.prototype.whenWithKeys=function(e,t,n,i){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,tv(u),i),this._trackKeys.push(s)}l.addKeyframe(e,tv(t[s]),i)}return this._maxTime=Math.max(this._maxTime,e),this},r.prototype.pause=function(){this._clip.pause(),this._paused=!0},r.prototype.resume=function(){this._clip.resume(),this._paused=!1},r.prototype.isPaused=function(){return!!this._paused},r.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},r.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,n=0;n0)){this._started=1;for(var t=this,n=[],i=this._maxTime||0,a=0;a1){var s=o.pop();a.addKeyframe(s.time,e[i]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},r}();function pf(){return new Date().getTime()}var Xoe=function(r){ae(e,r);function e(t){var n=r.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,t=t||{},n.stage=t.stage||{},n}return e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var n=t.getClip();n&&this.addClip(n)},e.prototype.removeClip=function(t){if(t.animation){var n=t.prev,i=t.next;n?n.next=i:this._head=i,i?i.prev=n:this._tail=n,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var n=t.getClip();n&&this.removeClip(n),t.animation=null},e.prototype.update=function(t){for(var n=pf()-this._pausedTime,i=n-this._time,a=this._head;a;){var o=a.next,s=a.step(n,i);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=n,t||(this.trigger("frame",i),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0;function n(){t._running&&(Jb(n),!t._paused&&t.update())}Jb(n)},e.prototype.start=function(){this._running||(this._time=pf(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=pf(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=pf()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var n=t.next;t.prev=t.next=t.animation=null,t=n}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(t,n){n=n||{},this.start();var i=new KC(t,n.loop);return this.addAnimator(i),i},e}(Ba);const Yoe=Xoe;var qoe=300,IS=kt.domSupported,NS=function(){var r=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],t={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},n=xe(r,function(i){var a=i.replace("mouse","pointer");return t.hasOwnProperty(a)?a:i});return{mouse:r,touch:e,pointer:n}}(),sI={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},lI=!1;function uT(r){var e=r.pointerType;return e==="pen"||e==="touch"}function joe(r){r.touching=!0,r.touchTimer!=null&&(clearTimeout(r.touchTimer),r.touchTimer=null),r.touchTimer=setTimeout(function(){r.touching=!1,r.touchTimer=null},700)}function kS(r){r&&(r.zrByTouch=!0)}function Koe(r,e){return ma(r.dom,new Zoe(r,e),!0)}function p4(r,e){for(var t=e,n=!1;t&&t.nodeType!==9&&!(n=t.domBelongToZr||t!==e&&t===r.painterRoot);)t=t.parentNode;return n}var Zoe=function(){function r(e,t){this.stopPropagation=qn,this.stopImmediatePropagation=qn,this.preventDefault=qn,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}return r}(),Ya={mousedown:function(r){r=ma(this.dom,r),this.__mayPointerCapture=[r.zrX,r.zrY],this.trigger("mousedown",r)},mousemove:function(r){r=ma(this.dom,r);var e=this.__mayPointerCapture;e&&(r.zrX!==e[0]||r.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",r)},mouseup:function(r){r=ma(this.dom,r),this.__togglePointerCapture(!1),this.trigger("mouseup",r)},mouseout:function(r){r=ma(this.dom,r);var e=r.toElement||r.relatedTarget;p4(this,e)||(this.__pointerCapturing&&(r.zrEventControl="no_globalout"),this.trigger("mouseout",r))},wheel:function(r){lI=!0,r=ma(this.dom,r),this.trigger("mousewheel",r)},mousewheel:function(r){lI||(r=ma(this.dom,r),this.trigger("mousewheel",r))},touchstart:function(r){r=ma(this.dom,r),kS(r),this.__lastTouchMoment=new Date,this.handler.processGesture(r,"start"),Ya.mousemove.call(this,r),Ya.mousedown.call(this,r)},touchmove:function(r){r=ma(this.dom,r),kS(r),this.handler.processGesture(r,"change"),Ya.mousemove.call(this,r)},touchend:function(r){r=ma(this.dom,r),kS(r),this.handler.processGesture(r,"end"),Ya.mouseup.call(this,r),+new Date-+this.__lastTouchMomenthI||r<-hI}var wu=[],Dh=[],FS=ta(),BS=Math.abs,rse=function(){function r(){}return r.prototype.getLocalTransform=function(e){return r.getLocalTransform(this,e)},r.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},r.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},r.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},r.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},r.prototype.needLocalTransform=function(){return Au(this.rotation)||Au(this.x)||Au(this.y)||Au(this.scaleX-1)||Au(this.scaleY-1)||Au(this.skewX)||Au(this.skewY)},r.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),n=this.transform;if(!(t||e)){n&&(cI(n),this.invTransform=null);return}n=n||ta(),t?this.getLocalTransform(n):cI(n),e&&(t?As(n,e,n):XC(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n)},r.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(wu);var n=wu[0]<0?-1:1,i=wu[1]<0?-1:1,a=((wu[0]-n)*t+n)/wu[0]||0,o=((wu[1]-i)*t+i)/wu[1]||0;e[0]*=a,e[1]*=a,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||ta(),vd(this.invTransform,e)},r.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},r.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],i=Math.atan2(e[1],e[0]),a=Math.PI/2+i-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(a),t=Math.sqrt(t),this.skewX=a,this.skewY=0,this.rotation=-i,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=n,this.originX=0,this.originY=0}},r.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||ta(),As(Dh,e.invTransform,t),t=Dh);var n=this.originX,i=this.originY;(n||i)&&(FS[4]=n,FS[5]=i,As(Dh,t,FS),Dh[4]-=n,Dh[5]-=i,t=Dh),this.setLocalTransform(t)}},r.prototype.getGlobalScale=function(e){var t=this.transform;return e=e||[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},r.prototype.transformCoordToLocal=function(e,t){var n=[e,t],i=this.invTransform;return i&&Or(n,n,i),n},r.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],i=this.transform;return i&&Or(n,n,i),n},r.prototype.getLineScale=function(){var e=this.transform;return e&&BS(e[0]-1)>1e-10&&BS(e[3]-1)>1e-10?Math.sqrt(BS(e[0]*e[3]-e[2]*e[1])):1},r.prototype.copyTransform=function(e){g4(this,e)},r.getLocalTransform=function(e,t){t=t||[];var n=e.originX||0,i=e.originY||0,a=e.scaleX,o=e.scaleY,s=e.anchorX,l=e.anchorY,u=e.rotation||0,c=e.x,h=e.y,f=e.skewX?Math.tan(e.skewX):0,d=e.skewY?Math.tan(-e.skewY):0;if(n||i||s||l){var p=n+s,g=i+l;t[4]=-p*a-f*g*o,t[5]=-g*o-d*p*a}else t[4]=t[5]=0;return t[0]=a,t[3]=o,t[1]=d*a,t[2]=f*o,u&&jc(t,t,u),t[4]+=n+c,t[5]+=i+h,t},r.initDefaultProps=function(){var e=r.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0}(),r}(),Yo=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function g4(r,e){for(var t=0;t=0?parseFloat(r)/100*e:parseFloat(r):r}function n_(r,e,t){var n=e.position||"inside",i=e.distance!=null?e.distance:5,a=t.height,o=t.width,s=a/2,l=t.x,u=t.y,c="left",h="top";if(n instanceof Array)l+=so(n[0],t.width),u+=so(n[1],t.height),c=null,h=null;else switch(n){case"left":l-=i,u+=s,c="right",h="middle";break;case"right":l+=i+o,u+=s,h="middle";break;case"top":l+=o/2,u-=i,c="center",h="bottom";break;case"bottom":l+=o/2,u+=a+i,c="center";break;case"inside":l+=o/2,u+=s,c="center",h="middle";break;case"insideLeft":l+=i,u+=s,h="middle";break;case"insideRight":l+=o-i,u+=s,c="right",h="middle";break;case"insideTop":l+=o/2,u+=i,c="center";break;case"insideBottom":l+=o/2,u+=a-i,c="center",h="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=o-i,u+=i,c="right";break;case"insideBottomLeft":l+=i,u+=a-i,h="bottom";break;case"insideBottomRight":l+=o-i,u+=a-i,c="right",h="bottom";break}return r=r||{},r.x=l,r.y=u,r.align=c,r.verticalAlign=h,r}var zS="__zr_normal__",US=Yo.concat(["ignore"]),ise=$o(Yo,function(r,e){return r[e]=!0,r},{ignore:!1}),Ih={},ase=new dt(0,0,0,0),ZC=function(){function r(e){this.id=GU(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return r.prototype._init=function(e){this.attr(e)},r.prototype.drift=function(e,t,n){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0;break}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=e,i[5]+=t,this.decomposeTransform(),this.markRedraw()},r.prototype.beforeUpdate=function(){},r.prototype.afterUpdate=function(){},r.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},r.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,a=t.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=i?this:null;var u=!1;if(a.copyTransform(t),n.position!=null){var c=ase;n.layoutRect?c.copy(n.layoutRect):c.copy(this.getBoundingRect()),i||c.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Ih,n,c):n_(Ih,n,c),a.x=Ih.x,a.y=Ih.y,o=Ih.align,s=Ih.verticalAlign;var h=n.origin;if(h&&n.rotation!=null){var f=void 0,d=void 0;h==="center"?(f=c.width*.5,d=c.height*.5):(f=so(h[0],c.width),d=so(h[1],c.height)),u=!0,a.originX=-a.x+f+(i?0:c.x),a.originY=-a.y+d+(i?0:c.y)}}n.rotation!=null&&(a.rotation=n.rotation);var p=n.offset;p&&(a.x+=p[0],a.y+=p[1],u||(a.originX=-p[0],a.originY=-p[1]));var g=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,v=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),m=void 0,y=void 0,_=void 0;g&&this.canBeInsideText()?(m=n.insideFill,y=n.insideStroke,(m==null||m==="auto")&&(m=this.getInsideTextFill()),(y==null||y==="auto")&&(y=this.getInsideTextStroke(m),_=!0)):(m=n.outsideFill,y=n.outsideStroke,(m==null||m==="auto")&&(m=this.getOutsideFill()),(y==null||y==="auto")&&(y=this.getOutsideStroke(m),_=!0)),m=m||"#000",(m!==v.fill||y!==v.stroke||_!==v.autoStroke||o!==v.align||s!==v.verticalAlign)&&(l=!0,v.fill=m,v.stroke=y,v.autoStroke=_,v.align=o,v.verticalAlign=s,t.setDefaultTextStyle(v)),t.__dirty|=ji,l&&t.dirtyStyle(!0)}},r.prototype.canBeInsideText=function(){return!0},r.prototype.getInsideTextFill=function(){return"#fff"},r.prototype.getInsideTextStroke=function(e){return"#000"},r.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?dT:fT},r.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n=typeof t=="string"&&na(t);n||(n=[255,255,255,1]);for(var i=n[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*i+(a?0:255)*(1-i);return n[3]=1,ws(n,"rgba")},r.prototype.traverse=function(e,t){},r.prototype.attrKV=function(e,t){e==="textConfig"?this.setTextConfig(t):e==="textContent"?this.setTextContent(t):e==="clipPath"?this.setClipPath(t):e==="extra"?(this.extra=this.extra||{},pe(this.extra,t)):this[e]=t},r.prototype.hide=function(){this.ignore=!0,this.markRedraw()},r.prototype.show=function(){this.ignore=!1,this.markRedraw()},r.prototype.attr=function(e,t){if(typeof e=="string")this.attrKV(e,t);else if(Qe(e))for(var n=e,i=wt(n),a=0;a0},r.prototype.getState=function(e){return this.states[e]},r.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},r.prototype.clearStates=function(e){this.useState(zS,!1,e)},r.prototype.useState=function(e,t,n,i){var a=e===zS,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(pt(s,e)>=0&&(t||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(e)),u||(u=this.states&&this.states[e]),!u&&!a){VC("State "+e+" not exists.");return}a||this.saveCurrentToNormalState(u);var c=!!(u&&u.hoverLayer||i);c&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,u,this._normalState,t,!n&&!this.__inHover&&l&&l.duration>0,l);var h=this._textContent,f=this._textGuide;return h&&h.useState(e,t,n,c),f&&f.useState(e,t,n,c),a?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~ji),u}}},r.prototype.useStates=function(e,t,n){if(!e.length)this.clearStates();else{var i=[],a=this.currentStates,o=e.length,s=o===a.length;if(s){for(var l=0;l0,p);var g=this._textContent,v=this._textGuide;g&&g.useStates(e,t,f),v&&v.useStates(e,t,f),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!f&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~ji)}},r.prototype.isSilent=function(){for(var e=this.silent,t=this.parent;!e&&t;){if(t.silent){e=!0;break}t=t.parent}return e},r.prototype._updateAnimationTargets=function(){for(var e=0;e=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},r.prototype.replaceState=function(e,t,n){var i=this.currentStates.slice(),a=pt(i,e),o=pt(i,t)>=0;a>=0?o?i.splice(a,1):i[a]=t:n&&!o&&i.push(t),this.useStates(i)},r.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},r.prototype._mergeStates=function(e){for(var t={},n,i=0;i=0&&a.splice(o,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},r.prototype.updateDuringAnimation=function(e){this.markRedraw()},r.prototype.stopAnimation=function(e,t){for(var n=this.animators,i=n.length,a=[],o=0;o0&&t.during&&a[0].during(function(p,g){t.during(g)});for(var f=0;f0||i.force&&!o.length){var M=void 0,C=void 0,b=void 0;if(s){C={},f&&(M={});for(var x=0;x<_;x++){var m=g[x];C[m]=t[m],f?M[m]=n[m]:t[m]=n[m]}}else if(f){b={};for(var x=0;x<_;x++){var m=g[x];b[m]=tv(t[m]),sse(t,n,m)}}var S=new KC(t,!1,!1,h?jt(p,function(P){return P.targetName===e}):null);S.targetName=e,i.scope&&(S.scope=i.scope),f&&M&&S.whenWithKeys(0,M,g),b&&S.whenWithKeys(0,b,g),S.whenWithKeys(u==null?500:u,s?C:n,g).delay(c||0),r.addAnimator(S,e),o.push(S)}}const y4=ZC;var _4=function(r){ae(e,r);function e(t){var n=r.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(t),n}return e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(t){return this._children[t]},e.prototype.childOfName=function(t){for(var n=this._children,i=0;i=0&&(i.splice(a,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,n){var i=pt(this._children,t);return i>=0&&this.replaceAt(n,i),this},e.prototype.replaceAt=function(t,n){var i=this._children,a=i[n];if(t&&t!==this&&t.parent!==this&&t!==a){i[n]=t,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var n=this.__zr;n&&n!==t.__zr&&t.addSelfToZr(n),n&&n.refresh()},e.prototype.remove=function(t){var n=this.__zr,i=this._children,a=pt(i,t);return a<0?this:(i.splice(a,1),t.parent=null,n&&t.removeSelfFromZr(n),n&&n.refresh(),this)},e.prototype.removeAll=function(){for(var t=this._children,n=this.__zr,i=0;i0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},r.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},r.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},r.prototype.refreshHover=function(){this._needsRefreshHover=!0},r.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},r.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},r.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},r.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},r.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},r.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},r.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},r.prototype.on=function(e,t,n){return this._disposed||this.handler.on(e,t,n),this},r.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},r.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},r.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t0){if(r<=i)return o;if(r>=a)return s}else{if(r>=i)return o;if(r<=a)return s}else{if(r===i)return o;if(r===a)return s}return(r-i)/l*u+o}function Pe(r,e){switch(r){case"center":case"middle":r="50%";break;case"left":case"top":r="0%";break;case"right":case"bottom":r="100%";break}return ke(r)?gse(r).match(/%$/)?parseFloat(r)/100*e:parseFloat(r):r==null?NaN:+r}function Vn(r,e,t){return e==null&&(e=10),e=Math.min(Math.max(0,e),S4),r=(+r).toFixed(e),t?r:+r}function Pa(r){return r.sort(function(e,t){return e-t}),r}function Oo(r){if(r=+r,isNaN(r))return 0;if(r>1e-14){for(var e=1,t=0;t<15;t++,e*=10)if(Math.round(r*e)/e===r)return t}return mse(r)}function mse(r){var e=r.toString().toLowerCase(),t=e.indexOf("e"),n=t>0?+e.slice(t+1):0,i=t>0?t:e.length,a=e.indexOf("."),o=a<0?0:i-1-a;return Math.max(0,o-n)}function A4(r,e){var t=Math.log,n=Math.LN10,i=Math.floor(t(r[1]-r[0])/n),a=Math.round(t(Math.abs(e[1]-e[0]))/n),o=Math.min(Math.max(-i+a,0),20);return isFinite(o)?o:20}function yse(r,e){var t=$o(r,function(d,p){return d+(isNaN(p)?0:p)},0);if(t===0)return[];for(var n=Math.pow(10,e),i=xe(r,function(d){return(isNaN(d)?0:d)/t*n*100}),a=n*100,o=xe(i,function(d){return Math.floor(d)}),s=$o(o,function(d,p){return d+p},0),l=xe(i,function(d,p){return d-o[p]});su&&(u=l[h],c=h);++o[c],l[c]=0,++s}return xe(o,function(d){return d/n})}function _se(r,e){var t=Math.max(Oo(r),Oo(e)),n=r+e;return t>S4?n:Vn(n,t)}var gI=9007199254740991;function w4(r){var e=Math.PI*2;return(r%e+e)%e}function Vv(r){return r>-vI&&r=10&&e++,e}function b4(r,e){var t=QC(r),n=Math.pow(10,t),i=r/n,a;return e?i<1.5?a=1:i<2.5?a=2:i<4?a=3:i<7?a=5:a=10:i<1?a=1:i<2?a=2:i<3?a=3:i<5?a=5:a=10,r=a*n,t>=-20?+r.toFixed(t<0?-t:0):r}function HS(r,e){var t=(r.length-1)*e+1,n=Math.floor(t),i=+r[n-1],a=t-n;return a?i+a*(r[n]-i):i}function mI(r){r.sort(function(l,u){return s(l,u,0)?-1:1});for(var e=-1/0,t=1,n=0;n=0||a&&pt(a,l)<0)){var u=n.getShallow(l,e);u!=null&&(o[r[s][0]]=u)}}return o}}var $se=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],Xse=Vc($se),Yse=function(){function r(){}return r.prototype.getAreaStyle=function(e,t){return Xse(this,e,t)},r}(),gT=new Ag(50);function qse(r){if(typeof r=="string"){var e=gT.get(r);return e&&e.image}else return r}function n2(r,e,t,n,i){if(r)if(typeof r=="string"){if(e&&e.__zrImageSrc===r||!t)return e;var a=gT.get(r),o={hostEl:t,cb:n,cbPayload:i};return a?(e=a.image,!x1(e)&&a.pending.push(o)):(e=ql.loadImage(r,SI,SI),e.__zrImageSrc=r,gT.put(r,e.__cachedImgObj={image:e,pending:[o]})),e}else return r;else return e}function SI(){var r=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=o;l++)s-=o;var u=ra(t,e);return u>s&&(t="",u=0),s=r-u,i.ellipsis=t,i.ellipsisWidth=u,i.contentWidth=s,i.containerWidth=r,i}function F4(r,e,t){var n=t.containerWidth,i=t.font,a=t.contentWidth;if(!n){r.textLine="",r.isTruncated=!1;return}var o=ra(e,i);if(o<=n){r.textLine=e,r.isTruncated=!1;return}for(var s=0;;s++){if(o<=a||s>=t.maxIterations){e+=t.ellipsis;break}var l=s===0?Kse(e,a,t.ascCharWidth,t.cnCharWidth):o>0?Math.floor(e.length*a/o):0;e=e.substr(0,l),o=ra(e,i)}e===""&&(e=t.placeholder),r.textLine=e,r.isTruncated=!0}function Kse(r,e,t,n){for(var i=0,a=0,o=r.length;ap&&u){var g=Math.floor(p/s);c=c||f.length>g,f=f.slice(0,g)}if(r&&a&&h!=null)for(var v=O4(h,i,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),m={},y=0;ys&&$S(t,r.substring(s,u),e,o),$S(t,l[2],e,o,l[1]),s=WS.lastIndex}si){var D=t.lines.length;A>0?(_.tokens=_.tokens.slice(0,A),m(_,S,x),t.lines=t.lines.slice(0,y+1)):t.lines=t.lines.slice(0,y),t.isTruncated=t.isTruncated||t.lines.length0&&p+n.accumWidth>n.width&&(c=e.split(` `),u=!0),n.accumWidth=p}else{var g=B4(e,l,n.width,n.breakAll,n.accumWidth);n.accumWidth=g.accumWidth+d,h=g.linesWidths,c=g.lines}}else c=e.split(` `);for(var v=0;v=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var nle=$o(",&?/;] ".split(""),function(r,e){return r[e]=!0,r},{});function rle(r){return tle(r)?!!nle[r]:!0}function B4(r,e,t,n,i){for(var a=[],o=[],s="",l="",u=0,c=0,h=0;ht:i+c+d>t){c?(s||l)&&(p?(s||(s=l,l="",u=0,c=u),a.push(s),o.push(c-u),l+=f,u+=d,s="",c=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(c),s=f,c=d)):p?(a.push(l),o.push(u),l=f,u=d):(a.push(f),o.push(d));continue}c+=d,p?(l+=f,u+=d):(l&&(s+=l,l="",u=0),s+=f)}return!a.length&&!s&&(s=r,l="",u=0),l&&(s+=l),s&&(a.push(s),o.push(c)),a.length===1&&(c+=i),{accumWidth:c,lines:a,linesWidths:o}}var mT="__zr_style_"+Math.round(Math.random()*10),Mc={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},S1={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Mc[mT]=!0;var wI=["z","z2","invisible"],ile=["invisible"],ale=function(r){ae(e,r);function e(t){return r.call(this,t)||this}return e.prototype._init=function(t){for(var n=wt(t),i=0;i1e-4){s[0]=r-t,s[1]=e-n,l[0]=r+t,l[1]=e+n;return}if(Ym[0]=jS(i)*t+r,Ym[1]=qS(i)*n+e,qm[0]=jS(a)*t+r,qm[1]=qS(a)*n+e,u(s,Ym,qm),c(l,Ym,qm),i=i%Tu,i<0&&(i=i+Tu),a=a%Tu,a<0&&(a=a+Tu),i>a&&!o?a+=Tu:ii&&(jm[0]=jS(d)*t+r,jm[1]=qS(d)*n+e,u(s,jm,s),c(l,jm,l))}var on={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Mu=[],Cu=[],mo=[],js=[],yo=[],_o=[],KS=Math.min,ZS=Math.max,Eu=Math.cos,Lu=Math.sin,ls=Math.abs,yT=Math.PI,sl=yT*2,QS=typeof Float32Array!="undefined",Kd=[];function JS(r){var e=Math.round(r/yT*1e8)/1e8;return e%2*yT}function r2(r,e){var t=JS(r[0]);t<0&&(t+=sl);var n=t-r[0],i=r[1];i+=n,!e&&i-t>=sl?i=t+sl:e&&t-i>=sl?i=t-sl:!e&&t>i?i=t+(sl-JS(t-i)):e&&t0&&(this._ux=ls(n/t_/e)||0,this._uy=ls(n/t_/t)||0)},r.prototype.setDPR=function(e){this.dpr=e},r.prototype.setContext=function(e){this._ctx=e},r.prototype.getContext=function(){return this._ctx},r.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},r.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},r.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(on.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},r.prototype.lineTo=function(e,t){var n=ls(e-this._xi),i=ls(t-this._yi),a=n>this._ux||i>this._uy;if(this.addData(on.L,e,t),this._ctx&&a&&this._ctx.lineTo(e,t),a)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var o=n*n+i*i;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=o)}return this},r.prototype.bezierCurveTo=function(e,t,n,i,a,o){return this._drawPendingPt(),this.addData(on.C,e,t,n,i,a,o),this._ctx&&this._ctx.bezierCurveTo(e,t,n,i,a,o),this._xi=a,this._yi=o,this},r.prototype.quadraticCurveTo=function(e,t,n,i){return this._drawPendingPt(),this.addData(on.Q,e,t,n,i),this._ctx&&this._ctx.quadraticCurveTo(e,t,n,i),this._xi=n,this._yi=i,this},r.prototype.arc=function(e,t,n,i,a,o){this._drawPendingPt(),Kd[0]=i,Kd[1]=a,r2(Kd,o),i=Kd[0],a=Kd[1];var s=a-i;return this.addData(on.A,e,t,n,n,i,s,0,o?0:1),this._ctx&&this._ctx.arc(e,t,n,i,a,o),this._xi=Eu(a)*n+e,this._yi=Lu(a)*n+t,this},r.prototype.arcTo=function(e,t,n,i,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,n,i,a),this},r.prototype.rect=function(e,t,n,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,n,i),this.addData(on.R,e,t,n,i),this},r.prototype.closePath=function(){this._drawPendingPt(),this.addData(on.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&e.closePath(),this._xi=t,this._yi=n,this},r.prototype.fill=function(e){e&&e.fill(),this.toStatic()},r.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},r.prototype.len=function(){return this._len},r.prototype.setData=function(e){var t=e.length;!(this.data&&this.data.length===t)&&QS&&(this.data=new Float32Array(t));for(var n=0;nc.length&&(this._expandData(),c=this.data);for(var h=0;h0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},r.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t11&&(this.data=new Float32Array(e)))}},r.prototype.getBoundingRect=function(){mo[0]=mo[1]=yo[0]=yo[1]=Number.MAX_VALUE,js[0]=js[1]=_o[0]=_o[1]=-Number.MAX_VALUE;var e=this.data,t=0,n=0,i=0,a=0,o;for(o=0;on||ls(_)>i||f===t-1)&&(g=Math.sqrt(y*y+_*_),a=v,o=m);break}case on.C:{var x=e[f++],S=e[f++],v=e[f++],m=e[f++],A=e[f++],w=e[f++];g=woe(a,o,x,S,v,m,A,w,10),a=A,o=w;break}case on.Q:{var x=e[f++],S=e[f++],v=e[f++],m=e[f++];g=Toe(a,o,x,S,v,m,10),a=v,o=m;break}case on.A:var M=e[f++],C=e[f++],b=e[f++],T=e[f++],P=e[f++],D=e[f++],L=D+P;f+=1,p&&(s=Eu(P)*b+M,l=Lu(P)*T+C),g=ZS(b,T)*KS(sl,Math.abs(D)),a=Eu(L)*b+M,o=Lu(L)*T+C;break;case on.R:{s=a=e[f++],l=o=e[f++];var E=e[f++],I=e[f++];g=E*2+I*2;break}case on.Z:{var y=s-a,_=l-o;g=Math.sqrt(y*y+_*_),a=s,o=l;break}}g>=0&&(u[h++]=g,c+=g)}return this._pathLen=c,c},r.prototype.rebuildPath=function(e,t){var n=this.data,i=this._ux,a=this._uy,o=this._len,s,l,u,c,h,f,d=t<1,p,g,v=0,m=0,y,_=0,x,S;if(!(d&&(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,g=this._pathLen,y=t*g,!y)))e:for(var A=0;A0&&(e.lineTo(x,S),_=0),w){case on.M:s=u=n[A++],l=c=n[A++],e.moveTo(u,c);break;case on.L:{h=n[A++],f=n[A++];var C=ls(h-u),b=ls(f-c);if(C>i||b>a){if(d){var T=p[m++];if(v+T>y){var P=(y-v)/T;e.lineTo(u*(1-P)+h*P,c*(1-P)+f*P);break e}v+=T}e.lineTo(h,f),u=h,c=f,_=0}else{var D=C*C+b*b;D>_&&(x=h,S=f,_=D)}break}case on.C:{var L=n[A++],E=n[A++],I=n[A++],N=n[A++],R=n[A++],F=n[A++];if(d){var T=p[m++];if(v+T>y){var P=(y-v)/T;jl(u,L,I,R,P,Mu),jl(c,E,N,F,P,Cu),e.bezierCurveTo(Mu[1],Cu[1],Mu[2],Cu[2],Mu[3],Cu[3]);break e}v+=T}e.bezierCurveTo(L,E,I,N,R,F),u=R,c=F;break}case on.Q:{var L=n[A++],E=n[A++],I=n[A++],N=n[A++];if(d){var T=p[m++];if(v+T>y){var P=(y-v)/T;Bv(u,L,I,P,Mu),Bv(c,E,N,P,Cu),e.quadraticCurveTo(Mu[1],Cu[1],Mu[2],Cu[2]);break e}v+=T}e.quadraticCurveTo(L,E,I,N),u=I,c=N;break}case on.A:var O=n[A++],V=n[A++],H=n[A++],Q=n[A++],W=n[A++],Z=n[A++],ee=n[A++],he=!n[A++],le=H>Q?H:Q,re=ls(H-Q)>.001,be=W+Z,de=!1;if(d){var T=p[m++];v+T>y&&(be=W+Z*(y-v)/T,de=!0),v+=T}if(re&&e.ellipse?e.ellipse(O,V,H,Q,ee,W,be,he):e.arc(O,V,le,W,be,he),de)break e;M&&(s=Eu(W)*H+O,l=Lu(W)*Q+V),u=Eu(be)*H+O,c=Lu(be)*Q+V;break;case on.R:s=u=n[A],l=c=n[A+1],h=n[A++],f=n[A++];var U=n[A++],K=n[A++];if(d){var T=p[m++];if(v+T>y){var te=y-v;e.moveTo(h,f),e.lineTo(h+KS(te,U),f),te-=U,te>0&&e.lineTo(h+U,f+KS(te,K)),te-=K,te>0&&e.lineTo(h+ZS(U-te,0),f+K),te-=U,te>0&&e.lineTo(h,f+ZS(K-te,0));break e}v+=T}e.rect(h,f,U,K);break;case on.Z:if(d){var T=p[m++];if(v+T>y){var P=(y-v)/T;e.lineTo(u*(1-P)+s*P,c*(1-P)+l*P);break e}v+=T}e.closePath(),u=s,c=l}}},r.prototype.clone=function(){var e=new r,t=this.data;return e.data=t.slice?t.slice():Array.prototype.slice.call(t),e._len=this._len,e},r.CMD=on,r.initDefaultProps=function(){var e=r.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),r}();function dl(r,e,t,n,i,a,o){if(i===0)return!1;var s=i,l=0,u=r;if(o>e+s&&o>n+s||or+s&&a>t+s||ae+h&&c>n+h&&c>a+h&&c>s+h||cr+h&&u>t+h&&u>i+h&&u>o+h||ue+u&&l>n+u&&l>a+u||lr+u&&s>t+u&&s>i+u||st||c+ui&&(i+=Zd);var f=Math.atan2(l,s);return f<0&&(f+=Zd),f>=n&&f<=i||f+Zd>=n&&f+Zd<=i}function ps(r,e,t,n,i,a){if(a>e&&a>n||ai?s:0}var Ks=jo.CMD,Pu=Math.PI*2,fle=1e-4;function dle(r,e){return Math.abs(r-e)e&&u>n&&u>a&&u>s||u1&&ple(),d=pr(e,n,a,s,_a[0]),f>1&&(p=pr(e,n,a,s,_a[1]))),f===2?v<_a[0]?h+=de&&s>n&&s>a||s=0&&u<=1){for(var c=0,h=Tr(e,n,a,u),f=0;ft||s<-t)return 0;var l=Math.sqrt(t*t-s*s);fi[0]=-l,fi[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=Pu-1e-4){n=0,i=Pu;var c=a?1:-1;return o>=fi[0]+r&&o<=fi[1]+r?c:0}if(n>i){var h=n;n=i,i=h}n<0&&(n+=Pu,i+=Pu);for(var f=0,d=0;d<2;d++){var p=fi[d];if(p+r>o){var g=Math.atan2(s,p),c=a?1:-1;g<0&&(g=Pu+g),(g>=n&&g<=i||g+Pu>=n&&g+Pu<=i)&&(g>Math.PI/2&&g1&&(t||(s+=ps(l,u,c,h,n,i))),v&&(l=a[p],u=a[p+1],c=l,h=u),g){case Ks.M:c=a[p++],h=a[p++],l=c,u=h;break;case Ks.L:if(t){if(dl(l,u,a[p],a[p+1],e,n,i))return!0}else s+=ps(l,u,a[p],a[p+1],n,i)||0;l=a[p++],u=a[p++];break;case Ks.C:if(t){if(cle(l,u,a[p++],a[p++],a[p++],a[p++],a[p],a[p+1],e,n,i))return!0}else s+=vle(l,u,a[p++],a[p++],a[p++],a[p++],a[p],a[p+1],n,i)||0;l=a[p++],u=a[p++];break;case Ks.Q:if(t){if(z4(l,u,a[p++],a[p++],a[p],a[p+1],e,n,i))return!0}else s+=gle(l,u,a[p++],a[p++],a[p],a[p+1],n,i)||0;l=a[p++],u=a[p++];break;case Ks.A:var m=a[p++],y=a[p++],_=a[p++],x=a[p++],S=a[p++],A=a[p++];p+=1;var w=!!(1-a[p++]);f=Math.cos(S)*_+m,d=Math.sin(S)*x+y,v?(c=f,h=d):s+=ps(l,u,f,d,n,i);var M=(n-m)*x/_+m;if(t){if(hle(m,y,x,S,S+A,w,e,M,i))return!0}else s+=mle(m,y,x,S,S+A,w,M,i);l=Math.cos(S+A)*_+m,u=Math.sin(S+A)*x+y;break;case Ks.R:c=l=a[p++],h=u=a[p++];var C=a[p++],b=a[p++];if(f=c+C,d=h+b,t){if(dl(c,h,f,h,e,n,i)||dl(f,h,f,d,e,n,i)||dl(f,d,c,d,e,n,i)||dl(c,d,c,h,e,n,i))return!0}else s+=ps(f,h,f,d,n,i),s+=ps(c,d,c,h,n,i);break;case Ks.Z:if(t){if(dl(l,u,c,h,e,n,i))return!0}else s+=ps(l,u,c,h,n,i);l=c,u=h;break}}return!t&&!dle(u,h)&&(s+=ps(l,u,c,h,n,i)||0),s!==0}function yle(r,e,t){return U4(r,0,!1,e,t)}function _le(r,e,t,n){return U4(r,e,!0,t,n)}var r_=Ke({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Mc),xle={style:Ke({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},S1.style)},eA=Yo.concat(["invisible","culling","z","z2","zlevel","parent"]),Sle=function(r){ae(e,r);function e(t){return r.call(this,t)||this}return e.prototype.update=function(){var t=this;r.prototype.update.call(this);var n=this.style;if(n.decal){var i=this._decalEl=this._decalEl||new e;i.buildPath===e.prototype.buildPath&&(i.buildPath=function(l){t.buildPath(l,t.shape)}),i.silent=!0;var a=i.style;for(var o in n)a[o]!==n[o]&&(a[o]=n[o]);a.fill=n.fill?n.decal:null,a.decal=null,a.shadowColor=null,n.strokeFirst&&(a.stroke=null);for(var s=0;s.5?fT:n>.2?nse:dT}else if(t)return dT}return fT},e.prototype.getInsideTextStroke=function(t){var n=this.style.fill;if(ke(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=J0(t,0)0))},e.prototype.hasFill=function(){var t=this.style,n=t.fill;return n!=null&&n!=="none"},e.prototype.getBoundingRect=function(){var t=this._rect,n=this.style,i=!t;if(i){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&tf)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),t=o.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||i){s.copy(t);var l=n.strokeNoScale?this.getLineScale():1,u=n.lineWidth;if(!this.hasFill()){var c=this.strokeContainThreshold;u=Math.max(u,c==null?4:c)}l>1e-10&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return t},e.prototype.contain=function(t,n){var i=this.transformCoordToLocal(t,n),a=this.getBoundingRect(),o=this.style;if(t=i[0],n=i[1],a.contain(t,n)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),_le(s,l/u,t,n)))return!0}if(this.hasFill())return yle(s,t,n)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=tf,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){t==="style"?this.dirtyStyle():t==="shape"?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(t,n){t==="shape"?this.setShape(n):r.prototype.attrKV.call(this,t,n)},e.prototype.setShape=function(t,n){var i=this.shape;return i||(i=this.shape={}),typeof t=="string"?i[t]=n:pe(i,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&tf)},e.prototype.createStyle=function(t){return v1(r_,t)},e.prototype._innerSaveToNormal=function(t){r.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=pe({},this.shape))},e.prototype._applyStateObj=function(t,n,i,a,o,s){r.prototype._applyStateObj.call(this,t,n,i,a,o,s);var l=!(n&&a),u;if(n&&n.shape?o?a?u=n.shape:(u=pe({},i.shape),pe(u,n.shape)):(u=pe({},a?this.shape:i.shape),pe(u,n.shape)):l&&(u=i.shape),u)if(o){this.shape=pe({},this.shape);for(var c={},h=wt(u),f=0;f0},e.prototype.hasFill=function(){var t=this.style,n=t.fill;return n!=null&&n!=="none"},e.prototype.createStyle=function(t){return v1(Ale,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var n=t.text;n!=null?n+="":n="";var i=wg(n,t.font,t.textAlign,t.textBaseline);if(i.x+=t.x||0,i.y+=t.y||0,this.hasStroke()){var a=t.lineWidth;i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a}this._rect=i}return this._rect},e.initDefaultProps=function(){var t=e.prototype;t.dirtyRectTolerance=10}(),e}(ka);V4.prototype.type="tspan";const Hv=V4;var wle=Ke({x:0,y:0},Mc),ble={style:Ke({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},S1.style)};function Tle(r){return!!(r&&typeof r!="string"&&r.width&&r.height)}var G4=function(r){ae(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.createStyle=function(t){return v1(wle,t)},e.prototype._getSize=function(t){var n=this.style,i=n[t];if(i!=null)return i;var a=Tle(n.image)?n.image:this.__image;if(!a)return 0;var o=t==="width"?"height":"width",s=n[o];return s==null?a[t]:a[t]/a[o]*s},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return ble},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new dt(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(ka);G4.prototype.type="image";const Ur=G4;function Mle(r,e){var t=e.x,n=e.y,i=e.width,a=e.height,o=e.r,s,l,u,c;i<0&&(t=t+i,i=-i),a<0&&(n=n+a,a=-a),typeof o=="number"?s=l=u=c=o:o instanceof Array?o.length===1?s=l=u=c=o[0]:o.length===2?(s=u=o[0],l=c=o[1]):o.length===3?(s=o[0],l=c=o[1],u=o[2]):(s=o[0],l=o[1],u=o[2],c=o[3]):s=l=u=c=0;var h;s+l>i&&(h=s+l,s*=i/h,l*=i/h),u+c>i&&(h=u+c,u*=i/h,c*=i/h),l+u>a&&(h=l+u,l*=a/h,u*=a/h),s+c>a&&(h=s+c,s*=a/h,c*=a/h),r.moveTo(t+s,n),r.lineTo(t+i-l,n),l!==0&&r.arc(t+i-l,n+l,l,-Math.PI/2,0),r.lineTo(t+i,n+a-u),u!==0&&r.arc(t+i-u,n+a-u,u,0,Math.PI/2),r.lineTo(t+c,n+a),c!==0&&r.arc(t+c,n+a-c,c,Math.PI/2,Math.PI),r.lineTo(t,n+s),s!==0&&r.arc(t+s,n+s,s,Math.PI,Math.PI*1.5)}var vf=Math.round;function H4(r,e,t){if(e){var n=e.x1,i=e.x2,a=e.y1,o=e.y2;r.x1=n,r.x2=i,r.y1=a,r.y2=o;var s=t&&t.lineWidth;return s&&(vf(n*2)===vf(i*2)&&(r.x1=r.x2=ac(n,s,!0)),vf(a*2)===vf(o*2)&&(r.y1=r.y2=ac(a,s,!0))),r}}function W4(r,e,t){if(e){var n=e.x,i=e.y,a=e.width,o=e.height;r.x=n,r.y=i,r.width=a,r.height=o;var s=t&&t.lineWidth;return s&&(r.x=ac(n,s,!0),r.y=ac(i,s,!0),r.width=Math.max(ac(n+a,s,!1)-r.x,a===0?0:1),r.height=Math.max(ac(i+o,s,!1)-r.y,o===0?0:1)),r}}function ac(r,e,t){if(!e)return r;var n=vf(r*2);return(n+vf(e))%2===0?n/2:(n+(t?1:-1))/2}var Cle=function(){function r(){this.x=0,this.y=0,this.width=0,this.height=0}return r}(),Ele={},$4=function(r){ae(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Cle},e.prototype.buildPath=function(t,n){var i,a,o,s;if(this.subPixelOptimize){var l=W4(Ele,n,this.style);i=l.x,a=l.y,o=l.width,s=l.height,l.r=n.r,n=l}else i=n.x,a=n.y,o=n.width,s=n.height;n.r?Mle(t,n):t.rect(i,a,o,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(yt);$4.prototype.type="rect";const Dt=$4;var EI={fill:"#000"},LI=2,Lle={style:Ke({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},S1.style)},X4=function(r){ae(e,r);function e(t){var n=r.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=EI,n.attr(t),n}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){r.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t0,P=t.width!=null&&(t.overflow==="truncate"||t.overflow==="break"||t.overflow==="breakAll"),D=o.calculatedLineHeight,L=0;L=0&&(L=A[D],L.align==="right");)this._placeToken(L,t,M,m,P,"right",_),C-=L.width,P-=L.width,D--;for(T+=(a-(T-v)-(y-P)-C)/2;b<=D;)L=A[b],this._placeToken(L,t,M,m,T+L.width/2,"center",_),T+=L.width,b++;m+=M}},e.prototype._placeToken=function(t,n,i,a,o,s,l){var u=n.rich[t.styleName]||{};u.text=t.text;var c=t.verticalAlign,h=a+i/2;c==="top"?h=a+t.height/2:c==="bottom"&&(h=a+i-t.height/2);var f=!t.isLineHolder&&tA(u);f&&this._renderBackground(u,n,s==="right"?o-t.width:s==="center"?o-t.width/2:o,h-t.height/2,t.width,t.height);var d=!!u.backgroundColor,p=t.textPadding;p&&(o=kI(o,s,p),h-=t.height/2-p[0]-t.innerHeight/2);var g=this._getOrCreateChild(Hv),v=g.createStyle();g.useStyle(v);var m=this._defaultStyle,y=!1,_=0,x=NI("fill"in u?u.fill:"fill"in n?n.fill:(y=!0,m.fill)),S=II("stroke"in u?u.stroke:"stroke"in n?n.stroke:!d&&!l&&(!m.autoStroke||y)?(_=LI,m.stroke):null),A=u.textShadowBlur>0||n.textShadowBlur>0;v.text=t.text,v.x=o,v.y=h,A&&(v.shadowBlur=u.textShadowBlur||n.textShadowBlur||0,v.shadowColor=u.textShadowColor||n.textShadowColor||"transparent",v.shadowOffsetX=u.textShadowOffsetX||n.textShadowOffsetX||0,v.shadowOffsetY=u.textShadowOffsetY||n.textShadowOffsetY||0),v.textAlign=s,v.textBaseline="middle",v.font=t.font||Yl,v.opacity=Go(u.opacity,n.opacity,1),RI(v,u),S&&(v.lineWidth=Go(u.lineWidth,n.lineWidth,_),v.lineDash=ot(u.lineDash,n.lineDash),v.lineDashOffset=n.lineDashOffset||0,v.stroke=S),x&&(v.fill=x);var w=t.contentWidth,M=t.contentHeight;g.setBoundingRect(new dt(Rp(v.x,w,v.textAlign),nf(v.y,M,v.textBaseline),w,M))},e.prototype._renderBackground=function(t,n,i,a,o,s){var l=t.backgroundColor,u=t.borderWidth,c=t.borderColor,h=l&&l.image,f=l&&!h,d=t.borderRadius,p=this,g,v;if(f||t.lineHeight||u&&c){g=this._getOrCreateChild(Dt),g.useStyle(g.createStyle()),g.style.fill=null;var m=g.shape;m.x=i,m.y=a,m.width=o,m.height=s,m.r=d,g.dirtyShape()}if(f){var y=g.style;y.fill=l||null,y.fillOpacity=ot(t.fillOpacity,1)}else if(h){v=this._getOrCreateChild(Ur),v.onload=function(){p.dirtyStyle()};var _=v.style;_.image=l.image,_.x=i,_.y=a,_.width=o,_.height=s}if(u&&c){var y=g.style;y.lineWidth=u,y.stroke=c,y.strokeOpacity=ot(t.strokeOpacity,1),y.lineDash=t.borderDash,y.lineDashOffset=t.borderDashOffset||0,g.strokeContainThreshold=0,g.hasFill()&&g.hasStroke()&&(y.strokeFirst=!0,y.lineWidth*=2)}var x=(g||v).style;x.shadowBlur=t.shadowBlur||0,x.shadowColor=t.shadowColor||"transparent",x.shadowOffsetX=t.shadowOffsetX||0,x.shadowOffsetY=t.shadowOffsetY||0,x.opacity=Go(t.opacity,n.opacity,1)},e.makeFont=function(t){var n="";return q4(t)&&(n=[t.fontStyle,t.fontWeight,Y4(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),n&&eo(n)||t.textFont||t.font},e}(ka),Ple={left:!0,right:1,center:1},Rle={top:1,bottom:1,middle:1},PI=["fontStyle","fontWeight","fontSize","fontFamily"];function Y4(r){return typeof r=="string"&&(r.indexOf("px")!==-1||r.indexOf("rem")!==-1||r.indexOf("em")!==-1)?r:isNaN(+r)?BC+"px":r+"px"}function RI(r,e){for(var t=0;t=0,a=!1;if(r instanceof yt){var o=j4(r),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(Nh(s)||Nh(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=pe({},n),u=pe({},u),u.fill=s):!Nh(u.fill)&&Nh(s)?(a=!0,n=pe({},n),u=pe({},u),u.fill=iT(s)):!Nh(u.stroke)&&Nh(l)&&(a||(n=pe({},n),u=pe({},u)),u.stroke=iT(l)),n.style=u}}if(n&&n.z2==null){a||(n=pe({},n));var c=r.z2EmphasisLift;n.z2=r.z2+(c!=null?c:md)}return n}function Ble(r,e,t){if(t&&t.z2==null){t=pe({},t);var n=r.z2SelectLift;t.z2=r.z2+(n!=null?n:Ile)}return t}function zle(r,e,t){var n=pt(r.currentStates,e)>=0,i=r.style.opacity,a=n?null:Ole(r,["opacity"],e,{opacity:1});t=t||{};var o=t.style||{};return o.opacity==null&&(t=pe({},t),o=pe({opacity:n?i:a.opacity*.1},o),t.style=o),t}function nA(r,e){var t=this.states[r];if(this.style){if(r==="emphasis")return Fle(this,r,e,t);if(r==="blur")return zle(this,r,t);if(r==="select")return Ble(this,r,t)}return t}function Gc(r){r.stateProxy=nA;var e=r.getTextContent(),t=r.getTextGuideLine();e&&(e.stateProxy=nA),t&&(t.stateProxy=nA)}function UI(r,e){!nV(r,e)&&!r.__highByOuter&&zs(r,K4)}function VI(r,e){!nV(r,e)&&!r.__highByOuter&&zs(r,Z4)}function Ds(r,e){r.__highByOuter|=1<<(e||0),zs(r,K4)}function Is(r,e){!(r.__highByOuter&=~(1<<(e||0)))&&zs(r,Z4)}function J4(r){zs(r,o2)}function s2(r){zs(r,Q4)}function eV(r){zs(r,Nle)}function tV(r){zs(r,kle)}function nV(r,e){return r.__highDownSilentOnTouch&&e.zrByTouch}function rV(r){var e=r.getModel(),t=[],n=[];e.eachComponent(function(i,a){var o=i2(a),s=i==="series",l=s?r.getViewOfSeriesModel(a):r.getViewOfComponentModel(a);!s&&n.push(l),o.isBlured&&(l.group.traverse(function(u){Q4(u)}),s&&t.push(a)),o.isBlured=!1}),k(n,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(t,!1,e)})}function xT(r,e,t,n){var i=n.getModel();t=t||"coordinateSystem";function a(u,c){for(var h=0;h0){var s={dataIndex:o,seriesIndex:t.seriesIndex};a!=null&&(s.dataType=a),e.push(s)}})}),e}function Ec(r,e,t){oc(r,!0),zs(r,Gc),AT(r,e,t)}function $le(r){oc(r,!1)}function Rn(r,e,t,n){n?$le(r):Ec(r,e,t)}function AT(r,e,t){var n=at(r);e!=null?(n.focus=e,n.blurScope=t):n.focus&&(n.focus=null)}var HI=["emphasis","blur","select"],Xle={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Br(r,e,t,n){t=t||"itemStyle";for(var i=0;i1&&(o*=rA(p),s*=rA(p));var g=(i===a?-1:1)*rA((o*o*(s*s)-o*o*(d*d)-s*s*(f*f))/(o*o*(d*d)+s*s*(f*f)))||0,v=g*o*d/s,m=g*-s*f/o,y=(r+t)/2+Zm(h)*v-Km(h)*m,_=(e+n)/2+Km(h)*v+Zm(h)*m,x=YI([1,0],[(f-v)/o,(d-m)/s]),S=[(f-v)/o,(d-m)/s],A=[(-1*f-v)/o,(-1*d-m)/s],w=YI(S,A);if(bT(S,A)<=-1&&(w=Qd),bT(S,A)>=1&&(w=0),w<0){var M=Math.round(w/Qd*1e6)/1e6;w=Qd*2+M%2*Qd}c.addData(u,y,_,o,s,x,w,h,a)}var Qle=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,Jle=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function eue(r){var e=new jo;if(!r)return e;var t=0,n=0,i=t,a=n,o,s=jo.CMD,l=r.match(Qle);if(!l)return e;for(var u=0;uL*L+E*E&&(M=b,C=T),{cx:M,cy:C,x0:-c,y0:-h,x1:M*(i/S-1),y1:C*(i/S-1)}}function sue(r){var e;if(_e(r)){var t=r.length;if(!t)return r;t===1?e=[r[0],r[0],0,0]:t===2?e=[r[0],r[0],r[1],r[1]]:t===3?e=r.concat(r[2]):e=r}else e=[r,r,r,r];return e}function lue(r,e){var t,n=Dp(e.r,0),i=Dp(e.r0||0,0),a=n>0,o=i>0;if(!(!a&&!o)){if(a||(n=i,i=0),i>n){var s=n;n=i,i=s}var l=e.startAngle,u=e.endAngle;if(!(isNaN(l)||isNaN(u))){var c=e.cx,h=e.cy,f=!!e.clockwise,d=jI(u-l),p=d>iA&&d%iA;if(p>Xa&&(d=p),!(n>Xa))r.moveTo(c,h);else if(d>iA-Xa)r.moveTo(c+n*Oh(l),h+n*Ru(l)),r.arc(c,h,n,l,u,!f),i>Xa&&(r.moveTo(c+i*Oh(u),h+i*Ru(u)),r.arc(c,h,i,u,l,f));else{var g=void 0,v=void 0,m=void 0,y=void 0,_=void 0,x=void 0,S=void 0,A=void 0,w=void 0,M=void 0,C=void 0,b=void 0,T=void 0,P=void 0,D=void 0,L=void 0,E=n*Oh(l),I=n*Ru(l),N=i*Oh(u),R=i*Ru(u),F=d>Xa;if(F){var O=e.cornerRadius;O&&(t=sue(O),g=t[0],v=t[1],m=t[2],y=t[3]);var V=jI(n-i)/2;if(_=xo(V,m),x=xo(V,y),S=xo(V,g),A=xo(V,v),C=w=Dp(_,x),b=M=Dp(S,A),(w>Xa||M>Xa)&&(T=n*Oh(u),P=n*Ru(u),D=i*Oh(l),L=i*Ru(l),dXa){var re=xo(m,C),be=xo(y,C),de=Qm(D,L,E,I,n,re,f),U=Qm(T,P,N,R,n,be,f);r.moveTo(c+de.cx+de.x0,h+de.cy+de.y0),C0&&r.arc(c+de.cx,h+de.cy,re,Wr(de.y0,de.x0),Wr(de.y1,de.x1),!f),r.arc(c,h,n,Wr(de.cy+de.y1,de.cx+de.x1),Wr(U.cy+U.y1,U.cx+U.x1),!f),be>0&&r.arc(c+U.cx,h+U.cy,be,Wr(U.y1,U.x1),Wr(U.y0,U.x0),!f))}else r.moveTo(c+E,h+I),r.arc(c,h,n,l,u,!f);if(!(i>Xa)||!F)r.lineTo(c+N,h+R);else if(b>Xa){var re=xo(g,b),be=xo(v,b),de=Qm(N,R,T,P,i,-be,f),U=Qm(E,I,D,L,i,-re,f);r.lineTo(c+de.cx+de.x0,h+de.cy+de.y0),b0&&r.arc(c+de.cx,h+de.cy,be,Wr(de.y0,de.x0),Wr(de.y1,de.x1),!f),r.arc(c,h,i,Wr(de.cy+de.y1,de.cx+de.x1),Wr(U.cy+U.y1,U.cx+U.x1),f),re>0&&r.arc(c+U.cx,h+U.cy,re,Wr(U.y1,U.x1),Wr(U.y0,U.x0),!f))}else r.lineTo(c+N,h+R),r.arc(c,h,i,u,l,f)}r.closePath()}}}var uue=function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return r}(),fV=function(r){ae(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new uue},e.prototype.buildPath=function(t,n){lue(t,n)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(yt);fV.prototype.type="sector";const Bi=fV;var cue=function(){function r(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return r}(),dV=function(r){ae(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new cue},e.prototype.buildPath=function(t,n){var i=n.cx,a=n.cy,o=Math.PI*2;t.moveTo(i+n.r,a),t.arc(i,a,n.r,0,o,!1),t.moveTo(i+n.r0,a),t.arc(i,a,n.r0,0,o,!0)},e}(yt);dV.prototype.type="ring";const T1=dV;function hue(r,e,t,n){var i=[],a=[],o=[],s=[],l,u,c,h;if(n){c=[1/0,1/0],h=[-1/0,-1/0];for(var f=0,d=r.length;f=2){if(n){var a=hue(i,n,t,e.smoothConstraint);r.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(t?o:o-1);s++){var l=a[s*2],u=a[s*2+1],c=i[(s+1)%o];r.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{r.moveTo(i[0][0],i[0][1]);for(var s=1,h=i.length;sIu[1]){if(s=!1,a)return s;var c=Math.abs(Iu[0]-Du[1]),h=Math.abs(Du[0]-Iu[1]);Math.min(c,h)>i.len()&&(c0){var h=c.duration,f=c.delay,d=c.easing,p={duration:h,delay:f||0,easing:d,done:a,force:!!a||!!o,setToFinal:!u,scope:r,during:o};s?e.animateFrom(t,p):e.animateTo(t,p)}else e.stopAnimation(),!s&&e.attr(t),o&&o(1),a&&a()}function zt(r,e,t,n,i,a){d2("update",r,e,t,n,i,a)}function Tn(r,e,t,n,i,a){d2("enter",r,e,t,n,i,a)}function Mf(r){if(!r.__zr)return!0;for(var e=0;eMath.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function QI(r){return!r.isGroup}function Rue(r){return r.shape!=null}function Mg(r,e,t){if(!r||!e)return;function n(o){var s={};return o.traverse(function(l){QI(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return Rue(o)&&(s.shape=pe({},o.shape)),s}var a=n(r);e.traverse(function(o){if(QI(o)&&o.anid){var s=a[o.anid];if(s){var l=i(o);o.attr(i(s)),zt(o,l,t,at(o).dataIndex)}}})}function MV(r,e){return xe(r,function(t){var n=t[0];n=o_(n,e.x),n=s_(n,e.x+e.width);var i=t[1];return i=o_(i,e.y),i=s_(i,e.y+e.height),[n,i]})}function Due(r,e){var t=o_(r.x,e.x),n=s_(r.x+r.width,e.x+e.width),i=o_(r.y,e.y),a=s_(r.y+r.height,e.y+e.height);if(n>=t&&a>=i)return{x:t,y:i,width:n-t,height:a-i}}function Cg(r,e,t){var n=pe({rectHover:!0},e),i=n.style={strokeNoScale:!0};if(t=t||{x:-1,y:-1,width:2,height:2},r)return r.indexOf("image://")===0?(i.image=r.slice(8),Ke(i,t),new Ur(n)):C1(r.replace("path://",""),n,t,"center")}function Ip(r,e,t,n,i){for(var a=0,o=i[i.length-1];a1)return!1;var v=aA(d,p,c,h)/f;return!(v<0||v>1)}function aA(r,e,t,n){return r*n-t*e}function Iue(r){return r<=1e-6&&r>=-1e-6}function Kc(r){var e=r.itemTooltipOption,t=r.componentModel,n=r.itemName,i=ke(e)?{formatter:e}:e,a=t.mainType,o=t.componentIndex,s={componentType:a,name:n,$vars:["name"]};s[a+"Index"]=o;var l=r.formatterParamsExtra;l&&k(wt(l),function(c){ze(s,c)||(s[c]=l[c],s.$vars.push(c))});var u=at(r.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:n,option:Ke({content:n,encodeHTMLContent:!0,formatterParams:s},i)}}function JI(r,e){var t;r.isGroup&&(t=e(r)),t||r.traverse(e)}function ou(r,e){if(r)if(_e(r))for(var t=0;t=0&&s.push(l)}),s}}function su(r,e){return ht(ht({},r,!0),e,!0)}const Xue={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},Yue={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}};var u_="ZH",g2="EN",Cf=g2,u0={},m2={},IV=kt.domSupported?function(){var r=(document.documentElement.lang||navigator.language||navigator.browserLanguage||Cf).toUpperCase();return r.indexOf(u_)>-1?u_:Cf}():Cf;function NV(r,e){r=r.toUpperCase(),m2[r]=new vn(e),u0[r]=e}function que(r){if(ke(r)){var e=u0[r.toUpperCase()]||{};return r===u_||r===g2?Je(e):ht(Je(e),Je(u0[Cf]),!1)}else return ht(Je(r),Je(u0[Cf]),!1)}function CT(r){return m2[r]}function jue(){return m2[Cf]}NV(g2,Xue);NV(u_,Yue);var y2=1e3,_2=y2*60,sv=_2*60,Ca=sv*24,iN=Ca*365,Np={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},ty="{yyyy}-{MM}-{dd}",aN={year:"{yyyy}",month:"{yyyy}-{MM}",day:ty,hour:ty+" "+Np.hour,minute:ty+" "+Np.minute,second:ty+" "+Np.second,millisecond:Np.none},lA=["year","month","day","hour","minute","second","millisecond"],kV=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function Zs(r,e){return r+="","0000".substr(0,e-r.length)+r}function Ef(r){switch(r){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return r}}function Kue(r){return r===Ef(r)}function Zue(r){switch(r){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function P1(r,e,t,n){var i=qo(r),a=i[x2(t)](),o=i[Lf(t)]()+1,s=Math.floor((o-1)/3)+1,l=i[R1(t)](),u=i["get"+(t?"UTC":"")+"Day"](),c=i[Yv(t)](),h=(c-1)%12+1,f=i[D1(t)](),d=i[I1(t)](),p=i[N1(t)](),g=c>=12?"pm":"am",v=g.toUpperCase(),m=n instanceof vn?n:CT(n||IV)||jue(),y=m.getModel("time"),_=y.get("month"),x=y.get("monthAbbr"),S=y.get("dayOfWeek"),A=y.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,g+"").replace(/{A}/g,v+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,Zs(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,_[o-1]).replace(/{MMM}/g,x[o-1]).replace(/{MM}/g,Zs(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,Zs(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,S[u]).replace(/{ee}/g,A[u]).replace(/{e}/g,u+"").replace(/{HH}/g,Zs(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,Zs(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,Zs(f,2)).replace(/{m}/g,f+"").replace(/{ss}/g,Zs(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,Zs(p,3)).replace(/{S}/g,p+"")}function Que(r,e,t,n,i){var a=null;if(ke(t))a=t;else if(qe(t))a=t(r.value,e,{level:r.level});else{var o=pe({},Np);if(r.level>0)for(var s=0;s=0;--s)if(l[u]){a=l[u];break}a=a||o.none}if(_e(a)){var h=r.level==null?0:r.level>=0?r.level:a.length+r.level;h=Math.min(h,a.length-1),a=a[h]}}return P1(new Date(r.value),a,i,n)}function OV(r,e){var t=qo(r),n=t[Lf(e)]()+1,i=t[R1(e)](),a=t[Yv(e)](),o=t[D1(e)](),s=t[I1(e)](),l=t[N1(e)](),u=l===0,c=u&&s===0,h=c&&o===0,f=h&&a===0,d=f&&i===1,p=d&&n===1;return p?"year":d?"month":f?"day":h?"hour":c?"minute":u?"second":"millisecond"}function oN(r,e,t){var n=Ft(r)?qo(r):r;switch(e=e||OV(r,t),e){case"year":return n[x2(t)]();case"half-year":return n[Lf(t)]()>=6?1:0;case"quarter":return Math.floor((n[Lf(t)]()+1)/4);case"month":return n[Lf(t)]();case"day":return n[R1(t)]();case"half-day":return n[Yv(t)]()/24;case"hour":return n[Yv(t)]();case"minute":return n[D1(t)]();case"second":return n[I1(t)]();case"millisecond":return n[N1(t)]()}}function x2(r){return r?"getUTCFullYear":"getFullYear"}function Lf(r){return r?"getUTCMonth":"getMonth"}function R1(r){return r?"getUTCDate":"getDate"}function Yv(r){return r?"getUTCHours":"getHours"}function D1(r){return r?"getUTCMinutes":"getMinutes"}function I1(r){return r?"getUTCSeconds":"getSeconds"}function N1(r){return r?"getUTCMilliseconds":"getMilliseconds"}function Jue(r){return r?"setUTCFullYear":"setFullYear"}function FV(r){return r?"setUTCMonth":"setMonth"}function BV(r){return r?"setUTCDate":"setDate"}function zV(r){return r?"setUTCHours":"setHours"}function UV(r){return r?"setUTCMinutes":"setMinutes"}function VV(r){return r?"setUTCSeconds":"setSeconds"}function GV(r){return r?"setUTCMilliseconds":"setMilliseconds"}function HV(r){if(!T4(r))return ke(r)?r:"-";var e=(r+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function WV(r,e){return r=(r||"").toLowerCase().replace(/-(.)/g,function(t,n){return n.toUpperCase()}),e&&r&&(r=r.charAt(0).toUpperCase()+r.slice(1)),r}var Sd=WC;function ET(r,e,t){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(c){return c&&eo(c)?c:"-"}function a(c){return!!(c!=null&&!isNaN(c)&&isFinite(c))}var o=e==="time",s=r instanceof Date;if(o||s){var l=o?qo(r):r;if(isNaN(+l)){if(s)return"-"}else return P1(l,n,t)}if(e==="ordinal")return $b(r)?i(r):Ft(r)&&a(r)?r+"":"-";var u=Rs(r);return a(u)?HV(u):$b(r)?i(r):typeof r=="boolean"?r+"":"-"}var sN=["a","b","c","d","e","f","g"],uA=function(r,e){return"{"+r+(e==null?"":e)+"}"};function $V(r,e,t){_e(e)||(e=[e]);var n=e.length;if(!n)return"";for(var i=e[0].$vars||[],a=0;a':'';var o=t.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:i==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}}function Hc(r,e){return e=e||"transparent",ke(r)?r:Qe(r)&&r.colorStops&&(r.colorStops[0]||{}).color||e}function c_(r,e){if(e==="_blank"||e==="blank"){var t=window.open();t.opener=null,t.location.href=r}else window.open(r,e)}var c0=k,XV=["left","right","top","bottom","width","height"],sc=[["width","left","right"],["height","top","bottom"]];function S2(r,e,t,n,i){var a=0,o=0;n==null&&(n=1/0),i==null&&(i=1/0);var s=0;e.eachChild(function(l,u){var c=l.getBoundingRect(),h=e.childAt(u+1),f=h&&h.getBoundingRect(),d,p;if(r==="horizontal"){var g=c.width+(f?-f.x+c.x:0);d=a+g,d>n||l.newline?(a=0,d=g,o+=s+t,s=c.height):s=Math.max(s,c.height)}else{var v=c.height+(f?-f.y+c.y:0);p=o+v,p>i||l.newline?(a+=s+t,o=0,p=v,s=c.width):s=Math.max(s,c.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),r==="horizontal"?a=d+t:o=p+t)})}var Pc=S2;ut(S2,"vertical");ut(S2,"horizontal");function nce(r,e,t){var n=e.width,i=e.height,a=Pe(r.left,n),o=Pe(r.top,i),s=Pe(r.right,n),l=Pe(r.bottom,i);return(isNaN(a)||isNaN(parseFloat(r.left)))&&(a=0),(isNaN(s)||isNaN(parseFloat(r.right)))&&(s=n),(isNaN(o)||isNaN(parseFloat(r.top)))&&(o=0),(isNaN(l)||isNaN(parseFloat(r.bottom)))&&(l=i),t=Sd(t||0),{width:Math.max(s-a-t[1]-t[3],0),height:Math.max(l-o-t[0]-t[2],0)}}function dr(r,e,t){t=Sd(t||0);var n=e.width,i=e.height,a=Pe(r.left,n),o=Pe(r.top,i),s=Pe(r.right,n),l=Pe(r.bottom,i),u=Pe(r.width,n),c=Pe(r.height,i),h=t[2]+t[0],f=t[1]+t[3],d=r.aspect;switch(isNaN(u)&&(u=n-s-f-a),isNaN(c)&&(c=i-l-h-o),d!=null&&(isNaN(u)&&isNaN(c)&&(d>n/i?u=n*.8:c=i*.8),isNaN(u)&&(u=d*c),isNaN(c)&&(c=u/d)),isNaN(a)&&(a=n-s-u-f),isNaN(o)&&(o=i-l-c-h),r.left||r.right){case"center":a=n/2-u/2-t[3];break;case"right":a=n-u-f;break}switch(r.top||r.bottom){case"middle":case"center":o=i/2-c/2-t[0];break;case"bottom":o=i-c-h;break}a=a||0,o=o||0,isNaN(u)&&(u=n-f-a-(s||0)),isNaN(c)&&(c=i-h-o-(l||0));var p=new dt(a+t[3],o+t[0],u,c);return p.margin=t,p}function k1(r,e,t,n,i,a){var o=!i||!i.hv||i.hv[0],s=!i||!i.hv||i.hv[1],l=i&&i.boundingMode||"all";if(a=a||r,a.x=r.x,a.y=r.y,!o&&!s)return!1;var u;if(l==="raw")u=r.type==="group"?new dt(0,0,+e.width||0,+e.height||0):r.getBoundingRect();else if(u=r.getBoundingRect(),r.needLocalTransform()){var c=r.getLocalTransform();u=u.clone(),u.applyTransform(c)}var h=dr(Ke({width:u.width,height:u.height},e),t,n),f=o?h.x-u.x:0,d=s?h.y-u.y:0;return l==="raw"?(a.x=f,a.y=d):(a.x+=f,a.y+=d),a===r&&r.markRedraw(),!0}function rce(r,e){return r[sc[e][0]]!=null||r[sc[e][1]]!=null&&r[sc[e][2]]!=null}function qv(r){var e=r.layoutMode||r.constructor.layoutMode;return Qe(e)?e:e?{type:e}:null}function Zl(r,e,t){var n=t&&t.ignoreSize;!_e(n)&&(n=[n,n]);var i=o(sc[0],0),a=o(sc[1],1);u(sc[0],r,i),u(sc[1],r,a);function o(c,h){var f={},d=0,p={},g=0,v=2;if(c0(c,function(_){p[_]=r[_]}),c0(c,function(_){s(e,_)&&(f[_]=p[_]=e[_]),l(f,_)&&d++,l(p,_)&&g++}),n[h])return l(e,c[1])?p[c[2]]=null:l(e,c[2])&&(p[c[1]]=null),p;if(g===v||!d)return p;if(d>=v)return f;for(var m=0;m=0;l--)s=ht(s,i[l],!0);n.defaultOption=s}return n.defaultOption},e.prototype.getReferringComponents=function(t,n){var i=t+"Index",a=t+"Id";return bg(this.ecModel,t,{index:this.get(i,!0),id:this.get(a,!0)},n)},e.prototype.getBoxLayoutParams=function(){var t=this;return{left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(t){this.option.zlevel=t},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(vn);k4(wd,vn);_1(wd);Wue(wd);$ue(wd,ace);function ace(r){var e=[];return k(wd.getClassesByMainType(r),function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])}),e=xe(e,function(t){return Fo(t).main}),r!=="dataset"&&pt(e,"dataset")<=0&&e.unshift("dataset"),e}const Nt=wd;var qV="";typeof navigator!="undefined"&&(qV=navigator.platform||"");var Fh="rgba(0, 0, 0, 0.2)";const oce={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:Fh,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Fh,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Fh,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Fh,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Fh,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Fh,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:qV.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var jV=He(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),za="original",ai="arrayRows",Ua="objectRows",Jo="keyedColumns",Vl="typedArray",KV="unknown",Ho="column",bd="row",Nr={Must:1,Might:2,Not:3},ZV=Pt();function sce(r){ZV(r).datasetMap=He()}function QV(r,e,t){var n={},i=w2(e);if(!i||!r)return n;var a=[],o=[],s=e.ecModel,l=ZV(s).datasetMap,u=i.uid+"_"+t.seriesLayoutBy,c,h;r=r.slice(),k(r,function(g,v){var m=Qe(g)?g:r[v]={name:g};m.type==="ordinal"&&c==null&&(c=v,h=p(m)),n[m.name]=[]});var f=l.get(u)||l.set(u,{categoryWayDim:h,valueWayDim:0});k(r,function(g,v){var m=g.name,y=p(g);if(c==null){var _=f.valueWayDim;d(n[m],_,y),d(o,_,y),f.valueWayDim+=y}else if(c===v)d(n[m],0,y),d(a,0,y);else{var _=f.categoryWayDim;d(n[m],_,y),d(o,_,y),f.categoryWayDim+=y}});function d(g,v,m){for(var y=0;ye)return r[n];return r[t-1]}function tG(r,e,t,n,i,a,o){a=a||r;var s=e(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var c=o==null||!n?t:fce(n,o);if(c=c||t,!(!c||!c.length)){var h=c[l];return i&&(u[i]=h),s.paletteIdx=(l+1)%c.length,h}}function dce(r,e){e(r).paletteIdx=0,e(r).paletteNameMap={}}var ny,Jd,uN,cN="\0_ec_inner",pce=1,nG=function(r){ae(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.init=function(t,n,i,a,o,s){a=a||{},this.option=null,this._theme=new vn(a),this._locale=new vn(o),this._optionManager=s},e.prototype.setOption=function(t,n,i){var a=dN(n);this._optionManager.setOption(t,i,a),this._resetOption(null,a)},e.prototype.resetOption=function(t,n){return this._resetOption(t,dN(n))},e.prototype._resetOption=function(t,n){var i=!1,a=this._optionManager;if(!t||t==="recreate"){var o=a.mountOption(t==="recreate");!this.option||t==="recreate"?uN(this,o):(this.restoreData(),this._mergeOption(o,n)),i=!0}if((t==="timeline"||t==="media")&&this.restoreData(),!t||t==="recreate"||t==="timeline"){var s=a.getTimelineOption(this);s&&(i=!0,this._mergeOption(s,n))}if(!t||t==="recreate"||t==="media"){var l=a.getMediaOption(this);l.length&&k(l,function(u){i=!0,this._mergeOption(u,n)},this)}return i},e.prototype.mergeOption=function(t){this._mergeOption(t,null)},e.prototype._mergeOption=function(t,n){var i=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=He(),u=n&&n.replaceMergeMainTypeMap;sce(this),k(t,function(h,f){h!=null&&(Nt.hasClass(f)?f&&(s.push(f),l.set(f,!0)):i[f]=i[f]==null?Je(h):ht(i[f],h,!0))}),u&&u.each(function(h,f){Nt.hasClass(f)&&!l.get(f)&&(s.push(f),l.set(f,!0))}),Nt.topologicalTravel(s,Nt.getAllClassMainTypes(),c,this);function c(h){var f=cce(this,h,nn(t[h])),d=a.get(h),p=d?u&&u.get(h)?"replaceMerge":"normalMerge":"replaceAll",g=P4(d,f,p);Pse(g,h,Nt),i[h]=null,a.set(h,null),o.set(h,0);var v=[],m=[],y=0,_;k(g,function(x,S){var A=x.existing,w=x.newOption;if(!w)A&&(A.mergeOption({},this),A.optionUpdated({},!1));else{var M=h==="series",C=Nt.getClass(h,x.keyInfo.subType,!M);if(!C)return;if(h==="tooltip"){if(_)return;_=!0}if(A&&A.constructor===C)A.name=x.keyInfo.name,A.mergeOption(w,this),A.optionUpdated(w,!1);else{var b=pe({componentIndex:S},x.keyInfo);A=new C(w,this,this,b),pe(A,b),x.brandNew&&(A.__requireNewView=!0),A.init(w,this,this),A.optionUpdated(null,!0)}}A?(v.push(A.option),m.push(A),y++):(v.push(void 0),m.push(void 0))},this),i[h]=v,a.set(h,m),o.set(h,y),h==="series"&&ny(this)}this._seriesIndices||ny(this)},e.prototype.getOption=function(){var t=Je(this.option);return k(t,function(n,i){if(Nt.hasClass(i)){for(var a=nn(n),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!Gv(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,t[i]=a}}),delete t[cN],t},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(t){this._payload=t},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(t,n){var i=this._componentsMap.get(t);if(i){var a=i[n||0];if(a)return a;if(n==null){for(var o=0;o=e:t==="max"?r<=e:r===e}function Tce(r,e){return r.join(",")===e.join(",")}const Mce=Sce;var Wa=k,jv=Qe,pN=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function hA(r){var e=r&&r.itemStyle;if(e)for(var t=0,n=pN.length;t=0;v--){var m=r[v];if(s||(p=m.data.rawIndexOf(m.stackedByDimension,d)),p>=0){var y=m.data.getByRawIndex(m.stackResultDimension,p);if(l==="all"||l==="positive"&&y>0||l==="negative"&&y<0||l==="samesign"&&f>=0&&y>0||l==="samesign"&&f<=0&&y<0){f=_se(f,y),g=y;break}}}return n[0]=f,n[1]=g,n})})}var O1=function(){function r(e){this.data=e.data||(e.sourceFormat===Jo?{}:[]),this.sourceFormat=e.sourceFormat||KV,this.seriesLayoutBy=e.seriesLayoutBy||Ho,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var n=0;ng&&(g=_)}d[0]=p,d[1]=g}},i=function(){return this._data?this._data.length/this._dimSize:0};SN=(e={},e[ai+"_"+Ho]={pure:!0,appendData:a},e[ai+"_"+bd]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[Ua]={pure:!0,appendData:a},e[Jo]={pure:!0,appendData:function(o){var s=this._data;k(o,function(l,u){for(var c=s[u]||(s[u]=[]),h=0;h<(l||[]).length;h++)c.push(l[h])})}},e[za]={appendData:a},e[Vl]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},e);function a(o){for(var s=0;s=0&&(g=o.interpolatedValue[v])}return g!=null?g+"":""})}},r.prototype.getRawValue=function(e,t){return Jf(this.getData(t),e)},r.prototype.formatTooltip=function(e,t,n){},r}();function TN(r){var e,t;return Qe(r)?r.type&&(t=r):e=r,{text:e,frag:t}}function lv(r){return new Hce(r)}var Hce=function(){function r(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return r.prototype.perform=function(e){var t=this._upstream,n=e&&e.skip;if(this._dirty&&t){var i=this.context;i.data=i.outputData=t.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!n&&(a=this._plan(this.context));var o=c(this._modBy),s=this._modDataCount||0,l=c(e&&e.modBy),u=e&&e.modDataCount||0;(o!==l||s!==u)&&(a="reset");function c(y){return!(y>=1)&&(y=1),y}var h;(this._dirty||a==="reset")&&(this._dirty=!1,h=this._doReset(n)),this._modBy=l,this._modDataCount=u;var f=e&&e.step;if(t?this._dueEnd=t._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,p=Math.min(f!=null?this._dueIndex+f:1/0,this._dueEnd);if(!n&&(h||d1&&n>0?s:o}};return a;function o(){return e=r?null:le},gte:function(r,e){return r>=e}},$ce=function(){function r(e,t){if(!Ft(t)){var n="";qt(n)}this._opFn=pG[e],this._rvalFloat=Rs(t)}return r.prototype.evaluate=function(e){return Ft(e)?this._opFn(e,this._rvalFloat):this._opFn(Rs(e),this._rvalFloat)},r}(),vG=function(){function r(e,t){var n=e==="desc";this._resultLT=n?1:-1,t==null&&(t=n?"min":"max"),this._incomparable=t==="min"?-1/0:1/0}return r.prototype.evaluate=function(e,t){var n=Ft(e)?e:Rs(e),i=Ft(t)?t:Rs(t),a=isNaN(n),o=isNaN(i);if(a&&(n=this._incomparable),o&&(i=this._incomparable),a&&o){var s=ke(e),l=ke(t);s&&(n=l?e:0),l&&(i=s?t:0)}return ni?-this._resultLT:0},r}(),Xce=function(){function r(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=Rs(t)}return r.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var n=typeof e;n!==this._rvalTypeof&&(n==="number"||this._rvalTypeof==="number")&&(t=Rs(e)===this._rvalFloat)}return this._isEQ?t:!t},r}();function Yce(r,e){return r==="eq"||r==="ne"?new Xce(r==="eq",e):ze(pG,r)?new $ce(r,e):null}var qce=function(){function r(){}return r.prototype.getRawData=function(){throw new Error("not supported")},r.prototype.getRawDataItem=function(e){throw new Error("not supported")},r.prototype.cloneRawData=function(){},r.prototype.getDimensionInfo=function(e){},r.prototype.cloneAllDimensionInfo=function(){},r.prototype.count=function(){},r.prototype.retrieveValue=function(e,t){},r.prototype.retrieveValueFromItem=function(e,t){},r.prototype.convertValue=function(e,t){return Gl(e,t)},r}();function jce(r,e){var t=new qce,n=r.data,i=t.sourceFormat=r.sourceFormat,a=r.startIndex,o="";r.seriesLayoutBy!==Ho&&qt(o);var s=[],l={},u=r.dimensionsDefine;if(u)k(u,function(g,v){var m=g.name,y={index:v,name:m,displayName:g.displayName};if(s.push(y),m!=null){var _="";ze(l,m)&&qt(_),l[m]=y}});else for(var c=0;c65535?rhe:ihe}function zh(){return[1/0,-1/0]}function ahe(r){var e=r.constructor;return e===Array?r.slice():new e(r)}function EN(r,e,t,n,i){var a=yG[t||"float"];if(i){var o=r[e],s=o&&o.length;if(s!==n){for(var l=new a(n),u=0;uv[1]&&(v[1]=g)}return this._rawCount=this._count=l,{start:s,end:l}},r.prototype._initDataFromProvider=function(e,t,n){for(var i=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=xe(o,function(y){return y.property}),c=0;cm[1]&&(m[1]=v)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=t,this._extent=[]},r.prototype.count=function(){return this._count},r.prototype.get=function(e,t){if(!(t>=0&&t=0&&t=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,n=t[e];if(n!=null&&ne)a=o-1;else return o}return-1},r.prototype.indicesOfNearest=function(e,t,n){var i=this._chunks,a=i[e],o=[];if(!a)return o;n==null&&(n=1/0);for(var s=1/0,l=-1,u=0,c=0,h=this.count();c=0&&l<0)&&(s=p,l=d,u=0),d===l&&(o[u++]=c))}return o.length=u,o},r.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,i=this._count;if(n===Array){e=new n(i);for(var a=0;a=h&&y<=f||isNaN(y))&&(l[u++]=g),g++}p=!0}else if(a===2){for(var v=d[i[0]],_=d[i[1]],x=e[i[1]][0],S=e[i[1]][1],m=0;m=h&&y<=f||isNaN(y))&&(A>=x&&A<=S||isNaN(A))&&(l[u++]=g),g++}p=!0}}if(!p)if(a===1)for(var m=0;m=h&&y<=f||isNaN(y))&&(l[u++]=w)}else for(var m=0;me[b][1])&&(M=!1)}M&&(l[u++]=t.getRawIndex(m))}return um[1]&&(m[1]=v)}}}},r.prototype.lttbDownSample=function(e,t){var n=this.clone([e],!0),i=n._chunks,a=i[e],o=this.count(),s=0,l=Math.floor(1/t),u=this.getRawIndex(0),c,h,f,d=new(Bh(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));d[s++]=u;for(var p=1;pc&&(c=h,f=x)}T>0&&Ts&&(g=s-c);for(var v=0;vp&&(p=y,d=c+v)}var _=this.getRawIndex(h),x=this.getRawIndex(d);hc-p&&(l=c-p,s.length=l);for(var g=0;gh[1]&&(h[1]=m),f[d++]=y}return a._count=d,a._indices=f,a._updateGetRawIdx(),a},r.prototype.each=function(e,t){if(this._count)for(var n=e.length,i=this._chunks,a=0,o=this.count();al&&(l=h)}return o=[s,l],this._extent[e]=o,o},r.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var n=[],i=this._chunks,a=0;a=0?this._indices[e]:-1},r.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},r.internalField=function(){function e(t,n,i,a){return Gl(t[a],this._dimensions[a])}pA={arrayRows:e,objectRows:function(t,n,i,a){return Gl(t[n],this._dimensions[a])},keyedColumns:e,original:function(t,n,i,a){var o=t&&(t.value==null?t:t.value);return Gl(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(t,n,i,a){return t[a]}}}(),r}(),_G=function(){function r(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return r.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},r.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},r.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},r.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},r.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,t=this._getUpstreamSourceManagers(),n=!!t.length,i,a;if(ry(e)){var o=e,s=void 0,l=void 0,u=void 0;if(n){var c=t[0];c.prepareSource(),u=c.getSource(),s=u.data,l=u.sourceFormat,a=[c._getVersionSign()]}else s=o.get("data",!0),l=Fi(s)?Vl:za,a=[];var h=this._getSourceMetaRawOption()||{},f=u&&u.metaRawOption||{},d=ot(h.seriesLayoutBy,f.seriesLayoutBy)||null,p=ot(h.sourceHeader,f.sourceHeader),g=ot(h.dimensions,f.dimensions),v=d!==f.seriesLayoutBy||!!p!=!!f.sourceHeader||g;i=v?[RT(s,{seriesLayoutBy:d,sourceHeader:p,dimensions:g},l)]:[]}else{var m=e;if(n){var y=this._applyTransform(t);i=y.sourceList,a=y.upstreamSignList}else{var _=m.get("source",!0);i=[RT(_,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(i,a)},r.prototype._applyTransform=function(e){var t=this._sourceHost,n=t.get("transform",!0),i=t.get("fromTransformResult",!0);if(i!=null){var a="";e.length!==1&&PN(a)}var o,s=[],l=[];return k(e,function(u){u.prepareSource();var c=u.getSource(i||0),h="";i!=null&&!c&&PN(h),s.push(c),l.push(u._getVersionSign())}),n?o=the(n,s,{datasetIndex:t.componentIndex}):i!=null&&(o=[Oce(s[0])]),{sourceList:o,upstreamSignList:l}},r.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t1||t>0&&!r.noHeader;return k(r.blocks,function(i){var a=wG(i);a>=e&&(e=a+ +(n&&(!a||IT(i)&&!i.noHeader)))}),e}return 0}function uhe(r,e,t,n){var i=e.noHeader,a=hhe(wG(e)),o=[],s=e.blocks||[];gi(!s||_e(s)),s=s||[];var l=r.orderMode;if(e.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(ze(u,l)){var c=new vG(u[l],null);s.sort(function(g,v){return c.evaluate(g.sortParam,v.sortParam)})}else l==="seriesDesc"&&s.reverse()}k(s,function(g,v){var m=e.valueFormatter,y=AG(g)(m?pe(pe({},r),{valueFormatter:m}):r,g,v>0?a.html:0,n);y!=null&&o.push(y)});var h=r.renderMode==="richText"?o.join(a.richText):NT(n,o.join(""),i?t:a.html);if(i)return h;var f=ET(e.header,"ordinal",r.useUTC),d=SG(n,r.renderMode).nameStyle,p=xG(n);return r.renderMode==="richText"?bG(r,f,d)+a.richText+h:NT(n,'
'+Jr(f)+"
"+h,t)}function che(r,e,t,n){var i=r.renderMode,a=e.noName,o=e.noValue,s=!e.markerType,l=e.name,u=r.useUTC,c=e.valueFormatter||r.valueFormatter||function(x){return x=_e(x)?x:[x],xe(x,function(S,A){return ET(S,_e(d)?d[A]:d,u)})};if(!(a&&o)){var h=s?"":r.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",i),f=a?"":ET(l,"ordinal",u),d=e.valueType,p=o?[]:c(e.value,e.dataIndex),g=!s||!a,v=!s&&a,m=SG(n,i),y=m.nameStyle,_=m.valueStyle;return i==="richText"?(s?"":h)+(a?"":bG(r,f,y))+(o?"":phe(r,p,g,v,_)):NT(n,(s?"":h)+(a?"":fhe(f,!s,y))+(o?"":dhe(p,g,v,_)),t)}}function RN(r,e,t,n,i,a){if(r){var o=AG(r),s={useUTC:i,renderMode:t,orderMode:n,markupStyleCreator:e,valueFormatter:r.valueFormatter};return o(s,r,0,a)}}function hhe(r){return{html:she[r],richText:lhe[r]}}function NT(r,e,t){var n='
',i="margin: "+t+"px 0 0",a=xG(r);return'
'+e+n+"
"}function fhe(r,e,t){var n=e?"margin-left:2px":"";return''+Jr(r)+""}function dhe(r,e,t,n){var i=t?"10px":"20px",a=e?"float:right;margin-left:"+i:"";return r=_e(r)?r:[r],''+xe(r,function(o){return Jr(o)}).join("  ")+""}function bG(r,e,t){return r.markupStyleCreator.wrapRichTextStyle(e,t)}function phe(r,e,t,n,i){var a=[i],o=n?10:20;return t&&a.push({padding:[0,0,0,o],align:"right"}),r.markupStyleCreator.wrapRichTextStyle(_e(e)?e.join(" "):e,a)}function TG(r,e){var t=r.getData().getItemVisual(e,"style"),n=t[r.visualDrawType];return Hc(n)}function MG(r,e){var t=r.get("padding");return t!=null?t:e==="richText"?[8,10]:10}var vA=function(){function r(){this.richTextStyles={},this._nextStyleNameId=M4()}return r.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},r.prototype.makeTooltipMarker=function(e,t,n){var i=n==="richText"?this._generateStyleName():null,a=tce({color:t,type:e,renderMode:n,markerId:i});return ke(a)?a:(this.richTextStyles[i]=a.style,a.content)},r.prototype.wrapRichTextStyle=function(e,t){var n={};_e(t)?k(t,function(a){return pe(n,a)}):pe(n,t);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+e+"}"},r}();function CG(r){var e=r.series,t=r.dataIndex,n=r.multipleSeries,i=e.getData(),a=i.mapDimensionsAll("defaultedTooltip"),o=a.length,s=e.getRawValue(t),l=_e(s),u=TG(e,t),c,h,f,d;if(o>1||l&&!o){var p=vhe(s,e,t,a,u);c=p.inlineValues,h=p.inlineValueTypes,f=p.blocks,d=p.inlineValues[0]}else if(o){var g=i.getDimensionInfo(a[0]);d=c=Jf(i,t,a[0]),h=g.type}else d=c=l?s[0]:s;var v=JC(e),m=v&&e.name||"",y=i.getName(t),_=n?m:y;return Ar("section",{header:m,noHeader:n||!v,sortParam:d,blocks:[Ar("nameValue",{markerType:"item",markerColor:u,name:_,noName:!eo(_),value:c,valueType:h,dataIndex:t})].concat(f||[])})}function vhe(r,e,t,n,i){var a=e.getData(),o=$o(r,function(h,f,d){var p=a.getDimensionInfo(d);return h=h||p&&p.tooltip!==!1&&p.displayName!=null},!1),s=[],l=[],u=[];n.length?k(n,function(h){c(Jf(a,t,h),h)}):k(r,c);function c(h,f){var d=a.getDimensionInfo(f);!d||d.otherDims.tooltip===!1||(o?u.push(Ar("nameValue",{markerType:"subItem",markerColor:i,name:d.displayName,value:h,valueType:d.type})):(s.push(h),l.push(d.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var Qs=Pt();function iy(r,e){return r.getName(e)||r.getId(e)}var h0="__universalTransitionEnabled",z1=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return e.prototype.init=function(t,n,i){this.seriesIndex=this.componentIndex,this.dataTask=lv({count:mhe,reset:yhe}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,i);var a=Qs(this).sourceManager=new _G(this);a.prepareSource();var o=this.getInitialData(t,i);IN(o,this),this.dataTask.context.data=o,Qs(this).dataBeforeProcessed=o,DN(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(t,n){var i=qv(this),a=i?Ad(t):{},o=this.subType;Nt.hasClass(o)&&(o+="Series"),ht(t,n.getTheme().get(this.subType)),ht(t,this.getDefaultOption()),zc(t,"label",["show"]),this.fillDataTextStyle(t.data),i&&Zl(t,a,i)},e.prototype.mergeOption=function(t,n){t=ht(this.option,t,!0),this.fillDataTextStyle(t.data);var i=qv(this);i&&Zl(this.option,t,i);var a=Qs(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(t,n);IN(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,Qs(this).dataBeforeProcessed=o,DN(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(t){if(t&&!Fi(t))for(var n=["show"],i=0;ithis.getShallow("animationThreshold")&&(n=!1),!!n},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,n,i){var a=this.ecModel,o=b2.prototype.getColorFromPalette.call(this,t,n,i);return o||(o=a.getColorFromPalette(t,n,i)),o},e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(t,n){this._innerSelect(this.getData(n),t)},e.prototype.unselect=function(t,n){var i=this.option.selectedMap;if(i){var a=this.option.selectedMode,o=this.getData(n);if(a==="series"||i==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s=0&&i.push(o)}return i},e.prototype.isSelected=function(t,n){var i=this.option.selectedMap;if(!i)return!1;var a=this.getData(n);return(i==="all"||i[iy(a,t)])&&!a.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[h0])return!0;var t=this.option.universalTransition;return t?t===!0?!0:t&&t.enabled:!1},e.prototype._innerSelect=function(t,n){var i,a,o=this.option,s=o.selectedMode,l=n.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){Qe(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,c=0;c0&&this._innerSelect(t,n)}},e.registerClass=function(t){return Nt.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(Nt);ir(z1,F1);ir(z1,b2);k4(z1,Nt);function DN(r){var e=r.name;JC(r)||(r.name=ghe(r)||e)}function ghe(r){var e=r.getRawData(),t=e.mapDimensionsAll("seriesName"),n=[];return k(t,function(i){var a=e.getDimensionInfo(i);a.displayName&&n.push(a.displayName)}),n.join(" ")}function mhe(r){return r.model.getRawData().count()}function yhe(r){var e=r.model;return e.setData(e.getRawData().cloneShallow()),_he}function _he(r,e){e.outputData&&r.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function IN(r,e){k(Fv(r.CHANGABLE_METHODS,r.DOWNSAMPLE_METHODS),function(t){r.wrapMethod(t,ut(xhe,e))})}function xhe(r,e){var t=kT(r);return t&&t.setOutputEnd((e||this).count()),e}function kT(r){var e=(r.ecModel||{}).scheduler,t=e&&e.getPipeline(r.uid);if(t){var n=t.currentTask;if(n){var i=n.agentStubMap;i&&(n=i.get(r.uid))}return n}}const En=z1;var L2=function(){function r(){this.group=new rt,this.uid=xd("viewComponent")}return r.prototype.init=function(e,t){},r.prototype.render=function(e,t,n,i){},r.prototype.dispose=function(e,t){},r.prototype.updateView=function(e,t,n,i){},r.prototype.updateLayout=function(e,t,n,i){},r.prototype.updateVisual=function(e,t,n,i){},r.prototype.toggleBlurSeries=function(e,t,n){},r.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},r}();t2(L2);_1(L2);const kn=L2;function Td(){var r=Pt();return function(e){var t=r(e),n=e.pipelineContext,i=!!t.large,a=!!t.progressiveRender,o=t.large=!!(n&&n.large),s=t.progressiveRender=!!(n&&n.progressiveRender);return(i!==o||a!==s)&&"reset"}}var EG=Pt(),She=Td(),P2=function(){function r(){this.group=new rt,this.uid=xd("viewChart"),this.renderTask=lv({plan:Ahe,reset:whe}),this.renderTask.context={view:this}}return r.prototype.init=function(e,t){},r.prototype.render=function(e,t,n,i){},r.prototype.highlight=function(e,t,n,i){var a=e.getData(i&&i.dataType);a&&kN(a,i,"emphasis")},r.prototype.downplay=function(e,t,n,i){var a=e.getData(i&&i.dataType);a&&kN(a,i,"normal")},r.prototype.remove=function(e,t){this.group.removeAll()},r.prototype.dispose=function(e,t){},r.prototype.updateView=function(e,t,n,i){this.render(e,t,n,i)},r.prototype.updateLayout=function(e,t,n,i){this.render(e,t,n,i)},r.prototype.updateVisual=function(e,t,n,i){this.render(e,t,n,i)},r.prototype.eachRendered=function(e){ou(this.group,e)},r.markUpdateMethod=function(e,t){EG(e).updateMethod=t},r.protoInitialize=function(){var e=r.prototype;e.type="chart"}(),r}();function NN(r,e,t){r&&$v(r)&&(e==="emphasis"?Ds:Is)(r,t)}function kN(r,e,t){var n=Uc(r,e),i=e&&e.highlightKey!=null?qle(e.highlightKey):null;n!=null?k(nn(n),function(a){NN(r.getItemGraphicEl(a),t,i)}):r.eachItemGraphicEl(function(a){NN(a,t,i)})}t2(P2);_1(P2);function Ahe(r){return She(r.model)}function whe(r){var e=r.model,t=r.ecModel,n=r.api,i=r.payload,a=e.pipelineContext.progressiveRender,o=r.view,s=i&&EG(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,t,n,i),bhe[l]}var bhe={incrementalPrepareRender:{progress:function(r,e){e.view.incrementalRender(r,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(r,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}};const gn=P2;var h_="\0__throttleOriginMethod",ON="\0__throttleRate",FN="\0__throttleType";function U1(r,e,t){var n,i=0,a=0,o=null,s,l,u,c;e=e||0;function h(){a=new Date().getTime(),o=null,r.apply(l,u||[])}var f=function(){for(var d=[],p=0;p=0?h():o=setTimeout(h,-s),i=n};return f.clear=function(){o&&(clearTimeout(o),o=null)},f.debounceNextCall=function(d){c=d},f}function Md(r,e,t,n){var i=r[e];if(i){var a=i[h_]||i,o=i[FN],s=i[ON];if(s!==t||o!==n){if(t==null||!n)return r[e]=a;i=r[e]=U1(a,t,n==="debounce"),i[h_]=a,i[FN]=n,i[ON]=t}return i}}function Kv(r,e){var t=r[e];t&&t[h_]&&(t.clear&&t.clear(),r[e]=t[h_])}var BN=Pt(),zN={itemStyle:Vc(DV,!0),lineStyle:Vc(RV,!0)},The={lineStyle:"stroke",itemStyle:"fill"};function LG(r,e){var t=r.visualStyleMapper||zN[e];return t||(console.warn("Unknown style type '"+e+"'."),zN.itemStyle)}function PG(r,e){var t=r.visualDrawType||The[e];return t||(console.warn("Unknown style type '"+e+"'."),"fill")}var Mhe={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,e){var t=r.getData(),n=r.visualStyleAccessPath||"itemStyle",i=r.getModel(n),a=LG(r,n),o=a(i),s=i.getShallow("decal");s&&(t.setVisual("decal",s),s.dirty=!0);var l=PG(r,n),u=o[l],c=qe(u)?u:null,h=o.fill==="auto"||o.stroke==="auto";if(!o[l]||c||h){var f=r.getColorFromPalette(r.name,null,e.getSeriesCount());o[l]||(o[l]=f,t.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||qe(o.fill)?f:o.fill,o.stroke=o.stroke==="auto"||qe(o.stroke)?f:o.stroke}if(t.setVisual("style",o),t.setVisual("drawType",l),!e.isSeriesFiltered(r)&&c)return t.setVisual("colorFromPalette",!1),{dataEach:function(d,p){var g=r.getDataParams(p),v=pe({},o);v[l]=c(g),d.setItemVisual(p,"style",v)}}}},tp=new vn,Che={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,e){if(!(r.ignoreStyleOnData||e.isSeriesFiltered(r))){var t=r.getData(),n=r.visualStyleAccessPath||"itemStyle",i=LG(r,n),a=t.getVisual("drawType");return{dataEach:t.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){tp.option=l[n];var u=i(tp),c=o.ensureUniqueItemVisual(s,"style");pe(c,u),tp.option.decal&&(o.setItemVisual(s,"decal",tp.option.decal),tp.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},Ehe={performRawSeries:!0,overallReset:function(r){var e=He();r.eachSeries(function(t){var n=t.getColorBy();if(!t.isColorBySeries()){var i=t.type+"-"+n,a=e.get(i);a||(a={},e.set(i,a)),BN(t).scope=a}}),r.eachSeries(function(t){if(!(t.isColorBySeries()||r.isSeriesFiltered(t))){var n=t.getRawData(),i={},a=t.getData(),o=BN(t).scope,s=t.visualStyleAccessPath||"itemStyle",l=PG(t,s);a.each(function(u){var c=a.getRawIndex(u);i[c]=u}),n.each(function(u){var c=i[u],h=a.getItemVisual(c,"colorFromPalette");if(h){var f=a.ensureUniqueItemVisual(c,"style"),d=n.getName(u)||u+"",p=n.count();f[l]=t.getColorFromPalette(d,o,p)}})}})}},ay=Math.PI;function Lhe(r,e){e=e||{},Ke(e,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var t=new rt,n=new Dt({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});t.add(n);var i=new Ot({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new Dt({style:{fill:"none"},textContent:i,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});t.add(a);var o;return e.showSpinner&&(o=new h2({shape:{startAngle:-ay/2,endAngle:-ay/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:ay*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:ay*3/2}).delay(300).start("circularInOut"),t.add(o)),t.resize=function(){var s=i.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,u=(r.getWidth()-l*2-(e.showSpinner&&s?10:0)-s)/2-(e.showSpinner&&s?0:5+s/2)+(e.showSpinner?0:s/2)+(s?0:l),c=r.getHeight()/2;e.showSpinner&&o.setShape({cx:u,cy:c}),a.setShape({x:u-l,y:c-l,width:l*2,height:l*2}),n.setShape({x:0,y:0,width:r.getWidth(),height:r.getHeight()})},t.resize(),t}var Phe=function(){function r(e,t,n,i){this._stageTaskMap=He(),this.ecInstance=e,this.api=t,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return r.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each(function(n){var i=n.overallTask;i&&i.dirty()})},r.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),i=n.context,a=!t&&n.progressiveEnabled&&(!i||i.progressiveRender)&&e.__idxInPipeline>n.blockIndex,o=a?n.step:null,s=i&&i.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},r.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},r.prototype.updateStreamModes=function(e,t){var n=this._pipelineMap.get(e.uid),i=e.getData(),a=i.count(),o=n.progressiveEnabled&&t.incrementalPrepareRender&&a>=n.threshold,s=e.get("large")&&a>=e.get("largeThreshold"),l=e.get("progressiveChunkMode")==="mod"?a:null;e.pipelineContext=n.context={progressiveRender:o,modDataCount:l,large:s}},r.prototype.restorePipelines=function(e){var t=this,n=t._pipelineMap=He();e.eachSeries(function(i){var a=i.getProgressive(),o=i.uid;n.set(o,{id:o,head:null,tail:null,threshold:i.getProgressiveThreshold(),progressiveEnabled:a&&!(i.preventIncremental&&i.preventIncremental()),blockIndex:-1,step:Math.round(a||700),count:0}),t._pipe(i,i.dataTask)})},r.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),n=this.api;k(this._allHandlers,function(i){var a=e.get(i.uid)||e.set(i.uid,{}),o="";gi(!(i.reset&&i.overallReset),o),i.reset&&this._createSeriesStageTask(i,a,t,n),i.overallReset&&this._createOverallStageTask(i,a,t,n)},this)},r.prototype.prepareView=function(e,t,n,i){var a=e.renderTask,o=a.context;o.model=t,o.ecModel=n,o.api=i,a.__block=!e.incrementalPrepareRender,this._pipe(t,a)},r.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},r.prototype.performVisualTasks=function(e,t,n){this._performStageTasks(this._visualHandlers,e,t,n)},r.prototype._performStageTasks=function(e,t,n,i){i=i||{};var a=!1,o=this;k(e,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var c=o._stageTaskMap.get(l.uid),h=c.seriesTaskMap,f=c.overallTask;if(f){var d,p=f.agentStubMap;p.each(function(v){s(i,v)&&(v.dirty(),d=!0)}),d&&f.dirty(),o.updatePayload(f,n);var g=o.getPerformArgs(f,i.block);p.each(function(v){v.perform(g)}),f.perform(g)&&(a=!0)}else h&&h.each(function(v,m){s(i,v)&&v.dirty();var y=o.getPerformArgs(v,i.block);y.skip=!l.performRawSeries&&t.isSeriesFiltered(v.context.model),o.updatePayload(v,n),v.perform(y)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},r.prototype.performSeriesTasks=function(e){var t;e.eachSeries(function(n){t=n.dataTask.perform()||t}),this.unfinished=t||this.unfinished},r.prototype.plan=function(){this._pipelineMap.each(function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)})},r.prototype.updatePayload=function(e,t){t!=="remain"&&(e.context.payload=t)},r.prototype._createSeriesStageTask=function(e,t,n,i){var a=this,o=t.seriesTaskMap,s=t.seriesTaskMap=He(),l=e.seriesType,u=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(c):l?n.eachRawSeriesByType(l,c):u&&u(n,i).each(c);function c(h){var f=h.uid,d=s.set(f,o&&o.get(f)||lv({plan:khe,reset:Ohe,count:Bhe}));d.context={model:h,ecModel:n,api:i,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:a},a._pipe(h,d)}},r.prototype._createOverallStageTask=function(e,t,n,i){var a=this,o=t.overallTask=t.overallTask||lv({reset:Rhe});o.context={ecModel:n,api:i,overallReset:e.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=He(),u=e.seriesType,c=e.getTargetSeries,h=!0,f=!1,d="";gi(!e.createOnAllSeries,d),u?n.eachRawSeriesByType(u,p):c?c(n,i).each(p):(h=!1,k(n.getSeries(),p));function p(g){var v=g.uid,m=l.set(v,s&&s.get(v)||(f=!0,lv({reset:Dhe,onDirty:Nhe})));m.context={model:g,overallProgress:h},m.agent=o,m.__block=h,a._pipe(g,m)}f&&o.dirty()},r.prototype._pipe=function(e,t){var n=e.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=t),i.tail&&i.tail.pipe(t),i.tail=t,t.__idxInPipeline=i.count++,t.__pipeline=i},r.wrapStageHandler=function(e,t){return qe(e)&&(e={overallReset:e,seriesType:zhe(e)}),e.uid=xd("stageHandler"),t&&(e.visualType=t),e},r}();function Rhe(r){r.overallReset(r.ecModel,r.api,r.payload)}function Dhe(r){return r.overallProgress&&Ihe}function Ihe(){this.agent.dirty(),this.getDownstream().dirty()}function Nhe(){this.agent&&this.agent.dirty()}function khe(r){return r.plan?r.plan(r.model,r.ecModel,r.api,r.payload):null}function Ohe(r){r.useClearVisual&&r.data.clearAllVisual();var e=r.resetDefines=nn(r.reset(r.model,r.ecModel,r.api,r.payload));return e.length>1?xe(e,function(t,n){return RG(n)}):Fhe}var Fhe=RG(0);function RG(r){return function(e,t){var n=t.data,i=t.resetDefines[r];if(i&&i.dataEach)for(var a=e.start;a0&&d===u.length-f.length){var p=u.slice(0,d);p!=="data"&&(t.mainType=p,t[f.toLowerCase()]=l,c=!0)}}s.hasOwnProperty(u)&&(n[u]=l,c=!0),c||(i[u]=l)})}return{cptQuery:t,dataQuery:n,otherQuery:i}},r.prototype.filter=function(e,t){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,a=n.packedEvent,o=n.model,s=n.view;if(!o||!s)return!0;var l=t.cptQuery,u=t.dataQuery;return c(l,o,"mainType")&&c(l,o,"subType")&&c(l,o,"index","componentIndex")&&c(l,o,"name")&&c(l,o,"id")&&c(u,a,"name")&&c(u,a,"dataIndex")&&c(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,t.otherQuery,i,a));function c(h,f,d,p){return h[d]==null||f[p||d]===h[d]}},r.prototype.afterTrigger=function(){this.eventInfo=null},r}(),OT=["symbol","symbolSize","symbolRotate","symbolOffset"],HN=OT.concat(["symbolKeepAspect"]),Hhe={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,e){var t=r.getData();if(r.legendIcon&&t.setVisual("legendIcon",r.legendIcon),!r.hasSymbolVisual)return;for(var n={},i={},a=!1,o=0;o=0&&uc(l)?l:.5;var u=r.createRadialGradient(o,s,0,o,s,l);return u}function FT(r,e,t){for(var n=e.type==="radial"?afe(r,e,t):ife(r,e,t),i=e.colorStops,a=0;a0)?null:r==="dashed"?[4*e,2*e]:r==="dotted"?[e]:Ft(r)?[r]:_e(r)?r:null}function D2(r){var e=r.style,t=e.lineDash&&e.lineWidth>0&&sfe(e.lineDash,e.lineWidth),n=e.lineDashOffset;if(t){var i=e.strokeNoScale&&r.getLineScale?r.getLineScale():1;i&&i!==1&&(t=xe(t,function(a){return a/i}),n/=i)}return[t,n]}var lfe=new jo(!0);function p_(r){var e=r.stroke;return!(e==null||e==="none"||!(r.lineWidth>0))}function WN(r){return typeof r=="string"&&r!=="none"}function v_(r){var e=r.fill;return e!=null&&e!=="none"}function $N(r,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var t=r.globalAlpha;r.globalAlpha=e.fillOpacity*e.opacity,r.fill(),r.globalAlpha=t}else r.fill()}function XN(r,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var t=r.globalAlpha;r.globalAlpha=e.strokeOpacity*e.opacity,r.stroke(),r.globalAlpha=t}else r.stroke()}function BT(r,e,t){var n=n2(e.image,e.__image,t);if(x1(n)){var i=r.createPattern(n,e.repeat||"repeat");if(typeof DOMMatrix=="function"&&i&&i.setTransform){var a=new DOMMatrix;a.translateSelf(e.x||0,e.y||0),a.rotateSelf(0,0,(e.rotation||0)*Zy),a.scaleSelf(e.scaleX||1,e.scaleY||1),i.setTransform(a)}return i}}function ufe(r,e,t,n){var i,a=p_(t),o=v_(t),s=t.strokePercent,l=s<1,u=!e.path;(!e.silent||l)&&u&&e.createPathProxy();var c=e.path||lfe,h=e.__dirty;if(!n){var f=t.fill,d=t.stroke,p=o&&!!f.colorStops,g=a&&!!d.colorStops,v=o&&!!f.image,m=a&&!!d.image,y=void 0,_=void 0,x=void 0,S=void 0,A=void 0;(p||g)&&(A=e.getBoundingRect()),p&&(y=h?FT(r,f,A):e.__canvasFillGradient,e.__canvasFillGradient=y),g&&(_=h?FT(r,d,A):e.__canvasStrokeGradient,e.__canvasStrokeGradient=_),v&&(x=h||!e.__canvasFillPattern?BT(r,f,e):e.__canvasFillPattern,e.__canvasFillPattern=x),m&&(S=h||!e.__canvasStrokePattern?BT(r,d,e):e.__canvasStrokePattern,e.__canvasStrokePattern=x),p?r.fillStyle=y:v&&(x?r.fillStyle=x:o=!1),g?r.strokeStyle=_:m&&(S?r.strokeStyle=S:a=!1)}var w=e.getGlobalScale();c.setScale(w[0],w[1],e.segmentIgnoreThreshold);var M,C;r.setLineDash&&t.lineDash&&(i=D2(e),M=i[0],C=i[1]);var b=!0;(u||h&tf)&&(c.setDPR(r.dpr),l?c.setContext(null):(c.setContext(r),b=!1),c.reset(),e.buildPath(c,e.shape,n),c.toStatic(),e.pathUpdated()),b&&c.rebuildPath(r,l?s:1),M&&(r.setLineDash(M),r.lineDashOffset=C),n||(t.strokeFirst?(a&&XN(r,t),o&&$N(r,t)):(o&&$N(r,t),a&&XN(r,t))),M&&r.setLineDash([])}function cfe(r,e,t){var n=e.__image=n2(t.image,e.__image,e,e.onload);if(!(!n||!x1(n))){var i=t.x||0,a=t.y||0,o=e.getWidth(),s=e.getHeight(),l=n.width/n.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=n.width,s=n.height),t.sWidth&&t.sHeight){var u=t.sx||0,c=t.sy||0;r.drawImage(n,u,c,t.sWidth,t.sHeight,i,a,o,s)}else if(t.sx&&t.sy){var u=t.sx,c=t.sy,h=o-u,f=s-c;r.drawImage(n,u,c,h,f,i,a,o,s)}else r.drawImage(n,i,a,o,s)}}function hfe(r,e,t){var n,i=t.text;if(i!=null&&(i+=""),i){r.font=t.font||Yl,r.textAlign=t.textAlign,r.textBaseline=t.textBaseline;var a=void 0,o=void 0;r.setLineDash&&t.lineDash&&(n=D2(e),a=n[0],o=n[1]),a&&(r.setLineDash(a),r.lineDashOffset=o),t.strokeFirst?(p_(t)&&r.strokeText(i,t.x,t.y),v_(t)&&r.fillText(i,t.x,t.y)):(v_(t)&&r.fillText(i,t.x,t.y),p_(t)&&r.strokeText(i,t.x,t.y)),a&&r.setLineDash([])}}var YN=["shadowBlur","shadowOffsetX","shadowOffsetY"],qN=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function BG(r,e,t,n,i){var a=!1;if(!n&&(t=t||{},e===t))return!1;if(n||e.opacity!==t.opacity){Ti(r,i),a=!0;var o=Math.max(Math.min(e.opacity,1),0);r.globalAlpha=isNaN(o)?Mc.opacity:o}(n||e.blend!==t.blend)&&(a||(Ti(r,i),a=!0),r.globalCompositeOperation=e.blend||Mc.blend);for(var s=0;s0&&t.unfinished);t.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(t,n,i){if(!this[$r]){if(this._disposed){this.id;return}var a,o,s;if(Qe(n)&&(i=n.lazyUpdate,a=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[$r]=!0,!this._model||n){var l=new Mce(this._api),u=this._theme,c=this._model=new rG;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,u,this._locale,l)}this._model.setOption(t,{replaceMerge:o},UT);var h={seriesTransition:s,optionChanged:!0};if(i)this[xi]={silent:a,updateParams:h},this[$r]=!1,this.getZr().wakeUp();else{try{Vh(this),Js.update.call(this,null,h)}catch(f){throw this[xi]=null,this[$r]=!1,f}this._ssr||this._zr.flush(),this[xi]=null,this[$r]=!1,np.call(this,a),rp.call(this,a)}}},e.prototype.setTheme=function(){},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||kt.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},e.prototype.renderToCanvas=function(t){t=t||{};var n=this._zr.painter;return n.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(t){t=t||{};var n=this._zr.painter;return n.renderToString({useViewBox:t.useViewBox})},e.prototype.getSvgDataURL=function(){if(kt.svgSupported){var t=this._zr,n=t.storage.getDisplayList();return k(n,function(i){i.stopAnimation(null,!0)}),t.painter.toDataURL()}},e.prototype.getDataURL=function(t){if(this._disposed){this.id;return}t=t||{};var n=t.excludeComponents,i=this._model,a=[],o=this;k(n,function(l){i.eachComponent({mainType:l},function(u){var c=o._componentsMap[u.__viewId];c.group.ignore||(a.push(c),c.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return k(a,function(l){l.group.ignore=!1}),s},e.prototype.getConnectedDataURL=function(t){if(this._disposed){this.id;return}var n=t.type==="svg",i=this.group,a=Math.min,o=Math.max,s=1/0;if(uk[i]){var l=s,u=s,c=-s,h=-s,f=[],d=t&&t.pixelRatio||this.getDevicePixelRatio();k(cv,function(_,x){if(_.group===i){var S=n?_.getZr().painter.getSvgDom().innerHTML:_.renderToCanvas(Je(t)),A=_.getDom().getBoundingClientRect();l=a(A.left,l),u=a(A.top,u),c=o(A.right,c),h=o(A.bottom,h),f.push({dom:S,left:A.left,top:A.top})}}),l*=d,u*=d,c*=d,h*=d;var p=c-l,g=h-u,v=ql.createCanvas(),m=pI(v,{renderer:n?"svg":"canvas"});if(m.resize({width:p,height:g}),n){var y="";return k(f,function(_){var x=_.left-l,S=_.top-u;y+=''+_.dom+""}),m.painter.getSvgRoot().innerHTML=y,t.connectedBackgroundColor&&m.painter.setBackgroundColor(t.connectedBackgroundColor),m.refreshImmediately(),m.painter.toDataURL()}else return t.connectedBackgroundColor&&m.add(new Dt({shape:{x:0,y:0,width:p,height:g},style:{fill:t.connectedBackgroundColor}})),k(f,function(_){var x=new Ur({style:{x:_.left*d-l,y:_.top*d-u,image:_.dom}});m.add(x)}),m.refreshImmediately(),v.toDataURL("image/"+(t&&t.type||"png"))}else return this.getDataURL(t)},e.prototype.convertToPixel=function(t,n){return xA(this,"convertToPixel",t,n)},e.prototype.convertFromPixel=function(t,n){return xA(this,"convertFromPixel",t,n)},e.prototype.containPixel=function(t,n){if(this._disposed){this.id;return}var i=this._model,a,o=rv(i,t);return k(o,function(s,l){l.indexOf("Models")>=0&&k(s,function(u){var c=u.coordinateSystem;if(c&&c.containPoint)a=a||!!c.containPoint(n);else if(l==="seriesModels"){var h=this._chartsMap[u.__viewId];h&&h.containPoint&&(a=a||h.containPoint(n,u))}},this)},this),!!a},e.prototype.getVisual=function(t,n){var i=this._model,a=rv(i,t,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?R2(s,l,n):Lg(s,n)},e.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},e.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},e.prototype._initEvents=function(){var t=this;k(Ffe,function(n){var i=function(a){var o=t.getModel(),s=a.target,l,u=n==="globalout";if(u?l={}:s&&lc(s,function(p){var g=at(p);if(g&&g.dataIndex!=null){var v=g.dataModel||o.getSeriesByIndex(g.seriesIndex);return l=v&&v.getDataParams(g.dataIndex,g.dataType,s)||{},!0}else if(g.eventData)return l=pe({},g.eventData),!0},!0),l){var c=l.componentType,h=l.componentIndex;(c==="markLine"||c==="markPoint"||c==="markArea")&&(c="series",h=l.seriesIndex);var f=c&&h!=null&&o.getComponent(c,h),d=f&&t[f.mainType==="series"?"_chartsMap":"_componentsMap"][f.__viewId];l.event=a,l.type=n,t._$eventProcessor.eventInfo={targetEl:s,packedEvent:l,model:f,view:d},t.trigger(n,l)}};i.zrEventfulCallAtLast=!0,t._zr.on(n,i,t)}),k(uv,function(n,i){t._messageCenter.on(i,function(a){this.trigger(i,a)},t)}),k(["selectchanged"],function(n){t._messageCenter.on(n,function(i){this.trigger(n,i)},t)}),$he(this._messageCenter,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var t=this.getDom();t&&D4(this.getDom(),k2,"");var n=this,i=n._api,a=n._model;k(n._componentsViews,function(o){o.dispose(a,i)}),k(n._chartsViews,function(o){o.dispose(a,i)}),n._zr.dispose(),n._dom=n._model=n._chartsMap=n._componentsMap=n._chartsViews=n._componentsViews=n._scheduler=n._api=n._zr=n._throttledZrFlush=n._theme=n._coordSysMgr=n._messageCenter=null,delete cv[n.id]},e.prototype.resize=function(t){if(!this[$r]){if(this._disposed){this.id;return}this._zr.resize(t);var n=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!n){var i=n.resetOption("media"),a=t&&t.silent;this[xi]&&(a==null&&(a=this[xi].silent),i=!0,this[xi]=null),this[$r]=!0;try{i&&Vh(this),Js.update.call(this,{type:"resize",animation:pe({duration:0},t&&t.animation)})}catch(o){throw this[$r]=!1,o}this[$r]=!1,np.call(this,a),rp.call(this,a)}}},e.prototype.showLoading=function(t,n){if(this._disposed){this.id;return}if(Qe(t)&&(n=t,t=""),t=t||"default",this.hideLoading(),!!VT[t]){var i=VT[t](this._api,n),a=this._zr;this._loadingFX=i,a.add(i)}},e.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},e.prototype.makeActionFromEvent=function(t){var n=pe({},t);return n.type=uv[t.type],n},e.prototype.dispatchAction=function(t,n){if(this._disposed){this.id;return}if(Qe(n)||(n={silent:!!n}),!!g_[t.type]&&this._model){if(this[$r]){this._pendingActions.push(t);return}var i=n.silent;AA.call(this,t,i);var a=n.flush;a?this._zr.flush():a!==!1&&kt.browser.weChat&&this._throttledZrFlush(),np.call(this,i),rp.call(this,i)}},e.prototype.updateLabelLayout=function(){qa.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(t){if(this._disposed){this.id;return}var n=t.seriesIndex,i=this.getModel(),a=i.getSeriesByIndex(n);a.appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=function(){Vh=function(h){var f=h._scheduler;f.restorePipelines(h._model),f.prepareStageTasks(),_A(h,!0),_A(h,!1),f.plan()},_A=function(h,f){for(var d=h._model,p=h._scheduler,g=f?h._componentsViews:h._chartsViews,v=f?h._componentsMap:h._chartsMap,m=h._zr,y=h._api,_=0;_f.get("hoverLayerThreshold")&&!kt.node&&!kt.worker&&f.eachSeries(function(v){if(!v.preventUsingHoverLayer){var m=h._chartsMap[v.__viewId];m.__alive&&m.eachRendered(function(y){y.states.emphasis&&(y.states.emphasis.hoverLayer=!0)})}})}function o(h,f){var d=h.get("blendMode")||null;f.eachRendered(function(p){p.isGroup||(p.style.blend=d)})}function s(h,f){if(!h.preventAutoZ){var d=h.get("z")||0,p=h.get("zlevel")||0;f.eachRendered(function(g){return l(g,d,p,-1/0),!0})}}function l(h,f,d,p){var g=h.getTextContent(),v=h.getTextGuideLine(),m=h.isGroup;if(m)for(var y=h.childrenRef(),_=0;_0?{duration:g,delay:d.get("delay"),easing:d.get("easing")}:null;f.eachRendered(function(m){if(m.states&&m.states.emphasis){if(Mf(m))return;if(m instanceof yt&&jle(m),m.__dirty){var y=m.prevStates;y&&m.useStates(y)}if(p){m.stateTransition=v;var _=m.getTextContent(),x=m.getTextGuideLine();_&&(_.stateTransition=v),x&&(x.stateTransition=v)}m.__dirty&&i(m)}})}sk=function(h){return new(function(f){ae(d,f);function d(){return f!==null&&f.apply(this,arguments)||this}return d.prototype.getCoordinateSystems=function(){return h._coordSysMgr.getCoordinateSystems()},d.prototype.getComponentByElement=function(p){for(;p;){var g=p.__ecComponentInfo;if(g!=null)return h._model.getComponent(g.mainType,g.index);p=p.parent}},d.prototype.enterEmphasis=function(p,g){Ds(p,g),la(h)},d.prototype.leaveEmphasis=function(p,g){Is(p,g),la(h)},d.prototype.enterBlur=function(p){J4(p),la(h)},d.prototype.leaveBlur=function(p){s2(p),la(h)},d.prototype.enterSelect=function(p){eV(p),la(h)},d.prototype.leaveSelect=function(p){tV(p),la(h)},d.prototype.getModel=function(){return h.getModel()},d.prototype.getViewOfComponentModel=function(p){return h.getViewOfComponentModel(p)},d.prototype.getViewOfSeriesModel=function(p){return h.getViewOfSeriesModel(p)},d}(iG))(h)},JG=function(h){function f(d,p){for(var g=0;g=0)){ck.push(t);var a=NG.wrapStageHandler(t,i);a.__prio=e,a.__raw=t,r.push(a)}}function aH(r,e){VT[r]=e}function $fe(r,e,t){var n=Afe("registerMap");n&&n(r,e,t)}var Xfe=ehe;eh(I2,Mhe);eh(V1,Che);eh(V1,Ehe);eh(I2,Hhe);eh(V1,Whe);eh(YG,_fe);rH(oG);iH(Tfe,Nce);aH("default",Lhe);es({type:Cc,event:Cc,update:Cc},qn);es({type:o0,event:o0,update:o0},qn);es({type:iv,event:iv,update:iv},qn);es({type:s0,event:s0,update:s0},qn);es({type:av,event:av,update:av},qn);nH("light",Uhe);nH("dark",Vhe);var hk=[],Yfe={registerPreprocessor:rH,registerProcessor:iH,registerPostInit:Vfe,registerPostUpdate:Gfe,registerUpdateLifecycle:O2,registerAction:es,registerCoordinateSystem:Hfe,registerLayout:Wfe,registerVisual:eh,registerTransform:Xfe,registerLoading:aH,registerMap:$fe,registerImpl:Sfe,PRIORITY:Nfe,ComponentModel:Nt,ComponentView:kn,SeriesModel:En,ChartView:gn,registerComponentModel:function(r){Nt.registerClass(r)},registerComponentView:function(r){kn.registerClass(r)},registerSeriesModel:function(r){En.registerClass(r)},registerChartView:function(r){gn.registerClass(r)},registerSubTypeDefaulter:function(r,e){Nt.registerSubTypeDefaulter(r,e)},registerPainter:function(r,e){dse(r,e)}};function gt(r){if(_e(r)){k(r,function(e){gt(e)});return}pt(hk,r)>=0||(hk.push(r),qe(r)&&(r={install:r}),r.install(Yfe))}function ip(r){return r==null?0:r.length||1}function fk(r){return r}var qfe=function(){function r(e,t,n,i,a,o){this._old=e,this._new=t,this._oldKeyGetter=n||fk,this._newKeyGetter=i||fk,this.context=a,this._diffModeMultiple=o==="multiple"}return r.prototype.add=function(e){return this._add=e,this},r.prototype.update=function(e){return this._update=e,this},r.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},r.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},r.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},r.prototype.remove=function(e){return this._remove=e,this},r.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},r.prototype._executeOneToOne=function(){var e=this._old,t=this._new,n={},i=new Array(e.length),a=new Array(t.length);this._initIndexMap(e,null,i,"_oldKeyGetter"),this._initIndexMap(t,n,a,"_newKeyGetter");for(var o=0;o1){var c=l.shift();l.length===1&&(n[s]=l[0]),this._update&&this._update(c,o)}else u===1?(n[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,n)},r.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},i={},a=[],o=[];this._initIndexMap(e,n,a,"_oldKeyGetter"),this._initIndexMap(t,i,o,"_newKeyGetter");for(var s=0;s1&&f===1)this._updateManyToOne&&this._updateManyToOne(c,u),i[l]=null;else if(h===1&&f>1)this._updateOneToMany&&this._updateOneToMany(c,u),i[l]=null;else if(h===1&&f===1)this._update&&this._update(c,u),i[l]=null;else if(h>1&&f>1)this._updateManyToMany&&this._updateManyToMany(c,u),i[l]=null;else if(h>1)for(var d=0;d1)for(var s=0;s30}var ap=Qe,el=xe,tde=typeof Int32Array=="undefined"?Array:Int32Array,nde="e\0\0",dk=-1,rde=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],ide=["_approximateExtent"],pk,cy,op,sp,TA,lp,MA,ade=function(){function r(e,t){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var n,i=!1;sH(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(i=!0,n=e),n=n||["x","y"];for(var a={},o=[],s={},l=!1,u={},c=0;c=t)){var n=this._store,i=n.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=i.getSource().sourceFormat,l=s===za;if(l&&!i.pure)for(var u=[],c=e;c0},r.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,i=n[e];i||(i=n[e]={});var a=i[t];return a==null&&(a=this.getVisual(t),_e(a)?a=a.slice():ap(a)&&(a=pe({},a)),i[t]=a),a},r.prototype.setItemVisual=function(e,t,n){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,ap(t)?pe(i,t):i[t]=n},r.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},r.prototype.setLayout=function(e,t){ap(e)?pe(this._layout,e):this._layout[e]=t},r.prototype.getLayout=function(e){return this._layout[e]},r.prototype.getItemLayout=function(e){return this._itemLayouts[e]},r.prototype.setItemLayout=function(e,t,n){this._itemLayouts[e]=n?pe(this._itemLayouts[e]||{},t):t},r.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},r.prototype.setItemGraphicEl=function(e,t){var n=this.hostModel&&this.hostModel.seriesIndex;_T(n,this.dataType,e,t),this._graphicEls[e]=t},r.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},r.prototype.eachItemGraphicEl=function(e,t){k(this._graphicEls,function(n,i){n&&e&&e.call(t,n,i)})},r.prototype.cloneShallow=function(e){return e||(e=new r(this._schema?this._schema:el(this.dimensions,this._getDimInfo,this),this.hostModel)),TA(e,this),e._store=this._store,e},r.prototype.wrapMethod=function(e,t){var n=this[e];qe(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var i=n.apply(this,arguments);return t.apply(this,[i].concat(HC(arguments)))})},r.internalField=function(){pk=function(e){var t=e._invertedIndicesMap;k(t,function(n,i){var a=e._dimInfos[i],o=a.ordinalMeta,s=e._store;if(o){n=t[i]=new tde(o.categories.length);for(var l=0;l1&&(l+="__ec__"+c),i[t]=l}}}(),r}();const vi=ade;function Pg(r,e){T2(r)||(r=M2(r)),e=e||{};var t=e.coordDimensions||[],n=e.dimensionsDefine||r.dimensionsDefine||[],i=He(),a=[],o=sde(r,t,n,e.dimensionsCount),s=e.canOmitUnusedDimensions&&cH(o),l=n===r.dimensionsDefine,u=l?uH(r):lH(n),c=e.encodeDefine;!c&&e.encodeDefaulter&&(c=e.encodeDefaulter(r,o));for(var h=He(c),f=new mG(o),d=0;d0&&(n.name=i+(a-1)),a++,e.set(i,a)}}function sde(r,e,t,n){var i=Math.max(r.dimensionsDetectedCount||1,e.length,t.length,n||0);return k(e,function(a){var o;Qe(a)&&(o=a.dimsDef)&&(i=Math.max(i,o.length))}),i}function lde(r,e,t){if(t||e.hasKey(r)){for(var n=0;e.hasKey(r+n);)n++;r+=n}return e.set(r,!0),r}var ude=function(){function r(e){this.coordSysDims=[],this.axisMap=He(),this.categoryAxisMap=He(),this.coordSysName=e}return r}();function cde(r){var e=r.get("coordinateSystem"),t=new ude(e),n=hde[e];if(n)return n(r,t,t.axisMap,t.categoryAxisMap),t}var hde={cartesian2d:function(r,e,t,n){var i=r.getReferringComponents("xAxis",nr).models[0],a=r.getReferringComponents("yAxis",nr).models[0];e.coordSysDims=["x","y"],t.set("x",i),t.set("y",a),Gh(i)&&(n.set("x",i),e.firstCategoryDimIndex=0),Gh(a)&&(n.set("y",a),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(r,e,t,n){var i=r.getReferringComponents("singleAxis",nr).models[0];e.coordSysDims=["single"],t.set("single",i),Gh(i)&&(n.set("single",i),e.firstCategoryDimIndex=0)},polar:function(r,e,t,n){var i=r.getReferringComponents("polar",nr).models[0],a=i.findAxisModel("radiusAxis"),o=i.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],t.set("radius",a),t.set("angle",o),Gh(a)&&(n.set("radius",a),e.firstCategoryDimIndex=0),Gh(o)&&(n.set("angle",o),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(r,e,t,n){e.coordSysDims=["lng","lat"]},parallel:function(r,e,t,n){var i=r.ecModel,a=i.getComponent("parallel",r.get("parallelIndex")),o=e.coordSysDims=a.dimensions.slice();k(a.parallelAxisIndex,function(s,l){var u=i.getComponent("parallelAxis",s),c=o[l];t.set(c,u),Gh(u)&&(n.set(c,u),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})}};function Gh(r){return r.get("type")==="category"}function fde(r,e,t){t=t||{};var n=t.byIndex,i=t.stackedCoordDimension,a,o,s;dde(e)?a=e:(o=e.schema,a=o.dimensions,s=e.store);var l=!!(r&&r.get("stack")),u,c,h,f;if(k(a,function(y,_){ke(y)&&(a[_]=y={name:y}),l&&!y.isExtraCoord&&(!n&&!u&&y.ordinalMeta&&(u=y),!c&&y.type!=="ordinal"&&y.type!=="time"&&(!i||i===y.coordDim)&&(c=y))}),c&&!n&&!u&&(n=!0),c){h="__\0ecstackresult_"+r.id,f="__\0ecstackedover_"+r.id,u&&(u.createInvertedIndices=!0);var d=c.coordDim,p=c.type,g=0;k(a,function(y){y.coordDim===d&&g++});var v={name:h,coordDim:d,coordDimIndex:g,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},m={name:f,coordDim:f,coordDimIndex:g+1,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(v.storeDimIndex=s.ensureCalculationDimension(f,p),m.storeDimIndex=s.ensureCalculationDimension(h,p)),o.appendCalculationDimension(v),o.appendCalculationDimension(m)):(a.push(v),a.push(m))}return{stackedDimension:c&&c.name,stackedByDimension:u&&u.name,isStackedByIndex:n,stackedOverDimension:f,stackResultDimension:h}}function dde(r){return!sH(r.schema)}function Ql(r,e){return!!e&&e===r.getCalculationInfo("stackedDimension")}function hH(r,e){return Ql(r,e)?r.getCalculationInfo("stackResultDimension"):e}function pde(r,e){var t=r.get("coordinateSystem"),n=Eg.get(t),i;return e&&e.coordSysDims&&(i=xe(e.coordSysDims,function(a){var o={name:a},s=e.axisMap.get(a);if(s){var l=s.get("type");o.type=y_(l)}return o})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function vde(r,e,t){var n,i;return t&&k(r,function(a,o){var s=a.coordDim,l=t.categoryAxisMap.get(s);l&&(n==null&&(n=o),a.ordinalMeta=l.getOrdinalMeta(),e&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(i=!0)}),!i&&n!=null&&(r[n].otherDims.itemName=0),n}function Us(r,e,t){t=t||{};var n=e.getSourceManager(),i,a=!1;r?(a=!0,i=M2(r)):(i=n.getSource(),a=i.sourceFormat===za);var o=cde(e),s=pde(e,o),l=t.useEncodeDefaulter,u=qe(l)?l:l?ut(QV,s,e):null,c={coordDimensions:s,generateCoord:t.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},h=Pg(i,c),f=vde(h.dimensions,t.createInvertedIndices,o),d=a?null:n.getSharedDataStore(h),p=fde(e,{schema:h,store:d}),g=new vi(h,e);g.setCalculationInfo(p);var v=f!=null&&gde(i)?function(m,y,_,x){return x===f?_:this.defaultDimValueGetter(m,y,_,x)}:null;return g.hasItemOption=!1,g.initData(a?i:d,null,v),g}function gde(r){if(r.sourceFormat===za){var e=mde(r.data||[]);return!_e(gd(e))}}function mde(r){for(var e=0;et[1]&&(t[1]=e[1])},r.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=e),isNaN(t)||(n[1]=t)},r.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},r.prototype.isBlank=function(){return this._isBlank},r.prototype.setBlank=function(e){this._isBlank=e},r}();_1(fH);const Vs=fH;var yde=0,_de=function(){function r(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++yde}return r.createByAxisModel=function(e){var t=e.option,n=t.data,i=n&&xe(n,xde);return new r({categories:i,needCollect:!i,deduplication:t.dedplication!==!1})},r.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},r.prototype.parseAndCollect=function(e){var t,n=this._needCollect;if(!ke(e)&&!n)return e;if(n&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var i=this._getOrCreateMap();return t=i.get(e),t==null&&(n?(t=this.categories.length,this.categories[t]=e,i.set(e,t)):t=NaN),t},r.prototype._getOrCreateMap=function(){return this._map||(this._map=He(this.categories))},r}();function xde(r){return Qe(r)&&r.value!=null?r.value:r+""}const GT=_de;function HT(r){return r.type==="interval"||r.type==="log"}function Sde(r,e,t,n){var i={},a=r[1]-r[0],o=i.interval=b4(a/e,!0);t!=null&&on&&(o=i.interval=n);var s=i.intervalPrecision=dH(o),l=i.niceTickExtent=[Vn(Math.ceil(r[0]/o)*o,s),Vn(Math.floor(r[1]/o)*o,s)];return Ade(l,r),i}function CA(r){var e=Math.pow(10,QC(r)),t=r/e;return t?t===2?t=3:t===3?t=5:t*=2:t=1,Vn(t*e)}function dH(r){return Oo(r)+2}function vk(r,e,t){r[e]=Math.max(Math.min(r[e],t[1]),t[0])}function Ade(r,e){!isFinite(r[0])&&(r[0]=e[0]),!isFinite(r[1])&&(r[1]=e[1]),vk(r,0,e),vk(r,1,e),r[0]>r[1]&&(r[0]=r[1])}function G1(r,e){return r>=e[0]&&r<=e[1]}function H1(r,e){return e[1]===e[0]?.5:(r-e[0])/(e[1]-e[0])}function W1(r,e){return r*(e[1]-e[0])+e[0]}var pH=function(r){ae(e,r);function e(t){var n=r.call(this,t)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new GT({})),_e(i)&&(i=new GT({categories:xe(i,function(a){return Qe(a)?a.value:a})})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return e.prototype.parse=function(t){return t==null?NaN:ke(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},e.prototype.contain=function(t){return t=this.parse(t),G1(t,this._extent)&&this._ordinalMeta.categories[t]!=null},e.prototype.normalize=function(t){return t=this._getTickNumber(this.parse(t)),H1(t,this._extent)},e.prototype.scale=function(t){return t=Math.round(W1(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){for(var t=[],n=this._extent,i=n[0];i<=n[1];)t.push({value:i}),i++;return t},e.prototype.getMinorTicks=function(t){},e.prototype.setSortInfo=function(t){if(t==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var n=t.ordinalNumbers,i=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=Math.min(s,n.length);o=0&&t=0&&t=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(Vs);Vs.registerClass(pH);const B2=pH;var Fu=Vn,vH=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="interval",t._interval=0,t._intervalPrecision=2,t}return e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return G1(t,this._extent)},e.prototype.normalize=function(t){return H1(t,this._extent)},e.prototype.scale=function(t){return W1(t,this._extent)},e.prototype.setExtent=function(t,n){var i=this._extent;isNaN(t)||(i[0]=parseFloat(t)),isNaN(n)||(i[1]=parseFloat(n))},e.prototype.unionExtent=function(t){var n=this._extent;t[0]n[1]&&(n[1]=t[1]),this.setExtent(n[0],n[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=dH(t)},e.prototype.getTicks=function(t){var n=this._interval,i=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=[];if(!n)return s;var l=1e4;i[0]l)return[];var c=s.length?s[s.length-1].value:a[1];return i[1]>c&&(t?s.push({value:Fu(c+n,o)}):s.push({value:i[1]})),s},e.prototype.getMinorTicks=function(t){for(var n=this.getTicks(!0),i=[],a=this.getExtent(),o=1;oa[0]&&d0&&(a=a===null?s:Math.min(a,s))}t[n]=a}}return t}function yH(r){var e=Tde(r),t=[];return k(r,function(n){var i=n.coordinateSystem,a=i.getBaseAxis(),o=a.getExtent(),s;if(a.type==="category")s=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=e[l],c=Math.abs(o[1]-o[0]),h=a.scale.getExtent(),f=Math.abs(h[1]-h[0]);s=u?c/f*u:c}else{var d=n.getData();s=Math.abs(o[1]-o[0])/d.count()}var p=Pe(n.get("barWidth"),s),g=Pe(n.get("barMaxWidth"),s),v=Pe(n.get("barMinWidth")||(wH(n)?.5:1),s),m=n.get("barGap"),y=n.get("barCategoryGap");t.push({bandWidth:s,barWidth:p,barMaxWidth:g,barMinWidth:v,barGap:m,barCategoryGap:y,axisKey:U2(a),stackId:z2(n)})}),_H(t)}function _H(r){var e={};k(r,function(n,i){var a=n.axisKey,o=n.bandWidth,s=e[a]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=s.stacks;e[a]=s;var u=n.stackId;l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var c=n.barWidth;c&&!l[u].width&&(l[u].width=c,c=Math.min(s.remainedWidth,c),s.remainedWidth-=c);var h=n.barMaxWidth;h&&(l[u].maxWidth=h);var f=n.barMinWidth;f&&(l[u].minWidth=f);var d=n.barGap;d!=null&&(s.gap=d);var p=n.barCategoryGap;p!=null&&(s.categoryGap=p)});var t={};return k(e,function(n,i){t[i]={};var a=n.stacks,o=n.bandWidth,s=n.categoryGap;if(s==null){var l=wt(a).length;s=Math.max(35-l*4,15)+"%"}var u=Pe(s,o),c=Pe(n.gap,1),h=n.remainedWidth,f=n.autoWidthCount,d=(h-u)/(f+(f-1)*c);d=Math.max(d,0),k(a,function(m){var y=m.maxWidth,_=m.minWidth;if(m.width){var x=m.width;y&&(x=Math.min(x,y)),_&&(x=Math.max(x,_)),m.width=x,h-=x+c*x,f--}else{var x=d;y&&yx&&(x=_),x!==d&&(m.width=x,h-=x+c*x,f--)}}),d=(h-u)/(f+(f-1)*c),d=Math.max(d,0);var p=0,g;k(a,function(m,y){m.width||(m.width=d),g=m,p+=m.width*(1+c)}),g&&(p-=g.width*c);var v=-p/2;k(a,function(m,y){t[i][y]=t[i][y]||{bandWidth:o,offset:v,width:m.width},v+=m.width*(1+c)})}),t}function Mde(r,e,t){if(r&&e){var n=r[U2(e)];return n!=null&&t!=null?n[z2(t)]:n}}function xH(r,e){var t=mH(r,e),n=yH(t);k(t,function(i){var a=i.getData(),o=i.coordinateSystem,s=o.getBaseAxis(),l=z2(i),u=n[U2(s)][l],c=u.offset,h=u.width;a.setLayout({bandWidth:u.bandWidth,offset:c,size:h})})}function SH(r){return{seriesType:r,plan:Td(),reset:function(e){if(AH(e)){var t=e.getData(),n=e.coordinateSystem,i=n.getBaseAxis(),a=n.getOtherAxis(i),o=t.getDimensionIndex(t.mapDimension(a.dim)),s=t.getDimensionIndex(t.mapDimension(i.dim)),l=e.get("showBackground",!0),u=t.mapDimension(a.dim),c=t.getCalculationInfo("stackResultDimension"),h=Ql(t,u)&&!!t.getCalculationInfo("stackedOnSeries"),f=a.isHorizontal(),d=Cde(i,a),p=wH(e),g=e.get("barMinHeight")||0,v=c&&t.getDimensionIndex(c),m=t.getLayout("size"),y=t.getLayout("offset");return{progress:function(_,x){for(var S=_.count,A=p&&Bo(S*3),w=p&&l&&Bo(S*3),M=p&&Bo(S),C=n.master.getRect(),b=f?C.width:C.height,T,P=x.getStore(),D=0;(T=_.next())!=null;){var L=P.get(h?v:o,T),E=P.get(s,T),I=d,N=void 0;h&&(N=+L-P.get(o,T));var R=void 0,F=void 0,O=void 0,V=void 0;if(f){var H=n.dataToPoint([L,E]);if(h){var Q=n.dataToPoint([N,E]);I=Q[0]}R=I,F=H[1]+y,O=H[0]-I,V=m,Math.abs(O)0?t:1:t))}var Ede=function(r,e,t,n){for(;t>>1;r[i][1]i&&(this._approxInterval=i);var s=hy.length,l=Math.min(Ede(hy,this._approxInterval,0,s),s-1);this._interval=hy[l][1],this._minLevelUnit=hy[Math.max(l-1,0)][0]},e.prototype.parse=function(t){return Ft(t)?t:+qo(t)},e.prototype.contain=function(t){return G1(this.parse(t),this._extent)},e.prototype.normalize=function(t){return H1(this.parse(t),this._extent)},e.prototype.scale=function(t){return W1(t,this._extent)},e.type="time",e}(Jl),hy=[["second",y2],["minute",_2],["hour",sv],["quarter-day",sv*6],["half-day",sv*12],["day",Ca*1.2],["half-week",Ca*3.5],["week",Ca*7],["month",Ca*31],["quarter",Ca*95],["half-year",iN/2],["year",iN]];function Lde(r,e,t,n){var i=qo(e),a=qo(t),o=function(p){return oN(i,p,n)===oN(a,p,n)},s=function(){return o("year")},l=function(){return s()&&o("month")},u=function(){return l()&&o("day")},c=function(){return u()&&o("hour")},h=function(){return c()&&o("minute")},f=function(){return h()&&o("second")},d=function(){return f()&&o("millisecond")};switch(r){case"year":return s();case"month":return l();case"day":return u();case"hour":return c();case"minute":return h();case"second":return f();case"millisecond":return d()}}function Pde(r,e){return r/=Ca,r>16?16:r>7.5?7:r>3.5?4:r>1.5?2:1}function Rde(r){var e=30*Ca;return r/=e,r>6?6:r>3?3:r>2?2:1}function Dde(r){return r/=sv,r>12?12:r>6?6:r>3.5?4:r>2?2:1}function gk(r,e){return r/=e?_2:y2,r>30?30:r>20?20:r>15?15:r>10?10:r>5?5:r>2?2:1}function Ide(r){return b4(r,!0)}function Nde(r,e,t){var n=new Date(r);switch(Ef(e)){case"year":case"month":n[FV(t)](0);case"day":n[BV(t)](1);case"hour":n[zV(t)](0);case"minute":n[UV(t)](0);case"second":n[VV(t)](0),n[GV(t)](0)}return n.getTime()}function kde(r,e,t,n){var i=1e4,a=kV,o=0;function s(b,T,P,D,L,E,I){for(var N=new Date(T),R=T,F=N[D]();R1&&E===0&&P.unshift({value:P[0].value-R})}}for(var E=0;E=n[0]&&y<=n[1]&&h++)}var _=(n[1]-n[0])/e;if(h>_*1.5&&f>_/1.5||(u.push(v),h>_||r===a[d]))break}c=[]}}}for(var x=jt(xe(u,function(b){return jt(b,function(T){return T.value>=n[0]&&T.value<=n[1]&&!T.notAdd})}),function(b){return b.length>0}),S=[],A=x.length-1,d=0;d0;)a*=10;var s=[Vn(Bde(n[0]/a)*a),Vn(Fde(n[1]/a)*a)];this._interval=a,this._niceExtent=s}},e.prototype.calcNiceExtent=function(t){hv.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return t=$a(t)/$a(this.base),G1(t,this._extent)},e.prototype.normalize=function(t){return t=$a(t)/$a(this.base),H1(t,this._extent)},e.prototype.scale=function(t){return t=W1(t,this._extent),fy(this.base,t)},e.type="log",e}(Vs),MH=V2.prototype;MH.getMinorTicks=hv.getMinorTicks;MH.getLabel=hv.getLabel;function dy(r,e){return Ode(r,Oo(e))}Vs.registerClass(V2);const zde=V2;var Ude=function(){function r(e,t,n){this._prepareParams(e,t,n)}return r.prototype._prepareParams=function(e,t,n){n[1]0&&l>0&&!u&&(s=0),s<0&&l<0&&!c&&(l=0));var f=this._determinedMin,d=this._determinedMax;return f!=null&&(s=f,u=!0),d!=null&&(l=d,c=!0),{min:s,max:l,minFixed:u,maxFixed:c,isBlank:h}},r.prototype.modifyDataMinMax=function(e,t){this[Gde[e]]=t},r.prototype.setDeterminedMinMax=function(e,t){var n=Vde[e];this[n]=t},r.prototype.freeze=function(){this.frozen=!0},r}(),Vde={min:"_determinedMin",max:"_determinedMax"},Gde={min:"_dataMin",max:"_dataMax"};function CH(r,e,t){var n=r.rawExtentInfo;return n||(n=new Ude(r,e,t),r.rawExtentInfo=n,n)}function py(r,e){return e==null?null:Ov(e)?NaN:r.parse(e)}function EH(r,e){var t=r.type,n=CH(r,e,r.getExtent()).calculate();r.setBlank(n.isBlank);var i=n.min,a=n.max,o=e.ecModel;if(o&&t==="time"){var s=mH("bar",o),l=!1;if(k(s,function(h){l=l||h.getBaseAxis()===e.axis}),l){var u=yH(s),c=Hde(i,a,e,u);i=c.min,a=c.max}}return{extent:[i,a],fixMin:n.minFixed,fixMax:n.maxFixed}}function Hde(r,e,t,n){var i=t.axis.getExtent(),a=Math.abs(i[1]-i[0]),o=Mde(n,t.axis);if(o===void 0)return{min:r,max:e};var s=1/0;k(o,function(d){s=Math.min(d.offset,s)});var l=-1/0;k(o,function(d){l=Math.max(d.offset+d.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,c=e-r,h=1-(s+l)/a,f=c/h-c;return e+=f*(l/u),r-=f*(s/u),{min:r,max:e}}function td(r,e){var t=e,n=EH(r,t),i=n.extent,a=t.get("splitNumber");r instanceof zde&&(r.base=t.get("logBase"));var o=r.type,s=t.get("interval"),l=o==="interval"||o==="time";r.setExtent(i[0],i[1]),r.calcNiceExtent({splitNumber:a,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:l?t.get("minInterval"):null,maxInterval:l?t.get("maxInterval"):null}),s!=null&&r.setInterval&&r.setInterval(s)}function $1(r,e){if(e=e||r.get("type"),e)switch(e){case"category":return new B2({ordinalMeta:r.getOrdinalMeta?r.getOrdinalMeta():r.getCategories(),extent:[1/0,-1/0]});case"time":return new TH({locale:r.ecModel.getLocaleModel(),useUTC:r.ecModel.get("useUTC")});default:return new(Vs.getClass(e)||Jl)}}function Wde(r){var e=r.scale.getExtent(),t=e[0],n=e[1];return!(t>0&&n>0||t<0&&n<0)}function Ed(r){var e=r.getLabelModel().get("formatter"),t=r.type==="category"?r.scale.getExtent()[0]:null;return r.scale.type==="time"?function(n){return function(i,a){return r.scale.getFormattedLabel(i,a,n)}}(e):ke(e)?function(n){return function(i){var a=r.scale.getLabel(i),o=n.replace("{value}",a!=null?a:"");return o}}(e):qe(e)?function(n){return function(i,a){return t!=null&&(a=i.value-t),n(G2(r,i),a,i.level!=null?{level:i.level}:null)}}(e):function(n){return r.scale.getLabel(n)}}function G2(r,e){return r.type==="category"?r.scale.getLabel(e):e.value}function $de(r){var e=r.model,t=r.scale;if(!(!e.get(["axisLabel","show"])||t.isBlank())){var n,i,a=t.getExtent();t instanceof B2?i=t.count():(n=t.getTicks(),i=n.length);var o=r.getLabelModel(),s=Ed(r),l,u=1;i>40&&(u=Math.ceil(i/40));for(var c=0;cr[1]&&(r[1]=i[1])})}var Rg=function(){function r(){}return r.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},r.prototype.getCoordSysModel=function(){},r}(),qde=1e-8;function yk(r,e){return Math.abs(r-e)i&&(n=o,i=l)}if(n)return Kde(n.exterior);var u=this.getBoundingRect();return[u.x+u.width/2,u.y+u.height/2]},e.prototype.getBoundingRect=function(t){var n=this._rect;if(n&&!t)return n;var i=[1/0,1/0],a=[-1/0,-1/0],o=this.geometries;return k(o,function(s){s.type==="polygon"?_k(s.exterior,i,a,t):k(s.points,function(l){_k(l,i,a,t)})}),isFinite(i[0])&&isFinite(i[1])&&isFinite(a[0])&&isFinite(a[1])||(i[0]=i[1]=a[0]=a[1]=0),n=new dt(i[0],i[1],a[0]-i[0],a[1]-i[1]),t||(this._rect=n),n},e.prototype.contain=function(t){var n=this.getBoundingRect(),i=this.geometries;if(!n.contain(t[0],t[1]))return!1;e:for(var a=0,o=i.length;a>1^-(s&1),l=l>>1^-(l&1),s+=i,l+=a,i=s,a=l,n.push([s/t,l/t])}return n}function Jde(r,e){return r=Qde(r),xe(jt(r.features,function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0}),function(t){var n=t.properties,i=t.geometry,a=[];switch(i.type){case"Polygon":var o=i.coordinates;a.push(new xk(o[0],o.slice(1)));break;case"MultiPolygon":k(i.coordinates,function(l){l[0]&&a.push(new xk(l[0],l.slice(1)))});break;case"LineString":a.push(new Sk([i.coordinates]));break;case"MultiLineString":a.push(new Sk(i.coordinates))}var s=new RH(n[e||"name"],a,n.cp);return s.properties=n,s})}var Jv=Pt();function IH(r,e){var t=xe(e,function(n){return r.scale.parse(n)});return r.type==="time"&&t.length>0&&(t.sort(),t.unshift(t[0]),t.push(t[t.length-1])),t}function epe(r){var e=r.getLabelModel().get("customValues");if(e){var t=Ed(r),n=r.scale.getExtent(),i=IH(r,e),a=jt(i,function(o){return o>=n[0]&&o<=n[1]});return{labels:xe(a,function(o){var s={value:o};return{formattedLabel:t(s),rawLabel:r.scale.getLabel(s),tickValue:o}})}}return r.type==="category"?npe(r):ipe(r)}function tpe(r,e){var t=r.getTickModel().get("customValues");if(t){var n=r.scale.getExtent(),i=IH(r,t);return{ticks:jt(i,function(a){return a>=n[0]&&a<=n[1]})}}return r.type==="category"?rpe(r,e):{ticks:xe(r.scale.getTicks(),function(a){return a.value})}}function npe(r){var e=r.getLabelModel(),t=NH(r,e);return!e.get("show")||r.scale.isBlank()?{labels:[],labelCategoryInterval:t.labelCategoryInterval}:t}function NH(r,e){var t=kH(r,"labels"),n=H2(e),i=OH(t,n);if(i)return i;var a,o;return qe(n)?a=zH(r,n):(o=n==="auto"?ape(r):n,a=BH(r,o)),FH(t,n,{labels:a,labelCategoryInterval:o})}function rpe(r,e){var t=kH(r,"ticks"),n=H2(e),i=OH(t,n);if(i)return i;var a,o;if((!e.get("show")||r.scale.isBlank())&&(a=[]),qe(n))a=zH(r,n,!0);else if(n==="auto"){var s=NH(r,r.getLabelModel());o=s.labelCategoryInterval,a=xe(s.labels,function(l){return l.tickValue})}else o=n,a=BH(r,o,!0);return FH(t,n,{ticks:a,tickCategoryInterval:o})}function ipe(r){var e=r.scale.getTicks(),t=Ed(r);return{labels:xe(e,function(n,i){return{level:n.level,formattedLabel:t(n,i),rawLabel:r.scale.getLabel(n),tickValue:n.value}})}}function kH(r,e){return Jv(r)[e]||(Jv(r)[e]=[])}function OH(r,e){for(var t=0;t40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=r.dataToCoord(l+1)-r.dataToCoord(l),c=Math.abs(u*Math.cos(n)),h=Math.abs(u*Math.sin(n)),f=0,d=0;l<=a[1];l+=s){var p=0,g=0,v=wg(t({value:l}),e.font,"center","top");p=v.width*1.3,g=v.height*1.3,f=Math.max(f,p,7),d=Math.max(d,g,7)}var m=f/c,y=d/h;isNaN(m)&&(m=1/0),isNaN(y)&&(y=1/0);var _=Math.max(0,Math.floor(Math.min(m,y))),x=Jv(r.model),S=r.getExtent(),A=x.lastAutoInterval,w=x.lastTickCount;return A!=null&&w!=null&&Math.abs(A-_)<=1&&Math.abs(w-o)<=1&&A>_&&x.axisExtent0===S[0]&&x.axisExtent1===S[1]?_=A:(x.lastTickCount=o,x.lastAutoInterval=_,x.axisExtent0=S[0],x.axisExtent1=S[1]),_}function spe(r){var e=r.getLabelModel();return{axisRotate:r.getRotate?r.getRotate():r.isHorizontal&&!r.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function BH(r,e,t){var n=Ed(r),i=r.scale,a=i.getExtent(),o=r.getLabelModel(),s=[],l=Math.max((e||0)+1,1),u=a[0],c=i.count();u!==0&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));var h=LH(r),f=o.get("showMinLabel")||h,d=o.get("showMaxLabel")||h;f&&u!==a[0]&&g(a[0]);for(var p=u;p<=a[1];p+=l)g(p);d&&p-l!==a[1]&&g(a[1]);function g(v){var m={value:v};s.push(t?v:{formattedLabel:n(m),rawLabel:i.getLabel(m),tickValue:v})}return s}function zH(r,e,t){var n=r.scale,i=Ed(r),a=[];return k(n.getTicks(),function(o){var s=n.getLabel(o),l=o.value;e(o.value,s)&&a.push(t?l:{formattedLabel:i(o),rawLabel:s,tickValue:l})}),a}var Ak=[0,1],lpe=function(){function r(e,t,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=n||[0,0]}return r.prototype.contain=function(e){var t=this._extent,n=Math.min(t[0],t[1]),i=Math.max(t[0],t[1]);return e>=n&&e<=i},r.prototype.containData=function(e){return this.scale.contain(e)},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.getPixelPrecision=function(e){return A4(e||this.scale.getExtent(),this._extent)},r.prototype.setExtent=function(e,t){var n=this._extent;n[0]=e,n[1]=t},r.prototype.dataToCoord=function(e,t){var n=this._extent,i=this.scale;return e=i.normalize(e),this.onBand&&i.type==="ordinal"&&(n=n.slice(),wk(n,i.count())),Kt(e,Ak,n,t)},r.prototype.coordToData=function(e,t){var n=this._extent,i=this.scale;this.onBand&&i.type==="ordinal"&&(n=n.slice(),wk(n,i.count()));var a=Kt(e,n,Ak,t);return this.scale.scale(a)},r.prototype.pointToData=function(e,t){},r.prototype.getTicksCoords=function(e){e=e||{};var t=e.tickModel||this.getTickModel(),n=tpe(this,t),i=n.ticks,a=xe(i,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=t.get("alignWithLabel");return upe(this,a,o,e.clamp),a},r.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var e=this.model.getModel("minorTick"),t=e.get("splitNumber");t>0&&t<100||(t=5);var n=this.scale.getMinorTicks(t),i=xe(n,function(a){return xe(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return i},r.prototype.getViewLabels=function(){return epe(this).labels},r.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},r.prototype.getTickModel=function(){return this.model.getModel("axisTick")},r.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),n=t[1]-t[0]+(this.onBand?1:0);n===0&&(n=1);var i=Math.abs(e[1]-e[0]);return Math.abs(i)/n},r.prototype.calculateCategoryInterval=function(){return ope(this)},r}();function wk(r,e){var t=r[1]-r[0],n=e,i=t/n/2;r[0]+=i,r[1]-=i}function upe(r,e,t,n){var i=e.length;if(!r.onBand||t||!i)return;var a=r.getExtent(),o,s;if(i===1)e[0].coord=a[0],o=e[1]={coord:a[1],tickValue:e[0].tickValue};else{var l=e[i-1].tickValue-e[0].tickValue,u=(e[i-1].coord-e[0].coord)/l;k(e,function(d){d.coord-=u/2});var c=r.scale.getExtent();s=1+c[1]-e[i-1].tickValue,o={coord:e[i-1].coord+u*s,tickValue:c[1]+1},e.push(o)}var h=a[0]>a[1];f(e[0].coord,a[0])&&(n?e[0].coord=a[0]:e.shift()),n&&f(a[0],e[0].coord)&&e.unshift({coord:a[0]}),f(a[1],o.coord)&&(n?o.coord=a[1]:e.pop()),n&&f(o.coord,a[1])&&e.push({coord:a[1]});function f(d,p){return d=Vn(d),p=Vn(p),h?d>p:di&&(i+=up);var d=Math.atan2(s,o);if(d<0&&(d+=up),d>=n&&d<=i||d+up>=n&&d+up<=i)return l[0]=c,l[1]=h,u-t;var p=t*Math.cos(n)+r,g=t*Math.sin(n)+e,v=t*Math.cos(i)+r,m=t*Math.sin(i)+e,y=(p-o)*(p-o)+(g-s)*(g-s),_=(v-o)*(v-o)+(m-s)*(m-s);return y<_?(l[0]=p,l[1]=g,Math.sqrt(y)):(l[0]=v,l[1]=m,Math.sqrt(_))}function x_(r,e,t,n,i,a,o,s){var l=i-r,u=a-e,c=t-r,h=n-e,f=Math.sqrt(c*c+h*h);c/=f,h/=f;var d=l*c+u*h,p=d/f;s&&(p=Math.min(Math.max(p,0),1)),p*=f;var g=o[0]=r+p*c,v=o[1]=e+p*h;return Math.sqrt((g-i)*(g-i)+(v-a)*(v-a))}function UH(r,e,t,n,i,a,o){t<0&&(r=r+t,t=-t),n<0&&(e=e+n,n=-n);var s=r+t,l=e+n,u=o[0]=Math.min(Math.max(i,r),s),c=o[1]=Math.min(Math.max(a,e),l);return Math.sqrt((u-i)*(u-i)+(c-a)*(c-a))}var ja=[];function dpe(r,e,t){var n=UH(e.x,e.y,e.width,e.height,r.x,r.y,ja);return t.set(ja[0],ja[1]),n}function ppe(r,e,t){for(var n=0,i=0,a=0,o=0,s,l,u=1/0,c=e.data,h=r.x,f=r.y,d=0;d0){e=e/180*Math.PI,to.fromArray(r[0]),fn.fromArray(r[1]),Wn.fromArray(r[2]),ft.sub(zo,to,fn),ft.sub(No,Wn,fn);var t=zo.len(),n=No.len();if(!(t<.001||n<.001)){zo.scale(1/t),No.scale(1/n);var i=zo.dot(No),a=Math.cos(e);if(a1&&ft.copy(di,Wn),di.toArray(r[1])}}}}function vpe(r,e,t){if(t<=180&&t>0){t=t/180*Math.PI,to.fromArray(r[0]),fn.fromArray(r[1]),Wn.fromArray(r[2]),ft.sub(zo,fn,to),ft.sub(No,Wn,fn);var n=zo.len(),i=No.len();if(!(n<.001||i<.001)){zo.scale(1/n),No.scale(1/i);var a=zo.dot(e),o=Math.cos(t);if(a=l)ft.copy(di,Wn);else{di.scaleAndAdd(No,s/Math.tan(Math.PI/2-c));var h=Wn.x!==fn.x?(di.x-fn.x)/(Wn.x-fn.x):(di.y-fn.y)/(Wn.y-fn.y);if(isNaN(h))return;h<0?ft.copy(di,fn):h>1&&ft.copy(di,Wn)}di.toArray(r[1])}}}}function PA(r,e,t,n){var i=t==="normal",a=i?r:r.ensureState(t);a.ignore=e;var o=n.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=n.getModel("lineStyle").getLineStyle();i?r.useStyle(s):a.style=s}function gpe(r,e){var t=e.smooth,n=e.points;if(n)if(r.moveTo(n[0][0],n[0][1]),t>0&&n.length>=3){var i=bl(n[0],n[1]),a=bl(n[1],n[2]);if(!i||!a){r.lineTo(n[1][0],n[1][1]),r.lineTo(n[2][0],n[2][1]);return}var o=Math.min(i,a)*t,s=Jy([],n[1],n[0],o/i),l=Jy([],n[1],n[2],o/a),u=Jy([],s,l,.5);r.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),r.bezierCurveTo(l[0],l[1],l[0],l[1],n[2][0],n[2][1])}else for(var c=1;c0&&a&&S(-c/o,0,o);var g=r[0],v=r[o-1],m,y;_(),m<0&&A(-m,.8),y<0&&A(y,.8),_(),x(m,y,1),x(y,m,-1),_(),m<0&&w(-m),y<0&&w(y);function _(){m=g.rect[e]-n,y=i-v.rect[e]-v.rect[t]}function x(M,C,b){if(M<0){var T=Math.min(C,-M);if(T>0){S(T*b,0,o);var P=T+M;P<0&&A(-P*b,1)}else A(-M*b,1)}}function S(M,C,b){M!==0&&(u=!0);for(var T=C;T0)for(var P=0;P0;P--){var I=b[P-1]*E;S(-I,P,o)}}}function w(M){var C=M<0?-1:1;M=Math.abs(M);for(var b=Math.ceil(M/(o-1)),T=0;T0?S(b,0,T+1):S(-b,o-T-1,o),M-=b,M<=0)return}return u}function mpe(r,e,t,n){return HH(r,"x","width",e,t,n)}function WH(r,e,t,n){return HH(r,"y","height",e,t,n)}function $H(r){var e=[];r.sort(function(g,v){return v.priority-g.priority});var t=new dt(0,0,0,0);function n(g){if(!g.ignore){var v=g.ensureState("emphasis");v.ignore==null&&(v.ignore=!1)}g.ignore=!0}for(var i=0;i=0&&n.attr(a.oldLayoutSelect),pt(f,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),zt(n,u,t,l)}else if(n.attr(u),!_d(n).valueAnimation){var h=ot(n.style.opacity,1);n.style.opacity=0,Tn(n,{style:{opacity:h}},t,l)}if(a.oldLayout=u,n.states.select){var d=a.oldLayoutSelect={};vy(d,u,gy),vy(d,n.states.select,gy)}if(n.states.emphasis){var p=a.oldLayoutEmphasis={};vy(p,u,gy),vy(p,n.states.emphasis,gy)}PV(n,l,c,t,t)}if(i&&!i.ignore&&!i.invisible){var a=xpe(i),o=a.oldLayout,g={points:i.shape.points};o?(i.attr({shape:o}),zt(i,{shape:g},t)):(i.setShape(g),i.style.strokePercent=0,Tn(i,{style:{strokePercent:1}},t)),a.oldLayout=g}},r}();const Ape=Spe;var DA=Pt();function wpe(r){r.registerUpdateLifecycle("series:beforeupdate",function(e,t,n){var i=DA(t).labelManager;i||(i=DA(t).labelManager=new Ape),i.clearLabels()}),r.registerUpdateLifecycle("series:layoutlabels",function(e,t,n){var i=DA(t).labelManager;n.updatedSeries.forEach(function(a){i.addLabelsOfSeries(t.getViewOfSeriesModel(a))}),i.updateLayoutConfig(t),i.layout(t),i.processLabelsOverall()})}var IA=Math.sin,NA=Math.cos,XH=Math.PI,zu=Math.PI*2,bpe=180/XH,Tpe=function(){function r(){}return r.prototype.reset=function(e){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,e||4)},r.prototype.moveTo=function(e,t){this._add("M",e,t)},r.prototype.lineTo=function(e,t){this._add("L",e,t)},r.prototype.bezierCurveTo=function(e,t,n,i,a,o){this._add("C",e,t,n,i,a,o)},r.prototype.quadraticCurveTo=function(e,t,n,i){this._add("Q",e,t,n,i)},r.prototype.arc=function(e,t,n,i,a,o){this.ellipse(e,t,n,n,0,i,a,o)},r.prototype.ellipse=function(e,t,n,i,a,o,s,l){var u=s-o,c=!l,h=Math.abs(u),f=Ll(h-zu)||(c?u>=zu:-u>=zu),d=u>0?u%zu:u%zu+zu,p=!1;f?p=!0:Ll(h)?p=!1:p=d>=XH==!!c;var g=e+n*NA(o),v=t+i*IA(o);this._start&&this._add("M",g,v);var m=Math.round(a*bpe);if(f){var y=1/this._p,_=(c?1:-1)*(zu-y);this._add("A",n,i,m,1,+c,e+n*NA(o+_),t+i*IA(o+_)),y>.01&&this._add("A",n,i,m,0,+c,g,v)}else{var x=e+n*NA(s),S=t+i*IA(s);this._add("A",n,i,m,+p,+c,x,S)}},r.prototype.rect=function(e,t,n,i){this._add("M",e,t),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},r.prototype.closePath=function(){this._d.length>0&&this._add("Z")},r.prototype._add=function(e,t,n,i,a,o,s,l,u){for(var c=[],h=this._p,f=1;f"}function Npe(r){return""}function X2(r,e){e=e||{};var t=e.newline?` `:"";function n(i){var a=i.children,o=i.tag,s=i.attrs,l=i.text;return Ipe(o,s)+(o!=="style"?Jr(l):l||"")+(a?""+t+xe(a,function(u){return n(u)}).join(t)+t:"")+Npe(o)}return n(r)}function kpe(r,e,t){t=t||{};var n=t.newline?` `:"",i=" {"+n,a=n+"}",o=xe(wt(r),function(l){return l+i+xe(wt(r[l]),function(u){return u+":"+r[l][u]+";"}).join(n)+a}).join(n),s=xe(wt(e),function(l){return"@keyframes "+l+i+xe(wt(e[l]),function(u){return u+i+xe(wt(e[l][u]),function(c){var h=e[l][u][c];return c==="d"&&(h='path("'+h+'")'),c+":"+h+";"}).join(n)+a}).join(n)+a}).join(n);return!o&&!s?"":[""].join(n)}function XT(r){return{zrId:r,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function Ck(r,e,t,n){return gr("svg","root",{width:r,height:e,xmlns:qH,"xmlns:xlink":jH,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+r+" "+e:!1},t)}var Ope=0;function ZH(){return Ope++}var Ek={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},Wu="transform-origin";function Fpe(r,e,t){var n=pe({},r.shape);pe(n,e),r.buildPath(t,n);var i=new YH;return i.reset(h4(r)),t.rebuildPath(i,1),i.generateStr(),i.getStr()}function Bpe(r,e){var t=e.originX,n=e.originY;(t||n)&&(r[Wu]=t+"px "+n+"px")}var zpe={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function QH(r,e){var t=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[t]=r,t}function Upe(r,e,t){var n=r.shape.paths,i={},a,o;if(k(n,function(l){var u=XT(t.zrId);u.animation=!0,X1(l,{},u,!0);var c=u.cssAnims,h=u.cssNodes,f=wt(c),d=f.length;if(d){o=f[d-1];var p=c[o];for(var g in p){var v=p[g];i[g]=i[g]||{d:""},i[g].d+=v.d||""}for(var m in h){var y=h[m].animation;y.indexOf(o)>=0&&(a=y)}}}),!!a){e.d=!1;var s=QH(i,t);return a.replace(o,s)}}function Lk(r){return ke(r)?Ek[r]?"cubic-bezier("+Ek[r]+")":qC(r)?r:"":""}function X1(r,e,t,n){var i=r.animators,a=i.length,o=[];if(r instanceof f2){var s=Upe(r,e,t);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var he=QH(w,t);return he+" "+y[0]+" both"}}for(var v in l){var s=g(l[v]);s&&o.push(s)}if(o.length){var m=t.zrId+"-cls-"+ZH();t.cssNodes["."+m]={animation:o.join(",")},e.class=m}}function Vpe(r,e,t){if(!r.ignore)if(r.isSilent()){var n={"pointer-events":"none"};Pk(n,e,t,!0)}else{var i=r.states.emphasis&&r.states.emphasis.style?r.states.emphasis.style:{},a=i.fill;if(!a){var o=r.style&&r.style.fill,s=r.states.select&&r.states.select.style&&r.states.select.style.fill,l=r.currentStates.indexOf("select")>=0&&s||o;l&&(a=iT(l))}var u=i.lineWidth;if(u){var c=!i.strokeNoScale&&r.transform?r.transform[0]:1;u=u/c}var n={cursor:"pointer"};a&&(n.fill=a),i.stroke&&(n.stroke=i.stroke),u&&(n["stroke-width"]=u),Pk(n,e,t,!0)}}function Pk(r,e,t,n){var i=JSON.stringify(r),a=t.cssStyleCache[i];a||(a=t.zrId+"-cls-"+ZH(),t.cssStyleCache[i]=a,t.cssNodes["."+a+(n?":hover":"")]=r),e.class=e.class?e.class+" "+a:a}var eg=Math.round;function JH(r){return r&&ke(r.src)}function e8(r){return r&&qe(r.toDataURL)}function Y2(r,e,t,n){Ppe(function(i,a){var o=i==="fill"||i==="stroke";o&&c4(a)?n8(e,r,i,n):o&&jC(a)?r8(t,r,i,n):r[i]=a,o&&n.ssr&&a==="none"&&(r["pointer-events"]="visible")},e,t,!1),qpe(t,r,n)}function q2(r,e){var t=pse(e);t&&(t.each(function(n,i){n!=null&&(r[(Mk+i).toLowerCase()]=n+"")}),e.isSilent()&&(r[Mk+"silent"]="true"))}function Rk(r){return Ll(r[0]-1)&&Ll(r[1])&&Ll(r[2])&&Ll(r[3]-1)}function Gpe(r){return Ll(r[4])&&Ll(r[5])}function j2(r,e,t){if(e&&!(Gpe(e)&&Rk(e))){var n=t?10:1e4;r.transform=Rk(e)?"translate("+eg(e[4]*n)/n+" "+eg(e[5]*n)/n+")":Noe(e)}}function Dk(r,e,t){for(var n=r.points,i=[],a=0;aa?(p=t[l+1]==null?null:t[l+1].elm,o8(r,p,t,i,l)):A_(r,e,n,a))}function rf(r,e){var t=e.elm=r.elm,n=r.children,i=e.children;r!==e&&(K2(r,e),YT(e.text)?Lo(n)&&Lo(i)?n!==i&&Jpe(t,n,i):Lo(i)?(Lo(r.text)&&kA(t,""),o8(t,null,i,0,i.length-1)):Lo(n)?A_(t,n,0,n.length-1):Lo(r.text)&&kA(t,""):r.text!==e.text&&(Lo(n)&&A_(t,n,0,n.length-1),kA(t,e.text)))}function eve(r,e){if(Op(r,e))rf(r,e);else{var t=r.elm,n=i8(t);tg(e),n!==null&&(Qu(n,e.elm,a8(t)),A_(n,[r],0,0))}return e}var tve=0,nve=function(){function r(e,t,n){if(this.type="svg",this.refreshHover=zk(),this.configLayer=zk(),this.storage=t,this._opts=n=pe({},n),this.root=e,this._id="zr"+tve++,this._oldVNode=Ck(n.width,n.height),e&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=KH("svg");K2(null,this._oldVNode),i.appendChild(a),e.appendChild(i)}this.resize(n.width,n.height)}return r.prototype.getType=function(){return this.type},r.prototype.getViewportRoot=function(){return this._viewport},r.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},r.prototype.getSvgDom=function(){return this._svgDom},r.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",eve(this._oldVNode,e),this._oldVNode=e}},r.prototype.renderOneToVNode=function(e){return Nk(e,XT(this._id))},r.prototype.renderToVNode=function(e){e=e||{};var t=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=XT(this._id);a.animation=e.animation,a.willUpdate=e.willUpdate,a.compress=e.compress,a.emphasis=e.emphasis,a.ssr=this._opts.ssr;var o=[],s=this._bgVNode=rve(n,i,this._backgroundColor,a);s&&o.push(s);var l=e.compress?null:this._mainVNode=gr("g","main",{},[]);this._paintList(t,a,l?l.children:o),l&&o.push(l);var u=xe(wt(a.defs),function(f){return a.defs[f]});if(u.length&&o.push(gr("defs","defs",{},u)),e.animation){var c=kpe(a.cssNodes,a.cssAnims,{newline:!0});if(c){var h=gr("style","stl",{},[],c);o.push(h)}}return Ck(n,i,o,e.useViewBox)},r.prototype.renderToString=function(e){return e=e||{},X2(this.renderToVNode({animation:ot(e.cssAnimation,!0),emphasis:ot(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:ot(e.useViewBox,!0)}),{newline:!0})},r.prototype.setBackgroundColor=function(e){this._backgroundColor=e},r.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},r.prototype._paintList=function(e,t,n){for(var i=e.length,a=[],o=0,s,l,u=0,c=0;c=0&&!(f&&l&&f[g]===l[g]);g--);for(var v=p-1;v>g;v--)o--,s=a[o-1];for(var m=g+1;m=s)}}for(var h=this.__startIndex;h15)break}}L.prevElClipPaths&&m.restore()};if(y)if(y.length===0)M=v.__endIndex;else for(var b=d.dpr,T=0;T0&&e>i[0]){for(l=0;le);l++);s=n[i[l]]}if(i.splice(l+1,0,e),n[e]=t,!t.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(t.dom,u.nextSibling):o.appendChild(t.dom)}else o.firstChild?o.insertBefore(t.dom,o.firstChild):o.appendChild(t.dom);t.painter||(t.painter=this)}},r.prototype.eachLayer=function(e,t){for(var n=this._zlevelList,i=0;i0?my:0),this._needsManuallyCompositing),c.__builtin__||VC("ZLevel "+u+" has been used by unkown layer "+c.id),c!==a&&(c.__used=!0,c.__startIndex!==l&&(c.__dirty=!0),c.__startIndex=l,c.incremental?c.__drawIndex=-1:c.__drawIndex=l,t(l),a=c),i.__dirty&ji&&!i.__inHover&&(c.__dirty=!0,c.incremental&&c.__drawIndex<0&&(c.__drawIndex=l))}t(l),this.eachBuiltinLayer(function(h,f){!h.__used&&h.getElementCount()>0&&(h.__dirty=!0,h.__startIndex=h.__endIndex=h.__drawIndex=0),h.__dirty&&h.__drawIndex<0&&(h.__drawIndex=h.__startIndex)})},r.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},r.prototype._clearLayer=function(e){e.clear()},r.prototype.setBackgroundColor=function(e){this._backgroundColor=e,k(this._layers,function(t){t.setUnpainted()})},r.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?ht(n[e],t,!0):n[e]=t;for(var i=0;i-1&&(u.style.stroke=u.style.fill,u.style.fill="#fff",u.style.lineWidth=2),n},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(En);const pve=dve;function nd(r,e){var t=r.mapDimensionsAll("defaultedLabel"),n=t.length;if(n===1){var i=Jf(r,e,t[0]);return i!=null?i+"":null}else if(n){for(var a=[],o=0;o=0&&n.push(e[a])}return n.join(" ")}var vve=function(r){ae(e,r);function e(t,n,i,a){var o=r.call(this)||this;return o.updateData(t,n,i,a),o}return e.prototype._createSymbol=function(t,n,i,a,o){this.removeAll();var s=rr(t,-1,-1,2,2,null,o);s.attr({z2:100,culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),s.drift=gve,this._symbolType=t,this.add(s)},e.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){Ds(this.childAt(0))},e.prototype.downplay=function(){Is(this.childAt(0))},e.prototype.setZ=function(t,n){var i=this.childAt(0);i.zlevel=t,i.z=n},e.prototype.setDraggable=function(t,n){var i=this.childAt(0);i.draggable=t,i.cursor=!n&&t?"move":i.cursor},e.prototype.updateData=function(t,n,i,a){this.silent=!1;var o=t.getItemVisual(n,"symbol")||"circle",s=t.hostModel,l=e.getSymbolSize(t,n),u=o!==this._symbolType,c=a&&a.disableAnimation;if(u){var h=t.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,t,n,l,h)}else{var f=this.childAt(0);f.silent=!1;var d={scaleX:l[0]/2,scaleY:l[1]/2};c?f.attr(d):zt(f,d,s,n),lo(f)}if(this._updateCommon(t,n,l,i,a),u){var f=this.childAt(0);if(!c){var d={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:f.style.opacity}};f.scaleX=f.scaleY=0,f.style.opacity=0,Tn(f,d,s,n)}}c&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,n,i,a,o){var s=this.childAt(0),l=t.hostModel,u,c,h,f,d,p,g,v,m;if(a&&(u=a.emphasisItemStyle,c=a.blurItemStyle,h=a.selectItemStyle,f=a.focus,d=a.blurScope,g=a.labelStatesModels,v=a.hoverScale,m=a.cursorStyle,p=a.emphasisDisabled),!a||t.hasItemOption){var y=a&&a.itemModel?a.itemModel:t.getItemModel(n),_=y.getModel("emphasis");u=_.getModel("itemStyle").getItemStyle(),h=y.getModel(["select","itemStyle"]).getItemStyle(),c=y.getModel(["blur","itemStyle"]).getItemStyle(),f=_.get("focus"),d=_.get("blurScope"),p=_.get("disabled"),g=Sr(y),v=_.getShallow("scale"),m=y.getShallow("cursor")}var x=t.getItemVisual(n,"symbolRotate");s.attr("rotation",(x||0)*Math.PI/180||0);var S=Jc(t.getItemVisual(n,"symbolOffset"),i);S&&(s.x=S[0],s.y=S[1]),m&&s.attr("cursor",m);var A=t.getItemVisual(n,"style"),w=A.fill;if(s instanceof Ur){var M=s.style;s.useStyle(pe({image:M.image,x:M.x,y:M.y,width:M.width,height:M.height},A))}else s.__isEmptyBrush?s.useStyle(pe({},A)):s.useStyle(A),s.style.decal=null,s.setColor(w,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var C=t.getItemVisual(n,"liftZ"),b=this._z2;C!=null?b==null&&(this._z2=s.z2,s.z2+=C):b!=null&&(s.z2=b,this._z2=null);var T=o&&o.useNameLabel;zr(s,g,{labelFetcher:l,labelDataIndex:n,defaultText:P,inheritColor:w,defaultOpacity:A.opacity});function P(E){return T?t.getName(E):nd(t,E)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var D=s.ensureState("emphasis");D.style=u,s.ensureState("select").style=h,s.ensureState("blur").style=c;var L=v==null||v===!0?Math.max(1.1,3/this._sizeY):isFinite(v)&&v>0?+v:1;D.scaleX=this._sizeX*L,D.scaleY=this._sizeY*L,this.setSymbolScale(1),Rn(this,f,d,p)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,n,i){var a=this.childAt(0),o=at(this).dataIndex,s=i&&i.animation;if(this.silent=a.silent=!0,i&&i.fadeLabel){var l=a.getTextContent();l&&Kl(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();Kl(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:t,removeOpt:s})},e.getSymbolSize=function(t,n){return Cd(t.getItemVisual(n,"symbolSize"))},e}(rt);function gve(r,e){this.parent.drift(r,e)}const Dg=vve;function FA(r,e,t,n){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(n.isIgnore&&n.isIgnore(t))&&!(n.clipShape&&!n.clipShape.contain(e[0],e[1]))&&r.getItemVisual(t,"symbol")!=="none"}function Gk(r){return r!=null&&!Qe(r)&&(r={isIgnore:r}),r||{}}function Hk(r){var e=r.hostModel,t=e.getModel("emphasis");return{emphasisItemStyle:t.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:t.get("focus"),blurScope:t.get("blurScope"),emphasisDisabled:t.get("disabled"),hoverScale:t.get("scale"),labelStatesModels:Sr(e),cursorStyle:e.get("cursor")}}var mve=function(){function r(e){this.group=new rt,this._SymbolCtor=e||Dg}return r.prototype.updateData=function(e,t){this._progressiveEls=null,t=Gk(t);var n=this.group,i=e.hostModel,a=this._data,o=this._SymbolCtor,s=t.disableAnimation,l=Hk(e),u={disableAnimation:s},c=t.getSymbolPoint||function(h){return e.getItemLayout(h)};a||n.removeAll(),e.diff(a).add(function(h){var f=c(h);if(FA(e,f,h,t)){var d=new o(e,h,l,u);d.setPosition(f),e.setItemGraphicEl(h,d),n.add(d)}}).update(function(h,f){var d=a.getItemGraphicEl(f),p=c(h);if(!FA(e,p,h,t)){n.remove(d);return}var g=e.getItemVisual(h,"symbol")||"circle",v=d&&d.getSymbolType&&d.getSymbolType();if(!d||v&&v!==g)n.remove(d),d=new o(e,h,l,u),d.setPosition(p);else{d.updateData(e,h,l,u);var m={x:p[0],y:p[1]};s?d.attr(m):zt(d,m,i)}n.add(d),e.setItemGraphicEl(h,d)}).remove(function(h){var f=a.getItemGraphicEl(h);f&&f.fadeOut(function(){n.remove(f)},i)}).execute(),this._getSymbolPoint=c,this._data=e},r.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl(function(n,i){var a=e._getSymbolPoint(i);n.setPosition(a),n.markRedraw()})},r.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=Hk(e),this._data=null,this.group.removeAll()},r.prototype.incrementalUpdate=function(e,t,n){this._progressiveEls=[],n=Gk(n);function i(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=e.start;a0?t=n[0]:n[1]<0&&(t=n[1]),t}function u8(r,e,t,n){var i=NaN;r.stacked&&(i=t.get(t.getCalculationInfo("stackedOverDimension"),n)),isNaN(i)&&(i=r.valueStart);var a=r.baseDataOffset,o=[];return o[a]=t.get(r.baseDim,n),o[1-a]=i,e.dataToPoint(o)}function _ve(r,e){var t=[];return e.diff(r).add(function(n){t.push({cmd:"+",idx:n})}).update(function(n,i){t.push({cmd:"=",idx:i,idx1:n})}).remove(function(n){t.push({cmd:"-",idx:n})}).execute(),t}function xve(r,e,t,n,i,a,o,s){for(var l=_ve(r,e),u=[],c=[],h=[],f=[],d=[],p=[],g=[],v=l8(i,e,o),m=r.getLayout("points")||[],y=e.getLayout("points")||[],_=0;_=i||g<0)break;if(Rc(m,y)){if(l){g+=a;continue}break}if(g===t)r[a>0?"moveTo":"lineTo"](m,y),h=m,f=y;else{var _=m-u,x=y-c;if(_*_+x*x<.5){g+=a;continue}if(o>0){for(var S=g+a,A=e[S*2],w=e[S*2+1];A===m&&w===y&&v=n||Rc(A,w))d=m,p=y;else{b=A-u,T=w-c;var L=m-u,E=A-m,I=y-c,N=w-y,R=void 0,F=void 0;if(s==="x"){R=Math.abs(L),F=Math.abs(E);var O=b>0?1:-1;d=m-O*R*o,p=y,P=m+O*F*o,D=y}else if(s==="y"){R=Math.abs(I),F=Math.abs(N);var V=T>0?1:-1;d=m,p=y-V*R*o,P=m,D=y+V*F*o}else R=Math.sqrt(L*L+I*I),F=Math.sqrt(E*E+N*N),C=F/(F+R),d=m-b*o*(1-C),p=y-T*o*(1-C),P=m+b*o*C,D=y+T*o*C,P=tl(P,nl(A,m)),D=tl(D,nl(w,y)),P=nl(P,tl(A,m)),D=nl(D,tl(w,y)),b=P-m,T=D-y,d=m-b*R/F,p=y-T*R/F,d=tl(d,nl(u,m)),p=tl(p,nl(c,y)),d=nl(d,tl(u,m)),p=nl(p,tl(c,y)),b=m-d,T=y-p,P=m+b*F/R,D=y+T*F/R}r.bezierCurveTo(h,f,d,p,m,y),h=P,f=D}else r.lineTo(m,y)}u=m,c=y,g+=a}return v}var c8=function(){function r(){this.smooth=0,this.smoothConstraint=!0}return r}(),Sve=function(r){ae(e,r);function e(t){var n=r.call(this,t)||this;return n.type="ec-polyline",n}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new c8},e.prototype.buildPath=function(t,n){var i=n.points,a=0,o=i.length/2;if(n.connectNulls){for(;o>0&&Rc(i[o*2-2],i[o*2-1]);o--);for(;a=0){var x=u?(p-l)*_+l:(d-s)*_+s;return u?[t,x]:[x,t]}s=d,l=p;break;case o.C:d=a[h++],p=a[h++],g=a[h++],v=a[h++],m=a[h++],y=a[h++];var S=u?Z0(s,d,g,m,t,c):Z0(l,p,v,y,t,c);if(S>0)for(var A=0;A=0){var x=u?pr(l,p,v,y,w):pr(s,d,g,m,w);return u?[t,x]:[x,t]}}s=m,l=y;break}}},e}(yt),Ave=function(r){ae(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(c8),h8=function(r){ae(e,r);function e(t){var n=r.call(this,t)||this;return n.type="ec-polygon",n}return e.prototype.getDefaultShape=function(){return new Ave},e.prototype.buildPath=function(t,n){var i=n.points,a=n.stackedOnPoints,o=0,s=i.length/2,l=n.smoothMonotone;if(n.connectNulls){for(;s>0&&Rc(i[s*2-2],i[s*2-1]);s--);for(;oe){a?t.push(o(a,l,e)):i&&t.push(o(i,l,0),o(i,l,e));break}else i&&(t.push(o(i,l,0)),i=null),t.push(l),a=l}return t}function Tve(r,e,t){var n=r.getVisual("visualMeta");if(!(!n||!n.length||!r.count())&&e.type==="cartesian2d"){for(var i,a,o=n.length-1;o>=0;o--){var s=r.getDimensionInfo(n[o].dimension);if(i=s&&s.coordDim,i==="x"||i==="y"){a=n[o];break}}if(a){var l=e.getAxis(i),u=xe(a.stops,function(_){return{coord:l.toGlobalCoord(l.dataToCoord(_.value)),color:_.color}}),c=u.length,h=a.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),h.reverse());var f=bve(u,i==="x"?t.getWidth():t.getHeight()),d=f.length;if(!d&&c)return u[0].coord<0?h[1]?h[1]:u[c-1].color:h[0]?h[0]:u[0].color;var p=10,g=f[0].coord-p,v=f[d-1].coord+p,m=v-g;if(m<.001)return"transparent";k(f,function(_){_.offset=(_.coord-g)/m}),f.push({offset:d?f[d-1].offset:.5,color:h[1]||"transparent"}),f.unshift({offset:d?f[0].offset:.5,color:h[0]||"transparent"});var y=new Ul(0,0,0,0,f,!0);return y[i]=g,y[i+"2"]=v,y}}}function Mve(r,e,t){var n=r.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=t.getAxesByScale("ordinal")[0];if(a&&!(i&&Cve(a,e))){var o=e.mapDimension(a.dim),s={};return k(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function Cve(r,e){var t=r.getExtent(),n=Math.abs(t[1]-t[0])/r.scale.count();isNaN(n)&&(n=0);for(var i=e.count(),a=Math.max(1,Math.round(i/5)),o=0;on)return!1;return!0}function Eve(r,e){return isNaN(r)||isNaN(e)}function Lve(r){for(var e=r.length/2;e>0&&Eve(r[e*2-2],r[e*2-1]);e--);return e-1}function qk(r,e){return[r[e*2],r[e*2+1]]}function Pve(r,e,t){for(var n=r.length/2,i=t==="x"?0:1,a,o,s=0,l=-1,u=0;u=e||a>=e&&o<=e){l=u;break}s=u,a=o}return{range:[s,l],t:(e-a)/(o-a)}}function p8(r){if(r.get(["endLabel","show"]))return!0;for(var e=0;e0&&t.get(["emphasis","lineStyle","width"])==="bolder"){var F=p.getState("emphasis").style;F.lineWidth=+p.style.lineWidth+1}at(p).seriesIndex=t.seriesIndex,Rn(p,I,N,R);var O=Yk(t.get("smooth")),V=t.get("smoothMonotone");if(p.setShape({smooth:O,smoothMonotone:V,connectNulls:w}),g){var H=s.getCalculationInfo("stackedOnSeries"),Q=0;g.useStyle(Ke(u.getAreaStyle(),{fill:P,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),H&&(Q=Yk(H.get("smooth"))),g.setShape({smooth:O,stackedOnSmooth:Q,smoothMonotone:V,connectNulls:w}),Br(g,t,"areaStyle"),at(g).seriesIndex=t.seriesIndex,Rn(g,I,N,R)}var W=this._changePolyState;s.eachItemGraphicEl(function(Z){Z&&(Z.onHoverStateChange=W)}),this._polyline.onHoverStateChange=W,this._data=s,this._coordSys=a,this._stackedOnPoints=S,this._points=c,this._step=b,this._valueOrigin=_,t.get("triggerLineEvent")&&(this.packEventData(t,p),g&&this.packEventData(t,g))},e.prototype.packEventData=function(t,n){at(n).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,n,i,a){var o=t.getData(),s=Uc(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var c=l[s*2],h=l[s*2+1];if(isNaN(c)||isNaN(h)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,h))return;var f=t.get("zlevel")||0,d=t.get("z")||0;u=new Dg(o,s),u.x=c,u.y=h,u.setZ(f,d);var p=u.getSymbolPath().getTextContent();p&&(p.zlevel=f,p.z=d,p.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else gn.prototype.highlight.call(this,t,n,i,a)},e.prototype.downplay=function(t,n,i,a){var o=t.getData(),s=Uc(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else gn.prototype.downplay.call(this,t,n,i,a)},e.prototype._changePolyState=function(t){var n=this._polygon;i_(this._polyline,t),n&&i_(n,t)},e.prototype._newPolyline=function(t){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new Sve({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(n),this._polyline=n,n},e.prototype._newPolygon=function(t,n){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new h8({shape:{points:t,stackedOnPoints:n},segmentIgnoreThreshold:2}),this._lineGroup.add(i),this._polygon=i,i},e.prototype._initSymbolLabelAnimation=function(t,n,i){var a,o,s=n.getBaseAxis(),l=s.inverse;n.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):n.type==="polar"&&(a=s.dim==="angle",o=!0);var u=t.hostModel,c=u.get("animationDuration");qe(c)&&(c=c(null));var h=u.get("animationDelay")||0,f=qe(h)?h(null):h;t.eachItemGraphicEl(function(d,p){var g=d;if(g){var v=[d.x,d.y],m=void 0,y=void 0,_=void 0;if(i)if(o){var x=i,S=n.pointToCoord(v);a?(m=x.startAngle,y=x.endAngle,_=-S[1]/180*Math.PI):(m=x.r0,y=x.r,_=S[0])}else{var A=i;a?(m=A.x,y=A.x+A.width,_=d.x):(m=A.y+A.height,y=A.y,_=d.y)}var w=y===m?0:(_-m)/(y-m);l&&(w=1-w);var M=qe(h)?h(p):c*w+f,C=g.getSymbolPath(),b=C.getTextContent();g.attr({scaleX:0,scaleY:0}),g.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:M}),b&&b.animateFrom({style:{opacity:0}},{duration:300,delay:M}),C.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(t,n,i){var a=t.getModel("endLabel");if(p8(t)){var o=t.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new Ot({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var c=Lve(l);c>=0&&(zr(s,Sr(t,"endLabel"),{inheritColor:i,labelFetcher:t,labelDataIndex:c,defaultText:function(h,f,d){return d!=null?s8(o,d):nd(o,h)},enableTextSetter:!0},Rve(a,n)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,n,i,a,o,s,l){var u=this._endLabel,c=this._polyline;if(u){t<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var h=i.getLayout("points"),f=i.hostModel,d=f.get("connectNulls"),p=s.get("precision"),g=s.get("distance")||0,v=l.getBaseAxis(),m=v.isHorizontal(),y=v.inverse,_=n.shape,x=y?m?_.x:_.y+_.height:m?_.x+_.width:_.y,S=(m?g:0)*(y?-1:1),A=(m?0:-g)*(y?-1:1),w=m?"x":"y",M=Pve(h,x,w),C=M.range,b=C[1]-C[0],T=void 0;if(b>=1){if(b>1&&!d){var P=qk(h,C[0]);u.attr({x:P[0]+S,y:P[1]+A}),o&&(T=f.getRawValue(C[0]))}else{var P=c.getPointOn(x,w);P&&u.attr({x:P[0]+S,y:P[1]+A});var D=f.getRawValue(C[0]),L=f.getRawValue(C[1]);o&&(T=I4(i,p,D,L,M.t))}a.lastFrameIndex=C[0]}else{var E=t===1||a.lastFrameIndex>0?C[0]:0,P=qk(h,E);o&&(T=f.getRawValue(E)),u.attr({x:P[0]+S,y:P[1]+A})}if(o){var I=_d(u);typeof I.setLabelText=="function"&&I.setLabelText(T)}}},e.prototype._doUpdateAnimation=function(t,n,i,a,o,s,l){var u=this._polyline,c=this._polygon,h=t.hostModel,f=xve(this._data,t,this._stackedOnPoints,n,this._coordSys,i,this._valueOrigin),d=f.current,p=f.stackedOnCurrent,g=f.next,v=f.stackedOnNext;if(o&&(p=rl(f.stackedOnCurrent,f.current,i,o,l),d=rl(f.current,null,i,o,l),v=rl(f.stackedOnNext,f.next,i,o,l),g=rl(f.next,null,i,o,l)),Xk(d,g)>3e3||c&&Xk(p,v)>3e3){u.stopAnimation(),u.setShape({points:g}),c&&(c.stopAnimation(),c.setShape({points:g,stackedOnPoints:v}));return}u.shape.__points=f.current,u.shape.points=d;var m={shape:{points:g}};f.current!==d&&(m.shape.__points=f.next),u.stopAnimation(),zt(u,m,h),c&&(c.setShape({points:d,stackedOnPoints:p}),c.stopAnimation(),zt(c,{shape:{stackedOnPoints:v}},h),u.shape.points!==c.shape.points&&(c.shape.points=u.shape.points));for(var y=[],_=f.status,x=0;x<_.length;x++){var S=_[x].cmd;if(S==="="){var A=t.getItemGraphicEl(_[x].idx1);A&&y.push({el:A,ptIdx:x})}}u.animators&&u.animators.length&&u.animators[0].during(function(){c&&c.dirtyShape();for(var w=u.shape.__points,M=0;Me&&(e=r[t]);return isFinite(e)?e:NaN},min:function(r){for(var e=1/0,t=0;t10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),c=l.getExtent(),h=n.getDevicePixelRatio(),f=Math.abs(c[1]-c[0])*(h||1),d=Math.round(s/f);if(isFinite(d)&&d>1){a==="lttb"?e.setData(i.lttbDownSample(i.mapDimension(u.dim),1/d)):a==="minmax"&&e.setData(i.minmaxDownSample(i.mapDimension(u.dim),1/d));var p=void 0;ke(a)?p=Nve[a]:qe(a)&&(p=a),p&&e.setData(i.downSample(i.mapDimension(u.dim),1/d,p,kve))}}}}}function Ove(r){r.registerChartView(Ive),r.registerSeriesModel(pve),r.registerLayout(kg("line",!0)),r.registerVisual({seriesType:"line",reset:function(e){var t=e.getData(),n=e.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=t.getVisual("style").fill),t.setVisual("legendLineStyle",n)}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,v8("line"))}var g8=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,n){return Us(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t,n,i){var a=this.coordinateSystem;if(a&&a.clampData){var o=a.clampData(t),s=a.dataToPoint(o);if(i)k(a.getAxes(),function(f,d){if(f.type==="category"&&n!=null){var p=f.getTicksCoords(),g=f.getTickModel().get("alignWithLabel"),v=o[d],m=n[d]==="x1"||n[d]==="y1";if(m&&!g&&(v+=1),p.length<2)return;if(p.length===2){s[d]=f.toGlobalCoord(f.getExtent()[m?1:0]);return}for(var y=void 0,_=void 0,x=1,S=0;Sv){_=(A+y)/2;break}S===1&&(x=w-p[0].tickValue)}_==null&&(y?y&&(_=p[p.length-1].coord):_=p[0].coord),s[d]=f.toGlobalCoord(_)}});else{var l=this.getData(),u=l.getLayout("offset"),c=l.getLayout("size"),h=a.getBaseAxis().isHorizontal()?0:1;s[h]+=u+c/2}return s}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}(En);En.registerClass(g8);const w_=g8;var Fve=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(){return Us(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},e.prototype.getProgressiveThreshold=function(){var t=this.get("progressiveThreshold"),n=this.get("largeThreshold");return n>t&&(t=n),t},e.prototype.brushSelector=function(t,n,i){return i.rect(n.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=su(w_.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e}(w_);const Bve=Fve;var zve=function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return r}(),Uve=function(r){ae(e,r);function e(t){var n=r.call(this,t)||this;return n.type="sausage",n}return e.prototype.getDefaultShape=function(){return new zve},e.prototype.buildPath=function(t,n){var i=n.cx,a=n.cy,o=Math.max(n.r0||0,0),s=Math.max(n.r,0),l=(s-o)*.5,u=o+l,c=n.startAngle,h=n.endAngle,f=n.clockwise,d=Math.PI*2,p=f?h-cMath.PI/2&&cs)return!0;s=h}return!1},e.prototype._isOrderDifferentInView=function(t,n){for(var i=n.scale,a=i.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],i.getOrdinalMeta().categories.length-1);o<=s;++o)if(t.ordinalNumbers[o]!==i.getRawOrdinalNumber(o))return!0},e.prototype._updateSortWithinSameData=function(t,n,i,a){if(this._isOrderChangedWithinSameData(t,n,i)){var o=this._dataSort(t,i,n);this._isOrderDifferentInView(o,i)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:o}))}},e.prototype._dispatchInitSort=function(t,n,i){var a=n.baseAxis,o=this._dataSort(t,a,function(s){return t.get(t.mapDimension(n.otherAxis.dim),s)});i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},e.prototype.remove=function(t,n){this._clear(this._model),this._removeOnRenderedListener(n)},e.prototype.dispose=function(t,n){this._removeOnRenderedListener(n)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var n=this.group,i=this._data;t&&t.isAnimationEnabled()&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl(function(a){Xv(a,t,at(a).dataIndex)})):n.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(gn),jk={cartesian2d:function(r,e){var t=e.width<0?-1:1,n=e.height<0?-1:1;t<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height);var i=r.x+r.width,a=r.y+r.height,o=zA(e.x,r.x),s=UA(e.x+e.width,i),l=zA(e.y,r.y),u=UA(e.y+e.height,a),c=si?s:o,e.y=h&&l>a?u:l,e.width=c?0:s-o,e.height=h?0:u-l,t<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height),c||h},polar:function(r,e){var t=e.r0<=e.r?1:-1;if(t<0){var n=e.r;e.r=e.r0,e.r0=n}var i=UA(e.r,r.r),a=zA(e.r0,r.r0);e.r=i,e.r0=a;var o=i-a<0;if(t<0){var n=e.r;e.r=e.r0,e.r0=n}return o}},Kk={cartesian2d:function(r,e,t,n,i,a,o,s,l){var u=new Dt({shape:pe({},n),z2:1});if(u.__dataIndex=t,u.name="item",a){var c=u.shape,h=i?"height":"width";c[h]=0}return u},polar:function(r,e,t,n,i,a,o,s,l){var u=!i&&l?b_:Bi,c=new u({shape:n,z2:1});c.name="item";var h=m8(i);if(c.calculateTextPosition=Vve(h,{isRoundCap:u===b_}),a){var f=c.shape,d=i?"r":"endAngle",p={};f[d]=i?n.r0:n.startAngle,p[d]=n[d],(s?zt:Tn)(c,{shape:p},a)}return c}};function $ve(r,e){var t=r.get("realtimeSort",!0),n=e.getBaseAxis();if(t&&n.type==="category"&&e.type==="cartesian2d")return{baseAxis:n,otherAxis:e.getOtherAxis(n)}}function Zk(r,e,t,n,i,a,o,s){var l,u;a?(u={x:n.x,width:n.width},l={y:n.y,height:n.height}):(u={y:n.y,height:n.height},l={x:n.x,width:n.width}),s||(o?zt:Tn)(t,{shape:l},e,i,null);var c=e?r.baseAxis.model:null;(o?zt:Tn)(t,{shape:u},c,i)}function Qk(r,e){for(var t=0;t0?1:-1,o=n.height>0?1:-1;return{x:n.x+a*i/2,y:n.y+o*i/2,width:n.width-a*i,height:n.height-o*i}},polar:function(r,e,t){var n=r.getItemLayout(e);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}}};function qve(r){return r.startAngle!=null&&r.endAngle!=null&&r.startAngle===r.endAngle}function m8(r){return function(e){var t=e?"Arc":"Angle";return function(n){switch(n){case"start":case"insideStart":case"end":case"insideEnd":return n+t;default:return n}}}(r)}function e3(r,e,t,n,i,a,o,s){var l=e.getItemVisual(t,"style");if(s){if(!a.get("roundCap")){var c=r.shape,h=hc(n.getModel("itemStyle"),c,!0);pe(c,h),r.setShape(c)}}else{var u=n.get(["itemStyle","borderRadius"])||0;r.setShape("r",u)}r.useStyle(l);var f=n.getShallow("cursor");f&&r.attr("cursor",f);var d=s?o?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":o?i.height>=0?"bottom":"top":i.width>=0?"right":"left",p=Sr(n);zr(r,p,{labelFetcher:a,labelDataIndex:t,defaultText:nd(a.getData(),t),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var g=r.getTextContent();if(s&&g){var v=n.get(["label","position"]);r.textConfig.inside=v==="middle"?!0:null,Gve(r,v==="outside"?d:v,m8(o),n.get(["label","rotate"]))}LV(g,p,a.getRawValue(t),function(y){return s8(e,y)});var m=n.getModel(["emphasis"]);Rn(r,m.get("focus"),m.get("blurScope"),m.get("disabled")),Br(r,n),qve(i)&&(r.style.fill="none",r.style.stroke="none",k(r.states,function(y){y.style&&(y.style.fill=y.style.stroke="none")}))}function jve(r,e){var t=r.get(["itemStyle","borderColor"]);if(!t||t==="none")return 0;var n=r.get(["itemStyle","borderWidth"])||0,i=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),a=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(n,i,a)}var Kve=function(){function r(){}return r}(),t3=function(r){ae(e,r);function e(t){var n=r.call(this,t)||this;return n.type="largeBar",n}return e.prototype.getDefaultShape=function(){return new Kve},e.prototype.buildPath=function(t,n){for(var i=n.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,c=0;c=0?t:null},30,!1);function Zve(r,e,t){for(var n=r.baseDimIdx,i=1-n,a=r.shape.points,o=r.largeDataIndices,s=[],l=[],u=r.barWidth,c=0,h=a.length/3;c=s[0]&&e<=s[0]+l[0]&&t>=s[1]&&t<=s[1]+l[1])return o[c]}return-1}function y8(r,e,t){if(th(t,"cartesian2d")){var n=e,i=t.getArea();return{x:r?n.x:i.x,y:r?i.y:n.y,width:r?n.width:i.width,height:r?i.height:n.height}}else{var i=t.getArea(),a=e;return{cx:i.cx,cy:i.cy,r0:r?i.r0:a.r0,r:r?i.r:a.r,startAngle:r?a.startAngle:0,endAngle:r?a.endAngle:Math.PI*2}}}function Qve(r,e,t){var n=r.type==="polar"?Bi:Dt;return new n({shape:y8(e,t,r),silent:!0,z2:0})}const Jve=Wve;function ege(r){r.registerChartView(Jve),r.registerSeriesModel(Bve),r.registerLayout(r.PRIORITY.VISUAL.LAYOUT,ut(xH,"bar")),r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,SH("bar")),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,v8("bar")),r.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,t){var n=e.componentType||"series";t.eachComponent({mainType:n,query:e},function(i){e.sortInfo&&i.axis.setCategorySortInfo(e.sortInfo)})})}var i3=Math.PI*2,Sy=Math.PI/180;function _8(r,e){return dr(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function x8(r,e){var t=_8(r,e),n=r.get("center"),i=r.get("radius");_e(i)||(i=[0,i]);var a=Pe(t.width,e.getWidth()),o=Pe(t.height,e.getHeight()),s=Math.min(a,o),l=Pe(i[0],s/2),u=Pe(i[1],s/2),c,h,f=r.coordinateSystem;if(f){var d=f.dataToPoint(n);c=d[0]||0,h=d[1]||0}else _e(n)||(n=[n,n]),c=Pe(n[0],a)+t.x,h=Pe(n[1],o)+t.y;return{cx:c,cy:h,r0:l,r:u}}function tge(r,e,t){e.eachSeriesByType(r,function(n){var i=n.getData(),a=i.mapDimension("value"),o=_8(n,t),s=x8(n,t),l=s.cx,u=s.cy,c=s.r,h=s.r0,f=-n.get("startAngle")*Sy,d=n.get("endAngle"),p=n.get("padAngle")*Sy;d=d==="auto"?f-i3:-d*Sy;var g=n.get("minAngle")*Sy,v=g+p,m=0;i.each(a,function(N){!isNaN(N)&&m++});var y=i.getSum(a),_=Math.PI/(y||m)*2,x=n.get("clockwise"),S=n.get("roseType"),A=n.get("stillShowZeroSum"),w=i.getDataExtent(a);w[0]=0;var M=x?1:-1,C=[f,d],b=M*p/2;r2(C,!x),f=C[0],d=C[1];var T=S8(n);T.startAngle=f,T.endAngle=d,T.clockwise=x;var P=Math.abs(d-f),D=P,L=0,E=f;if(i.setLayout({viewRect:o,r:c}),i.each(a,function(N,R){var F;if(isNaN(N)){i.setItemLayout(R,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:x,cx:l,cy:u,r0:h,r:S?NaN:c});return}S!=="area"?F=y===0&&A?_:N*_:F=P/m,FF?(V=E+M*F/2,H=V):(V=E+b,H=O-b),i.setItemLayout(R,{angle:F,startAngle:V,endAngle:H,clockwise:x,cx:l,cy:u,r0:h,r:S?Kt(N,w,[h,c]):c}),E=O}),Dt?m:v,S=Math.abs(_.label.y-t);if(S>=x.maxY){var A=_.label.x-e-_.len2*i,w=n+_.len,M=Math.abs(A)r.unconstrainedWidth?null:d:null;n.setStyle("width",p)}var g=n.getBoundingRect();a.width=g.width;var v=(n.style.margin||0)+2.1;a.height=g.height+v,a.y-=(a.height-h)/2}}}function VA(r){return r.position==="center"}function ige(r){var e=r.getData(),t=[],n,i,a=!1,o=(r.get("minShowLabelAngle")||0)*nge,s=e.getLayout("viewRect"),l=e.getLayout("r"),u=s.width,c=s.x,h=s.y,f=s.height;function d(A){A.ignore=!0}function p(A){if(!A.ignore)return!0;for(var w in A.states)if(A.states[w].ignore===!1)return!0;return!1}e.each(function(A){var w=e.getItemGraphicEl(A),M=w.shape,C=w.getTextContent(),b=w.getTextGuideLine(),T=e.getItemModel(A),P=T.getModel("label"),D=P.get("position")||T.get(["emphasis","label","position"]),L=P.get("distanceToLabelLine"),E=P.get("alignTo"),I=Pe(P.get("edgeDistance"),u),N=P.get("bleedMargin"),R=T.getModel("labelLine"),F=R.get("length");F=Pe(F,u);var O=R.get("length2");if(O=Pe(O,u),Math.abs(M.endAngle-M.startAngle)0?"right":"left":H>0?"left":"right"}var ce=Math.PI,se=0,Ne=P.get("rotate");if(Ft(Ne))se=Ne*(ce/180);else if(D==="center")se=0;else if(Ne==="radial"||Ne===!0){var Oe=H<0?-V+ce:-V;se=Oe}else if(Ne==="tangential"&&D!=="outside"&&D!=="outer"){var B=Math.atan2(H,Q);B<0&&(B=ce*2+B);var z=Q>0;z&&(B=ce+B),se=B-ce}if(a=!!se,C.x=W,C.y=Z,C.rotation=se,C.setStyle({verticalAlign:"middle"}),le){C.setStyle({align:he});var Ae=C.states.select;Ae&&(Ae.x+=C.x,Ae.y+=C.y)}else{var ne=C.getBoundingRect().clone();ne.applyTransform(C.getComputedTransform());var ve=(C.style.margin||0)+2.1;ne.y-=ve/2,ne.height+=ve,t.push({label:C,labelLine:b,position:D,len:F,len2:O,minTurnAngle:R.get("minTurnAngle"),maxSurfaceAngle:R.get("maxSurfaceAngle"),surfaceNormal:new ft(H,Q),linePoints:ee,textAlign:he,labelDistance:L,labelAlignTo:E,edgeDistance:I,bleedMargin:N,rect:ne,unconstrainedWidth:ne.width,labelStyleWidth:C.style.width})}w.setTextConfig({inside:le})}}),!a&&r.get("avoidLabelOverlap")&&rge(t,n,i,l,u,f,c,h);for(var g=0;g0){for(var c=o.getItemLayout(0),h=1;isNaN(c&&c.startAngle)&&h=a.r0}},e.type="pie",e}(gn);const sge=oge;function Ld(r,e,t){e=_e(e)&&{coordDimensions:e}||pe({encodeDefine:r.getEncode()},e);var n=r.getSource(),i=Pg(n,e).dimensions,a=new vi(i,r);return a.initData(n,t),a}var lge=function(){function r(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return r.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},r.prototype.containName=function(e){var t=this._getRawData();return t.indexOfName(e)>=0},r.prototype.indexOfName=function(e){var t=this._getDataWithEncodedVisual();return t.indexOfName(e)},r.prototype.getItemVisual=function(e,t){var n=this._getDataWithEncodedVisual();return n.getItemVisual(e,t)},r}();const Fg=lge;var uge=Pt(),cge=function(r){ae(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new Fg(Fe(this.getData,this),Fe(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.mergeOption=function(){r.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return Ld(this,{coordDimensions:["value"],encodeDefaulter:ut(A2,this)})},e.prototype.getDataParams=function(t){var n=this.getData(),i=uge(n),a=i.seats;if(!a){var o=[];n.each(n.mapDimension("value"),function(l){o.push(l)}),a=i.seats=yse(o,n.hostModel.get("percentPrecision"))}var s=r.prototype.getDataParams.call(this,t);return s.percent=a[t]||0,s.$vars.push("percent"),s},e.prototype._defaultLabelLine=function(t){zc(t,"labelLine",["show"]);var n=t.labelLine,i=t.emphasis.labelLine;n.show=n.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(En);const hge=cge;function fge(r){return{seriesType:r,reset:function(e,t){var n=e.getData();n.filterSelf(function(i){var a=n.mapDimension("value"),o=n.get(a,i);return!(Ft(o)&&!isNaN(o)&&o<0)})}}}function dge(r){r.registerChartView(sge),r.registerSeriesModel(hge),FG("pie",r.registerAction),r.registerLayout(ut(tge,"pie")),r.registerProcessor(Og("pie")),r.registerProcessor(fge("pie"))}var pge=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.getInitialData=function(t,n){return Us(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return t==null?this.option.large?5e3:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return t==null?this.option.large?1e4:this.get("progressiveThreshold"):t},e.prototype.brushSelector=function(t,n,i){return i.point(n.getItemLayout(t))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}(En);const vge=pge;var w8=4,gge=function(){function r(){}return r}(),mge=function(r){ae(e,r);function e(t){var n=r.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return e.prototype.getDefaultShape=function(){return new gge},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(t,n){var i=n.points,a=n.size,o=this.symbolProxy,s=o.shape,l=t.getContext?t.getContext():t,u=l&&a[0]=0;u--){var c=u*2,h=a[c]-s/2,f=a[c+1]-l/2;if(t>=h&&n>=f&&t<=h+s&&n<=f+l)return u}return-1},e.prototype.contain=function(t,n){var i=this.transformCoordToLocal(t,n),a=this.getBoundingRect();if(t=i[0],n=i[1],a.contain(t,n)){var o=this.hoverDataIdx=this.findDataIndex(t,n);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var n=this.shape,i=n.points,a=n.size,o=a[0],s=a[1],l=1/0,u=1/0,c=-1/0,h=-1/0,f=0;f=0&&(u.dataIndex=h+(e.startIndex||0))})},r.prototype.remove=function(){this._clear()},r.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},r}();const _ge=yge;var xge=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a=t.getData(),o=this._updateSymbolDraw(a,t);o.updateData(a,{clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,n,i){var a=t.getData(),o=this._updateSymbolDraw(a,t);o.incrementalPrepareUpdate(a),this._finished=!1},e.prototype.incrementalRender=function(t,n,i){this._symbolDraw.incrementalUpdate(t,n.getData(),{clipShape:this._getClipShape(n)}),this._finished=t.end===n.getData().count()},e.prototype.updateTransform=function(t,n,i){var a=t.getData();if(this.group.dirty(),!this._finished||a.count()>1e4)return{update:!0};var o=kg("").reset(t,n,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(a)},e.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},e.prototype._getClipShape=function(t){if(t.get("clip",!0)){var n=t.coordinateSystem;return n&&n.getArea&&n.getArea(.1)}},e.prototype._updateSymbolDraw=function(t,n){var i=this._symbolDraw,a=n.pipelineContext,o=a.large;return(!i||o!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=o?new _ge:new Ig,this._isLargeDraw=o,this.group.removeAll()),this.group.add(i.group),i},e.prototype.remove=function(t,n){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(gn);const Sge=xge;var Age=function(r){ae(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(Nt);const wge=Age;var jT=function(r){ae(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",nr).models[0]},e.type="cartesian2dAxis",e}(Nt);ir(jT,Rg);var b8={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},bge=ht({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},b8),Z2=ht({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},b8),Tge=ht({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},Z2),Mge=Ke({logBase:10},Z2);const T8={category:bge,value:Z2,time:Tge,log:Mge};var Cge={value:1,category:1,time:1,log:1};function rd(r,e,t,n){k(Cge,function(i,a){var o=ht(ht({},T8[a],!0),n,!0),s=function(l){ae(u,l);function u(){var c=l!==null&&l.apply(this,arguments)||this;return c.type=e+"Axis."+a,c}return u.prototype.mergeDefaultAndTheme=function(c,h){var f=qv(this),d=f?Ad(c):{},p=h.getTheme();ht(c,p.get(a+"Axis")),ht(c,this.getDefaultOption()),c.type=o3(c),f&&Zl(c,d,f)},u.prototype.optionUpdated=function(){var c=this.option;c.type==="category"&&(this.__ordinalMeta=GT.createByAxisModel(this))},u.prototype.getCategories=function(c){var h=this.option;if(h.type==="category")return c?h.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.type=e+"Axis."+a,u.defaultOption=o,u}(t);r.registerComponentModel(s)}),r.registerSubTypeDefaulter(e+"Axis",o3)}function o3(r){return r.type||(r.data?"category":"value")}var Ege=function(){function r(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return r.prototype.getAxis=function(e){return this._axes[e]},r.prototype.getAxes=function(){return xe(this._dimList,function(e){return this._axes[e]},this)},r.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),jt(this.getAxes(),function(t){return t.scale.type===e})},r.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},r}();const Lge=Ege;var KT=["x","y"];function s3(r){return r.type==="interval"||r.type==="time"}var Pge=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=KT,t}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!s3(t)||!s3(n))){var i=t.getExtent(),a=n.getExtent(),o=this.dataToPoint([i[0],a[0]]),s=this.dataToPoint([i[1],a[1]]),l=i[1]-i[0],u=a[1]-a[0];if(!(!l||!u)){var c=(s[0]-o[0])/l,h=(s[1]-o[1])/u,f=o[0]-i[0]*c,d=o[1]-a[0]*h,p=this._transform=[c,0,0,h,f,d];this._invTransform=vd([],p)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var n=this.getAxis("x"),i=this.getAxis("y");return n.contain(n.toLocalCoord(t[0]))&&i.contain(i.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.containZone=function(t,n){var i=this.dataToPoint(t),a=this.dataToPoint(n),o=this.getArea(),s=new dt(i[0],i[1],a[0]-i[0],a[1]-i[1]);return o.intersect(s)},e.prototype.dataToPoint=function(t,n,i){i=i||[];var a=t[0],o=t[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return Or(i,t,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return i[0]=s.toGlobalCoord(s.dataToCoord(a,n)),i[1]=l.toGlobalCoord(l.dataToCoord(o,n)),i},e.prototype.clampData=function(t,n){var i=this.getAxis("x").scale,a=this.getAxis("y").scale,o=i.getExtent(),s=a.getExtent(),l=i.parse(t[0]),u=a.parse(t[1]);return n=n||[],n[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),n[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),n},e.prototype.pointToData=function(t,n){var i=[];if(this._invTransform)return Or(i,t,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return i[0]=a.coordToData(a.toLocalCoord(t[0]),n),i[1]=o.coordToData(o.toLocalCoord(t[1]),n),i},e.prototype.getOtherAxis=function(t){return this.getAxis(t.dim==="x"?"y":"x")},e.prototype.getArea=function(t){t=t||0;var n=this.getAxis("x").getGlobalExtent(),i=this.getAxis("y").getGlobalExtent(),a=Math.min(n[0],n[1])-t,o=Math.min(i[0],i[1])-t,s=Math.max(n[0],n[1])-a+t,l=Math.max(i[0],i[1])-o+t;return new dt(a,o,s,l)},e}(Lge),Rge=function(r){ae(e,r);function e(t,n,i,a,o){var s=r.call(this,t,n,i)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return e.prototype.isHorizontal=function(){var t=this.position;return t==="top"||t==="bottom"},e.prototype.getGlobalExtent=function(t){var n=this.getExtent();return n[0]=this.toGlobalCoord(n[0]),n[1]=this.toGlobalCoord(n[1]),t&&n[0]>n[1]&&n.reverse(),n},e.prototype.pointToData=function(t,n){return this.coordToData(this.toLocalCoord(t[this.dim==="x"?0:1]),n)},e.prototype.setCategorySortInfo=function(t){if(this.type!=="category")return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(ho);const Dge=Rge;function ZT(r,e,t){t=t||{};var n=r.coordinateSystem,i=e.axis,a={},o=i.getAxesOnZeroOf()[0],s=i.position,l=o?"onZero":s,u=i.dim,c=n.getRect(),h=[c.x,c.x+c.width,c.y,c.y+c.height],f={left:0,right:1,top:0,bottom:1,onZero:2},d=e.get("offset")||0,p=u==="x"?[h[2]-d,h[3]+d]:[h[0]-d,h[1]+d];if(o){var g=o.toGlobalCoord(o.dataToCoord(0));p[f.onZero]=Math.max(Math.min(g,p[1]),p[0])}a.position=[u==="y"?p[f[l]]:h[0],u==="x"?p[f[l]]:h[3]],a.rotation=Math.PI/2*(u==="x"?0:1);var v={top:-1,bottom:1,left:-1,right:1};a.labelDirection=a.tickDirection=a.nameDirection=v[s],a.labelOffset=o?p[f[s]]-p[f.onZero]:0,e.get(["axisTick","inside"])&&(a.tickDirection=-a.tickDirection),Mr(t.labelInside,e.get(["axisLabel","inside"]))&&(a.labelDirection=-a.labelDirection);var m=e.get(["axisLabel","rotate"]);return a.labelRotate=l==="top"?-m:m,a.z2=1,a}function l3(r){return r.get("coordinateSystem")==="cartesian2d"}function u3(r){var e={xAxisModel:null,yAxisModel:null};return k(e,function(t,n){var i=n.replace(/Model$/,""),a=r.getReferringComponents(i,nr).models[0];e[n]=a}),e}var GA=Math.log;function M8(r,e,t){var n=Jl.prototype,i=n.getTicks.call(t),a=n.getTicks.call(t,!0),o=i.length-1,s=n.getInterval.call(t),l=EH(r,e),u=l.extent,c=l.fixMin,h=l.fixMax;if(r.type==="log"){var f=GA(r.base);u=[GA(u[0])/f,GA(u[1])/f]}r.setExtent(u[0],u[1]),r.calcNiceExtent({splitNumber:o,fixMin:c,fixMax:h});var d=n.getExtent.call(r);c&&(u[0]=d[0]),h&&(u[1]=d[1]);var p=n.getInterval.call(r),g=u[0],v=u[1];if(c&&h)p=(v-g)/o;else if(c)for(v=u[0]+p*o;vu[0]&&isFinite(g)&&isFinite(u[0]);)p=CA(p),g=u[1]-p*o;else{var m=r.getTicks().length-1;m>o&&(p=CA(p));var y=p*o;v=Math.ceil(u[1]/p)*p,g=Vn(v-y),g<0&&u[0]>=0?(g=0,v=Vn(y)):v>0&&u[1]<=0&&(v=0,g=-Vn(y))}var _=(i[0].value-a[0].value)/s,x=(i[o].value-a[o].value)/s;n.setExtent.call(r,g+p*_,v+p*x),n.setInterval.call(r,p),(_||x)&&n.setNiceExtent.call(r,g+p,v-p)}var Ige=function(){function r(e,t,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=KT,this._initCartesian(e,t,n),this.model=e}return r.prototype.getRect=function(){return this._rect},r.prototype.update=function(e,t){var n=this._axesMap;this._updateScale(e,this.model);function i(o){var s,l=wt(o),u=l.length;if(u){for(var c=[],h=u-1;h>=0;h--){var f=+l[h],d=o[f],p=d.model,g=d.scale;HT(g)&&p.get("alignTicks")&&p.get("interval")==null?c.push(d):(td(g,p),HT(g)&&(s=d))}c.length&&(s||(s=c.pop(),td(s.scale,s.model)),k(c,function(v){M8(v.scale,v.model,s.scale)}))}}i(n.x),i(n.y);var a={};k(n.x,function(o){c3(n,"y",o,a)}),k(n.y,function(o){c3(n,"x",o,a)}),this.resize(this.model,t)},r.prototype.resize=function(e,t,n){var i=e.getBoxLayoutParams(),a=!n&&e.get("containLabel"),o=dr(i,{width:t.getWidth(),height:t.getHeight()});this._rect=o;var s=this._axesList;l(),a&&(k(s,function(u){if(!u.model.get(["axisLabel","inside"])){var c=$de(u);if(c){var h=u.isHorizontal()?"height":"width",f=u.model.get(["axisLabel","margin"]);o[h]-=c[h]+f,u.position==="top"?o.y+=c.height+f:u.position==="left"&&(o.x+=c.width+f)}}}),l()),k(this._coordsList,function(u){u.calcAffineTransform()});function l(){k(s,function(u){var c=u.isHorizontal(),h=c?[0,o.width]:[0,o.height],f=u.inverse?1:0;u.setExtent(h[f],h[1-f]),Nge(u,c?o.x:o.y)})}},r.prototype.getAxis=function(e,t){var n=this._axesMap[e];if(n!=null)return n[t||0]},r.prototype.getAxes=function(){return this._axesList.slice()},r.prototype.getCartesian=function(e,t){if(e!=null&&t!=null){var n="x"+e+"y"+t;return this._coordsMap[n]}Qe(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var i=0,a=this._coordsList;i0?"top":"bottom",a="center"):Vv(i-Pl)?(o=n>0?"bottom":"top",a="center"):(o="middle",i>0&&i0?"right":"left":a=n>0?"left":"right"),{rotation:i,textAlign:a,textVerticalAlign:o}},r.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},r.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)},r}(),f3={axisLine:function(r,e,t,n){var i=e.get(["axisLine","show"]);if(i==="auto"&&r.handleAutoShown&&(i=r.handleAutoShown("axisLine")),!!i){var a=e.axis.getExtent(),o=n.transform,s=[a[0],0],l=[a[1],0],u=s[0]>l[0];o&&(Or(s,s,o),Or(l,l,o));var c=pe({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),h=new Cr({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:c,strokeContainThreshold:r.strokeContainThreshold||5,silent:!0,z2:1});Qf(h.shape,h.style.lineWidth),h.anid="line",t.add(h);var f=e.get(["axisLine","symbol"]);if(f!=null){var d=e.get(["axisLine","symbolSize"]);ke(f)&&(f=[f,f]),(ke(d)||Ft(d))&&(d=[d,d]);var p=Jc(e.get(["axisLine","symbolOffset"])||0,d),g=d[0],v=d[1];k([{rotate:r.rotation+Math.PI/2,offset:p[0],r:0},{rotate:r.rotation-Math.PI/2,offset:p[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(m,y){if(f[y]!=="none"&&f[y]!=null){var _=rr(f[y],-g/2,-v/2,g,v,c.stroke,!0),x=m.r+m.offset,S=u?l:s;_.attr({rotation:m.rotate,x:S[0]+x*Math.cos(r.rotation),y:S[1]-x*Math.sin(r.rotation),silent:!0,z2:11}),t.add(_)}})}}},axisTickLabel:function(r,e,t,n){var i=Bge(t,n,e,r),a=Uge(t,n,e,r);if(Fge(e,a,i),zge(t,n,e,r.tickDirection),e.get(["axisLabel","hideOverlap"])){var o=GH(xe(a,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));$H(o)}},axisName:function(r,e,t,n){var i=Mr(r.axisName,e.get("name"));if(i){var a=e.get("nameLocation"),o=r.nameDirection,s=e.getModel("nameTextStyle"),l=e.get("nameGap")||0,u=e.axis.getExtent(),c=u[0]>u[1]?-1:1,h=[a==="start"?u[0]-c*l:a==="end"?u[1]+c*l:(u[0]+u[1])/2,p3(a)?r.labelOffset+o*l:0],f,d=e.get("nameRotate");d!=null&&(d=d*Pl/180);var p;p3(a)?f=Dc.innerTextLayout(r.rotation,d!=null?d:r.rotation,o):(f=Oge(r.rotation,a,d||0,u),p=r.axisNameAvailableWidth,p!=null&&(p=Math.abs(p/Math.sin(f.rotation)),!isFinite(p)&&(p=null)));var g=s.getFont(),v=e.get("nameTruncate",!0)||{},m=v.ellipsis,y=Mr(r.nameTruncateMaxWidth,v.maxWidth,p),_=new Ot({x:h[0],y:h[1],rotation:f.rotation,silent:Dc.isLabelSilent(e),style:pn(s,{text:i,font:g,overflow:"truncate",width:y,ellipsis:m,fill:s.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:s.get("align")||f.textAlign,verticalAlign:s.get("verticalAlign")||f.textVerticalAlign}),z2:1});if(Kc({el:_,componentModel:e,itemName:i}),_.__fullText=i,_.anid="name",e.get("triggerEvent")){var x=Dc.makeAxisEventDataBase(e);x.targetType="axisName",x.name=i,at(_).eventData=x}n.add(_),_.updateTransform(),t.add(_),_.decomposeTransform()}}};function Oge(r,e,t,n){var i=w4(t-r),a,o,s=n[0]>n[1],l=e==="start"&&!s||e!=="start"&&s;return Vv(i-Pl/2)?(o=l?"bottom":"top",a="center"):Vv(i-Pl*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",iPl/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function Fge(r,e,t){if(!LH(r.axis)){var n=r.get(["axisLabel","showMinLabel"]),i=r.get(["axisLabel","showMaxLabel"]);e=e||[],t=t||[];var a=e[0],o=e[1],s=e[e.length-1],l=e[e.length-2],u=t[0],c=t[1],h=t[t.length-1],f=t[t.length-2];n===!1?(ua(a),ua(u)):d3(a,o)&&(n?(ua(o),ua(c)):(ua(a),ua(u))),i===!1?(ua(s),ua(h)):d3(l,s)&&(i?(ua(l),ua(f)):(ua(s),ua(h)))}}function ua(r){r&&(r.ignore=!0)}function d3(r,e){var t=r&&r.getBoundingRect().clone(),n=e&&e.getBoundingRect().clone();if(!(!t||!n)){var i=g1([]);return jc(i,i,-r.rotation),t.applyTransform(As([],i,r.getLocalTransform())),n.applyTransform(As([],i,e.getLocalTransform())),t.intersect(n)}}function p3(r){return r==="middle"||r==="center"}function C8(r,e,t,n,i){for(var a=[],o=[],s=[],l=0;l=0||r===e}function Xge(r){var e=Q2(r);if(e){var t=e.axisPointerModel,n=e.axis.scale,i=t.option,a=t.get("status"),o=t.get("value");o!=null&&(o=n.parse(o));var s=QT(t);a==null&&(i.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o0&&!p.min?p.min=0:p.min!=null&&p.min<0&&!p.max&&(p.max=0);var g=l;p.color!=null&&(g=Ke({color:p.color},l));var v=ht(Je(p),{boundaryGap:t,splitNumber:n,scale:i,axisLine:a,axisTick:o,axisLabel:s,name:p.text,showName:u,nameLocation:"end",nameGap:h,nameTextStyle:g,triggerEvent:f},!1);if(ke(c)){var m=v.name;v.name=c.replace("{value}",m!=null?m:"")}else qe(c)&&(v.name=c(v.name,v));var y=new vn(v,null,this.ecModel);return ir(y,Rg.prototype),y.mainType="radar",y.componentIndex=this.componentIndex,y},this);this._indicatorModels=d},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type="radar",e.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:ht({lineStyle:{color:"#bbb"}},cp.axisLine),axisLabel:Ay(cp.axisLabel,!1),axisTick:Ay(cp.axisTick,!1),splitLine:Ay(cp.splitLine,!0),splitArea:Ay(cp.splitArea,!0),indicator:[]},e}(Nt);const lme=sme;var ume=["axisLine","axisTickLabel","axisName"],cme=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a=this.group;a.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},e.prototype._buildAxes=function(t){var n=t.coordinateSystem,i=n.getIndicatorAxes(),a=xe(i,function(o){var s=o.model.get("showName")?o.name:"",l=new ks(o.model,{axisName:s,position:[n.cx,n.cy],rotation:o.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return l});k(a,function(o){k(ume,o.add,o),this.group.add(o.getGroup())},this)},e.prototype._buildSplitLineAndArea=function(t){var n=t.coordinateSystem,i=n.getIndicatorAxes();if(!i.length)return;var a=t.get("shape"),o=t.getModel("splitLine"),s=t.getModel("splitArea"),l=o.getModel("lineStyle"),u=s.getModel("areaStyle"),c=o.get("show"),h=s.get("show"),f=l.get("color"),d=u.get("color"),p=_e(f)?f:[f],g=_e(d)?d:[d],v=[],m=[];function y(E,I,N){var R=N%I.length;return E[R]=E[R]||[],R}if(a==="circle")for(var _=i[0].getTicksCoords(),x=n.cx,S=n.cy,A=0;A<_.length;A++){if(c){var w=y(v,p,A);v[w].push(new au({shape:{cx:x,cy:S,r:_[A].coord}}))}if(h&&A<_.length-1){var w=y(m,g,A);m[w].push(new T1({shape:{cx:x,cy:S,r0:_[A].coord,r:_[A+1].coord}}))}}else for(var M,C=xe(i,function(E,I){var N=E.getTicksCoords();return M=M==null?N.length-1:Math.min(N.length-1,M),xe(N,function(R){return n.coordToPoint(R.coord,I)})}),b=[],A=0;A<=M;A++){for(var T=[],P=0;P3?1.4:o>1?1.2:1.1,c=a>0?u:1/u;$A(this,"zoom","zoomOnMouseWheel",t,{scale:c,originX:s,originY:l,isAvailableBehavior:null})}if(i){var h=Math.abs(a),f=(a>0?1:-1)*(h>3?.4:h>1?.15:.05);$A(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:f,originX:s,originY:l,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){if(!x3(this._zr,"globalPan")){var n=t.pinchScale>1?1.1:1/1.1;$A(this,"zoom",null,t,{scale:n,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})}},e}(Ba);function $A(r,e,t,n,i){r.pointerChecker&&r.pointerChecker(n,i.originX,i.originY)&&(Ps(n.event),I8(r,e,t,n,i))}function I8(r,e,t,n,i){i.isAvailableBehavior=Fe(d0,null,t,n),r.trigger(e,i)}function d0(r,e,t){var n=t[r];return!r||n&&(!ke(n)||e.event[n+"Key"])}const Bg=xme;function eE(r,e,t){var n=r.target;n.x+=e,n.y+=t,n.dirty()}function tE(r,e,t,n){var i=r.target,a=r.zoomLimit,o=r.zoom=r.zoom||1;if(o*=e,a){var s=a.min||0,l=a.max||1/0;o=Math.max(Math.min(l,o),s)}var u=o/r.zoom;r.zoom=o,i.x-=(t-i.x)*(u-1),i.y-=(n-i.y)*(u-1),i.scaleX*=u,i.scaleY*=u,i.dirty()}var Sme={axisPointer:1,tooltip:1,brush:1};function Y1(r,e,t){var n=e.getComponentByElement(r.topTarget),i=n&&n.coordinateSystem;return n&&n!==t&&!Sme.hasOwnProperty(n.mainType)&&i&&i.model!==t}function N8(r){if(ke(r)){var e=new DOMParser;r=e.parseFromString(r,"text/xml")}var t=r;for(t.nodeType===9&&(t=t.firstChild);t.nodeName.toLowerCase()!=="svg"||t.nodeType!==1;)t=t.nextSibling;return t}var XA,T_={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-anchor":"textAlign",visibility:"visibility",display:"display"},S3=wt(T_),M_={"alignment-baseline":"textBaseline","stop-color":"stopColor"},A3=wt(M_),Ame=function(){function r(){this._defs={},this._root=null}return r.prototype.parse=function(e,t){t=t||{};var n=N8(e);this._defsUsePending=[];var i=new rt;this._root=i;var a=[],o=n.getAttribute("viewBox")||"",s=parseFloat(n.getAttribute("width")||t.width),l=parseFloat(n.getAttribute("height")||t.height);isNaN(s)&&(s=null),isNaN(l)&&(l=null),Wi(n,i,null,!0,!1);for(var u=n.firstChild;u;)this._parseNode(u,i,a,null,!1,!1),u=u.nextSibling;Tme(this._defs,this._defsUsePending),this._defsUsePending=[];var c,h;if(o){var f=q1(o);f.length>=4&&(c={x:parseFloat(f[0]||0),y:parseFloat(f[1]||0),width:parseFloat(f[2]),height:parseFloat(f[3])})}if(c&&s!=null&&l!=null&&(h=O8(c,{x:0,y:0,width:s,height:l}),!t.ignoreViewBox)){var d=i;i=new rt,i.add(d),d.scaleX=d.scaleY=h.scale,d.x=h.x,d.y=h.y}return!t.ignoreRootClip&&s!=null&&l!=null&&i.setClipPath(new Dt({shape:{x:0,y:0,width:s,height:l}})),{root:i,width:s,height:l,viewBoxRect:c,viewBoxTransform:h,named:a}},r.prototype._parseNode=function(e,t,n,i,a,o){var s=e.nodeName.toLowerCase(),l,u=i;if(s==="defs"&&(a=!0),s==="text"&&(o=!0),s==="defs"||s==="switch")l=t;else{if(!a){var c=XA[s];if(c&&ze(XA,s)){l=c.call(this,e,t);var h=e.getAttribute("name");if(h){var f={name:h,namedFrom:null,svgNodeTagLower:s,el:l};n.push(f),s==="g"&&(u=f)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:l});t.add(l)}}var d=w3[s];if(d&&ze(w3,s)){var p=d.call(this,e),g=e.getAttribute("id");g&&(this._defs[g]=p)}}if(l&&l.isGroup)for(var v=e.firstChild;v;)v.nodeType===1?this._parseNode(v,l,n,u,a,o):v.nodeType===3&&o&&this._parseText(v,l),v=v.nextSibling},r.prototype._parseText=function(e,t){var n=new Hv({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});ca(t,n),Wi(e,n,this._defsUsePending,!1,!1),wme(n,t);var i=n.style,a=i.fontSize;a&&a<9&&(i.fontSize=9,n.scaleX*=a/9,n.scaleY*=a/9);var o=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=o;var s=n.getBoundingRect();return this._textX+=s.width,t.add(n),n},r.internalField=function(){XA={g:function(e,t){var n=new rt;return ca(t,n),Wi(e,n,this._defsUsePending,!1,!1),n},rect:function(e,t){var n=new Dt;return ca(t,n),Wi(e,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(e.getAttribute("x")||"0"),y:parseFloat(e.getAttribute("y")||"0"),width:parseFloat(e.getAttribute("width")||"0"),height:parseFloat(e.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(e,t){var n=new au;return ca(t,n),Wi(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),n.silent=!0,n},line:function(e,t){var n=new Cr;return ca(t,n),Wi(e,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(e.getAttribute("x1")||"0"),y1:parseFloat(e.getAttribute("y1")||"0"),x2:parseFloat(e.getAttribute("x2")||"0"),y2:parseFloat(e.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(e,t){var n=new c2;return ca(t,n),Wi(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),rx:parseFloat(e.getAttribute("rx")||"0"),ry:parseFloat(e.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(e,t){var n=e.getAttribute("points"),i;n&&(i=M3(n));var a=new zi({shape:{points:i||[]},silent:!0});return ca(t,a),Wi(e,a,this._defsUsePending,!1,!1),a},polyline:function(e,t){var n=e.getAttribute("points"),i;n&&(i=M3(n));var a=new Ui({shape:{points:i||[]},silent:!0});return ca(t,a),Wi(e,a,this._defsUsePending,!1,!1),a},image:function(e,t){var n=new Ur;return ca(t,n),Wi(e,n,this._defsUsePending,!1,!1),n.setStyle({image:e.getAttribute("xlink:href")||e.getAttribute("href"),x:+e.getAttribute("x"),y:+e.getAttribute("y"),width:+e.getAttribute("width"),height:+e.getAttribute("height")}),n.silent=!0,n},text:function(e,t){var n=e.getAttribute("x")||"0",i=e.getAttribute("y")||"0",a=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(a),this._textY=parseFloat(i)+parseFloat(o);var s=new rt;return ca(t,s),Wi(e,s,this._defsUsePending,!1,!0),s},tspan:function(e,t){var n=e.getAttribute("x"),i=e.getAttribute("y");n!=null&&(this._textX=parseFloat(n)),i!=null&&(this._textY=parseFloat(i));var a=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0",s=new rt;return ca(t,s),Wi(e,s,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(o),s},path:function(e,t){var n=e.getAttribute("d")||"",i=lV(n);return ca(t,i),Wi(e,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),r}(),w3={lineargradient:function(r){var e=parseInt(r.getAttribute("x1")||"0",10),t=parseInt(r.getAttribute("y1")||"0",10),n=parseInt(r.getAttribute("x2")||"10",10),i=parseInt(r.getAttribute("y2")||"0",10),a=new Ul(e,t,n,i);return b3(r,a),T3(r,a),a},radialgradient:function(r){var e=parseInt(r.getAttribute("cx")||"0",10),t=parseInt(r.getAttribute("cy")||"0",10),n=parseInt(r.getAttribute("r")||"0",10),i=new SV(e,t,n);return b3(r,i),T3(r,i),i}};function b3(r,e){var t=r.getAttribute("gradientUnits");t==="userSpaceOnUse"&&(e.global=!0)}function T3(r,e){for(var t=r.firstChild;t;){if(t.nodeType===1&&t.nodeName.toLocaleLowerCase()==="stop"){var n=t.getAttribute("offset"),i=void 0;n&&n.indexOf("%")>0?i=parseInt(n,10)/100:n?i=parseFloat(n):i=0;var a={};k8(t,a,a);var o=a.stopColor||t.getAttribute("stop-color")||"#000000";e.colorStops.push({offset:i,color:o})}t=t.nextSibling}}function ca(r,e){r&&r.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),Ke(e.__inheritedStyle,r.__inheritedStyle))}function M3(r){for(var e=q1(r),t=[],n=0;n0;a-=2){var o=n[a],s=n[a-1],l=q1(o);switch(i=i||ta(),s){case"translate":Xo(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":YC(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":jc(i,i,-parseFloat(l[0])*YA,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*YA);As(i,[1,0,u,1,0,0],i);break;case"skewY":var c=Math.tan(parseFloat(l[0])*YA);As(i,[1,c,0,1,0,0],i);break;case"matrix":i[0]=parseFloat(l[0]),i[1]=parseFloat(l[1]),i[2]=parseFloat(l[2]),i[3]=parseFloat(l[3]),i[4]=parseFloat(l[4]),i[5]=parseFloat(l[5]);break}}e.setLocalTransform(i)}}var E3=/([^\s:;]+)\s*:\s*([^:;]+)/g;function k8(r,e,t){var n=r.getAttribute("style");if(n){E3.lastIndex=0;for(var i;(i=E3.exec(n))!=null;){var a=i[1],o=ze(T_,a)?T_[a]:null;o&&(e[o]=i[2]);var s=ze(M_,a)?M_[a]:null;s&&(t[s]=i[2])}}}function Lme(r,e,t){for(var n=0;n0,v={api:n,geo:l,mapOrGeoModel:e,data:s,isVisualEncodedByVisualMap:g,isGeo:o,transformInfoRaw:f};l.resourceType==="geoJSON"?this._buildGeoJSON(v):l.resourceType==="geoSVG"&&this._buildSVG(v),this._updateController(e,t,n),this._updateMapSelectHandler(e,u,n,i)},r.prototype._buildGeoJSON=function(e){var t=this._regionsGroupByName=He(),n=He(),i=this._regionsGroup,a=e.transformInfoRaw,o=e.mapOrGeoModel,s=e.data,l=e.geo.projection,u=l&&l.stream;function c(d,p){return p&&(d=p(d)),d&&[d[0]*a.scaleX+a.x,d[1]*a.scaleY+a.y]}function h(d){for(var p=[],g=!u&&l&&l.project,v=0;v=0)&&(f=i);var d=o?{normal:{align:"center",verticalAlign:"middle"}}:null;zr(e,Sr(n),{labelFetcher:f,labelDataIndex:h,defaultText:t},d);var p=e.getTextContent();if(p&&(F8(p).ignore=p.ignore,e.textConfig&&o)){var g=e.getBoundingRect().clone();e.textConfig.layoutRect=g,e.textConfig.position=[(o[0]-g.x)/g.width*100+"%",(o[1]-g.y)/g.height*100+"%"]}e.disableLabelAnimation=!0}else e.removeTextContent(),e.removeTextConfig(),e.disableLabelAnimation=null}function I3(r,e,t,n,i,a){r.data?r.data.setItemGraphicEl(a,e):at(e).eventData={componentType:"geo",componentIndex:i.componentIndex,geoIndex:i.componentIndex,name:t,region:n&&n.option||{}}}function N3(r,e,t,n,i){r.data||Kc({el:e,componentModel:i,itemName:t,itemTooltipOption:n.get("tooltip")})}function k3(r,e,t,n,i){e.highDownSilentOnTouch=!!i.get("selectedMode");var a=n.getModel("emphasis"),o=a.get("focus");return Rn(e,o,a.get("blurScope"),a.get("disabled")),r.isGeo&&Yle(e,i,t),o}function O3(r,e,t){var n=[],i;function a(){i=[]}function o(){i.length&&(n.push(i),i=[])}var s=e({polygonStart:a,polygonEnd:o,lineStart:a,lineEnd:o,point:function(l,u){isFinite(l)&&isFinite(u)&&i.push([l,u])},sphere:function(){}});return!t&&s.polygonStart(),k(r,function(l){s.lineStart();for(var u=0;u-1&&(i.style.stroke=i.style.fill,i.style.fill="#fff",i.style.lineWidth=2),i},e.type="series.map",e.dependencies=["geo"],e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},e}(En);const Zme=Kme;function Qme(r,e){var t={};return k(r,function(n){n.each(n.mapDimension("value"),function(i,a){var o="ec-"+n.getName(a);t[o]=t[o]||[],isNaN(i)||t[o].push(i)})}),r[0].map(r[0].mapDimension("value"),function(n,i){for(var a="ec-"+r[0].getName(i),o=0,s=1/0,l=-1/0,u=t[a].length,c=0;c1?(x.width=_,x.height=_/v):(x.height=_,x.width=_*v),x.y=y[1]-x.height/2,x.x=y[0]-x.width/2;else{var S=r.getBoxLayoutParams();S.aspect=v,x=dr(S,{width:p,height:g})}this.setViewRect(x.x,x.y,x.width,x.height),this.setCenter(r.get("center"),e),this.setZoom(r.get("zoom"))}function rye(r,e){k(e.get("geoCoord"),function(t,n){r.addGeoCoord(n,t)})}var iye=function(){function r(){this.dimensions=z8}return r.prototype.create=function(e,t){var n=[];function i(o){return{nameProperty:o.get("nameProperty"),aspectScale:o.get("aspectScale"),projection:o.get("projection")}}e.eachComponent("geo",function(o,s){var l=o.get("map"),u=new U3(l+s,l,pe({nameMap:o.get("nameMap")},i(o)));u.zoomLimit=o.get("scaleLimit"),n.push(u),o.coordinateSystem=u,u.model=o,u.resize=V3,u.resize(o,t)}),e.eachSeries(function(o){var s=o.get("coordinateSystem");if(s==="geo"){var l=o.get("geoIndex")||0;o.coordinateSystem=n[l]}});var a={};return e.eachSeriesByType("map",function(o){if(!o.getHostGeoModel()){var s=o.getMapType();a[s]=a[s]||[],a[s].push(o)}}),k(a,function(o,s){var l=xe(o,function(c){return c.get("nameMap")}),u=new U3(s,s,pe({nameMap:GC(l)},i(o[0])));u.zoomLimit=Mr.apply(null,xe(o,function(c){return c.get("scaleLimit")})),n.push(u),u.resize=V3,u.resize(o[0],t),k(o,function(c){c.coordinateSystem=u,rye(u,c)})}),n},r.prototype.getFilledRegions=function(e,t,n,i){for(var a=(e||[]).slice(),o=He(),s=0;s=0;o--){var s=i[o];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},t.push(s)}}function dye(r,e){var t=r.isExpand?r.children:[],n=r.parentNode.children,i=r.hierNode.i?n[r.hierNode.i-1]:null;if(t.length){gye(r);var a=(t[0].hierNode.prelim+t[t.length-1].hierNode.prelim)/2;i?(r.hierNode.prelim=i.hierNode.prelim+e(r,i),r.hierNode.modifier=r.hierNode.prelim-a):r.hierNode.prelim=a}else i&&(r.hierNode.prelim=i.hierNode.prelim+e(r,i));r.parentNode.hierNode.defaultAncestor=mye(r,i,r.parentNode.hierNode.defaultAncestor||n[0],e)}function pye(r){var e=r.hierNode.prelim+r.parentNode.hierNode.modifier;r.setLayout({x:e},!0),r.hierNode.modifier+=r.parentNode.hierNode.modifier}function H3(r){return arguments.length?r:xye}function Fp(r,e){return r-=Math.PI/2,{x:e*Math.cos(r),y:e*Math.sin(r)}}function vye(r,e){return dr(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function gye(r){for(var e=r.children,t=e.length,n=0,i=0;--t>=0;){var a=e[t];a.hierNode.prelim+=n,a.hierNode.modifier+=n,i+=a.hierNode.change,n+=a.hierNode.shift+i}}function mye(r,e,t,n){if(e){for(var i=r,a=r,o=a.parentNode.children[0],s=e,l=i.hierNode.modifier,u=a.hierNode.modifier,c=o.hierNode.modifier,h=s.hierNode.modifier;s=qA(s),a=jA(a),s&&a;){i=qA(i),o=jA(o),i.hierNode.ancestor=r;var f=s.hierNode.prelim+h-a.hierNode.prelim-u+n(s,a);f>0&&(_ye(yye(s,r,t),r,f),u+=f,l+=f),h+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,c+=o.hierNode.modifier}s&&!qA(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=h-l),a&&!jA(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-c,t=r)}return t}function qA(r){var e=r.children;return e.length&&r.isExpand?e[e.length-1]:r.hierNode.thread}function jA(r){var e=r.children;return e.length&&r.isExpand?e[0]:r.hierNode.thread}function yye(r,e,t){return r.hierNode.ancestor.parentNode===e.parentNode?r.hierNode.ancestor:t}function _ye(r,e,t){var n=t/(e.hierNode.i-r.hierNode.i);e.hierNode.change-=n,e.hierNode.shift+=t,e.hierNode.modifier+=t,e.hierNode.prelim+=t,r.hierNode.change+=n}function xye(r,e){return r.parentNode===e.parentNode?1:2}var Sye=function(){function r(){this.parentPoint=[],this.childPoints=[]}return r}(),Aye=function(r){ae(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Sye},e.prototype.buildPath=function(t,n){var i=n.childPoints,a=i.length,o=n.parentPoint,s=i[0],l=i[a-1];if(a===1){t.moveTo(o[0],o[1]),t.lineTo(s[0],s[1]);return}var u=n.orient,c=u==="TB"||u==="BT"?0:1,h=1-c,f=Pe(n.forkPosition,1),d=[];d[c]=o[c],d[h]=o[h]+(l[h]-o[h])*f,t.moveTo(o[0],o[1]),t.lineTo(d[0],d[1]),t.moveTo(s[0],s[1]),d[c]=s[c],t.lineTo(d[0],d[1]),d[c]=l[c],t.lineTo(d[0],d[1]),t.lineTo(l[0],l[1]);for(var p=1;py.x,S||(x=x-Math.PI));var w=S?"left":"right",M=s.getModel("label"),C=M.get("rotate"),b=C*(Math.PI/180),T=v.getTextContent();T&&(v.setTextConfig({position:M.get("position")||w,rotation:C==null?-x:b,origin:"center"}),T.setStyle("verticalAlign","middle"))}var P=s.get(["emphasis","focus"]),D=P==="relative"?Fv(o.getAncestorsIndices(),o.getDescendantIndices()):P==="ancestor"?o.getAncestorsIndices():P==="descendant"?o.getDescendantIndices():null;D&&(at(t).focus=D),bye(i,o,c,t,p,d,g,n),t.__edge&&(t.onHoverStateChange=function(L){if(L!=="blur"){var E=o.parentNode&&r.getItemGraphicEl(o.parentNode.dataIndex);E&&E.hoverState===Tg||i_(t.__edge,L)}})}function bye(r,e,t,n,i,a,o,s){var l=e.getModel(),u=r.get("edgeShape"),c=r.get("layout"),h=r.getOrient(),f=r.get(["lineStyle","curveness"]),d=r.get("edgeForkPosition"),p=l.getModel("lineStyle").getLineStyle(),g=n.__edge;if(u==="curve")e.parentNode&&e.parentNode!==t&&(g||(g=n.__edge=new M1({shape:tM(c,h,f,i,i)})),zt(g,{shape:tM(c,h,f,a,o)},r));else if(u==="polyline"&&c==="orthogonal"&&e!==t&&e.children&&e.children.length!==0&&e.isExpand===!0){for(var v=e.children,m=[],y=0;yt&&(t=i.height)}this.height=t+1},r.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,n=this.children,i=n.length;t=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},r.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},r.prototype.getModel=function(e){if(!(this.dataIndex<0)){var t=this.hostTree,n=t.data.getItemModel(this.dataIndex);return n.getModel(e)}},r.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},r.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},r.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},r.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},r.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},r.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,t=0;t=0){var n=t.getData().tree.root,i=r.targetNode;if(ke(i)&&(i=n.getNodeById(i)),i&&n.contains(i))return{node:i};var a=r.targetNodeId;if(a!=null&&(i=n.getNodeById(a)))return{node:i}}}function X8(r){for(var e=[];r;)r=r.parentNode,r&&e.push(r);return e.reverse()}function oE(r,e){var t=X8(r);return pt(t,e)>=0}function j1(r,e){for(var t=[];r;){var n=r.dataIndex;t.push({name:r.name,dataIndex:n,value:e.getRawValue(n)}),r=r.parentNode}return t.reverse(),t}var kye=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.hasSymbolVisual=!0,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t){var n={name:t.name,children:t.data},i=t.leaves||{},a=new vn(i,this,this.ecModel),o=aE.createTree(n,this,s);function s(h){h.wrapMethod("getItemModel",function(f,d){var p=o.getNodeByDataIndex(d);return p&&p.children.length&&p.isExpand||(f.parentModel=a),f})}var l=0;o.eachNode("preorder",function(h){h.depth>l&&(l=h.depth)});var u=t.expandAndCollapse,c=u&&t.initialTreeDepth>=0?t.initialTreeDepth:l;return o.root.eachNode("preorder",function(h){var f=h.hostTree.data.getRawDataItem(h.dataIndex);h.isExpand=f&&f.collapsed!=null?!f.collapsed:h.depth<=c}),o.data},e.prototype.getOrient=function(){var t=this.get("orient");return t==="horizontal"?t="LR":t==="vertical"&&(t="TB"),t},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.formatTooltip=function(t,n,i){for(var a=this.getData().tree,o=a.root.children[0],s=a.getNodeByDataIndex(t),l=s.getValue(),u=s.name;s&&s!==o;)u=s.parentNode.name+"."+u,s=s.parentNode;return Ar("nameValue",{name:u,value:l,noValue:isNaN(l)||l==null})},e.prototype.getDataParams=function(t){var n=r.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treeAncestors=j1(i,this),n.collapsed=!i.isExpand,n},e.type="series.tree",e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(En);const Oye=kye;function Fye(r,e,t){for(var n=[r],i=[],a;a=n.pop();)if(i.push(a),a.isExpand){var o=a.children;if(o.length)for(var s=0;s=0;a--)t.push(i[a])}}function Bye(r,e){r.eachSeriesByType("tree",function(t){zye(t,e)})}function zye(r,e){var t=vye(r,e);r.layoutInfo=t;var n=r.get("layout"),i=0,a=0,o=null;n==="radial"?(i=2*Math.PI,a=Math.min(t.height,t.width)/2,o=H3(function(_,x){return(_.parentNode===x.parentNode?1:2)/_.depth})):(i=t.width,a=t.height,o=H3());var s=r.getData().tree.root,l=s.children[0];if(l){fye(s),Fye(l,dye,o),s.hierNode.modifier=-l.hierNode.prelim,fp(l,pye);var u=l,c=l,h=l;fp(l,function(_){var x=_.getLayout().x;xc.getLayout().x&&(c=_),_.depth>h.depth&&(h=_)});var f=u===c?1:o(u,c)/2,d=f-u.getLayout().x,p=0,g=0,v=0,m=0;if(n==="radial")p=i/(c.getLayout().x+f+d),g=a/(h.depth-1||1),fp(l,function(_){v=(_.getLayout().x+d)*p,m=(_.depth-1)*g;var x=Fp(v,m);_.setLayout({x:x.x,y:x.y,rawX:v,rawY:m},!0)});else{var y=r.getOrient();y==="RL"||y==="LR"?(g=a/(c.getLayout().x+f+d),p=i/(h.depth-1||1),fp(l,function(_){m=(_.getLayout().x+d)*g,v=y==="LR"?(_.depth-1)*p:i-(_.depth-1)*p,_.setLayout({x:v,y:m},!0)})):(y==="TB"||y==="BT")&&(p=i/(c.getLayout().x+f+d),g=a/(h.depth-1||1),fp(l,function(_){v=(_.getLayout().x+d)*p,m=y==="TB"?(_.depth-1)*g:a-(_.depth-1)*g,_.setLayout({x:v,y:m},!0)}))}}}function Uye(r){r.eachSeriesByType("tree",function(e){var t=e.getData(),n=t.tree;n.eachNode(function(i){var a=i.getModel(),o=a.getModel("itemStyle").getItemStyle(),s=t.ensureUniqueItemVisual(i.dataIndex,"style");pe(s,o)})})}function Vye(r){r.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},function(n){var i=e.dataIndex,a=n.getData().tree,o=a.getNodeByDataIndex(i);o.isExpand=!o.isExpand})}),r.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},function(e,t,n){t.eachComponent({mainType:"series",subType:"tree",query:e},function(i){var a=i.coordinateSystem,o=rE(a,e,void 0,n);i.setCenter&&i.setCenter(o.center),i.setZoom&&i.setZoom(o.zoom)})})}function Gye(r){r.registerChartView(Tye),r.registerSeriesModel(Oye),r.registerLayout(Bye),r.registerVisual(Uye),Vye(r)}var q3=["treemapZoomToNode","treemapRender","treemapMove"];function Hye(r){for(var e=0;e1;)a=a.parentNode;var o=PT(r.ecModel,a.name||a.dataIndex+"",n);i.setVisual("decal",o)})}var Wye=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.preventUsingHoverLayer=!0,t}return e.prototype.getInitialData=function(t,n){var i={name:t.name,children:t.data};q8(i);var a=t.levels||[],o=this.designatedVisualItemStyle={},s=new vn({itemStyle:o},this,n);a=t.levels=$ye(a,n);var l=xe(a||[],function(h){return new vn(h,s,n)},this),u=aE.createTree(i,this,c);function c(h){h.wrapMethod("getItemModel",function(f,d){var p=u.getNodeByDataIndex(d),g=p?l[p.depth]:null;return f.parentModel=g||s,f})}return u.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(t,n,i){var a=this.getData(),o=this.getRawValue(t),s=a.getName(t);return Ar("nameValue",{name:s,value:o})},e.prototype.getDataParams=function(t){var n=r.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treeAncestors=j1(i,this),n.treePathInfo=n.treeAncestors,n},e.prototype.setLayoutInfo=function(t){this.layoutInfo=this.layoutInfo||{},pe(this.layoutInfo,t)},e.prototype.mapIdToIndex=function(t){var n=this._idIndexMap;n||(n=this._idIndexMap=He(),this._idIndexMapCount=0);var i=n.get(t);return i==null&&n.set(t,i=this._idIndexMapCount++),i},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var n=this.getRawData().tree.root;(!t||t!==n&&!n.contains(t))&&(this._viewRoot=n)},e.prototype.enableAriaDecal=function(){Y8(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.32*.32,scaleLimit:null,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},e}(En);function q8(r){var e=0;k(r.children,function(n){q8(n);var i=n.value;_e(i)&&(i=i[0]),e+=i});var t=r.value;_e(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),_e(r.value)?r.value[0]=t:r.value=t}function $ye(r,e){var t=nn(e.get("color")),n=nn(e.get(["aria","decal","decals"]));if(t){r=r||[];var i,a;k(r,function(s){var l=new vn(s),u=l.get("color"),c=l.get("decal");(l.get(["itemStyle","color"])||u&&u!=="none")&&(i=!0),(l.get(["itemStyle","decal"])||c&&c!=="none")&&(a=!0)});var o=r[0]||(r[0]={});return i||(o.color=t.slice()),!a&&n&&(o.decal=n.slice()),r}}const Xye=Wye;var Yye=8,j3=8,KA=5,qye=function(){function r(e){this.group=new rt,e.add(this.group)}return r.prototype.render=function(e,t,n,i){var a=e.getModel("breadcrumb"),o=this.group;if(o.removeAll(),!(!a.get("show")||!n)){var s=a.getModel("itemStyle"),l=a.getModel("emphasis"),u=s.getModel("textStyle"),c=l.getModel(["itemStyle","textStyle"]),h={pos:{left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(n,h,u),this._renderContent(e,h,s,l,u,c,i),k1(o,h.pos,h.box)}},r.prototype._prepare=function(e,t,n){for(var i=e;i;i=i.parentNode){var a=fr(i.getModel().get("name"),""),o=n.getTextRect(a),s=Math.max(o.width+Yye*2,t.emptyItemWidth);t.totalWidth+=s+j3,t.renderList.push({node:i,text:a,width:s})}},r.prototype._renderContent=function(e,t,n,i,a,o,s){for(var l=0,u=t.emptyItemWidth,c=e.get(["breadcrumb","height"]),h=nce(t.pos,t.box),f=t.totalWidth,d=t.renderList,p=i.getModel("itemStyle").getItemStyle(),g=d.length-1;g>=0;g--){var v=d[g],m=v.node,y=v.width,_=v.text;f>h.width&&(f-=y-u,y=u,_=null);var x=new zi({shape:{points:jye(l,0,y,c,g===d.length-1,g===0)},style:Ke(n.getItemStyle(),{lineJoin:"bevel"}),textContent:new Ot({style:pn(a,{text:_})}),textConfig:{position:"inside"},z2:md*1e4,onclick:ut(s,m)});x.disableLabelAnimation=!0,x.getTextContent().ensureState("emphasis").style=pn(o,{text:_}),x.ensureState("emphasis").style=p,Rn(x,i.get("focus"),i.get("blurScope"),i.get("disabled")),this.group.add(x),Kye(x,e,m),l+=y+j3}},r.prototype.remove=function(){this.group.removeAll()},r}();function jye(r,e,t,n,i,a){var o=[[i?r:r-KA,e],[r+t,e],[r+t,e+n],[i?r:r-KA,e+n]];return!a&&o.splice(2,0,[r+t+KA,e+n/2]),!i&&o.push([r,e+n/2]),o}function Kye(r,e,t){at(r).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:t&&t.dataIndex,name:t&&t.name},treePathInfo:t&&j1(t,e)}}const Zye=qye;var Qye=function(){function r(){this._storage=[],this._elExistsMap={}}return r.prototype.add=function(e,t,n,i,a){return this._elExistsMap[e.id]?!1:(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:n,delay:i,easing:a}),!0)},r.prototype.finished=function(e){return this._finishedCallback=e,this},r.prototype.start=function(){for(var e=this,t=this._storage.length,n=function(){t--,t<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},i=0,a=this._storage.length;iZ3||Math.abs(t.dy)>Z3)){var n=this.seriesModel.getData().tree.root;if(!n)return;var i=n.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+t.dx,y:i.y+t.dy,width:i.width,height:i.height}})}},e.prototype._onZoom=function(t){var n=t.originX,i=t.originY,a=t.scale;if(this._state!=="animating"){var o=this.seriesModel.getData().tree.root;if(!o)return;var s=o.getLayout();if(!s)return;var l=new dt(s.x,s.y,s.width,s.height),u=null,c=this._controllerHost;u=c.zoomLimit;var h=c.zoom=c.zoom||1;if(h*=a,u){var f=u.min||0,d=u.max||1/0;h=Math.max(Math.min(d,h),f)}var p=h/c.zoom;c.zoom=h;var g=this.seriesModel.layoutInfo;n-=g.x,i-=g.y;var v=ta();Xo(v,v,[-n,-i]),YC(v,v,[p,p]),Xo(v,v,[n,i]),l.applyTransform(v),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:l.x,y:l.y,width:l.width,height:l.height}})}},e.prototype._initEvents=function(t){var n=this;t.on("click",function(i){if(n._state==="ready"){var a=n.seriesModel.get("nodeClick",!0);if(a){var o=n.findTarget(i.offsetX,i.offsetY);if(o){var s=o.node;if(s.getLayout().isLeafRoot)n._rootToNode(o);else if(a==="zoomToNode")n._zoomToNode(o);else if(a==="link"){var l=s.hostTree.data.getItemModel(s.dataIndex),u=l.get("link",!0),c=l.get("target",!0)||"blank";u&&c_(u,c)}}}}},this)},e.prototype._renderBreadcrumb=function(t,n,i){var a=this;i||(i=t.get("leafDepth",!0)!=null?{node:t.getViewRoot()}:this.findTarget(n.getWidth()/2,n.getHeight()/2),i||(i={node:t.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new Zye(this.group))).render(t,n,i.node,function(o){a._state!=="animating"&&(oE(t.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=dp(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},e.prototype.dispose=function(){this._clearController()},e.prototype._zoomToNode=function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype._rootToNode=function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype.findTarget=function(t,n){var i,a=this.seriesModel.getViewRoot();return a.eachNode({attr:"viewChildren",order:"preorder"},function(o){var s=this._storage.background[o.getRawIndex()];if(s){var l=s.transformCoordToLocal(t,n),u=s.shape;if(u.x<=l[0]&&l[0]<=u.x+u.width&&u.y<=l[1]&&l[1]<=u.y+u.height)i={node:o,offsetX:l[0],offsetY:l[1]};else return!1}},this),i},e.type="treemap",e}(gn);function dp(){return{nodeGroup:[],background:[],content:[]}}function i0e(r,e,t,n,i,a,o,s,l,u){if(!o)return;var c=o.getLayout(),h=r.getData(),f=o.getModel();if(h.setItemGraphicEl(o.dataIndex,null),!c||!c.isInView)return;var d=c.width,p=c.height,g=c.borderWidth,v=c.invisible,m=o.getRawIndex(),y=s&&s.getRawIndex(),_=o.viewChildren,x=c.upperHeight,S=_&&_.length,A=f.getModel("itemStyle"),w=f.getModel(["emphasis","itemStyle"]),M=f.getModel(["blur","itemStyle"]),C=f.getModel(["select","itemStyle"]),b=A.get("borderRadius")||0,T=Z("nodeGroup",nM);if(!T)return;if(l.add(T),T.x=c.x||0,T.y=c.y||0,T.markRedraw(),C_(T).nodeWidth=d,C_(T).nodeHeight=p,c.isAboveViewRoot)return T;var P=Z("background",K3,u,t0e);P&&O(T,P,S&&c.upperLabelHeight);var D=f.getModel("emphasis"),L=D.get("focus"),E=D.get("blurScope"),I=D.get("disabled"),N=L==="ancestor"?o.getAncestorsIndices():L==="descendant"?o.getDescendantIndices():L;if(S)$v(T)&&oc(T,!1),P&&(oc(P,!I),h.setItemGraphicEl(o.dataIndex,P),AT(P,N,E));else{var R=Z("content",K3,u,n0e);R&&V(T,R),P.disableMorphing=!0,P&&$v(P)&&oc(P,!1),oc(T,!I),h.setItemGraphicEl(o.dataIndex,T);var F=f.getShallow("cursor");F&&R.attr("cursor",F),AT(T,N,E)}return T;function O(le,re,be){var de=at(re);if(de.dataIndex=o.dataIndex,de.seriesIndex=r.seriesIndex,re.setShape({x:0,y:0,width:d,height:p,r:b}),v)H(re);else{re.invisible=!1;var U=o.getVisual("style"),K=U.stroke,te=eO(A);te.fill=K;var ce=Xu(w);ce.fill=w.get("borderColor");var se=Xu(M);se.fill=M.get("borderColor");var Ne=Xu(C);if(Ne.fill=C.get("borderColor"),be){var Oe=d-2*g;Q(re,K,U.opacity,{x:g,y:0,width:Oe,height:x})}else re.removeTextContent();re.setStyle(te),re.ensureState("emphasis").style=ce,re.ensureState("blur").style=se,re.ensureState("select").style=Ne,Gc(re)}le.add(re)}function V(le,re){var be=at(re);be.dataIndex=o.dataIndex,be.seriesIndex=r.seriesIndex;var de=Math.max(d-2*g,0),U=Math.max(p-2*g,0);if(re.culling=!0,re.setShape({x:g,y:g,width:de,height:U,r:b}),v)H(re);else{re.invisible=!1;var K=o.getVisual("style"),te=K.fill,ce=eO(A);ce.fill=te,ce.decal=K.decal;var se=Xu(w),Ne=Xu(M),Oe=Xu(C);Q(re,te,K.opacity,null),re.setStyle(ce),re.ensureState("emphasis").style=se,re.ensureState("blur").style=Ne,re.ensureState("select").style=Oe,Gc(re)}le.add(re)}function H(le){!le.invisible&&a.push(le)}function Q(le,re,be,de){var U=f.getModel(de?J3:Q3),K=fr(f.get("name"),null),te=U.getShallow("show");zr(le,Sr(f,de?J3:Q3),{defaultText:te?K:null,inheritColor:re,defaultOpacity:be,labelFetcher:r,labelDataIndex:o.dataIndex});var ce=le.getTextContent();if(ce){var se=ce.style,Ne=WC(se.padding||0);de&&(le.setTextConfig({layoutRect:de}),ce.disableLabelLayout=!0),ce.beforeUpdate=function(){var B=Math.max((de?de.width:le.shape.width)-Ne[1]-Ne[3],0),z=Math.max((de?de.height:le.shape.height)-Ne[0]-Ne[2],0);(se.width!==B||se.height!==z)&&ce.setStyle({width:B,height:z})},se.truncateMinChar=2,se.lineOverflow="truncate",W(se,de,c);var Oe=ce.getState("emphasis");W(Oe?Oe.style:null,de,c)}}function W(le,re,be){var de=le?le.text:null;if(!re&&be.isLeafRoot&&de!=null){var U=r.get("drillDownIcon",!0);le.text=U?U+" "+de:de}}function Z(le,re,be,de){var U=y!=null&&t[le][y],K=i[le];return U?(t[le][y]=null,ee(K,U)):v||(U=new re,U instanceof ka&&(U.z2=a0e(be,de)),he(K,U)),e[le][m]=U}function ee(le,re){var be=le[m]={};re instanceof nM?(be.oldX=re.x,be.oldY=re.y):be.oldShape=pe({},re.shape)}function he(le,re){var be=le[m]={},de=o.parentNode,U=re instanceof rt;if(de&&(!n||n.direction==="drillDown")){var K=0,te=0,ce=i.background[de.getRawIndex()];!n&&ce&&ce.oldShape&&(K=ce.oldShape.width,te=ce.oldShape.height),U?(be.oldX=0,be.oldY=te):be.oldShape={x:K,y:te,width:0,height:0}}be.fadein=!U}}function a0e(r,e){return r*e0e+e}const o0e=r0e;var ig=k,s0e=Qe,E_=-1,sE=function(){function r(e){var t=e.mappingMethod,n=e.type,i=this.option=Je(e);this.type=n,this.mappingMethod=t,this._normalizeData=c0e[t];var a=r.visualHandlers[n];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[t],t==="piecewise"?(ZA(i),l0e(i)):t==="category"?i.categories?u0e(i):ZA(i,!0):(gi(t!=="linear"||i.dataExtent),ZA(i))}return r.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},r.prototype.getNormalizer=function(){return Fe(this._normalizeData,this)},r.listVisualTypes=function(){return wt(r.visualHandlers)},r.isValidType=function(e){return r.visualHandlers.hasOwnProperty(e)},r.eachVisual=function(e,t,n){Qe(e)?k(e,t,n):t.call(n,e)},r.mapVisual=function(e,t,n){var i,a=_e(e)?[]:Qe(e)?{}:(i=!0,null);return r.eachVisual(e,function(o,s){var l=t.call(n,o,s);i?a=l:a[s]=l}),a},r.retrieveVisuals=function(e){var t={},n;return e&&ig(r.visualHandlers,function(i,a){e.hasOwnProperty(a)&&(t[a]=e[a],n=!0)}),n?t:null},r.prepareVisualTypes=function(e){if(_e(e))e=e.slice();else if(s0e(e)){var t=[];ig(e,function(n,i){t.push(i)}),e=t}else return[];return e.sort(function(n,i){return i==="color"&&n!=="color"&&n.indexOf("color")===0?1:-1}),e},r.dependsOn=function(e,t){return t==="color"?!!(e&&e.indexOf(t)===0):e===t},r.findPieceIndex=function(e,t,n){for(var i,a=1/0,o=0,s=t.length;o=0;a--)n[a]==null&&(delete t[e[a]],e.pop())}function ZA(r,e){var t=r.visual,n=[];Qe(t)?ig(t,function(a){n.push(a)}):t!=null&&n.push(t);var i={color:1,symbol:1};!e&&n.length===1&&!i.hasOwnProperty(r.type)&&(n[1]=n[0]),j8(r,n)}function by(r){return{applyVisual:function(e,t,n){var i=this.mapValueToVisual(e);n("color",r(t("color"),i))},_normalizedToVisual:rM([0,1])}}function tO(r){var e=this.option.visual;return e[Math.round(Kt(r,[0,1],[0,e.length-1],!0))]||{}}function pp(r){return function(e,t,n){n(r,this.mapValueToVisual(e))}}function Bp(r){var e=this.option.visual;return e[this.option.loop&&r!==E_?r%e.length:r]}function Yu(){return this.option.visual[0]}function rM(r){return{linear:function(e){return Kt(e,r,this.option.visual,!0)},category:Bp,piecewise:function(e,t){var n=iM.call(this,t);return n==null&&(n=Kt(e,r,this.option.visual,!0)),n},fixed:Yu}}function iM(r){var e=this.option,t=e.pieceList;if(e.hasSpecialVisual){var n=sE.findPieceIndex(r,t),i=t[n];if(i&&i.visual)return i.visual[this.type]}}function j8(r,e){return r.visual=e,r.type==="color"&&(r.parsedVisual=xe(e,function(t){var n=na(t);return n||[0,0,0,1]})),e}var c0e={linear:function(r){return Kt(r,this.option.dataExtent,[0,1],!0)},piecewise:function(r){var e=this.option.pieceList,t=sE.findPieceIndex(r,e,!0);if(t!=null)return Kt(t,[0,e.length-1],[0,1],!0)},category:function(r){var e=this.option.categories?this.option.categoryMap[r]:r;return e==null?E_:e},fixed:qn};function Ty(r,e,t){return r?e<=t:e=t.length||g===t[g.depth]){var m=g0e(i,l,g,v,p,n);Z8(g,m,t,n)}})}}}function d0e(r,e,t){var n=pe({},e),i=t.designatedVisualItemStyle;return k(["color","colorAlpha","colorSaturation"],function(a){i[a]=e[a];var o=r.get(a);i[a]=null,o!=null&&(n[a]=o)}),n}function nO(r){var e=QA(r,"color");if(e){var t=QA(r,"colorAlpha"),n=QA(r,"colorSaturation");return n&&(e=ev(e,null,null,n)),t&&(e=Q0(e,t)),e}}function p0e(r,e){return e!=null?ev(e,null,null,r):null}function QA(r,e){var t=r[e];if(t!=null&&t!=="none")return t}function v0e(r,e,t,n,i,a){if(!(!a||!a.length)){var o=JA(e,"color")||i.color!=null&&i.color!=="none"&&(JA(e,"colorAlpha")||JA(e,"colorSaturation"));if(o){var s=e.get("visualMin"),l=e.get("visualMax"),u=t.dataExtent.slice();s!=null&&su[1]&&(u[1]=l);var c=e.get("colorMappingBy"),h={type:o.name,dataExtent:u,visual:o.range};h.type==="color"&&(c==="index"||c==="id")?(h.mappingMethod="category",h.loop=!0):h.mappingMethod="linear";var f=new Fr(h);return K8(f).drColorMappingBy=c,f}}}function JA(r,e){var t=r.get(e);return _e(t)&&t.length?{name:e,range:t}:null}function g0e(r,e,t,n,i,a){var o=pe({},e);if(i){var s=i.type,l=s==="color"&&K8(i).drColorMappingBy,u=l==="index"?n:l==="id"?a.mapIdToIndex(t.getId()):t.getValue(r.get("visualDimension"));o[s]=i.mapValueToVisual(u)}return o}var ag=Math.max,L_=Math.min,rO=Mr,lE=k,Q8=["itemStyle","borderWidth"],m0e=["itemStyle","gapWidth"],y0e=["upperLabel","show"],_0e=["upperLabel","height"];const x0e={seriesType:"treemap",reset:function(r,e,t,n){var i=t.getWidth(),a=t.getHeight(),o=r.option,s=dr(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),l=o.size||[],u=Pe(rO(s.width,l[0]),i),c=Pe(rO(s.height,l[1]),a),h=n&&n.type,f=["treemapZoomToNode","treemapRootToNode"],d=rg(n,f,r),p=h==="treemapRender"||h==="treemapMove"?n.rootRect:null,g=r.getViewRoot(),v=X8(g);if(h!=="treemapMove"){var m=h==="treemapZoomToNode"?M0e(r,d,g,u,c):p?[p.width,p.height]:[u,c],y=o.sort;y&&y!=="asc"&&y!=="desc"&&(y="desc");var _={squareRatio:o.squareRatio,sort:y,leafDepth:o.leafDepth};g.hostTree.clearLayouts();var x={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};g.setLayout(x),J8(g,_,!1,0),x=g.getLayout(),lE(v,function(A,w){var M=(v[w+1]||g).getValue();A.setLayout(pe({dataExtent:[M,M],borderWidth:0,upperHeight:0},x))})}var S=r.getData().tree.root;S.setLayout(C0e(s,p,d),!0),r.setLayoutInfo(s),e6(S,new dt(-s.x,-s.y,i,a),v,g,0)}};function J8(r,e,t,n){var i,a;if(!r.isRemoved()){var o=r.getLayout();i=o.width,a=o.height;var s=r.getModel(),l=s.get(Q8),u=s.get(m0e)/2,c=t6(s),h=Math.max(l,c),f=l-u,d=h-u;r.setLayout({borderWidth:l,upperHeight:h,upperLabelHeight:c},!0),i=ag(i-2*f,0),a=ag(a-f-d,0);var p=i*a,g=S0e(r,s,p,e,t,n);if(g.length){var v={x:f,y:d,width:i,height:a},m=L_(i,a),y=1/0,_=[];_.area=0;for(var x=0,S=g.length;x=0;l--){var u=i[n==="asc"?o-l-1:l].getValue();u/t*es[1]&&(s[1]=u)})),{sum:n,dataExtent:s}}function T0e(r,e,t){for(var n=0,i=1/0,a=0,o=void 0,s=r.length;an&&(n=o));var l=r.area*r.area,u=e*e*t;return l?ag(u*n/l,l/(u*i)):1/0}function iO(r,e,t,n,i){var a=e===t.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=t[s[a]],c=e?r.area/e:0;(i||c>t[l[o]])&&(c=t[l[o]]);for(var h=0,f=r.length;hgI&&(u=gI),a=s}un&&(n=e);var a=n%2?n+2:n+3;i=[];for(var o=0;o0&&(S[0]=-S[0],S[1]=-S[1]);var w=x[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var M=-Math.atan2(x[1],x[0]);h[0].8?"left":f[0]<-.8?"right":"center",g=f[1]>.8?"top":f[1]<-.8?"bottom":"middle";break;case"start":a.x=-f[0]*m+c[0],a.y=-f[1]*y+c[1],p=f[0]>.8?"right":f[0]<-.8?"left":"center",g=f[1]>.8?"bottom":f[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=m*w+c[0],a.y=c[1]+C,p=x[0]<0?"right":"left",a.originX=-m*w,a.originY=-C;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=A[0],a.y=A[1]+C,p="center",a.originY=-C;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-m*w+h[0],a.y=h[1]+C,p=x[0]>=0?"right":"left",a.originX=m*w,a.originY=-C;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||g,align:a.__align||p})}},e}(rt);const fE=X0e;var Y0e=function(){function r(e){this.group=new rt,this._LineCtor=e||fE}return r.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this,i=n.group,a=n._lineData;n._lineData=e,a||i.removeAll();var o=cO(e);e.diff(a).add(function(s){t._doAdd(e,s,o)}).update(function(s,l){t._doUpdate(a,e,l,s,o)}).remove(function(s){i.remove(a.getItemGraphicEl(s))}).execute()},r.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,n){t.updateLayout(e,n)},this)},r.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=cO(e),this._lineData=null,this.group.removeAll()},r.prototype.incrementalUpdate=function(e,t){this._progressiveEls=[];function n(s){!s.isGroup&&!q0e(s)&&(s.incremental=!0,s.ensureState("emphasis").hoverLayer=!0)}for(var i=e.start;i0}function cO(r){var e=r.hostModel,t=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:t.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:t.get("disabled"),blurScope:t.get("blurScope"),focus:t.get("focus"),labelStatesModels:Sr(e)}}function hO(r){return isNaN(r[0])||isNaN(r[1])}function iw(r){return r&&!hO(r[0])&&!hO(r[1])}const dE=Y0e;var aw=[],ow=[],sw=[],$h=Tr,lw=bc,fO=Math.abs;function dO(r,e,t){for(var n=r[0],i=r[1],a=r[2],o=1/0,s,l=t*t,u=.1,c=.1;c<=.9;c+=.1){aw[0]=$h(n[0],i[0],a[0],c),aw[1]=$h(n[1],i[1],a[1],c);var h=fO(lw(aw,e)-l);h=0?s=s+u:s=s-u:p>=0?s=s-u:s=s+u}return s}function uw(r,e){var t=[],n=Bv,i=[[],[],[]],a=[[],[]],o=[];e/=2,r.eachEdge(function(s,l){var u=s.getLayout(),c=s.getVisual("fromSymbol"),h=s.getVisual("toSymbol");u.__original||(u.__original=[Ss(u[0]),Ss(u[1])],u[2]&&u.__original.push(Ss(u[2])));var f=u.__original;if(u[2]!=null){if(hi(i[0],f[0]),hi(i[1],f[2]),hi(i[2],f[1]),c&&c!=="none"){var d=Up(s.node1),p=dO(i,f[0],d*e);n(i[0][0],i[1][0],i[2][0],p,t),i[0][0]=t[3],i[1][0]=t[4],n(i[0][1],i[1][1],i[2][1],p,t),i[0][1]=t[3],i[1][1]=t[4]}if(h&&h!=="none"){var d=Up(s.node2),p=dO(i,f[1],d*e);n(i[0][0],i[1][0],i[2][0],p,t),i[1][0]=t[1],i[2][0]=t[2],n(i[0][1],i[1][1],i[2][1],p,t),i[1][1]=t[1],i[2][1]=t[2]}hi(u[0],i[0]),hi(u[1],i[2]),hi(u[2],i[1])}else{if(hi(a[0],f[0]),hi(a[1],f[1]),ic(o,a[1],a[0]),pd(o,o),c&&c!=="none"){var d=Up(s.node1);Xb(a[0],a[0],o,d*e)}if(h&&h!=="none"){var d=Up(s.node2);Xb(a[1],a[1],o,-d*e)}hi(u[0],a[0]),hi(u[1],a[1])}})}function pO(r){return r.type==="view"}var j0e=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,n){var i=new Ig,a=new dE,o=this.group;this._controller=new Bg(n.getZr()),this._controllerHost={target:o},o.add(i.group),o.add(a.group),this._symbolDraw=i,this._lineDraw=a,this._firstRender=!0},e.prototype.render=function(t,n,i){var a=this,o=t.coordinateSystem;this._model=t;var s=this._symbolDraw,l=this._lineDraw,u=this.group;if(pO(o)){var c={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?u.attr(c):zt(u,c,t)}uw(t.getGraph(),zp(t));var h=t.getData();s.updateData(h);var f=t.getEdgeData();l.updateData(f),this._updateNodeAndLinkScale(),this._updateController(t,n,i),clearTimeout(this._layoutTimeout);var d=t.forceLayout,p=t.get(["force","layoutAnimation"]);d&&this._startForceLayoutIteration(d,p);var g=t.get("layout");h.graph.eachNode(function(_){var x=_.dataIndex,S=_.getGraphicEl(),A=_.getModel();if(S){S.off("drag").off("dragend");var w=A.get("draggable");w&&S.on("drag",function(C){switch(g){case"force":d.warmUp(),!a._layouting&&a._startForceLayoutIteration(d,p),d.setFixed(x),h.setItemLayout(x,[S.x,S.y]);break;case"circular":h.setItemLayout(x,[S.x,S.y]),_.setLayout({fixed:!0},!0),hE(t,"symbolSize",_,[C.offsetX,C.offsetY]),a.updateLayout(t);break;case"none":default:h.setItemLayout(x,[S.x,S.y]),cE(t.getGraph(),t),a.updateLayout(t);break}}).on("dragend",function(){d&&d.setUnfixed(x)}),S.setDraggable(w,!!A.get("cursor"));var M=A.get(["emphasis","focus"]);M==="adjacency"&&(at(S).focus=_.getAdjacentDataIndices())}}),h.graph.eachEdge(function(_){var x=_.getGraphicEl(),S=_.getModel().get(["emphasis","focus"]);x&&S==="adjacency"&&(at(x).focus={edge:[_.dataIndex],node:[_.node1.dataIndex,_.node2.dataIndex]})});var v=t.get("layout")==="circular"&&t.get(["circular","rotateLabel"]),m=h.getLayout("cx"),y=h.getLayout("cy");h.graph.eachNode(function(_){a6(_,v,m,y)}),this._firstRender=!1},e.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype._startForceLayoutIteration=function(t,n){var i=this;(function a(){t.step(function(o){i.updateLayout(i._model),(i._layouting=!o)&&(n?i._layoutTimeout=setTimeout(a,16):a())})})()},e.prototype._updateController=function(t,n,i){var a=this,o=this._controller,s=this._controllerHost,l=this.group;if(o.setPointerChecker(function(u,c,h){var f=l.getBoundingRect();return f.applyTransform(l.transform),f.contain(c,h)&&!Y1(u,i,t)}),!pO(t.coordinateSystem)){o.disable();return}o.enable(t.get("roam")),s.zoomLimit=t.get("scaleLimit"),s.zoom=t.coordinateSystem.getZoom(),o.off("pan").off("zoom").on("pan",function(u){eE(s,u.dx,u.dy),i.dispatchAction({seriesId:t.id,type:"graphRoam",dx:u.dx,dy:u.dy})}).on("zoom",function(u){tE(s,u.scale,u.originX,u.originY),i.dispatchAction({seriesId:t.id,type:"graphRoam",zoom:u.scale,originX:u.originX,originY:u.originY}),a._updateNodeAndLinkScale(),uw(t.getGraph(),zp(t)),a._lineDraw.updateLayout(),i.updateLabelLayout()})},e.prototype._updateNodeAndLinkScale=function(){var t=this._model,n=t.getData(),i=zp(t);n.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(i)})},e.prototype.updateLayout=function(t){uw(t.getGraph(),zp(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},e.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},e.type="graph",e}(gn);const K0e=j0e;function Xh(r){return"_EC_"+r}var Z0e=function(){function r(e){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return r.prototype.isDirected=function(){return this._directed},r.prototype.addNode=function(e,t){e=e==null?""+t:""+e;var n=this._nodesMap;if(!n[Xh(e)]){var i=new qu(e,t);return i.hostGraph=this,this.nodes.push(i),n[Xh(e)]=i,i}},r.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},r.prototype.getNodeById=function(e){return this._nodesMap[Xh(e)]},r.prototype.addEdge=function(e,t,n){var i=this._nodesMap,a=this._edgesMap;if(Ft(e)&&(e=this.nodes[e]),Ft(t)&&(t=this.nodes[t]),e instanceof qu||(e=i[Xh(e)]),t instanceof qu||(t=i[Xh(t)]),!(!e||!t)){var o=e.id+"-"+t.id,s=new s6(e,t,n);return s.hostGraph=this,this._directed&&(e.outEdges.push(s),t.inEdges.push(s)),e.edges.push(s),e!==t&&t.edges.push(s),this.edges.push(s),a[o]=s,s}},r.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},r.prototype.getEdge=function(e,t){e instanceof qu&&(e=e.id),t instanceof qu&&(t=t.id);var n=this._edgesMap;return this._directed?n[e+"-"+t]:n[e+"-"+t]||n[t+"-"+e]},r.prototype.eachNode=function(e,t){for(var n=this.nodes,i=n.length,a=0;a=0&&e.call(t,n[a],a)},r.prototype.eachEdge=function(e,t){for(var n=this.edges,i=n.length,a=0;a=0&&n[a].node1.dataIndex>=0&&n[a].node2.dataIndex>=0&&e.call(t,n[a],a)},r.prototype.breadthFirstTraverse=function(e,t,n,i){if(t instanceof qu||(t=this._nodesMap[Xh(t)]),!!t){for(var a=n==="out"?"outEdges":n==="in"?"inEdges":"edges",o=0;o=0&&l.node2.dataIndex>=0});for(var a=0,o=i.length;a=0&&this[r][e].setItemVisual(this.dataIndex,t,n)},getVisual:function(t){return this[r][e].getItemVisual(this.dataIndex,t)},setLayout:function(t,n){this.dataIndex>=0&&this[r][e].setItemLayout(this.dataIndex,t,n)},getLayout:function(){return this[r][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[r][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[r][e].getRawIndex(this.dataIndex)}}}ir(qu,l6("hostGraph","data"));ir(s6,l6("hostGraph","edgeData"));const Q0e=Z0e;function u6(r,e,t,n,i){for(var a=new Q0e(n),o=0;o "+f)),u++)}var d=t.get("coordinateSystem"),p;if(d==="cartesian2d"||d==="polar")p=Us(r,t);else{var g=Eg.get(d),v=g?g.dimensions||[]:[];pt(v,"value")<0&&v.concat(["value"]);var m=Pg(r,{coordDimensions:v,encodeDefine:t.getEncode()}).dimensions;p=new vi(m,t),p.initData(r)}var y=new vi(["value"],t);return y.initData(l,s),i&&i(p,y),W8({mainData:p,struct:a,structAttr:"graph",datas:{node:p,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var J0e=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments);var n=this;function i(){return n._categoriesData}this.legendVisualProvider=new Fg(i,i),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},e.prototype.mergeOption=function(t){r.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(t){r.prototype.mergeDefaultAndTheme.apply(this,arguments),zc(t,"edgeLabel",["show"])},e.prototype.getInitialData=function(t,n){var i=t.edges||t.links||[],a=t.data||t.nodes||[],o=this;if(a&&i){N0e(this);var s=u6(a,i,this,!0,l);return k(s.edges,function(u){k0e(u.node1,u.node2,this,u.dataIndex)},this),s.data}function l(u,c){u.wrapMethod("getItemModel",function(p){var g=o._categoriesModels,v=p.getShallow("category"),m=g[v];return m&&(m.parentModel=p.parentModel,p.parentModel=m),p});var h=vn.prototype.getModel;function f(p,g){var v=h.call(this,p,g);return v.resolveParentPath=d,v}c.wrapMethod("getItemModel",function(p){return p.resolveParentPath=d,p.getModel=f,p});function d(p){if(p&&(p[0]==="label"||p[1]==="label")){var g=p.slice();return p[0]==="label"?g[0]="edgeLabel":p[1]==="label"&&(g[1]="edgeLabel"),g}return p}}},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.getCategoriesData=function(){return this._categoriesData},e.prototype.formatTooltip=function(t,n,i){if(i==="edge"){var a=this.getData(),o=this.getDataParams(t,i),s=a.graph.getEdgeByIndex(t),l=a.getName(s.node1.dataIndex),u=a.getName(s.node2.dataIndex),c=[];return l!=null&&c.push(l),u!=null&&c.push(u),Ar("nameValue",{name:c.join(" > "),value:o.value,noValue:o.value==null})}var h=CG({series:this,dataIndex:t,multipleSeries:n});return h},e.prototype._updateCategoriesData=function(){var t=xe(this.option.categories||[],function(i){return i.value!=null?i:pe({value:0},i)}),n=new vi(["value"],this);n.initData(t),this._categoriesData=n,this._categoriesModels=n.mapArray(function(i){return n.getItemModel(i)})},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.isAnimationEnabled=function(){return r.prototype.isAnimationEnabled.call(this)&&!(this.get("layout")==="force"&&this.get(["force","layoutAnimation"]))},e.type="series.graph",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(En);const e_e=J0e;var t_e={type:"graphRoam",event:"graphRoam",update:"none"};function n_e(r){r.registerChartView(K0e),r.registerSeriesModel(e_e),r.registerProcessor(L0e),r.registerVisual(P0e),r.registerVisual(R0e),r.registerLayout(O0e),r.registerLayout(r.PRIORITY.VISUAL.POST_CHART_LAYOUT,B0e),r.registerLayout(U0e),r.registerCoordinateSystem("graphView",{dimensions:zg.dimensions,create:G0e}),r.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},qn),r.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},qn),r.registerAction(t_e,function(e,t,n){t.eachComponent({mainType:"series",query:e},function(i){var a=i.coordinateSystem,o=rE(a,e,void 0,n);i.setCenter&&i.setCenter(o.center),i.setZoom&&i.setZoom(o.zoom)})})}var r_e=function(){function r(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return r}(),i_e=function(r){ae(e,r);function e(t){var n=r.call(this,t)||this;return n.type="pointer",n}return e.prototype.getDefaultShape=function(){return new r_e},e.prototype.buildPath=function(t,n){var i=Math.cos,a=Math.sin,o=n.r,s=n.width,l=n.angle,u=n.x-i(l)*s*(s>=o/3?1:2),c=n.y-a(l)*s*(s>=o/3?1:2);l=n.angle-Math.PI/2,t.moveTo(u,c),t.lineTo(n.x+i(l)*s,n.y+a(l)*s),t.lineTo(n.x+i(n.angle)*o,n.y+a(n.angle)*o),t.lineTo(n.x-i(l)*s,n.y-a(l)*s),t.lineTo(u,c)},e}(yt);const a_e=i_e;function o_e(r,e){var t=r.get("center"),n=e.getWidth(),i=e.getHeight(),a=Math.min(n,i),o=Pe(t[0],e.getWidth()),s=Pe(t[1],e.getHeight()),l=Pe(r.get("radius"),a/2);return{cx:o,cy:s,r:l}}function Cy(r,e){var t=r==null?"":r+"";return e&&(ke(e)?t=e.replace("{value}",t):qe(e)&&(t=e(r))),t}var s_e=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){this.group.removeAll();var a=t.get(["axisLine","lineStyle","color"]),o=o_e(t,i);this._renderMain(t,n,i,a,o),this._data=t.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(t,n,i,a,o){var s=this.group,l=t.get("clockwise"),u=-t.get("startAngle")/180*Math.PI,c=-t.get("endAngle")/180*Math.PI,h=t.getModel("axisLine"),f=h.get("roundCap"),d=f?b_:Bi,p=h.get("show"),g=h.getModel("lineStyle"),v=g.get("width"),m=[u,c];r2(m,!l),u=m[0],c=m[1];for(var y=c-u,_=u,x=[],S=0;p&&S=C&&(b===0?0:a[b-1][0])Math.PI/2&&(W+=Math.PI)):Q==="tangential"?W=-M-Math.PI/2:Ft(Q)&&(W=Q*Math.PI/180),W===0?h.add(new Ot({style:pn(_,{text:F,x:V,y:H,verticalAlign:E<-.8?"top":E>.8?"bottom":"middle",align:L<-.4?"left":L>.4?"right":"center"},{inheritColor:O}),silent:!0})):h.add(new Ot({style:pn(_,{text:F,x:V,y:H,verticalAlign:"middle",align:"center"},{inheritColor:O}),silent:!0,originX:V,originY:H,rotation:W}))}if(y.get("show")&&I!==x){var N=y.get("distance");N=N?N+c:c;for(var Z=0;Z<=S;Z++){L=Math.cos(M),E=Math.sin(M);var ee=new Cr({shape:{x1:L*(p-N)+f,y1:E*(p-N)+d,x2:L*(p-w-N)+f,y2:E*(p-w-N)+d},silent:!0,style:P});P.stroke==="auto"&&ee.setStyle({stroke:a((I+Z/S)/x)}),h.add(ee),M+=b}M-=b}else M+=C}},e.prototype._renderPointer=function(t,n,i,a,o,s,l,u,c){var h=this.group,f=this._data,d=this._progressEls,p=[],g=t.get(["pointer","show"]),v=t.getModel("progress"),m=v.get("show"),y=t.getData(),_=y.mapDimension("value"),x=+t.get("min"),S=+t.get("max"),A=[x,S],w=[s,l];function M(b,T){var P=y.getItemModel(b),D=P.getModel("pointer"),L=Pe(D.get("width"),o.r),E=Pe(D.get("length"),o.r),I=t.get(["pointer","icon"]),N=D.get("offsetCenter"),R=Pe(N[0],o.r),F=Pe(N[1],o.r),O=D.get("keepAspect"),V;return I?V=rr(I,R-L/2,F-E,L,E,null,O):V=new a_e({shape:{angle:-Math.PI/2,width:L,r:E,x:R,y:F}}),V.rotation=-(T+Math.PI/2),V.x=o.cx,V.y=o.cy,V}function C(b,T){var P=v.get("roundCap"),D=P?b_:Bi,L=v.get("overlap"),E=L?v.get("width"):c/y.count(),I=L?o.r-E:o.r-(b+1)*E,N=L?o.r:o.r-b*E,R=new D({shape:{startAngle:s,endAngle:T,cx:o.cx,cy:o.cy,clockwise:u,r0:I,r:N}});return L&&(R.z2=Kt(y.get(_,b),[x,S],[100,0],!0)),R}(m||g)&&(y.diff(f).add(function(b){var T=y.get(_,b);if(g){var P=M(b,s);Tn(P,{rotation:-((isNaN(+T)?w[0]:Kt(T,A,w,!0))+Math.PI/2)},t),h.add(P),y.setItemGraphicEl(b,P)}if(m){var D=C(b,s),L=v.get("clip");Tn(D,{shape:{endAngle:Kt(T,A,w,L)}},t),h.add(D),_T(t.seriesIndex,y.dataType,b,D),p[b]=D}}).update(function(b,T){var P=y.get(_,b);if(g){var D=f.getItemGraphicEl(T),L=D?D.rotation:s,E=M(b,L);E.rotation=L,zt(E,{rotation:-((isNaN(+P)?w[0]:Kt(P,A,w,!0))+Math.PI/2)},t),h.add(E),y.setItemGraphicEl(b,E)}if(m){var I=d[T],N=I?I.shape.endAngle:s,R=C(b,N),F=v.get("clip");zt(R,{shape:{endAngle:Kt(P,A,w,F)}},t),h.add(R),_T(t.seriesIndex,y.dataType,b,R),p[b]=R}}).execute(),y.each(function(b){var T=y.getItemModel(b),P=T.getModel("emphasis"),D=P.get("focus"),L=P.get("blurScope"),E=P.get("disabled");if(g){var I=y.getItemGraphicEl(b),N=y.getItemVisual(b,"style"),R=N.fill;if(I instanceof Ur){var F=I.style;I.useStyle(pe({image:F.image,x:F.x,y:F.y,width:F.width,height:F.height},N))}else I.useStyle(N),I.type!=="pointer"&&I.setColor(R);I.setStyle(T.getModel(["pointer","itemStyle"]).getItemStyle()),I.style.fill==="auto"&&I.setStyle("fill",a(Kt(y.get(_,b),A,[0,1],!0))),I.z2EmphasisLift=0,Br(I,T),Rn(I,D,L,E)}if(m){var O=p[b];O.useStyle(y.getItemVisual(b,"style")),O.setStyle(T.getModel(["progress","itemStyle"]).getItemStyle()),O.z2EmphasisLift=0,Br(O,T),Rn(O,D,L,E)}}),this._progressEls=p)},e.prototype._renderAnchor=function(t,n){var i=t.getModel("anchor"),a=i.get("show");if(a){var o=i.get("size"),s=i.get("icon"),l=i.get("offsetCenter"),u=i.get("keepAspect"),c=rr(s,n.cx-o/2+Pe(l[0],n.r),n.cy-o/2+Pe(l[1],n.r),o,o,null,u);c.z2=i.get("showAbove")?1:0,c.setStyle(i.getModel("itemStyle").getItemStyle()),this.group.add(c)}},e.prototype._renderTitleAndDetail=function(t,n,i,a,o){var s=this,l=t.getData(),u=l.mapDimension("value"),c=+t.get("min"),h=+t.get("max"),f=new rt,d=[],p=[],g=t.isAnimationEnabled(),v=t.get(["pointer","showAbove"]);l.diff(this._data).add(function(m){d[m]=new Ot({silent:!0}),p[m]=new Ot({silent:!0})}).update(function(m,y){d[m]=s._titleEls[y],p[m]=s._detailEls[y]}).execute(),l.each(function(m){var y=l.getItemModel(m),_=l.get(u,m),x=new rt,S=a(Kt(_,[c,h],[0,1],!0)),A=y.getModel("title");if(A.get("show")){var w=A.get("offsetCenter"),M=o.cx+Pe(w[0],o.r),C=o.cy+Pe(w[1],o.r),b=d[m];b.attr({z2:v?0:2,style:pn(A,{x:M,y:C,text:l.getName(m),align:"center",verticalAlign:"middle"},{inheritColor:S})}),x.add(b)}var T=y.getModel("detail");if(T.get("show")){var P=T.get("offsetCenter"),D=o.cx+Pe(P[0],o.r),L=o.cy+Pe(P[1],o.r),E=Pe(T.get("width"),o.r),I=Pe(T.get("height"),o.r),N=t.get(["progress","show"])?l.getItemVisual(m,"style").fill:S,b=p[m],R=T.get("formatter");b.attr({z2:v?0:2,style:pn(T,{x:D,y:L,text:Cy(_,R),width:isNaN(E)?null:E,height:isNaN(I)?null:I,align:"center",verticalAlign:"middle"},{inheritColor:N})}),LV(b,{normal:T},_,function(O){return Cy(O,R)}),g&&PV(b,m,l,t,{getFormattedLabel:function(O,V,H,Q,W,Z){return Cy(Z?Z.interpolatedValue:_,R)}}),x.add(b)}f.add(x)}),this.group.add(f),this._titleEls=d,this._detailEls=p},e.type="gauge",e}(gn);const l_e=s_e;var u_e=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="itemStyle",t}return e.prototype.getInitialData=function(t,n){return Ld(this,["value"])},e.type="series.gauge",e.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(En);const c_e=u_e;function h_e(r){r.registerChartView(l_e),r.registerSeriesModel(c_e)}var f_e=["itemStyle","opacity"],d_e=function(r){ae(e,r);function e(t,n){var i=r.call(this)||this,a=i,o=new Ui,s=new Ot;return a.setTextContent(s),i.setTextGuideLine(o),i.updateData(t,n,!0),i}return e.prototype.updateData=function(t,n,i){var a=this,o=t.hostModel,s=t.getItemModel(n),l=t.getItemLayout(n),u=s.getModel("emphasis"),c=s.get(f_e);c=c==null?1:c,i||lo(a),a.useStyle(t.getItemVisual(n,"style")),a.style.lineJoin="round",i?(a.setShape({points:l.points}),a.style.opacity=0,Tn(a,{style:{opacity:c}},o,n)):zt(a,{style:{opacity:c},shape:{points:l.points}},o,n),Br(a,s),this._updateLabel(t,n),Rn(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t,n){var i=this,a=this.getTextGuideLine(),o=i.getTextContent(),s=t.hostModel,l=t.getItemModel(n),u=t.getItemLayout(n),c=u.label,h=t.getItemVisual(n,"style"),f=h.fill;zr(o,Sr(l),{labelFetcher:t.hostModel,labelDataIndex:n,defaultOpacity:h.opacity,defaultText:t.getName(n)},{normal:{align:c.textAlign,verticalAlign:c.verticalAlign}}),i.setTextConfig({local:!0,inside:!!c.inside,insideStroke:f,outsideFill:f});var d=c.linePoints;a.setShape({points:d}),i.textGuideLineConfig={anchor:d?new ft(d[0][0],d[0][1]):null},zt(o,{style:{x:c.x,y:c.y}},s,n),o.attr({rotation:c.rotation,originX:c.x,originY:c.y,z2:10}),W2(i,$2(l),{stroke:f})},e}(zi),p_e=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.ignoreLabelLineUpdate=!0,t}return e.prototype.render=function(t,n,i){var a=t.getData(),o=this._data,s=this.group;a.diff(o).add(function(l){var u=new d_e(a,l);a.setItemGraphicEl(l,u),s.add(u)}).update(function(l,u){var c=o.getItemGraphicEl(u);c.updateData(a,l),s.add(c),a.setItemGraphicEl(l,c)}).remove(function(l){var u=o.getItemGraphicEl(l);Xv(u,t,l)}).execute(),this._data=a},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type="funnel",e}(gn);const v_e=p_e;var g_e=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new Fg(Fe(this.getData,this),Fe(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.getInitialData=function(t,n){return Ld(this,{coordDimensions:["value"],encodeDefaulter:ut(A2,this)})},e.prototype._defaultLabelLine=function(t){zc(t,"labelLine",["show"]);var n=t.labelLine,i=t.emphasis.labelLine;n.show=n.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},e.prototype.getDataParams=function(t){var n=this.getData(),i=r.prototype.getDataParams.call(this,t),a=n.mapDimension("value"),o=n.getSum(a);return i.percent=o?+(n.get(a,t)/o*100).toFixed(2):0,i.$vars.push("percent"),i},e.type="series.funnel",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(En);const m_e=g_e;function y_e(r,e){return dr(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function __e(r,e){for(var t=r.mapDimension("value"),n=r.mapArray(t,function(l){return l}),i=[],a=e==="ascending",o=0,s=r.count();oB_e)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([r.offsetX,r.offsetY]);i.behavior!=="none"&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(r){if(!(this._mouseDownPoint||!hw(this,"mousemove"))){var e=this._model,t=e.coordinateSystem.getSlidedAxisExpandWindow([r.offsetX,r.offsetY]),n=t.behavior;n==="jump"&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand(n==="none"?null:{axisExpandWindow:t.axisExpandWindow,animation:n==="jump"?null:{duration:0}})}}};function hw(r,e){var t=r._model;return t.get("axisExpandable")&&t.get("axisExpandTriggerOn")===e}const V_e=z_e;var G_e=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){r.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(t){var n=this.option;t&&ht(n,t,!0),this._initDimensions()},e.prototype.contains=function(t,n){var i=t.get("parallelIndex");return i!=null&&n.getComponent("parallel",i)===this},e.prototype.setAxisExpand=function(t){k(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(n){t.hasOwnProperty(n)&&(this.option[n]=t[n])},this)},e.prototype._initDimensions=function(){var t=this.dimensions=[],n=this.parallelAxisIndex=[],i=jt(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);k(i,function(a){t.push("dim"+a.get("dim")),n.push(a.componentIndex)})},e.type="parallel",e.dependencies=["parallelAxis"],e.layoutMode="box",e.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},e}(Nt);const H_e=G_e;var W_e=function(r){ae(e,r);function e(t,n,i,a,o){var s=r.call(this,t,n,i)||this;return s.type=a||"value",s.axisIndex=o,s}return e.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"},e}(ho);const $_e=W_e;function rh(r,e,t,n,i,a){r=r||0;var o=t[1]-t[0];if(i!=null&&(i=Yh(i,[0,o])),a!=null&&(a=Math.max(a,i!=null?i:0)),n==="all"){var s=Math.abs(e[1]-e[0]);s=Yh(s,[0,o]),i=a=Yh(s,[i,a]),n=0}e[0]=Yh(e[0],t),e[1]=Yh(e[1],t);var l=fw(e,n);e[n]+=r;var u=i||0,c=t.slice();l.sign<0?c[0]+=u:c[1]-=u,e[n]=Yh(e[n],c);var h;return h=fw(e,n),i!=null&&(h.sign!==l.sign||h.spana&&(e[1-n]=e[n]+h.sign*a),e}function fw(r,e){var t=r[e]-r[1-e];return{span:Math.abs(t),sign:t>0?-1:t<0?1:e?-1:1}}function Yh(r,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,r))}var dw=k,h6=Math.min,f6=Math.max,mO=Math.floor,X_e=Math.ceil,yO=Vn,Y_e=Math.PI,q_e=function(){function r(e,t,n){this.type="parallel",this._axesMap=He(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,t,n)}return r.prototype._init=function(e,t,n){var i=e.dimensions,a=e.parallelAxisIndex;dw(i,function(o,s){var l=a[s],u=t.getComponent("parallelAxis",l),c=this._axesMap.set(o,new $_e(o,$1(u),[0,0],u.get("type"),l)),h=c.type==="category";c.onBand=h&&u.get("boundaryGap"),c.inverse=u.get("inverse"),u.axis=c,c.model=u,c.coordinateSystem=u.coordinateSystem=this},this)},r.prototype.update=function(e,t){this._updateAxesFromSeries(this._model,e)},r.prototype.containPoint=function(e){var t=this._makeLayoutInfo(),n=t.axisBase,i=t.layoutBase,a=t.pixelDimIndex,o=e[1-a],s=e[a];return o>=n&&o<=n+t.axisLength&&s>=i&&s<=i+t.layoutLength},r.prototype.getModel=function(){return this._model},r.prototype._updateAxesFromSeries=function(e,t){t.eachSeries(function(n){if(e.contains(n,t)){var i=n.getData();dw(this.dimensions,function(a){var o=this._axesMap.get(a);o.scale.unionExtentFromData(i,i.mapDimension(a)),td(o.scale,o.model)},this)}},this)},r.prototype.resize=function(e,t){this._rect=dr(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},r.prototype.getRect=function(){return this._rect},r.prototype._makeLayoutInfo=function(){var e=this._model,t=this._rect,n=["x","y"],i=["width","height"],a=e.get("layout"),o=a==="horizontal"?0:1,s=t[i[o]],l=[0,s],u=this.dimensions.length,c=Ey(e.get("axisExpandWidth"),l),h=Ey(e.get("axisExpandCount")||0,[0,u]),f=e.get("axisExpandable")&&u>3&&u>h&&h>1&&c>0&&s>0,d=e.get("axisExpandWindow"),p;if(d)p=Ey(d[1]-d[0],l),d[1]=d[0]+p;else{p=Ey(c*(h-1),l);var g=e.get("axisExpandCenter")||mO(u/2);d=[c*g-p/2],d[1]=d[0]+p}var v=(s-p)/(u-h);v<3&&(v=0);var m=[mO(yO(d[0]/c,1))+1,X_e(yO(d[1]/c,1))-1],y=v/c*d[0];return{layout:a,pixelDimIndex:o,layoutBase:t[n[o]],layoutLength:s,axisBase:t[n[1-o]],axisLength:t[i[1-o]],axisExpandable:f,axisExpandWidth:c,axisCollapseWidth:v,axisExpandWindow:d,axisCount:u,winInnerIndices:m,axisExpandWindow0Pos:y}},r.prototype._layoutAxes=function(){var e=this._rect,t=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),a=i.layout;t.each(function(o){var s=[0,i.axisLength],l=o.inverse?1:0;o.setExtent(s[l],s[1-l])}),dw(n,function(o,s){var l=(i.axisExpandable?K_e:j_e)(s,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},c={horizontal:Y_e/2,vertical:0},h=[u[a].x+e.x,u[a].y+e.y],f=c[a],d=ta();jc(d,d,f),Xo(d,d,h),this._axesLayout[o]={position:h,rotation:f,transform:d,axisNameAvailableWidth:l.axisNameAvailableWidth,axisLabelShow:l.axisLabelShow,nameTruncateMaxWidth:l.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},r.prototype.getAxis=function(e){return this._axesMap.get(e)},r.prototype.dataToPoint=function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},r.prototype.eachActiveState=function(e,t,n,i){n==null&&(n=0),i==null&&(i=e.count());var a=this._axesMap,o=this.dimensions,s=[],l=[];k(o,function(v){s.push(e.mapDimension(v)),l.push(a.get(v).model)});for(var u=this.hasAxisBrushed(),c=n;ca*(1-h[0])?(u="jump",l=s-a*(1-h[2])):(l=s-a*h[1])>=0&&(l=s-a*(1-h[1]))<=0&&(l=0),l*=t.axisExpandWidth/c,l?rh(l,i,o,"all"):u="none";else{var d=i[1]-i[0],p=o[1]*s/d;i=[f6(0,p-d/2)],i[1]=h6(o[1],i[0]+d),i[0]=i[1]-d}return{axisExpandWindow:i,behavior:u}},r}();function Ey(r,e){return h6(f6(r,e[0]),e[1])}function j_e(r,e){var t=e.layoutLength/(e.axisCount-1);return{position:t*r,axisNameAvailableWidth:t,axisLabelShow:!0}}function K_e(r,e){var t=e.layoutLength,n=e.axisExpandWidth,i=e.axisCount,a=e.axisCollapseWidth,o=e.winInnerIndices,s,l=a,u=!1,c;return r=0;i--)Pa(n[i])},e.prototype.getActiveState=function(t){var n=this.activeIntervals;if(!n.length)return"normal";if(t==null||isNaN(+t))return"inactive";if(n.length===1){var i=n[0];if(i[0]<=t&&t<=i[1])return"active"}else for(var a=0,o=n.length;ar1e}function _6(r){var e=r.length-1;return e<0&&(e=0),[r[0],r[e]]}function x6(r,e,t,n){var i=new rt;return i.add(new Dt({name:"main",style:mE(t),silent:!0,draggable:!0,cursor:"move",drift:ut(AO,r,e,i,["n","s","w","e"]),ondragend:ut($c,e,{isEnd:!0})})),k(n,function(a){i.add(new Dt({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:ut(AO,r,e,i,a),ondragend:ut($c,e,{isEnd:!0})}))}),i}function S6(r,e,t,n){var i=n.brushStyle.lineWidth||0,a=id(i,i1e),o=t[0][0],s=t[1][0],l=o-i/2,u=s-i/2,c=t[0][1],h=t[1][1],f=c-a+i/2,d=h-a+i/2,p=c-o,g=h-s,v=p+i,m=g+i;cs(r,e,"main",o,s,p,g),n.transformable&&(cs(r,e,"w",l,u,a,m),cs(r,e,"e",f,u,a,m),cs(r,e,"n",l,u,v,a),cs(r,e,"s",l,d,v,a),cs(r,e,"nw",l,u,a,a),cs(r,e,"ne",f,u,a,a),cs(r,e,"sw",l,d,a,a),cs(r,e,"se",f,d,a,a))}function uM(r,e){var t=e.__brushOption,n=t.transformable,i=e.childAt(0);i.useStyle(mE(t)),i.attr({silent:!n,cursor:n?"move":"default"}),k([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=e.childOfName(a.join("")),s=a.length===1?cM(r,a[0]):h1e(r,a);o&&o.attr({silent:!n,invisible:!n,cursor:n?o1e[s]+"-resize":null})})}function cs(r,e,t,n,i,a,o){var s=e.childOfName(t);s&&s.setShape(d1e(yE(r,e,[[n,i],[n+a,i+o]])))}function mE(r){return Ke({strokeNoScale:!0},r.brushStyle)}function A6(r,e,t,n){var i=[sg(r,t),sg(e,n)],a=[id(r,t),id(e,n)];return[[i[0],a[0]],[i[1],a[1]]]}function c1e(r){return Lc(r.group)}function cM(r,e){var t={w:"left",e:"right",n:"top",s:"bottom"},n={left:"w",right:"e",top:"n",bottom:"s"},i=E1(t[e],c1e(r));return n[i]}function h1e(r,e){var t=[cM(r,e[0]),cM(r,e[1])];return(t[0]==="e"||t[0]==="w")&&t.reverse(),t.join("")}function AO(r,e,t,n,i,a){var o=t.__brushOption,s=r.toRectRange(o.range),l=w6(e,i,a);k(n,function(u){var c=a1e[u];s[c[0]][c[1]]+=l[c[0]]}),o.range=r.fromRectRange(A6(s[0][0],s[1][0],s[0][1],s[1][1])),pE(e,t),$c(e,{isEnd:!1})}function f1e(r,e,t,n){var i=e.__brushOption.range,a=w6(r,t,n);k(i,function(o){o[0]+=a[0],o[1]+=a[1]}),pE(r,e),$c(r,{isEnd:!1})}function w6(r,e,t){var n=r.group,i=n.transformCoordToLocal(e,t),a=n.transformCoordToLocal(0,0);return[i[0]-a[0],i[1]-a[1]]}function yE(r,e,t){var n=y6(r,e);return n&&n!==Wc?n.clipPath(t,r._transform):Je(t)}function d1e(r){var e=sg(r[0][0],r[1][0]),t=sg(r[0][1],r[1][1]),n=id(r[0][0],r[1][0]),i=id(r[0][1],r[1][1]);return{x:e,y:t,width:n-e,height:i-t}}function p1e(r,e,t){if(!(!r._brushType||g1e(r,e.offsetX,e.offsetY))){var n=r._zr,i=r._covers,a=gE(r,e,t);if(!r._dragging)for(var o=0;on.getWidth()||t<0||t>n.getHeight()}var Z1={lineX:TO(0),lineY:TO(1),rect:{createCover:function(r,e){function t(n){return n}return x6({toRectRange:t,fromRectRange:t},r,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(r){var e=_6(r);return A6(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(r,e,t,n){S6(r,e,t,n)},updateCommon:uM,contain:fM},polygon:{createCover:function(r,e){var t=new rt;return t.add(new Ui({name:"main",style:mE(e),silent:!0})),t},getCreatingRange:function(r){return r},endCreating:function(r,e){e.remove(e.childAt(0)),e.add(new zi({name:"main",draggable:!0,drift:ut(f1e,r,e),ondragend:ut($c,r,{isEnd:!0})}))},updateCoverShape:function(r,e,t,n){e.childAt(0).setShape({points:yE(r,e,t)})},updateCommon:uM,contain:fM}};function TO(r){return{createCover:function(e,t){return x6({toRectRange:function(n){var i=[n,[0,100]];return r&&i.reverse(),i},fromRectRange:function(n){return n[r]}},e,t,[[["w"],["e"]],[["n"],["s"]]][r])},getCreatingRange:function(e){var t=_6(e),n=sg(t[0][r],t[1][r]),i=id(t[0][r],t[1][r]);return[n,i]},updateCoverShape:function(e,t,n,i){var a,o=y6(e,t);if(o!==Wc&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(r);else{var s=e._zr;a=[0,[s.getWidth(),s.getHeight()][1-r]]}var l=[n,a];r&&l.reverse(),S6(e,t,l,i)},updateCommon:uM,contain:fM}}const _E=l1e;function T6(r){return r=xE(r),function(e){return MV(e,r)}}function M6(r,e){return r=xE(r),function(t){var n=e!=null?e:t,i=n?r.width:r.height,a=n?r.x:r.y;return[a,a+(i||0)]}}function C6(r,e,t){var n=xE(r);return function(i,a){return n.contain(a[0],a[1])&&!Y1(i,e,t)}}function xE(r){return dt.create(r)}var m1e=["axisLine","axisTickLabel","axisName"],y1e=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,n){r.prototype.init.apply(this,arguments),(this._brushController=new _E(n.getZr())).on("brush",Fe(this._onBrush,this))},e.prototype.render=function(t,n,i,a){if(!_1e(t,n,a)){this.axisModel=t,this.api=i,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new rt,this.group.add(this._axisGroup),!!t.get("show")){var s=S1e(t,n),l=s.coordinateSystem,u=t.getAreaSelectStyle(),c=u.width,h=t.axis.dim,f=l.getAxisLayout(h),d=pe({strokeContainThreshold:c},f),p=new ks(t,d);k(m1e,p.add,p),this._axisGroup.add(p.getGroup()),this._refreshBrushController(d,u,t,s,c,i),Mg(o,this._axisGroup,t)}}},e.prototype._refreshBrushController=function(t,n,i,a,o,s){var l=i.axis.getExtent(),u=l[1]-l[0],c=Math.min(30,Math.abs(u)*.1),h=dt.create({x:l[0],y:-o/2,width:u,height:o});h.x-=c,h.width+=2*c,this._brushController.mount({enableGlobalPan:!0,rotation:t.rotation,x:t.position[0],y:t.position[1]}).setPanels([{panelId:"pl",clipPath:T6(h),isTargetByCursor:C6(h,s,a),getLinearBrushOtherExtent:M6(h,0)}]).enableBrush({brushType:"lineX",brushStyle:n,removeOnClick:!0}).updateCovers(x1e(i))},e.prototype._onBrush=function(t){var n=t.areas,i=this.axisModel,a=i.axis,o=xe(n,function(s){return[a.coordToData(s.range[0],!0),a.coordToData(s.range[1],!0)]});(!i.option.realtime===t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:o})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(kn);function _1e(r,e,t){return t&&t.type==="axisAreaSelect"&&e.findComponents({mainType:"parallelAxis",query:t})[0]===r}function x1e(r){var e=r.axis;return xe(r.activeIntervals,function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}})}function S1e(r,e){return e.getComponent("parallel",r.get("parallelIndex"))}const A1e=y1e;var w1e={type:"axisAreaSelect",event:"axisAreaSelected"};function b1e(r){r.registerAction(w1e,function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},function(n){n.axis.model.setActiveIntervals(e.intervals)})}),r.registerAction("parallelAxisExpand",function(e,t){t.eachComponent({mainType:"parallel",query:e},function(n){n.setAxisExpand(e)})})}var T1e={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function E6(r){r.registerComponentView(V_e),r.registerComponentModel(H_e),r.registerCoordinateSystem("parallel",e1e),r.registerPreprocessor(k_e),r.registerComponentModel(_O),r.registerComponentView(A1e),rd(r,"parallel",_O,T1e),b1e(r)}function M1e(r){gt(E6),r.registerChartView(C_e),r.registerSeriesModel(R_e),r.registerVisual(r.PRIORITY.VISUAL.BRUSH,N_e)}var C1e=function(){function r(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return r}(),E1e=function(r){ae(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new C1e},e.prototype.buildPath=function(t,n){var i=n.extent;t.moveTo(n.x1,n.y1),t.bezierCurveTo(n.cpx1,n.cpy1,n.cpx2,n.cpy2,n.x2,n.y2),n.orient==="vertical"?(t.lineTo(n.x2+i,n.y2),t.bezierCurveTo(n.cpx2+i,n.cpy2,n.cpx1+i,n.cpy1,n.x1+i,n.y1)):(t.lineTo(n.x2,n.y2+i),t.bezierCurveTo(n.cpx2,n.cpy2+i,n.cpx1,n.cpy1+i,n.x1,n.y1+i)),t.closePath()},e.prototype.highlight=function(){Ds(this)},e.prototype.downplay=function(){Is(this)},e}(yt),L1e=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._focusAdjacencyDisabled=!1,t}return e.prototype.render=function(t,n,i){var a=this,o=t.getGraph(),s=this.group,l=t.layoutInfo,u=l.width,c=l.height,h=t.getData(),f=t.getData("edge"),d=t.get("orient");this._model=t,s.removeAll(),s.x=l.x,s.y=l.y,o.eachEdge(function(p){var g=new E1e,v=at(g);v.dataIndex=p.dataIndex,v.seriesIndex=t.seriesIndex,v.dataType="edge";var m=p.getModel(),y=m.getModel("lineStyle"),_=y.get("curveness"),x=p.node1.getLayout(),S=p.node1.getModel(),A=S.get("localX"),w=S.get("localY"),M=p.node2.getLayout(),C=p.node2.getModel(),b=C.get("localX"),T=C.get("localY"),P=p.getLayout(),D,L,E,I,N,R,F,O;g.shape.extent=Math.max(1,P.dy),g.shape.orient=d,d==="vertical"?(D=(A!=null?A*u:x.x)+P.sy,L=(w!=null?w*c:x.y)+x.dy,E=(b!=null?b*u:M.x)+P.ty,I=T!=null?T*c:M.y,N=D,R=L*(1-_)+I*_,F=E,O=L*_+I*(1-_)):(D=(A!=null?A*u:x.x)+x.dx,L=(w!=null?w*c:x.y)+P.sy,E=b!=null?b*u:M.x,I=(T!=null?T*c:M.y)+P.ty,N=D*(1-_)+E*_,R=L,F=D*_+E*(1-_),O=I),g.setShape({x1:D,y1:L,x2:E,y2:I,cpx1:N,cpy1:R,cpx2:F,cpy2:O}),g.useStyle(y.getItemStyle()),MO(g.style,d,p);var V=""+m.get("value"),H=Sr(m,"edgeLabel");zr(g,H,{labelFetcher:{getFormattedLabel:function(Z,ee,he,le,re,be){return t.getFormattedLabel(Z,ee,"edge",le,Go(re,H.normal&&H.normal.get("formatter"),V),be)}},labelDataIndex:p.dataIndex,defaultText:V}),g.setTextConfig({position:"inside"});var Q=m.getModel("emphasis");Br(g,m,"lineStyle",function(Z){var ee=Z.getItemStyle();return MO(ee,d,p),ee}),s.add(g),f.setItemGraphicEl(p.dataIndex,g);var W=Q.get("focus");Rn(g,W==="adjacency"?p.getAdjacentDataIndices():W==="trajectory"?p.getTrajectoryDataIndices():W,Q.get("blurScope"),Q.get("disabled"))}),o.eachNode(function(p){var g=p.getLayout(),v=p.getModel(),m=v.get("localX"),y=v.get("localY"),_=v.getModel("emphasis"),x=v.get(["itemStyle","borderRadius"])||0,S=new Dt({shape:{x:m!=null?m*u:g.x,y:y!=null?y*c:g.y,width:g.dx,height:g.dy,r:x},style:v.getModel("itemStyle").getItemStyle(),z2:10});zr(S,Sr(v),{labelFetcher:{getFormattedLabel:function(w,M){return t.getFormattedLabel(w,M,"node")}},labelDataIndex:p.dataIndex,defaultText:p.id}),S.disableLabelAnimation=!0,S.setStyle("fill",p.getVisual("color")),S.setStyle("decal",p.getVisual("style").decal),Br(S,v),s.add(S),h.setItemGraphicEl(p.dataIndex,S),at(S).dataType="node";var A=_.get("focus");Rn(S,A==="adjacency"?p.getAdjacentDataIndices():A==="trajectory"?p.getTrajectoryDataIndices():A,_.get("blurScope"),_.get("disabled"))}),h.eachItemGraphicEl(function(p,g){var v=h.getItemModel(g);v.get("draggable")&&(p.drift=function(m,y){a._focusAdjacencyDisabled=!0,this.shape.x+=m,this.shape.y+=y,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:t.id,dataIndex:h.getRawIndex(g),localX:this.shape.x/u,localY:this.shape.y/c})},p.ondragend=function(){a._focusAdjacencyDisabled=!1},p.draggable=!0,p.cursor="move")}),!this._data&&t.isAnimationEnabled()&&s.setClipPath(P1e(s.getBoundingRect(),t,function(){s.removeClipPath()})),this._data=t.getData()},e.prototype.dispose=function(){},e.type="sankey",e}(gn);function MO(r,e,t){switch(r.fill){case"source":r.fill=t.node1.getVisual("color"),r.decal=t.node1.getVisual("style").decal;break;case"target":r.fill=t.node2.getVisual("color"),r.decal=t.node2.getVisual("style").decal;break;case"gradient":var n=t.node1.getVisual("color"),i=t.node2.getVisual("color");ke(n)&&ke(i)&&(r.fill=new Ul(0,0,+(e==="horizontal"),+(e==="vertical"),[{color:n,offset:0},{color:i,offset:1}]))}}function P1e(r,e,t){var n=new Dt({shape:{x:r.x-10,y:r.y-10,width:0,height:r.height+20}});return Tn(n,{shape:{width:r.width+20}},e,t),n}const R1e=L1e;var D1e=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,n){var i=t.edges||t.links||[],a=t.data||t.nodes||[],o=t.levels||[];this.levelModels=[];for(var s=this.levelModels,l=0;l=0&&(s[o[l].depth]=new vn(o[l],this,n));var u=u6(a,i,this,!0,c);return u.data;function c(h,f){h.wrapMethod("getItemModel",function(d,p){var g=d.parentModel,v=g.getData().getItemLayout(p);if(v){var m=v.depth,y=g.levelModels[m];y&&(d.parentModel=y)}return d}),f.wrapMethod("getItemModel",function(d,p){var g=d.parentModel,v=g.getGraph().getEdgeByIndex(p),m=v.node1.getLayout();if(m){var y=m.depth,_=g.levelModels[y];_&&(d.parentModel=_)}return d})}},e.prototype.setNodePosition=function(t,n){var i=this.option.data||this.option.nodes,a=i[t];a.localX=n[0],a.localY=n[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(t,n,i){function a(d){return isNaN(d)||d==null}if(i==="edge"){var o=this.getDataParams(t,i),s=o.data,l=o.value,u=s.source+" -- "+s.target;return Ar("nameValue",{name:u,value:l,noValue:a(l)})}else{var c=this.getGraph().getNodeByIndex(t),h=c.getLayout().value,f=this.getDataParams(t,i).data.name;return Ar("nameValue",{name:f!=null?f+"":null,value:h,noValue:a(h)})}},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(t,n){var i=r.prototype.getDataParams.call(this,t,n);if(i.value==null&&n==="node"){var a=this.getGraph().getNodeByIndex(t),o=a.getLayout().value;i.value=o}return i},e.type="series.sankey",e.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},e}(En);const I1e=D1e;function N1e(r,e){r.eachSeriesByType("sankey",function(t){var n=t.get("nodeWidth"),i=t.get("nodeGap"),a=k1e(t,e);t.layoutInfo=a;var o=a.width,s=a.height,l=t.getGraph(),u=l.nodes,c=l.edges;F1e(u);var h=jt(u,function(g){return g.getLayout().value===0}),f=h.length!==0?0:t.get("layoutIterations"),d=t.get("orient"),p=t.get("nodeAlign");O1e(u,c,n,i,o,s,f,d,p)})}function k1e(r,e){return dr(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function O1e(r,e,t,n,i,a,o,s,l){B1e(r,e,t,i,a,s,l),G1e(r,e,a,i,n,o,s),Z1e(r,s)}function F1e(r){k(r,function(e){var t=Hl(e.outEdges,P_),n=Hl(e.inEdges,P_),i=e.getValue()||0,a=Math.max(t,n,i);e.setLayout({value:a},!0)})}function B1e(r,e,t,n,i,a,o){for(var s=[],l=[],u=[],c=[],h=0,f=0;f=0;m&&v.depth>d&&(d=v.depth),g.setLayout({depth:m?v.depth:h},!0),a==="vertical"?g.setLayout({dy:t},!0):g.setLayout({dx:t},!0);for(var y=0;yh-1?d:h-1;o&&o!=="left"&&z1e(r,o,a,w);var M=a==="vertical"?(i-t)/w:(n-t)/w;V1e(r,M,a)}function L6(r){var e=r.hostGraph.data.getRawDataItem(r.dataIndex);return e.depth!=null&&e.depth>=0}function z1e(r,e,t,n){if(e==="right"){for(var i=[],a=r,o=0;a.length;){for(var s=0;s0;a--)l*=.99,$1e(s,l,o),pw(s,i,t,n,o),K1e(s,l,o),pw(s,i,t,n,o)}function H1e(r,e){var t=[],n=e==="vertical"?"y":"x",i=vT(r,function(a){return a.getLayout()[n]});return i.keys.sort(function(a,o){return a-o}),k(i.keys,function(a){t.push(i.buckets.get(a))}),t}function W1e(r,e,t,n,i,a){var o=1/0;k(r,function(s){var l=s.length,u=0;k(s,function(h){u+=h.getLayout().value});var c=a==="vertical"?(n-(l-1)*i)/u:(t-(l-1)*i)/u;c0&&(s=l.getLayout()[a]+u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),c=l.getLayout()[a]+l.getLayout()[f]+e;var p=i==="vertical"?n:t;if(u=c-e-p,u>0){s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),c=s;for(var d=h-2;d>=0;--d)l=o[d],u=l.getLayout()[a]+l.getLayout()[f]+e-c,u>0&&(s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),c=l.getLayout()[a]}})}function $1e(r,e,t){k(r.slice().reverse(),function(n){k(n,function(i){if(i.outEdges.length){var a=Hl(i.outEdges,X1e,t)/Hl(i.outEdges,P_);if(isNaN(a)){var o=i.outEdges.length;a=o?Hl(i.outEdges,Y1e,t)/o:0}if(t==="vertical"){var s=i.getLayout().x+(a-eu(i,t))*e;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-eu(i,t))*e;i.setLayout({y:l},!0)}}})})}function X1e(r,e){return eu(r.node2,e)*r.getValue()}function Y1e(r,e){return eu(r.node2,e)}function q1e(r,e){return eu(r.node1,e)*r.getValue()}function j1e(r,e){return eu(r.node1,e)}function eu(r,e){return e==="vertical"?r.getLayout().x+r.getLayout().dx/2:r.getLayout().y+r.getLayout().dy/2}function P_(r){return r.getValue()}function Hl(r,e,t){for(var n=0,i=r.length,a=-1;++ao&&(o=l)}),k(n,function(s){var l=new Fr({type:"color",mappingMethod:"linear",dataExtent:[a,o],visual:e.get("color")}),u=l.mapValueToVisual(s.getLayout().value),c=s.getModel().get(["itemStyle","color"]);c!=null?(s.setVisual("color",c),s.setVisual("style",{fill:c})):(s.setVisual("color",u),s.setVisual("style",{fill:u}))})}i.length&&k(i,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function J1e(r){r.registerChartView(R1e),r.registerSeriesModel(I1e),r.registerLayout(N1e),r.registerVisual(Q1e),r.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},function(n){n.setNodePosition(e.dataIndex,[e.localX,e.localY])})})}var P6=function(){function r(){}return r.prototype._hasEncodeRule=function(e){var t=this.getEncode();return t&&t.get(e)!=null},r.prototype.getInitialData=function(e,t){var n,i=t.getComponent("xAxis",this.get("xAxisIndex")),a=t.getComponent("yAxis",this.get("yAxisIndex")),o=i.get("type"),s=a.get("type"),l;o==="category"?(e.layout="horizontal",n=i.getOrdinalMeta(),l=!this._hasEncodeRule("x")):s==="category"?(e.layout="vertical",n=a.getOrdinalMeta(),l=!this._hasEncodeRule("y")):e.layout=e.layout||"horizontal";var u=["x","y"],c=e.layout==="horizontal"?0:1,h=this._baseAxisDim=u[c],f=u[1-c],d=[i,a],p=d[c].get("type"),g=d[1-c].get("type"),v=e.data;if(v&&l){var m=[];k(v,function(x,S){var A;_e(x)?(A=x.slice(),x.unshift(S)):_e(x.value)?(A=pe({},x),A.value=A.value.slice(),x.value.unshift(S)):A=x,m.push(A)}),e.data=m}var y=this.defaultValueDimensions,_=[{name:h,type:y_(p),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:f,type:y_(g),dimsDef:y.slice()}];return Ld(this,{coordDimensions:_,dimensionsCount:y.length+1,encodeDefaulter:ut(QV,_,this)})},r.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},r}(),R6=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],t.visualDrawType="stroke",t}return e.type="series.boxplot",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},e}(En);ir(R6,P6,!0);const exe=R6;var txe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a=t.getData(),o=this.group,s=this._data;this._data||o.removeAll();var l=t.get("layout")==="horizontal"?1:0;a.diff(s).add(function(u){if(a.hasValue(u)){var c=a.getItemLayout(u),h=CO(c,a,u,l,!0);a.setItemGraphicEl(u,h),o.add(h)}}).update(function(u,c){var h=s.getItemGraphicEl(c);if(!a.hasValue(u)){o.remove(h);return}var f=a.getItemLayout(u);h?(lo(h),D6(f,h,a,u)):h=CO(f,a,u,l),o.add(h),a.setItemGraphicEl(u,h)}).remove(function(u){var c=s.getItemGraphicEl(u);c&&o.remove(c)}).execute(),this._data=a},e.prototype.remove=function(t){var n=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl(function(a){a&&n.remove(a)})},e.type="boxplot",e}(gn),nxe=function(){function r(){}return r}(),rxe=function(r){ae(e,r);function e(t){var n=r.call(this,t)||this;return n.type="boxplotBoxPath",n}return e.prototype.getDefaultShape=function(){return new nxe},e.prototype.buildPath=function(t,n){var i=n.points,a=0;for(t.moveTo(i[a][0],i[a][1]),a++;a<4;a++)t.lineTo(i[a][0],i[a][1]);for(t.closePath();ag){var x=[m,_];n.push(x)}}}return{boxData:t,outliers:n}}var hxe={type:"echarts:boxplot",transform:function(e){var t=e.upstream;if(t.sourceFormat!==ai){var n="";qt(n)}var i=cxe(t.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function fxe(r){r.registerSeriesModel(exe),r.registerChartView(axe),r.registerLayout(oxe),r.registerTransform(hxe)}var dxe=["itemStyle","borderColor"],pxe=["itemStyle","borderColor0"],vxe=["itemStyle","borderColorDoji"],gxe=["itemStyle","color"],mxe=["itemStyle","color0"];function SE(r,e){return e.get(r>0?gxe:mxe)}function AE(r,e){return e.get(r===0?vxe:r>0?dxe:pxe)}var yxe={seriesType:"candlestick",plan:Td(),performRawSeries:!0,reset:function(r,e){if(!e.isSeriesFiltered(r)){var t=r.pipelineContext.large;return!t&&{progress:function(n,i){for(var a;(a=n.next())!=null;){var o=i.getItemModel(a),s=i.getItemLayout(a).sign,l=o.getItemStyle();l.fill=SE(s,o),l.stroke=AE(s,o)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");pe(u,l)}}}}}};const _xe=yxe;var xxe=["color","borderColor"],Sxe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},e.prototype.incrementalPrepareRender=function(t,n,i){this._clear(),this._updateDrawMode(t)},e.prototype.incrementalRender=function(t,n,i,a){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(t,n):this._incrementalRenderNormal(t,n)},e.prototype.eachRendered=function(t){ou(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var n=t.pipelineContext.large;(this._isLargeDraw==null||n!==this._isLargeDraw)&&(this._isLargeDraw=n,this._clear())},e.prototype._renderNormal=function(t){var n=t.getData(),i=this._data,a=this.group,o=n.getLayout("isSimpleBox"),s=t.get("clip",!0),l=t.coordinateSystem,u=l.getArea&&l.getArea();this._data||a.removeAll(),n.diff(i).add(function(c){if(n.hasValue(c)){var h=n.getItemLayout(c);if(s&&EO(u,h))return;var f=vw(h,c,!0);Tn(f,{shape:{points:h.ends}},t,c),gw(f,n,c,o),a.add(f),n.setItemGraphicEl(c,f)}}).update(function(c,h){var f=i.getItemGraphicEl(h);if(!n.hasValue(c)){a.remove(f);return}var d=n.getItemLayout(c);if(s&&EO(u,d)){a.remove(f);return}f?(zt(f,{shape:{points:d.ends}},t,c),lo(f)):f=vw(d),gw(f,n,c,o),a.add(f),n.setItemGraphicEl(c,f)}).remove(function(c){var h=i.getItemGraphicEl(c);h&&a.remove(h)}).execute(),this._data=n},e.prototype._renderLarge=function(t){this._clear(),LO(t,this.group);var n=t.get("clip",!0)?Ng(t.coordinateSystem,!1,t):null;n?this.group.setClipPath(n):this.group.removeClipPath()},e.prototype._incrementalRenderNormal=function(t,n){for(var i=n.getData(),a=i.getLayout("isSimpleBox"),o;(o=t.next())!=null;){var s=i.getItemLayout(o),l=vw(s);gw(l,i,o,a),l.incremental=!0,this.group.add(l),this._progressiveEls.push(l)}},e.prototype._incrementalRenderLarge=function(t,n){LO(n,this.group,this._progressiveEls,!0)},e.prototype.remove=function(t){this._clear()},e.prototype._clear=function(){this.group.removeAll(),this._data=null},e.type="candlestick",e}(gn),Axe=function(){function r(){}return r}(),wxe=function(r){ae(e,r);function e(t){var n=r.call(this,t)||this;return n.type="normalCandlestickBox",n}return e.prototype.getDefaultShape=function(){return new Axe},e.prototype.buildPath=function(t,n){var i=n.points;this.__simpleBox?(t.moveTo(i[4][0],i[4][1]),t.lineTo(i[6][0],i[6][1])):(t.moveTo(i[0][0],i[0][1]),t.lineTo(i[1][0],i[1][1]),t.lineTo(i[2][0],i[2][1]),t.lineTo(i[3][0],i[3][1]),t.closePath(),t.moveTo(i[4][0],i[4][1]),t.lineTo(i[5][0],i[5][1]),t.moveTo(i[6][0],i[6][1]),t.lineTo(i[7][0],i[7][1]))},e}(yt);function vw(r,e,t){var n=r.ends;return new wxe({shape:{points:t?bxe(n,r):n},z2:100})}function EO(r,e){for(var t=!0,n=0;nS?T[a]:b[a],ends:L,brushRect:F(A,w,_)})}function N(V,H){var Q=[];return Q[i]=H,Q[a]=V,isNaN(H)||isNaN(V)?[NaN,NaN]:e.dataToPoint(Q)}function R(V,H,Q){var W=H.slice(),Z=H.slice();W[i]=l0(W[i]+n/2,1,!1),Z[i]=l0(Z[i]-n/2,1,!0),Q?V.push(W,Z):V.push(Z,W)}function F(V,H,Q){var W=N(V,Q),Z=N(H,Q);return W[i]-=n/2,Z[i]-=n/2,{x:W[0],y:W[1],width:n,height:Z[1]-W[1]}}function O(V){return V[i]=l0(V[i],1),V}}function p(g,v){for(var m=Bo(g.count*4),y=0,_,x=[],S=[],A,w=v.getStore(),M=!!r.get(["itemStyle","borderColorDoji"]);(A=g.next())!=null;){var C=w.get(s,A),b=w.get(u,A),T=w.get(c,A),P=w.get(h,A),D=w.get(f,A);if(isNaN(C)||isNaN(P)||isNaN(D)){m[y++]=NaN,y+=3;continue}m[y++]=PO(w,A,b,T,c,M),x[i]=C,x[a]=P,_=e.dataToPoint(x,null,S),m[y++]=_?_[0]:NaN,m[y++]=_?_[1]:NaN,x[a]=D,_=e.dataToPoint(x,null,S),m[y++]=_?_[1]:NaN}v.setLayout("largePoints",m)}}};function PO(r,e,t,n,i,a){var o;return t>n?o=-1:t0?r.get(i,e-1)<=n?1:-1:1,o}function Pxe(r,e){var t=r.getBaseAxis(),n,i=t.type==="category"?t.getBandWidth():(n=t.getExtent(),Math.abs(n[1]-n[0])/e.count()),a=Pe(ot(r.get("barMaxWidth"),i),i),o=Pe(ot(r.get("barMinWidth"),1),i),s=r.get("barWidth");return s!=null?Pe(s,i):Math.max(Math.min(i/2,a),o)}const Rxe=Lxe;function Dxe(r){r.registerChartView(Mxe),r.registerSeriesModel(Cxe),r.registerPreprocessor(Exe),r.registerVisual(_xe),r.registerLayout(Rxe)}function RO(r,e){var t=e.rippleEffectColor||e.color;r.eachChild(function(n){n.attr({z:e.z,zlevel:e.zlevel,style:{stroke:e.brushType==="stroke"?t:null,fill:e.brushType==="fill"?t:null}})})}var Ixe=function(r){ae(e,r);function e(t,n){var i=r.call(this)||this,a=new Dg(t,n),o=new rt;return i.add(a),i.add(o),i.updateData(t,n),i}return e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(t){for(var n=t.symbolType,i=t.color,a=t.rippleNumber,o=this.childAt(1),s=0;s0&&(s=this._getLineLength(a)/c*1e3),s!==this._period||l!==this._loop||u!==this._roundTrip){a.stopAnimation();var f=void 0;qe(h)?f=h(i):f=h,a.__t>0&&(f=-s*a.__t),this._animateSymbol(a,s,f,l,u)}this._period=s,this._loop=l,this._roundTrip=u}},e.prototype._animateSymbol=function(t,n,i,a,o){if(n>0){t.__t=0;var s=this,l=t.animate("",a).when(o?n*2:n,{__t:o?2:1}).delay(i).during(function(){s._updateSymbolPosition(t)});a||l.done(function(){s.remove(t)}),l.start()}},e.prototype._getLineLength=function(t){return bl(t.__p1,t.__cp1)+bl(t.__cp1,t.__p2)},e.prototype._updateAnimationPoints=function(t,n){t.__p1=n[0],t.__p2=n[1],t.__cp1=n[2]||[(n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2]},e.prototype.updateData=function(t,n,i){this.childAt(0).updateData(t,n,i),this._updateEffectSymbol(t,n)},e.prototype._updateSymbolPosition=function(t){var n=t.__p1,i=t.__p2,a=t.__cp1,o=t.__t<1?t.__t:2-t.__t,s=[t.x,t.y],l=s.slice(),u=Tr,c=eT;s[0]=u(n[0],a[0],i[0],o),s[1]=u(n[1],a[1],i[1],o);var h=t.__t<1?c(n[0],a[0],i[0],o):c(i[0],a[0],n[0],1-o),f=t.__t<1?c(n[1],a[1],i[1],o):c(i[1],a[1],n[1],1-o);t.rotation=-Math.atan2(f,h)-Math.PI/2,(this._symbolType==="line"||this._symbolType==="rect"||this._symbolType==="roundRect")&&(t.__lastT!==void 0&&t.__lastT=0&&!(a[l]<=n);l--);l=Math.min(l,o-2)}else{for(l=s;ln);l++);l=Math.min(l-1,o-2)}var c=(n-a[l])/(a[l+1]-a[l]),h=i[l],f=i[l+1];t.x=h[0]*(1-c)+c*f[0],t.y=h[1]*(1-c)+c*f[1];var d=t.__t<1?f[0]-h[0]:h[0]-f[0],p=t.__t<1?f[1]-h[1]:h[1]-f[1];t.rotation=-Math.atan2(p,d)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=n,t.ignore=!1}},e}(N6);const Hxe=Gxe;var Wxe=function(){function r(){this.polyline=!1,this.curveness=0,this.segs=[]}return r}(),$xe=function(r){ae(e,r);function e(t){var n=r.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Wxe},e.prototype.buildPath=function(t,n){var i=n.segs,a=n.curveness,o;if(n.polyline)for(o=this._off;o0){t.moveTo(i[o++],i[o++]);for(var l=1;l0){var d=(u+h)/2-(c-f)*a,p=(c+f)/2-(h-u)*a;t.quadraticCurveTo(d,p,h,f)}else t.lineTo(h,f)}this.incremental&&(this._off=o,this.notClear=!0)},e.prototype.findDataIndex=function(t,n){var i=this.shape,a=i.segs,o=i.curveness,s=this.style.lineWidth;if(i.polyline)for(var l=0,u=0;u0)for(var h=a[u++],f=a[u++],d=1;d0){var v=(h+p)/2-(f-g)*o,m=(f+g)/2-(p-h)*o;if(z4(h,f,v,m,p,g,s,t,n))return l}else if(dl(h,f,p,g,s,t,n))return l;l++}return-1},e.prototype.contain=function(t,n){var i=this.transformCoordToLocal(t,n),a=this.getBoundingRect();if(t=i[0],n=i[1],a.contain(t,n)){var o=this.hoverDataIdx=this.findDataIndex(t,n);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var n=this.shape,i=n.segs,a=1/0,o=1/0,s=-1/0,l=-1/0,u=0;u0&&(o.dataIndex=l+e.__startIndex)})},r.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},r}();const Yxe=Xxe;var qxe={seriesType:"lines",plan:Td(),reset:function(r){var e=r.coordinateSystem;if(e){var t=r.get("polyline"),n=r.pipelineContext.large;return{progress:function(i,a){var o=[];if(n){var s=void 0,l=i.end-i.start;if(t){for(var u=0,c=i.start;c0&&(c||u.configLayer(s,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)})),o.updateData(a);var h=t.get("clip",!0)&&Ng(t.coordinateSystem,!1,t);h?this.group.setClipPath(h):this.group.removeClipPath(),this._lastZlevel=s,this._finished=!0},e.prototype.incrementalPrepareRender=function(t,n,i){var a=t.getData(),o=this._updateLineDraw(a,t);o.incrementalPrepareUpdate(a),this._clearLayer(i),this._finished=!1},e.prototype.incrementalRender=function(t,n,i){this._lineDraw.incrementalUpdate(t,n.getData()),this._finished=t.end===n.getData().count()},e.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},e.prototype.updateTransform=function(t,n,i){var a=t.getData(),o=t.pipelineContext;if(!this._finished||o.large||o.progressiveRender)return{update:!0};var s=O6.reset(t,n,i);s.progress&&s.progress({start:0,end:a.count(),count:a.count()},a),this._lineDraw.updateLayout(),this._clearLayer(i)},e.prototype._updateLineDraw=function(t,n){var i=this._lineDraw,a=this._showEffect(n),o=!!n.get("polyline"),s=n.pipelineContext,l=s.large;return(!i||a!==this._hasEffet||o!==this._isPolyline||l!==this._isLargeDraw)&&(i&&i.remove(),i=this._lineDraw=l?new Yxe:new dE(o?a?Hxe:k6:a?N6:fE),this._hasEffet=a,this._isPolyline=o,this._isLargeDraw=l),this.group.add(i.group),i},e.prototype._showEffect=function(t){return!!t.get(["effect","show"])},e.prototype._clearLayer=function(t){var n=t.getZr(),i=n.painter.getType()==="svg";!i&&this._lastZlevel!=null&&n.painter.getLayer(this._lastZlevel).clear(!0)},e.prototype.remove=function(t,n){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(n)},e.prototype.dispose=function(t,n){this.remove(t,n)},e.type="lines",e}(gn);const Kxe=jxe;var Zxe=typeof Uint32Array=="undefined"?Array:Uint32Array,Qxe=typeof Float64Array=="undefined"?Array:Float64Array;function DO(r){var e=r.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(r.data=xe(e,function(t){var n=[t[0].coord,t[1].coord],i={coords:n};return t[0].name&&(i.fromName=t[0].name),t[1].name&&(i.toName=t[1].name),GC([i,t[0],t[1]])}))}var Jxe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="lineStyle",t.visualDrawType="stroke",t}return e.prototype.init=function(t){t.data=t.data||[],DO(t);var n=this._processFlatCoordsArray(t.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(t.data=new Float32Array(n.count)),r.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(t){if(DO(t),t.data){var n=this._processFlatCoordsArray(t.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(t.data=new Float32Array(n.count))}r.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(t){var n=this._processFlatCoordsArray(t.data);n.flatCoords&&(this._flatCoords?(this._flatCoords=Fv(this._flatCoords,n.flatCoords),this._flatCoordsOffset=Fv(this._flatCoordsOffset,n.flatCoordsOffset)):(this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset),t.data=new Float32Array(n.count)),this.getRawData().appendData(t.data)},e.prototype._getCoordsFromItemModel=function(t){var n=this.getData().getItemModel(t),i=n.option instanceof Array?n.option:n.getShallow("coords");return i},e.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[t*2+1]:this._getCoordsFromItemModel(t).length},e.prototype.getLineCoords=function(t,n){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[t*2],a=this._flatCoordsOffset[t*2+1],o=0;o ")})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var t=this.option.progressive;return t==null?this.option.large?1e4:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return t==null?this.option.large?2e4:this.get("progressiveThreshold"):t},e.prototype.getZLevelKey=function(){var t=this.getModel("effect"),n=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&n>0?n+"":""},e.type="series.lines",e.dependencies=["grid","polar","geo","calendar"],e.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},e}(En);const eSe=Jxe;function Ly(r){return r instanceof Array||(r=[r,r]),r}var tSe={seriesType:"lines",reset:function(r){var e=Ly(r.get("symbol")),t=Ly(r.get("symbolSize")),n=r.getData();n.setVisual("fromSymbol",e&&e[0]),n.setVisual("toSymbol",e&&e[1]),n.setVisual("fromSymbolSize",t&&t[0]),n.setVisual("toSymbolSize",t&&t[1]);function i(a,o){var s=a.getItemModel(o),l=Ly(s.getShallow("symbol",!0)),u=Ly(s.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(o,"fromSymbol",l[0]),l[1]&&a.setItemVisual(o,"toSymbol",l[1]),u[0]&&a.setItemVisual(o,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(o,"toSymbolSize",u[1])}return{dataEach:n.hasItemOption?i:null}}};const nSe=tSe;function rSe(r){r.registerChartView(Kxe),r.registerSeriesModel(eSe),r.registerLayout(O6),r.registerVisual(nSe)}var iSe=256,aSe=function(){function r(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=ql.createCanvas();this.canvas=e}return r.prototype.update=function(e,t,n,i,a,o){var s=this._getBrush(),l=this._getGradient(a,"inRange"),u=this._getGradient(a,"outOfRange"),c=this.pointSize+this.blurSize,h=this.canvas,f=h.getContext("2d"),d=e.length;h.width=t,h.height=n;for(var p=0;p0){var P=o(_)?l:u;_>0&&(_=_*b+M),S[A++]=P[T],S[A++]=P[T+1],S[A++]=P[T+2],S[A++]=P[T+3]*_*256}else A+=4}return f.putImageData(x,0,0),h},r.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=ql.createCanvas()),t=this.pointSize+this.blurSize,n=t*2;e.width=n,e.height=n;var i=e.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor="#000",i.beginPath(),i.arc(-t,t,this.pointSize,0,Math.PI*2,!0),i.closePath(),i.fill(),e},r.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,i=n[t]||(n[t]=new Uint8ClampedArray(256*4)),a=[0,0,0,0],o=0,s=0;s<256;s++)e[t](s/255,!0,a),i[o++]=a[0],i[o++]=a[1],i[o++]=a[2],i[o++]=a[3];return i},r}();const oSe=aSe;function sSe(r,e,t){var n=r[1]-r[0];e=xe(e,function(o){return{interval:[(o.interval[0]-r[0])/n,(o.interval[1]-r[0])/n]}});var i=e.length,a=0;return function(o){var s;for(s=a;s=0;s--){var l=e[s].interval;if(l[0]<=o&&o<=l[1]){a=s;break}}return s>=0&&s=e[0]&&n<=e[1]}}function IO(r){var e=r.dimensions;return e[0]==="lng"&&e[1]==="lat"}var uSe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a;n.eachComponent("visualMap",function(s){s.eachTargetSeries(function(l){l===t&&(a=s)})}),this._progressiveEls=null,this.group.removeAll();var o=t.coordinateSystem;o.type==="cartesian2d"||o.type==="calendar"?this._renderOnCartesianAndCalendar(t,i,0,t.getData().count()):IO(o)&&this._renderOnGeo(o,t,a,i)},e.prototype.incrementalPrepareRender=function(t,n,i){this.group.removeAll()},e.prototype.incrementalRender=function(t,n,i,a){var o=n.coordinateSystem;o&&(IO(o)?this.render(n,i,a):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(n,a,t.start,t.end,!0)))},e.prototype.eachRendered=function(t){ou(this._progressiveEls||this.group,t)},e.prototype._renderOnCartesianAndCalendar=function(t,n,i,a,o){var s=t.coordinateSystem,l=th(s,"cartesian2d"),u,c,h,f;if(l){var d=s.getAxis("x"),p=s.getAxis("y");u=d.getBandWidth()+.5,c=p.getBandWidth()+.5,h=d.scale.getExtent(),f=p.scale.getExtent()}for(var g=this.group,v=t.getData(),m=t.getModel(["emphasis","itemStyle"]).getItemStyle(),y=t.getModel(["blur","itemStyle"]).getItemStyle(),_=t.getModel(["select","itemStyle"]).getItemStyle(),x=t.get(["itemStyle","borderRadius"]),S=Sr(t),A=t.getModel("emphasis"),w=A.get("focus"),M=A.get("blurScope"),C=A.get("disabled"),b=l?[v.mapDimension("x"),v.mapDimension("y"),v.mapDimension("value")]:[v.mapDimension("time"),v.mapDimension("value")],T=i;Th[1]||Ef[1])continue;var I=s.dataToPoint([L,E]);P=new Dt({shape:{x:I[0]-u/2,y:I[1]-c/2,width:u,height:c},style:D})}else{if(isNaN(v.get(b[1],T)))continue;P=new Dt({z2:1,shape:s.dataToRect([v.get(b[0],T)]).contentShape,style:D})}if(v.hasItemOption){var N=v.getItemModel(T),R=N.getModel("emphasis");m=R.getModel("itemStyle").getItemStyle(),y=N.getModel(["blur","itemStyle"]).getItemStyle(),_=N.getModel(["select","itemStyle"]).getItemStyle(),x=N.get(["itemStyle","borderRadius"]),w=R.get("focus"),M=R.get("blurScope"),C=R.get("disabled"),S=Sr(N)}P.shape.r=x;var F=t.getRawValue(T),O="-";F&&F[2]!=null&&(O=F[2]+""),zr(P,S,{labelFetcher:t,labelDataIndex:T,defaultOpacity:D.opacity,defaultText:O}),P.ensureState("emphasis").style=m,P.ensureState("blur").style=y,P.ensureState("select").style=_,Rn(P,w,M,C),P.incremental=o,o&&(P.states.emphasis.hoverLayer=!0),g.add(P),v.setItemGraphicEl(T,P),this._progressiveEls&&this._progressiveEls.push(P)}},e.prototype._renderOnGeo=function(t,n,i,a){var o=i.targetVisuals.inRange,s=i.targetVisuals.outOfRange,l=n.getData(),u=this._hmLayer||this._hmLayer||new oSe;u.blurSize=n.get("blurSize"),u.pointSize=n.get("pointSize"),u.minOpacity=n.get("minOpacity"),u.maxOpacity=n.get("maxOpacity");var c=t.getViewRect().clone(),h=t.getRoamTransform();c.applyTransform(h);var f=Math.max(c.x,0),d=Math.max(c.y,0),p=Math.min(c.width+c.x,a.getWidth()),g=Math.min(c.height+c.y,a.getHeight()),v=p-f,m=g-d,y=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],_=l.mapArray(y,function(w,M,C){var b=t.dataToPoint([w,M]);return b[0]-=f,b[1]-=d,b.push(C),b}),x=i.getExtent(),S=i.type==="visualMap.continuous"?lSe(x,i.option.range):sSe(x,i.getPieceList(),i.option.selected);u.update(_,v,m,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},S);var A=new Ur({style:{width:v,height:m,x:f,y:d,image:u.canvas},silent:!0});this.group.add(A)},e.type="heatmap",e}(gn);const cSe=uSe;var hSe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,n){return Us(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var t=Eg.get(this.get("coordinateSystem"));if(t&&t.dimensions)return t.dimensions[0]==="lng"&&t.dimensions[1]==="lat"},e.type="series.heatmap",e.dependencies=["grid","geo","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},e}(En);const fSe=hSe;function dSe(r){r.registerChartView(cSe),r.registerSeriesModel(fSe)}var pSe=["itemStyle","borderWidth"],NO=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],_w=new au,vSe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a=this.group,o=t.getData(),s=this._data,l=t.coordinateSystem,u=l.getBaseAxis(),c=u.isHorizontal(),h=l.master.getRect(),f={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:t,coordSys:l,coordSysExtent:[[h.x,h.x+h.width],[h.y,h.y+h.height]],isHorizontal:c,valueDim:NO[+c],categoryDim:NO[1-+c]};o.diff(s).add(function(p){if(o.hasValue(p)){var g=OO(o,p),v=kO(o,p,g,f),m=FO(o,f,v);o.setItemGraphicEl(p,m),a.add(m),zO(m,f,v)}}).update(function(p,g){var v=s.getItemGraphicEl(g);if(!o.hasValue(p)){a.remove(v);return}var m=OO(o,p),y=kO(o,p,m,f),_=G6(o,y);v&&_!==v.__pictorialShapeStr&&(a.remove(v),o.setItemGraphicEl(p,null),v=null),v?ASe(v,f,y):v=FO(o,f,y,!0),o.setItemGraphicEl(p,v),v.__pictorialSymbolMeta=y,a.add(v),zO(v,f,y)}).remove(function(p){var g=s.getItemGraphicEl(p);g&&BO(s,p,g.__pictorialSymbolMeta.animationModel,g)}).execute();var d=t.get("clip",!0)?Ng(t.coordinateSystem,!1,t):null;return d?a.setClipPath(d):a.removeClipPath(),this._data=o,this.group},e.prototype.remove=function(t,n){var i=this.group,a=this._data;t.get("animation")?a&&a.eachItemGraphicEl(function(o){BO(a,at(o).dataIndex,t,o)}):i.removeAll()},e.type="pictorialBar",e}(gn);function kO(r,e,t,n){var i=r.getItemLayout(e),a=t.get("symbolRepeat"),o=t.get("symbolClip"),s=t.get("symbolPosition")||"start",l=t.get("symbolRotate"),u=(l||0)*Math.PI/180||0,c=t.get("symbolPatternSize")||2,h=t.isAnimationEnabled(),f={dataIndex:e,layout:i,itemModel:t,symbolType:r.getItemVisual(e,"symbol")||"circle",style:r.getItemVisual(e,"style"),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:t.get("symbolRepeatDirection"),symbolPatternSize:c,rotation:u,animationModel:h?t:null,hoverScale:h&&t.get(["emphasis","scale"]),z2:t.getShallow("z",!0)||0};gSe(t,a,i,n,f),mSe(r,e,i,a,o,f.boundingLength,f.pxSign,c,n,f),ySe(t,f.symbolScale,u,n,f);var d=f.symbolSize,p=Jc(t.get("symbolOffset"),d);return _Se(t,d,i,a,o,p,s,f.valueLineWidth,f.boundingLength,f.repeatCutLength,n,f),f}function gSe(r,e,t,n,i){var a=n.valueDim,o=r.get("symbolBoundingData"),s=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),l=s.toGlobalCoord(s.dataToCoord(0)),u=1-+(t[a.wh]<=0),c;if(_e(o)){var h=[xw(s,o[0])-l,xw(s,o[1])-l];h[1]=0?1:-1:c>0?1:-1}function xw(r,e){return r.toGlobalCoord(r.dataToCoord(r.scale.parse(e)))}function mSe(r,e,t,n,i,a,o,s,l,u){var c=l.valueDim,h=l.categoryDim,f=Math.abs(t[h.wh]),d=r.getItemVisual(e,"symbolSize"),p;_e(d)?p=d.slice():d==null?p=["100%","100%"]:p=[d,d],p[h.index]=Pe(p[h.index],f),p[c.index]=Pe(p[c.index],n?f:Math.abs(a)),u.symbolSize=p;var g=u.symbolScale=[p[0]/s,p[1]/s];g[c.index]*=(l.isHorizontal?-1:1)*o}function ySe(r,e,t,n,i){var a=r.get(pSe)||0;a&&(_w.attr({scaleX:e[0],scaleY:e[1],rotation:t}),_w.updateTransform(),a/=_w.getLineScale(),a*=e[n.valueDim.index]),i.valueLineWidth=a||0}function _Se(r,e,t,n,i,a,o,s,l,u,c,h){var f=c.categoryDim,d=c.valueDim,p=h.pxSign,g=Math.max(e[d.index]+s,0),v=g;if(n){var m=Math.abs(l),y=Mr(r.get("symbolMargin"),"15%")+"",_=!1;y.lastIndexOf("!")===y.length-1&&(_=!0,y=y.slice(0,y.length-1));var x=Pe(y,e[d.index]),S=Math.max(g+x*2,0),A=_?0:x*2,w=T4(n),M=w?n:UO((m+A)/S),C=m-M*g;x=C/2/(_?M:Math.max(M-1,1)),S=g+x*2,A=_?0:x*2,!w&&n!=="fixed"&&(M=u?UO((Math.abs(u)+A)/S):0),v=M*S-A,h.repeatTimes=M,h.symbolMargin=x}var b=p*(v/2),T=h.pathPosition=[];T[f.index]=t[f.wh]/2,T[d.index]=o==="start"?b:o==="end"?l-b:l/2,a&&(T[0]+=a[0],T[1]+=a[1]);var P=h.bundlePosition=[];P[f.index]=t[f.xy],P[d.index]=t[d.xy];var D=h.barRectShape=pe({},t);D[d.wh]=p*Math.max(Math.abs(t[d.wh]),Math.abs(T[d.index]+b)),D[f.wh]=t[f.wh];var L=h.clipShape={};L[f.xy]=-t[f.xy],L[f.wh]=c.ecSize[f.wh],L[d.xy]=0,L[d.wh]=t[d.wh]}function F6(r){var e=r.symbolPatternSize,t=rr(r.symbolType,-e/2,-e/2,e,e);return t.attr({culling:!0}),t.type!=="image"&&t.setStyle({strokeNoScale:!0}),t}function B6(r,e,t,n){var i=r.__pictorialBundle,a=t.symbolSize,o=t.valueLineWidth,s=t.pathPosition,l=e.valueDim,u=t.repeatTimes||0,c=0,h=a[e.valueDim.index]+o+t.symbolMargin*2;for(wE(r,function(g){g.__pictorialAnimationIndex=c,g.__pictorialRepeatTimes=u,c0:m<0)&&(y=u-1-g),v[l.index]=h*(y-u/2+.5)+s[l.index],{x:v[0],y:v[1],scaleX:t.symbolScale[0],scaleY:t.symbolScale[1],rotation:t.rotation}}}function z6(r,e,t,n){var i=r.__pictorialBundle,a=r.__pictorialMainPath;a?Pf(a,null,{x:t.pathPosition[0],y:t.pathPosition[1],scaleX:t.symbolScale[0],scaleY:t.symbolScale[1],rotation:t.rotation},t,n):(a=r.__pictorialMainPath=F6(t),i.add(a),Pf(a,{x:t.pathPosition[0],y:t.pathPosition[1],scaleX:0,scaleY:0,rotation:t.rotation},{scaleX:t.symbolScale[0],scaleY:t.symbolScale[1]},t,n))}function U6(r,e,t){var n=pe({},e.barRectShape),i=r.__pictorialBarRect;i?Pf(i,null,{shape:n},e,t):(i=r.__pictorialBarRect=new Dt({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,r.add(i))}function V6(r,e,t,n){if(t.symbolClip){var i=r.__pictorialClipPath,a=pe({},t.clipShape),o=e.valueDim,s=t.animationModel,l=t.dataIndex;if(i)zt(i,{shape:a},s,l);else{a[o.wh]=0,i=new Dt({shape:a}),r.__pictorialBundle.setClipPath(i),r.__pictorialClipPath=i;var u={};u[o.wh]=t.clipShape[o.wh],Zc[n?"updateProps":"initProps"](i,{shape:u},s,l)}}}function OO(r,e){var t=r.getItemModel(e);return t.getAnimationDelayParams=xSe,t.isAnimationEnabled=SSe,t}function xSe(r){return{index:r.__pictorialAnimationIndex,count:r.__pictorialRepeatTimes}}function SSe(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function FO(r,e,t,n){var i=new rt,a=new rt;return i.add(a),i.__pictorialBundle=a,a.x=t.bundlePosition[0],a.y=t.bundlePosition[1],t.symbolRepeat?B6(i,e,t):z6(i,e,t),U6(i,t,n),V6(i,e,t,n),i.__pictorialShapeStr=G6(r,t),i.__pictorialSymbolMeta=t,i}function ASe(r,e,t){var n=t.animationModel,i=t.dataIndex,a=r.__pictorialBundle;zt(a,{x:t.bundlePosition[0],y:t.bundlePosition[1]},n,i),t.symbolRepeat?B6(r,e,t,!0):z6(r,e,t,!0),U6(r,t,!0),V6(r,e,t,!0)}function BO(r,e,t,n){var i=n.__pictorialBarRect;i&&i.removeTextContent();var a=[];wE(n,function(o){a.push(o)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(t=null),k(a,function(o){Kl(o,{scaleX:0,scaleY:0},t,e,function(){n.parent&&n.parent.remove(n)})}),r.setItemGraphicEl(e,null)}function G6(r,e){return[r.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function wE(r,e,t){k(r.__pictorialBundle.children(),function(n){n!==r.__pictorialBarRect&&e.call(t,n)})}function Pf(r,e,t,n,i,a){e&&r.attr(e),n.symbolClip&&!i?t&&r.attr(t):t&&Zc[i?"updateProps":"initProps"](r,t,n.animationModel,n.dataIndex,a)}function zO(r,e,t){var n=t.dataIndex,i=t.itemModel,a=i.getModel("emphasis"),o=a.getModel("itemStyle").getItemStyle(),s=i.getModel(["blur","itemStyle"]).getItemStyle(),l=i.getModel(["select","itemStyle"]).getItemStyle(),u=i.getShallow("cursor"),c=a.get("focus"),h=a.get("blurScope"),f=a.get("scale");wE(r,function(g){if(g instanceof Ur){var v=g.style;g.useStyle(pe({image:v.image,x:v.x,y:v.y,width:v.width,height:v.height},t.style))}else g.useStyle(t.style);var m=g.ensureState("emphasis");m.style=o,f&&(m.scaleX=g.scaleX*1.1,m.scaleY=g.scaleY*1.1),g.ensureState("blur").style=s,g.ensureState("select").style=l,u&&(g.cursor=u),g.z2=t.z2});var d=e.valueDim.posDesc[+(t.boundingLength>0)],p=r.__pictorialBarRect;p.ignoreClip=!0,zr(p,Sr(i),{labelFetcher:e.seriesModel,labelDataIndex:n,defaultText:nd(e.seriesModel.getData(),n),inheritColor:t.style.fill,defaultOpacity:t.style.opacity,defaultOutsidePosition:d}),Rn(r,c,h,a.get("disabled"))}function UO(r){var e=Math.round(r);return Math.abs(r-e)<1e-4?e:Math.ceil(r)}const wSe=vSe;var bSe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t.defaultSymbol="roundRect",t}return e.prototype.getInitialData=function(t){return t.stack=null,r.prototype.getInitialData.apply(this,arguments)},e.type="series.pictorialBar",e.dependencies=["grid"],e.defaultOption=su(w_.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),e}(w_);const TSe=bSe;function MSe(r){r.registerChartView(wSe),r.registerSeriesModel(TSe),r.registerLayout(r.PRIORITY.VISUAL.LAYOUT,ut(xH,"pictorialBar")),r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,SH("pictorialBar"))}var CSe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._layers=[],t}return e.prototype.render=function(t,n,i){var a=t.getData(),o=this,s=this.group,l=t.getLayerSeries(),u=a.getLayout("layoutInfo"),c=u.rect,h=u.boundaryGap;s.x=0,s.y=c.y+h[0];function f(v){return v.name}var d=new Ns(this._layersSeries||[],l,f,f),p=[];d.add(Fe(g,this,"add")).update(Fe(g,this,"update")).remove(Fe(g,this,"remove")).execute();function g(v,m,y){var _=o._layers;if(v==="remove"){s.remove(_[m]);return}for(var x=[],S=[],A,w=l[m].indices,M=0;Ma&&(a=s),n.push(s)}for(var u=0;ua&&(a=h)}return{y0:i,max:a}}function NSe(r){r.registerChartView(LSe),r.registerSeriesModel(RSe),r.registerLayout(DSe),r.registerProcessor(Og("themeRiver"))}var kSe=2,OSe=4,FSe=function(r){ae(e,r);function e(t,n,i,a){var o=r.call(this)||this;o.z2=kSe,o.textConfig={inside:!0},at(o).seriesIndex=n.seriesIndex;var s=new Ot({z2:OSe,silent:t.getModel().get(["label","silent"])});return o.setTextContent(s),o.updateData(!0,t,n,i,a),o}return e.prototype.updateData=function(t,n,i,a,o){this.node=n,n.piece=this,i=i||this._seriesModel,a=a||this._ecModel;var s=this;at(s).dataIndex=n.dataIndex;var l=n.getModel(),u=l.getModel("emphasis"),c=n.getLayout(),h=pe({},c);h.label=null;var f=n.getVisual("style");f.lineJoin="bevel";var d=n.getVisual("decal");d&&(f.decal=ed(d,o));var p=hc(l.getModel("itemStyle"),h,!0);pe(h,p),k(mi,function(y){var _=s.ensureState(y),x=l.getModel([y,"itemStyle"]);_.style=x.getItemStyle();var S=hc(x,h);S&&(_.shape=S)}),t?(s.setShape(h),s.shape.r=c.r0,Tn(s,{shape:{r:c.r}},i,n.dataIndex)):(zt(s,{shape:h},i),lo(s)),s.useStyle(f),this._updateLabel(i);var g=l.getShallow("cursor");g&&s.attr("cursor",g),this._seriesModel=i||this._seriesModel,this._ecModel=a||this._ecModel;var v=u.get("focus"),m=v==="relative"?Fv(n.getAncestorsIndices(),n.getDescendantIndices()):v==="ancestor"?n.getAncestorsIndices():v==="descendant"?n.getDescendantIndices():v;Rn(this,m,u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t){var n=this,i=this.node.getModel(),a=i.getModel("label"),o=this.node.getLayout(),s=o.endAngle-o.startAngle,l=(o.startAngle+o.endAngle)/2,u=Math.cos(l),c=Math.sin(l),h=this,f=h.getTextContent(),d=this.node.dataIndex,p=a.get("minAngle")/180*Math.PI,g=a.get("show")&&!(p!=null&&Math.abs(s)L&&!Vv(I-L)&&I0?(o.virtualPiece?o.virtualPiece.updateData(!1,y,t,n,i):(o.virtualPiece=new GO(y,t,n,i),c.add(o.virtualPiece)),_.piece.off("click"),o.virtualPiece.on("click",function(x){o._rootToNode(_.parentNode)})):o.virtualPiece&&(c.remove(o.virtualPiece),o.virtualPiece=null)}},e.prototype._initEvents=function(){var t=this;this.group.off("click"),this.group.on("click",function(n){var i=!1,a=t.seriesModel.getViewRoot();a.eachNode(function(o){if(!i&&o.piece&&o.piece===n.target){var s=o.getModel().get("nodeClick");if(s==="rootToNode")t._rootToNode(o);else if(s==="link"){var l=o.getModel(),u=l.get("link");if(u){var c=l.get("target",!0)||"_blank";c_(u,c)}}i=!0}})})},e.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:dM,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},e.prototype.containPoint=function(t,n){var i=n.getData(),a=i.getItemLayout(0);if(a){var o=t[0]-a.cx,s=t[1]-a.cy,l=Math.sqrt(o*o+s*s);return l<=a.r&&l>=a.r0}},e.type="sunburst",e}(gn);const VSe=USe;var GSe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t,n){var i={name:t.name,children:t.data};H6(i);var a=this._levelModels=xe(t.levels||[],function(l){return new vn(l,this,n)},this),o=aE.createTree(i,this,s);function s(l){l.wrapMethod("getItemModel",function(u,c){var h=o.getNodeByDataIndex(c),f=a[h.depth];return f&&(u.parentModel=f),u})}return o.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.getDataParams=function(t){var n=r.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treePathInfo=j1(i,this),n},e.prototype.getLevelModel=function(t){return this._levelModels&&this._levelModels[t.depth]},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var n=this.getRawData().tree.root;(!t||t!==n&&!n.contains(t))&&(this._viewRoot=n)},e.prototype.enableAriaDecal=function(){Y8(this)},e.type="series.sunburst",e.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},e}(En);function H6(r){var e=0;k(r.children,function(n){H6(n);var i=n.value;_e(i)&&(i=i[0]),e+=i});var t=r.value;_e(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),_e(r.value)?r.value[0]=t:r.value=t}const HSe=GSe;var WO=Math.PI/180;function WSe(r,e,t){e.eachSeriesByType(r,function(n){var i=n.get("center"),a=n.get("radius");_e(a)||(a=[0,a]),_e(i)||(i=[i,i]);var o=t.getWidth(),s=t.getHeight(),l=Math.min(o,s),u=Pe(i[0],o),c=Pe(i[1],s),h=Pe(a[0],l/2),f=Pe(a[1],l/2),d=-n.get("startAngle")*WO,p=n.get("minAngle")*WO,g=n.getData().tree.root,v=n.getViewRoot(),m=v.depth,y=n.get("sort");y!=null&&W6(v,y);var _=0;k(v.children,function(I){!isNaN(I.getValue())&&_++});var x=v.getValue(),S=Math.PI/(x||_)*2,A=v.depth>0,w=v.height-(A?-1:1),M=(f-h)/(w||1),C=n.get("clockwise"),b=n.get("stillShowZeroSum"),T=C?1:-1,P=function(I,N){if(I){var R=N;if(I!==g){var F=I.getValue(),O=x===0&&b?S:F*S;O1;)o=o.parentNode;var s=i.getColorFromPalette(o.name||o.dataIndex+"",e);return n.depth>1&&ke(s)&&(s=rT(s,(n.depth-1)/(a-1)*.5)),s}r.eachSeriesByType("sunburst",function(n){var i=n.getData(),a=i.tree;a.eachNode(function(o){var s=o.getModel(),l=s.getModel("itemStyle").getItemStyle();l.fill||(l.fill=t(o,n,a.root.height));var u=i.ensureUniqueItemVisual(o.dataIndex,"style");pe(u,l)})})}function YSe(r){r.registerChartView(VSe),r.registerSeriesModel(HSe),r.registerLayout(ut(WSe,"sunburst")),r.registerProcessor(ut(Og,"sunburst")),r.registerVisual(XSe),zSe(r)}var $O={color:"fill",borderColor:"stroke"},qSe={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},bs=Pt(),jSe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},e.prototype.getInitialData=function(t,n){return Us(null,this)},e.prototype.getDataParams=function(t,n,i){var a=r.prototype.getDataParams.call(this,t,n);return i&&(a.info=bs(i).info),a},e.type="series.custom",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},e}(En);const KSe=jSe;function ZSe(r,e){return e=e||[0,0],xe(["x","y"],function(t,n){var i=this.getAxis(t),a=e[n],o=r[n]/2;return i.type==="category"?i.getBandWidth():Math.abs(i.dataToCoord(a-o)-i.dataToCoord(a+o))},this)}function QSe(r){var e=r.master.getRect();return{coordSys:{type:"cartesian2d",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(t){return r.dataToPoint(t)},size:Fe(ZSe,r)}}}function JSe(r,e){return e=e||[0,0],xe([0,1],function(t){var n=e[t],i=r[t]/2,a=[],o=[];return a[t]=n-i,o[t]=n+i,a[1-t]=o[1-t]=e[1-t],Math.abs(this.dataToPoint(a)[t]-this.dataToPoint(o)[t])},this)}function eAe(r){var e=r.getBoundingRect();return{coordSys:{type:"geo",x:e.x,y:e.y,width:e.width,height:e.height,zoom:r.getZoom()},api:{coord:function(t){return r.dataToPoint(t)},size:Fe(JSe,r)}}}function tAe(r,e){var t=this.getAxis(),n=e instanceof Array?e[0]:e,i=(r instanceof Array?r[0]:r)/2;return t.type==="category"?t.getBandWidth():Math.abs(t.dataToCoord(n-i)-t.dataToCoord(n+i))}function nAe(r){var e=r.getRect();return{coordSys:{type:"singleAxis",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(t){return r.dataToPoint(t)},size:Fe(tAe,r)}}}function rAe(r,e){return e=e||[0,0],xe(["Radius","Angle"],function(t,n){var i="get"+t+"Axis",a=this[i](),o=e[n],s=r[n]/2,l=a.type==="category"?a.getBandWidth():Math.abs(a.dataToCoord(o-s)-a.dataToCoord(o+s));return t==="Angle"&&(l=l*Math.PI/180),l},this)}function iAe(r){var e=r.getRadiusAxis(),t=r.getAngleAxis(),n=e.getExtent();return n[0]>n[1]&&n.reverse(),{coordSys:{type:"polar",cx:r.cx,cy:r.cy,r:n[1],r0:n[0]},api:{coord:function(i){var a=e.dataToRadius(i[0]),o=t.dataToAngle(i[1]),s=r.coordToPoint([a,o]);return s.push(a,o*Math.PI/180),s},size:Fe(rAe,r)}}}function aAe(r){var e=r.getRect(),t=r.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:r.getCellWidth(),cellHeight:r.getCellHeight(),rangeInfo:{start:t.start,end:t.end,weeks:t.weeks,dayCount:t.allDay}},api:{coord:function(n,i){return r.dataToPoint(n,i)}}}}function $6(r,e,t,n){return r&&(r.legacy||r.legacy!==!1&&!t&&!n&&e!=="tspan"&&(e==="text"||ze(r,"text")))}function X6(r,e,t){var n=r,i,a,o;if(e==="text")o=n;else{o={},ze(n,"text")&&(o.text=n.text),ze(n,"rich")&&(o.rich=n.rich),ze(n,"textFill")&&(o.fill=n.textFill),ze(n,"textStroke")&&(o.stroke=n.textStroke),ze(n,"fontFamily")&&(o.fontFamily=n.fontFamily),ze(n,"fontSize")&&(o.fontSize=n.fontSize),ze(n,"fontStyle")&&(o.fontStyle=n.fontStyle),ze(n,"fontWeight")&&(o.fontWeight=n.fontWeight),a={type:"text",style:o,silent:!0},i={};var s=ze(n,"textPosition");t?i.position=s?n.textPosition:"inside":s&&(i.position=n.textPosition),ze(n,"textPosition")&&(i.position=n.textPosition),ze(n,"textOffset")&&(i.offset=n.textOffset),ze(n,"textRotation")&&(i.rotation=n.textRotation),ze(n,"textDistance")&&(i.distance=n.textDistance)}return XO(o,r),k(o.rich,function(l){XO(l,l)}),{textConfig:i,textContent:a}}function XO(r,e){e&&(e.font=e.textFont||e.font,ze(e,"textStrokeWidth")&&(r.lineWidth=e.textStrokeWidth),ze(e,"textAlign")&&(r.align=e.textAlign),ze(e,"textVerticalAlign")&&(r.verticalAlign=e.textVerticalAlign),ze(e,"textLineHeight")&&(r.lineHeight=e.textLineHeight),ze(e,"textWidth")&&(r.width=e.textWidth),ze(e,"textHeight")&&(r.height=e.textHeight),ze(e,"textBackgroundColor")&&(r.backgroundColor=e.textBackgroundColor),ze(e,"textPadding")&&(r.padding=e.textPadding),ze(e,"textBorderColor")&&(r.borderColor=e.textBorderColor),ze(e,"textBorderWidth")&&(r.borderWidth=e.textBorderWidth),ze(e,"textBorderRadius")&&(r.borderRadius=e.textBorderRadius),ze(e,"textBoxShadowColor")&&(r.shadowColor=e.textBoxShadowColor),ze(e,"textBoxShadowBlur")&&(r.shadowBlur=e.textBoxShadowBlur),ze(e,"textBoxShadowOffsetX")&&(r.shadowOffsetX=e.textBoxShadowOffsetX),ze(e,"textBoxShadowOffsetY")&&(r.shadowOffsetY=e.textBoxShadowOffsetY))}function YO(r,e,t){var n=r;n.textPosition=n.textPosition||t.position||"inside",t.offset!=null&&(n.textOffset=t.offset),t.rotation!=null&&(n.textRotation=t.rotation),t.distance!=null&&(n.textDistance=t.distance);var i=n.textPosition.indexOf("inside")>=0,a=r.fill||"#000";qO(n,e);var o=n.textFill==null;return i?o&&(n.textFill=t.insideFill||"#fff",!n.textStroke&&t.insideStroke&&(n.textStroke=t.insideStroke),!n.textStroke&&(n.textStroke=a),n.textStrokeWidth==null&&(n.textStrokeWidth=2)):(o&&(n.textFill=r.fill||t.outsideFill||"#000"),!n.textStroke&&t.outsideStroke&&(n.textStroke=t.outsideStroke)),n.text=e.text,n.rich=e.rich,k(e.rich,function(s){qO(s,s)}),n}function qO(r,e){e&&(ze(e,"fill")&&(r.textFill=e.fill),ze(e,"stroke")&&(r.textStroke=e.fill),ze(e,"lineWidth")&&(r.textStrokeWidth=e.lineWidth),ze(e,"font")&&(r.font=e.font),ze(e,"fontStyle")&&(r.fontStyle=e.fontStyle),ze(e,"fontWeight")&&(r.fontWeight=e.fontWeight),ze(e,"fontSize")&&(r.fontSize=e.fontSize),ze(e,"fontFamily")&&(r.fontFamily=e.fontFamily),ze(e,"align")&&(r.textAlign=e.align),ze(e,"verticalAlign")&&(r.textVerticalAlign=e.verticalAlign),ze(e,"lineHeight")&&(r.textLineHeight=e.lineHeight),ze(e,"width")&&(r.textWidth=e.width),ze(e,"height")&&(r.textHeight=e.height),ze(e,"backgroundColor")&&(r.textBackgroundColor=e.backgroundColor),ze(e,"padding")&&(r.textPadding=e.padding),ze(e,"borderColor")&&(r.textBorderColor=e.borderColor),ze(e,"borderWidth")&&(r.textBorderWidth=e.borderWidth),ze(e,"borderRadius")&&(r.textBorderRadius=e.borderRadius),ze(e,"shadowColor")&&(r.textBoxShadowColor=e.shadowColor),ze(e,"shadowBlur")&&(r.textBoxShadowBlur=e.shadowBlur),ze(e,"shadowOffsetX")&&(r.textBoxShadowOffsetX=e.shadowOffsetX),ze(e,"shadowOffsetY")&&(r.textBoxShadowOffsetY=e.shadowOffsetY),ze(e,"textShadowColor")&&(r.textShadowColor=e.textShadowColor),ze(e,"textShadowBlur")&&(r.textShadowBlur=e.textShadowBlur),ze(e,"textShadowOffsetX")&&(r.textShadowOffsetX=e.textShadowOffsetX),ze(e,"textShadowOffsetY")&&(r.textShadowOffsetY=e.textShadowOffsetY))}var Y6={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},jO=wt(Y6);$o(Yo,function(r,e){return r[e]=1,r},{});Yo.join(", ");var R_=["","style","shape","extra"],ad=Pt();function bE(r,e,t,n,i){var a=r+"Animation",o=yd(r,n,i)||{},s=ad(e).userDuring;return o.duration>0&&(o.during=s?Fe(cAe,{el:e,userDuring:s}):null,o.setToFinal=!0,o.scope=r),pe(o,t[a]),o}function p0(r,e,t,n){n=n||{};var i=n.dataIndex,a=n.isInit,o=n.clearStyle,s=t.isAnimationEnabled(),l=ad(r),u=e.style;l.userDuring=e.during;var c={},h={};if(fAe(r,e,h),ZO("shape",e,h),ZO("extra",e,h),!a&&s&&(hAe(r,e,c),KO("shape",r,e,c),KO("extra",r,e,c),dAe(r,e,u,c)),h.style=u,oAe(r,h,o),lAe(r,e),s)if(a){var f={};k(R_,function(p){var g=p?e[p]:e;g&&g.enterFrom&&(p&&(f[p]=f[p]||{}),pe(p?f[p]:f,g.enterFrom))});var d=bE("enter",r,e,t,i);d.duration>0&&r.animateFrom(f,d)}else sAe(r,e,i||0,t,c);q6(r,e),u?r.dirty():r.markRedraw()}function q6(r,e){for(var t=ad(r).leaveToProps,n=0;n0&&r.animateFrom(i,a)}}function lAe(r,e){ze(e,"silent")&&(r.silent=e.silent),ze(e,"ignore")&&(r.ignore=e.ignore),r instanceof ka&&ze(e,"invisible")&&(r.invisible=e.invisible),r instanceof yt&&ze(e,"autoBatch")&&(r.autoBatch=e.autoBatch)}var Ao={},uAe={setTransform:function(r,e){return Ao.el[r]=e,this},getTransform:function(r){return Ao.el[r]},setShape:function(r,e){var t=Ao.el,n=t.shape||(t.shape={});return n[r]=e,t.dirtyShape&&t.dirtyShape(),this},getShape:function(r){var e=Ao.el.shape;if(e)return e[r]},setStyle:function(r,e){var t=Ao.el,n=t.style;return n&&(n[r]=e,t.dirtyStyle&&t.dirtyStyle()),this},getStyle:function(r){var e=Ao.el.style;if(e)return e[r]},setExtra:function(r,e){var t=Ao.el.extra||(Ao.el.extra={});return t[r]=e,this},getExtra:function(r){var e=Ao.el.extra;if(e)return e[r]}};function cAe(){var r=this,e=r.el;if(e){var t=ad(e).userDuring,n=r.userDuring;if(t!==n){r.el=r.userDuring=null;return}Ao.el=e,n(uAe)}}function KO(r,e,t,n){var i=t[r];if(i){var a=e[r],o;if(a){var s=t.transition,l=i.transition;if(l)if(!o&&(o=n[r]={}),Ic(l))pe(o,a);else for(var u=nn(l),c=0;c=0){!o&&(o=n[r]={});for(var d=wt(a),c=0;c=0)){var f=r.getAnimationStyleProps(),d=f?f.style:null;if(d){!a&&(a=n.style={});for(var p=wt(t),u=0;u=0?e.getStore().get(N,E):void 0}var R=e.get(I.name,E),F=I&&I.ordinalMeta;return F?F.categories[R]:R}function A(L,E){E==null&&(E=u);var I=e.getItemVisual(E,"style"),N=I&&I.fill,R=I&&I.opacity,F=y(E,Rl).getItemStyle();N!=null&&(F.fill=N),R!=null&&(F.opacity=R);var O={inheritColor:ke(N)?N:"#000"},V=_(E,Rl),H=pn(V,null,O,!1,!0);H.text=V.getShallow("show")?ot(r.getFormattedLabel(E,Rl),nd(e,E)):null;var Q=l_(V,O,!1);return C(L,F),F=YO(F,H,Q),L&&M(F,L),F.legacy=!0,F}function w(L,E){E==null&&(E=u);var I=y(E,Ts).getItemStyle(),N=_(E,Ts),R=pn(N,null,null,!0,!0);R.text=N.getShallow("show")?Go(r.getFormattedLabel(E,Ts),r.getFormattedLabel(E,Rl),nd(e,E)):null;var F=l_(N,null,!0);return C(L,I),I=YO(I,R,F),L&&M(I,L),I.legacy=!0,I}function M(L,E){for(var I in E)ze(E,I)&&(L[I]=E[I])}function C(L,E){L&&(L.textFill&&(E.textFill=L.textFill),L.textPosition&&(E.textPosition=L.textPosition))}function b(L,E){if(E==null&&(E=u),ze($O,L)){var I=e.getItemVisual(E,"style");return I?I[$O[L]]:null}if(ze(qSe,L))return e.getItemVisual(E,L)}function T(L){if(a.type==="cartesian2d"){var E=a.getBaseAxis();return bde(Ke({axis:E},L))}}function P(){return t.getCurrentSeriesIndices()}function D(L){return v2(L,t)}}function bAe(r){var e={};return k(r.dimensions,function(t){var n=r.getDimensionInfo(t);if(!n.isExtraCoord){var i=n.coordDim,a=e[i]=e[i]||[];a[n.coordDimIndex]=r.getDimensionIndex(t)}}),e}function bw(r,e,t,n,i,a,o){if(!n){a.remove(e);return}var s=LE(r,e,t,n,i,a);return s&&o.setItemGraphicEl(t,s),s&&Rn(s,n.focus,n.blurScope,n.emphasisDisabled),s}function LE(r,e,t,n,i,a){var o=-1,s=e;e&&Q6(e,n,i)&&(o=pt(a.childrenRef(),e),e=null);var l=!e,u=e;u?u.clearStates():(u=CE(n),s&&_Ae(s,u)),n.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),ha.normal.cfg=ha.normal.conOpt=ha.emphasis.cfg=ha.emphasis.conOpt=ha.blur.cfg=ha.blur.conOpt=ha.select.cfg=ha.select.conOpt=null,ha.isLegacy=!1,MAe(u,t,n,i,l,ha),TAe(u,t,n,i,l),EE(r,u,t,n,ha,i,l),ze(n,"info")&&(bs(u).info=n.info);for(var c=0;c=0?a.replaceAt(u,o):a.add(u),u}function Q6(r,e,t){var n=bs(r),i=e.type,a=e.shape,o=e.style;return t.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i==="path"&&RAe(a)&&J6(a)!==n.customPathData||i==="image"&&ze(o,"image")&&o.image!==n.customImagePath}function TAe(r,e,t,n,i){var a=t.clipPath;if(a===!1)r&&r.getClipPath()&&r.removeClipPath();else if(a){var o=r.getClipPath();o&&Q6(o,a,n)&&(o=null),o||(o=CE(a),r.setClipPath(o)),EE(null,o,e,a,null,n,i)}}function MAe(r,e,t,n,i,a){if(!r.isGroup){JO(t,null,a),JO(t,Ts,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(o!=null||s!=null||u!=null||l!=null){var c=r.getTextContent();if(o===!1)c&&r.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},c?c.clearStates():(c=CE(o),r.setTextContent(c)),EE(null,c,e,o,null,n,i);for(var h=o&&o.style,f=0;f=c;d--){var p=e.childAt(d);EAe(e,p,i)}}}function EAe(r,e,t){e&&Q1(e,bs(r).option,t)}function LAe(r){new Ns(r.oldChildren,r.newChildren,eF,eF,r).add(tF).update(tF).remove(PAe).execute()}function eF(r,e){var t=r&&r.name;return t!=null?t:mAe+e}function tF(r,e){var t=this.context,n=r!=null?t.newChildren[r]:null,i=e!=null?t.oldChildren[e]:null;LE(t.api,i,t.dataIndex,n,t.seriesModel,t.group)}function PAe(r){var e=this.context,t=e.oldChildren[r];t&&Q1(t,bs(t).option,e.seriesModel)}function J6(r){return r&&(r.pathData||r.d)}function RAe(r){return r&&(ze(r,"pathData")||ze(r,"d"))}function DAe(r){r.registerChartView(SAe),r.registerSeriesModel(KSe)}var Ju=Pt(),nF=Je,Tw=Fe,IAe=function(){function r(){this._dragging=!1,this.animationThreshold=15}return r.prototype.render=function(e,t,n,i){var a=t.get("value"),o=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=n,!(!i&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var u={};this.makeElOption(u,a,e,t,n);var c=u.graphicKey;c!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=c;var h=this._moveAnimation=this.determineAnimation(e,t);if(!s)s=this._group=new rt,this.createPointerEl(s,u,e,t),this.createLabelEl(s,u,e,t),n.getZr().add(s);else{var f=ut(rF,t,h);this.updatePointerEl(s,u,f),this.updateLabelEl(s,u,f,t)}aF(s,t,!0),this._renderHandle(a)}},r.prototype.remove=function(e){this.clear(e)},r.prototype.dispose=function(e){this.clear(e)},r.prototype.determineAnimation=function(e,t){var n=t.get("animation"),i=e.axis,a=i.type==="category",o=t.get("snap");if(!o&&!a)return!1;if(n==="auto"||n==null){var s=this.animationThreshold;if(a&&i.getBandWidth()>s)return!0;if(o){var l=Q2(e).seriesDataCount,u=i.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return n===!0},r.prototype.makeElOption=function(e,t,n,i,a){},r.prototype.createPointerEl=function(e,t,n,i){var a=t.pointer;if(a){var o=Ju(e).pointerEl=new Zc[a.type](nF(t.pointer));e.add(o)}},r.prototype.createLabelEl=function(e,t,n,i){if(t.label){var a=Ju(e).labelEl=new Ot(nF(t.label));e.add(a),iF(a,i)}},r.prototype.updatePointerEl=function(e,t,n){var i=Ju(e).pointerEl;i&&t.pointer&&(i.setStyle(t.pointer.style),n(i,{shape:t.pointer.shape}))},r.prototype.updateLabelEl=function(e,t,n,i){var a=Ju(e).labelEl;a&&(a.setStyle(t.label.style),n(a,{x:t.label.x,y:t.label.y}),iF(a,i))},r.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var t=this._axisPointerModel,n=this._api.getZr(),i=this._handle,a=t.getModel("handle"),o=t.get("status");if(!a.get("show")||!o||o==="hide"){i&&n.remove(i),this._handle=null;return}var s;this._handle||(s=!0,i=this._handle=Cg(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){Ps(u.event)},onmousedown:Tw(this._onHandleDragMove,this,0,0),drift:Tw(this._onHandleDragMove,this),ondragend:Tw(this._onHandleDragEnd,this)}),n.add(i)),aF(i,t,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");_e(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,Md(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},r.prototype._moveHandleToValue=function(e,t){rF(this._axisPointerModel,!t&&this._moveAnimation,this._handle,Mw(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},r.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(Mw(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(Mw(i)),Ju(n).lastProp=null,this._doDispatchAxisPointer()}},r.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(e){var t=this._payloadInfo,n=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:n.axis.dim,axisIndex:n.componentIndex}]})}},r.prototype._onHandleDragEnd=function(){this._dragging=!1;var e=this._handle;if(e){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},r.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,i=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),i&&t.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),Kv(this,"_doDispatchAxisPointer")},r.prototype.doClear=function(){},r.prototype.buildLabel=function(e,t,n){return n=n||0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}},r}();function rF(r,e,t,n){eW(Ju(t).lastProp,n)||(Ju(t).lastProp=n,e?zt(t,n,r):(t.stopAnimation(),t.attr(n)))}function eW(r,e){if(Qe(r)&&Qe(e)){var t=!0;return k(e,function(n,i){t=t&&eW(r[i],n)}),!!t}else return r===e}function iF(r,e){r[e.get(["label","show"])?"show":"hide"]()}function Mw(r){return{x:r.x||0,y:r.y||0,rotation:r.rotation||0}}function aF(r,e,t){var n=e.get("z"),i=e.get("zlevel");r&&r.traverse(function(a){a.type!=="group"&&(n!=null&&(a.z=n),i!=null&&(a.zlevel=i),a.silent=t)})}const RE=IAe;function DE(r){var e=r.get("type"),t=r.getModel(e+"Style"),n;return e==="line"?(n=t.getLineStyle(),n.fill=null):e==="shadow"&&(n=t.getAreaStyle(),n.stroke=null),n}function tW(r,e,t,n,i){var a=t.get("value"),o=nW(a,e.axis,e.ecModel,t.get("seriesDataIndices"),{precision:t.get(["label","precision"]),formatter:t.get(["label","formatter"])}),s=t.getModel("label"),l=Sd(s.get("padding")||0),u=s.getFont(),c=wg(o,u),h=i.position,f=c.width+l[1]+l[3],d=c.height+l[0]+l[2],p=i.align;p==="right"&&(h[0]-=f),p==="center"&&(h[0]-=f/2);var g=i.verticalAlign;g==="bottom"&&(h[1]-=d),g==="middle"&&(h[1]-=d/2),NAe(h,f,d,n);var v=s.get("backgroundColor");(!v||v==="auto")&&(v=e.get(["axisLine","lineStyle","color"])),r.label={x:h[0],y:h[1],style:pn(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:v}),z2:10}}function NAe(r,e,t,n){var i=n.getWidth(),a=n.getHeight();r[0]=Math.min(r[0]+e,i)-e,r[1]=Math.min(r[1]+t,a)-t,r[0]=Math.max(r[0],0),r[1]=Math.max(r[1],0)}function nW(r,e,t,n,i){r=e.scale.parse(r);var a=e.scale.getLabel({value:r},{precision:i.precision}),o=i.formatter;if(o){var s={value:G2(e,{value:r}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};k(n,function(l){var u=t.getSeriesByIndex(l.seriesIndex),c=l.dataIndexInside,h=u&&u.getDataParams(c);h&&s.seriesData.push(h)}),ke(o)?a=o.replace("{value}",a):qe(o)&&(a=o(s))}return a}function IE(r,e,t){var n=ta();return jc(n,n,t.rotation),Xo(n,n,t.position),io([r.dataToCoord(e),(t.labelOffset||0)+(t.labelDirection||1)*(t.labelMargin||0)],n)}function rW(r,e,t,n,i,a){var o=ks.innerTextLayout(t.rotation,0,t.labelDirection);t.labelMargin=i.get(["label","margin"]),tW(e,n,i,a,{position:IE(n.axis,r,t),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function NE(r,e,t){return t=t||0,{x1:r[t],y1:r[1-t],x2:e[t],y2:e[1-t]}}function iW(r,e,t){return t=t||0,{x:r[t],y:r[1-t],width:e[t],height:e[1-t]}}function oF(r,e,t,n,i,a){return{cx:r,cy:e,r0:t,r:n,startAngle:i,endAngle:a,clockwise:!0}}var kAe=function(r){ae(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,n,i,a,o){var s=i.axis,l=s.grid,u=a.get("type"),c=sF(l,s).getOtherAxis(s).getGlobalExtent(),h=s.toGlobalCoord(s.dataToCoord(n,!0));if(u&&u!=="none"){var f=DE(a),d=OAe[u](s,h,c);d.style=f,t.graphicKey=d.type,t.pointer=d}var p=ZT(l.model,i);rW(n,t,p,i,a,o)},e.prototype.getHandleTransform=function(t,n,i){var a=ZT(n.axis.grid.model,n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=IE(n.axis,t,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,n,i,a){var o=i.axis,s=o.grid,l=o.getGlobalExtent(!0),u=sF(s,o).getOtherAxis(o).getGlobalExtent(),c=o.dim==="x"?0:1,h=[t.x,t.y];h[c]+=n[c],h[c]=Math.min(l[1],h[c]),h[c]=Math.max(l[0],h[c]);var f=(u[1]+u[0])/2,d=[f,f];d[c]=h[c];var p=[{verticalAlign:"middle"},{align:"center"}];return{x:h[0],y:h[1],rotation:t.rotation,cursorPoint:d,tooltipOption:p[c]}},e}(RE);function sF(r,e){var t={};return t[e.dim+"AxisIndex"]=e.index,r.getCartesian(t)}var OAe={line:function(r,e,t){var n=NE([e,t[0]],[e,t[1]],lF(r));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(r,e,t){var n=Math.max(1,r.getBandWidth()),i=t[1]-t[0];return{type:"Rect",shape:iW([e-n/2,t[0]],[n,i],lF(r))}}};function lF(r){return r.dim==="x"?0:1}const FAe=kAe;var BAe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e}(Nt);const zAe=BAe;var xs=Pt(),UAe=k;function aW(r,e,t){if(!kt.node){var n=e.getZr();xs(n).records||(xs(n).records={}),VAe(n,e);var i=xs(n).records[r]||(xs(n).records[r]={});i.handler=t}}function VAe(r,e){if(xs(r).initialized)return;xs(r).initialized=!0,t("click",ut(uF,"click")),t("mousemove",ut(uF,"mousemove")),t("globalout",HAe);function t(n,i){r.on(n,function(a){var o=WAe(e);UAe(xs(r).records,function(s){s&&i(s,a,o.dispatchAction)}),GAe(o.pendings,e)})}}function GAe(r,e){var t=r.showTip.length,n=r.hideTip.length,i;t?i=r.showTip[t-1]:n&&(i=r.hideTip[n-1]),i&&(i.dispatchAction=null,e.dispatchAction(i))}function HAe(r,e,t){r.handler("leave",null,t)}function uF(r,e,t,n){e.handler(r,t,n)}function WAe(r){var e={showTip:[],hideTip:[]},t=function(n){var i=e[n.type];i?i.push(n):(n.dispatchAction=t,r.dispatchAction(n))};return{dispatchAction:t,pendings:e}}function gM(r,e){if(!kt.node){var t=e.getZr(),n=(xs(t).records||{})[r];n&&(xs(t).records[r]=null)}}var $Ae=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a=n.getComponent("tooltip"),o=t.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";aW("axisPointer",i,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(t,n){gM("axisPointer",n)},e.prototype.dispose=function(t,n){gM("axisPointer",n)},e.type="axisPointer",e}(kn);const XAe=$Ae;function oW(r,e){var t=[],n=r.seriesIndex,i;if(n==null||!(i=e.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),o=Uc(a,r);if(o==null||o<0||_e(o))return{point:[]};var s=a.getItemGraphicEl(o),l=i.coordinateSystem;if(i.getTooltipPosition)t=i.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(r.isStacked){var u=l.getBaseAxis(),c=l.getOtherAxis(u),h=c.dim,f=u.dim,d=h==="x"||h==="radius"?1:0,p=a.mapDimension(f),g=[];g[d]=a.get(p,o),g[1-d]=a.get(a.getCalculationInfo("stackResultDimension"),o),t=l.dataToPoint(g)||[]}else t=l.dataToPoint(a.getValues(xe(l.dimensions,function(m){return a.mapDimension(m)}),o))||[];else if(s){var v=s.getBoundingRect().clone();v.applyTransform(s.transform),t=[v.x+v.width/2,v.y+v.height/2]}return{point:t,el:s}}var cF=Pt();function YAe(r,e,t){var n=r.currTrigger,i=[r.x,r.y],a=r,o=r.dispatchAction||Fe(t.dispatchAction,t),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){v0(i)&&(i=oW({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=v0(i),u=a.axesInfo,c=s.axesInfo,h=n==="leave"||v0(i),f={},d={},p={list:[],map:{}},g={showPointer:ut(jAe,d),showTooltip:ut(KAe,p)};k(s.coordSysMap,function(m,y){var _=l||m.containPoint(i);k(s.coordSysAxesInfo[y],function(x,S){var A=x.axis,w=ewe(u,x);if(!h&&_&&(!u||w)){var M=w&&w.value;M==null&&!l&&(M=A.pointToData(i)),M!=null&&hF(x,M,g,!1,f)}})});var v={};return k(c,function(m,y){var _=m.linkGroup;_&&!d[y]&&k(_.axesInfo,function(x,S){var A=d[S];if(x!==m&&A){var w=A.value;_.mapper&&(w=m.axis.scale.parse(_.mapper(w,fF(x),fF(m)))),v[m.key]=w}})}),k(v,function(m,y){hF(c[y],m,g,!0,f)}),ZAe(d,c,f),QAe(p,i,r,o),JAe(c,o,t),f}}function hF(r,e,t,n,i){var a=r.axis;if(!(a.scale.isBlank()||!a.containData(e))){if(!r.involveSeries){t.showPointer(r,e);return}var o=qAe(e,r),s=o.payloadBatch,l=o.snapToValue;s[0]&&i.seriesIndex==null&&pe(i,s[0]),!n&&r.snap&&a.containData(l)&&l!=null&&(e=l),t.showPointer(r,e,s),t.showTooltip(r,o,l)}}function qAe(r,e){var t=e.axis,n=t.dim,i=r,a=[],o=Number.MAX_VALUE,s=-1;return k(e.seriesModels,function(l,u){var c=l.getData().mapDimensionsAll(n),h,f;if(l.getAxisTooltipData){var d=l.getAxisTooltipData(c,r,t);f=d.dataIndices,h=d.nestestValue}else{if(f=l.getData().indicesOfNearest(c[0],r,t.type==="category"?.5:null),!f.length)return;h=l.getData().get(c[0],f[0])}if(!(h==null||!isFinite(h))){var p=r-h,g=Math.abs(p);g<=o&&((g=0&&s<0)&&(o=g,s=p,i=h,a.length=0),k(f,function(v){a.push({seriesIndex:l.seriesIndex,dataIndexInside:v,dataIndex:l.getData().getRawIndex(v)})}))}}),{payloadBatch:a,snapToValue:i}}function jAe(r,e,t,n){r[e.key]={value:t,payloadBatch:n}}function KAe(r,e,t,n){var i=t.payloadBatch,a=e.axis,o=a.model,s=e.axisPointerModel;if(!(!e.triggerTooltip||!i.length)){var l=e.coordSys.model,u=ng(l),c=r.map[u];c||(c=r.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},r.list.push(c)),c.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function ZAe(r,e,t){var n=t.axesInfo=[];k(e,function(i,a){var o=i.axisPointerModel.option,s=r[a];s?(!i.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!i.useHandle&&(o.status="hide"),o.status==="show"&&n.push({axisDim:i.axis.dim,axisIndex:i.axis.model.componentIndex,value:o.value})})}function QAe(r,e,t,n){if(v0(e)||!r.list.length){n({type:"hideTip"});return}var i=((r.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:t.tooltipOption,position:t.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:r.list})}function JAe(r,e,t){var n=t.getZr(),i="axisPointerLastHighlights",a=cF(n)[i]||{},o=cF(n)[i]={};k(r,function(u,c){var h=u.axisPointerModel.option;h.status==="show"&&u.triggerEmphasis&&k(h.seriesDataIndices,function(f){var d=f.seriesIndex+" | "+f.dataIndex;o[d]=f})});var s=[],l=[];k(a,function(u,c){!o[c]&&l.push(u)}),k(o,function(u,c){!a[c]&&s.push(u)}),l.length&&t.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&t.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function ewe(r,e){for(var t=0;t<(r||[]).length;t++){var n=r[t];if(e.axis.dim===n.axisDim&&e.axis.model.componentIndex===n.axisIndex)return n}}function fF(r){var e=r.axis.model,t={},n=t.axisDim=r.axis.dim;return t.axisIndex=t[n+"AxisIndex"]=e.componentIndex,t.axisName=t[n+"AxisName"]=e.name,t.axisId=t[n+"AxisId"]=e.id,t}function v0(r){return!r||r[0]==null||isNaN(r[0])||r[1]==null||isNaN(r[1])}function Ug(r){nh.registerAxisPointerClass("CartesianAxisPointer",FAe),r.registerComponentModel(zAe),r.registerComponentView(XAe),r.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!_e(t)&&(e.axisPointer.link=[t])}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=Vge(e,t)}),r.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},YAe)}function twe(r){gt(D8),gt(Ug)}var nwe=function(r){ae(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,n,i,a,o){var s=i.axis;s.dim==="angle"&&(this.animationThreshold=Math.PI/18);var l=s.polar,u=l.getOtherAxis(s),c=u.getExtent(),h=s.dataToCoord(n),f=a.get("type");if(f&&f!=="none"){var d=DE(a),p=iwe[f](s,l,h,c);p.style=d,t.graphicKey=p.type,t.pointer=p}var g=a.get(["label","margin"]),v=rwe(n,i,a,l,g);tW(t,i,a,o,v)},e}(RE);function rwe(r,e,t,n,i){var a=e.axis,o=a.dataToCoord(r),s=n.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l=n.getRadiusAxis().getExtent(),u,c,h;if(a.dim==="radius"){var f=ta();jc(f,f,s),Xo(f,f,[n.cx,n.cy]),u=io([o,-i],f);var d=e.getModel("axisLabel").get("rotate")||0,p=ks.innerTextLayout(s,d*Math.PI/180,-1);c=p.textAlign,h=p.textVerticalAlign}else{var g=l[1];u=n.coordToPoint([g+i,o]);var v=n.cx,m=n.cy;c=Math.abs(u[0]-v)/g<.3?"center":u[0]>v?"left":"right",h=Math.abs(u[1]-m)/g<.3?"middle":u[1]>m?"top":"bottom"}return{position:u,align:c,verticalAlign:h}}var iwe={line:function(r,e,t,n){return r.dim==="angle"?{type:"Line",shape:NE(e.coordToPoint([n[0],t]),e.coordToPoint([n[1],t]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:t}}},shadow:function(r,e,t,n){var i=Math.max(1,r.getBandWidth()),a=Math.PI/180;return r.dim==="angle"?{type:"Sector",shape:oF(e.cx,e.cy,n[0],n[1],(-t-i/2)*a,(-t+i/2)*a)}:{type:"Sector",shape:oF(e.cx,e.cy,t-i/2,t+i/2,0,Math.PI*2)}}};const awe=nwe;var owe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.findAxisModel=function(t){var n,i=this.ecModel;return i.eachComponent(t,function(a){a.getCoordSysModel()===this&&(n=a)},this),n},e.type="polar",e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(Nt);const swe=owe;var kE=function(r){ae(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",nr).models[0]},e.type="polarAxis",e}(Nt);ir(kE,Rg);var lwe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="angleAxis",e}(kE),uwe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="radiusAxis",e}(kE),OE=function(r){ae(e,r);function e(t,n){return r.call(this,"radius",t,n)||this}return e.prototype.pointToData=function(t,n){return this.polar.pointToData(t,n)[this.dim==="radius"?0:1]},e}(ho);OE.prototype.dataToRadius=ho.prototype.dataToCoord;OE.prototype.radiusToData=ho.prototype.coordToData;const cwe=OE;var hwe=Pt(),FE=function(r){ae(e,r);function e(t,n){return r.call(this,"angle",t,n||[0,360])||this}return e.prototype.pointToData=function(t,n){return this.polar.pointToData(t,n)[this.dim==="radius"?0:1]},e.prototype.calculateCategoryInterval=function(){var t=this,n=t.getLabelModel(),i=t.scale,a=i.getExtent(),o=i.count();if(a[1]-a[0]<1)return 0;var s=a[0],l=t.dataToCoord(s+1)-t.dataToCoord(s),u=Math.abs(l),c=wg(s==null?"":s+"",n.getFont(),"center","top"),h=Math.max(c.height,7),f=h/u;isNaN(f)&&(f=1/0);var d=Math.max(0,Math.floor(f)),p=hwe(t.model),g=p.lastAutoInterval,v=p.lastTickCount;return g!=null&&v!=null&&Math.abs(g-d)<=1&&Math.abs(v-o)<=1&&g>d?d=g:(p.lastTickCount=o,p.lastAutoInterval=d),d},e}(ho);FE.prototype.dataToAngle=ho.prototype.dataToCoord;FE.prototype.angleToData=ho.prototype.coordToData;const fwe=FE;var sW=["radius","angle"],dwe=function(){function r(e){this.dimensions=sW,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new cwe,this._angleAxis=new fwe,this.axisPointerEnabled=!0,this.name=e||"",this._radiusAxis.polar=this._angleAxis.polar=this}return r.prototype.containPoint=function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},r.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},r.prototype.getAxis=function(e){var t="_"+e+"Axis";return this[t]},r.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},r.prototype.getAxesByScale=function(e){var t=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===e&&t.push(n),i.scale.type===e&&t.push(i),t},r.prototype.getAngleAxis=function(){return this._angleAxis},r.prototype.getRadiusAxis=function(){return this._radiusAxis},r.prototype.getOtherAxis=function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},r.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},r.prototype.getTooltipAxes=function(e){var t=e!=null&&e!=="auto"?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},r.prototype.dataToPoint=function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},r.prototype.pointToData=function(e,t){var n=this.pointToCoord(e);return[this._radiusAxis.radiusToData(n[0],t),this._angleAxis.angleToData(n[1],t)]},r.prototype.pointToCoord=function(e){var t=e[0]-this.cx,n=e[1]-this.cy,i=this.getAngleAxis(),a=i.getExtent(),o=Math.min(a[0],a[1]),s=Math.max(a[0],a[1]);i.inverse?o=s-360:s=o+360;var l=Math.sqrt(t*t+n*n);t/=l,n/=l;for(var u=Math.atan2(-n,t)/Math.PI*180,c=us;)u+=c*360;return[l,u]},r.prototype.coordToPoint=function(e){var t=e[0],n=e[1]/180*Math.PI,i=Math.cos(n)*t+this.cx,a=-Math.sin(n)*t+this.cy;return[i,a]},r.prototype.getArea=function(){var e=this.getAngleAxis(),t=this.getRadiusAxis(),n=t.getExtent().slice();n[0]>n[1]&&n.reverse();var i=e.getExtent(),a=Math.PI/180,o=1e-4;return{cx:this.cx,cy:this.cy,r0:n[0],r:n[1],startAngle:-i[0]*a,endAngle:-i[1]*a,clockwise:e.inverse,contain:function(s,l){var u=s-this.cx,c=l-this.cy,h=u*u+c*c,f=this.r,d=this.r0;return f!==d&&h-o<=f*f&&h+o>=d*d}}},r.prototype.convertToPixel=function(e,t,n){var i=dF(t);return i===this?this.dataToPoint(n):null},r.prototype.convertFromPixel=function(e,t,n){var i=dF(t);return i===this?this.pointToData(n):null},r}();function dF(r){var e=r.seriesModel,t=r.polarModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}const pwe=dwe;function vwe(r,e,t){var n=e.get("center"),i=t.getWidth(),a=t.getHeight();r.cx=Pe(n[0],i),r.cy=Pe(n[1],a);var o=r.getRadiusAxis(),s=Math.min(i,a)/2,l=e.get("radius");l==null?l=[0,"100%"]:_e(l)||(l=[0,l]);var u=[Pe(l[0],s),Pe(l[1],s)];o.inverse?o.setExtent(u[1],u[0]):o.setExtent(u[0],u[1])}function gwe(r,e){var t=this,n=t.getAngleAxis(),i=t.getRadiusAxis();if(n.scale.setExtent(1/0,-1/0),i.scale.setExtent(1/0,-1/0),r.eachSeries(function(s){if(s.coordinateSystem===t){var l=s.getData();k(__(l,"radius"),function(u){i.scale.unionExtentFromData(l,u)}),k(__(l,"angle"),function(u){n.scale.unionExtentFromData(l,u)})}}),td(n.scale,n.model),td(i.scale,i.model),n.type==="category"&&!n.onBand){var a=n.getExtent(),o=360/n.scale.count();n.inverse?a[1]+=o:a[1]-=o,n.setExtent(a[0],a[1])}}function mwe(r){return r.mainType==="angleAxis"}function pF(r,e){var t;if(r.type=e.get("type"),r.scale=$1(e),r.onBand=e.get("boundaryGap")&&r.type==="category",r.inverse=e.get("inverse"),mwe(e)){r.inverse=r.inverse!==e.get("clockwise");var n=e.get("startAngle"),i=(t=e.get("endAngle"))!==null&&t!==void 0?t:n+(r.inverse?-360:360);r.setExtent(n,i)}e.axis=r,r.model=e}var ywe={dimensions:sW,create:function(r,e){var t=[];return r.eachComponent("polar",function(n,i){var a=new pwe(i+"");a.update=gwe;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=n.findAxisModel("radiusAxis"),u=n.findAxisModel("angleAxis");pF(o,l),pF(s,u),vwe(a,n,e),t.push(a),n.coordinateSystem=a,a.model=n}),r.eachSeries(function(n){if(n.get("coordinateSystem")==="polar"){var i=n.getReferringComponents("polar",nr).models[0];n.coordinateSystem=i.coordinateSystem}}),t}};const _we=ywe;var xwe=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function Py(r,e,t){e[1]>e[0]&&(e=e.slice().reverse());var n=r.coordToPoint([e[0],t]),i=r.coordToPoint([e[1],t]);return{x1:n[0],y1:n[1],x2:i[0],y2:i[1]}}function Ry(r){var e=r.getRadiusAxis();return e.inverse?0:1}function vF(r){var e=r[0],t=r[r.length-1];e&&t&&Math.abs(Math.abs(e.coord-t.coord)-360)<1e-4&&r.pop()}var Swe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.axisPointerClass="PolarAxisPointer",t}return e.prototype.render=function(t,n){if(this.group.removeAll(),!!t.get("show")){var i=t.axis,a=i.polar,o=a.getRadiusAxis().getExtent(),s=i.getTicksCoords(),l=i.getMinorTicksCoords(),u=xe(i.getViewLabels(),function(c){c=Je(c);var h=i.scale,f=h.type==="ordinal"?h.getRawOrdinalNumber(c.tickValue):c.tickValue;return c.coord=i.dataToCoord(f),c});vF(u),vF(s),k(xwe,function(c){t.get([c,"show"])&&(!i.scale.isBlank()||c==="axisLine")&&Awe[c](this.group,t,a,s,l,o,u)},this)}},e.type="angleAxis",e}(nh),Awe={axisLine:function(r,e,t,n,i,a){var o=e.getModel(["axisLine","lineStyle"]),s=t.getAngleAxis(),l=Math.PI/180,u=s.getExtent(),c=Ry(t),h=c?0:1,f,d=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[h]===0?f=new Zc[d]({shape:{cx:t.cx,cy:t.cy,r:a[c],startAngle:-u[0]*l,endAngle:-u[1]*l,clockwise:s.inverse},style:o.getLineStyle(),z2:1,silent:!0}):f=new T1({shape:{cx:t.cx,cy:t.cy,r:a[c],r0:a[h]},style:o.getLineStyle(),z2:1,silent:!0}),f.style.fill=null,r.add(f)},axisTick:function(r,e,t,n,i,a){var o=e.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[Ry(t)],u=xe(n,function(c){return new Cr({shape:Py(t,[l,l+s],c.coord)})});r.add(Ma(u,{style:Ke(o.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(r,e,t,n,i,a){if(i.length){for(var o=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),u=a[Ry(t)],c=[],h=0;hm?"left":"right",x=Math.abs(v[1]-y)/g<.3?"middle":v[1]>y?"top":"bottom";if(s&&s[p]){var S=s[p];Qe(S)&&S.textStyle&&(d=new vn(S.textStyle,l,l.ecModel))}var A=new Ot({silent:ks.isLabelSilent(e),style:pn(d,{x:v[0],y:v[1],fill:d.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:h.formattedLabel,align:_,verticalAlign:x})});if(r.add(A),c){var w=ks.makeAxisEventDataBase(e);w.targetType="axisLabel",w.value=h.rawLabel,at(A).eventData=w}},this)},splitLine:function(r,e,t,n,i,a){var o=e.getModel("splitLine"),s=o.getModel("lineStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var c=[],h=0;h=0?"p":"n",E=C;S&&(n[c][D]||(n[c][D]={p:C,n:C}),E=n[c][D][L]);var I=void 0,N=void 0,R=void 0,F=void 0;if(p.dim==="radius"){var O=p.dataToCoord(P)-C,V=l.dataToCoord(D);Math.abs(O)=F})}}})}function Rwe(r){var e={};k(r,function(n,i){var a=n.getData(),o=n.coordinateSystem,s=o.getBaseAxis(),l=uW(o,s),u=s.getExtent(),c=s.type==="category"?s.getBandWidth():Math.abs(u[1]-u[0])/a.count(),h=e[l]||{bandWidth:c,remainedWidth:c,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},f=h.stacks;e[l]=h;var d=lW(n);f[d]||h.autoWidthCount++,f[d]=f[d]||{width:0,maxWidth:0};var p=Pe(n.get("barWidth"),c),g=Pe(n.get("barMaxWidth"),c),v=n.get("barGap"),m=n.get("barCategoryGap");p&&!f[d].width&&(p=Math.min(h.remainedWidth,p),f[d].width=p,h.remainedWidth-=p),g&&(f[d].maxWidth=g),v!=null&&(h.gap=v),m!=null&&(h.categoryGap=m)});var t={};return k(e,function(n,i){t[i]={};var a=n.stacks,o=n.bandWidth,s=Pe(n.categoryGap,o),l=Pe(n.gap,1),u=n.remainedWidth,c=n.autoWidthCount,h=(u-s)/(c+(c-1)*l);h=Math.max(h,0),k(a,function(g,v){var m=g.maxWidth;m&&m=t.y&&e[1]<=t.y+t.height:n.contain(n.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},r.prototype.pointToData=function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e[t.orient==="horizontal"?0:1]))]},r.prototype.dataToPoint=function(e){var t=this.getAxis(),n=this.getRect(),i=[],a=t.orient==="horizontal"?0:1;return e instanceof Array&&(e=e[0]),i[a]=t.toGlobalCoord(t.dataToCoord(+e)),i[1-a]=a===0?n.y+n.height/2:n.x+n.width/2,i},r.prototype.convertToPixel=function(e,t,n){var i=gF(t);return i===this?this.dataToPoint(n):null},r.prototype.convertFromPixel=function(e,t,n){var i=gF(t);return i===this?this.pointToData(n):null},r}();function gF(r){var e=r.seriesModel,t=r.singleAxisModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}function Wwe(r,e){var t=[];return r.eachComponent("singleAxis",function(n,i){var a=new Hwe(n,r,e);a.name="single_"+i,a.resize(n,e),n.coordinateSystem=a,t.push(a)}),r.eachSeries(function(n){if(n.get("coordinateSystem")==="singleAxis"){var i=n.getReferringComponents("singleAxis",nr).models[0];n.coordinateSystem=i&&i.coordinateSystem}}),t}var $we={create:Wwe,dimensions:hW};const Xwe=$we;var mF=["x","y"],Ywe=["width","height"],qwe=function(r){ae(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,n,i,a,o){var s=i.axis,l=s.coordinateSystem,u=Ew(l,1-N_(s)),c=l.dataToPoint(n)[0],h=a.get("type");if(h&&h!=="none"){var f=DE(a),d=jwe[h](s,c,u);d.style=f,t.graphicKey=d.type,t.pointer=d}var p=mM(i);rW(n,t,p,i,a,o)},e.prototype.getHandleTransform=function(t,n,i){var a=mM(n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=IE(n.axis,t,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,n,i,a){var o=i.axis,s=o.coordinateSystem,l=N_(o),u=Ew(s,l),c=[t.x,t.y];c[l]+=n[l],c[l]=Math.min(u[1],c[l]),c[l]=Math.max(u[0],c[l]);var h=Ew(s,1-l),f=(h[1]+h[0])/2,d=[f,f];return d[l]=c[l],{x:c[0],y:c[1],rotation:t.rotation,cursorPoint:d,tooltipOption:{verticalAlign:"middle"}}},e}(RE),jwe={line:function(r,e,t){var n=NE([e,t[0]],[e,t[1]],N_(r));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(r,e,t){var n=r.getBandWidth(),i=t[1]-t[0];return{type:"Rect",shape:iW([e-n/2,t[0]],[n,i],N_(r))}}};function N_(r){return r.isHorizontal()?0:1}function Ew(r,e){var t=r.getRect();return[t[mF[e]],t[mF[e]]+t[Ywe[e]]]}const Kwe=qwe;var Zwe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="single",e}(kn);function Qwe(r){gt(Ug),nh.registerAxisPointerClass("SingleAxisPointer",Kwe),r.registerComponentView(Zwe),r.registerComponentView(Uwe),r.registerComponentModel(Cw),rd(r,"single",Cw,Cw.defaultOption),r.registerCoordinateSystem("single",Xwe)}var Jwe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,n,i){var a=Ad(t);r.prototype.init.apply(this,arguments),yF(t,a)},e.prototype.mergeOption=function(t){r.prototype.mergeOption.apply(this,arguments),yF(this.option,t)},e.prototype.getCellSize=function(){return this.option.cellSize},e.type="calendar",e.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(Nt);function yF(r,e){var t=r.cellSize,n;_e(t)?n=t:n=r.cellSize=[t,t],n.length===1&&(n[1]=n[0]);var i=xe([0,1],function(a){return rce(e,a)&&(n[a]="auto"),n[a]!=null&&n[a]!=="auto"});Zl(r,e,{type:"box",ignoreSize:i})}const ebe=Jwe;var tbe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a=this.group;a.removeAll();var o=t.coordinateSystem,s=o.getRangeInfo(),l=o.getOrient(),u=n.getLocaleModel();this._renderDayRect(t,s,a),this._renderLines(t,s,l,a),this._renderYearText(t,s,l,a),this._renderMonthText(t,u,l,a),this._renderWeekText(t,u,s,l,a)},e.prototype._renderDayRect=function(t,n,i){for(var a=t.coordinateSystem,o=t.getModel("itemStyle").getItemStyle(),s=a.getCellWidth(),l=a.getCellHeight(),u=n.start.time;u<=n.end.time;u=a.getNextNDay(u,1).time){var c=a.dataToRect([u],!1).tl,h=new Dt({shape:{x:c[0],y:c[1],width:s,height:l},cursor:"default",style:o});i.add(h)}},e.prototype._renderLines=function(t,n,i,a){var o=this,s=t.coordinateSystem,l=t.getModel(["splitLine","lineStyle"]).getLineStyle(),u=t.get(["splitLine","show"]),c=l.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var h=n.start,f=0;h.time<=n.end.time;f++){p(h.formatedDate),f===0&&(h=s.getDateInfo(n.start.y+"-"+n.start.m));var d=h.date;d.setMonth(d.getMonth()+1),h=s.getDateInfo(d)}p(s.getNextNDay(n.end.time,1).formatedDate);function p(g){o._firstDayOfMonth.push(s.getDateInfo(g)),o._firstDayPoints.push(s.dataToRect([g],!1).tl);var v=o._getLinePointsOfOneWeek(t,g,i);o._tlpoints.push(v[0]),o._blpoints.push(v[v.length-1]),u&&o._drawSplitline(v,l,a)}u&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,c,i),l,a),u&&this._drawSplitline(o._getEdgesPoints(o._blpoints,c,i),l,a)},e.prototype._getEdgesPoints=function(t,n,i){var a=[t[0].slice(),t[t.length-1].slice()],o=i==="horizontal"?0:1;return a[0][o]=a[0][o]-n/2,a[1][o]=a[1][o]+n/2,a},e.prototype._drawSplitline=function(t,n,i){var a=new Ui({z2:20,shape:{points:t},style:n});i.add(a)},e.prototype._getLinePointsOfOneWeek=function(t,n,i){for(var a=t.coordinateSystem,o=a.getDateInfo(n),s=[],l=0;l<7;l++){var u=a.getNextNDay(o.time,l),c=a.dataToRect([u.time],!1);s[2*u.day]=c.tl,s[2*u.day+1]=c[i==="horizontal"?"bl":"tr"]}return s},e.prototype._formatterLabel=function(t,n){return ke(t)&&t?ece(t,n):qe(t)?t(n):n.nameMap},e.prototype._yearTextPositionControl=function(t,n,i,a,o){var s=n[0],l=n[1],u=["center","bottom"];a==="bottom"?(l+=o,u=["center","top"]):a==="left"?s-=o:a==="right"?(s+=o,u=["center","top"]):l-=o;var c=0;return(a==="left"||a==="right")&&(c=Math.PI/2),{rotation:c,x:s,y:l,style:{align:u[0],verticalAlign:u[1]}}},e.prototype._renderYearText=function(t,n,i,a){var o=t.getModel("yearLabel");if(o.get("show")){var s=o.get("margin"),l=o.get("position");l||(l=i!=="horizontal"?"top":"left");var u=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],c=(u[0][0]+u[1][0])/2,h=(u[0][1]+u[1][1])/2,f=i==="horizontal"?0:1,d={top:[c,u[f][1]],bottom:[c,u[1-f][1]],left:[u[1-f][0],h],right:[u[f][0],h]},p=n.start.y;+n.end.y>+n.start.y&&(p=p+"-"+n.end.y);var g=o.get("formatter"),v={start:n.start.y,end:n.end.y,nameMap:p},m=this._formatterLabel(g,v),y=new Ot({z2:30,style:pn(o,{text:m}),silent:o.get("silent")});y.attr(this._yearTextPositionControl(y,d[l],i,l,s)),a.add(y)}},e.prototype._monthTextPositionControl=function(t,n,i,a,o){var s="left",l="top",u=t[0],c=t[1];return i==="horizontal"?(c=c+o,n&&(s="center"),a==="start"&&(l="bottom")):(u=u+o,n&&(l="middle"),a==="start"&&(s="right")),{x:u,y:c,align:s,verticalAlign:l}},e.prototype._renderMonthText=function(t,n,i,a){var o=t.getModel("monthLabel");if(o.get("show")){var s=o.get("nameMap"),l=o.get("margin"),u=o.get("position"),c=o.get("align"),h=[this._tlpoints,this._blpoints];(!s||ke(s))&&(s&&(n=CT(s)||n),s=n.get(["time","monthAbbr"])||[]);var f=u==="start"?0:1,d=i==="horizontal"?0:1;l=u==="start"?-l:l;for(var p=c==="center",g=o.get("silent"),v=0;v=i.start.time&&n.times.end.time&&t.reverse(),t},r.prototype._getRangeInfo=function(e){var t=[this.getDateInfo(e[0]),this.getDateInfo(e[1])],n;t[0].time>t[1].time&&(n=!0,t.reverse());var i=Math.floor(t[1].time/Lw)-Math.floor(t[0].time/Lw)+1,a=new Date(t[0].time),o=a.getDate(),s=t[1].date.getDate();a.setDate(o+i-1);var l=a.getDate();if(l!==s)for(var u=a.getTime()-t[1].time>0?1:-1;(l=a.getDate())!==s&&(a.getTime()-t[1].time)*u>0;)i-=u,a.setDate(l-u);var c=Math.floor((i+t[0].day+6)/7),h=n?-c+1:c-1;return n&&t.reverse(),{range:[t[0].formatedDate,t[1].formatedDate],start:t[0],end:t[1],allDay:i,weeks:c,nthWeek:h,fweek:t[0].day,lweek:t[1].day}},r.prototype._getDateByWeeksAndDay=function(e,t,n){var i=this._getRangeInfo(n);if(e>i.weeks||e===0&&ti.lweek)return null;var a=(e-1)*7-i.fweek+t,o=new Date(i.start.time);return o.setDate(+i.start.d+a),this.getDateInfo(o)},r.create=function(e,t){var n=[];return e.eachComponent("calendar",function(i){var a=new r(i);n.push(a),i.coordinateSystem=a}),e.eachSeries(function(i){i.get("coordinateSystem")==="calendar"&&(i.coordinateSystem=n[i.get("calendarIndex")||0])}),n},r.dimensions=["time","value"],r}();function _F(r){var e=r.calendarModel,t=r.seriesModel,n=e?e.coordinateSystem:t?t.coordinateSystem:null;return n}const ibe=rbe;function abe(r){r.registerComponentModel(ebe),r.registerComponentView(nbe),r.registerCoordinateSystem("calendar",ibe)}function obe(r,e){var t=r.existing;if(e.id=r.keyInfo.id,!e.type&&t&&(e.type=t.type),e.parentId==null){var n=e.parentOption;n?e.parentId=n.id:t&&(e.parentId=t.parentId)}e.parentOption=null}function xF(r,e){var t;return k(e,function(n){r[n]!=null&&r[n]!=="auto"&&(t=!0)}),t}function sbe(r,e,t){var n=pe({},t),i=r[e],a=t.$action||"merge";a==="merge"?i?(ht(i,n,!0),Zl(i,n,{ignoreSize:!0}),YV(t,i),Dy(t,i),Dy(t,i,"shape"),Dy(t,i,"style"),Dy(t,i,"extra"),t.clipPath=i.clipPath):r[e]=n:a==="replace"?r[e]=n:a==="remove"&&i&&(r[e]=null)}var fW=["transition","enterFrom","leaveTo"],lbe=fW.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function Dy(r,e,t){if(t&&(!r[t]&&e[t]&&(r[t]={}),r=r[t],e=e[t]),!(!r||!e))for(var n=t?fW:lbe,i=0;i=0;c--){var h=i[c],f=fr(h.id,null),d=f!=null?o.get(f):null;if(d){var p=d.parent,m=xa(p),y=p===a?{width:s,height:l}:{width:m.width,height:m.height},_={},x=k1(d,h,y,null,{hv:h.hv,boundingMode:h.bounding},_);if(!xa(d).isNew&&x){for(var S=h.transition,A={},w=0;w=0)?A[M]=C:d[M]=C}zt(d,A,t,0)}else d.attr(_)}}},e.prototype._clear=function(){var t=this,n=this._elMap;n.each(function(i){g0(i,xa(i).option,n,t._lastGraphicModel)}),this._elMap=He()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(kn);function yM(r){var e=ze(SF,r)?SF[r]:p2(r),t=new e({});return xa(t).type=r,t}function AF(r,e,t,n){var i=yM(t);return e.add(i),n.set(r,i),xa(i).id=r,xa(i).isNew=!0,i}function g0(r,e,t,n){var i=r&&r.parent;i&&(r.type==="group"&&r.traverse(function(a){g0(a,e,t,n)}),Q1(r,e,n),t.removeKey(xa(r).id))}function wF(r,e,t,n){r.isGroup||k([["cursor",ka.prototype.cursor],["zlevel",n||0],["z",t||0],["z2",0]],function(i){var a=i[0];ze(e,a)?r[a]=ot(e[a],i[1]):r[a]==null&&(r[a]=i[1])}),k(wt(e),function(i){if(i.indexOf("on")===0){var a=e[i];r[i]=qe(a)?a:null}}),ze(e,"draggable")&&(r.draggable=e.draggable),e.name!=null&&(r.name=e.name),e.id!=null&&(r.id=e.id)}function fbe(r){return r=pe({},r),k(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(XV),function(e){delete r[e]}),r}function dbe(r,e,t){var n=at(r).eventData;!r.silent&&!r.ignore&&!n&&(n=at(r).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:r.name}),n&&(n.info=t.info)}function pbe(r){r.registerComponentModel(cbe),r.registerComponentView(hbe),r.registerPreprocessor(function(e){var t=e.graphic;_e(t)?!t[0]||!t[0].elements?e.graphic=[{elements:t}]:e.graphic=[e.graphic[0]]:t&&!t.elements&&(e.graphic=[{elements:[t]}])})}var bF=["x","y","radius","angle","single"],vbe=["cartesian2d","polar","singleAxis"];function gbe(r){var e=r.get("coordinateSystem");return pt(vbe,e)>=0}function Dl(r){return r+"Axis"}function mbe(r,e){var t=He(),n=[],i=He();r.eachComponent({mainType:"dataZoom",query:e},function(c){i.get(c.uid)||s(c)});var a;do a=!1,r.eachComponent("dataZoom",o);while(a);function o(c){!i.get(c.uid)&&l(c)&&(s(c),a=!0)}function s(c){i.set(c.uid,!0),n.push(c),u(c)}function l(c){var h=!1;return c.eachTargetAxis(function(f,d){var p=t.get(f);p&&p[d]&&(h=!0)}),h}function u(c){c.eachTargetAxis(function(h,f){(t.get(h)||t.set(h,[]))[f]=!0})}return n}function dW(r){var e=r.ecModel,t={infoList:[],infoMap:He()};return r.eachTargetAxis(function(n,i){var a=e.getComponent(Dl(n),i);if(a){var o=a.getCoordSysModel();if(o){var s=o.uid,l=t.infoMap.get(s);l||(l={model:o,axisModels:[]},t.infoList.push(l),t.infoMap.set(s,l)),l.axisModels.push(a)}}}),t}var Pw=function(){function r(){this.indexList=[],this.indexMap=[]}return r.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},r}(),ybe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._autoThrottle=!0,t._noTarget=!0,t._rangePropMode=["percent","percent"],t}return e.prototype.init=function(t,n,i){var a=TF(t);this.settledOption=a,this.mergeDefaultAndTheme(t,i),this._doInit(a)},e.prototype.mergeOption=function(t){var n=TF(t);ht(this.option,t,!0),ht(this.settledOption,n,!0),this._doInit(n)},e.prototype._doInit=function(t){var n=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var i=this.settledOption;k([["start","startValue"],["end","endValue"]],function(a,o){this._rangePropMode[o]==="value"&&(n[a[0]]=i[a[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),n=this._targetAxisInfoMap=He(),i=this._fillSpecifiedTargetAxis(n);i?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(n,this._orient)),this._noTarget=!0,n.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(t){var n=!1;return k(bF,function(i){var a=this.getReferringComponents(Dl(i),Nse);if(a.specified){n=!0;var o=new Pw;k(a.models,function(s){o.add(s.componentIndex)}),t.set(i,o)}},this),n},e.prototype._fillAutoTargetAxisByOrient=function(t,n){var i=this.ecModel,a=!0;if(a){var o=n==="vertical"?"y":"x",s=i.findComponents({mainType:o+"Axis"});l(s,o)}if(a){var s=i.findComponents({mainType:"singleAxis",filter:function(c){return c.get("orient",!0)===n}});l(s,"single")}function l(u,c){var h=u[0];if(h){var f=new Pw;if(f.add(h.componentIndex),t.set(c,f),a=!1,c==="x"||c==="y"){var d=h.getReferringComponents("grid",nr).models[0];d&&k(u,function(p){h.componentIndex!==p.componentIndex&&d===p.getReferringComponents("grid",nr).models[0]&&f.add(p.componentIndex)})}}}a&&k(bF,function(u){if(a){var c=i.findComponents({mainType:Dl(u),filter:function(f){return f.get("type",!0)==="category"}});if(c[0]){var h=new Pw;h.add(c[0].componentIndex),t.set(u,h),a=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis(function(n){!t&&(t=n)},this),t==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var n=this.ecModel.option;this.option.throttle=n.animation&&n.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var n=this._rangePropMode,i=this.get("rangeMode");k([["start","startValue"],["end","endValue"]],function(a,o){var s=t[a[0]]!=null,l=t[a[1]]!=null;s&&!l?n[o]="percent":!s&&l?n[o]="value":i?n[o]=i[o]:s&&(n[o]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis(function(n,i){t==null&&(t=this.ecModel.getComponent(Dl(n),i))},this),t},e.prototype.eachTargetAxis=function(t,n){this._targetAxisInfoMap.each(function(i,a){k(i.indexList,function(o){t.call(n,a,o)})})},e.prototype.getAxisProxy=function(t,n){var i=this.getAxisModel(t,n);if(i)return i.__dzAxisProxy},e.prototype.getAxisModel=function(t,n){var i=this._targetAxisInfoMap.get(t);if(i&&i.indexMap[n])return this.ecModel.getComponent(Dl(t),n)},e.prototype.setRawRange=function(t){var n=this.option,i=this.settledOption;k([["start","startValue"],["end","endValue"]],function(a){(t[a[0]]!=null||t[a[1]]!=null)&&(n[a[0]]=i[a[0]]=t[a[0]],n[a[1]]=i[a[1]]=t[a[1]])},this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var n=this.option;k(["start","startValue","end","endValue"],function(i){n[i]=t[i]})},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},e.prototype.getValueRange=function(t,n){if(t==null&&n==null){var i=this.findRepresentativeAxisProxy();if(i)return i.getDataValueWindow()}else return this.getAxisProxy(t,n).getDataValueWindow()},e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var n,i=this._targetAxisInfoMap.keys(),a=0;ao[1];if(_&&!x&&!S)return!0;_&&(v=!0),x&&(p=!0),S&&(g=!0)}return v&&p&&g})}else af(c,function(d){if(a==="empty")l.setData(u=u.map(d,function(g){return s(g)?g:NaN}));else{var p={};p[d]=o,u.selectRange(p)}});af(c,function(d){u.setApproximateExtent(o,d)})}});function s(l){return l>=o[0]&&l<=o[1]}},r.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._dataExtent;af(["min","max"],function(i){var a=t.get(i+"Span"),o=t.get(i+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?a=Kt(n[0]+o,n,[0,100],!0):a!=null&&(o=Kt(a,[0,100],n,!0)-n[0]),e[i+"Span"]=a,e[i+"ValueSpan"]=o},this)},r.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,n=this._valueWindow;if(t){var i=A4(n,[0,500]);i=Math.min(i,20);var a=e.axis.scale.rawExtentInfo;t[0]!==0&&a.setDeterminedMinMax("min",+n[0].toFixed(i)),t[1]!==100&&a.setDeterminedMinMax("max",+n[1].toFixed(i)),a.freeze()}},r}();function Tbe(r,e,t){var n=[1/0,-1/0];af(t,function(o){Yde(n,o.getData(),e)});var i=r.getAxisModel(),a=CH(i.axis.scale,i,n).calculate();return[a.min,a.max]}const Mbe=bbe;var Cbe={getTargetSeries:function(r){function e(i){r.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=r.getComponent(Dl(o),s);i(o,s,l,a)})})}e(function(i,a,o,s){o.__dzAxisProxy=null});var t=[];e(function(i,a,o,s){o.__dzAxisProxy||(o.__dzAxisProxy=new Mbe(i,a,s,r),t.push(o.__dzAxisProxy))});var n=He();return k(t,function(i){k(i.getTargetSeriesModels(),function(a){n.set(a.uid,a)})}),n},overallReset:function(r,e){r.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(n,i){t.getAxisProxy(n,i).reset(t)}),t.eachTargetAxis(function(n,i){t.getAxisProxy(n,i).filterData(t,e)})}),r.eachComponent("dataZoom",function(t){var n=t.findRepresentativeAxisProxy();if(n){var i=n.getDataPercentWindow(),a=n.getDataValueWindow();t.setCalculatedRange({start:i[0],end:i[1],startValue:a[0],endValue:a[1]})}})}};const Ebe=Cbe;function Lbe(r){r.registerAction("dataZoom",function(e,t){var n=mbe(t,e);k(n,function(i){i.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var CF=!1;function zE(r){CF||(CF=!0,r.registerProcessor(r.PRIORITY.PROCESSOR.FILTER,Ebe),Lbe(r),r.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function Pbe(r){r.registerComponentModel(xbe),r.registerComponentView(wbe),zE(r)}var wa=function(){function r(){}return r}(),pW={};function of(r,e){pW[r]=e}function vW(r){return pW[r]}var Rbe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){r.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;k(this.option.feature,function(n,i){var a=vW(i);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(t)),ht(n,a.defaultOption))})},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},e}(Nt);const Dbe=Rbe;function Ibe(r,e,t){var n=e.getBoxLayoutParams(),i=e.get("padding"),a={width:t.getWidth(),height:t.getHeight()},o=dr(n,a,i);Pc(e.get("orient"),r,e.get("itemGap"),o.width,o.height),k1(r,n,a,i)}function gW(r,e){var t=Sd(e.get("padding")),n=e.getItemStyle(["color","opacity"]);return n.fill=e.get("backgroundColor"),r=new Dt({shape:{x:r.x-t[3],y:r.y-t[0],width:r.width+t[1]+t[3],height:r.height+t[0]+t[2],r:e.get("borderRadius")},style:n,silent:!0,z2:-1}),r}var Nbe=function(r){ae(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,n,i,a){var o=this.group;if(o.removeAll(),!t.get("show"))return;var s=+t.get("itemSize"),l=t.get("orient")==="vertical",u=t.get("feature")||{},c=this._features||(this._features={}),h=[];k(u,function(p,g){h.push(g)}),new Ns(this._featureNames||[],h).add(f).update(f).remove(ut(f,null)).execute(),this._featureNames=h;function f(p,g){var v=h[p],m=h[g],y=u[v],_=new vn(y,t,t.ecModel),x;if(a&&a.newTitle!=null&&a.featureName===v&&(y.title=a.newTitle),v&&!m){if(kbe(v))x={onclick:_.option.onclick,featureName:v};else{var S=vW(v);if(!S)return;x=new S}c[v]=x}else if(x=c[m],!x)return;x.uid=xd("toolbox-feature"),x.model=_,x.ecModel=n,x.api=i;var A=x instanceof wa;if(!v&&m){A&&x.dispose&&x.dispose(n,i);return}if(!_.get("show")||A&&x.unusable){A&&x.remove&&x.remove(n,i);return}d(_,x,v),_.setIconStatus=function(w,M){var C=this.option,b=this.iconPaths;C.iconStatus=C.iconStatus||{},C.iconStatus[w]=M,b[w]&&(M==="emphasis"?Ds:Is)(b[w])},x instanceof wa&&x.render&&x.render(_,n,i,a)}function d(p,g,v){var m=p.getModel("iconStyle"),y=p.getModel(["emphasis","iconStyle"]),_=g instanceof wa&&g.getIcons?g.getIcons():p.get("icon"),x=p.get("title")||{},S,A;ke(_)?(S={},S[v]=_):S=_,ke(x)?(A={},A[v]=x):A=x;var w=p.iconPaths={};k(S,function(M,C){var b=Cg(M,{},{x:-s/2,y:-s/2,width:s,height:s});b.setStyle(m.getItemStyle());var T=b.ensureState("emphasis");T.style=y.getItemStyle();var P=new Ot({style:{text:A[C],align:y.get("textAlign"),borderRadius:y.get("textBorderRadius"),padding:y.get("textPadding"),fill:null,font:v2({fontStyle:y.get("textFontStyle"),fontFamily:y.get("textFontFamily"),fontSize:y.get("textFontSize"),fontWeight:y.get("textFontWeight")},n)},ignore:!0});b.setTextContent(P),Kc({el:b,componentModel:t,itemName:C,formatterParamsExtra:{title:A[C]}}),b.__title=A[C],b.on("mouseover",function(){var D=y.getItemStyle(),L=l?t.get("right")==null&&t.get("left")!=="right"?"right":"left":t.get("bottom")==null&&t.get("top")!=="bottom"?"bottom":"top";P.setStyle({fill:y.get("textFill")||D.fill||D.stroke||"#000",backgroundColor:y.get("textBackgroundColor")}),b.setTextConfig({position:y.get("textPosition")||L}),P.ignore=!t.get("showTitle"),i.enterEmphasis(this)}).on("mouseout",function(){p.get(["iconStatus",C])!=="emphasis"&&i.leaveEmphasis(this),P.hide()}),(p.get(["iconStatus",C])==="emphasis"?Ds:Is)(b),o.add(b),b.on("click",Fe(g.onclick,g,n,i,C)),w[C]=b})}Ibe(o,t,i),o.add(gW(o.getBoundingRect(),t)),l||o.eachChild(function(p){var g=p.__title,v=p.ensureState("emphasis"),m=v.textConfig||(v.textConfig={}),y=p.getTextContent(),_=y&&y.ensureState("emphasis");if(_&&!qe(_)&&g){var x=_.style||(_.style={}),S=wg(g,Ot.makeFont(x)),A=p.x+o.x,w=p.y+o.y+s,M=!1;w+S.height>i.getHeight()&&(m.position="top",M=!0);var C=M?-5-S.height:s+10;A+S.width/2>i.getWidth()?(m.position=["100%",C],x.align="right"):A-S.width/2<0&&(m.position=[0,C],x.align="left")}})},e.prototype.updateView=function(t,n,i,a){k(this._features,function(o){o instanceof wa&&o.updateView&&o.updateView(o.model,n,i,a)})},e.prototype.remove=function(t,n){k(this._features,function(i){i instanceof wa&&i.remove&&i.remove(t,n)}),this.group.removeAll()},e.prototype.dispose=function(t,n){k(this._features,function(i){i instanceof wa&&i.dispose&&i.dispose(t,n)})},e.type="toolbox",e}(kn);function kbe(r){return r.indexOf("my")===0}const Obe=Nbe;var Fbe=function(r){ae(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.onclick=function(t,n){var i=this.model,a=i.get("name")||t.get("title.0.text")||"echarts",o=n.getZr().painter.getType()==="svg",s=o?"svg":i.get("type",!0)||"png",l=n.getConnectedDataURL({type:s,backgroundColor:i.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")}),u=kt.browser;if(typeof MouseEvent=="function"&&(u.newEdge||!u.ie&&!u.edge)){var c=document.createElement("a");c.download=a+"."+s,c.target="_blank",c.href=l;var h=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});c.dispatchEvent(h)}else if(window.navigator.msSaveOrOpenBlob||o){var f=l.split(","),d=f[0].indexOf("base64")>-1,p=o?decodeURIComponent(f[1]):f[1];d&&(p=window.atob(p));var g=a+"."+s;if(window.navigator.msSaveOrOpenBlob){for(var v=p.length,m=new Uint8Array(v);v--;)m[v]=p.charCodeAt(v);var y=new Blob([m]);window.navigator.msSaveOrOpenBlob(y,g)}else{var _=document.createElement("iframe");document.body.appendChild(_);var x=_.contentWindow,S=x.document;S.open("image/svg+xml","replace"),S.write(p),S.close(),x.focus(),S.execCommand("SaveAs",!0,g),document.body.removeChild(_)}}else{var A=i.get("lang"),w='',M=window.open();M.document.write(w),M.document.title=a}},e.getDefaultOption=function(t){var n={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return n},e}(wa);const Bbe=Fbe;var EF="__ec_magicType_stack__",zbe=[["line","bar"],["stack"]],Ube=function(r){ae(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getIcons=function(){var t=this.model,n=t.get("icon"),i={};return k(t.get("type"),function(a){n[a]&&(i[a]=n[a])}),i},e.getDefaultOption=function(t){var n={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return n},e.prototype.onclick=function(t,n,i){var a=this.model,o=a.get(["seriesIndex",i]);if(LF[i]){var s={series:[]},l=function(h){var f=h.subType,d=h.id,p=LF[i](f,d,h,a);p&&(Ke(p,h.option),s.series.push(p));var g=h.coordinateSystem;if(g&&g.type==="cartesian2d"&&(i==="line"||i==="bar")){var v=g.getAxesByScale("ordinal")[0];if(v){var m=v.dim,y=m+"Axis",_=h.getReferringComponents(y,nr).models[0],x=_.componentIndex;s[y]=s[y]||[];for(var S=0;S<=x;S++)s[y][x]=s[y][x]||{};s[y][x].boundaryGap=i==="bar"}}};k(zbe,function(h){pt(h,i)>=0&&k(h,function(f){a.setIconStatus(f,"normal")})}),a.setIconStatus(i,"emphasis"),t.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,c=i;i==="stack"&&(u=ht({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",i])!=="emphasis"&&(c="tiled")),n.dispatchAction({type:"changeMagicType",currentType:c,newOption:s,newTitle:u,featureName:"magicType"})}},e}(wa),LF={line:function(r,e,t,n){if(r==="bar")return ht({id:e,type:"line",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},n.get(["option","line"])||{},!0)},bar:function(r,e,t,n){if(r==="line")return ht({id:e,type:"bar",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},n.get(["option","bar"])||{},!0)},stack:function(r,e,t,n){var i=t.get("stack")===EF;if(r==="line"||r==="bar")return n.setIconStatus("stack",i?"normal":"emphasis"),ht({id:e,stack:i?"":EF},n.get(["option","stack"])||{},!0)}};es({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(r,e){e.mergeOption(r.newOption)});const Vbe=Ube;var J1=new Array(60).join("-"),od=" ";function Gbe(r){var e={},t=[],n=[];return r.eachRawSeries(function(i){var a=i.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var o=a.getBaseAxis();if(o.type==="category"){var s=o.dim+"_"+o.index;e[s]||(e[s]={categoryAxis:o,valueAxis:a.getOtherAxis(o),series:[]},n.push({axisDim:o.dim,axisIndex:o.index})),e[s].series.push(i)}else t.push(i)}else t.push(i)}),{seriesGroupByCategoryAxis:e,other:t,meta:n}}function Hbe(r){var e=[];return k(r,function(t,n){var i=t.categoryAxis,a=t.valueAxis,o=a.dim,s=[" "].concat(xe(t.series,function(d){return d.name})),l=[i.model.getCategories()];k(t.series,function(d){var p=d.getRawData();l.push(d.getRawData().mapArray(p.mapDimension(o),function(g){return g}))});for(var u=[s.join(od)],c=0;c=0)return!0}var _M=new RegExp("["+od+"]+","g");function Ybe(r){for(var e=r.split(/\n+/g),t=k_(e.shift()).split(_M),n=[],i=xe(t,function(l){return{name:l,data:[]}}),a=0;a=0;a--){var o=t[a];if(o[i])break}if(a<0){var s=r.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(s){var l=s.getPercentRange();t[0][i]={dataZoomId:i,start:l[0],end:l[1]}}}}),t.push(e)}function eTe(r){var e=UE(r),t=e[e.length-1];e.length>1&&e.pop();var n={};return mW(t,function(i,a){for(var o=e.length-1;o>=0;o--)if(i=e[o][a],i){n[a]=i;break}}),n}function tTe(r){yW(r).snapshots=null}function nTe(r){return UE(r).length}function UE(r){var e=yW(r);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var rTe=function(r){ae(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.onclick=function(t,n){tTe(t),n.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(t){var n={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:t.getLocaleModel().get(["toolbox","restore","title"])};return n},e}(wa);es({type:"restore",event:"restore",update:"prepareAndUpdate"},function(r,e){e.resetOption("recreate")});const iTe=rTe;var aTe=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],oTe=function(){function r(e,t,n){var i=this;this._targetInfoList=[];var a=PF(t,e);k(sTe,function(o,s){(!n||!n.include||pt(n.include,s)>=0)&&o(a,i._targetInfoList)})}return r.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,function(n,i,a){if((n.coordRanges||(n.coordRanges=[])).push(i),!n.coordRange){n.coordRange=i;var o=Rw[n.brushType](0,a,i);n.__rangeOffset={offset:NF[n.brushType](o.values,n.range,[1,1]),xyMinMax:o.xyMinMax}}}),e},r.prototype.matchOutputRanges=function(e,t,n){k(e,function(i){var a=this.findTargetInfo(i,t);a&&a!==!0&&k(a.coordSyses,function(o){var s=Rw[i.brushType](1,o,i.range,!0);n(i,s.values,o,t)})},this)},r.prototype.setInputRanges=function(e,t){k(e,function(n){var i=this.findTargetInfo(n,t);if(n.range=n.range||[],i&&i!==!0){n.panelId=i.panelId;var a=Rw[n.brushType](0,i.coordSys,n.coordRange),o=n.__rangeOffset;n.range=o?NF[n.brushType](a.values,o.offset,lTe(a.xyMinMax,o.xyMinMax)):a.values}},this)},r.prototype.makePanelOpts=function(e,t){return xe(this._targetInfoList,function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:t?t(n):null,clipPath:T6(i),isTargetByCursor:C6(i,e,n.coordSysModel),getLinearBrushOtherExtent:M6(i)}})},r.prototype.controlSeries=function(e,t,n){var i=this.findTargetInfo(e,n);return i===!0||i&&pt(i.coordSyses,t.coordinateSystem)>=0},r.prototype.findTargetInfo=function(e,t){for(var n=this._targetInfoList,i=PF(t,e),a=0;ar[1]&&r.reverse(),r}function PF(r,e){return rv(r,e,{includeMainTypes:aTe})}var sTe={grid:function(r,e){var t=r.xAxisModels,n=r.yAxisModels,i=r.gridModels,a=He(),o={},s={};!t&&!n&&!i||(k(t,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),k(n,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),k(i,function(l){a.set(l.id,l),o[l.id]=!0,s[l.id]=!0}),a.each(function(l){var u=l.coordinateSystem,c=[];k(u.getCartesians(),function(h,f){(pt(t,h.getAxis("x").model)>=0||pt(n,h.getAxis("y").model)>=0)&&c.push(h)}),e.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:c[0],coordSyses:c,getPanelRect:DF.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(r,e){k(r.geoModels,function(t){var n=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:n,coordSyses:[n],getPanelRect:DF.geo})})}},RF=[function(r,e){var t=r.xAxisModel,n=r.yAxisModel,i=r.gridModel;return!i&&t&&(i=t.axis.grid.model),!i&&n&&(i=n.axis.grid.model),i&&i===e.gridModel},function(r,e){var t=r.geoModel;return t&&t===e.geoModel}],DF={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var r=this.coordSys,e=r.getBoundingRect().clone();return e.applyTransform(Lc(r)),e}},Rw={lineX:ut(IF,0),lineY:ut(IF,1),rect:function(r,e,t,n){var i=r?e.pointToData([t[0][0],t[1][0]],n):e.dataToPoint([t[0][0],t[1][0]],n),a=r?e.pointToData([t[0][1],t[1][1]],n):e.dataToPoint([t[0][1],t[1][1]],n),o=[xM([i[0],a[0]]),xM([i[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(r,e,t,n){var i=[[1/0,-1/0],[1/0,-1/0]],a=xe(t,function(o){var s=r?e.pointToData(o,n):e.dataToPoint(o,n);return i[0][0]=Math.min(i[0][0],s[0]),i[1][0]=Math.min(i[1][0],s[1]),i[0][1]=Math.max(i[0][1],s[0]),i[1][1]=Math.max(i[1][1],s[1]),s});return{values:a,xyMinMax:i}}};function IF(r,e,t,n){var i=t.getAxis(["x","y"][r]),a=xM(xe([0,1],function(s){return e?i.coordToData(i.toLocalCoord(n[s]),!0):i.toGlobalCoord(i.dataToCoord(n[s]))})),o=[];return o[r]=a,o[1-r]=[NaN,NaN],{values:a,xyMinMax:o}}var NF={lineX:ut(kF,0),lineY:ut(kF,1),rect:function(r,e,t){return[[r[0][0]-t[0]*e[0][0],r[0][1]-t[0]*e[0][1]],[r[1][0]-t[1]*e[1][0],r[1][1]-t[1]*e[1][1]]]},polygon:function(r,e,t){return xe(r,function(n,i){return[n[0]-t[0]*e[i][0],n[1]-t[1]*e[i][1]]})}};function kF(r,e,t,n){return[e[0]-n[r]*t[0],e[1]-n[r]*t[1]]}function lTe(r,e){var t=OF(r),n=OF(e),i=[t[0]/n[0],t[1]/n[1]];return isNaN(i[0])&&(i[0]=1),isNaN(i[1])&&(i[1]=1),i}function OF(r){return r?[r[0][1]-r[0][0],r[1][1]-r[1][0]]:[NaN,NaN]}const VE=oTe;var SM=k,uTe=Lse("toolbox-dataZoom_"),cTe=function(r){ae(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,n,i,a){this._brushController||(this._brushController=new _E(i.getZr()),this._brushController.on("brush",Fe(this._onBrush,this)).mount()),dTe(t,n,this,a,i),fTe(t,n)},e.prototype.onclick=function(t,n,i){hTe[i].call(this)},e.prototype.remove=function(t,n){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,n){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var n=t.areas;if(!t.isEnd||!n.length)return;var i={},a=this.ecModel;this._brushController.updateCovers([]);var o=new VE(GE(this.model),a,{include:["grid"]});o.matchOutputRanges(n,a,function(u,c,h){if(h.type==="cartesian2d"){var f=u.brushType;f==="rect"?(s("x",h,c[0]),s("y",h,c[1])):s({lineX:"x",lineY:"y"}[f],h,c)}}),Jbe(a,i),this._dispatchZoomAction(i);function s(u,c,h){var f=c.getAxis(u),d=f.model,p=l(u,d,a),g=p.findRepresentativeAxisProxy(d).getMinMaxSpan();(g.minValueSpan!=null||g.maxValueSpan!=null)&&(h=rh(0,h.slice(),f.scale.getExtent(),0,g.minValueSpan,g.maxValueSpan)),p&&(i[p.id]={dataZoomId:p.id,startValue:h[0],endValue:h[1]})}function l(u,c,h){var f;return h.eachComponent({mainType:"dataZoom",subType:"select"},function(d){var p=d.getAxisModel(u,c.componentIndex);p&&(f=d)}),f}},e.prototype._dispatchZoomAction=function(t){var n=[];SM(t,function(i,a){n.push(Je(i))}),n.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:n})},e.getDefaultOption=function(t){var n={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}};return n},e}(wa),hTe={zoom:function(){var r=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:r})},back:function(){this._dispatchZoomAction(eTe(this.ecModel))}};function GE(r){var e={xAxisIndex:r.get("xAxisIndex",!0),yAxisIndex:r.get("yAxisIndex",!0),xAxisId:r.get("xAxisId",!0),yAxisId:r.get("yAxisId",!0)};return e.xAxisIndex==null&&e.xAxisId==null&&(e.xAxisIndex="all"),e.yAxisIndex==null&&e.yAxisId==null&&(e.yAxisIndex="all"),e}function fTe(r,e){r.setIconStatus("back",nTe(e)>1?"emphasis":"normal")}function dTe(r,e,t,n,i){var a=t._isZoomActive;n&&n.type==="takeGlobalCursor"&&(a=n.key==="dataZoomSelect"?n.dataZoomSelectActive:!1),t._isZoomActive=a,r.setIconStatus("zoom",a?"emphasis":"normal");var o=new VE(GE(r),e,{include:["grid"]}),s=o.makePanelOpts(i,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});t._brushController.setPanels(s).enableBrush(a&&s.length?{brushType:"auto",brushStyle:r.getModel("brushStyle").getItemStyle()}:!1)}uce("dataZoom",function(r){var e=r.getComponent("toolbox",0),t=["feature","dataZoom"];if(!e||e.get(t)==null)return;var n=e.getModel(t),i=[],a=GE(n),o=rv(r,a);SM(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),SM(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,c){var h=l.componentIndex,f={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:uTe+u+h};f[c]=h,i.push(f)}return i});const pTe=cTe;function vTe(r){r.registerComponentModel(Dbe),r.registerComponentView(Obe),of("saveAsImage",Bbe),of("magicType",Vbe),of("dataView",Qbe),of("dataZoom",pTe),of("restore",iTe),gt(Pbe)}var gTe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(Nt);const mTe=gTe;function _W(r){var e=r.get("confine");return e!=null?!!e:r.get("renderMode")==="richText"}function xW(r){if(kt.domSupported){for(var e=document.documentElement.style,t=0,n=r.length;t-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var c=u*Math.PI/180,h=o+i,f=h*Math.abs(Math.cos(c))+h*Math.abs(Math.sin(c)),d=Math.round(((f-Math.SQRT2*i)/2+Math.SQRT2*i-(f-h)/2)*100)/100;s+=";"+a+":-"+d+"px";var p=e+" solid "+i+"px;",g=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+p,"border-right:"+p,"background-color:"+n+";"];return'
'}function bTe(r,e){var t="cubic-bezier(0.23,1,0.32,1)",n=" "+r/2+"s "+t,i="opacity"+n+",visibility"+n;return e||(n=" "+r+"s "+t,i+=kt.transformSupported?","+HE+n:",left"+n+",top"+n),xTe+":"+i}function FF(r,e,t){var n=r.toFixed(0)+"px",i=e.toFixed(0)+"px";if(!kt.transformSupported)return t?"top:"+i+";left:"+n+";":[["top",i],["left",n]];var a=kt.transform3dSupported,o="translate"+(a?"3d":"")+"("+n+","+i+(a?",0":"")+")";return t?"top:0;left:0;"+HE+":"+o+";":[["top",0],["left",0],[SW,o]]}function TTe(r){var e=[],t=r.get("fontSize"),n=r.getTextColor();n&&e.push("color:"+n),e.push("font:"+r.getFont());var i=ot(r.get("lineHeight"),Math.round(t*3/2));t&&e.push("line-height:"+i+"px");var a=r.get("textShadowColor"),o=r.get("textShadowBlur")||0,s=r.get("textShadowOffsetX")||0,l=r.get("textShadowOffsetY")||0;return a&&o&&e.push("text-shadow:"+s+"px "+l+"px "+o+"px "+a),k(["decoration","align"],function(u){var c=r.get(u);c&&e.push("text-"+u+":"+c)}),e.join(";")}function MTe(r,e,t){var n=[],i=r.get("transitionDuration"),a=r.get("backgroundColor"),o=r.get("shadowBlur"),s=r.get("shadowColor"),l=r.get("shadowOffsetX"),u=r.get("shadowOffsetY"),c=r.getModel("textStyle"),h=MG(r,"html"),f=l+"px "+u+"px "+o+"px "+s;return n.push("box-shadow:"+f),e&&i&&n.push(bTe(i,t)),a&&n.push("background-color:"+a),k(["width","color","radius"],function(d){var p="border-"+d,g=WV(p),v=r.get(g);v!=null&&n.push(p+":"+v+(d==="color"?"":"px"))}),n.push(TTe(c)),h!=null&&n.push("padding:"+Sd(h).join("px ")+"px"),n.join(";")+";"}function BF(r,e,t,n,i){var a=e&&e.painter;if(t){var o=a&&a.getViewportRoot();o&&Qae(r,o,t,n,i)}else{r[0]=n,r[1]=i;var s=a&&a.getViewportRootOffset();s&&(r[0]+=s.offsetLeft,r[1]+=s.offsetTop)}r[2]=r[0]/e.getWidth(),r[3]=r[1]/e.getHeight()}var CTe=function(){function r(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,kt.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=e.getZr(),a=t.appendTo,o=a&&(ke(a)?document.querySelector(a):Zf(a)?a:qe(a)&&a(e.getDom()));BF(this._styleCoord,i,o,e.getWidth()/2,e.getHeight()/2),(o||e.getDom()).appendChild(n),this._api=e,this._container=o;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=i.handler,c=i.painter.getViewportRoot();ma(c,l,!0),u.dispatch("mousemove",l)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return r.prototype.update=function(e){if(!this._container){var t=this._api.getDom(),n=_Te(t,"position"),i=t.style;i.position!=="absolute"&&n!=="absolute"&&(i.position="relative")}var a=e.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this.el.className=e.get("className")||""},r.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,a=this._styleCoord;n.innerHTML?i.cssText=STe+MTe(e,!this._firstShow,this._longHide)+FF(a[0],a[1],!0)+("border-color:"+Hc(t)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},r.prototype.setContent=function(e,t,n,i,a){var o=this.el;if(e==null){o.innerHTML="";return}var s="";if(ke(a)&&n.get("trigger")==="item"&&!_W(n)&&(s=wTe(n,i,a)),ke(e))o.innerHTML=e+s;else if(e){o.innerHTML="",_e(e)||(e=[e]);for(var l=0;l=0?this._tryShow(a,o):i==="leave"&&this._hide(o))},this))},e.prototype._keepShow=function(){var t=this._tooltipModel,n=this._ecModel,i=this._api,a=t.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!i.isDisposed()&&o.manuallyShowTip(t,n,i,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(t,n,i,a){if(!(a.from===this.uid||kt.node||!i.getDom())){var o=VF(a,i);this._ticket="";var s=a.dataByCoordSys,l=OTe(a,n,i);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var c=RTe;c.x=a.x,c.y=a.y,c.update(),at(c).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:c},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(t,n,i,a))return;var h=oW(a,n),f=h.point[0],d=h.point[1];f!=null&&d!=null&&this._tryShow({offsetX:f,offsetY:d,target:h.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(i.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:i.getZr().findHover(a.x,a.y).target},o))}},e.prototype.manuallyHideTip=function(t,n,i,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(VF(a,i))},e.prototype._manuallyAxisShowTip=function(t,n,i,a){var o=a.seriesIndex,s=a.dataIndex,l=n.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=n.getSeriesByIndex(o);if(u){var c=u.getData(),h=vp([c.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(h.get("trigger")==="axis")return i.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},e.prototype._tryShow=function(t,n){var i=t.target,a=this._tooltipModel;if(a){this._lastX=t.offsetX,this._lastY=t.offsetY;var o=t.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,t);else if(i){var s=at(i);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;lc(i,function(c){if(at(c).dataIndex!=null)return l=c,!0;if(at(c).tooltipConfig!=null)return u=c,!0},!0),l?this._showSeriesItemTooltip(t,l,n):u?this._showComponentItemTooltip(t,u,n):this._hide(n)}else this._lastDataByCoordSys=null,this._hide(n)}},e.prototype._showOrMove=function(t,n){var i=t.get("showDelay");n=Fe(n,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(n,i):n()},e.prototype._showAxisTooltip=function(t,n){var i=this._ecModel,a=this._tooltipModel,o=[n.offsetX,n.offsetY],s=vp([n.tooltipOption],a),l=this._renderMode,u=[],c=Ar("section",{blocks:[],noHeader:!0}),h=[],f=new vA;k(t,function(y){k(y.dataByAxis,function(_){var x=i.getComponent(_.axisDim+"Axis",_.axisIndex),S=_.value;if(!(!x||S==null)){var A=nW(S,x.axis,i,_.seriesDataIndices,_.valueLabelOpt),w=Ar("section",{header:A,noHeader:!eo(A),sortBlocks:!0,blocks:[]});c.blocks.push(w),k(_.seriesDataIndices,function(M){var C=i.getSeriesByIndex(M.seriesIndex),b=M.dataIndexInside,T=C.getDataParams(b);if(!(T.dataIndex<0)){T.axisDim=_.axisDim,T.axisIndex=_.axisIndex,T.axisType=_.axisType,T.axisId=_.axisId,T.axisValue=G2(x.axis,{value:S}),T.axisValueLabel=A,T.marker=f.makeTooltipMarker("item",Hc(T.color),l);var P=TN(C.formatTooltip(b,!0,null)),D=P.frag;if(D){var L=vp([C],a).get("valueFormatter");w.blocks.push(L?pe({valueFormatter:L},D):D)}P.text&&h.push(P.text),u.push(T)}})}})}),c.blocks.reverse(),h.reverse();var d=n.position,p=s.get("order"),g=RN(c,f,l,p,i.get("useUTC"),s.get("textStyle"));g&&h.unshift(g);var v=l==="richText"?` `:"
",m=h.join(v);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(t,u)?this._updatePosition(s,d,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,m,u,Math.random()+"",o[0],o[1],d,null,f)})},e.prototype._showSeriesItemTooltip=function(t,n,i){var a=this._ecModel,o=at(n),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,c=o.dataIndex,h=o.dataType,f=u.getData(h),d=this._renderMode,p=t.positionDefault,g=vp([f.getItemModel(c),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),v=g.get("trigger");if(!(v!=null&&v!=="item")){var m=u.getDataParams(c,h),y=new vA;m.marker=y.makeTooltipMarker("item",Hc(m.color),d);var _=TN(u.formatTooltip(c,!1,h)),x=g.get("order"),S=g.get("valueFormatter"),A=_.frag,w=A?RN(S?pe({valueFormatter:S},A):A,y,d,x,a.get("useUTC"),g.get("textStyle")):_.text,M="item_"+u.name+"_"+c;this._showOrMove(g,function(){this._showTooltipContent(g,w,m,M,t.offsetX,t.offsetY,t.position,t.target,y)}),i({type:"showTip",dataIndexInside:c,dataIndex:f.getRawIndex(c),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,n,i){var a=this._renderMode==="html",o=at(n),s=o.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if(ke(l)){var c=l;l={content:c,formatter:c},u=!0}u&&a&&l.content&&(l=Je(l),l.content=Jr(l.content));var h=[l],f=this._ecModel.getComponent(o.componentMainType,o.componentIndex);f&&h.push(f),h.push({formatter:l.content});var d=t.positionDefault,p=vp(h,this._tooltipModel,d?{position:d}:null),g=p.get("content"),v=Math.random()+"",m=new vA;this._showOrMove(p,function(){var y=Je(p.get("formatterParams")||{});this._showTooltipContent(p,g,y,v,t.offsetX,t.offsetY,t.position,n,m)}),i({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,n,i,a,o,s,l,u,c){if(this._ticket="",!(!t.get("showContent")||!t.get("show"))){var h=this._tooltipContent;h.setEnterable(t.get("enterable"));var f=t.get("formatter");l=l||t.get("position");var d=n,p=this._getNearestPoint([o,s],i,t.get("trigger"),t.get("borderColor")),g=p.color;if(f)if(ke(f)){var v=t.ecModel.get("useUTC"),m=_e(i)?i[0]:i,y=m&&m.axisType&&m.axisType.indexOf("time")>=0;d=f,y&&(d=P1(m.axisValue,d,v)),d=$V(d,i,!0)}else if(qe(f)){var _=Fe(function(x,S){x===this._ticket&&(h.setContent(S,c,t,g,l),this._updatePosition(t,l,o,s,h,i,u))},this);this._ticket=a,d=f(i,a,_)}else d=f;h.setContent(d,c,t,g,l),h.show(t,g),this._updatePosition(t,l,o,s,h,i,u)}},e.prototype._getNearestPoint=function(t,n,i,a){if(i==="axis"||_e(n))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!_e(n))return{color:a||n.color||n.borderColor}},e.prototype._updatePosition=function(t,n,i,a,o,s,l){var u=this._api.getWidth(),c=this._api.getHeight();n=n||t.get("position");var h=o.getSize(),f=t.get("align"),d=t.get("verticalAlign"),p=l&&l.getBoundingRect().clone();if(l&&p.applyTransform(l.transform),qe(n)&&(n=n([i,a],s,o.el,p,{viewSize:[u,c],contentSize:h.slice()})),_e(n))i=Pe(n[0],u),a=Pe(n[1],c);else if(Qe(n)){var g=n;g.width=h[0],g.height=h[1];var v=dr(g,{width:u,height:c});i=v.x,a=v.y,f=null,d=null}else if(ke(n)&&l){var m=kTe(n,p,h,t.get("borderWidth"));i=m[0],a=m[1]}else{var m=ITe(i,a,o,u,c,f?null:20,d?null:20);i=m[0],a=m[1]}if(f&&(i-=GF(f)?h[0]/2:f==="right"?h[0]:0),d&&(a-=GF(d)?h[1]/2:d==="bottom"?h[1]:0),_W(t)){var m=NTe(i,a,o,u,c);i=m[0],a=m[1]}o.moveTo(i,a)},e.prototype._updateContentNotChangedOnAxis=function(t,n){var i=this._lastDataByCoordSys,a=this._cbParamsList,o=!!i&&i.length===t.length;return o&&k(i,function(s,l){var u=s.dataByAxis||[],c=t[l]||{},h=c.dataByAxis||[];o=o&&u.length===h.length,o&&k(u,function(f,d){var p=h[d]||{},g=f.seriesDataIndices||[],v=p.seriesDataIndices||[];o=o&&f.value===p.value&&f.axisType===p.axisType&&f.axisId===p.axisId&&g.length===v.length,o&&k(g,function(m,y){var _=v[y];o=o&&m.seriesIndex===_.seriesIndex&&m.dataIndex===_.dataIndex}),a&&k(f.seriesDataIndices,function(m){var y=m.seriesIndex,_=n[y],x=a[y];_&&x&&x.data!==_.data&&(o=!1)})})}),this._lastDataByCoordSys=t,this._cbParamsList=n,!!o},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,n){kt.node||!n.getDom()||(Kv(this,"_updatePosition"),this._tooltipContent.dispose(),gM("itemTooltip",n))},e.type="tooltip",e}(kn);function vp(r,e,t){var n=e.ecModel,i;t?(i=new vn(t,n,n),i=new vn(e.option,i,n)):i=e;for(var a=r.length-1;a>=0;a--){var o=r[a];o&&(o instanceof vn&&(o=o.get("tooltip",!0)),ke(o)&&(o={formatter:o}),o&&(i=new vn(o,i,n)))}return i}function VF(r,e){return r.dispatchAction||Fe(e.dispatchAction,e)}function ITe(r,e,t,n,i,a,o){var s=t.getSize(),l=s[0],u=s[1];return a!=null&&(r+l+a+2>n?r-=l+a:r+=a),o!=null&&(e+u+o>i?e-=u+o:e+=o),[r,e]}function NTe(r,e,t,n,i){var a=t.getSize(),o=a[0],s=a[1];return r=Math.min(r+o,n)-o,e=Math.min(e+s,i)-s,r=Math.max(r,0),e=Math.max(e,0),[r,e]}function kTe(r,e,t,n){var i=t[0],a=t[1],o=Math.ceil(Math.SQRT2*n)+8,s=0,l=0,u=e.width,c=e.height;switch(r){case"inside":s=e.x+u/2-i/2,l=e.y+c/2-a/2;break;case"top":s=e.x+u/2-i/2,l=e.y-a-o;break;case"bottom":s=e.x+u/2-i/2,l=e.y+c+o;break;case"left":s=e.x-i-o,l=e.y+c/2-a/2;break;case"right":s=e.x+u+o,l=e.y+c/2-a/2}return[s,l]}function GF(r){return r==="center"||r==="middle"}function OTe(r,e,t){var n=e2(r).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=bg(e,i,n.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=t.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var c=at(u).tooltipConfig;if(c&&c.name===r.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:o.componentIndex,el:l}}}}const FTe=DTe;function BTe(r){gt(Ug),r.registerComponentModel(mTe),r.registerComponentView(FTe),r.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},qn),r.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},qn)}var zTe=["rect","polygon","keep","clear"];function UTe(r,e){var t=nn(r?r.brush:[]);if(t.length){var n=[];k(t,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(n=n.concat(u))});var i=r&&r.toolbox;_e(i)&&(i=i[0]),i||(i={feature:{}},r.toolbox=[i]);var a=i.feature||(i.feature={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,n),VTe(s),e&&!s.length&&s.push.apply(s,zTe)}}function VTe(r){var e={};k(r,function(t){e[t]=1}),r.length=0,k(e,function(t,n){r.push(n)})}var HF=k;function WF(r){if(r){for(var e in r)if(r.hasOwnProperty(e))return!0}}function AM(r,e,t){var n={};return HF(e,function(a){var o=n[a]=i();HF(r[a],function(s,l){if(Fr.isValidType(l)){var u={type:l,visual:s};t&&t(u,a),o[l]=new Fr(u),l==="opacity"&&(u=Je(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new Fr(u))}})}),n;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function wW(r,e,t){var n;k(t,function(i){e.hasOwnProperty(i)&&WF(e[i])&&(n=!0)}),n&&k(t,function(i){e.hasOwnProperty(i)&&WF(e[i])?r[i]=Je(e[i]):delete r[i]})}function GTe(r,e,t,n,i,a){var o={};k(r,function(h){var f=Fr.prepareVisualTypes(e[h]);o[h]=f});var s;function l(h){return R2(t,s,h)}function u(h,f){OG(t,s,h,f)}a==null?t.each(c):t.each([a],c);function c(h,f){s=a==null?h:f;var d=t.getRawDataItem(s);if(!(d&&d.visualMap===!1))for(var p=n.call(i,h),g=e[p],v=o[p],m=0,y=v.length;me[0][1]&&(e[0][1]=a[0]),a[1]e[1][1]&&(e[1][1]=a[1])}return e&&jF(e)}};function jF(r){return new dt(r[0][0],r[1][0],r[0][1]-r[0][0],r[1][1]-r[1][0])}var KTe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,n){this.ecModel=t,this.api=n,this.model,(this._brushController=new _E(n.getZr())).on("brush",Fe(this._onBrush,this)).mount()},e.prototype.render=function(t,n,i,a){this.model=t,this._updateController(t,n,i,a)},e.prototype.updateTransform=function(t,n,i,a){bW(n),this._updateController(t,n,i,a)},e.prototype.updateVisual=function(t,n,i,a){this.updateTransform(t,n,i,a)},e.prototype.updateView=function(t,n,i,a){this._updateController(t,n,i,a)},e.prototype._updateController=function(t,n,i,a){(!a||a.$from!==t.id)&&this._brushController.setPanels(t.brushTargetManager.makePanelOpts(i)).enableBrush(t.brushOption).updateCovers(t.areas.slice())},e.prototype.dispose=function(){this._brushController.dispose()},e.prototype._onBrush=function(t){var n=this.model.id,i=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:n,areas:Je(i),$from:n}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:n,areas:Je(i),$from:n})},e.type="brush",e}(kn);const ZTe=KTe;var QTe="#ddd",JTe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.areas=[],t.brushOption={},t}return e.prototype.optionUpdated=function(t,n){var i=this.option;!n&&wW(i,t,["inBrush","outOfBrush"]);var a=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:QTe},a.hasOwnProperty("liftZ")||(a.liftZ=5)},e.prototype.setAreas=function(t){t&&(this.areas=xe(t,function(n){return KF(this.option,n)},this))},e.prototype.setBrushOption=function(t){this.brushOption=KF(this.option,t),this.brushType=this.brushOption.brushType},e.type="brush",e.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],e.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},e}(Nt);function KF(r,e){return ht({brushType:r.brushType,brushMode:r.brushMode,transformable:r.transformable,brushStyle:new vn(r.brushStyle).getItemStyle(),removeOnClick:r.removeOnClick,z:r.z},e,!0)}const eMe=JTe;var tMe=["rect","polygon","lineX","lineY","keep","clear"],nMe=function(r){ae(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,n,i){var a,o,s;n.eachComponent({mainType:"brush"},function(l){a=l.brushType,o=l.brushOption.brushMode||"single",s=s||!!l.areas.length}),this._brushType=a,this._brushMode=o,k(t.get("type",!0),function(l){t.setIconStatus(l,(l==="keep"?o==="multiple":l==="clear"?s:l===a)?"emphasis":"normal")})},e.prototype.updateView=function(t,n,i){this.render(t,n,i)},e.prototype.getIcons=function(){var t=this.model,n=t.get("icon",!0),i={};return k(t.get("type",!0),function(a){n[a]&&(i[a]=n[a])}),i},e.prototype.onclick=function(t,n,i){var a=this._brushType,o=this._brushMode;i==="clear"?(n.dispatchAction({type:"axisAreaSelect",intervals:[]}),n.dispatchAction({type:"brush",command:"clear",areas:[]})):n.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:i==="keep"?a:a===i?!1:i,brushMode:i==="keep"?o==="multiple"?"single":"multiple":o}})},e.getDefaultOption=function(t){var n={show:!0,type:tMe.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:t.getLocaleModel().get(["toolbox","brush","title"])};return n},e}(wa);const rMe=nMe;function iMe(r){r.registerComponentView(ZTe),r.registerComponentModel(eMe),r.registerPreprocessor(UTe),r.registerVisual(r.PRIORITY.VISUAL.BRUSH,$Te),r.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(e,t){t.eachComponent({mainType:"brush",query:e},function(n){n.setAreas(e.areas)})}),r.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},qn),r.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},qn),of("brush",rMe)}var aMe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.layoutMode={type:"box",ignoreSize:!0},t}return e.type="title",e.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(Nt),oMe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){if(this.group.removeAll(),!!t.get("show")){var a=this.group,o=t.getModel("textStyle"),s=t.getModel("subtextStyle"),l=t.get("textAlign"),u=ot(t.get("textBaseline"),t.get("textVerticalAlign")),c=new Ot({style:pn(o,{text:t.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),h=c.getBoundingRect(),f=t.get("subtext"),d=new Ot({style:pn(s,{text:f,fill:s.getTextColor(),y:h.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),p=t.get("link"),g=t.get("sublink"),v=t.get("triggerEvent",!0);c.silent=!p&&!v,d.silent=!g&&!v,p&&c.on("click",function(){c_(p,"_"+t.get("target"))}),g&&d.on("click",function(){c_(g,"_"+t.get("subtarget"))}),at(c).eventData=at(d).eventData=v?{componentType:"title",componentIndex:t.componentIndex}:null,a.add(c),f&&a.add(d);var m=a.getBoundingRect(),y=t.getBoxLayoutParams();y.width=m.width,y.height=m.height;var _=dr(y,{width:i.getWidth(),height:i.getHeight()},t.get("padding"));l||(l=t.get("left")||t.get("right"),l==="middle"&&(l="center"),l==="right"?_.x+=_.width:l==="center"&&(_.x+=_.width/2)),u||(u=t.get("top")||t.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?_.y+=_.height:u==="middle"&&(_.y+=_.height/2),u=u||"top"),a.x=_.x,a.y=_.y,a.markRedraw();var x={align:l,verticalAlign:u};c.setStyle(x),d.setStyle(x),m=a.getBoundingRect();var S=_.margin,A=t.getItemStyle(["color","opacity"]);A.fill=t.get("backgroundColor");var w=new Dt({shape:{x:m.x-S[3],y:m.y-S[0],width:m.width+S[1]+S[3],height:m.height+S[0]+S[2],r:t.get("borderRadius")},style:A,subPixelOptimize:!0,silent:!0});a.add(w)}},e.type="title",e}(kn);function sMe(r){r.registerComponentModel(aMe),r.registerComponentView(oMe)}var lMe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.layoutMode="box",t}return e.prototype.init=function(t,n,i){this.mergeDefaultAndTheme(t,i),this._initData()},e.prototype.mergeOption=function(t){r.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.setCurrentIndex=function(t){t==null&&(t=this.option.currentIndex);var n=this._data.count();this.option.loop?t=(t%n+n)%n:(t>=n&&(t=n-1),t<0&&(t=0)),this.option.currentIndex=t},e.prototype.getCurrentIndex=function(){return this.option.currentIndex},e.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},e.prototype.setPlayState=function(t){this.option.autoPlay=!!t},e.prototype.getPlayState=function(){return!!this.option.autoPlay},e.prototype._initData=function(){var t=this.option,n=t.data||[],i=t.axisType,a=this._names=[],o;i==="category"?(o=[],k(n,function(u,c){var h=fr(gd(u),""),f;Qe(u)?(f=Je(u),f.value=c):f=c,o.push(f),a.push(h)})):o=n;var s={category:"ordinal",time:"time",value:"number"}[i]||"number",l=this._data=new vi([{name:"value",type:s}],this);l.initData(o,a)},e.prototype.getData=function(){return this._data},e.prototype.getCategories=function(){if(this.get("axisType")==="category")return this._names.slice()},e.type="timeline",e.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},e}(Nt);const ZF=lMe;var TW=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="timeline.slider",e.defaultOption=su(ZF.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),e}(ZF);ir(TW,F1.prototype);const uMe=TW;var cMe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="timeline",e}(kn);const hMe=cMe;var fMe=function(r){ae(e,r);function e(t,n,i,a){var o=r.call(this,t,n,i)||this;return o.type=a||"value",o}return e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},e}(ho);const dMe=fMe;var Iw=Math.PI,QF=Pt(),pMe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,n){this.api=n},e.prototype.render=function(t,n,i){if(this.model=t,this.api=i,this.ecModel=n,this.group.removeAll(),t.get("show",!0)){var a=this._layout(t,i),o=this._createGroup("_mainGroup"),s=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,t);t.formatTooltip=function(u){var c=l.scale.getLabel({value:u});return Ar("nameValue",{noName:!0,value:c})},k(["AxisLine","AxisTick","Control","CurrentPointer"],function(u){this["_render"+u](a,o,l,t)},this),this._renderAxisLabel(a,s,l,t),this._position(a,t)}this._doPlayStop(),this._updateTicksStatus()},e.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},e.prototype.dispose=function(){this._clearTimer()},e.prototype._layout=function(t,n){var i=t.get(["label","position"]),a=t.get("orient"),o=gMe(t,n),s;i==null||i==="auto"?s=a==="horizontal"?o.y+o.height/2=0||s==="+"?"left":"right"},u={horizontal:s>=0||s==="+"?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:Iw/2},h=a==="vertical"?o.height:o.width,f=t.getModel("controlStyle"),d=f.get("show",!0),p=d?f.get("itemSize"):0,g=d?f.get("itemGap"):0,v=p+g,m=t.get(["label","rotate"])||0;m=m*Iw/180;var y,_,x,S=f.get("position",!0),A=d&&f.get("showPlayBtn",!0),w=d&&f.get("showPrevBtn",!0),M=d&&f.get("showNextBtn",!0),C=0,b=h;S==="left"||S==="bottom"?(A&&(y=[0,0],C+=v),w&&(_=[C,0],C+=v),M&&(x=[b-p,0],b-=v)):(A&&(y=[b-p,0],b-=v),w&&(_=[0,0],C+=v),M&&(x=[b-p,0],b-=v));var T=[C,b];return t.get("inverse")&&T.reverse(),{viewRect:o,mainLength:h,orient:a,rotation:c[a],labelRotation:m,labelPosOpt:s,labelAlign:t.get(["label","align"])||l[a],labelBaseline:t.get(["label","verticalAlign"])||t.get(["label","baseline"])||u[a],playPosition:y,prevBtnPosition:_,nextBtnPosition:x,axisExtent:T,controlSize:p,controlGap:g}},e.prototype._position=function(t,n){var i=this._mainGroup,a=this._labelGroup,o=t.viewRect;if(t.orient==="vertical"){var s=ta(),l=o.x,u=o.y+o.height;Xo(s,s,[-l,-u]),jc(s,s,-Iw/2),Xo(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var c=y(o),h=y(i.getBoundingRect()),f=y(a.getBoundingRect()),d=[i.x,i.y],p=[a.x,a.y];p[0]=d[0]=c[0][0];var g=t.labelPosOpt;if(g==null||ke(g)){var v=g==="+"?0:1;_(d,h,c,1,v),_(p,f,c,1,1-v)}else{var v=g>=0?0:1;_(d,h,c,1,v),p[1]=d[1]+g}i.setPosition(d),a.setPosition(p),i.rotation=a.rotation=t.rotation,m(i),m(a);function m(x){x.originX=c[0][0]-x.x,x.originY=c[1][0]-x.y}function y(x){return[[x.x,x.x+x.width],[x.y,x.y+x.height]]}function _(x,S,A,w,M){x[w]+=A[w][M]-S[w][M]}},e.prototype._createAxis=function(t,n){var i=n.getData(),a=n.get("axisType"),o=vMe(n,a);o.getTicks=function(){return i.mapArray(["value"],function(u){return{value:u}})};var s=i.getDataExtent("value");o.setExtent(s[0],s[1]),o.calcNiceTicks();var l=new dMe("value",o,t.axisExtent,a);return l.model=n,l},e.prototype._createGroup=function(t){var n=this[t]=new rt;return this.group.add(n),n},e.prototype._renderAxisLine=function(t,n,i,a){var o=i.getExtent();if(a.get(["lineStyle","show"])){var s=new Cr({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:pe({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});n.add(s);var l=this._progressLine=new Cr({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:Ke({lineCap:"round",lineWidth:s.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});n.add(l)}},e.prototype._renderAxisTick=function(t,n,i,a){var o=this,s=a.getData(),l=i.scale.getTicks();this._tickSymbols=[],k(l,function(u){var c=i.dataToCoord(u.value),h=s.getItemModel(u.value),f=h.getModel("itemStyle"),d=h.getModel(["emphasis","itemStyle"]),p=h.getModel(["progress","itemStyle"]),g={x:c,y:0,onclick:Fe(o._changeTimeline,o,u.value)},v=JF(h,f,n,g);v.ensureState("emphasis").style=d.getItemStyle(),v.ensureState("progress").style=p.getItemStyle(),Ec(v);var m=at(v);h.get("tooltip")?(m.dataIndex=u.value,m.dataModel=a):m.dataIndex=m.dataModel=null,o._tickSymbols.push(v)})},e.prototype._renderAxisLabel=function(t,n,i,a){var o=this,s=i.getLabelModel();if(s.get("show")){var l=a.getData(),u=i.getViewLabels();this._tickLabels=[],k(u,function(c){var h=c.tickValue,f=l.getItemModel(h),d=f.getModel("label"),p=f.getModel(["emphasis","label"]),g=f.getModel(["progress","label"]),v=i.dataToCoord(c.tickValue),m=new Ot({x:v,y:0,rotation:t.labelRotation-t.rotation,onclick:Fe(o._changeTimeline,o,h),silent:!1,style:pn(d,{text:c.formattedLabel,align:t.labelAlign,verticalAlign:t.labelBaseline})});m.ensureState("emphasis").style=pn(p),m.ensureState("progress").style=pn(g),n.add(m),Ec(m),QF(m).dataIndex=h,o._tickLabels.push(m)})}},e.prototype._renderControl=function(t,n,i,a){var o=t.controlSize,s=t.rotation,l=a.getModel("controlStyle").getItemStyle(),u=a.getModel(["emphasis","controlStyle"]).getItemStyle(),c=a.getPlayState(),h=a.get("inverse",!0);f(t.nextBtnPosition,"next",Fe(this._changeTimeline,this,h?"-":"+")),f(t.prevBtnPosition,"prev",Fe(this._changeTimeline,this,h?"+":"-")),f(t.playPosition,c?"stop":"play",Fe(this._handlePlayClick,this,!c),!0);function f(d,p,g,v){if(d){var m=so(ot(a.get(["controlStyle",p+"BtnSize"]),o),o),y=[0,-m/2,m,m],_=mMe(a,p+"Icon",y,{x:d[0],y:d[1],originX:o/2,originY:0,rotation:v?-s:0,rectHover:!0,style:l,onclick:g});_.ensureState("emphasis").style=u,n.add(_),Ec(_)}}},e.prototype._renderCurrentPointer=function(t,n,i,a){var o=a.getData(),s=a.getCurrentIndex(),l=o.getItemModel(s).getModel("checkpointStyle"),u=this,c={onCreate:function(h){h.draggable=!0,h.drift=Fe(u._handlePointerDrag,u),h.ondragend=Fe(u._handlePointerDragend,u),eB(h,u._progressLine,s,i,a,!0)},onUpdate:function(h){eB(h,u._progressLine,s,i,a)}};this._currentPointer=JF(l,l,this._mainGroup,{},this._currentPointer,c)},e.prototype._handlePlayClick=function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},e.prototype._handlePointerDrag=function(t,n,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},e.prototype._handlePointerDragend=function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},e.prototype._pointerChangeTimeline=function(t,n){var i=this._toAxisCoord(t)[0],a=this._axis,o=Pa(a.getExtent().slice());i>o[1]&&(i=o[1]),i=0&&(o[a]=+o[a].toFixed(f)),[o,h]}var Nw={min:ut(ky,"min"),max:ut(ky,"max"),average:ut(ky,"average"),median:ut(ky,"median")};function ug(r,e){if(e){var t=r.getData(),n=r.coordinateSystem,i=n&&n.dimensions;if(!TMe(e)&&!_e(e.coord)&&_e(i)){var a=CW(e,t,n,r);if(e=Je(e),e.type&&Nw[e.type]&&a.baseAxis&&a.valueAxis){var o=pt(i,a.baseAxis.dim),s=pt(i,a.valueAxis.dim),l=Nw[e.type](t,a.baseDataDim,a.valueDataDim,o,s);e.coord=l[0],e.value=l[1]}else e.coord=[e.xAxis!=null?e.xAxis:e.radiusAxis,e.yAxis!=null?e.yAxis:e.angleAxis]}if(e.coord==null||!_e(i))e.coord=[];else for(var u=e.coord,c=0;c<2;c++)Nw[u[c]]&&(u[c]=$E(t,t.mapDimension(i[c]),u[c]));return e}}function CW(r,e,t,n){var i={};return r.valueIndex!=null||r.valueDim!=null?(i.valueDataDim=r.valueIndex!=null?e.getDimension(r.valueIndex):r.valueDim,i.valueAxis=t.getAxis(MMe(n,i.valueDataDim)),i.baseAxis=t.getOtherAxis(i.valueAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim)):(i.baseAxis=n.getBaseAxis(),i.valueAxis=t.getOtherAxis(i.baseAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim),i.valueDataDim=e.mapDimension(i.valueAxis.dim)),i}function MMe(r,e){var t=r.getData().getDimensionInfo(e);return t&&t.coordDim}function cg(r,e){return r&&r.containData&&e.coord&&!bM(e)?r.containData(e.coord):!0}function CMe(r,e,t){return r&&r.containZone&&e.coord&&t.coord&&!bM(e)&&!bM(t)?r.containZone(e.coord,t.coord):!0}function EW(r,e){return r?function(t,n,i,a){var o=a<2?t.coord&&t.coord[a]:t.value;return Gl(o,e[a])}:function(t,n,i,a){return Gl(t.value,e[a])}}function $E(r,e,t){if(t==="average"){var n=0,i=0;return r.each(e,function(a,o){isNaN(a)||(n+=a,i++)}),n/i}else return t==="median"?r.getMedian(e):r.getDataExtent(e)[t==="max"?1:0]}var kw=Pt(),EMe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){this.markerGroupMap=He()},e.prototype.render=function(t,n,i){var a=this,o=this.markerGroupMap;o.each(function(s){kw(s).keep=!1}),n.eachSeries(function(s){var l=nu.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,n,i)}),o.each(function(s){!kw(s).keep&&a.group.remove(s.group)})},e.prototype.markKeep=function(t){kw(t).keep=!0},e.prototype.toggleBlurSeries=function(t,n){var i=this;k(t,function(a){var o=nu.getMarkerModelFromSeries(a,i.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(n?J4(l):s2(l))})}})},e.type="marker",e}(kn);const XE=EMe;function nB(r,e,t){var n=e.coordinateSystem;r.each(function(i){var a=r.getItemModel(i),o,s=Pe(a.get("x"),t.getWidth()),l=Pe(a.get("y"),t.getHeight());if(!isNaN(s)&&!isNaN(l))o=[s,l];else if(e.getMarkerPosition)o=e.getMarkerPosition(r.getValues(r.dimensions,i));else if(n){var u=r.get(n.dimensions[0],i),c=r.get(n.dimensions[1],i);o=n.dataToPoint([u,c])}isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),r.setItemLayout(i,o)})}var LMe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,n,i){n.eachSeries(function(a){var o=nu.getMarkerModelFromSeries(a,"markPoint");o&&(nB(o.getData(),a,i),this.markerGroupMap.get(a.id).updateLayout())},this)},e.prototype.renderSeries=function(t,n,i,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new Ig),h=PMe(o,t,n);n.setData(h),nB(n.getData(),t,a),h.each(function(f){var d=h.getItemModel(f),p=d.getShallow("symbol"),g=d.getShallow("symbolSize"),v=d.getShallow("symbolRotate"),m=d.getShallow("symbolOffset"),y=d.getShallow("symbolKeepAspect");if(qe(p)||qe(g)||qe(v)||qe(m)){var _=n.getRawValue(f),x=n.getDataParams(f);qe(p)&&(p=p(_,x)),qe(g)&&(g=g(_,x)),qe(v)&&(v=v(_,x)),qe(m)&&(m=m(_,x))}var S=d.getModel("itemStyle").getItemStyle(),A=Lg(l,"color");S.fill||(S.fill=A),h.setItemVisual(f,{symbol:p,symbolSize:g,symbolRotate:v,symbolOffset:m,symbolKeepAspect:y,style:S})}),c.updateData(h),this.group.add(c.group),h.eachItemGraphicEl(function(f){f.traverse(function(d){at(d).dataModel=n})}),this.markKeep(c),c.group.silent=n.get("silent")||t.get("silent")},e.type="markPoint",e}(XE);function PMe(r,e,t){var n;r?n=xe(r&&r.dimensions,function(s){var l=e.getData().getDimensionInfo(e.getData().mapDimension(s))||{};return pe(pe({},l),{name:s,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new vi(n,t),a=xe(t.get("data"),ut(ug,e));r&&(a=jt(a,ut(cg,r)));var o=EW(!!r,n);return i.initData(a,null,o),i}const RMe=LMe;function DMe(r){r.registerComponentModel(bMe),r.registerComponentView(RMe),r.registerPreprocessor(function(e){WE(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}var IMe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markLine",e.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(nu);const NMe=IMe;var Oy=Pt(),kMe=function(r,e,t,n){var i=r.getData(),a;if(_e(n))a=n;else{var o=n.type;if(o==="min"||o==="max"||o==="average"||o==="median"||n.xAxis!=null||n.yAxis!=null){var s=void 0,l=void 0;if(n.yAxis!=null||n.xAxis!=null)s=e.getAxis(n.yAxis!=null?"y":"x"),l=Mr(n.yAxis,n.xAxis);else{var u=CW(n,i,e,r);s=u.valueAxis;var c=hH(i,u.valueDataDim);l=$E(i,c,o)}var h=s.dim==="x"?0:1,f=1-h,d=Je(n),p={coord:[]};d.type=null,d.coord=[],d.coord[f]=-1/0,p.coord[f]=1/0;var g=t.get("precision");g>=0&&Ft(l)&&(l=+l.toFixed(Math.min(g,20))),d.coord[h]=p.coord[h]=l,a=[d,p,{type:o,valueIndex:n.valueIndex,value:l}]}else a=[]}var v=[ug(r,a[0]),ug(r,a[1]),pe({},a[2])];return v[2].type=v[2].type||null,ht(v[2],v[0]),ht(v[2],v[1]),v};function O_(r){return!isNaN(r)&&!isFinite(r)}function rB(r,e,t,n){var i=1-r,a=n.dimensions[r];return O_(e[i])&&O_(t[i])&&e[r]===t[r]&&n.getAxis(a).containData(e[r])}function OMe(r,e){if(r.type==="cartesian2d"){var t=e[0].coord,n=e[1].coord;if(t&&n&&(rB(1,t,n,r)||rB(0,t,n,r)))return!0}return cg(r,e[0])&&cg(r,e[1])}function Ow(r,e,t,n,i){var a=n.coordinateSystem,o=r.getItemModel(e),s,l=Pe(o.get("x"),i.getWidth()),u=Pe(o.get("y"),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(n.getMarkerPosition)s=n.getMarkerPosition(r.getValues(r.dimensions,e));else{var c=a.dimensions,h=r.get(c[0],e),f=r.get(c[1],e);s=a.dataToPoint([h,f])}if(th(a,"cartesian2d")){var d=a.getAxis("x"),p=a.getAxis("y"),c=a.dimensions;O_(r.get(c[0],e))?s[0]=d.toGlobalCoord(d.getExtent()[t?0:1]):O_(r.get(c[1],e))&&(s[1]=p.toGlobalCoord(p.getExtent()[t?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}r.setItemLayout(e,s)}var FMe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,n,i){n.eachSeries(function(a){var o=nu.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=Oy(o).from,u=Oy(o).to;l.each(function(c){Ow(l,c,!0,a,i),Ow(u,c,!1,a,i)}),s.each(function(c){s.setItemLayout(c,[l.getItemLayout(c),u.getItemLayout(c)])}),this.markerGroupMap.get(a.id).updateLayout()}},this)},e.prototype.renderSeries=function(t,n,i,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new dE);this.group.add(c.group);var h=BMe(o,t,n),f=h.from,d=h.to,p=h.line;Oy(n).from=f,Oy(n).to=d,n.setData(p);var g=n.get("symbol"),v=n.get("symbolSize"),m=n.get("symbolRotate"),y=n.get("symbolOffset");_e(g)||(g=[g,g]),_e(v)||(v=[v,v]),_e(m)||(m=[m,m]),_e(y)||(y=[y,y]),h.from.each(function(x){_(f,x,!0),_(d,x,!1)}),p.each(function(x){var S=p.getItemModel(x).getModel("lineStyle").getLineStyle();p.setItemLayout(x,[f.getItemLayout(x),d.getItemLayout(x)]),S.stroke==null&&(S.stroke=f.getItemVisual(x,"style").fill),p.setItemVisual(x,{fromSymbolKeepAspect:f.getItemVisual(x,"symbolKeepAspect"),fromSymbolOffset:f.getItemVisual(x,"symbolOffset"),fromSymbolRotate:f.getItemVisual(x,"symbolRotate"),fromSymbolSize:f.getItemVisual(x,"symbolSize"),fromSymbol:f.getItemVisual(x,"symbol"),toSymbolKeepAspect:d.getItemVisual(x,"symbolKeepAspect"),toSymbolOffset:d.getItemVisual(x,"symbolOffset"),toSymbolRotate:d.getItemVisual(x,"symbolRotate"),toSymbolSize:d.getItemVisual(x,"symbolSize"),toSymbol:d.getItemVisual(x,"symbol"),style:S})}),c.updateData(p),h.line.eachItemGraphicEl(function(x){at(x).dataModel=n,x.traverse(function(S){at(S).dataModel=n})});function _(x,S,A){var w=x.getItemModel(S);Ow(x,S,A,t,a);var M=w.getModel("itemStyle").getItemStyle();M.fill==null&&(M.fill=Lg(l,"color")),x.setItemVisual(S,{symbolKeepAspect:w.get("symbolKeepAspect"),symbolOffset:ot(w.get("symbolOffset",!0),y[A?0:1]),symbolRotate:ot(w.get("symbolRotate",!0),m[A?0:1]),symbolSize:ot(w.get("symbolSize"),v[A?0:1]),symbol:ot(w.get("symbol",!0),g[A?0:1]),style:M})}this.markKeep(c),c.group.silent=n.get("silent")||t.get("silent")},e.type="markLine",e}(XE);function BMe(r,e,t){var n;r?n=xe(r&&r.dimensions,function(u){var c=e.getData().getDimensionInfo(e.getData().mapDimension(u))||{};return pe(pe({},c),{name:u,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new vi(n,t),a=new vi(n,t),o=new vi([],t),s=xe(t.get("data"),ut(kMe,e,r,t));r&&(s=jt(s,ut(OMe,r)));var l=EW(!!r,n);return i.initData(xe(s,function(u){return u[0]}),null,l),a.initData(xe(s,function(u){return u[1]}),null,l),o.initData(xe(s,function(u){return u[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}const zMe=FMe;function UMe(r){r.registerComponentModel(NMe),r.registerComponentView(zMe),r.registerPreprocessor(function(e){WE(e.series,"markLine")&&(e.markLine=e.markLine||{})})}var VMe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markArea",e.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(nu);const GMe=VMe;var Fy=Pt(),HMe=function(r,e,t,n){var i=n[0],a=n[1];if(!(!i||!a)){var o=ug(r,i),s=ug(r,a),l=o.coord,u=s.coord;l[0]=Mr(l[0],-1/0),l[1]=Mr(l[1],-1/0),u[0]=Mr(u[0],1/0),u[1]=Mr(u[1],1/0);var c=GC([{},o,s]);return c.coord=[o.coord,s.coord],c.x0=o.x,c.y0=o.y,c.x1=s.x,c.y1=s.y,c}};function F_(r){return!isNaN(r)&&!isFinite(r)}function iB(r,e,t,n){var i=1-r;return F_(e[i])&&F_(t[i])}function WMe(r,e){var t=e.coord[0],n=e.coord[1],i={coord:t,x:e.x0,y:e.y0},a={coord:n,x:e.x1,y:e.y1};return th(r,"cartesian2d")?t&&n&&(iB(1,t,n)||iB(0,t,n))?!0:CMe(r,i,a):cg(r,i)||cg(r,a)}function aB(r,e,t,n,i){var a=n.coordinateSystem,o=r.getItemModel(e),s,l=Pe(o.get(t[0]),i.getWidth()),u=Pe(o.get(t[1]),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(n.getMarkerPosition){var c=r.getValues(["x0","y0"],e),h=r.getValues(["x1","y1"],e),f=a.clampData(c),d=a.clampData(h),p=[];t[0]==="x0"?p[0]=f[0]>d[0]?h[0]:c[0]:p[0]=f[0]>d[0]?c[0]:h[0],t[1]==="y0"?p[1]=f[1]>d[1]?h[1]:c[1]:p[1]=f[1]>d[1]?c[1]:h[1],s=n.getMarkerPosition(p,t,!0)}else{var g=r.get(t[0],e),v=r.get(t[1],e),m=[g,v];a.clampData&&a.clampData(m,m),s=a.dataToPoint(m,!0)}if(th(a,"cartesian2d")){var y=a.getAxis("x"),_=a.getAxis("y"),g=r.get(t[0],e),v=r.get(t[1],e);F_(g)?s[0]=y.toGlobalCoord(y.getExtent()[t[0]==="x0"?0:1]):F_(v)&&(s[1]=_.toGlobalCoord(_.getExtent()[t[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}return s}var oB=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],$Me=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,n,i){n.eachSeries(function(a){var o=nu.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=xe(oB,function(h){return aB(s,l,h,a,i)});s.setItemLayout(l,u);var c=s.getItemGraphicEl(l);c.setShape("points",u)})}},this)},e.prototype.renderSeries=function(t,n,i,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,{group:new rt});this.group.add(c.group),this.markKeep(c);var h=XMe(o,t,n);n.setData(h),h.each(function(f){var d=xe(oB,function(M){return aB(h,f,M,t,a)}),p=o.getAxis("x").scale,g=o.getAxis("y").scale,v=p.getExtent(),m=g.getExtent(),y=[p.parse(h.get("x0",f)),p.parse(h.get("x1",f))],_=[g.parse(h.get("y0",f)),g.parse(h.get("y1",f))];Pa(y),Pa(_);var x=!(v[0]>y[1]||v[1]_[1]||m[1]<_[0]),S=!x;h.setItemLayout(f,{points:d,allClipped:S});var A=h.getItemModel(f).getModel("itemStyle").getItemStyle(),w=Lg(l,"color");A.fill||(A.fill=w,ke(A.fill)&&(A.fill=Q0(A.fill,.4))),A.stroke||(A.stroke=w),h.setItemVisual(f,"style",A)}),h.diff(Fy(c).data).add(function(f){var d=h.getItemLayout(f);if(!d.allClipped){var p=new zi({shape:{points:d.points}});h.setItemGraphicEl(f,p),c.group.add(p)}}).update(function(f,d){var p=Fy(c).data.getItemGraphicEl(d),g=h.getItemLayout(f);g.allClipped?p&&c.group.remove(p):(p?zt(p,{shape:{points:g.points}},n,f):p=new zi({shape:{points:g.points}}),h.setItemGraphicEl(f,p),c.group.add(p))}).remove(function(f){var d=Fy(c).data.getItemGraphicEl(f);c.group.remove(d)}).execute(),h.eachItemGraphicEl(function(f,d){var p=h.getItemModel(d),g=h.getItemVisual(d,"style");f.useStyle(h.getItemVisual(d,"style")),zr(f,Sr(p),{labelFetcher:n,labelDataIndex:d,defaultText:h.getName(d)||"",inheritColor:ke(g.fill)?Q0(g.fill,1):"#000"}),Br(f,p),Rn(f,null,null,p.get(["emphasis","disabled"])),at(f).dataModel=n}),Fy(c).data=h,c.group.silent=n.get("silent")||t.get("silent")},e.type="markArea",e}(XE);function XMe(r,e,t){var n,i,a=["x0","y0","x1","y1"];if(r){var o=xe(r&&r.dimensions,function(u){var c=e.getData(),h=c.getDimensionInfo(c.mapDimension(u))||{};return pe(pe({},h),{name:u,ordinalMeta:null})});i=xe(a,function(u,c){return{name:u,type:o[c%2].type}}),n=new vi(i,t)}else i=[{name:"value",type:"float"}],n=new vi(i,t);var s=xe(t.get("data"),ut(HMe,e,r,t));r&&(s=jt(s,ut(WMe,r)));var l=r?function(u,c,h,f){var d=u.coord[Math.floor(f/2)][f%2];return Gl(d,i[f])}:function(u,c,h,f){return Gl(u.value,i[f])};return n.initData(s,null,l),n.hasItemOption=!0,n}const YMe=$Me;function qMe(r){r.registerComponentModel(GMe),r.registerComponentView(YMe),r.registerPreprocessor(function(e){WE(e.series,"markArea")&&(e.markArea=e.markArea||{})})}var jMe=function(r,e){if(e==="all")return{type:"all",title:r.getLocaleModel().get(["legend","selector","all"])};if(e==="inverse")return{type:"inverse",title:r.getLocaleModel().get(["legend","selector","inverse"])}},KMe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.layoutMode={type:"box",ignoreSize:!0},t}return e.prototype.init=function(t,n,i){this.mergeDefaultAndTheme(t,i),t.selected=t.selected||{},this._updateSelector(t)},e.prototype.mergeOption=function(t,n){r.prototype.mergeOption.call(this,t,n),this._updateSelector(t)},e.prototype._updateSelector=function(t){var n=t.selector,i=this.ecModel;n===!0&&(n=t.selector=["all","inverse"]),_e(n)&&k(n,function(a,o){ke(a)&&(a={type:a}),n[o]=ht(a,jMe(i,a.type))})},e.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&this.get("selectedMode")==="single"){for(var n=!1,i=0;i=0},e.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(Nt);const TM=KMe;var qh=ut,MM=k,By=rt,ZMe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.newlineDisabled=!1,t}return e.prototype.init=function(){this.group.add(this._contentGroup=new By),this.group.add(this._selectorGroup=new By),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,n,i){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!t.get("show",!0)){var o=t.get("align"),s=t.get("orient");(!o||o==="auto")&&(o=t.get("left")==="right"&&s==="vertical"?"right":"left");var l=t.get("selector",!0),u=t.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,t,n,i,l,s,u);var c=t.getBoxLayoutParams(),h={width:i.getWidth(),height:i.getHeight()},f=t.get("padding"),d=dr(c,h,f),p=this.layoutInner(t,o,d,a,l,u),g=dr(Ke({width:p.width,height:p.height},c),h,f);this.group.x=g.x-p.x,this.group.y=g.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=gW(p,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,n,i,a,o,s,l){var u=this.getContentGroup(),c=He(),h=n.get("selectedMode"),f=[];i.eachRawSeries(function(d){!d.get("legendHoverLink")&&f.push(d.id)}),MM(n.getData(),function(d,p){var g=d.get("name");if(!this.newlineDisabled&&(g===""||g===` `)){var v=new By;v.newline=!0,u.add(v);return}var m=i.getSeriesByName(g)[0];if(!c.get(g))if(m){var y=m.getData(),_=y.getVisual("legendLineStyle")||{},x=y.getVisual("legendIcon"),S=y.getVisual("style"),A=this._createItem(m,g,p,d,n,t,_,S,x,h,a);A.on("click",qh(sB,g,null,a,f)).on("mouseover",qh(CM,m.name,null,a,f)).on("mouseout",qh(EM,m.name,null,a,f)),i.ssr&&A.eachChild(function(w){var M=at(w);M.seriesIndex=m.seriesIndex,M.dataIndex=p,M.ssrType="legend"}),c.set(g,!0)}else i.eachRawSeries(function(w){if(!c.get(g)&&w.legendVisualProvider){var M=w.legendVisualProvider;if(!M.containName(g))return;var C=M.indexOfName(g),b=M.getItemVisual(C,"style"),T=M.getItemVisual(C,"legendIcon"),P=na(b.fill);P&&P[3]===0&&(P[3]=.2,b=pe(pe({},b),{fill:ws(P,"rgba")}));var D=this._createItem(w,g,p,d,n,t,{},b,T,h,a);D.on("click",qh(sB,null,g,a,f)).on("mouseover",qh(CM,null,g,a,f)).on("mouseout",qh(EM,null,g,a,f)),i.ssr&&D.eachChild(function(L){var E=at(L);E.seriesIndex=w.seriesIndex,E.dataIndex=p,E.ssrType="legend"}),c.set(g,!0)}},this)},this),o&&this._createSelector(o,n,a,s,l)},e.prototype._createSelector=function(t,n,i,a,o){var s=this.getSelectorGroup();MM(t,function(u){var c=u.type,h=new Ot({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:c==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});s.add(h);var f=n.getModel("selectorLabel"),d=n.getModel(["emphasis","selectorLabel"]);zr(h,{normal:f,emphasis:d},{defaultText:u.title}),Ec(h)})},e.prototype._createItem=function(t,n,i,a,o,s,l,u,c,h,f){var d=t.visualDrawType,p=o.get("itemWidth"),g=o.get("itemHeight"),v=o.isSelected(n),m=a.get("symbolRotate"),y=a.get("symbolKeepAspect"),_=a.get("icon");c=_||c||"roundRect";var x=QMe(c,a,l,u,d,v,f),S=new By,A=a.getModel("textStyle");if(qe(t.getLegendIcon)&&(!_||_==="inherit"))S.add(t.getLegendIcon({itemWidth:p,itemHeight:g,icon:c,iconRotate:m,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:y}));else{var w=_==="inherit"&&t.getData().getVisual("symbol")?m==="inherit"?t.getData().getVisual("symbolRotate"):m:0;S.add(JMe({itemWidth:p,itemHeight:g,icon:c,iconRotate:w,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:y}))}var M=s==="left"?p+5:-5,C=s,b=o.get("formatter"),T=n;ke(b)&&b?T=b.replace("{name}",n!=null?n:""):qe(b)&&(T=b(n));var P=v?A.getTextColor():a.get("inactiveColor");S.add(new Ot({style:pn(A,{text:T,x:M,y:g/2,fill:P,align:C,verticalAlign:"middle"},{inheritColor:P})}));var D=new Dt({shape:S.getBoundingRect(),style:{fill:"transparent"}}),L=a.getModel("tooltip");return L.get("show")&&Kc({el:D,componentModel:o,itemName:n,itemTooltipOption:L.option}),S.add(D),S.eachChild(function(E){E.silent=!0}),D.silent=!h,this.getContentGroup().add(S),Ec(S),S.__legendDataIndex=i,S},e.prototype.layoutInner=function(t,n,i,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();Pc(t.get("orient"),l,t.get("itemGap"),i.width,i.height);var c=l.getBoundingRect(),h=[-c.x,-c.y];if(u.markRedraw(),l.markRedraw(),o){Pc("horizontal",u,t.get("selectorItemGap",!0));var f=u.getBoundingRect(),d=[-f.x,-f.y],p=t.get("selectorButtonGap",!0),g=t.getOrient().index,v=g===0?"width":"height",m=g===0?"height":"width",y=g===0?"y":"x";s==="end"?d[g]+=c[v]+p:h[g]+=f[v]+p,d[1-g]+=c[m]/2-f[m]/2,u.x=d[0],u.y=d[1],l.x=h[0],l.y=h[1];var _={x:0,y:0};return _[v]=c[v]+p+f[v],_[m]=Math.max(c[m],f[m]),_[y]=Math.min(0,f[y]+d[1-g]),_}else return l.x=h[0],l.y=h[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(kn);function QMe(r,e,t,n,i,a,o){function s(v,m){v.lineWidth==="auto"&&(v.lineWidth=m.lineWidth>0?2:0),MM(v,function(y,_){v[_]==="inherit"&&(v[_]=m[_])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),c=r.lastIndexOf("empty",0)===0?"fill":"stroke",h=l.getShallow("decal");u.decal=!h||h==="inherit"?n.decal:ed(h,o),u.fill==="inherit"&&(u.fill=n[i]),u.stroke==="inherit"&&(u.stroke=n[c]),u.opacity==="inherit"&&(u.opacity=(i==="fill"?n:t).opacity),s(u,n);var f=e.getModel("lineStyle"),d=f.getLineStyle();if(s(d,t),u.fill==="auto"&&(u.fill=n.fill),u.stroke==="auto"&&(u.stroke=n.fill),d.stroke==="auto"&&(d.stroke=n.fill),!a){var p=e.get("inactiveBorderWidth"),g=u[c];u.lineWidth=p==="auto"?n.lineWidth>0&&g?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),d.stroke=f.get("inactiveColor"),d.lineWidth=f.get("inactiveWidth")}return{itemStyle:u,lineStyle:d}}function JMe(r){var e=r.icon||"roundRect",t=rr(e,0,0,r.itemWidth,r.itemHeight,r.itemStyle.fill,r.symbolKeepAspect);return t.setStyle(r.itemStyle),t.rotation=(r.iconRotate||0)*Math.PI/180,t.setOrigin([r.itemWidth/2,r.itemHeight/2]),e.indexOf("empty")>-1&&(t.style.stroke=t.style.fill,t.style.fill="#fff",t.style.lineWidth=2),t}function sB(r,e,t,n){EM(r,e,t,n),t.dispatchAction({type:"legendToggleSelect",name:r!=null?r:e}),CM(r,e,t,n)}function LW(r){for(var e=r.getZr().storage.getDisplayList(),t,n=0,i=e.length;ni[o],v=[-d.x,-d.y];n||(v[a]=c[u]);var m=[0,0],y=[-p.x,-p.y],_=ot(t.get("pageButtonGap",!0),t.get("itemGap",!0));if(g){var x=t.get("pageButtonPosition",!0);x==="end"?y[a]+=i[o]-p[o]:m[a]+=p[o]+_}y[1-a]+=d[s]/2-p[s]/2,c.setPosition(v),h.setPosition(m),f.setPosition(y);var S={x:0,y:0};if(S[o]=g?i[o]:d[o],S[s]=Math.max(d[s],p[s]),S[l]=Math.min(0,p[l]+y[1-a]),h.__rectSize=i[o],g){var A={x:0,y:0};A[o]=Math.max(i[o]-p[o]-_,0),A[s]=S[s],h.setClipPath(new Dt({shape:A})),h.__rectSize=A[o]}else f.eachChild(function(M){M.attr({invisible:!0,silent:!0})});var w=this._getPageInfo(t);return w.pageIndex!=null&&zt(c,{x:w.contentPosition[0],y:w.contentPosition[1]},g?t:null),this._updatePageInfoView(t,w),S},e.prototype._pageGo=function(t,n,i){var a=this._getPageInfo(n)[t];a!=null&&i.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:n.id})},e.prototype._updatePageInfoView=function(t,n){var i=this._controllerGroup;k(["pagePrev","pageNext"],function(c){var h=c+"DataIndex",f=n[h]!=null,d=i.childOfName(c);d&&(d.setStyle("fill",f?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),d.cursor=f?"pointer":"default")});var a=i.childOfName("pageText"),o=t.get("pageFormatter"),s=n.pageIndex,l=s!=null?s+1:0,u=n.pageCount;a&&o&&a.setStyle("text",ke(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},e.prototype._getPageInfo=function(t){var n=t.get("scrollDataIndex",!0),i=this.getContentGroup(),a=this._containerGroup.__rectSize,o=t.getOrient().index,s=Fw[o],l=Bw[o],u=this._findTargetItemIndex(n),c=i.children(),h=c[u],f=c.length,d=f?1:0,p={contentPosition:[i.x,i.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!h)return p;var g=x(h);p.contentPosition[o]=-g.s;for(var v=u+1,m=g,y=g,_=null;v<=f;++v)_=x(c[v]),(!_&&y.e>m.s+a||_&&!S(_,m.s))&&(y.i>m.i?m=y:m=_,m&&(p.pageNextDataIndex==null&&(p.pageNextDataIndex=m.i),++p.pageCount)),y=_;for(var v=u-1,m=g,y=g,_=null;v>=-1;--v)_=x(c[v]),(!_||!S(y,_.s))&&m.i=w&&A.s<=w+a}},e.prototype._findTargetItemIndex=function(t){if(!this._showController)return 0;var n,i=this.getContentGroup(),a;return i.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===t&&(n=s)}),n!=null?n:a},e.type="legend.scroll",e}(PW);const aCe=iCe;function oCe(r){r.registerAction("legendScroll","legendscroll",function(e,t){var n=e.scrollDataIndex;n!=null&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},function(i){i.setScrollDataIndex(n)})})}function sCe(r){gt(RW),r.registerComponentModel(rCe),r.registerComponentView(aCe),oCe(r)}function lCe(r){gt(RW),gt(sCe)}var uCe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.inside",e.defaultOption=su(lg.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(lg);const cCe=uCe;var YE=Pt();function hCe(r,e,t){YE(r).coordSysRecordMap.each(function(n){var i=n.dataZoomInfoMap.get(e.uid);i&&(i.getRange=t)})}function fCe(r,e){for(var t=YE(r).coordSysRecordMap,n=t.keys(),i=0;in[t+e]&&(e=s),i=i&&o.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!i}}}function mCe(r){r.registerProcessor(r.PRIORITY.PROCESSOR.FILTER,function(e,t){var n=YE(t),i=n.coordSysRecordMap||(n.coordSysRecordMap=He());i.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=dW(a);k(o.infoList,function(s){var l=s.model.uid,u=i.get(l)||i.set(l,dCe(t,s.model)),c=u.dataZoomInfoMap||(u.dataZoomInfoMap=He());c.set(a.uid,{dzReferCoordSysInfo:s,model:a,getRange:null})})}),i.each(function(a){var o=a.controller,s,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(s=l.get(u))}if(!s){DW(i,a);return}var c=gCe(l);o.enable(c.controlType,c.opt),o.setPointerChecker(a.containsPoint),Md(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var yCe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return e.prototype.render=function(t,n,i){if(r.prototype.render.apply(this,arguments),t.noTarget()){this._clear();return}this.range=t.getPercentRange(),hCe(i,t,{pan:Fe(zw.pan,this),zoom:Fe(zw.zoom,this),scrollMove:Fe(zw.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),r.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){fCe(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(BE),zw={zoom:function(r,e,t,n){var i=this.range,a=i.slice(),o=r.axisModels[0];if(o){var s=Uw[e](null,[n.originX,n.originY],o,t,r),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/n.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(rh(0,a,[0,100],0,c.minSpan,c.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:hB(function(r,e,t,n,i,a){var o=Uw[n]([a.oldX,a.oldY],[a.newX,a.newY],e,i,t);return o.signal*(r[1]-r[0])*o.pixel/o.pixelLength}),scrollMove:hB(function(r,e,t,n,i,a){var o=Uw[n]([0,0],[a.scrollDelta,a.scrollDelta],e,i,t);return o.signal*(r[1]-r[0])*a.scrollDelta})};function hB(r){return function(e,t,n,i){var a=this.range,o=a.slice(),s=e.axisModels[0];if(s){var l=r(o,s,e,t,n,i);if(rh(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var Uw={grid:function(r,e,t,n,i){var a=t.axis,o={},s=i.model.coordinateSystem.getRect();return r=r||[0,0],a.dim==="x"?(o.pixel=e[0]-r[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=e[1]-r[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(r,e,t,n,i){var a=t.axis,o={},s=i.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return r=r?s.pointToCoord(r):[0,0],e=s.pointToCoord(e),t.mainType==="radiusAxis"?(o.pixel=e[0]-r[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=e[1]-r[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(r,e,t,n,i){var a=t.axis,o=i.model.coordinateSystem.getRect(),s={};return r=r||[0,0],a.orient==="horizontal"?(s.pixel=e[0]-r[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-r[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};const _Ce=yCe;function IW(r){zE(r),r.registerComponentModel(cCe),r.registerComponentView(_Ce),mCe(r)}var xCe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=su(lg.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(lg);const SCe=xCe;var yp=Dt,fB=7,ACe=1,Vw=30,wCe=7,_p="horizontal",dB="vertical",bCe=5,TCe=["line","bar","candlestick","scatter"],MCe={easing:"cubicOut",duration:100,delay:0},CCe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._displayables={},t}return e.prototype.init=function(t,n){this.api=n,this._onBrush=Fe(this._onBrush,this),this._onBrushEnd=Fe(this._onBrushEnd,this)},e.prototype.render=function(t,n,i,a){if(r.prototype.render.apply(this,arguments),Md(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),t.get("show")===!1){this.group.removeAll();return}if(t.noTarget()){this._clear(),this.group.removeAll();return}(!a||a.type!=="dataZoom"||a.from!==this.uid)&&this._buildView(),this._updateView()},e.prototype.dispose=function(){this._clear(),r.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){Kv(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var n=this._displayables.sliderGroup=new rt;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(n),this._positionGroup()},e.prototype._resetLocation=function(){var t=this.dataZoomModel,n=this.api,i=t.get("brushSelect"),a=i?wCe:0,o=this._findCoordRect(),s={width:n.getWidth(),height:n.getHeight()},l=this._orient===_p?{right:s.width-o.x-o.width,top:s.height-Vw-fB-a,width:o.width,height:Vw}:{right:fB,top:o.y,width:Vw,height:o.height},u=Ad(t.option);k(["right","top","width","height"],function(h){u[h]==="ph"&&(u[h]=l[h])});var c=dr(u,s);this._location={x:c.x,y:c.y},this._size=[c.width,c.height],this._orient===dB&&this._size.reverse()},e.prototype._positionGroup=function(){var t=this.group,n=this._location,i=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),o=a&&a.get("inverse"),s=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;s.attr(i===_p&&!o?{scaleY:l?1:-1,scaleX:1}:i===_p&&o?{scaleY:l?1:-1,scaleX:-1}:i===dB&&!o?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=t.getBoundingRect([s]);t.x=n.x-u.x,t.y=n.y-u.y,t.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var t=this.dataZoomModel,n=this._size,i=this._displayables.sliderGroup,a=t.get("brushSelect");i.add(new yp({silent:!0,shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var o=new yp({shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:"transparent"},z2:0,onclick:Fe(this._onClickPanel,this)}),s=this.api.getZr();a?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",s.on("mousemove",this._onBrush),s.on("mouseup",this._onBrushEnd)):(s.off("mousemove",this._onBrush),s.off("mouseup",this._onBrushEnd)),i.add(o)},e.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!t)return;var n=this._size,i=this._shadowSize||[],a=t.series,o=a.getRawData(),s=a.getShadowDim&&a.getShadowDim(),l=s&&o.getDimensionInfo(s)?a.getShadowDim():t.otherDim;if(l==null)return;var u=this._shadowPolygonPts,c=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||n[0]!==i[0]||n[1]!==i[1]){var h=o.getDataExtent(l),f=(h[1]-h[0])*.3;h=[h[0]-f,h[1]+f];var d=[0,n[1]],p=[0,n[0]],g=[[n[0],0],[0,0]],v=[],m=p[1]/(o.count()-1),y=0,_=Math.round(o.count()/n[0]),x;o.each([l],function(C,b){if(_>0&&b%_){y+=m;return}var T=C==null||isNaN(C)||C==="",P=T?0:Kt(C,h,d,!0);T&&!x&&b?(g.push([g[g.length-1][0],0]),v.push([v[v.length-1][0],0])):!T&&x&&(g.push([y,0]),v.push([y,0])),g.push([y,P]),v.push([y,P]),y+=m,x=T}),u=this._shadowPolygonPts=g,c=this._shadowPolylinePts=v}this._shadowData=o,this._shadowDim=l,this._shadowSize=[n[0],n[1]];var S=this.dataZoomModel;function A(C){var b=S.getModel(C?"selectedDataBackground":"dataBackground"),T=new rt,P=new zi({shape:{points:u},segmentIgnoreThreshold:1,style:b.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),D=new Ui({shape:{points:c},segmentIgnoreThreshold:1,style:b.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return T.add(P),T.add(D),T}for(var w=0;w<3;w++){var M=A(w===1);this._displayables.sliderGroup.add(M),this._displayables.dataShadowSegs.push(M)}},e.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,n=t.get("showDataShadow");if(n!==!1){var i,a=this.ecModel;return t.eachTargetAxis(function(o,s){var l=t.getAxisProxy(o,s).getTargetSeriesModels();k(l,function(u){if(!i&&!(n!==!0&&pt(TCe,u.get("type"))<0)){var c=a.getComponent(Dl(o),s).axis,h=ECe(o),f,d=u.coordinateSystem;h!=null&&d.getOtherAxis&&(f=d.getOtherAxis(c).inverse),h=u.getData().mapDimension(h),i={thisAxis:c,series:u,thisDim:o,otherDim:h,otherAxisInverse:f}}},this)},this),i}},e.prototype._renderHandle=function(){var t=this.group,n=this._displayables,i=n.handles=[null,null],a=n.handleLabels=[null,null],o=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,u=this.api,c=l.get("borderRadius")||0,h=l.get("brushSelect"),f=n.filler=new yp({silent:h,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(f),o.add(new yp({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:c},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:ACe,fill:"rgba(0,0,0,0)"}})),k([0,1],function(_){var x=l.get("handleIcon");!d_[x]&&x.indexOf("path://")<0&&x.indexOf("image://")<0&&(x="path://"+x);var S=rr(x,-1,0,2,2,null,!0);S.attr({cursor:pB(this._orient),draggable:!0,drift:Fe(this._onDragMove,this,_),ondragend:Fe(this._onDragEnd,this),onmouseover:Fe(this._showDataInfo,this,!0),onmouseout:Fe(this._showDataInfo,this,!1),z2:5});var A=S.getBoundingRect(),w=l.get("handleSize");this._handleHeight=Pe(w,this._size[1]),this._handleWidth=A.width/A.height*this._handleHeight,S.setStyle(l.getModel("handleStyle").getItemStyle()),S.style.strokeNoScale=!0,S.rectHover=!0,S.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),Ec(S);var M=l.get("handleColor");M!=null&&(S.style.fill=M),o.add(i[_]=S);var C=l.getModel("textStyle"),b=l.get("handleLabel")||{},T=b.show||!1;t.add(a[_]=new Ot({silent:!0,invisible:!T,style:pn(C,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:C.getTextColor(),font:C.getFont()}),z2:10}))},this);var d=f;if(h){var p=Pe(l.get("moveHandleSize"),s[1]),g=n.moveHandle=new Dt({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:p}}),v=p*.8,m=n.moveHandleIcon=rr(l.get("moveHandleIcon"),-v/2,-v/2,v,v,"#fff",!0);m.silent=!0,m.y=s[1]+p/2-.5,g.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var y=Math.min(s[1]/2,Math.max(p,10));d=n.moveZone=new Dt({invisible:!0,shape:{y:s[1]-y,height:p+y}}),d.on("mouseover",function(){u.enterEmphasis(g)}).on("mouseout",function(){u.leaveEmphasis(g)}),o.add(g),o.add(m),o.add(d)}d.attr({draggable:!0,cursor:pB(this._orient),drift:Fe(this._onDragMove,this,"all"),ondragstart:Fe(this._showDataInfo,this,!0),ondragend:Fe(this._onDragEnd,this),onmouseover:Fe(this._showDataInfo,this,!0),onmouseout:Fe(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),n=this._getViewExtent();this._handleEnds=[Kt(t[0],[0,100],n,!0),Kt(t[1],[0,100],n,!0)]},e.prototype._updateInterval=function(t,n){var i=this.dataZoomModel,a=this._handleEnds,o=this._getViewExtent(),s=i.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];rh(n,a,o,i.get("zoomLock")?"all":t,s.minSpan!=null?Kt(s.minSpan,l,o,!0):null,s.maxSpan!=null?Kt(s.maxSpan,l,o,!0):null);var u=this._range,c=this._range=Pa([Kt(a[0],o,l,!0),Kt(a[1],o,l,!0)]);return!u||u[0]!==c[0]||u[1]!==c[1]},e.prototype._updateView=function(t){var n=this._displayables,i=this._handleEnds,a=Pa(i.slice()),o=this._size;k([0,1],function(d){var p=n.handles[d],g=this._handleHeight;p.attr({scaleX:g/2,scaleY:g/2,x:i[d]+(d?-1:1),y:o[1]/2-g/2})},this),n.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:o[1]});var s={x:a[0],width:a[1]-a[0]};n.moveHandle&&(n.moveHandle.setShape(s),n.moveZone.setShape(s),n.moveZone.getBoundingRect(),n.moveHandleIcon&&n.moveHandleIcon.attr("x",s.x+s.width/2));for(var l=n.dataShadowSegs,u=[0,a[0],a[1],o[0]],c=0;cn[0]||i[1]<0||i[1]>n[1])){var a=this._handleEnds,o=(a[0]+a[1])/2,s=this._updateInterval("all",i[0]-o);this._updateView(),s&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(t){var n=t.offsetX,i=t.offsetY;this._brushStart=new ft(n,i),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(t){if(this._brushing){var n=this._displayables.brushRect;if(this._brushing=!1,!!n){n.attr("ignore",!0);var i=n.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(i.width)<5)){var o=this._getViewExtent(),s=[0,100];this._range=Pa([Kt(i.x,o,s,!0),Kt(i.x+i.width,o,s,!0)]),this._handleEnds=[i.x,i.x+i.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(t){this._brushing&&(Ps(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},e.prototype._updateBrushRect=function(t,n){var i=this._displayables,a=this.dataZoomModel,o=i.brushRect;o||(o=i.brushRect=new yp({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),i.sliderGroup.add(o)),o.attr("ignore",!1);var s=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(t,n),c=l.transformCoordToLocal(s.x,s.y),h=this._size;u[0]=Math.max(Math.min(h[0],u[0]),0),o.setShape({x:c[0],y:0,width:u[0]-c[0],height:h[1]})},e.prototype._dispatchZoomAction=function(t){var n=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?MCe:null,start:n[0],end:n[1]})},e.prototype._findCoordRect=function(){var t,n=dW(this.dataZoomModel).infoList;if(!t&&n.length){var i=n[0].model.coordinateSystem;t=i.getRect&&i.getRect()}if(!t){var a=this.api.getWidth(),o=this.api.getHeight();t={x:a*.2,y:o*.2,width:a*.6,height:o*.6}}return t},e.type="dataZoom.slider",e}(BE);function ECe(r){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[r]}function pB(r){return r==="vertical"?"ns-resize":"ew-resize"}const LCe=CCe;function NW(r){r.registerComponentModel(SCe),r.registerComponentView(LCe),zE(r)}function PCe(r){gt(IW),gt(NW)}var RCe={get:function(r,e,t){var n=Je((DCe[r]||{})[e]);return t&&_e(n)?n[n.length-1]:n}},DCe={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}};const kW=RCe;var vB=Fr.mapVisual,ICe=Fr.eachVisual,NCe=_e,gB=k,kCe=Pa,OCe=Kt,FCe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.stateList=["inRange","outOfRange"],t.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],t.layoutMode={type:"box",ignoreSize:!0},t.dataBound=[-1/0,1/0],t.targetVisuals={},t.controllerVisuals={},t}return e.prototype.init=function(t,n,i){this.mergeDefaultAndTheme(t,i)},e.prototype.optionUpdated=function(t,n){var i=this.option;!n&&wW(i,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(t){var n=this.stateList;t=Fe(t,this),this.controllerVisuals=AM(this.option.controller,n,t),this.targetVisuals=AM(this.option.target,n,t)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var t=this.option.seriesIndex,n=[];return t==null||t==="all"?this.ecModel.eachSeries(function(i,a){n.push(a)}):n=nn(t),n},e.prototype.eachTargetSeries=function(t,n){k(this.getTargetSeriesIndices(),function(i){var a=this.ecModel.getSeriesByIndex(i);a&&t.call(n,a)},this)},e.prototype.isTargetSeries=function(t){var n=!1;return this.eachTargetSeries(function(i){i===t&&(n=!0)}),n},e.prototype.formatValueText=function(t,n,i){var a=this.option,o=a.precision,s=this.dataBound,l=a.formatter,u;i=i||["<",">"],_e(t)&&(t=t.slice(),u=!0);var c=n?t:u?[h(t[0]),h(t[1])]:h(t);if(ke(l))return l.replace("{value}",u?c[0]:c).replace("{value2}",u?c[1]:c);if(qe(l))return u?l(t[0],t[1]):l(t);if(u)return t[0]===s[0]?i[0]+" "+c[1]:t[1]===s[1]?i[1]+" "+c[0]:c[0]+" - "+c[1];return c;function h(f){return f===s[0]?"min":f===s[1]?"max":(+f).toFixed(Math.min(o,20))}},e.prototype.resetExtent=function(){var t=this.option,n=kCe([t.min,t.max]);this._dataExtent=n},e.prototype.getDataDimensionIndex=function(t){var n=this.option.dimension;if(n!=null)return t.getDimensionIndex(n);for(var i=t.dimensions,a=i.length-1;a>=0;a--){var o=i[a],s=t.getDimensionInfo(o);if(!s.isCalculationCoord)return s.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var t=this.ecModel,n=this.option,i={inRange:n.inRange,outOfRange:n.outOfRange},a=n.target||(n.target={}),o=n.controller||(n.controller={});ht(a,i),ht(o,i);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),c.call(this,o);function l(h){NCe(n.color)&&!h.inRange&&(h.inRange={color:n.color.slice().reverse()}),h.inRange=h.inRange||{color:t.get("gradientColor")}}function u(h,f,d){var p=h[f],g=h[d];p&&!g&&(g=h[d]={},gB(p,function(v,m){if(Fr.isValidType(m)){var y=kW.get(m,"inactive",s);y!=null&&(g[m]=y,m==="color"&&!g.hasOwnProperty("opacity")&&!g.hasOwnProperty("colorAlpha")&&(g.opacity=[0,0]))}}))}function c(h){var f=(h.inRange||{}).symbol||(h.outOfRange||{}).symbol,d=(h.inRange||{}).symbolSize||(h.outOfRange||{}).symbolSize,p=this.get("inactiveColor"),g=this.getItemSymbol(),v=g||"roundRect";gB(this.stateList,function(m){var y=this.itemSize,_=h[m];_||(_=h[m]={color:s?p:[p]}),_.symbol==null&&(_.symbol=f&&Je(f)||(s?v:[v])),_.symbolSize==null&&(_.symbolSize=d&&Je(d)||(s?y[0]:[y[0],y[0]])),_.symbol=vB(_.symbol,function(A){return A==="none"?v:A});var x=_.symbolSize;if(x!=null){var S=-1/0;ICe(x,function(A){A>S&&(S=A)}),_.symbolSize=vB(x,function(A){return OCe(A,[0,S],[0,y[0]],!0)})}},this)}},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(t){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(t){return null},e.prototype.getVisualMeta=function(t){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},e}(Nt);const B_=FCe;var mB=[20,140],BCe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(t,n){r.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(i){i.mappingMethod="linear",i.dataExtent=this.getExtent()}),this._resetRange()},e.prototype.resetItemSize=function(){r.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(t[0]==null||isNaN(t[0]))&&(t[0]=mB[0]),(t[1]==null||isNaN(t[1]))&&(t[1]=mB[1])},e.prototype._resetRange=function(){var t=this.getExtent(),n=this.option.range;!n||n.auto?(t.auto=1,this.option.range=t):_e(n)&&(n[0]>n[1]&&n.reverse(),n[0]=Math.max(n[0],t[0]),n[1]=Math.min(n[1],t[1]))},e.prototype.completeVisualOption=function(){r.prototype.completeVisualOption.apply(this,arguments),k(this.stateList,function(t){var n=this.option.controller[t].symbolSize;n&&n[0]!==n[1]&&(n[0]=n[1]/3)},this)},e.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},e.prototype.getSelected=function(){var t=this.getExtent(),n=Pa((this.get("range")||[]).slice());return n[0]>t[1]&&(n[0]=t[1]),n[1]>t[1]&&(n[1]=t[1]),n[0]=i[1]||t<=n[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var n=[];return this.eachTargetSeries(function(i){var a=[],o=i.getData();o.each(this.getDataDimensionIndex(o),function(s,l){t[0]<=s&&s<=t[1]&&a.push(l)},this),n.push({seriesId:i.id,dataIndex:a})},this),n},e.prototype.getVisualMeta=function(t){var n=yB(this,"outOfRange",this.getExtent()),i=yB(this,"inRange",this.option.range.slice()),a=[];function o(d,p){a.push({value:d,color:t(d,p)})}for(var s=0,l=0,u=i.length,c=n.length;lt[1])break;a.push({color:this.getControllerVisual(l,"color",n),offset:s/i})}return a.push({color:this.getControllerVisual(t[1],"color",n),offset:1}),a},e.prototype._createBarPoints=function(t,n){var i=this.visualMapModel.itemSize;return[[i[0]-n[0],t[0]],[i[0],t[0]],[i[0],t[1]],[i[0]-n[1],t[1]]]},e.prototype._createBarGroup=function(t){var n=this._orient,i=this.visualMapModel.get("inverse");return new rt(n==="horizontal"&&!i?{scaleX:t==="bottom"?1:-1,rotation:Math.PI/2}:n==="horizontal"&&i?{scaleX:t==="bottom"?-1:1,rotation:-Math.PI/2}:n==="vertical"&&!i?{scaleX:t==="left"?1:-1,scaleY:-1}:{scaleX:t==="left"?1:-1})},e.prototype._updateHandle=function(t,n){if(this._useHandle){var i=this._shapes,a=this.visualMapModel,o=i.handleThumbs,s=i.handleLabels,l=a.itemSize,u=a.getExtent(),c=this._applyTransform("left",i.mainGroup);VCe([0,1],function(h){var f=o[h];f.setStyle("fill",n.handlesColor[h]),f.y=t[h];var d=wo(t[h],[0,l[1]],u,!0),p=this.getControllerVisual(d,"symbolSize");f.scaleX=f.scaleY=p/l[0],f.x=l[0]-p/2;var g=io(i.handleLabelPoints[h],Lc(f,this.group));if(this._orient==="horizontal"){var v=c==="left"||c==="top"?(l[0]-p)/2:(l[0]-p)/-2;g[1]+=v}s[h].setStyle({x:g[0],y:g[1],text:a.formatValueText(this._dataInterval[h]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",i.mainGroup):"center"})},this)}},e.prototype._showIndicator=function(t,n,i,a){var o=this.visualMapModel,s=o.getExtent(),l=o.itemSize,u=[0,l[1]],c=this._shapes,h=c.indicator;if(h){h.attr("invisible",!1);var f={convertOpacityToAlpha:!0},d=this.getControllerVisual(t,"color",f),p=this.getControllerVisual(t,"symbolSize"),g=wo(t,s,u,!0),v=l[0]-p/2,m={x:h.x,y:h.y};h.y=g,h.x=v;var y=io(c.indicatorLabelPoint,Lc(h,this.group)),_=c.indicatorLabel;_.attr("invisible",!1);var x=this._applyTransform("left",c.mainGroup),S=this._orient,A=S==="horizontal";_.setStyle({text:(i||"")+o.formatValueText(n),verticalAlign:A?x:"middle",align:A?"center":x});var w={x:v,y:g,style:{fill:d}},M={style:{x:y[0],y:y[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var C={duration:100,easing:"cubicInOut",additive:!0};h.x=m.x,h.y=m.y,h.animateTo(w,C),_.animateTo(M,C)}else h.attr(w),_.attr(M);this._firstShowIndicator=!1;var b=this._shapes.handleLabels;if(b)for(var T=0;To[1]&&(h[1]=1/0),n&&(h[0]===-1/0?this._showIndicator(c,h[1],"< ",l):h[1]===1/0?this._showIndicator(c,h[0],"> ",l):this._showIndicator(c,c,"≈ ",l));var f=this._hoverLinkDataIndices,d=[];(n||AB(i))&&(d=this._hoverLinkDataIndices=i.findTargetDataIndices(h));var p=Dse(f,d);this._dispatchHighDown("downplay",m0(p[0],i)),this._dispatchHighDown("highlight",m0(p[1],i))}},e.prototype._hoverLinkFromSeriesMouseOver=function(t){var n;if(lc(t.target,function(l){var u=at(l);if(u.dataIndex!=null)return n=u,!0},!0),!!n){var i=this.ecModel.getSeriesByIndex(n.seriesIndex),a=this.visualMapModel;if(a.isTargetSeries(i)){var o=i.getData(n.dataType),s=o.getStore().get(a.getDataDimensionIndex(o),n.dataIndex);isNaN(s)||this._showIndicator(s,s)}}},e.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var n=this._shapes.handleLabels;if(n)for(var i=0;i=0&&(a.dimension=o,n.push(a))}}),r.getData().setVisual("visualMeta",n)}}];function KCe(r,e,t,n){for(var i=e.targetVisuals[n],a=Fr.prepareVisualTypes(i),o={color:Lg(r.getData(),"color")},s=0,l=a.length;s0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),r.registerAction(YCe,qCe),k(jCe,function(e){r.registerVisual(r.PRIORITY.VISUAL.COMPONENT,e)}),r.registerPreprocessor(ZCe))}function zW(r){r.registerComponentModel(zCe),r.registerComponentView(XCe),BW(r)}var QCe=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._pieceList=[],t}return e.prototype.optionUpdated=function(t,n){r.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],JCe[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var a=this.option.categories;this.resetVisual(function(o,s){i==="categories"?(o.mappingMethod="category",o.categories=Je(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=xe(this._pieceList,function(l){return l=Je(l),s!=="inRange"&&(l.visual=null),l}))})},e.prototype.completeVisualOption=function(){var t=this.option,n={},i=Fr.listVisualTypes(),a=this.isCategory();k(t.pieces,function(s){k(i,function(l){s.hasOwnProperty(l)&&(n[l]=1)})}),k(n,function(s,l){var u=!1;k(this.stateList,function(c){u=u||o(t,c,l)||o(t.target,c,l)},this),!u&&k(this.stateList,function(c){(t[c]||(t[c]={}))[l]=kW.get(l,c==="inRange"?"active":"inactive",a)})},this);function o(s,l,u){return s&&s[l]&&s[l].hasOwnProperty(u)}r.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(t,n){var i=this.option,a=this._pieceList,o=(n?i:t).selected||{};if(i.selected=o,k(a,function(l,u){var c=this.getSelectedMapKey(l);o.hasOwnProperty(c)||(o[c]=!0)},this),i.selectedMode==="single"){var s=!1;k(a,function(l,u){var c=this.getSelectedMapKey(l);o[c]&&(s?o[c]=!1:s=!0)},this)}},e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},e.prototype.getSelectedMapKey=function(t){return this._mode==="categories"?t.value+"":t.index+""},e.prototype.getPieceList=function(){return this._pieceList},e.prototype._determineMode=function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},e.prototype.setSelected=function(t){this.option.selected=Je(t)},e.prototype.getValueState=function(t){var n=Fr.findPieceIndex(t,this._pieceList);return n!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[n])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var n=[],i=this._pieceList;return this.eachTargetSeries(function(a){var o=[],s=a.getData();s.each(this.getDataDimensionIndex(s),function(l,u){var c=Fr.findPieceIndex(l,i);c===t&&o.push(u)},this),n.push({seriesId:a.id,dataIndex:o})},this),n},e.prototype.getRepresentValue=function(t){var n;if(this.isCategory())n=t.value;else if(t.value!=null)n=t.value;else{var i=t.interval||[];n=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return n},e.prototype.getVisualMeta=function(t){if(this.isCategory())return;var n=[],i=["",""],a=this;function o(c,h){var f=a.getRepresentValue({interval:c});h||(h=a.getValueState(f));var d=t(f,h);c[0]===-1/0?i[0]=d:c[1]===1/0?i[1]=d:n.push({value:c[0],color:d},{value:c[1],color:d})}var s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var u=-1/0;return k(s,function(c){var h=c.interval;h&&(h[0]>u&&o([u,h[0]],"outOfRange"),o(h.slice()),u=h[1])},this),{stops:n,outerColors:i}},e.type="visualMap.piecewise",e.defaultOption=su(B_.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(B_),JCe={splitNumber:function(r){var e=this.option,t=Math.min(e.precision,20),n=this.getExtent(),i=e.splitNumber;i=Math.max(parseInt(i,10),1),e.splitNumber=i;for(var a=(n[1]-n[0])/i;+a.toFixed(t)!==a&&t<5;)t++;e.precision=t,a=+a.toFixed(t),e.minOpen&&r.push({interval:[-1/0,n[0]],close:[0,0]});for(var o=0,s=n[0];o","≥"][n[0]]];t.text=t.text||this.formatValueText(t.value!=null?t.value:t.interval,!1,i)},this)}};function MB(r,e){var t=r.inverse;(r.orient==="vertical"?!t:t)&&e.reverse()}const e2e=QCe;var t2e=function(r){ae(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.doRender=function(){var t=this.group;t.removeAll();var n=this.visualMapModel,i=n.get("textGap"),a=n.textStyleModel,o=a.getFont(),s=a.getTextColor(),l=this._getItemAlign(),u=n.itemSize,c=this._getViewData(),h=c.endsText,f=Mr(n.get("showLabel",!0),!h),d=!n.get("selectedMode");h&&this._renderEndsText(t,h[0],u,f,l),k(c.viewPieceList,function(p){var g=p.piece,v=new rt;v.onclick=Fe(this._onItemClick,this,g),this._enableHoverLink(v,p.indexInModelPieceList);var m=n.getRepresentValue(g);if(this._createItemSymbol(v,m,[0,0,u[0],u[1]],d),f){var y=this.visualMapModel.getValueState(m);v.add(new Ot({style:{x:l==="right"?-i:u[0]+i,y:u[1]/2,text:g.text,verticalAlign:"middle",align:l,font:o,fill:s,opacity:y==="outOfRange"?.5:1},silent:d}))}t.add(v)},this),h&&this._renderEndsText(t,h[1],u,f,l),Pc(n.get("orient"),t,n.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},e.prototype._enableHoverLink=function(t,n){var i=this;t.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(o){var s=i.visualMapModel;s.option.hoverLink&&i.api.dispatchAction({type:o,batch:m0(s.findTargetDataIndices(n),s)})}},e.prototype._getItemAlign=function(){var t=this.visualMapModel,n=t.option;if(n.orient==="vertical")return FW(t,this.api,t.itemSize);var i=n.align;return(!i||i==="auto")&&(i="left"),i},e.prototype._renderEndsText=function(t,n,i,a,o){if(n){var s=new rt,l=this.visualMapModel.textStyleModel;s.add(new Ot({style:pn(l,{x:a?o==="right"?i[0]:0:i[0]/2,y:i[1]/2,verticalAlign:"middle",align:a?o:"center",text:n})})),t.add(s)}},e.prototype._getViewData=function(){var t=this.visualMapModel,n=xe(t.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),i=t.get("text"),a=t.get("orient"),o=t.get("inverse");return(a==="horizontal"?o:!o)?n.reverse():i&&(i=i.slice().reverse()),{viewPieceList:n,endsText:i}},e.prototype._createItemSymbol=function(t,n,i,a){var o=rr(this.getControllerVisual(n,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(n,"color"));o.silent=a,t.add(o)},e.prototype._onItemClick=function(t){var n=this.visualMapModel,i=n.option,a=i.selectedMode;if(a){var o=Je(i.selected),s=n.getSelectedMapKey(t);a==="single"||a===!0?(o[s]=!0,k(o,function(l,u){o[u]=u===s})):o[s]=!o[s],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},e.type="visualMap.piecewise",e}(OW);const n2e=t2e;function UW(r){r.registerComponentModel(e2e),r.registerComponentView(n2e),BW(r)}function r2e(r){gt(zW),gt(UW)}var i2e={label:{enabled:!0},decal:{show:!1}},CB=Pt(),a2e={};function o2e(r,e){var t=r.getModel("aria");if(!t.get("enabled"))return;var n=Je(i2e);ht(n.label,r.getLocaleModel().get("aria"),!1),ht(t.option,n,!1),i(),a();function i(){var u=t.getModel("decal"),c=u.get("show");if(c){var h=He();r.eachSeries(function(f){if(!f.isColorBySeries()){var d=h.get(f.type);d||(d={},h.set(f.type,d)),CB(f).scope=d}}),r.eachRawSeries(function(f){if(r.isSeriesFiltered(f))return;if(qe(f.enableAriaDecal)){f.enableAriaDecal();return}var d=f.getData();if(f.isColorBySeries()){var y=PT(f.ecModel,f.name,a2e,r.getSeriesCount()),_=d.getVisual("decal");d.setVisual("decal",x(_,y))}else{var p=f.getRawData(),g={},v=CB(f).scope;d.each(function(S){var A=d.getRawIndex(S);g[A]=S});var m=p.count();p.each(function(S){var A=g[S],w=p.getName(S)||S+"",M=PT(f.ecModel,w,v,m),C=d.getItemVisual(A,"decal");d.setItemVisual(A,"decal",x(C,M))})}function x(S,A){var w=S?pe(pe({},A),S):A;return w.dirty=!0,w}})}}function a(){var u=e.getZr().dom;if(u){var c=r.getLocaleModel().get("aria"),h=t.getModel("label");if(h.option=Ke(h.option,c),!!h.get("enabled")){if(u.setAttribute("role","img"),h.get("description")){u.setAttribute("aria-label",h.get("description"));return}var f=r.getSeriesCount(),d=h.get(["data","maxCount"])||10,p=h.get(["series","maxCount"])||10,g=Math.min(f,p),v;if(!(f<1)){var m=s();if(m){var y=h.get(["general","withTitle"]);v=o(y,{title:m})}else v=h.get(["general","withoutTitle"]);var _=[],x=f>1?h.get(["series","multiple","prefix"]):h.get(["series","single","prefix"]);v+=o(x,{seriesCount:f}),r.eachSeries(function(M,C){if(C1?h.get(["series","multiple",P]):h.get(["series","single",P]),b=o(b,{seriesId:M.seriesIndex,seriesName:M.get("name"),seriesType:l(M.subType)});var D=M.getData();if(D.count()>d){var L=h.get(["data","partialData"]);b+=o(L,{displayCnt:d})}else b+=h.get(["data","allData"]);for(var E=h.get(["data","separator","middle"]),I=h.get(["data","separator","end"]),N=h.get(["data","excludeDimensionId"]),R=[],F=0;F":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},u2e=function(){function r(e){var t=this._condVal=ke(e)?new RegExp(e):Vae(e)?e:null;if(t==null){var n="";qt(n)}}return r.prototype.evaluate=function(e){var t=typeof e;return ke(t)?this._condVal.test(e):Ft(t)?this._condVal.test(e+""):!1},r}(),c2e=function(){function r(){}return r.prototype.evaluate=function(){return this.value},r}(),h2e=function(){function r(){}return r.prototype.evaluate=function(){for(var e=this.children,t=0;t2&&n.push(i),i=[D,L]}function c(D,L,E,I){mf(D,E)&&mf(L,I)||i.push(D,L,E,I,E,I)}function h(D,L,E,I,N,R){var F=Math.abs(L-D),O=Math.tan(F/4)*4/3,V=LM:T2&&n.push(i),n}function PM(r,e,t,n,i,a,o,s,l,u){if(mf(r,t)&&mf(e,n)&&mf(i,o)&&mf(a,s)){l.push(o,s);return}var c=2/u,h=c*c,f=o-r,d=s-e,p=Math.sqrt(f*f+d*d);f/=p,d/=p;var g=t-r,v=n-e,m=i-o,y=a-s,_=g*g+v*v,x=m*m+y*y;if(_=0&&M=0){l.push(o,s);return}var C=[],b=[];jl(r,t,i,o,.5,C),jl(e,n,a,s,.5,b),PM(C[0],b[0],C[1],b[1],C[2],b[2],C[3],b[3],l,u),PM(C[4],b[4],C[5],b[5],C[6],b[6],C[7],b[7],l,u)}function T2e(r,e){var t=LM(r),n=[];e=e||1;for(var i=0;i0)for(var u=0;uMath.abs(u),h=GW([l,u],c?0:1,e),f=(c?s:u)/h.length,d=0;di,o=GW([n,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",c=a?"y":"x",h=r[s]/o.length,f=0;f1?null:new ft(g*l+r,g*u+e)}function E2e(r,e,t){var n=new ft;ft.sub(n,t,e),n.normalize();var i=new ft;ft.sub(i,r,e);var a=i.dot(n);return a}function Kh(r,e){var t=r[r.length-1];t&&t[0]===e[0]&&t[1]===e[1]||r.push(e)}function L2e(r,e,t){for(var n=r.length,i=[],a=0;ao?(u.x=c.x=s+a/2,u.y=l,c.y=l+o):(u.y=c.y=l+o/2,u.x=s,c.x=s+a),L2e(e,u,c)}function z_(r,e,t,n){if(t===1)n.push(e);else{var i=Math.floor(t/2),a=r(e);z_(r,a[0],i,n),z_(r,a[1],t-i,n)}return n}function P2e(r,e){for(var t=[],n=0;n0)for(var S=n/t,A=-n/2;A<=n/2;A+=S){for(var w=Math.sin(A),M=Math.cos(A),C=0,_=0;_0;u/=2){var c=0,h=0;(r&u)>0&&(c=1),(e&u)>0&&(h=1),s+=u*u*(3*c^h),h===0&&(c===1&&(r=u-1-r,e=u-1-e),l=r,r=e,e=l)}return s}function G_(r){var e=1/0,t=1/0,n=-1/0,i=-1/0,a=xe(r,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),c=l.x+l.width/2+(u?u[4]:0),h=l.y+l.height/2+(u?u[5]:0);return e=Math.min(c,e),t=Math.min(h,t),n=Math.max(c,n),i=Math.max(h,i),[c,h]}),o=xe(a,function(s,l){return{cp:s,z:z2e(s[0],s[1],e,t,n,i),path:r[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function $W(r){return I2e(r.path,r.count)}function RM(){return{fromIndividuals:[],toIndividuals:[],count:0}}function U2e(r,e,t){var n=[];function i(S){for(var A=0;A=0;i--)if(!t[i].many.length){var l=t[s].many;if(l.length<=1)if(s)s=0;else return t;var a=l.length,u=Math.ceil(a/2);t[i].many=l.slice(u,a),t[s].many=l.slice(0,u),s++}return t}var G2e={clone:function(r){for(var e=[],t=1-Math.pow(1-r.path.style.opacity,1/r.count),n=0;n0))return;var s=n.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,c;OB(r)&&(u=r,c=e),OB(e)&&(u=e,c=r);function h(m,y,_,x,S){var A=m.many,w=m.one;if(A.length===1&&!S){var M=y?A[0]:w,C=y?w:A[0];if(U_(M))h({many:[M],one:C},!0,_,x,!0);else{var b=s?Ke({delay:s(_,x)},l):l;jE(M,C,b),a(M,C,M,C,b)}}else for(var T=Ke({dividePath:G2e[t],individualDelay:s&&function(N,R,F,O){return s(N+_,x)}},l),P=y?U2e(A,w,T):V2e(w,A,T),D=P.fromIndividuals,L=P.toIndividuals,E=D.length,I=0;Ie.length,d=u?FB(c,u):FB(f?e:r,[f?r:e]),p=0,g=0;gXW))for(var a=n.getIndices(),o=0;o0&&A.group.traverse(function(M){M instanceof yt&&!M.animators.length&&M.animateFrom({style:{opacity:0}},w)})})}function GB(r){var e=r.getModel("universalTransition").get("seriesKey");return e||r.id}function HB(r){return _e(r)?r.sort().join(","):r}function pl(r){if(r.hostModel)return r.hostModel.getModel("universalTransition").get("divideShape")}function j2e(r,e){var t=He(),n=He(),i=He();return k(r.oldSeries,function(a,o){var s=r.oldDataGroupIds[o],l=r.oldData[o],u=GB(a),c=HB(u);n.set(c,{dataGroupId:s,data:l}),_e(u)&&k(u,function(h){i.set(h,{key:c,dataGroupId:s,data:l})})}),k(e.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var o=a.get("dataGroupId"),s=a.getData(),l=GB(a),u=HB(l),c=n.get(u);if(c)t.set(u,{oldSeries:[{dataGroupId:c.dataGroupId,divide:pl(c.data),data:c.data}],newSeries:[{dataGroupId:o,divide:pl(s),data:s}]});else if(_e(l)){var h=[];k(l,function(p){var g=n.get(p);g.data&&h.push({dataGroupId:g.dataGroupId,divide:pl(g.data),data:g.data})}),h.length&&t.set(u,{oldSeries:h,newSeries:[{dataGroupId:o,data:s,divide:pl(s)}]})}else{var f=i.get(l);if(f){var d=t.get(f.key);d||(d={oldSeries:[{dataGroupId:f.dataGroupId,data:f.data,divide:pl(f.data)}],newSeries:[]},t.set(f.key,d)),d.newSeries.push({dataGroupId:o,data:s,divide:pl(s)})}}}}),t}function WB(r,e){for(var t=0;t=0&&i.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:pl(e.oldData[s]),groupIdDim:o.dimension})}),k(nn(r.to),function(o){var s=WB(t.updatedSeries,o);if(s>=0){var l=t.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:pl(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&YW(i,a,n)}function Z2e(r){r.registerUpdateLifecycle("series:beforeupdate",function(e,t,n){k(nn(n.seriesTransition),function(i){k(nn(i.to),function(a){for(var o=n.updatedSeries,s=0;sQW(r))}function xEe(){return ZW(KW,"/api/yak/forecast").then(r=>QW(r))}function SEe(){return Ge(this,null,function*(){return(yield _Ee()).map((e,t)=>({key:Rf(e,["areaCode","area_code","code","id"],`yak-town-${t}`),name:Rf(e,["areaName","area_name","zoneName","townName","name"],`区域${t+1}`),value:QE(Rf(e,["number","yakCount","yak_count","count","value"])),unit:"头"})).filter(e=>e.name&&Number.isFinite(e.value)).sort((e,t)=>t.value-e.value)})}function AEe(){return Ge(this,null,function*(){return(yield xEe()).map((e,t)=>{const n=Rf(e,["month","date","name","time"],`预测${t+1}`);return{key:`${n}-${t}`,name:wEe(n),value:QE(Rf(e,["number","count","yakCount","value"])),unit:"头",extra:bEe("增速",Rf(e,["speed","growth","growthRate","rate"]))}}).filter(e=>e.name&&Number.isFinite(e.value))})}function QW(r){return Array.isArray(r)?r:Array.isArray(r==null?void 0:r.rows)?r.rows:Array.isArray(r==null?void 0:r.list)?r.list:Array.isArray(r==null?void 0:r.records)?r.records:Array.isArray(r==null?void 0:r.data)?r.data:[]}function Rf(r,e,t=""){for(const n of e){const i=r==null?void 0:r[n];if(i!=null&&i!=="")return i}return t}function wEe(r){const e=String(r||""),t=e.match(/(?:^|\D)(1[0-2]|0?[1-9])(?:月|$|-)/);return t?`${Number(t[1])}月`:e}function bEe(r,e){const t=QE(e);return Number.isFinite(t)?`${r}:${t.toLocaleString("zh-CN",{maximumFractionDigits:2})}`:""}function QE(r){if(r==null||r==="")return NaN;const e=Number(String(r).replace(/,/g,"").replace(/%/g,""));return Number.isFinite(e)?e:NaN}const TEe={色地镇:"色地乡",瓦切镇:"瓦切乡",安曲镇:"安曲乡",龙日镇:"龙日乡"};function Vp(r){return TEe[r]||r}const NM=yU.slice().sort((r,e)=>e.count-r.count),Vy=PEe([{key:"adultCow",name:"成年母牛",ratio:47,source:"专家共识模型"},{key:"otherAdult",name:"其他成年牛",ratio:22,source:"专家共识模型"},{key:"calf",name:"幼畜(≤1岁)",ratio:16,source:"专家共识模型"},{key:"yearling",name:"育成牛(1-2岁)",ratio:11,source:"专家共识模型"},{key:"bull",name:"公牛",ratio:4,source:"专家共识模型"}],Al),qB=IC.map((r,e)=>Xe(Re({},r),{color:["#ff8f6b","#30dcff","#ffd76c","#7aa7ff"][e%4]})),qw=[{age:"≤1岁",cow:61280,bull:64892},{age:"1-2岁",cow:43076,bull:43752},{age:"2-4岁",cow:148260,bull:78240},{age:"4-8岁",cow:169420,bull:51860},{age:"8岁以上",cow:45534,bull:21416}],tc=[{key:"2026",label:"2026年底",shortLabel:"2026",months:7,stock:781236,births:44763,outflow:21684,correction:-21843,structure:{adultCow:47,otherAdult:22,calf:16,yearling:11,bull:4}},{key:"2027",label:"2027年底",shortLabel:"2027",months:19,stock:779428,births:121374,outflow:61286,correction:-60660,structure:{adultCow:47,otherAdult:21,calf:17,yearling:11,bull:4}},{key:"2028",label:"2028年底",shortLabel:"2028",months:31,stock:782617,births:199642,outflow:102517,correction:-94508,structure:{adultCow:46,otherAdult:22,calf:17,yearling:11,bull:4}}],jB=[{name:"繁殖补充",value:86},{name:"出栏周转",value:62},{name:"死亡淘汰",value:48},{name:"母牛基础",value:91},{name:"幼畜存活",value:73}];function MEe(r){return tc.find(e=>e.key===r)||tc[1]}function CEe(r){var i,a,o,s,l;const e=(r==null?void 0:r.structure)||{},t=[{key:"adultCow",name:"成年母牛",ratio:(i=e.adultCow)!=null?i:47},{key:"otherAdult",name:"其他成年牛",ratio:(a=e.otherAdult)!=null?a:22},{key:"calf",name:"幼畜(≤1岁)",ratio:(o=e.calf)!=null?o:16},{key:"yearling",name:"育成牛(1-2岁)",ratio:(s=e.yearling)!=null?s:11},{key:"bull",name:"公牛",ratio:(l=e.bull)!=null?l:4}].map(u=>Xe(Re({},u),{count:Math.round(r.stock*u.ratio/100),source:"预测模型"})),n=r.stock-t.reduce((u,c)=>u+c.count,0);return n&&t[1]&&(t[1].count+=n),t}function EEe(r){const e=r.stock/W0,t=NM.map((i,a)=>Xe(Re({},i),{forecast:Math.round(i.count*e+(a%3-1)*r.months*18)})),n=r.stock-t.reduce((i,a)=>i+a.forecast,0);if(n){const i=t.reduce((a,o)=>o.count>a.count?o:a,t[0]);i.forecast+=n}return t.map(i=>Xe(Re({},i),{change:i.forecast-i.count})).sort((i,a)=>a.forecast-i.forecast)}function LEe(r){const e=r.months+1,t=Array.from({length:e},(o,s)=>s===0?"2026-06":s===r.months?r.label:`+${s}月`),n=t.map((o,s)=>{const l=s/r.months,u=Math.sin(s/2.6)*Math.min(360,r.months*18);return Math.round(Al+(r.stock-Al)*l+u)}),i=t.map((o,s)=>Math.round(r.births/r.months*s)),a=t.map((o,s)=>Math.round(r.outflow/r.months*s));return{labels:t,stock:n,births:i,outflow:a}}function PEe(r,e){const t=r.map(i=>Xe(Re({},i),{count:Math.round(e*i.ratio/100)})),n=e-t.reduce((i,a)=>i+a.count,0);return n&&t[1]&&(t[1].count+=n),t}function REe(r){const e=new Map;return r.forEach(t=>{const n=Vp(t.name),i=e.get(n)||{name:n,count:0,devices:0};i.count+=Number(t.count||0),i.devices+=Number(t.devices||0),e.set(n,i)}),[...e.values()].sort((t,n)=>n.count-t.count)}const DEe={class:"yak-management"},IEe={key:0,class:"yak-map-loading"},NEe={class:"yak-management-ui"},kEe={class:"yak-left"},OEe={class:"yak-side-stack is-left"},FEe={class:"yak-formula-card"},BEe={class:"yak-formula-row"},zEe={class:"formula-box"},UEe={class:"formula-box is-gold"},VEe={class:"formula-box is-red"},GEe={class:"formula-result"},HEe={class:"yak-formula-card is-forecast"},WEe={class:"yak-period-tabs"},$Ee=["onClick"],XEe={class:"yak-formula-row"},YEe={class:"formula-box"},qEe={class:"formula-box is-gold"},jEe={class:"formula-box is-red"},KEe={class:"formula-result"},ZEe={class:"yak-right"},QEe={class:"yak-side-stack is-right"},JEe={class:"yak-structure-list"},eLe={class:"structure-item-head"},tLe={class:"forecast-heat-list"},nLe={class:"yak-bottom-topic"},Xr=398,Yr=190,rLe={__name:"index",emits:["module-stats"],setup(r,{emit:e}){const t=e,n=["#30dcff","#27f0c0","#ffd76c","#7aa7ff","#ff8f6b","#a6f06d"],i=[{key:"structure",name:"畜群结构",color:"#30dcff"},{key:"forecast",name:"畜群预测",color:"#ffd76c"}],a=tt("structure"),o=tt("2027"),s=tt([]),l=tt([]),u=tt(null),c=tt(!1);let h=null,f=!1;const d=Se(()=>MEe(o.value)),p=Se(()=>new Map(NM.map(U=>[Vp(U.name),U]))),g=Se(()=>(s.value.length>=5?s.value:NM).map(K=>{const te=p.value.get(Vp(K.name));return Xe(Re({},K),{devices:Number(K.devices||(te==null?void 0:te.devices)||0)})})),v=Se(()=>l.value.length>=6?l.value:bre),m=Se(()=>EEe(d.value)),y=Se(()=>CEe(d.value)),_=Se(()=>a.value==="forecast"?m.value:g.value),x=Se(()=>W(_.value,a.value==="forecast"?"forecast":"count")),S=Se(()=>({title:a.value==="forecast"?`${d.value.shortLabel}预测存栏`:"牦牛识别数量",metricLabel:a.value==="forecast"?"预测":"识别",unit:"万头",rows:x.value.map(U=>({name:U.name,value:Number((U.value/1e4).toFixed(2)),unit:"万头"}))})),A=Se(()=>({color:n,tooltip:ee(U=>`${U.name}
占比:${U.percent}%
数量:${le(U.value)}头`),legend:{orient:"vertical",right:8,top:"middle",itemWidth:9,itemHeight:9,textStyle:{color:"rgba(222, 250, 255, 0.78)",fontSize:11}},series:[{name:"畜群结构",type:"pie",radius:["46%","70%"],center:["33%","52%"],avoidLabelOverlap:!0,label:{color:"#fff",fontSize:11,formatter:"{d}%"},labelLine:{lineStyle:{color:"rgba(223, 250, 255, 0.36)"}},itemStyle:{borderColor:"rgba(3, 18, 31, 0.9)",borderWidth:3},data:Vy.map(U=>({name:U.name,value:U.count}))}]})),w=Se(()=>({color:["#ffd76c","#30dcff"],tooltip:Xe(Re({},ee()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(U){const K=U.map(te=>`${te.marker}${te.seriesName}:${le(Math.abs(te.value))}头`);return`${U[0].name}
${K.join("
")}`}}),legend:{top:4,right:12,itemWidth:12,itemHeight:8,textStyle:{color:"rgba(222, 250, 255, 0.8)",fontSize:11}},grid:{left:22,right:22,top:32,bottom:12,containLabel:!0},xAxis:{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.58)",fontSize:10,formatter:U=>re(Math.abs(U))},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.1)",type:"dashed"}},axisLine:{show:!1},axisTick:{show:!1}},yAxis:{type:"category",data:qw.map(U=>U.age),axisLabel:{color:"rgba(223, 250, 255, 0.82)",fontSize:11},axisLine:{show:!1},axisTick:{show:!1}},series:[{name:"母牛",type:"bar",stack:"gender",barWidth:12,data:qw.map(U=>-U.cow),itemStyle:{borderRadius:[7,0,0,7]}},{name:"公牛",type:"bar",stack:"gender",barWidth:12,data:qw.map(U=>U.bull),itemStyle:{borderRadius:[0,7,7,0]}}]})),M=Se(()=>{const U=g.value.slice(0,6),K=U.map(te=>te.count);return{color:n,tooltip:Xe(Re({},ee()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(te){const ce=te.map(se=>`${se.marker}${se.seriesName}:${le(se.value)}头`);return`${te[0].name}
${ce.join("
")}
合计:${le(K[te[0].dataIndex])}头`}}),legend:{top:0,right:0,itemWidth:8,itemHeight:6,itemGap:6,textStyle:{color:"rgba(222, 250, 255, 0.75)",fontSize:9}},grid:{left:56,right:36,top:28,bottom:10},xAxis:{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.56)",fontSize:10,formatter:re},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.1)",type:"dashed"}},axisLine:{show:!1},axisTick:{show:!1}},yAxis:{type:"category",inverse:!0,data:U.map(te=>te.name),axisLabel:{color:"rgba(223, 250, 255, 0.82)",fontSize:11},axisLine:{show:!1},axisTick:{show:!1}},series:Vy.map(te=>({name:te.name.replace("(≤1岁)","").replace("(1-2岁)",""),type:"bar",stack:"town",barWidth:11,data:U.map(ce=>Math.round(ce.count*te.ratio/100))}))}}),C=Se(()=>H(g.value.slice(0,8),"count","头")),b=Se(()=>{const U=g.value.slice(0,8);return{tooltip:ee(K=>`${K.data.name}
在线设备:${K.value[0]}台
识别数量:${le(K.value[1])}头`),grid:{left:46,right:28,top:22,bottom:32},xAxis:{type:"value",min:0,max:Math.max(...U.map(K=>Number(K.devices||0)),1)+3,name:"设备",nameGap:8,nameTextStyle:{color:"rgba(223, 250, 255, 0.6)",fontSize:10},axisLabel:{color:"rgba(223, 250, 255, 0.62)",fontSize:10},axisLine:{lineStyle:{color:"rgba(48, 220, 255, 0.22)"}},axisTick:{show:!1},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.08)"}}},yAxis:{type:"value",name:"识别",nameGap:8,nameTextStyle:{color:"rgba(223, 250, 255, 0.6)",fontSize:10},axisLabel:{color:"rgba(223, 250, 255, 0.62)",fontSize:10,formatter:re},axisLine:{lineStyle:{color:"rgba(48, 220, 255, 0.22)"}},axisTick:{show:!1},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.08)",type:"dashed"}}},series:[{name:"设备识别",type:"scatter",symbolSize:K=>Math.max(12,Math.min(28,K[1]/5200)),itemStyle:{color:K=>n[K.dataIndex%n.length],opacity:.92,shadowBlur:18,shadowColor:"rgba(48, 220, 255, 0.42)"},label:{show:!0,formatter:"{b}",position:"top",color:"rgba(223, 252, 255, 0.88)",fontSize:10},labelLayout:{hideOverlap:!0},emphasis:{scale:1.12,label:{show:!0,color:"#ffffff",fontWeight:700}},data:U.map(K=>({name:K.name,value:[K.devices||0,K.count]}))}]}}),T=Se(()=>{const U=qB.slice().sort((K,te)=>te.value-K.value);return H(U,"value","头",{labelKey:"label",colors:U.map(K=>K.color),tooltipFormatter(K){const te=U[K.dataIndex],ce=qB.reduce((se,Ne)=>se+Ne.value,0);return`${te.label}
数量:${le(te.value)}头
占比:${be(te.value/ce*100)}
同比:${te.yoy>0?"+":""}${te.yoy}%`}})}),P=Se(()=>{const U=LEe(d.value);return{color:["#30dcff","#ffd76c","#ff8f6b"],tooltip:Xe(Re({},ee()),{trigger:"axis"}),legend:{top:4,right:8,itemWidth:12,itemHeight:8,textStyle:{color:"rgba(222, 250, 255, 0.78)",fontSize:10}},grid:{left:44,right:40,top:34,bottom:28},xAxis:{type:"category",boundaryGap:!1,data:U.labels,axisLabel:{color:"rgba(223, 250, 255, 0.62)",fontSize:10,interval:d.value.months>18?4:d.value.months>12?2:1},axisLine:{lineStyle:{color:"rgba(48, 220, 255, 0.28)"}},axisTick:{show:!1}},yAxis:[{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.58)",fontSize:10,formatter:re},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.1)",type:"dashed"}}},{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.48)",fontSize:10,formatter:re},splitLine:{show:!1}}],series:[Q("预测存栏",U.stock,"#30dcff",0,!0),Q("繁殖补充",U.births,"#ffd76c",1),Q("出栏扣减",U.outflow,"#ff8f6b",1)]}}),D=Se(()=>({color:["#30dcff","#ffd76c"],tooltip:Xe(Re({},ee()),{trigger:"axis"}),legend:{top:4,right:12,itemWidth:12,itemHeight:8,textStyle:{color:"rgba(222, 250, 255, 0.78)",fontSize:10}},grid:{left:40,right:42,top:34,bottom:28},xAxis:{type:"category",data:v.value.map(U=>U.month||U.name),axisLabel:{color:"rgba(223, 250, 255, 0.68)",fontSize:10,interval:1},axisLine:{lineStyle:{color:"rgba(48, 220, 255, 0.26)"}},axisTick:{show:!1}},yAxis:[{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.58)",fontSize:10},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.1)",type:"dashed"}}},{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.48)",fontSize:10},splitLine:{show:!1}}],series:[{name:"数量",type:"bar",barWidth:12,data:v.value.map(U=>U.count||U.value),itemStyle:{borderRadius:[8,8,0,0],color:new Ul(0,0,0,1,[{offset:0,color:"#30dcff"},{offset:1,color:"rgba(48, 220, 255, 0.08)"}])}},{name:"增速",type:"line",yAxisIndex:1,smooth:!0,symbolSize:5,data:v.value.map(U=>U.speed||U.growthRate||0),lineStyle:{width:2.4,color:"#ffd76c"},itemStyle:{color:"#ffd76c"}}]})),L=Se(()=>({tooltip:ee(),radar:{center:["50%","54%"],radius:"68%",splitNumber:4,indicator:jB.map(U=>({name:U.name,max:100})),axisName:{color:"rgba(223, 250, 255, 0.76)",fontSize:11},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.22)"}},splitArea:{areaStyle:{color:["rgba(48, 220, 255, 0.04)","rgba(39, 240, 192, 0.02)"]}},axisLine:{lineStyle:{color:"rgba(48, 220, 255, 0.18)"}}},series:[{type:"radar",data:[{name:"预测因子",value:jB.map(U=>U.value),areaStyle:{color:"rgba(48, 220, 255, 0.22)"},lineStyle:{color:"#30dcff",width:2},itemStyle:{color:"#ffd76c"}}]}]})),E=Se(()=>H(m.value.slice(0,8),"forecast","头")),I=Se(()=>H(y.value,"ratio","%",{tooltipFormatter(U){const K=y.value[U.dataIndex];return`${K.name}
预测占比:${be(K.ratio)}
预测数量:${le(K.count)}头`}})),N=Se(()=>({color:["#ffd76c","#ff8f6b","#7aa7ff"],tooltip:Xe(Re({},ee()),{trigger:"axis",axisPointer:{type:"shadow"}}),legend:{top:4,right:8,itemWidth:12,itemHeight:8,textStyle:{color:"rgba(222, 250, 255, 0.78)",fontSize:10}},grid:{left:44,right:26,top:34,bottom:28},xAxis:{type:"category",data:tc.map(U=>U.shortLabel),axisLabel:{color:"rgba(223, 250, 255, 0.76)",fontSize:11},axisLine:{lineStyle:{color:"rgba(48, 220, 255, 0.26)"}},axisTick:{show:!1}},yAxis:{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.58)",fontSize:10,formatter:re},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.1)",type:"dashed"}}},series:[{name:"繁殖补充",type:"bar",barWidth:12,data:tc.map(U=>U.births),itemStyle:{borderRadius:[7,7,0,0]}},{name:"出栏流出",type:"bar",barWidth:12,data:tc.map(U=>-U.outflow),itemStyle:{borderRadius:[0,0,7,7]}},{name:"稳态校正",type:"line",smooth:!0,symbolSize:6,data:tc.map(U=>U.correction),lineStyle:{width:2.4}}]})),R=Se(()=>{const U=m.value.slice(0,7),K=Math.max(...U.map(te=>Math.abs(te.change)),1);return U.map(te=>Xe(Re({},te),{width:Math.max(8,Math.round(Math.abs(te.change)/K*100))}))});Ko(()=>{O(),F()}),uo(()=>{var U,K;f=!0,(K=(U=u.value)==null?void 0:U.destroyMap)==null||K.call(U)}),ni([a,d,g],()=>{V()},{immediate:!0});function F(){return Ge(this,null,function*(){var te,ce;const[U,K]=yield Promise.allSettled([SEe(),AEe()]);U.status==="fulfilled"&&((te=U.value)!=null&&te.length)&&(s.value=REe(U.value.map(se=>{var Ne;return{name:Vp(se.name),count:Number(se.value),devices:((Ne=p.value.get(Vp(se.name)))==null?void 0:Ne.devices)||0}}).filter(se=>se.name&&Number.isFinite(se.count)))),K.status==="fulfilled"&&((ce=K.value)!=null&&ce.length)&&(l.value=K.value.map(se=>({month:se.name,count:Number(se.value),speed:he(se.extra)})).filter(se=>se.month&&Number.isFinite(se.count)))})}function O(){var K;h=new _g;const U=(te=0)=>Ge(this,null,function*(){var se,Ne;if(f)return;yield no();const ce=u.value;if((se=ce==null?void 0:ce.loadMap)==null||se.call(ce,h),ce!=null&&ce.canvasMap){c.value=!0,(Ne=ce.play)==null||Ne.call(ce);return}te<24&&window.setTimeout(()=>U(te+1),120)});(K=h.ready)==null||K.then(U).catch(()=>{c.value=!0})}function V(){if(a.value==="forecast"){const K=d.value.stock-Al;t("module-stats",{moduleKey:"yak-management",items:[{zh:"预测期末存栏",value:d.value.stock,unit:"头"},{zh:"繁殖补充",value:d.value.births,unit:"头"},{zh:"出栏流出",value:d.value.outflow,unit:"头"},{zh:"预测净变化",value:K,unit:"头"}]});return}const U=Vy.find(K=>K.key==="adultCow");t("module-stats",{moduleKey:"yak-management",items:[{zh:"当前估算存栏",value:Al,unit:"头"},{zh:"无人机识别总数",value:W0,unit:"头"},{zh:"成年母牛",value:(U==null?void 0:U.count)||0,unit:"头"},{zh:"识别乡镇",value:g.value.length,unit:"个"}]})}function H(U,K,te,ce={}){const se=ce.labelKey||"name",Ne=ce.colors||n,Oe=Math.max(...U.map(B=>Number(B[K]||0)),1);return{tooltip:Xe(Re({},ee()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(B){if(ce.tooltipFormatter)return ce.tooltipFormatter(B[0]);const z=U[B[0].dataIndex];return`${z[se]}
数值:${le(z[K])}${te}`}}),grid:{left:74,right:54,top:14,bottom:14},xAxis:{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.56)",fontSize:10,formatter:te==="%"?"{value}%":re},axisLine:{show:!1},axisTick:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",inverse:!0,data:U.map(B=>B[se]),axisLabel:{color:"rgba(223, 250, 255, 0.82)",fontSize:11},axisLine:{show:!1},axisTick:{show:!1}},series:[{type:"bar",barWidth:U.length>6?11:13,data:U.map((B,z)=>({value:B[K],itemStyle:{borderRadius:[0,7,7,0],color:new Ul(0,0,1,0,[{offset:0,color:"rgba(48, 220, 255, 0.12)"},{offset:1,color:Ne[z%Ne.length]}])}})),showBackground:!0,backgroundStyle:{color:"rgba(48, 220, 255, 0.055)",borderRadius:[0,7,7,0]},label:{show:!0,position:"right",color:"#ffffff",fontSize:10,formatter:({value:B})=>`${te==="%"?be(B):re(B)}`},markLine:ce.showAverage===!1?void 0:{silent:!0,symbol:"none",label:{show:!1},lineStyle:{color:"rgba(255, 215, 108, 0.22)",type:"dashed",width:1},data:[{xAxis:Math.round(Oe*.72)}]}}]}}function Q(U,K,te,ce=0,se=!1){return{name:U,type:"line",yAxisIndex:ce,smooth:!0,symbolSize:5,data:K,lineStyle:{width:2.5,color:te},itemStyle:{color:te},areaStyle:se?{color:new Ul(0,0,0,1,[{offset:0,color:`${te}44`},{offset:1,color:`${te}05`}])}:void 0}}function W(U,K){const te=new Map;return U.forEach(ce=>{const se=Z(ce.name);if(!se)return;const Ne=te.get(se)||{name:se,value:0};Ne.value+=Number(ce[K]||0),te.set(se,Ne)}),[...te.values()].sort((ce,se)=>se.value-ce.value)}function Z(U){return{色地乡:"色地镇",瓦切乡:"瓦切镇",安曲乡:"安曲镇",龙日乡:"龙日镇",色地镇:"色地镇",瓦切镇:"瓦切镇",安曲镇:"安曲镇",龙日镇:"龙日镇",邛溪镇:"邛溪镇",刷经寺镇:"刷经寺镇",阿木乡:"阿木乡",查尔玛乡:"查尔玛乡",江茸乡:"江茸乡",麦洼乡:"麦洼乡"}[U]||""}function ee(U){return{trigger:"item",backgroundColor:"rgba(5, 31, 51, 0.96)",borderColor:"rgba(0, 210, 255, 0.54)",borderWidth:1,textStyle:{color:"#e7fbff",fontSize:12},extraCssText:"box-shadow:0 0 18px rgba(0,210,255,.2);",formatter:U}}function he(U){const K=String(U||"").match(/-?\d+(?:\.\d+)?/);return K?Number(K[0]):0}function le(U){const K=Number(U);return Number.isFinite(K)?K.toLocaleString("zh-CN",{maximumFractionDigits:Number.isInteger(K)?0:2}):"--"}function re(U){const K=Number(U);return Number.isFinite(K)?Math.abs(K)>=1e4?`${(K/1e4).toFixed(Math.abs(K)>=1e5?0:1)}万`:Math.abs(K)>=1e3?`${Math.round(K/1e3)}k`:`${Math.round(K)}`:"--"}function be(U){const K=Number(U);return Number.isFinite(K)?`${Number.isInteger(K)?K:K.toFixed(1)}%`:"--"}function de(U){const K=Number(U);return Number.isFinite(K)?`${K>=0?"+":"-"}${le(Math.abs(K))}`:"--"}return(U,K)=>(ie(),oe("div",DEe,[$e(yg,{ref_key:"mapSceneRef",ref:u,class:"yak-map-scene","map-ranking":S.value},null,8,["map-ranking"]),K[15]||(K[15]=G("div",{class:"yak-map-scrim"},null,-1)),c.value?Tt("",!0):(ie(),oe("div",IEe,"3D地图加载中")),G("div",NEe,[G("div",kEe,[G("div",OEe,[a.value==="structure"?(ie(),oe(it,{key:0},[$e(tn,{class:"yak-side-card left-card",title:"存栏估算口径",width:Xr,height:Yr},{default:Xt(()=>[G("div",FEe,[G("div",BEe,[G("div",zEe,[K[1]||(K[1]=G("span",null,"无人机识别",-1)),G("strong",null,Te(le(_n(W0))),1)]),K[4]||(K[4]=G("i",null,"+",-1)),G("div",UEe,[K[2]||(K[2]=G("span",null,"待归属校正",-1)),G("strong",null,Te(le(_n(_U))),1)]),K[5]||(K[5]=G("i",null,"-",-1)),G("div",VEe,[K[3]||(K[3]=G("span",null,"周转扣减",-1)),G("strong",null,Te(le(Math.abs(_n(xU)))),1)])]),G("div",GEe,[K[7]||(K[7]=G("span",null,"当前估算存栏",-1)),G("strong",null,[Zn(Te(le(_n(Al))),1),K[6]||(K[6]=G("em",null,"头",-1))])])])]),_:1}),$e(tn,{class:"yak-side-card left-card",title:"畜群结构占比",width:Xr,height:Yr},{default:Xt(()=>[$e(_n(fa),{class:"yak-chart",option:A.value,autoresize:!0},null,8,["option"])]),_:1}),$e(tn,{class:"yak-side-card left-card",title:"母牛/公牛年龄结构",width:Xr,height:Yr},{default:Xt(()=>[$e(_n(fa),{class:"yak-chart",option:w.value,autoresize:!0},null,8,["option"])]),_:1}),$e(tn,{class:"yak-side-card left-card",title:"乡镇结构堆叠",width:Xr,height:Yr},{default:Xt(()=>[$e(_n(fa),{class:"yak-chart",option:M.value,autoresize:!0},null,8,["option"])]),_:1})],64)):(ie(),oe(it,{key:1},[$e(tn,{class:"yak-side-card left-card",title:"预测模型口径",width:Xr,height:Yr},{default:Xt(()=>[G("div",HEe,[G("div",WEe,[(ie(!0),oe(it,null,vt(_n(tc),te=>(ie(),oe("button",{key:te.key,type:"button",class:Vt({active:te.key===o.value}),onClick:ce=>o.value=te.key},Te(te.shortLabel),11,$Ee))),128))]),G("div",XEe,[G("div",YEe,[K[8]||(K[8]=G("span",null,"当前存栏",-1)),G("strong",null,Te(re(_n(Al))),1)]),K[11]||(K[11]=G("i",null,"+",-1)),G("div",qEe,[K[9]||(K[9]=G("span",null,"繁殖补充",-1)),G("strong",null,Te(re(d.value.births)),1)]),K[12]||(K[12]=G("i",null,"-",-1)),G("div",jEe,[K[10]||(K[10]=G("span",null,"出栏流出",-1)),G("strong",null,Te(re(d.value.outflow)),1)])]),G("div",KEe,[G("span",null,Te(d.value.label)+"预测存栏",1),G("strong",null,[Zn(Te(le(d.value.stock)),1),K[13]||(K[13]=G("em",null,"头",-1))])])])]),_:1}),$e(tn,{class:"yak-side-card left-card",title:"未来存栏趋势",width:Xr,height:Yr},{default:Xt(()=>[$e(_n(fa),{class:"yak-chart",option:P.value,autoresize:!0},null,8,["option"])]),_:1}),$e(tn,{class:"yak-side-card left-card",title:"月度数量预测",width:Xr,height:Yr},{default:Xt(()=>[$e(_n(fa),{class:"yak-chart",option:D.value,autoresize:!0},null,8,["option"])]),_:1}),$e(tn,{class:"yak-side-card left-card",title:"预测因子雷达",width:Xr,height:Yr},{default:Xt(()=>[$e(_n(fa),{class:"yak-chart",option:L.value,autoresize:!0},null,8,["option"])]),_:1})],64))])]),G("div",ZEe,[G("div",QEe,[a.value==="structure"?(ie(),oe(it,{key:0},[$e(tn,{class:"yak-side-card right-card",title:"识别数量排行",width:Xr,height:Yr},{default:Xt(()=>[$e(_n(fa),{class:"yak-chart",option:C.value,autoresize:!0},null,8,["option"])]),_:1}),$e(tn,{class:"yak-side-card right-card",title:"设备与识别关系",width:Xr,height:Yr},{default:Xt(()=>[$e(_n(fa),{class:"yak-chart",option:b.value,autoresize:!0},null,8,["option"])]),_:1}),$e(tn,{class:"yak-side-card right-card",title:"出栏/交易影响",width:Xr,height:Yr},{default:Xt(()=>[$e(_n(fa),{class:"yak-chart",option:T.value,autoresize:!0},null,8,["option"])]),_:1}),$e(tn,{class:"yak-side-card right-card",title:"结构明细",width:Xr,height:Yr},{default:Xt(()=>[G("div",JEe,[(ie(!0),oe(it,null,vt(_n(Vy),(te,ce)=>(ie(),oe("div",{key:te.key,class:"structure-item",style:un({"--ratio-width":`${Math.max(8,te.ratio*1.8)}%`,"--item-color":n[ce%n.length]})},[G("div",eLe,[G("span",null,Te(te.name),1),G("strong",null,Te(be(te.ratio)),1),G("em",null,Te(re(te.count))+"头",1)]),K[14]||(K[14]=G("div",{class:"structure-track"},[G("i")],-1))],4))),128))])]),_:1})],64)):(ie(),oe(it,{key:1},[$e(tn,{class:"yak-side-card right-card",title:"乡镇预测排行",width:Xr,height:Yr},{default:Xt(()=>[$e(_n(fa),{class:"yak-chart",option:E.value,autoresize:!0},null,8,["option"])]),_:1}),$e(tn,{class:"yak-side-card right-card",title:"期末结构预测",width:Xr,height:Yr},{default:Xt(()=>[$e(_n(fa),{class:"yak-chart",option:I.value,autoresize:!0},null,8,["option"])]),_:1}),$e(tn,{class:"yak-side-card right-card",title:"补充/流出对比",width:Xr,height:Yr},{default:Xt(()=>[$e(_n(fa),{class:"yak-chart",option:N.value,autoresize:!0},null,8,["option"])]),_:1}),$e(tn,{class:"yak-side-card right-card",title:"预测变化热力",width:Xr,height:Yr},{default:Xt(()=>[G("div",tLe,[(ie(!0),oe(it,null,vt(R.value,te=>(ie(),oe("div",{key:te.name,class:"heat-row",style:un({"--heat-width":`${te.width}%`})},[G("span",null,Te(te.name),1),G("strong",null,Te(de(te.change)),1)],4))),128))])]),_:1})],64))])]),G("div",nLe,[$e(OC,{"model-value":a.value,topics:i,"onUpdate:modelValue":K[0]||(K[0]=te=>a.value=te)},null,8,["model-value"])])])]))}},JW="/jsyApi";function e7(r,e){return/^https?:\/\//.test(e)?e:`${r}${e.startsWith("/")?e:`/${e}`}`}function t7(r){if((r==null?void 0:r.success)===!1||(r==null?void 0:r.code)!==void 0&&![0,200,"0","200"].includes(r.code)){const t=new Error((r==null?void 0:r.msg)||(r==null?void 0:r.message)||"接口请求失败");throw t.code=r==null?void 0:r.code,t}return Lt(r)}function iLe(r,e,t={}){return Bs(e7(JW,r),{params:e,timeout:t.timeout||12e3}).then(t7)}function ex(r,e,t={}){return Bs(e7(JW,r),{method:"POST",params:e,timeout:t.timeout||12e3}).then(t7)}function aLe(){return ex("/dataItem",{group:"pastures"}).then(r=>(r==null?void 0:r.data)||r||[])}function oLe(){return ex("/muhu/distribution").then(r=>(r==null?void 0:r.data)||r||[])}function sLe(){return ex("/muhu/age").then(r=>(r==null?void 0:r.data)||r||[])}function lLe(){return ex("/muhu/upline_rate").then(r=>(r==null?void 0:r.data)||r||[])}function uLe(){return iLe("/pasturesList").then(r=>(r==null?void 0:r.data)||r||[])}function cLe(){return Ge(this,null,function*(){const[r,e,t,n,i]=yield Promise.allSettled([aLe(),oLe(),sLe(),lLe(),uLe()]);return{core:r.status==="fulfilled"?r.value:[],distribution:e.status==="fulfilled"?e.value:[],age:t.status==="fulfilled"?t.value:[],online:n.status==="fulfilled"?n.value:[],list:i.status==="fulfilled"?i.value:[]}})}const Pd=(r,e=2)=>{const t=cu(10,e);return Math.round((Number(r)||0)*t)/t},hLe=(r,e)=>r.reduce((t,n)=>t+(Number(n[e])||0),0),W_=r=>Pd((Number(r)||0)/1e4,2),hg=W_(oo.grasslandArea),tx=hLe(xg,"yakCount"),fLe=W_(oo.wetArea),fg=oo.herdsmanCount,n7=112,dLe=Pd(hg/Math.max(fg,1),2),$_=164820,kM=158460,pLe=Pd((kM-$_)/$_*100,1),r7=[{key:"pasture-count",zh:"牧场总数",name:"牧场总数",value:fg,unit:"户",decimals:0},{key:"pasture-grassland",zh:"牧场草地",name:"牧场草地",value:hg,unit:"万亩",decimals:2},{key:"pasture-yak",zh:"关联牦牛",name:"关联牦牛",value:tx,unit:"头",decimals:0},{key:"pasture-online",zh:"在线牧户",name:"在线牧户",value:n7,unit:"户",decimals:0}],Gp=[{key:"pasture-total",name:"牧场总数",value:fg,unit:"户",icon:"town"},{key:"pasture-grassland-area",name:"草地面积",value:hg,unit:"万亩",icon:"area"},{key:"pasture-yak-total",name:"牦牛存栏",value:tx,unit:"头",icon:"yield"},{key:"pasture-online-rate",name:"在线率",value:Pd(n7/fg*100,1),unit:"%",icon:"rate"}],nx=xg.map((r,e)=>{const t=mU.find(o=>o.zoneName===r.zoneName)||{},n=W_(r.grasslandArea||t.grasslandArea),i=W_(t.wetArea),a=Math.max(5,Math.round(r.yakCount/Math.max(tx,1)*fg));return{key:r.zoneName,name:r.zoneName,value:a,unit:"户",yakCount:r.yakCount,grasslandArea:n,wetlandArea:i,onlineRate:Math.min(98,78+e*7%18),density:Pd(r.yakCount/Math.max(n,1),1)}}).sort((r,e)=>e.value-r.value),i7=[{key:"age-30",name:"30岁以下",value:12,unit:"人"},{key:"age-40",name:"30-40岁",value:31,unit:"人"},{key:"age-50",name:"40-50岁",value:38,unit:"人"},{key:"age-60",name:"50-60岁",value:29,unit:"人"},{key:"age-60-plus",name:"60岁以上",value:19,unit:"人"}],a7=[{key:"male",name:"男性牧户",value:72,unit:"户"},{key:"female",name:"女性牧户",value:57,unit:"户"}],o7=nx.slice(0,6).map(r=>({key:`${r.key}-online`,name:r.name,value:r.onlineRate,unit:"%",extra:`${r.value}户`})),vLe=[{key:"grassland",name:"可利用草地",value:hg,unit:"万亩"},{key:"wetland",name:"关联湿地",value:fLe,unit:"万亩"},{key:"average",name:"户均草地",value:dLe,unit:"万亩/户"},{key:"density",name:"草畜密度",value:Pd(tx/Math.max(hg,1),1),unit:"头/万亩"}],gLe=[{key:"capacity",name:"理论承载力",value:$_,unit:"羊单位"},{key:"actual",name:"实际载畜量",value:kM,unit:"羊单位"},{key:"surplus",name:"承载余量",value:Math.abs(kM-$_),unit:"羊单位"},{key:"overload-rate",name:"超载率",value:Math.max(pLe,0),unit:"%"}],mLe=[{key:"inspection",name:"草场巡查",value:86,unit:"%",extra:"本月完成"},{key:"insurance",name:"保险覆盖",value:74,unit:"%",extra:"牧户覆盖"},{key:"epidemic",name:"防疫到位",value:91,unit:"%",extra:"年度任务"},{key:"device",name:"设备在线",value:88,unit:"%",extra:"定位设备"}],yLe=Mre.map((r,e)=>({key:r.name,name:r.name,value:r.value,unit:"条",scaleValue:[72,58,42,28][e]||20})),_Le=nx.map(r=>({name:r.name,value:r.value,unit:"户"})),jw={topStats:r7,coreRows:Gp,townRows:nx,ageRows:i7,genderRows:a7,onlineRows:o7};const xLe={class:"pasture-management"},SLe={key:0,class:"pasture-map-loading"},ALe={class:"pasture-management-ui"},wLe={class:"pasture-left"},bLe={class:"pasture-side-stack is-left"},TLe={class:"pasture-center-panel"},MLe={class:"pasture-center-metrics"},CLe={class:"pasture-right"},ELe={class:"pasture-side-stack is-right"},LLe={class:"pasture-bottom-status"},il=398,al=190,PLe={__name:"index",emits:["module-stats","loading-progress","map-ready"],setup(r,{emit:e}){const t=e,n=tt(null),i=tt(!1),a=tt(jw),o=mg("grassland","grassland-distribution");let s=null,l=!1;const u=Se(()=>T(a.value.core).length?T(a.value.core):Gp),c=Se(()=>P(a.value.distribution).length?P(a.value.distribution):nx),h=Se(()=>L(a.value.age,{nameKeys:["name","age","ageRange","label"],valueKeys:["value","count","num"],unit:"人"}).length?L(a.value.age,{nameKeys:["name","age","ageRange","label"],valueKeys:["value","count","num"],unit:"人"}):i7),f=Se(()=>D(a.value.online).length?D(a.value.online):o7),d=Se(()=>a7),p=Se(()=>mLe),g=Se(()=>[u.value[0]||Gp[0],u.value[1]||Gp[1],u.value[2]||Gp[2]]),v=Se(()=>({title:"牧场分布排行",metricLabel:"牧场",unit:"户",rows:(c.value.length?c.value:_Le).slice(0,8).map(N=>({name:N.name,value:Number(N.value)||0,unit:N.unit||"户"}))})),m=Se(()=>({key:"pasture-core",type:"iconMetric",rows:u.value})),y=Se(()=>({key:"pasture-town",type:"bar",variant:"distribution",rows:c.value.slice(0,7)})),_=Se(()=>({key:"pasture-age",type:"column",variant:"slim",rows:h.value})),x=Se(()=>({key:"pasture-gender",type:"donut",variant:"ring",rows:d.value})),S=Se(()=>({key:"pasture-online",type:"line",rows:f.value})),A=Se(()=>({key:"pasture-resource",type:"structure",rows:vLe})),w=Se(()=>({key:"pasture-balance",type:"bar",rows:gLe})),M=Se(()=>({key:"pasture-warning",type:"heat",rows:yLe}));Ko(()=>{t("module-stats",{moduleKey:"pasture-management",items:r7}),b(),C()}),uo(()=>{var N,R;l=!0,(R=(N=n.value)==null?void 0:N.destroyMap)==null||R.call(N)});function C(){return Ge(this,null,function*(){try{const N=yield cLe();if(l)return;a.value=Re(Re({},jw),N)}catch(N){a.value=jw}})}function b(){var R,F,O;s=new _g,t("loading-progress",{progress:0}),(F=(R=s.instance)==null?void 0:R.on)==null||F.call(R,"onProgress",(V,H,Q)=>{t("loading-progress",{progress:Math.floor(H/(Q||1)*100),path:V,itemsLoaded:H,itemsTotal:Q})});const N=(V=0)=>Ge(this,null,function*(){var Q,W;if(l)return;yield no();const H=n.value;if((Q=H==null?void 0:H.loadMap)==null||Q.call(H,s),H!=null&&H.canvasMap){i.value=!0,t("loading-progress",{progress:100}),t("map-ready"),(W=H.play)==null||W.call(H);return}if(V<24){window.setTimeout(()=>N(V+1),120);return}i.value=!0,t("map-ready")});(O=s.ready)==null||O.then(N).catch(()=>{i.value=!0,t("map-ready")})}function T(N=[]){return(Array.isArray(N)?N:[]).map((R,F)=>{const O=R.name||R.title||R.label||R.zh,V=E(R,["value","num","count","dataValue"]);return!O||V===void 0||V===null||V===""?null:{key:R.key||R.id||O,name:O,value:Number(V)||0,unit:R.unit||R.dw||"",icon:R.icon||["town","area","yield","rate"][F%4]}}).filter(Boolean).slice(0,4)}function P(N=[]){return(Array.isArray(N)?N:[]).map(R=>{const F=E(R,["areaName","name","townName","zoneName"]),O=E(R,["value","count","num","pastureCount","muhuCount"]);return!F||O===void 0||O===null||O===""?null:{key:R.code||R.areaCode||F,name:F,value:Number(O)||0,unit:"户"}}).filter(Boolean).sort((R,F)=>F.value-R.value)}function D(N=[]){return(Array.isArray(N)?N:[]).map(R=>{const F=E(R,["areaName","name","townName","zoneName"]),O=E(R,["onlinePercent","value","percent","rate"]);return!F||O===void 0||O===null||O===""?null:{key:R.code||R.areaCode||F,name:F,value:Number(String(O).replace("%",""))||0,unit:"%"}}).filter(Boolean).slice(0,7)}function L(N=[],R={}){const{nameKeys:F=["name"],valueKeys:O=["value"],unit:V=""}=R;return(Array.isArray(N)?N:[]).map(H=>{const Q=E(H,F),W=E(H,O);return!Q||W===void 0||W===null||W===""?null:{key:H.key||H.id||Q,name:Q,value:Number(W)||0,unit:H.unit||V}}).filter(Boolean)}function E(N={},R=[]){for(const F of R){const O=N==null?void 0:N[F];if(O!=null&&O!=="")return O}}function I(N){const R=Number(N);return Number.isFinite(R)?R.toLocaleString("zh-CN",{maximumFractionDigits:Number.isInteger(R)?0:2}):"--"}return(N,R)=>(ie(),oe("div",xLe,[$e(yg,{ref_key:"mapSceneRef",ref:n,class:"pasture-map-scene","active-layer":_n(o),"map-ranking":v.value},null,8,["active-layer","map-ranking"]),R[1]||(R[1]=G("div",{class:"pasture-map-scrim"},null,-1)),i.value?Tt("",!0):(ie(),oe("div",SLe,"3D地图加载中")),G("div",ALe,[G("div",wLe,[G("div",bLe,[$e(tn,{class:"pasture-side-card left-card",title:"牧场核心指标",width:il,height:al},{default:Xt(()=>[$e(Si,{panel:m.value,compact:""},null,8,["panel"])]),_:1}),$e(tn,{class:"pasture-side-card left-card",title:"乡镇牧场分布",width:il,height:al},{default:Xt(()=>[$e(Si,{panel:y.value,compact:""},null,8,["panel"])]),_:1}),$e(tn,{class:"pasture-side-card left-card",title:"牧户年龄结构",width:il,height:al},{default:Xt(()=>[$e(Si,{panel:_.value,compact:""},null,8,["panel"])]),_:1}),$e(tn,{class:"pasture-side-card left-card",title:"牧户性别占比",width:il,height:al},{default:Xt(()=>[$e(Si,{panel:x.value,compact:""},null,8,["panel"])]),_:1})])]),G("section",TLe,[R[0]||(R[0]=G("div",{class:"pasture-center-title"},[G("span",null,"Pasture Management"),G("strong",null,"牧场管理")],-1)),G("div",MLe,[(ie(!0),oe(it,null,vt(g.value,F=>(ie(),oe("div",{key:F.key,class:"pasture-center-metric"},[G("span",null,Te(F.name),1),G("strong",null,[Zn(Te(I(F.value)),1),G("em",null,Te(F.unit),1)])]))),128))])]),G("div",CLe,[G("div",ELe,[$e(tn,{class:"pasture-side-card right-card",title:"牧户在线率",width:il,height:al},{default:Xt(()=>[$e(Si,{panel:S.value,compact:""},null,8,["panel"])]),_:1}),$e(tn,{class:"pasture-side-card right-card",title:"牧场资源画像",width:il,height:al},{default:Xt(()=>[$e(Si,{panel:A.value,compact:""},null,8,["panel"])]),_:1}),$e(tn,{class:"pasture-side-card right-card",title:"草畜平衡状态",width:il,height:al},{default:Xt(()=>[$e(Si,{panel:w.value,compact:""},null,8,["panel"])]),_:1}),$e(tn,{class:"pasture-side-card right-card",title:"牧场服务预警",width:il,height:al},{default:Xt(()=>[$e(Si,{panel:M.value,compact:""},null,8,["panel"])]),_:1})])]),G("div",LLe,[(ie(!0),oe(it,null,vt(p.value,F=>(ie(),oe("div",{key:F.key,class:"pasture-status-item"},[G("span",null,Te(F.name),1),G("strong",null,[Zn(Te(I(F.value)),1),G("em",null,Te(F.unit),1)]),G("small",null,Te(F.extra),1)]))),128))])])]))}},rx="/openApi";function RLe(r,e){return/^https?:\/\//.test(e)?e:`${r}${e.startsWith("/")?e:`/${e}`}`}function ix(r,e,t,n={}){return Bs(RLe(r,e),{params:t,timeout:n.timeout}).then(DLe)}function DLe(r){if((r==null?void 0:r.success)===!1||(r==null?void 0:r.code)!==void 0&&![0,200,"0","200"].includes(r.code)){const t=new Error((r==null?void 0:r.msg)||(r==null?void 0:r.message)||"接口请求失败");throw t.code=r==null?void 0:r.code,t}return Lt(r)}function ILe(r,e=window.location.hash||window.location.pathname,t="智慧管理"){return ix(rx,"/ai/stat/question",{question:r,pagePath:e,pageName:t},{timeout:45e3})}function NLe(r){return ix(rx,"/ai/balance/targets",{question:r},{timeout:18e3}).then(e=>Array.isArray(e)?e:(e==null?void 0:e.rows)||(e==null?void 0:e.list)||[])}function kLe({areaCode:r,pasturesId:e}={}){return ix(rx,"/ai/balance/advice",{areaCode:r,pasturesId:e},{timeout:18e3})}function OLe(){return ix(rx,"/ai/balance/welcome",void 0,{timeout:12e3})}const FLe="/openApi";function BLe(r){return/^https?:\/\//.test(r)?r:`${FLe}${r.startsWith("/")?r:`/${r}`}`}function zLe(r){if((r==null?void 0:r.success)===!1||(r==null?void 0:r.code)!==void 0&&![0,200,"0","200"].includes(r.code)){const t=new Error((r==null?void 0:r.msg)||(r==null?void 0:r.message)||"图表接口请求失败");throw t.code=r==null?void 0:r.code,t}return Lt(r)}function ULe(n){return Ge(this,arguments,function*(r,e=window.location.hash||window.location.pathname,t="智慧管理"){const i=yield Bs(BLe("/ai/stat/charts"),{params:{question:r,pagePath:e,pageName:t},timeout:3e4}).then(zLe);return(Array.isArray(i==null?void 0:i.charts)?i.charts:[]).map(VLe).filter(o=>o.rows.length)})}function VLe(r,e){const t=Array.isArray(r==null?void 0:r.rows)?r.rows:[];return{id:(r==null?void 0:r.id)||`smart-chart-${e}`,type:GLe(r==null?void 0:r.type),title:(r==null?void 0:r.title)||`统计图表${e+1}`,subtitle:(r==null?void 0:r.subtitle)||HLe(r==null?void 0:r.source),unit:(r==null?void 0:r.unit)||"",source:(r==null?void 0:r.source)||{},rows:t.map((n,i)=>({key:(n==null?void 0:n.key)||`${(n==null?void 0:n.name)||"row"}-${i}`,name:String((n==null?void 0:n.name)||`指标${i+1}`),value:WLe(n==null?void 0:n.value),rawValue:n==null?void 0:n.value,unit:(n==null?void 0:n.unit)||(r==null?void 0:r.unit)||"",extra:(n==null?void 0:n.extra)||""})).filter(n=>n.name&&Number.isFinite(n.value))}}function GLe(r){return["pie","donut"].includes(r)?"pie":["line","trend"].includes(r)?"line":"bar"}function HLe(r={}){const e=r.table?`来源:${r.table}`:"来源:openApi 统计库",t=r.period?`,${r.period}`:"";return`${e}${t}`}function WLe(r){if(r==null||r==="")return NaN;const e=Number(String(r).replace(/,/g,"").replace(/%/g,""));return Number.isFinite(e)?e:NaN}const $Le={class:"wisdom-management"},XLe={class:"wisdom-chat"},YLe={key:0,class:"wisdom-empty-state"},qLe={class:"wisdom-prompt-grid"},jLe=["disabled","onClick"],KLe={key:0,class:"wisdom-message-mark"},ZLe={class:"wisdom-bubble"},QLe={key:0,class:"wisdom-steps"},JLe={key:1,class:"wisdom-digesting"},ePe={key:2,class:"wisdom-chart-list"},tPe={key:3,class:"wisdom-insight-list"},nPe=["innerHTML"],rPe={key:5,class:"wisdom-stream-caret"},iPe={key:6,class:"wisdom-suggestion-list"},aPe=["disabled","onClick"],oPe={key:7,class:"wisdom-choice-list"},sPe=["disabled","onClick"],lPe={class:"wisdom-input-shell"},uPe=["disabled"],cPe=["disabled"],hPe={key:0,class:"wisdom-button-loading"},fPe={__name:"index",setup(r){const e=_7({loader:()=>x7(()=>import("./SmartChartRenderer-8df650d8-1782613078975.js"),["./SmartChartRenderer-8df650d8-1782613078975.js","./index-1782613078975.js","./index-b8a77371-balabala-1782613078975.css","./SmartChartRenderer-8fd37aa6-balabala-1782613078975.css"],import.meta.url),loadingComponent:{template:'
正在绘制统计图表
'}}),t=tt(""),n=tt([]),i=tt(!1),a=tt(null),o=tt("可以直接询问牦牛数量、草地面积、牧户情况、饲草产量、林地面积、基地分布、畜群结构和交易流通等统计问题。"),s=[{label:"牦牛分布",question:"牦牛分布"},{label:"畜群结构",question:"牦牛结构占比"},{label:"草地面积",question:"草地面积分布"},{label:"草畜平衡",question:"红原县草畜平衡建议"},{label:"湿地类型",question:"湿地类型结构"},{label:"公益林保护",question:"公益林保护等级统计"}];let l=null;Ko(()=>{OLe().then(N=>{const R=(N==null?void 0:N.value)||(N==null?void 0:N.text)||N;typeof R=="string"&&R.trim()&&(o.value=R)}).catch(()=>{})}),uo(()=>{T()});function u(){return`${Date.now()}-${Math.random().toString(16).slice(2)}`}function c(){return Ge(this,arguments,function*(N=t.value){const R=String(N||"").trim();if(!R||i.value)return;const F={id:u(),role:"user",text:R},O={id:u(),role:"assistant",steps:[`正在理解:${R}`],digesting:!0,digestText:"小牧正在匹配业务数据",visibleText:"",fullText:"",streaming:!1,choices:[],charts:[],insights:[],suggestions:[]};if(n.value=[...n.value,F,O],t.value="",i.value=!0,yield E(),g(R)){yield f(R,O.id);return}yield h(R,O.id)})}function h(N,R){return Ge(this,null,function*(){w(R,{digestText:"正在理解问题并查询统计库"});const F=ILe(N,window.location.hash||window.location.pathname,"智慧管理"),O=ULe(N,window.location.hash||window.location.pathname,"智慧管理"),[V,H]=yield Promise.allSettled([F,O]),Q=H.status==="fulfilled"?H.value||[]:[],W=H.status==="rejected"?H.reason:null;if(V.status==="fulfilled"){const Z=V.value,ee=(Z==null?void 0:Z.answer)||"小牧暂时没有查到相关统计数据,可以换一种说法再问一次。",he=[`正在理解:${N}`,"已查询统计库","已生成统计回答"];Q.length?he.push(`已生成 ${Q.length} 个数据图表`):W&&he.push("图表生成暂时不可用"),w(R,{digesting:!1,steps:he,insights:Q.length?S(Q):[],suggestions:A(N,Q),allowFollowUp:!0}),b(R,W?`${ee} **图表状态** - ${C(W,"图表接口暂时不可用,已先返回文字分析。")}`:ee,Q);return}if(Q.length){w(R,{digesting:!1,steps:[`正在理解:${N}`,"已查询统计库",`已生成 ${Q.length} 个数据图表`,"文字分析暂时不可用"],insights:S(Q),suggestions:A(N,Q),allowFollowUp:!0}),b(R,"文字分析服务暂时没有返回结果,已按统计库真实数据生成可视化图表。",Q);return}M(R,C(V.reason,"小牧暂时没有获取到统计结果,请稍后再试。"))})}function f(N,R){return Ge(this,null,function*(){w(R,{digestText:"正在检索草畜平衡对象"});try{const F=yield NLe(N),O=v(F);if(!O.length){w(R,{digesting:!1,steps:[`正在理解:${N}`,"未匹配到草畜平衡对象"]}),b(R,"暂时没有匹配到对应的区域或牧户。可以输入更明确的乡镇、村名、牧户或牧场名称,例如“红原县草畜平衡建议”。");return}if(O.length>1){w(R,{digesting:!1,steps:[`正在理解:${N}`,"已匹配多个对象,请选择一个继续"],choices:O.slice(0,8)}),i.value=!1;return}yield p(O[0],R)}catch(F){M(R,C(F,"草畜平衡对象检索失败,请稍后再试。"))}})}function d(N){return Ge(this,null,function*(){if(i.value)return;const R=N.name||N.label||"草畜平衡建议",F={id:u(),role:"user",text:R},O={id:u(),role:"assistant",steps:[`已选择:${R}`],digesting:!0,digestText:"正在消化草畜平衡数据",visibleText:"",fullText:"",streaming:!1,choices:[],charts:[],insights:[],suggestions:[]};n.value=[...n.value,F,O],i.value=!0,yield E(),yield p(N,O.id)})}function p(N,R){return Ge(this,null,function*(){const F=(N==null?void 0:N.name)||(N==null?void 0:N.label)||"该区域",O=m(N);w(R,{steps:[`已锁定:${F}`,"正在消化草畜平衡数据"],digestText:"正在生成平衡建议"});try{const V=yield kLe(O);w(R,{digesting:!1,steps:[`已锁定:${F}`,"已生成草畜平衡建议"]}),b(R,y(F,V||{}))}catch(V){M(R,C(V,"小牧刚才没有消化成功,请稍后再问一次。"))}})}function g(N){return/草畜|平衡|承载|载畜|超载|放牧压力|轮牧|休牧|牧场建议|牧户建议/.test(N)}function v(N=[]){return N.map((R,F)=>({key:(R==null?void 0:R.key)||(R==null?void 0:R.type)||"area_code",value:(R==null?void 0:R.value)||(R==null?void 0:R.id)||(R==null?void 0:R.code)||(R==null?void 0:R.areaCode)||(R==null?void 0:R.pasturesId),name:(R==null?void 0:R.name)||(R==null?void 0:R.label)||(R==null?void 0:R.areaName)||(R==null?void 0:R.pasturesName)||`对象${F+1}`,raw:R})).filter(R=>R.value||R.name==="红原县")}function m(N){return(N==null?void 0:N.key)==="pasturesId"||(N==null?void 0:N.key)==="pastures_id"?{pasturesId:N.value}:{areaCode:(N==null?void 0:N.value)||"513233"}}function y(N,R={}){const F=_(R,["areaRange","arearange","area_range","area","acreage"],0),O=_(R,["yakNumber","yaknumber","yak_number","livestock_capacity","livestockCapacity","livestockcapacity"],0),V=_(R,["level","conclusion"],"暂无等级"),H=_(R,["overloadRate","overloadrate","overload_rate"],0),Q=_(R,["advice","balanceAdvice","balanceadvice","balance_advice"],"暂无建议,请稍后再试。");return`**${N}草畜平衡建议** - 草地面积:${x(F)} 亩 - 牦牛/载畜量:${x(O)} 头 - 草畜平衡等级:${V} - 超载率:${x(H)}% **建议** ${Q}`}function _(N,R,F=""){for(const O of R){const V=N==null?void 0:N[O];if(V!=null&&V!=="")return V}return F}function x(N){const R=Number(String(N).replace(/,/g,""));return Number.isFinite(R)?R.toLocaleString("zh-CN",{maximumFractionDigits:2}):N||"--"}function S(N=[]){const R=[];return N.slice(0,2).forEach(F=>{var he;const O=(F.rows||[]).map(le=>Xe(Re({},le),{value:Number(le.value)})).filter(le=>le.name&&Number.isFinite(le.value));if(!O.length)return;const V=F.unit||((he=O.find(le=>le.unit))==null?void 0:he.unit)||"",H=O.slice().sort((le,re)=>re.value-le.value),Q=O.reduce((le,re)=>le+re.value,0),W=Q/O.length,Z=H[0],ee=H[H.length-1];R.push({label:"最高",value:`${Z.name} ${x(Z.value)}${V}`,note:F.title}),O.length>2&&R.push({label:F.type==="pie"?"占比项":"最低",value:`${ee.name} ${x(ee.value)}${V}`,note:F.type==="pie"?"最小结构项":"低值区域"}),R.push({label:"合计",value:`${x(Q)}${V}`,note:O.length>1?`覆盖 ${O.length} 项`:F.title}),F.type!=="pie"&&O.length>1&&R.push({label:"均值",value:`${x(W)}${V}`,note:"按当前图表项计算"})}),R.slice(0,4)}function A(N,R=[]){const F=String(N||""),O=[],V=(H,Q)=>{!O.some(W=>W.question===Q)&&Q!==F&&O.push({label:H,question:Q})};return(/牦牛|畜群|存栏|牛/.test(F)||R.some(H=>{var Q,W;return(W=(Q=H.source)==null?void 0:Q.localKey)==null?void 0:W.includes("yak")}))&&(V("看畜群结构","牦牛结构占比"),V("看存栏预测","牦牛存栏预测"),V("看交易结构","牦牛交易结构")),/草地|草原|饲草|鲜草/.test(F)&&(V("看草地健康","草地健康占比"),V("看生产力","草地生产力分布"),V("看退化统计","草地退化统计")),/湿地/.test(F)&&(V("看湿地类型","湿地类型结构"),V("看湿地级别","湿地级别面积统计")),/林地|公益林|森林/.test(F)&&(V("看权属结构","林地权属结构"),V("看公益林等级","公益林保护等级统计")),/草畜|平衡|承载|载畜/.test(F)&&(V("看牦牛分布","牦牛分布"),V("看草地面积","草地面积分布")),V("换个图表",`${F} 图表`),O.slice(0,3)}function w(N,R,F=!0){n.value=n.value.map(O=>O.id===N?Re(Re({},O),R):O),F&&E()}function M(N,R){w(N,{digesting:!1,steps:["请求已结束"]}),b(N,R)}function C(N,R){const F=String((N==null?void 0:N.message)||"");return(N==null?void 0:N.code)===401||(N==null?void 0:N.code)==="401"||(N==null?void 0:N.code)==="HTTP_401"||/未登录|授权|Unauthorized|HTTP 401/i.test(F)?"接口需要登录授权。当前智慧管理不会使用假数据,请先完成平台登录或使用 openApi 统计库口径继续问数。":(N==null?void 0:N.code)==="REQUEST_TIMEOUT"||/timeout|timed out|超时/i.test(F)?"服务响应时间较长,请稍后再试,或换一个更具体的问题。":(N==null?void 0:N.code)==="REQUEST_ABORTED"||/aborted|abort|signal/i.test(F)?"本次请求被中断了,请重新发送一次。":/Failed to fetch|NetworkError|Load failed|HTTP 50|HTTP 40/i.test(F)||/[a-zA-Z]{4,}/.test(F)?R:F||R}function b(N,R,F=[]){T();const O=String(R||""),V=O.length>1200?36:O.length>700?24:14;let H=0;const Q=F.length>0;w(N,{fullText:O,visibleText:"",streaming:!0,choices:[],charts:F}),Q&&I();const W=()=>{if(H=Math.min(H+V,O.length),w(N,{visibleText:O.slice(0,H),streaming:H=O.length){l=null,F.length&&w(N,{charts:F},!1),i.value=!1;return}l=window.setTimeout(W,18)};l=window.setTimeout(W,0)}function T(){l&&(window.clearTimeout(l),l=null)}function P(N){const R=L(N).split(/\r?\n/),F=[];let O=[],V=!1;const H=()=>{O.length&&(F.push(`<${V?"ol":"ul"}>${O.map(Q=>`
  • ${D(Q)}
  • `).join("")}`),O=[],V=!1)};return R.forEach(Q=>{const W=Q.trim();if(!W){H();return}const Z=W.match(/^#{1,4}\s+(.+)$/)||W.match(/^\*\*(.+)\*\*$/);if(Z){H(),F.push(`

    ${D(Z[1])}

    `);return}const ee=W.match(/^\d+[.)、]\s+(.+)$/),he=W.match(/^[-*]\s+(.+)$/);if(ee||he){const le=!!ee;O.length&&V!==le&&H(),V=le,O.push(ee?ee[1]:he[1]);return}H(),F.push(`

    ${D(W)}

    `)}),H(),F.join("")}function D(N){return N.replace(/\*\*([^*]+)\*\*/g,"$1")}function L(N){return String(N||"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function E(){return Ge(this,null,function*(){yield no(),window.requestAnimationFrame(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})})}function I(){return Ge(this,null,function*(){yield no(),window.requestAnimationFrame(()=>{const N=a.value,R=N==null?void 0:N.querySelector(".wisdom-message.is-assistant:last-child .wisdom-chart-list");if(!N||!R)return;const F=N.getBoundingClientRect(),O=R.getBoundingClientRect();N.scrollTop+=O.top-F.top-12})})}return(N,R)=>(ie(),oe("div",$Le,[R[11]||(R[11]=fc('',1)),G("main",XLe,[G("div",{ref_key:"dialogueRef",ref:a,class:Vt(["wisdom-dialogue",{"is-empty":!n.value.length}])},[n.value.length?Tt("",!0):(ie(),oe("section",YLe,[R[3]||(R[3]=G("div",{class:"wisdom-empty-mark"},[G("span"),G("strong",null,"AI")],-1)),R[4]||(R[4]=G("h2",null,"智慧管理问答",-1)),G("p",null,Te(o.value),1),G("div",qLe,[(ie(),oe(it,null,vt(s,F=>G("button",{key:F.question,type:"button",disabled:i.value,onClick:O=>c(F.question)},Te(F.label),9,jLe)),64))])])),(ie(!0),oe(it,null,vt(n.value,F=>{var O,V,H,Q,W;return ie(),oe("article",{key:F.id,class:Vt(["wisdom-message",`is-${F.role}`])},[F.role==="assistant"?(ie(),oe("div",KLe,[...R[5]||(R[5]=[G("span",null,"牧",-1)])])):Tt("",!0),G("div",ZLe,[F.role==="user"?(ie(),oe(it,{key:0},[Zn(Te(F.text),1)],64)):(ie(),oe(it,{key:1},[(O=F.steps)!=null&&O.length?(ie(),oe("div",QLe,[(ie(!0),oe(it,null,vt(F.steps,Z=>(ie(),oe("div",{key:Z,class:"wisdom-step"},[R[6]||(R[6]=G("span",null,null,-1)),Zn(Te(Z),1)]))),128))])):Tt("",!0),F.digesting?(ie(),oe("div",JLe,[R[7]||(R[7]=G("span",null,null,-1)),R[8]||(R[8]=G("span",null,null,-1)),R[9]||(R[9]=G("span",null,null,-1)),G("em",null,Te(F.digestText||"小牧正在消化中"),1)])):Tt("",!0),(V=F.charts)!=null&&V.length?(ie(),oe("div",ePe,[(ie(!0),oe(it,null,vt(F.charts,Z=>(ie(),Ji(_n(e),{key:Z.id,chart:Z,onReady:E},null,8,["chart"]))),128))])):Tt("",!0),(H=F.insights)!=null&&H.length?(ie(),oe("div",tPe,[(ie(!0),oe(it,null,vt(F.insights,Z=>(ie(),oe("div",{key:`${Z.label}-${Z.value}`,class:"wisdom-insight-item"},[G("span",null,Te(Z.label),1),G("strong",null,Te(Z.value),1),G("em",null,Te(Z.note),1)]))),128))])):Tt("",!0),F.visibleText?(ie(),oe("div",{key:4,class:"wisdom-answer",innerHTML:P(F.visibleText)},null,8,nPe)):Tt("",!0),F.streaming?(ie(),oe("span",rPe)):Tt("",!0),(Q=F.suggestions)!=null&&Q.length&&(F.allowFollowUp||!F.digesting&&!F.streaming)?(ie(),oe("div",iPe,[(ie(!0),oe(it,null,vt(F.suggestions,Z=>(ie(),oe("button",{key:Z.question,type:"button",disabled:i.value,onClick:ee=>c(Z.question)},Te(Z.label),9,aPe))),128))])):Tt("",!0),(W=F.choices)!=null&&W.length?(ie(),oe("div",oPe,[(ie(!0),oe(it,null,vt(F.choices,(Z,ee)=>(ie(),oe("button",{key:`${Z.key||"choice"}-${Z.value||ee}`,type:"button",disabled:i.value,onClick:he=>d(Z)},Te(Z.name||Z.label||Z.value),9,sPe))),128))])):Tt("",!0)],64))])],2)}),128))],2),G("form",{class:"wisdom-input-bar",onSubmit:R[2]||(R[2]=Nc(F=>c(),["prevent"]))},[G("div",lPe,[R[10]||(R[10]=G("span",{class:"wisdom-input-icon"},null,-1)),ul(G("input",{"onUpdate:modelValue":R[0]||(R[0]=F=>t.value=F),disabled:i.value,autocomplete:"off",placeholder:"输入牧户、区域或草畜平衡问题",onKeydown:R[1]||(R[1]=Kw(Nc(F=>c(),["prevent"]),["enter"]))},null,40,uPe),[[JB,t.value]]),G("button",{type:"submit",disabled:i.value||!t.value.trim()},[i.value?(ie(),oe("span",hPe)):Tt("",!0),G("span",null,Te(i.value?"消化中":"发送"),1)],8,cPe)])],32)])]))}},X_=[{key:"home",label:"首页",bottomLabel:"核心指标",status:"ready"},{key:"forest-grass-wet",label:"林草湿一张图",bottomLabel:"林草湿",status:"ready"},{key:"ecological-protection",label:"生态保护",bottomLabel:"生态保护",status:"ready"},{key:"grass-livestock-balance",label:"草畜平衡",bottomLabel:"草畜平衡",status:"coming"},{key:"yak-management",label:"牦牛管理",bottomLabel:"牦牛管理",status:"ready"},{key:"pasture-management",label:"牧场管理",bottomLabel:"牧场管理",status:"ready"},{key:"yak-industry-chain",label:"牦牛产业全链",bottomLabel:"产业全链",status:"coming"},{key:"smart-management",label:"智慧管理",bottomLabel:"智慧管理",status:"ready"}];function dPe(r){return X_.find(e=>e.key===r)||X_[1]}const pPe={key:0,class:"platform-module-pane"},vPe={key:1,class:"platform-module-pane"},gPe={key:2,class:"platform-module-pane"},mPe={key:3,class:"platform-module-pane"},yPe={key:4,class:"platform-module-pane"},_Pe={key:5,class:"platform-module-pane"},xPe={class:"large-screen-wrap"},SPe={class:"m-header-date"},APe={class:"top-menu"},wPe={key:0,class:"top-menu-mid-space"},bPe={key:1,class:"module-coming"},TPe={class:"module-coming-title"},MPe={key:2,class:"bottom-tray"},CPe={class:"bottom-menu"},EPe=["onClick"],LPe={key:6,class:"loading platform-loading"},PPe={class:"loading-progress"},RPe={class:"value"},DPe=1200,IPe={__name:"index",setup(r){const e=tt("home"),t=tt("national-park"),n=tt({home:!0}),i=tt({}),a=tt(""),o=tt(""),s=tt(!0),l=tt(0);let u=null,c=null,h=!1;const f=Date.now(),d={progress:0},p=["xiaoshoujine","zongxiaoliang","xiaoshoujine","zongxiaoliang"],g=Se(()=>dPe(e.value)),v=Se(()=>e.value==="ecological-protection"?Xie:X_),m=Se(()=>e.value==="ecological-protection"?t.value:e.value),y=Se(()=>{const E=i.value[e.value];return E!=null&&E.length?E:T([{zh:"草地总面积",en:"",value:756.43,unit:"万亩",decimals:2},{zh:"林地总面积",en:"",value:177.92,unit:"万亩",decimals:2},{zh:"湿地面积",en:"",value:291.82,unit:"万亩",decimals:2}])});Ko(()=>{c=Y_.init({dh:1080,dw:1920,el:"#large-screen",resize:!0}),L(),D(),u=window.setInterval(D,1e3)}),uo(()=>{var E;u&&window.clearInterval(u),(E=c==null?void 0:c.off)==null||E.call(c,"#large-screen"),$n.killTweensOf(d)});function _(E){P(E),e.value=E,no(L)}function x(E){if(e.value==="ecological-protection"){S(E.key),no(L);return}_(E.key)}function S(E){t.value=E==="restoration"?"restoration":"national-park",no(L)}function A(E){const I=E.moduleKey||(E.topicKey?"forest-grass-wet":e.value);i.value=Xe(Re({},i.value),{[I]:T(E.items||[])})}function w(E={}){const I=typeof E=="number"?E:E.progress;C(I)}function M(){$n.killTweensOf(d),d.progress=100,l.value=100;const E=Date.now()-f,I=Math.max(180,DPe-E);window.setTimeout(b,I)}function C(E){if(!s.value)return;const I=Math.max(0,Math.min(100,Math.floor(Number(E)||0)));I{l.value=Math.floor(d.progress)}})}function b(){if(!s.value||h)return;h=!0;const E=$n.timeline({onComplete:()=>{s.value=!1}});E.to(".platform-loading .loading-text span",{y:"200%",opacity:0,ease:"power4.inOut",duration:1.4,stagger:.14}),E.to(".platform-loading .loading-progress",{opacity:0,ease:"power4.inOut",duration:1.2},"<"),E.to(".platform-loading",{opacity:0,ease:"power4.inOut",duration:.8},"-=0.55")}function T(E=[]){return E.slice(0,4).map((I,N)=>{var O;const R=Number(I.value)||0,F={zh:I.zh||I.name||`指标${N+1}`,en:I.en||"",value:R,unit:I.unit||"",decimals:(O=I.decimals)!=null?O:Number.isInteger(R)?0:2};return Re({icon:p[N%p.length]},F)})}function P(E){["home","forest-grass-wet","ecological-protection","yak-management","pasture-management","smart-management"].includes(E)&&(n.value[E]||(n.value=Xe(Re({},n.value),{[E]:!0})))}function D(){const E=new Date,I=N=>`${N}`.padStart(2,"0");a.value=`${E.getFullYear()}-${I(E.getMonth()+1)}-${I(E.getDate())}`,o.value=`${I(E.getHours())}:${I(E.getMinutes())}:${I(E.getSeconds())}`}function L(){window.scrollTo(0,0),document.documentElement.scrollTop=0,document.body.scrollTop=0;const E=document.querySelector("#app");E&&(E.scrollTop=0)}return(E,I)=>(ie(),oe("div",{class:Vt(["large-screen platform-screen",{"is-home":g.value.key==="home","is-forest-grass-wet":g.value.key==="forest-grass-wet","is-ecological-protection":g.value.key==="ecological-protection","is-yak-management":g.value.key==="yak-management","is-pasture-management":g.value.key==="pasture-management","is-smart-management":g.value.key==="smart-management"}]),id:"large-screen"},[n.value.home?ul((ie(),oe("div",pPe,[$e(Fre,{onLoadingProgress:w,onMapReady:M,onModuleStats:A})],512)),[[ih,g.value.key==="home"]]):Tt("",!0),n.value["forest-grass-wet"]?ul((ie(),oe("div",vPe,[$e($ie,{"show-loading":!1,onTopicStats:A})],512)),[[ih,g.value.key==="forest-grass-wet"]]):Tt("",!0),n.value["ecological-protection"]?ul((ie(),oe("div",gPe,[$e(bae,{"active-view":t.value,"show-loading":!1,onModuleStats:A,onViewChange:S},null,8,["active-view"])],512)),[[ih,g.value.key==="ecological-protection"]]):Tt("",!0),n.value["yak-management"]?ul((ie(),oe("div",mPe,[$e(rLe,{onModuleStats:A})],512)),[[ih,g.value.key==="yak-management"]]):Tt("",!0),n.value["pasture-management"]?ul((ie(),oe("div",yPe,[$e(PLe,{onLoadingProgress:w,onMapReady:M,onModuleStats:A})],512)),[[ih,g.value.key==="pasture-management"]]):Tt("",!0),n.value["smart-management"]?ul((ie(),oe("div",_Pe,[$e(fPe)],512)),[[ih,g.value.key==="smart-management"]]):Tt("",!0),G("div",xPe,[$e(r$,{title:"红原县数字畜牧业监管平台","sub-text":"Hongyuan Digital Animal Husbandry Supervision Platform"},{right:Xt(()=>[G("div",SPe,[G("span",null,Te(a.value),1),G("span",null,Te(o.value),1)])]),_:1}),G("div",APe,[$e(a$,{"default-active":e.value,onSelect:_},{default:Xt(()=>[(ie(!0),oe(it,null,vt(_n(X_),(N,R)=>(ie(),oe(it,{key:N.key},[$e(o$,{index:N.key},{default:Xt(()=>[Zn(Te(N.label),1)]),_:2},1032,["index"]),R===3?(ie(),oe("div",wPe)):Tt("",!0)],64))),128))]),_:1},8,["default-active"])]),g.value.key!=="smart-management"?(ie(),oe("div",{key:0,class:Vt(["top-count-card",{"is-four":y.value.length>3}])},[(ie(!0),oe(it,null,vt(y.value,N=>(ie(),Ji(g$,{key:N.zh,info:N},null,8,["info"]))),128))],2)):Tt("",!0),g.value.status!=="ready"?(ie(),oe("div",bPe,[G("div",TPe,Te(g.value.label),1),I[0]||(I[0]=G("div",{class:"module-coming-text"},"模块建设中,平台框架已预留入口",-1))])):Tt("",!0),["home","forest-grass-wet","ecological-protection","yak-management","pasture-management","smart-management"].includes(g.value.key)?Tt("",!0):(ie(),oe("div",MPe,[$e(E0,{class:"bottom-svg-line-left",width:721,height:57,color:"#30DCFF",strokeWidth:2,dir:[0,1],length:50,path:"M1 56.6105C1 31.5123 185.586 10.0503 451.904 1.35519C458.942 1.12543 465.781 4.00883 470.505 9.22964L484.991 25.2383C487.971 28.4775 492.938 30.4201 498.254 30.4201H720.142"}),$e(E0,{class:"bottom-svg-line-left bottom-svg-line-right",width:721,height:57,color:"#30DCFF",strokeWidth:2,dir:[0,1],length:50,path:"M1 56.6105C1 31.5123 185.586 10.0503 451.904 1.35519C458.942 1.12543 465.781 4.00883 470.505 9.22964L484.991 25.2383C487.971 28.4775 492.938 30.4201 498.254 30.4201H720.142"}),I[1]||(I[1]=G("div",{class:"bottom-tray-arrow"},[G("img",{src:_0,alt:""}),G("img",{src:x0,alt:""})],-1)),G("div",CPe,[(ie(!0),oe(it,null,vt(v.value,N=>(ie(),oe("div",{key:N.key,class:Vt(["bottom-menu-item",{"is-active":N.key===m.value}]),onClick:R=>x(N)},[G("span",null,Te(N.bottomLabel),1)],10,EPe))),128))]),I[2]||(I[2]=G("div",{class:"bottom-tray-arrow is-reverse"},[G("img",{src:_0,alt:""}),G("img",{src:x0,alt:""})],-1))])),I[3]||(I[3]=G("div",{class:"large-screen-left-zsline"},null,-1)),I[4]||(I[4]=G("div",{class:"large-screen-right-zsline"},null,-1))]),s.value?(ie(),oe("div",LPe,[I[6]||(I[6]=fc('
    LOADING
    ',1)),G("div",PPe,[G("span",RPe,Te(l.value),1),I[5]||(I[5]=G("span",{class:"unit"},"%",-1))])])):Tt("",!0)],2))}},WPe=Object.freeze(Object.defineProperty({__proto__:null,default:IPe},Symbol.toStringTag,{value:"Module"}));export{fa as H,Ul as L,WPe as i};